blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
332
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
7
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
557 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
82 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
5.41M
extension
stringclasses
11 values
content
stringlengths
7
5.41M
authors
listlengths
1
1
author
stringlengths
0
161
fbd0c507471e5fd46f2e16bcfefbfdc058787466
074a20c550e1b99fe8963cb173e72d4d62e24028
/base-web/src/test/java/com/example/base/bean/NotInitialization.java
d560177c849fd3a589535c06cd06efde62660822
[ "MIT" ]
permissive
itdebug/base
32768f432ee41ee77ddc4b6642893af8f4e48144
680dbb25db48935f54c8eaafb4b3a8125002b270
refs/heads/master
2022-05-03T12:14:24.023150
2019-04-25T05:25:37
2019-04-25T05:25:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
package com.example.base.bean; /** * @author lrk * @date 2019/4/23下午9:18 */ public class NotInitialization { public static void main(String[] args) { // System.out.println(SubClass.value); // SuperClass[] sca = new SuperClass[10]; System.out.println(ConstantClass.HELLOWORLD); } }
[ "lurongkang@21tb.com" ]
lurongkang@21tb.com
903b970b52f79fe58311aa9024ca272833e7dcf4
20eb62855cb3962c2d36fda4377dfd47d82eb777
/newEvaluatedBugs/Jsoup_24_buggy/mutated/94/Node.java
bfe59dcb2394b08e1a6fdc9658acde9613604a24
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
22,858
java
package org.jsoup.nodes; import org.jsoup.helper.StringUtil; import org.jsoup.helper.Validate; import org.jsoup.parser.Parser; import org.jsoup.select.NodeTraversor; import org.jsoup.select.NodeVisitor; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; /** The base, abstract Node model. Elements, Documents, Comments etc are all Node instances. @author Jonathan Hedley, jonathan@hedley.net */ public abstract class Node implements Cloneable { Node parentNode; List<Node> childNodes; Attributes attributes; String baseUri; int siblingIndex; /** Create a new Node. @param baseUri base URI @param attributes attributes (not null, but may be empty) */ protected Node(String baseUri, Attributes attributes) { Validate.notNull(baseUri); Validate.notNull(attributes); childNodes = new ArrayList<Node>(4); this.baseUri = baseUri.trim(); this.attributes = attributes; } protected Node(String baseUri) { this(baseUri, new Attributes()); } /** * Default constructor. Doesn't setup base uri, children, or attributes; use with caution. */ protected Node() { childNodes = Collections.emptyList(); attributes = null; } /** Get the node name of this node. Use for debugging purposes and not logic switching (for that, use instanceof). @return node name */ public abstract String nodeName(); /** * Get an attribute's value by its key. * <p> * To get an absolute URL from an attribute that may be a relative URL, prefix the key with <code><b>abs</b></code>, * which is a shortcut to the {@link #absUrl} method. * </p> * E.g.: * <blockquote><code>String url = a.attr("abs:href");</code></blockquote> * * @param attributeKey The attribute key. * @return The attribute, or empty string if not present (to avoid nulls). * @see #attributes() * @see #hasAttr(String) * @see #absUrl(String) */ public String attr(String attributeKey) { Validate.notNull(attributeKey); if (attributes.hasKey(attributeKey)) return attributes.get(attributeKey); else if (attributeKey.toLowerCase().startsWith("abs:")) return absUrl(attributeKey.substring("abs:".length())); else return ""; } /** * Get all of the element's attributes. * @return attributes (which implements iterable, in same order as presented in original HTML). */ public Attributes attributes() { return attributes; } /** * Set an attribute (key=value). If the attribute already exists, it is replaced. * @param attributeKey The attribute key. * @param attributeValue The attribute value. * @return this (for chaining) */ public Node attr(String attributeKey, String attributeValue) { attributes.put(attributeKey, attributeValue); return this; } /** * Test if this element has an attribute. * @param attributeKey The attribute key to check. * @return true if the attribute exists, false if not. */ public boolean hasAttr(String attributeKey) { Validate.notNull(attributeKey); if (attributeKey.startsWith("abs:")) { String key = attributeKey.substring("abs:".length()); if (attributes.hasKey(key) && !absUrl(key).equals("")) return true; } return attributes.hasKey(attributeKey); } /** * Remove an attribute from this element. * @param attributeKey The attribute to remove. * @return this (for chaining) */ public Node removeAttr(String attributeKey) { Validate.notNull(attributeKey); attributes.remove(attributeKey); return this; } /** Get the base URI of this node. @return base URI */ public String baseUri() { return baseUri; } /** Update the base URI of this node and all of its descendants. @param baseUri base URI to set */ public void setBaseUri(final String baseUri) { Validate.notNull(baseUri); traverse(new NodeVisitor() { public void head(Node node, int depth) { node.baseUri = baseUri; } public void tail(Node node, int depth) { } }); } /** * Get an absolute URL from a URL attribute that may be relative (i.e. an <code>&lt;a href&gt;</code> or * <code>&lt;img src&gt;</code>). * <p> * E.g.: <code>String absUrl = linkEl.absUrl("href");</code> * </p> * <p> * If the attribute value is already absolute (i.e. it starts with a protocol, like * <code>http://</code> or <code>https://</code> etc), and it successfully parses as a URL, the attribute is * returned directly. Otherwise, it is treated as a URL relative to the element's {@link #baseUri}, and made * absolute using that. * </p> * <p> * As an alternate, you can use the {@link #attr} method with the <code>abs:</code> prefix, e.g.: * <code>String absUrl = linkEl.attr("abs:href");</code> * </p> * * @param attributeKey The attribute key * @return An absolute URL if one could be made, or an empty string (not null) if the attribute was missing or * could not be made successfully into a URL. * @see #attr * @see java.net.URL#URL(java.net.URL, String) */ public String absUrl(String attributeKey) { Validate.notEmpty(attributeKey); String relUrl = attr(attributeKey); if (!hasAttr(attributeKey)) { return ""; // nothing to make absolute with } else { URL base; try { try { base = new URL(baseUri); } catch (MalformedURLException e) { // the base is unsuitable, but the attribute may be abs on its own, so try that URL abs = new URL(relUrl); return abs.toExternalForm(); } // workaround: java resolves '//path/file + ?foo' to '//path/?foo', not '//path/file?foo' as desired if (relUrl.startsWith("?")) relUrl = base.getPath() + relUrl; URL abs = new URL(base, relUrl); return abs.toExternalForm(); } catch (MalformedURLException e) { return ""; } } } /** Get a child node by its 0-based index. @param index index of child node @return the child node at this index. Throws a {@code IndexOutOfBoundsException} if the index is out of bounds. */ public Node childNode(int index) { return attributes.get(index); } /** Get this node's children. Presented as an unmodifiable list: new children can not be added, but the child nodes themselves can be manipulated. @return list of children. If no children, returns an empty list. */ public List<Node> childNodes() { return Collections.unmodifiableList(childNodes); } /** * Returns a deep copy of this node's children. Changes made to these nodes will not be reflected in the original * nodes * @return a deep copy of this node's children */ public List<Node> childNodesCopy() { List<Node> children = new ArrayList<Node>(childNodes.size()); for (Node node : childNodes) { children.add(node.clone()); } return children; } /** * Get the number of child nodes that this node holds. * @return the number of child nodes that this node holds. */ public final int childNodeSize() { return childNodes.size(); } protected Node[] childNodesAsArray() { return childNodes.toArray(new Node[childNodeSize()]); } /** Gets this node's parent node. @return parent node; or null if no parent. */ public Node parent() { return parentNode; } /** Gets this node's parent node. Node overridable by extending classes, so useful if you really just need the Node type. @return parent node; or null if no parent. */ public final Node parentNode() { return parentNode; } /** * Gets the Document associated with this Node. * @return the Document associated with this Node, or null if there is no such Document. */ public Document ownerDocument() { if (this instanceof Document) return (Document) this; else if (parentNode == null) return null; else return parentNode.ownerDocument(); } /** * Remove (delete) this node from the DOM tree. If this node has children, they are also removed. */ public void remove() { Validate.notNull(parentNode); parentNode.removeChild(this); } /** * Insert the specified HTML into the DOM before this node (i.e. as a preceding sibling). * @param html HTML to add before this node * @return this node, for chaining * @see #after(String) */ public Node before(String html) { addSiblingHtml(siblingIndex, html); return this; } /** * Insert the specified node into the DOM before this node (i.e. as a preceding sibling). * @param node to add before this node * @return this node, for chaining * @see #after(Node) */ public Node before(Node node) { Validate.notNull(node); Validate.notNull(parentNode); parentNode.addChildren(siblingIndex, node); return this; } /** * Insert the specified HTML into the DOM after this node (i.e. as a following sibling). * @param html HTML to add after this node * @return this node, for chaining * @see #before(String) */ public Node after(String html) { addSiblingHtml(siblingIndex + 1, html); return this; } /** * Insert the specified node into the DOM after this node (i.e. as a following sibling). * @param node to add after this node * @return this node, for chaining * @see #before(Node) */ public Node after(Node node) { Validate.notNull(node); Validate.notNull(parentNode); parentNode.addChildren(siblingIndex + 1, node); return this; } private void addSiblingHtml(int index, String html) { Validate.notNull(html); Validate.notNull(parentNode); Element context = parent() instanceof Element ? (Element) parent() : null; List<Node> nodes = Parser.parseFragment(html, context, baseUri()); parentNode.addChildren(index, nodes.toArray(new Node[nodes.size()])); } /** Wrap the supplied HTML around this node. @param html HTML to wrap around this element, e.g. {@code <div class="head"></div>}. Can be arbitrarily deep. @return this node, for chaining. */ public Node wrap(String html) { Validate.notEmpty(html); Element context = parent() instanceof Element ? (Element) parent() : null; List<Node> wrapChildren = Parser.parseFragment(html, context, baseUri()); Node wrapNode = wrapChildren.get(0); if (wrapNode == null || !(wrapNode instanceof Element)) // nothing to wrap with; noop return null; Element wrap = (Element) wrapNode; Element deepest = getDeepChild(wrap); parentNode.replaceChild(this, wrap); deepest.addChildren(this); // remainder (unbalanced wrap, like <div></div><p></p> -- The <p> is remainder if (wrapChildren.size() > 0) { for (int i = 0; i < wrapChildren.size(); i++) { Node remainder = wrapChildren.get(i); remainder.parentNode.removeChild(remainder); wrap.appendChild(remainder); } } return this; } /** * Removes this node from the DOM, and moves its children up into the node's parent. This has the effect of dropping * the node but keeping its children. * <p> * For example, with the input html: * </p> * <p>{@code <div>One <span>Two <b>Three</b></span></div>}</p> * Calling {@code element.unwrap()} on the {@code span} element will result in the html: * <p>{@code <div>One Two <b>Three</b></div>}</p> * and the {@code "Two "} {@link TextNode} being returned. * * @return the first child of this node, after the node has been unwrapped. Null if the node had no children. * @see #remove() * @see #wrap(String) */ public Node unwrap() { Validate.notNull(parentNode); Node firstChild = childNodes.size() > 0 ? childNodes.get(0) : null; parentNode.addChildren(siblingIndex, this.childNodesAsArray()); this.remove(); return firstChild; } private Element getDeepChild(Element el) { List<Element> children = el.children(); if (children.size() > 0) return getDeepChild(children.get(0)); else return el; } /** * Replace this node in the DOM with the supplied node. * @param in the node that will will replace the existing node. */ public void replaceWith(Node in) { Validate.notNull(in); Validate.notNull(parentNode); parentNode.replaceChild(this, in); } protected void setParentNode(Node parentNode) { if (this.parentNode != null) this.parentNode.removeChild(this); this.parentNode = parentNode; } protected void replaceChild(Node out, Node in) { Validate.isTrue(out.parentNode == this); Validate.notNull(in); if (in.parentNode != null) in.parentNode.removeChild(in); final int index = out.siblingIndex; childNodes.set(index, in); in.parentNode = this; in.setSiblingIndex(index); out.parentNode = null; } protected void removeChild(Node out) { Validate.isTrue(out.parentNode == this); final int index = out.siblingIndex; childNodes.remove(index); reindexChildren(index); out.parentNode = null; } protected void addChildren(Node... children) { //most used. short circuit addChildren(int), which hits reindex children and array copy for (Node child: children) { reparentChild(child); childNodes.add(child); child.setSiblingIndex(childNodes.size()-1); } } protected void addChildren(int index, Node... children) { Validate.noNullElements(children); for (int i = children.length - 1; i >= 0; i--) { Node in = children[i]; reparentChild(in); childNodes.add(index, in); } reindexChildren(index); } protected void reparentChild(Node child) { if (child.parentNode != null) child.parentNode.removeChild(child); child.setParentNode(this); } private void reindexChildren(int start) { for (int i = start; i < childNodes.size(); i++) { childNodes.get(i).setSiblingIndex(i); } } /** Retrieves this node's sibling nodes. Similar to {@link #childNodes() node.parent.childNodes()}, but does not include this node (a node is not a sibling of itself). @return node siblings. If the node has no parent, returns an empty list. */ public List<Node> siblingNodes() { if (parentNode == null) return Collections.emptyList(); List<Node> nodes = parentNode.childNodes; List<Node> siblings = new ArrayList<Node>(nodes.size() - 1); for (Node node: nodes) if (node != this) siblings.add(node); return siblings; } /** Get this node's next sibling. @return next sibling, or null if this is the last sibling */ public Node nextSibling() { if (parentNode == null) return null; // root final List<Node> siblings = parentNode.childNodes; final int index = siblingIndex+1; if (siblings.size() > index) return siblings.get(index); else return null; } /** Get this node's previous sibling. @return the previous sibling, or null if this is the first sibling */ public Node previousSibling() { if (parentNode == null) return null; // root if (siblingIndex > 0) return parentNode.childNodes.get(siblingIndex-1); else return null; } /** * Get the list index of this node in its node sibling list. I.e. if this is the first node * sibling, returns 0. * @return position in node sibling list * @see org.jsoup.nodes.Element#elementSiblingIndex() */ public int siblingIndex() { return siblingIndex; } protected void setSiblingIndex(int siblingIndex) { this.siblingIndex = siblingIndex; } /** * Perform a depth-first traversal through this node and its descendants. * @param nodeVisitor the visitor callbacks to perform on each node * @return this node, for chaining */ public Node traverse(NodeVisitor nodeVisitor) { Validate.notNull(nodeVisitor); NodeTraversor traversor = new NodeTraversor(nodeVisitor); traversor.traverse(this); return this; } /** Get the outer HTML of this node. @return HTML */ public String outerHtml() { StringBuilder accum = new StringBuilder(128); outerHtml(accum); return accum.toString(); } protected void outerHtml(StringBuilder accum) { new NodeTraversor(new OuterHtmlVisitor(accum, getOutputSettings())).traverse(this); } // if this node has no document (or parent), retrieve the default output settings Document.OutputSettings getOutputSettings() { return ownerDocument() != null ? ownerDocument().outputSettings() : (new Document("")).outputSettings(); } /** Get the outer HTML of this node. @param accum accumulator to place HTML into */ abstract void outerHtmlHead(StringBuilder accum, int depth, Document.OutputSettings out); abstract void outerHtmlTail(StringBuilder accum, int depth, Document.OutputSettings out); @Override public String toString() { return outerHtml(); } protected void indent(StringBuilder accum, int depth, Document.OutputSettings out) { accum.append("\n").append(StringUtil.padding(depth * out.indentAmount())); } /** * Check if this node is equal to another node. A node is considered equal if its attributes and content equal the * other node; particularly its position in the tree does not influence its equality. * @param o other object to compare to * @return true if the content of this node is the same as the other */ @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Node node = (Node) o; if (childNodes != null ? !childNodes.equals(node.childNodes) : node.childNodes != null) return false; return !(attributes != null ? !attributes.equals(node.attributes) : node.attributes != null); } /** * Calculates a hash code for this node, which includes iterating all its attributes, and recursing into any child * nodes. This means that a node's hashcode is based on it and its child content, and not its parent or place in the * tree. So two nodes with the same content, regardless of their position in the tree, will have the same hashcode. * @return the calculated hashcode * @see Node#equals(Object) */ @Override public int hashCode() { int result = childNodes != null ? childNodes.hashCode() : 0; result = 31 * result + (attributes != null ? attributes.hashCode() : 0); return result; } /** * Create a stand-alone, deep copy of this node, and all of its children. The cloned node will have no siblings or * parent node. As a stand-alone object, any changes made to the clone or any of its children will not impact the * original node. * <p> * The cloned node may be adopted into another Document or node structure using {@link Element#appendChild(Node)}. * @return stand-alone cloned node */ @Override public Node clone() { Node thisClone = doClone(null); // splits for orphan // Queue up nodes that need their children cloned (BFS). LinkedList<Node> nodesToProcess = new LinkedList<Node>(); nodesToProcess.add(thisClone); while (!nodesToProcess.isEmpty()) { Node currParent = nodesToProcess.remove(); for (int i = 0; i < currParent.childNodes.size(); i++) { Node childClone = currParent.childNodes.get(i).doClone(currParent); currParent.childNodes.set(i, childClone); nodesToProcess.add(childClone); } } return thisClone; } /* * Return a clone of the node using the given parent (which can be null). * Not a deep copy of children. */ protected Node doClone(Node parent) { Node clone; try { clone = (Node) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } clone.parentNode = parent; // can be null, to create an orphan split clone.siblingIndex = parent == null ? 0 : siblingIndex; clone.attributes = attributes != null ? attributes.clone() : null; clone.baseUri = baseUri; clone.childNodes = new ArrayList<Node>(childNodes.size()); for (Node child: childNodes) clone.childNodes.add(child); return clone; } private static class OuterHtmlVisitor implements NodeVisitor { private StringBuilder accum; private Document.OutputSettings out; OuterHtmlVisitor(StringBuilder accum, Document.OutputSettings out) { this.accum = accum; this.out = out; } public void head(Node node, int depth) { node.outerHtmlHead(accum, depth, out); } public void tail(Node node, int depth) { if (!node.nodeName().equals("#text")) // saves a void hit. node.outerHtmlTail(accum, depth, out); } } }
[ "justinwm@163.com" ]
justinwm@163.com
9e9d596a9dd93f750b8750388b3698ad7816a059
032bcc928f791a91a74566fee5a3d0998fc5a3c6
/app/src/main/java/com/example/vien/courtcounter/MainActivity.java
bed2c5a701f331c3bf67c56795968ec1007be00b
[]
no_license
vienaulia/CourtCounter
e02179ed629b15be84b23a932a0cf7bf0e1b9715
317e06af5efc087f31ff27d8975b003462c27e7d
refs/heads/master
2021-04-28T20:31:43.199338
2018-02-18T07:00:48
2018-02-18T07:00:48
121,927,142
0
0
null
null
null
null
UTF-8
Java
false
false
3,172
java
package com.example.vien.courtcounter; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.TextView; /** * Created by Vien on 05/11/2017. */ public class MainActivity extends AppCompatActivity implements View.OnClickListener { //untuk team vien TextView txtPointMerah; Button btnTambahTigaMerah, btnTambahDuaMerah, btnFreeMerah; // team puutih TextView txtPointPutih; Button btnTambahTigaPutih, btnTambahDuaPutih, btnFreePutih; // tombol reset Button btnReset; int poinA = 0, poinB= 0; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); definisi(); } // definisi (casting) object ke variabel diatas private void definisi(){ // untuk poin merah txtPointMerah = (TextView) findViewById(R.id.textpoinvi); btnTambahTigaMerah= (Button) findViewById(R.id.vi3); btnTambahDuaMerah = (Button) findViewById(R.id.vi2); btnFreeMerah = (Button) findViewById(R.id.vifree); // untuk poin putih txtPointPutih = (TextView) findViewById(R.id.textpoinaul); btnTambahTigaPutih= (Button) findViewById(R.id.ar3); btnTambahDuaPutih = (Button) findViewById(R.id.ar2); btnFreePutih = (Button) findViewById(R.id.arfree); // buttonreset btnReset = (Button) findViewById(R.id.btn_reset); // fungsi semua tombol btnTambahTigaMerah.setOnClickListener(this); btnTambahDuaMerah.setOnClickListener(this); btnFreeMerah.setOnClickListener(this); btnTambahTigaPutih.setOnClickListener(this); btnTambahDuaPutih.setOnClickListener(this); btnFreePutih.setOnClickListener(this); btnReset.setOnClickListener(this); } @Override public void onClick(View view) { switch (view.getId()){ case R.id.vi3: poinA = poinA + 3; txtPointMerah.setText(String.valueOf(poinA)); break; case R.id.vi2: poinA = poinA + 2; txtPointMerah.setText(String.valueOf(poinA)); break; case R.id.vifree: poinA = poinA + 1; txtPointMerah.setText(String.valueOf(poinA)); break; case R.id.ar3: poinB = poinB + 3; txtPointPutih.setText(String.valueOf(poinB)); break; case R.id.ar2: poinB = poinB + 2; txtPointPutih.setText(String.valueOf(poinB)); break; case R.id.arfree: poinB = poinB + 1; txtPointPutih.setText(String.valueOf(poinB)); break; case R.id.btn_reset: poinA = 0 ; poinB = 0; txtPointMerah.setText("0"); txtPointPutih.setText("0"); break; } } }
[ "vienrahmatika@gmail.com" ]
vienrahmatika@gmail.com
1079e42970f27d9a228453a48060330d6d5e5851
280d31084c976a61e8e3e731959f2da1c1b019c7
/src/main/java/com/akshay/validator/ItemPriceValidator.java
c50f52f7d13a26423a4841ea489ea97996b09a49
[]
no_license
AkshayaPk/res-core
774b0f934ad89f2bdc010fb752916b38fcc223e3
394fffb20ac12adba181cd91e4fee98db9ba0687
refs/heads/master
2021-04-30T17:05:34.592300
2017-02-01T10:44:19
2017-02-01T10:44:19
80,182,911
0
1
null
null
null
null
UTF-8
Java
false
false
812
java
package com.akshay.validator; import com.akshay.exception.ItemPriceInvalidUpdateException; import com.akshay.model.ItemPrice; public class ItemPriceValidator { public void validateUpdate(ItemPrice itemPrice) throws ItemPriceInvalidUpdateException { if (itemPrice.getPrice() < 0 || itemPrice.getId() < 0 ) { throw new ItemPriceInvalidUpdateException("Enter a valid price for the item"); } } public void validateSave(ItemPrice itemPrice) throws ItemPriceInvalidUpdateException { if ("".equals(itemPrice.getItemName())) { throw new ItemPriceInvalidUpdateException("This field cannot be null"); } } public void validateDelete(ItemPrice itemPrice) throws ItemPriceInvalidUpdateException { if(itemPrice.getId()<0) { throw new ItemPriceInvalidUpdateException("Enter ID"); } } }
[ "akshay pk" ]
akshay pk
3de7c8d9e2623971077d3b7de0380dc7a8d3769d
d0e74ff6e8d37984cea892dfe8508e2b44de5446
/logistics-wms-city-1.1.3.44.5/logistics-wms-city-manager/src/main/java/com/yougou/logistics/city/manager/BillOmDeliverManagerImpl.java
0029c2a742f204d15730e0c67434087f151f4691
[]
no_license
heaven6059/wms
fb39f31968045ba7e0635a4416a405a226448b5a
5885711e188e8e5c136956956b794f2a2d2e2e81
refs/heads/master
2021-01-14T11:20:10.574341
2015-04-11T08:11:59
2015-04-11T08:11:59
29,462,213
1
4
null
null
null
null
UTF-8
Java
false
false
14,539
java
package com.yougou.logistics.city.manager; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.apache.commons.lang.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.yougou.logistics.base.common.enums.DataAccessRuleEnum; import com.yougou.logistics.base.common.exception.ManagerException; import com.yougou.logistics.base.common.exception.ServiceException; import com.yougou.logistics.base.common.model.AuthorityParams; import com.yougou.logistics.base.manager.BaseCrudManagerImpl; import com.yougou.logistics.base.service.BaseCrudService; import com.yougou.logistics.city.common.enums.ContainerStatusEnums; import com.yougou.logistics.city.common.model.BillOmDeliver; import com.yougou.logistics.city.common.model.BillOmDeliverDtl; import com.yougou.logistics.city.common.model.BmContainer; import com.yougou.logistics.city.common.model.ConBox; import com.yougou.logistics.city.common.model.ConLabel; import com.yougou.logistics.city.common.model.ConLabelDtl; import com.yougou.logistics.city.common.model.SystemUser; import com.yougou.logistics.city.common.utils.CommonUtil; import com.yougou.logistics.city.service.BillOmDeliverDtlService; import com.yougou.logistics.city.service.BillOmDeliverService; import com.yougou.logistics.city.service.BmContainerService; import com.yougou.logistics.city.service.ConBoxService; import com.yougou.logistics.city.service.ConLabelDtlService; import com.yougou.logistics.city.service.ConLabelService; /** * * 装车单manager实现 * * @author qin.dy * @date 2013-10-12 下午3:25:51 * @version 0.1.0 * @copyright yougou.com */ @Service("billOmDeliverManager") class BillOmDeliverManagerImpl extends BaseCrudManagerImpl implements BillOmDeliverManager { @Resource private ConLabelService conLabelService; @Resource private ConLabelDtlService conLabelDtlService; @Resource private BillOmDeliverService billOmDeliverService; @Resource private BillOmDeliverDtlService billOmDeliverDtlService; @Resource private ConBoxService conBoxService; @Resource private BmContainerService bmContainerService; private static final String STATUS10 = "10"; @Override public BaseCrudService init() { return billOmDeliverService; } @Override @Transactional(propagation=Propagation.REQUIRED,rollbackFor=ManagerException.class) public int deleteBatch(String ids) throws ManagerException { //容器记账,锁定箱子 占用,status=1,optBillNo,optBillType都要传 List<BmContainer> lstContainer = new ArrayList<BmContainer>(); Map<String,String> returnMap = new HashMap<String,String>(); int count = 0; if(StringUtils.isNotBlank(ids)){ String[] idArr = ids.split(","); for(String str : idArr){ String[] tmp = str.split("-"); if(tmp.length==3){ try { String locno = tmp[0]; String deliverNo = tmp[1]; String ownerNo = tmp[2]; BillOmDeliver key = new BillOmDeliver(); key.setLocno(locno); key.setDeliverNo(deliverNo); key.setOwnerNo(ownerNo); BillOmDeliver selObj = billOmDeliverService.findById(key); if(null==selObj || !STATUS10.equals(selObj.getStatus())){ throw new ManagerException("单据"+deliverNo+"不是新建状态,不可以删除!"); } //查询单据下的所有标签号 BillOmDeliverDtl deliverDtl = new BillOmDeliverDtl(); deliverDtl.setLocno(locno); deliverDtl.setDeliverNo(deliverNo); deliverDtl.setOwnerNo(ownerNo); List<BillOmDeliverDtl> lstBillOmDeliverDtl = billOmDeliverDtlService.findBoxNoByDetail(deliverDtl); for (BillOmDeliverDtl b : lstBillOmDeliverDtl) { ConLabel conLabel = new ConLabel(); conLabel.setLocno(locno); conLabel.setScanLabelNo(b.getBoxNo()); conLabel.setStatus("A0"); //释放本单据已锁定的箱信息。更新标签状态为61(复核完成) int a = conLabelService.modifyStatusByLocnoAndLabelNo(conLabel); if(a < 1){ throw new ManagerException("未更新到标签号【"+b.getBoxNo()+"】的状态!"); } ConLabelDtl conLabelDtl = new ConLabelDtl(); conLabelDtl.setStatus("A0");//标签状态为6E(外复核完成) conLabelDtl.setLocno(locno); conLabelDtl.setScanLabelNo(b.getBoxNo()); int c = conLabelDtlService.modifyLabelDtlStatusByLabelNo(conLabelDtl); if(c < 1){ throw new ManagerException("未更新到标签明细【"+b.getBoxNo()+"】的状态!"); } ConBox conBox = new ConBox(); conBox.setStatus("2"); conBox.setLocno(locno); conBox.setOwnerNo(ownerNo); conBox.setBoxNo(b.getBoxNo()); int b1 = conBoxService.modifyById(conBox); if(b1 < 1){ throw new ManagerException("未更新到箱号【"+b.getBoxNo()+"】的状态!"); } //添加解锁的容器 String labelNo = b.getBoxNo(); if(!returnMap.containsKey(labelNo)){ BmContainer bc = new BmContainer(); bc.setLocno(locno); bc.setConNo(labelNo); bc.setStatus(ContainerStatusEnums.STATUS0.getContainerStatus()); bc.setFalg("Y"); lstContainer.add(bc); returnMap.put(labelNo, labelNo); } } //锁定容器号 if (CommonUtil.hasValue(lstContainer)) { bmContainerService.batchUpdate(lstContainer); lstContainer.clear(); returnMap.clear(); } billOmDeliverService.deleteById(key); billOmDeliverService.deleteByDeliverDtl(key); count++; } catch (ServiceException e) { throw new ManagerException(e); } } } } return count; } @Override @Transactional(propagation = Propagation.REQUIRED,rollbackFor=ManagerException.class) public Map<String, Object> checkBoxBillOmDeliver(String ids, SystemUser user) throws ManagerException { Map<String, Object> mapObj = new HashMap<String, Object>(); try { String msg1 = "N"; if(StringUtils.isNotBlank(ids)){ Date now = new Date(); BillOmDeliverDtl dtl = new BillOmDeliverDtl(); dtl.setEditor(user.getLoginName()); dtl.setEditorname(user.getUsername()); dtl.setEdittm(now); String[] idArr = ids.split(","); for(String id : idArr){ msg1 = "N"; String msg2 = "审核失败!"; String[] tmp = id.split("-"); if(tmp.length==3){ BillOmDeliver billOmDeliver = new BillOmDeliver(); billOmDeliver.setLocno(tmp[0]); billOmDeliver.setOwnerNo(tmp[1]); billOmDeliver.setDeliverNo(tmp[2]); billOmDeliver.setSealNo("0"); billOmDeliver.setIsDevice("0"); billOmDeliver.setAuditor(user.getLoginName()); BillOmDeliver singojb = billOmDeliverService.findById(billOmDeliver); if(null == singojb || !STATUS10.equals(singojb.getStatus())){ throw new ManagerException("单据"+tmp[2]+"不为新建状态!"); } if(StringUtils.isNotBlank(billOmDeliver.getLocno()) && StringUtils.isNotBlank(billOmDeliver.getOwnerNo()) && StringUtils.isNotBlank(billOmDeliver.getDeliverNo()) && StringUtils.isNotBlank(billOmDeliver.getSealNo()) && StringUtils.isNotBlank(billOmDeliver.getIsDevice()) && StringUtils.isNotBlank(billOmDeliver.getAuditor())){ Map<String, String> map = new HashMap<String, String>(); map.put("strLocNo", billOmDeliver.getLocno()); map.put("strOwnerNo", billOmDeliver.getOwnerNo()); map.put("strDeliverNo", billOmDeliver.getDeliverNo()); map.put("strSealNo", billOmDeliver.getSealNo()); map.put("strIsDevice", billOmDeliver.getIsDevice()); map.put("strUserID", billOmDeliver.getAuditor()); billOmDeliverService.checkBillOmDeliver(map); String stroutmsg = map.get("strResult"); if(StringUtils.isNotBlank(stroutmsg)){ String[] msgs = stroutmsg.split("\\|"); if(msgs != null && msgs.length >= 2) { msg1 = msgs[0]; msg2 = msgs[1]; } if (!"Y".equals(msg1)) { throw new ManagerException(msg2); } } else { throw new ManagerException(msg2); } //审核时修改明细的editor、editorname、edittm dtl.setDeliverNo(billOmDeliver.getDeliverNo()); dtl.setLocno(billOmDeliver.getLocno()); dtl.setOwnerNo(billOmDeliver.getOwnerNo()); billOmDeliverDtlService.modifyById(dtl); }else{ msg2 = "参数非法!"; throw new ManagerException(msg2); } } } if("Y".equals(msg1)) { mapObj.put("flag", "success"); mapObj.put("msg", "审核成功!"); } else { mapObj.put("flag", "warn"); mapObj.put("msg", "无审核成功记录!"); } } return mapObj; } catch (Exception e) { throw new ManagerException(e.getMessage()); } } @Override @Transactional(propagation = Propagation.REQUIRED,rollbackFor=ManagerException.class) public Map<String, Object> checkBillFlagOmDeliver(String ids, String auditor) throws ManagerException { Map<String, Object> mapObj = new HashMap<String, Object>(); String msg1 = "N"; String msg2 = "审核失败!"; try { if(StringUtils.isNotBlank(ids)){ String[] idArr = ids.split(","); for(String id : idArr){ String[] tmp = id.split("-"); if(tmp.length==3){ BillOmDeliver billOmDeliver = new BillOmDeliver(); billOmDeliver.setLocno(tmp[0]); billOmDeliver.setOwnerNo(tmp[1]); billOmDeliver.setDeliverNo(tmp[2]); billOmDeliver.setSealNo("0"); billOmDeliver.setIsDevice("0"); billOmDeliver.setAuditor(auditor); billOmDeliver.setAudittm(new Date()); if(StringUtils.isNotBlank(billOmDeliver.getLocno()) && StringUtils.isNotBlank(billOmDeliver.getOwnerNo()) && StringUtils.isNotBlank(billOmDeliver.getDeliverNo()) && StringUtils.isNotBlank(billOmDeliver.getSealNo()) && StringUtils.isNotBlank(billOmDeliver.getIsDevice()) && StringUtils.isNotBlank(billOmDeliver.getAuditor())){ Map<String, String> map = new HashMap<String, String>(); map.put("strLocNo", billOmDeliver.getLocno()); map.put("strOwnerNo", billOmDeliver.getOwnerNo()); map.put("strDeliverNo", billOmDeliver.getDeliverNo()); map.put("strSealNo", billOmDeliver.getSealNo()); map.put("strIsDevice", billOmDeliver.getIsDevice()); map.put("strUserID", billOmDeliver.getAuditor()); //执行审核 billOmDeliverService.checkBillOmDeliver(map); String stroutmsg = map.get("strResult"); if(StringUtils.isNotBlank(stroutmsg)){ String[] msgs = stroutmsg.split("\\|"); if(msgs != null && msgs.length >= 2) { msg1 = msgs[0]; msg2 = msgs[1]; } //////////////////////////////手动审核BEGIN//////////////////////////// // billOmDeliver.setStatus("13"); // int count = billOmDeliverService.modifyById(billOmDeliver); // if(count > 0) { // int two = billOmDeliverService.updateBillOmDeliverDtl(billOmDeliver); // if(two <= 0) { // msg2 = "审核派车单明细失败!"; // throw new ManagerException(msg2); // } // msg1 = "Y"; // msg2 = "审核成功!"; //////////////////////////////手动审核 END//////////////////////////// if (!"Y".equals(msg1)) { throw new ManagerException(msg2); } else { if(checkFlag(billOmDeliver)) { mapObj.put("flag", "success"); mapObj.put("msg", msg2); return mapObj; } else { msg2 = "派车单回填失败!"; throw new ManagerException(msg2); } } } else { throw new ManagerException(msg2); } }else{ msg2 = "参数非法!"; throw new ManagerException(msg2); } } } } return mapObj; } catch (Exception e) { throw new ManagerException(e.getMessage()); } } /** * 回填派车单状态 * @param billOmDeliver * @return */ private boolean checkFlag(BillOmDeliver billOmDeliver) throws ManagerException { boolean isCheck = false; List<BillOmDeliver> list; try { list = billOmDeliverService.selectLoadproposeDtl(billOmDeliver); if(list!= null && list.size() > 0) { int no = 0; for(BillOmDeliver bd : list) { String locno = bd.getLocno(); String loadproposeNo = bd.getLoadproposeNo(); String containerNo = bd.getContainerNo(); String storeNo = bd.getStoreNo(); // BillOmDeliver deliver = new BillOmDeliver(); deliver.setLocno(locno); deliver.setLoadproposeNo(loadproposeNo); deliver.setStoreNo(storeNo); deliver.setContainerNo(containerNo); no += billOmDeliverService.updateLoadproposeDtl(deliver); } billOmDeliver = new BillOmDeliver(); billOmDeliver.setLocno(list.get(0).getLocno()); billOmDeliver.setLoadproposeNo(list.get(0).getLoadproposeNo()); int count = billOmDeliverService.loadproposeDtlCount(billOmDeliver); if(count == 0) { billOmDeliverService.updateLoadpropose(billOmDeliver); } if(no > 0) { isCheck = true; } } } catch (ServiceException e) { isCheck = false; e.printStackTrace(); throw new ManagerException("派车单回填异常"); } return isCheck; } @Override public List<BillOmDeliver> findBillOmDeliverSum(Map<String,Object> params,AuthorityParams authorityParams) throws ManagerException { try { return billOmDeliverService.findBillOmDeliverSum(params,authorityParams); } catch (ServiceException e) { throw new ManagerException(e); } } @Override public List<BillOmDeliver> findPrintOmDeliverList(String sortColumn, String sortOrder, Map<String, Object> params, AuthorityParams authorityParams) throws ManagerException { try { return billOmDeliverService.findPrintOmDeliverList(sortColumn,sortOrder,params,authorityParams); } catch (ServiceException e) { throw new ManagerException(e); } } }
[ "heaven6059@126.com" ]
heaven6059@126.com
bbafc1e1a71ad09a2eacb547b3286ed35ff6fe0b
838995c78a287c46990f6d31b1a9a5d216b00c2c
/app/src/main/java/com/udacity/sandwichclub/ingredients.java
25ac8c096b5ec0cb857ad05e27e332a385f7ead0
[]
no_license
PratyushaThumiki/SandwichClub
730e6c5a6eee67f387ac988132bdae9ca7598731
382ce1284e16150f7085e0edc5a9e5e04031b7ec
refs/heads/master
2020-03-19T14:00:13.630131
2018-06-08T10:29:55
2018-06-08T10:29:55
136,596,646
0
0
null
null
null
null
UTF-8
Java
false
false
572
java
package com.udacity.sandwichclub; import android.support.v4.app.Fragment; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class ingredients extends Fragment{ View view; public ingredients() { } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { view =inflater.inflate(R.layout.ingredients,container,false); return view; } }
[ "pratyusha.thumiki@gmail.com" ]
pratyusha.thumiki@gmail.com
f5fc8b2c14601b9275bd4982a5aa8995d884c441
324fbb9922902c850b0f677fd0923d2a07c3d2f1
/libraries/auth/src/test/java/com/kakao/auth/authorization/authcode/AuthCodeParseIntentTest.java
f43e8df1825e13f745d61b1e43d5dda30bf7adc7
[]
no_license
NamKey/HealthForYou
df71b1aee51304526dfd6e6ba3508785af1846e7
184fd53ac79e70bb69a6c9ad3766c95e91ecb6c5
refs/heads/master
2022-11-10T13:49:09.709259
2022-10-26T04:01:42
2022-10-26T04:01:42
97,194,421
0
0
null
null
null
null
UTF-8
Java
false
false
5,797
java
package com.kakao.auth.authorization.authcode; import android.app.Activity; import android.content.Intent; import com.kakao.auth.ApprovalType; import com.kakao.auth.AuthType; import com.kakao.auth.ISessionConfig; import com.kakao.auth.authorization.AuthorizationResult; import com.kakao.auth.mocks.TestKakaoProtocolService; import com.kakao.test.common.KakaoTestCase; import com.kakao.util.AppConfig; import com.kakao.util.protocol.KakaoProtocolService; import com.kakao.util.helper.TalkProtocol; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.robolectric.RuntimeEnvironment; /** * This test class tests if KakaoAuthCodeManager correctly parses intent outputs from * KakaoTalk app or KaKaoWebViewActivity. * * @author kevin.kang. Created on 2017. 5. 23.. */ public class AuthCodeParseIntentTest extends KakaoTestCase { private String appKey = "sample_app_key"; private String redirectUri = "kakao" + appKey + "://oauth"; private String expectedAuthCode = "12345"; private String authCodePostfix = "?code=" + expectedAuthCode; private String errorDescription = "error_description"; private AppConfig appConfig = new AppConfig(appKey, "key_hash", "ka_header", "app_ver", "package_name"); private TalkAuthCodeService talkAuthCodeService; private KakaoProtocolService protocolService; @Before public void setup() { super.setup(); ISessionConfig sessionConfig = new ISessionConfig() { @Override public AuthType[] getAuthTypes() { return new AuthType[]{AuthType.KAKAO_LOGIN_ALL}; } @Override public boolean isUsingWebviewTimer() { return false; } @Override public boolean isSecureMode() { return false; } @Override public ApprovalType getApprovalType() { return ApprovalType.INDIVIDUAL; } @Override public boolean isSaveFormData() { return false; } }; protocolService = new TestKakaoProtocolService(); talkAuthCodeService = new TalkAuthCodeService(RuntimeEnvironment.application, appConfig, sessionConfig, protocolService); } @After public void cleanup() { } @Test public void testParseCancelIntent() { Intent intent = new Intent(); AuthorizationResult result = talkAuthCodeService.parseAuthCodeIntent(1, Activity.RESULT_CANCELED, intent); Assert.assertTrue(result.isCanceled()); } @Test public void testParseSuccessIntent() { Intent intent = new Intent(); intent.putExtra(TalkProtocol.EXTRA_REDIRECT_URL, redirectUri + authCodePostfix); AuthorizationResult result = talkAuthCodeService.parseAuthCodeIntent(1, Activity.RESULT_OK, intent); Assert.assertTrue(result.isSuccess()); Assert.assertEquals(redirectUri + authCodePostfix, result.getRedirectURL()); Assert.assertEquals(redirectUri + authCodePostfix, result.getRedirectUri().toString()); Assert.assertNull(result.getAccessToken()); } @Test public void testNotSupprtErrorIntent() { Intent intent = createErrorIntent(TalkProtocol.NOT_SUPPORT_ERROR, null); AuthorizationResult result = talkAuthCodeService.parseAuthCodeIntent(1, Activity.RESULT_OK, intent); Assert.assertTrue(result.isPass()); } @Test public void testUnknownErrorIntent() { Intent intent = createErrorIntent(TalkProtocol.UNKNOWN_ERROR, errorDescription); AuthorizationResult result = talkAuthCodeService.parseAuthCodeIntent(1, Activity.RESULT_OK, intent); Assert.assertTrue(result.isAuthError()); Assert.assertTrue(result.getResultMessage().contains(errorDescription)); } @Test public void testProtocolErrorIntent() { Intent intent = createErrorIntent(TalkProtocol.PROTOCOL_ERROR, errorDescription); AuthorizationResult result = talkAuthCodeService.parseAuthCodeIntent(1, Activity.RESULT_OK, intent); Assert.assertTrue(result.isAuthError()); Assert.assertTrue(result.getResultMessage().contains(errorDescription)); } @Test public void testApplicationErrorIntent() { Intent intent = createErrorIntent(TalkProtocol.APPLICATION_ERROR, errorDescription); AuthorizationResult result = talkAuthCodeService.parseAuthCodeIntent(1, Activity.RESULT_OK, intent); Assert.assertTrue(result.isAuthError()); Assert.assertTrue(result.getResultMessage().contains(errorDescription)); } @Test public void testAuthCodeErrorIntent() { Intent intent = createErrorIntent(TalkProtocol.AUTH_CODE_ERROR, errorDescription); AuthorizationResult result = talkAuthCodeService.parseAuthCodeIntent(1, Activity.RESULT_OK, intent); Assert.assertTrue(result.isAuthError()); Assert.assertTrue(result.getResultMessage().contains(errorDescription)); } @Test public void testClientInfoError() { Intent intent = createErrorIntent(TalkProtocol.CLIENT_INFO_ERROR, errorDescription); AuthorizationResult result = talkAuthCodeService.parseAuthCodeIntent(1, Activity.RESULT_OK, intent); Assert.assertTrue(result.isAuthError()); Assert.assertTrue(result.getResultMessage().contains(errorDescription)); } private Intent createErrorIntent(final String errorType, final String errorDescription) { Intent intent = new Intent(); intent.putExtra(TalkProtocol.EXTRA_ERROR_TYPE, errorType); intent.putExtra(TalkProtocol.EXTRA_ERROR_DESCRIPTION, errorDescription); return intent; } }
[ "kakapo12@naver.com" ]
kakapo12@naver.com
f110ac4cdecb2797ea7c0056dcadd97bc6e3105a
a877f611c03067536629ce812fbf93c2d580573c
/lxhFirst/src/main/java/cn/lxh/controller/IndexController.java
535f0ce69f124c2e9f504c31e8d93ac3b5f2dec3
[]
no_license
liaoxinghan/lxhFirst
b302ab3bf980d9ce27c9bcc6a816cf9ae6f40a5b
7e75fe9670b54b782460af6beed42cfddee00d52
refs/heads/master
2021-01-11T17:29:26.496046
2017-01-24T06:08:04
2017-01-24T06:08:04
79,787,082
0
0
null
null
null
null
UTF-8
Java
false
false
683
java
package cn.lxh.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** * <p>Title: IndexController</p> * <p>Description: </p> * <p>Company: zhph</p> * @author liaoxinghan * @date 2016-12-16 */ @Controller public class IndexController { @RequestMapping("/") public String toIndex(){ return "main"; } @RequestMapping("/view") public String toView(String viewName,HttpServletRequest request){ String header = request.getHeader("X-Requested-With"); if("XMLHttpRequest".equals(header)){ return viewName; }else{ return "../../404"; } } }
[ "1280034558@qq.com" ]
1280034558@qq.com
0a9c65828e2d6fd3f8b916f426724a51e88214e1
d831e93666585770b68e87813cbbb929cf8e1f9b
/app/src/androidTest/java/com/tabsontally/markomarks/tabsontally/ApplicationTest.java
9cab3dd9d73df7610ca48de73b29db6dd2bac49c
[]
no_license
fatdzo/TabsOnTally
ed70e18dddcdbc81a7e157b691209c1795416716
14b59e57da07796c887659d9d3dd11b73bb5a73c
refs/heads/master
2021-01-10T12:14:11.597734
2016-02-27T01:33:42
2016-02-27T01:33:42
49,779,826
1
1
null
null
null
null
UTF-8
Java
false
false
369
java
package com.tabsontally.markomarks.tabsontally; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
[ "fatdzo@gmail.com" ]
fatdzo@gmail.com
ae9e22ea887adef59f4c8bf8be942a28eb96e633
4ef6a76dc1a55560ccf979af21ad5bb21d3cec2d
/tkkta-frontend/src/main/java/com/controllers/DashbaordController.java
e82c1aeecbd4ce7155290ba85813fb97ecf61b30
[]
no_license
jenwitWork/JspProject
2df1b805c1fc8b71c6537b1a0b426752b176b1a9
162871407c9b54b55bbfbcec91da55a99bc61a63
refs/heads/master
2022-12-14T12:57:09.189223
2019-10-06T12:12:40
2019-10-06T12:12:40
94,548,334
0
0
null
2022-12-03T04:02:33
2017-06-16T13:49:50
HTML
UTF-8
Java
false
false
716
java
package com.controllers; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @Controller public class DashbaordController extends BaseController { @GetMapping("/dashboard") public Object dashbaord(Model model, HttpServletRequest request, HttpSession session) { current_action = "Dashboard"; current_title = "Dashboard"; session.setAttribute("current_action", current_action); model.addAttribute("current_title", current_title); return auth.checkLogin(session, request, "dashboard/dashboard"); } }
[ "jenwit_ch@JENWIT_CH" ]
jenwit_ch@JENWIT_CH
7af7f79e7cf8569fc449d90a920f4b755d6168e9
12563229bd1c69d26900d4a2ea34fe4c64c33b7e
/nan21.dnet.module.sd/nan21.dnet.module.sd.business.api/src/main/java/net/nan21/dnet/module/sd/order/business/service/ISalesOrderService.java
72f2925ac0226ffb28b3611227773722f95825b2
[]
no_license
nan21/nan21.dnet.modules
90b002c6847aa491c54bd38f163ba40a745a5060
83e5f02498db49e3d28f92bd8216fba5d186dd27
refs/heads/master
2023-03-15T16:22:57.059953
2012-08-01T07:36:57
2012-08-01T07:36:57
1,918,395
0
1
null
2012-07-24T03:23:00
2011-06-19T05:56:03
Java
UTF-8
Java
false
false
4,166
java
/* * DNet eBusiness Suite * Copyright: 2008-2012 Nan21 Electronics SRL. All rights reserved. * Use is subject to license terms. */ package net.nan21.dnet.module.sd.order.business.service; import java.util.List; import net.nan21.dnet.core.api.service.IEntityService; import net.nan21.dnet.module.bd.currency.domain.entity.Currency; import net.nan21.dnet.module.bd.geo.domain.entity.Location; import net.nan21.dnet.module.bd.org.domain.entity.Organization; import net.nan21.dnet.module.md.base.tx.domain.entity.DeliveryMethod; import net.nan21.dnet.module.md.base.tx.domain.entity.PaymentMethod; import net.nan21.dnet.module.md.base.tx.domain.entity.PaymentTerm; import net.nan21.dnet.module.md.base.tx.domain.entity.TxDocType; import net.nan21.dnet.module.md.bp.domain.entity.BusinessPartner; import net.nan21.dnet.module.md.bp.domain.entity.Contact; import net.nan21.dnet.module.md.mm.price.domain.entity.PriceList; import net.nan21.dnet.module.sd.order.domain.entity.SalesOrderItem; import net.nan21.dnet.module.sd.order.domain.entity.SalesOrderTax; import net.nan21.dnet.module.sd.order.domain.entity.SalesOrder; import java.util.Date; import net.nan21.dnet.module.md.tx.inventory.domain.entity.InvTransactionType; public interface ISalesOrderService extends IEntityService<SalesOrder> { public List<SalesOrder> findByDocType(TxDocType docType); public List<SalesOrder> findByDocTypeId(Long docTypeId); public List<SalesOrder> findByCustomer(BusinessPartner customer); public List<SalesOrder> findByCustomerId(Long customerId); public List<SalesOrder> findBySupplier(Organization supplier); public List<SalesOrder> findBySupplierId(Long supplierId); public List<SalesOrder> findByPriceList(PriceList priceList); public List<SalesOrder> findByPriceListId(Long priceListId); public List<SalesOrder> findByCurrency(Currency currency); public List<SalesOrder> findByCurrencyId(Long currencyId); public List<SalesOrder> findByPaymentMethod(PaymentMethod paymentMethod); public List<SalesOrder> findByPaymentMethodId(Long paymentMethodId); public List<SalesOrder> findByPaymentTerm(PaymentTerm paymentTerm); public List<SalesOrder> findByPaymentTermId(Long paymentTermId); public List<SalesOrder> findByInventory(Organization inventory); public List<SalesOrder> findByInventoryId(Long inventoryId); public List<SalesOrder> findByDeliveryMethod(DeliveryMethod deliveryMethod); public List<SalesOrder> findByDeliveryMethodId(Long deliveryMethodId); public List<SalesOrder> findByCarrier(Organization carrier); public List<SalesOrder> findByCarrierId(Long carrierId); public List<SalesOrder> findByBillTo(BusinessPartner billTo); public List<SalesOrder> findByBillToId(Long billToId); public List<SalesOrder> findByBillToLocation(Location billToLocation); public List<SalesOrder> findByBillToLocationId(Long billToLocationId); public List<SalesOrder> findByBillToContact(Contact billToContact); public List<SalesOrder> findByBillToContactId(Long billToContactId); public List<SalesOrder> findByShipTo(BusinessPartner shipTo); public List<SalesOrder> findByShipToId(Long shipToId); public List<SalesOrder> findByShipToLocation(Location shipToLocation); public List<SalesOrder> findByShipToLocationId(Long shipToLocationId); public List<SalesOrder> findByShipToContact(Contact shipToContact); public List<SalesOrder> findByShipToContactId(Long shipToContactId); public List<SalesOrder> findByLines(SalesOrderItem lines); public List<SalesOrder> findByLinesId(Long linesId); public List<SalesOrder> findByTaxes(SalesOrderTax taxes); public List<SalesOrder> findByTaxesId(Long taxesId); public void doGenerateInvoice(SalesOrder salesOrder, TxDocType invDocType) throws Exception; public void doGenerateDelivery(SalesOrder salesOrder, TxDocType deliveryDocType, InvTransactionType delivTxType, Date delivEventDate) throws Exception; }
[ "mathe_attila@yahoo.com" ]
mathe_attila@yahoo.com
8c9ac7dd3803e8cdc06a378867fb7e13689be068
fe2c32ed2b18b3e066bf92c57048d6f0a5472475
/app/src/main/java/com/example/wangluo/httpdemo/ergediandian/EgddBean.java
a209b724642df3e765f05448a1dd5fa10a762532
[]
no_license
zhaichenxiao-github/wangluo
15191d0f539b5fe79215d19272fe5dc2e7616084
160eaf040d9c696b3880bf495b6f8fa5aab51e59
refs/heads/master
2023-02-07T16:32:37.199301
2020-12-23T08:36:18
2020-12-23T08:36:18
302,257,203
2
0
null
null
null
null
UTF-8
Java
false
false
33,926
java
package com.example.wangluo.httpdemo.ergediandian; import java.util.List; public class EgddBean { /** * success : true * data : {"id":3,"name":"简单英文儿歌","image_url":"http://img5g22.ergedd.com/album/3_1567662527435.jpg","image_gif":"","image_ver":"","ext":null,"description":"简单易学经典英文儿歌","status":c,"video_count":23,"play_count":3879420,"icon_url":"http://img5g22.ergedd.com/album/3_1513592708648.png","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox","brand_styles":[{"type":"c","banner_image_url":"http://img5g22.ergedd.com/admin/app_config/48673804594_1504843571850.png","banner_image_width":"1080","banner_image_height":"640","banner_bg_image_url":"http://img5g22.ergedd.com/admin/app_config/91431209409_1504843608923.png","banner_bg_image_width":"405","banner_bg_image_height":"960","brand_image_url":"http://img5g22.ergedd.com/admin/app_config/96341757472_1504843617858.png","brand_image_width":"194","brand_image_height":"194","bg_color":"#fff4cf","album_border_color":"#ffb54c","album_title_color":"#ffffff","intro_color":"#c17900","intro_text":["一套精心制作的幼儿英语儿歌视频,经典专业的音乐,鲜艳明快的视频,宝宝可以一边学唱歌、一边学英语。"],"albums":[{"id":3,"title":"简单的英文儿歌","name":"简单英文儿歌","image_url":"http://img5g22.ergedd.com/album/3_1567662527435.jpg","image_gif":"","image_ver":"","ext":null,"description":"简单易学经典英文儿歌","status":c,"video_count":23,"play_count":3879420,"icon_url":"http://img5g22.ergedd.com/album/3_1513592708648.png","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":7,"title":"日常用语歌","name":"日常用语歌","image_url":"http://img5g22.ergedd.com/album/7_1567663321304.jpg","image_gif":"","image_ver":"","ext":null,"description":"英文日常小调","status":c,"video_count":10,"play_count":194839,"icon_url":"http://img5g22.ergedd.com/album/7_20170414114411_myvi.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":121,"title":"数字英文儿歌","name":"数字英文儿歌","image_url":"http://img5g22.ergedd.com/album/121_1567662288319.jpg","image_gif":"","image_ver":"","ext":null,"description":"唱儿歌 学英文","status":c,"video_count":14,"play_count":681494,"icon_url":"http://img5g22.ergedd.com/album/121_20170414114441_kpal.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":4,"title":"欧美童谣","name":"欧美童谣","image_url":"http://img5g22.ergedd.com/album/4_1567663142140.jpg","image_gif":"","image_ver":"","ext":null,"description":"汇集欧美经典英文童谣","status":c,"video_count":52,"play_count":193621,"icon_url":"http://img5g22.ergedd.com/album/4_20170414114411_pwph.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":25,"title":"宝宝游戏歌","name":"宝宝游戏歌","image_url":"http://img5g22.ergedd.com/album/25_1567662596460.jpg","image_gif":"","image_ver":"","ext":null,"description":"做游戏学英文","status":c,"video_count":16,"play_count":315223,"icon_url":"http://img5g22.ergedd.com/album/25_20170414114416_e94l.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":122,"title":"我爱动物","name":"我爱动物","image_url":"http://img5g22.ergedd.com/album/122_1567663541576.jpg","image_gif":"","image_ver":"","ext":null,"description":"把小动物的英文唱出来","status":c,"video_count":8,"play_count":171727,"icon_url":"http://img5g22.ergedd.com/album/122_20170414114442_lhcf.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":123,"title":"故事性英文儿歌","name":"故事性英文儿歌","image_url":"http://img5g22.ergedd.com/album/123_1567663211360.jpg","image_gif":"","image_ver":"","ext":null,"description":"英文儿歌还能这么学","status":c,"video_count":24,"play_count":137612,"icon_url":"http://img5g22.ergedd.com/album/123_20170414114442_nhjj.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"}]}]} * message : Get album successfully */ /** * id : 3 * name : 简单英文儿歌 * image_url : http://img5g22.ergedd.com/album/3_1567662527435.jpg * image_gif : * image_ver : * ext : null * description : 简单易学经典英文儿歌 * status : c * video_count : 23 * play_count : 3879420 * icon_url : http://img5g22.ergedd.com/album/3_1513592708648.png * icon_gif : * index_recommend : 0 * copyright_sensitive : 0 * is_vip : 2 * type : c * sensitive : 0 * watch_areas : ["c"] * erge_img_url : * free : 5 * cost : 0 * price : 0 * expires_at : null * vip_price : 0 * publisher_name : Little Fox * brand_styles : [{"type":"c","banner_image_url":"http://img5g22.ergedd.com/admin/app_config/48673804594_1504843571850.png","banner_image_width":"1080","banner_image_height":"640","banner_bg_image_url":"http://img5g22.ergedd.com/admin/app_config/91431209409_1504843608923.png","banner_bg_image_width":"405","banner_bg_image_height":"960","brand_image_url":"http://img5g22.ergedd.com/admin/app_config/96341757472_1504843617858.png","brand_image_width":"194","brand_image_height":"194","bg_color":"#fff4cf","album_border_color":"#ffb54c","album_title_color":"#ffffff","intro_color":"#c17900","intro_text":["一套精心制作的幼儿英语儿歌视频,经典专业的音乐,鲜艳明快的视频,宝宝可以一边学唱歌、一边学英语。"],"albums":[{"id":3,"title":"简单的英文儿歌","name":"简单英文儿歌","image_url":"http://img5g22.ergedd.com/album/3_1567662527435.jpg","image_gif":"","image_ver":"","ext":null,"description":"简单易学经典英文儿歌","status":c,"video_count":23,"play_count":3879420,"icon_url":"http://img5g22.ergedd.com/album/3_1513592708648.png","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":7,"title":"日常用语歌","name":"日常用语歌","image_url":"http://img5g22.ergedd.com/album/7_1567663321304.jpg","image_gif":"","image_ver":"","ext":null,"description":"英文日常小调","status":c,"video_count":10,"play_count":194839,"icon_url":"http://img5g22.ergedd.com/album/7_20170414114411_myvi.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":121,"title":"数字英文儿歌","name":"数字英文儿歌","image_url":"http://img5g22.ergedd.com/album/121_1567662288319.jpg","image_gif":"","image_ver":"","ext":null,"description":"唱儿歌 学英文","status":c,"video_count":14,"play_count":681494,"icon_url":"http://img5g22.ergedd.com/album/121_20170414114441_kpal.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":4,"title":"欧美童谣","name":"欧美童谣","image_url":"http://img5g22.ergedd.com/album/4_1567663142140.jpg","image_gif":"","image_ver":"","ext":null,"description":"汇集欧美经典英文童谣","status":c,"video_count":52,"play_count":193621,"icon_url":"http://img5g22.ergedd.com/album/4_20170414114411_pwph.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":25,"title":"宝宝游戏歌","name":"宝宝游戏歌","image_url":"http://img5g22.ergedd.com/album/25_1567662596460.jpg","image_gif":"","image_ver":"","ext":null,"description":"做游戏学英文","status":c,"video_count":16,"play_count":315223,"icon_url":"http://img5g22.ergedd.com/album/25_20170414114416_e94l.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":122,"title":"我爱动物","name":"我爱动物","image_url":"http://img5g22.ergedd.com/album/122_1567663541576.jpg","image_gif":"","image_ver":"","ext":null,"description":"把小动物的英文唱出来","status":c,"video_count":8,"play_count":171727,"icon_url":"http://img5g22.ergedd.com/album/122_20170414114442_lhcf.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":123,"title":"故事性英文儿歌","name":"故事性英文儿歌","image_url":"http://img5g22.ergedd.com/album/123_1567663211360.jpg","image_gif":"","image_ver":"","ext":null,"description":"英文儿歌还能这么学","status":c,"video_count":24,"play_count":137612,"icon_url":"http://img5g22.ergedd.com/album/123_20170414114442_nhjj.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"}]}] */ private int id; private String name; private String image_url; private String image_gif; private String image_ver; private Object ext; private String description; private int status; private int video_count; private int play_count; private String icon_url; private String icon_gif; private int index_recommend; private int copyright_sensitive; private int is_vip; private int type; private int sensitive; private String erge_img_url; private int free; private int cost; private int price; private Object expires_at; private int vip_price; private String publisher_name; private List<String> watch_areas; private List<BrandStylesBean> brand_styles; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImage_url() { return image_url; } public void setImage_url(String image_url) { this.image_url = image_url; } public String getImage_gif() { return image_gif; } public void setImage_gif(String image_gif) { this.image_gif = image_gif; } public String getImage_ver() { return image_ver; } public void setImage_ver(String image_ver) { this.image_ver = image_ver; } public Object getExt() { return ext; } public void setExt(Object ext) { this.ext = ext; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public int getVideo_count() { return video_count; } public void setVideo_count(int video_count) { this.video_count = video_count; } public int getPlay_count() { return play_count; } public void setPlay_count(int play_count) { this.play_count = play_count; } public String getIcon_url() { return icon_url; } public void setIcon_url(String icon_url) { this.icon_url = icon_url; } public String getIcon_gif() { return icon_gif; } public void setIcon_gif(String icon_gif) { this.icon_gif = icon_gif; } public int getIndex_recommend() { return index_recommend; } public void setIndex_recommend(int index_recommend) { this.index_recommend = index_recommend; } public int getCopyright_sensitive() { return copyright_sensitive; } public void setCopyright_sensitive(int copyright_sensitive) { this.copyright_sensitive = copyright_sensitive; } public int getIs_vip() { return is_vip; } public void setIs_vip(int is_vip) { this.is_vip = is_vip; } public int getType() { return type; } public void setType(int type) { this.type = type; } public int getSensitive() { return sensitive; } public void setSensitive(int sensitive) { this.sensitive = sensitive; } public String getErge_img_url() { return erge_img_url; } public void setErge_img_url(String erge_img_url) { this.erge_img_url = erge_img_url; } public int getFree() { return free; } public void setFree(int free) { this.free = free; } public int getCost() { return cost; } public void setCost(int cost) { this.cost = cost; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public Object getExpires_at() { return expires_at; } public void setExpires_at(Object expires_at) { this.expires_at = expires_at; } public int getVip_price() { return vip_price; } public void setVip_price(int vip_price) { this.vip_price = vip_price; } public String getPublisher_name() { return publisher_name; } public void setPublisher_name(String publisher_name) { this.publisher_name = publisher_name; } public List<String> getWatch_areas() { return watch_areas; } public void setWatch_areas(List<String> watch_areas) { this.watch_areas = watch_areas; } public List<BrandStylesBean> getBrand_styles() { return brand_styles; } public void setBrand_styles(List<BrandStylesBean> brand_styles) { this.brand_styles = brand_styles; } public static class BrandStylesBean { /** * type : c * banner_image_url : http://img5g22.ergedd.com/admin/app_config/48673804594_1504843571850.png * banner_image_width : 1080 * banner_image_height : 640 * banner_bg_image_url : http://img5g22.ergedd.com/admin/app_config/91431209409_1504843608923.png * banner_bg_image_width : 405 * banner_bg_image_height : 960 * brand_image_url : http://img5g22.ergedd.com/admin/app_config/96341757472_1504843617858.png * brand_image_width : 194 * brand_image_height : 194 * bg_color : #fff4cf * album_border_color : #ffb54c * album_title_color : #ffffff * intro_color : #c17900 * intro_text : ["一套精心制作的幼儿英语儿歌视频,经典专业的音乐,鲜艳明快的视频,宝宝可以一边学唱歌、一边学英语。"] * albums : [{"id":3,"title":"简单的英文儿歌","name":"简单英文儿歌","image_url":"http://img5g22.ergedd.com/album/3_1567662527435.jpg","image_gif":"","image_ver":"","ext":null,"description":"简单易学经典英文儿歌","status":c,"video_count":23,"play_count":3879420,"icon_url":"http://img5g22.ergedd.com/album/3_1513592708648.png","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":7,"title":"日常用语歌","name":"日常用语歌","image_url":"http://img5g22.ergedd.com/album/7_1567663321304.jpg","image_gif":"","image_ver":"","ext":null,"description":"英文日常小调","status":c,"video_count":10,"play_count":194839,"icon_url":"http://img5g22.ergedd.com/album/7_20170414114411_myvi.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":121,"title":"数字英文儿歌","name":"数字英文儿歌","image_url":"http://img5g22.ergedd.com/album/121_1567662288319.jpg","image_gif":"","image_ver":"","ext":null,"description":"唱儿歌 学英文","status":c,"video_count":14,"play_count":681494,"icon_url":"http://img5g22.ergedd.com/album/121_20170414114441_kpal.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":4,"title":"欧美童谣","name":"欧美童谣","image_url":"http://img5g22.ergedd.com/album/4_1567663142140.jpg","image_gif":"","image_ver":"","ext":null,"description":"汇集欧美经典英文童谣","status":c,"video_count":52,"play_count":193621,"icon_url":"http://img5g22.ergedd.com/album/4_20170414114411_pwph.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":25,"title":"宝宝游戏歌","name":"宝宝游戏歌","image_url":"http://img5g22.ergedd.com/album/25_1567662596460.jpg","image_gif":"","image_ver":"","ext":null,"description":"做游戏学英文","status":c,"video_count":16,"play_count":315223,"icon_url":"http://img5g22.ergedd.com/album/25_20170414114416_e94l.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":122,"title":"我爱动物","name":"我爱动物","image_url":"http://img5g22.ergedd.com/album/122_1567663541576.jpg","image_gif":"","image_ver":"","ext":null,"description":"把小动物的英文唱出来","status":c,"video_count":8,"play_count":171727,"icon_url":"http://img5g22.ergedd.com/album/122_20170414114442_lhcf.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"},{"id":123,"title":"故事性英文儿歌","name":"故事性英文儿歌","image_url":"http://img5g22.ergedd.com/album/123_1567663211360.jpg","image_gif":"","image_ver":"","ext":null,"description":"英文儿歌还能这么学","status":c,"video_count":24,"play_count":137612,"icon_url":"http://img5g22.ergedd.com/album/123_20170414114442_nhjj.jpg","icon_gif":"","index_recommend":0,"copyright_sensitive":0,"is_vip":2,"type":c,"sensitive":0,"watch_areas":["c"],"erge_img_url":"","free":5,"cost":0,"price":0,"expires_at":null,"vip_price":0,"publisher_name":"Little Fox"}] */ private String type; private String banner_image_url; private String banner_image_width; private String banner_image_height; private String banner_bg_image_url; private String banner_bg_image_width; private String banner_bg_image_height; private String brand_image_url; private String brand_image_width; private String brand_image_height; private String bg_color; private String album_border_color; private String album_title_color; private String intro_color; private List<String> intro_text; private List<AlbumsBean> albums; public String getType() { return type; } public void setType(String type) { this.type = type; } public String getBanner_image_url() { return banner_image_url; } public void setBanner_image_url(String banner_image_url) { this.banner_image_url = banner_image_url; } public String getBanner_image_width() { return banner_image_width; } public void setBanner_image_width(String banner_image_width) { this.banner_image_width = banner_image_width; } public String getBanner_image_height() { return banner_image_height; } public void setBanner_image_height(String banner_image_height) { this.banner_image_height = banner_image_height; } public String getBanner_bg_image_url() { return banner_bg_image_url; } public void setBanner_bg_image_url(String banner_bg_image_url) { this.banner_bg_image_url = banner_bg_image_url; } public String getBanner_bg_image_width() { return banner_bg_image_width; } public void setBanner_bg_image_width(String banner_bg_image_width) { this.banner_bg_image_width = banner_bg_image_width; } public String getBanner_bg_image_height() { return banner_bg_image_height; } public void setBanner_bg_image_height(String banner_bg_image_height) { this.banner_bg_image_height = banner_bg_image_height; } public String getBrand_image_url() { return brand_image_url; } public void setBrand_image_url(String brand_image_url) { this.brand_image_url = brand_image_url; } public String getBrand_image_width() { return brand_image_width; } public void setBrand_image_width(String brand_image_width) { this.brand_image_width = brand_image_width; } public String getBrand_image_height() { return brand_image_height; } public void setBrand_image_height(String brand_image_height) { this.brand_image_height = brand_image_height; } public String getBg_color() { return bg_color; } public void setBg_color(String bg_color) { this.bg_color = bg_color; } public String getAlbum_border_color() { return album_border_color; } public void setAlbum_border_color(String album_border_color) { this.album_border_color = album_border_color; } public String getAlbum_title_color() { return album_title_color; } public void setAlbum_title_color(String album_title_color) { this.album_title_color = album_title_color; } public String getIntro_color() { return intro_color; } public void setIntro_color(String intro_color) { this.intro_color = intro_color; } public List<String> getIntro_text() { return intro_text; } public void setIntro_text(List<String> intro_text) { this.intro_text = intro_text; } public List<AlbumsBean> getAlbums() { return albums; } public void setAlbums(List<AlbumsBean> albums) { this.albums = albums; } public static class AlbumsBean { /** * id : 3 * title : 简单的英文儿歌 * name : 简单英文儿歌 * image_url : http://img5g22.ergedd.com/album/3_1567662527435.jpg * image_gif : * image_ver : * ext : null * description : 简单易学经典英文儿歌 * status : c * video_count : 23 * play_count : 3879420 * icon_url : http://img5g22.ergedd.com/album/3_1513592708648.png * icon_gif : * index_recommend : 0 * copyright_sensitive : 0 * is_vip : 2 * type : c * sensitive : 0 * watch_areas : ["c"] * erge_img_url : * free : 5 * cost : 0 * price : 0 * expires_at : null * vip_price : 0 * publisher_name : Little Fox */ private int id; private String title; private String name; private String image_url; private String image_gif; private String image_ver; private Object ext; private String description; private int status; private int video_count; private int play_count; private String icon_url; private String icon_gif; private int index_recommend; private int copyright_sensitive; private int is_vip; private int type; private int sensitive; private String erge_img_url; private int free; private int cost; private int price; private Object expires_at; private int vip_price; private String publisher_name; private List<String> watch_areas; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImage_url() { return image_url; } public void setImage_url(String image_url) { this.image_url = image_url; } public String getImage_gif() { return image_gif; } public void setImage_gif(String image_gif) { this.image_gif = image_gif; } public String getImage_ver() { return image_ver; } public void setImage_ver(String image_ver) { this.image_ver = image_ver; } public Object getExt() { return ext; } public void setExt(Object ext) { this.ext = ext; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public int getVideo_count() { return video_count; } public void setVideo_count(int video_count) { this.video_count = video_count; } public int getPlay_count() { return play_count; } public void setPlay_count(int play_count) { this.play_count = play_count; } public String getIcon_url() { return icon_url; } public void setIcon_url(String icon_url) { this.icon_url = icon_url; } public String getIcon_gif() { return icon_gif; } public void setIcon_gif(String icon_gif) { this.icon_gif = icon_gif; } public int getIndex_recommend() { return index_recommend; } public void setIndex_recommend(int index_recommend) { this.index_recommend = index_recommend; } public int getCopyright_sensitive() { return copyright_sensitive; } public void setCopyright_sensitive(int copyright_sensitive) { this.copyright_sensitive = copyright_sensitive; } public int getIs_vip() { return is_vip; } public void setIs_vip(int is_vip) { this.is_vip = is_vip; } public int getType() { return type; } public void setType(int type) { this.type = type; } public int getSensitive() { return sensitive; } public void setSensitive(int sensitive) { this.sensitive = sensitive; } public String getErge_img_url() { return erge_img_url; } public void setErge_img_url(String erge_img_url) { this.erge_img_url = erge_img_url; } public int getFree() { return free; } public void setFree(int free) { this.free = free; } public int getCost() { return cost; } public void setCost(int cost) { this.cost = cost; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public Object getExpires_at() { return expires_at; } public void setExpires_at(Object expires_at) { this.expires_at = expires_at; } public int getVip_price() { return vip_price; } public void setVip_price(int vip_price) { this.vip_price = vip_price; } public String getPublisher_name() { return publisher_name; } public void setPublisher_name(String publisher_name) { this.publisher_name = publisher_name; } public List<String> getWatch_areas() { return watch_areas; } public void setWatch_areas(List<String> watch_areas) { this.watch_areas = watch_areas; } } } }
[ "121" ]
121
fb484aed5760d72844fab35a03043e66e61f0760
ad040865173dcfb2954b112a1d68d8b33761e955
/src/main/java/be/vdab/entities/ProductLine.java
2af86ea1bde985525d3f068627dd249ad589f99a
[]
no_license
WouterBoghaert/toysforboys
bbc6b129b3e75036bbcb3d94716bd59c1f224667
9f25d1a560a73ed7caec82be0aa1949f9aabb886
refs/heads/master
2021-05-06T02:45:55.562265
2017-12-20T14:45:56
2017-12-20T14:45:56
114,618,228
0
0
null
null
null
null
UTF-8
Java
false
false
1,622
java
package be.vdab.entities; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Version; @Entity @Table(name = "productlines") public class ProductLine implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; private String name; private String description; @Version private int version; public ProductLine(String name, int version) { this.name = name; this.version = version; } public ProductLine(String name, String description, int version) { this(name, version); this.description = description; } protected ProductLine() {} public long getId() { return id; } public String getName() { return name; } public String getDescription() { return description; } public int getVersion() { return version; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof ProductLine)) return false; ProductLine other = (ProductLine) obj; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; return true; } }
[ "cursist@LOK111-05" ]
cursist@LOK111-05
bbf0006458275f676d0f6d432e679142e31bccc7
c0fa504f41fea80fede0f8983f1a61ddab965c48
/app/src/main/java/com/yunfeng/gui/render/IProgramId.java
1296fe1e60ddb37a5f3a736ecdecf9f04f6b1c46
[ "MIT" ]
permissive
liang47009/demo
e05b4031a0feb2f6c083fce657733a35d0834af8
7193d14ca9a4a2c74568bf230056682b69915d99
refs/heads/master
2020-03-23T15:03:41.876937
2018-10-23T06:06:52
2018-10-23T06:06:52
141,718,910
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.yunfeng.gui.render; import android.content.Context; public interface IProgramId { String POSITION = "position"; String MATRIX = "matrix"; String COLOR = "color"; String TEXTURE = "texture"; void init(Context context); int get(String key); void start(); void end(); int getType(); }
[ "xiayunfeng2012@gmail.com" ]
xiayunfeng2012@gmail.com
5006bcf4af091ae5313837b7ac6d916105bb1667
c3380f33e005ac5f421f04162978d780e9f23fd6
/LogOutPerformance/src/main/java/com/dyp/kafka/controller/KafkaTest.java
21b0d7c923f1261ed05a52b355472f43b3063d44
[]
no_license
YanpingDong/WebRelatedDemo
361cc98985c2af3685d5e5d9822bc05c1eafdb4f
32cf295c0f3e2ccf63f8d6d7854c3fe7fd369a7f
refs/heads/master
2021-04-10T14:30:17.208591
2017-02-21T14:03:34
2017-02-21T14:03:34
26,516,193
0
0
null
null
null
null
UTF-8
Java
false
false
488
java
package com.dyp.kafka.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class KafkaTest { private static Logger LOG = LoggerFactory.getLogger(KafkaTest.class); @RequestMapping("kafka/log") public String kafkawelcome() { LOG.error("TEST PERFORMENCE, TO KAFKA"); return "welcome";//return welcome.jsp to client } }
[ "dyp@tcl.com" ]
dyp@tcl.com
ed31b2f8bd2b0592ef38ca57d6bca40abb6293f5
f9f82a813512ef1b6e6f0dbcc9b33d622c6e66ca
/quiz6no5.java
5ae1a5f2a3bf3e8e56aaac54b056af7a71a96ebc
[]
no_license
rishabh-parekh/test-java
0dc83d6e69748b21a09295979d8a667a2793f60b
d3f8eecebb1fda5d69031cd877f0a20403a60145
refs/heads/master
2021-01-11T03:08:21.855358
2016-11-28T03:11:18
2016-11-28T03:11:18
71,085,941
0
0
null
null
null
null
UTF-8
Java
false
false
258
java
public class quiz6no5 { public static void main (String [] args) { for(int i=0; i < 20 ; i++ ) { for( int j = 1; j < 6; j++) { System.out.print(i*5 + j + " "); } System.out.println(""); } } }
[ "rishabh.parekh00@gmail.com" ]
rishabh.parekh00@gmail.com
1bc8d4c0b263de9b9c5ae31edbb676cb05f4364a
9ae90b4afa1cef5b6d1dcd653e86de829e7c6021
/javaStudy/src/chap04_controlStatement/FlowEx1.java
1e9bb1f635d23a65ccd70b86d6649266345d057f
[]
no_license
hoyouni/JavaStudy
81f0774c3e1ddd8f4c994a05ef25ab66a3510e85
ba1d4ecec6631afc8d6c23eeb7ead614a0d445c8
refs/heads/master
2023-03-29T08:55:12.811306
2021-04-02T08:17:32
2021-04-02T08:17:32
344,370,536
0
0
null
null
null
null
UTF-8
Java
false
false
408
java
package chap04_controlStatement; public class FlowEx1 { public static void main(String[] args) { int x = 0; System.out.println("x = 0 일때 참인 것은? "); if(x == 0) System.out.println("1. x == 0"); if(x != 0) System.out.println("2. x != 0"); if(!(x == 0)) System.out.println("3. !(x == 0)"); if(!(x != 0)) System.out.println("4. !(x != 0)"); } }
[ "sgm00006@gmail.com" ]
sgm00006@gmail.com
d04edcf751d010a740fa3d34f930be6bb067eb32
95ba1a0d7e10586d42280d2454f270395428b390
/src/main/java/com/vb/aws/services/si/iam/IamUtilsImpl.java
1d924e72b17d421e283cd40aaa7ff3d4b9b5fb1f
[ "Apache-2.0" ]
permissive
code4innerpeace/AWSConfig
c5924b98fafd3b22aaa32a2e29050c6c45e4fa32
a06d31b591b571d9bbf8a8d413d58212fbf0a4dc
refs/heads/master
2021-01-13T14:56:41.277791
2016-12-19T17:42:31
2016-12-19T17:42:31
76,678,804
1
0
null
null
null
null
UTF-8
Java
false
false
4,819
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 com.vb.aws.services.si.iam; import com.amazonaws.AmazonClientException; import com.amazonaws.regions.Regions; import com.amazonaws.services.identitymanagement.AmazonIdentityManagement; import com.amazonaws.services.identitymanagement.AmazonIdentityManagementClient; import com.amazonaws.services.identitymanagement.model.ListMFADevicesRequest; import com.amazonaws.services.identitymanagement.model.ListMFADevicesResult; import com.amazonaws.services.identitymanagement.model.ListUsersRequest; import com.amazonaws.services.identitymanagement.model.ListUsersResult; import com.amazonaws.services.identitymanagement.model.User; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; /** * * @author Vijay Bheemineni */ public class IamUtilsImpl implements IamUtils { private AmazonIdentityManagement iamClient; /** * Parameterized constructor. Pass the AWS Region as parameter. * @param region */ public IamUtilsImpl(Regions region) { this.iamClient = new AmazonIdentityManagementClient().withRegion(region); } /** * Default constructor. */ public IamUtilsImpl() { this.iamClient = new AmazonIdentityManagementClient(); } /** * This method returns all Iam users. * @return List<User> returns all Iam users. * @throws AmazonClientException */ public List<User> getAllIamUsers() throws AmazonClientException { String marker = null; List<User> allIamUsers = new ArrayList<>(); try { // Fetch all iam users. while(true) { ListUsersRequest listUsersRequest = new ListUsersRequest(); listUsersRequest.setMarker(marker); ListUsersResult listUsersResult = this.iamClient.listUsers(listUsersRequest); allIamUsers.addAll(listUsersResult.getUsers()); // Check the listUsersResult is truncated. This method returns users in batches of 100. if ( listUsersResult.isTruncated() ) { marker = listUsersResult.getMarker(); } else { break; } } } catch(AmazonClientException e) { System.out.println("ERROR : fetching all iam users"); e.printStackTrace(); throw e; } List<String> allIamUsersName = allIamUsers.stream().map(e -> e.getUserName()).collect(Collectors.toList()); System.out.println("INFO : Number of Iam users : " + allIamUsers.size()); System.out.println("INFO : Iam users : " + allIamUsersName); return allIamUsers; } /** * Returns all Iam users for whom MFA is not enabled. * @param allIamUsers * @return List<User> :- return all Iam users whose MFA is not enabled. */ public List<User> getAllMFANotEnabledUsers(List<User> allIamUsers) { List<User> allMFANotEnabledUsers = new ArrayList<>(); if ( allIamUsers != null || allIamUsers.size() > 0 ) { for ( User user: allIamUsers) { if (! isMFAEnabled(user)) { allMFANotEnabledUsers.add(user); } } } System.out.println("INFO : Number of MFA Not Enabled Users : " + allMFANotEnabledUsers.size()); System.out.println("INFO : All MFA Not Enabled Users : " + allMFANotEnabledUsers); return allMFANotEnabledUsers; } /** * Checks if user MFA is enabled or not. * @param user * @return returns true, if MFA is enabled for the user. */ public Boolean isMFAEnabled(User user) throws AmazonClientException { Boolean mfaDeviceEnabled = false; try { if ( user != null ) { ListMFADevicesRequest listMFADevicesRequest = new ListMFADevicesRequest(user.getUserName()); ListMFADevicesResult listMFADevicesResult = this.iamClient.listMFADevices(listMFADevicesRequest); if ( listMFADevicesResult.getMFADevices().size() > 0) { mfaDeviceEnabled = true; } } }catch(AmazonClientException e) { System.out.println("ERROR : Fetching list of MFA Devices."); e.printStackTrace(); throw e; } //System.out.println("INFO : MFA enabled for the user? " + mfaDeviceEnabled); return mfaDeviceEnabled; } }
[ "bheemineni.vijay@gmail.com" ]
bheemineni.vijay@gmail.com
33dcc20b9754fc2417b8fc1e5724b429f8a99dff
426040f19e4ab0abb5977e8557451cfd94bf6c2d
/apks/aldi/src/b/k/l.java
4887748778bdd3fbb28f528168c92e2fa02344e1
[]
no_license
kmille/android-pwning
0e340965f4c27dfc9df6ecadddd124448e6cec65
e82b96d484e618fe8b2c3f8ff663e74f793541b8
refs/heads/master
2020-05-09T17:22:54.876992
2020-04-06T18:04:16
2020-04-06T18:04:16
181,300,145
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package b.k; import b.j; @j(a={1, 1, 13}, b={"kotlin/text/StringsKt__IndentKt", "kotlin/text/StringsKt__RegexExtensionsJVMKt", "kotlin/text/StringsKt__RegexExtensionsKt", "kotlin/text/StringsKt__StringBuilderJVMKt", "kotlin/text/StringsKt__StringBuilderKt", "kotlin/text/StringsKt__StringNumberConversionsJVMKt", "kotlin/text/StringsKt__StringNumberConversionsKt", "kotlin/text/StringsKt__StringsJVMKt", "kotlin/text/StringsKt__StringsKt", "kotlin/text/StringsKt___StringsJvmKt", "kotlin/text/StringsKt___StringsKt"}, d=1) public final class l extends w {} /* Location: /home/kmille/projects/android-pwning/apks/aldi/ALDI TALK_v6.2.1_apkpure.com-dex2jar.jar!/b/k/l.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "christian.schneider@androidloves.me" ]
christian.schneider@androidloves.me
32e0e6e1768d6a464d7c8235c8798a5515c85f06
1564bc9c05e5eca576e7e26ec6cb0672c6f7f1db
/src/test/java/com/datadrivedntesting/restapi/XlUtil.java
e71d3618ce90e758a8b8f283315d7ae9761f1f9e
[]
no_license
SaumyaRanjanDas96/ApiRestAssured
58036db5d6b1727403a95368114183e20f51f13f
9a93e78d9ba520235dc1e1ea518e9662083f5c3f
refs/heads/master
2023-04-02T19:14:08.473124
2021-04-15T06:32:53
2021-04-15T06:32:53
358,146,071
0
0
null
null
null
null
UTF-8
Java
false
false
2,041
java
package com.datadrivedntesting.restapi; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.EncryptedDocumentException; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; public class XlUtil { public static FileInputStream fi; public static FileOutputStream fo; public static Workbook wb; public static Sheet ws; public static Row row ; public static Cell cell; public static int getRowCount(String xlfile, String xlsheet) throws EncryptedDocumentException, IOException{ fi=new FileInputStream(xlfile); wb=WorkbookFactory.create(fi); ws = wb.getSheet(xlsheet); int rowcount = ws.getLastRowNum(); wb.close(); fi.close(); return rowcount; } public static int getCellCount(String xlfile, String xlsheet, int rownum) throws EncryptedDocumentException, IOException{ fi=new FileInputStream(xlfile); wb=WorkbookFactory.create(fi); ws = wb.getSheet(xlsheet); row = ws.getRow(rownum); int cellcount = row.getLastCellNum(); wb.close(); fi.close(); return cellcount; } public static String getCellData(String xlfile, String xlsheet, int rownum, int colnum) throws EncryptedDocumentException, IOException{ fi=new FileInputStream(xlfile); wb=WorkbookFactory.create(fi); ws = wb.getSheet(xlsheet); row = ws.getRow(rownum); cell = row.getCell(colnum); String data = cell.getStringCellValue(); wb.close(); fi.close(); return data; } void setCellValue(String xlfile, String xlsheet, int rownum, int colnum) throws EncryptedDocumentException, IOException{ fi=new FileInputStream(xlfile); wb=WorkbookFactory.create(fi); ws = wb.getSheet(xlsheet); row = ws.getRow(rownum); cell = row.getCell(colnum); String data = cell.getStringCellValue(); fo=new FileOutputStream(xlfile); wb.write(fo); wb.close(); fi.close(); fo.close(); } }
[ "saumyaranjand96@gmail.com" ]
saumyaranjand96@gmail.com
cc63828f8789e007baf743ea6f87a56c9279f12e
4680419b556e4a8eed2fa00d845dff26ee381348
/AsymmetricEncryption/src/com/asymmetricencryption/PublicKeyEncryption/Tester.java
25aa4d11f85fcd37ae7c79a5dfb7aa16beb8e445
[]
no_license
manpreet95/Encryption
935c855dcdbd4893905586ec04ea34c671db496c
a7db445fba1bbcfb9b250097760c2cdec8c02c50
refs/heads/master
2020-03-14T14:22:01.314219
2018-05-01T21:08:38
2018-05-01T21:08:38
131,652,134
0
0
null
null
null
null
UTF-8
Java
false
false
1,253
java
package com.asymmetricencryption.PublicKeyEncryption; import java.security.PrivateKey; import java.security.PublicKey; public class Tester { public static void main(String[] args) throws Exception { // TODO Auto-generated method stub Encryption encryption = new EncryptionImpl(); String keyStorePath = "D:/Work/KeyStore/keystore.jks"; String keyStoreType = "JCEKS"; char[] password = "123456789".toCharArray(); String alias = "demoRSA"; String publicKeyPath = "D:/Work/KeyStore/demoRSAPublicKey.cer"; String algorithm = "RSA"; String plainText = "Hello World"; System.out.println("Original Plain text: "+plainText); //fetch public key PublicKey publicKey = encryption.getPublicKey(publicKeyPath); //encrypt data String encodedCipherText = encryption.encryptData(plainText, publicKey, algorithm); System.out.println("Encoded cipher Text: "+new String(encodedCipherText)); //fetch private key PrivateKey privateKey = encryption.getPrivateKey(keyStorePath, keyStoreType, password, alias); //decrypt data String result = encryption.decryptData(encodedCipherText, privateKey, algorithm); System.out.println("Decrypted Plain Text: "+result); } }
[ "noreply@github.com" ]
noreply@github.com
9dfba94058d89e182e2df9600d9eef3657ca00c2
c723912874f9ed950980996a5f18092e90b9dbee
/src/main/java/com/packt/naturebesttouch/domain/repository/impl/InMemoryProductRepository.java
bc9ecb61558207c46b0d2f9992e25fb82d243bc8
[]
no_license
lucicabest/naturebesttouch
9042c1792936c7374c3a841f1ccc3aa83ce9f41b
fa471dc6a1edbf2efe78de409c03fc052dcf2c1e
refs/heads/master
2020-03-18T22:50:45.635843
2018-06-11T08:17:22
2018-06-11T08:17:22
135,368,697
0
1
null
null
null
null
UTF-8
Java
false
false
9,335
java
package com.packt.naturebesttouch.domain.repository.impl; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; //import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.support.GeneratedKeyHolder; import org.springframework.jdbc.support.KeyHolder; import org.springframework.stereotype.Repository; import com.packt.naturebesttouch.domain.Product; import com.packt.naturebesttouch.domain.ProductSizePriceQuantity; import com.packt.naturebesttouch.domain.repository.ProductRepository; import com.packt.naturebesttouch.exception.ProductNotFoundException; //import com.packt.webstore.domain.repository.impl.InMemoryProductRepository.ProductMapper; @Repository public class InMemoryProductRepository implements ProductRepository { @Autowired private NamedParameterJdbcTemplate jdbcTemplate; // @Override public List<Product> getAllProducts() { Map<String, Object> params = new HashMap<String, Object>(); List<Product> result = jdbcTemplate.query("SELECT * FROM products", params, new ProductMapper()); return result; } // public List<ProductSizePriceQuantity> getAllSPQ(String productPriceId) { // // String SQL = "SELECT * FROM PRICES WHERE ID =:id"; // Map<String, Object> params = new HashMap<String, Object>(); // params.put("id", productPriceId); // // List<ProductSizePriceQuantity> result = jdbcTemplate.query("SELECT * FROM // prices", params, new ProductSizePriceQuantityMapper()); // return result; // } private class ProductMapper implements RowMapper<Product> { // private ProductSizePriceQuantityMapper productSPQMapper; @Override public Product mapRow(ResultSet rs, int rowNum) throws SQLException { Product product = new Product(); String id = rs.getString("ID"); // Cart cart = new Cart(id); // String SQL = String.format("SELECT * FROM PRICES WHERE PRODUCT_ID = '%s' ORDER BY SIZE", id); String SQL = String.format("SELECT PRODUCTS.NAME, PRICES.ID, PRICES.PRODUCT_ID, PRICES.SIZE, PRICES.PRICE, PRICES.UNITS_IN_STOCK, PRICES.UNITS_IN_ORDER FROM PRODUCTS INNER JOIN PRICES ON PRODUCTS.ID = PRICES.PRODUCT_ID WHERE PRICES.PRODUCT_ID = '%s' ORDER BY SIZE", id); List<ProductSizePriceQuantity> productsSPQ = jdbcTemplate.query(SQL, new ProductSizePriceQuantityMapper()); // cart.setCartItems(cartItems); // return cart; product.setProductId(rs.getString("ID")); product.setName(rs.getString("NAME")); product.setUnitSPQ(productsSPQ); product.setDescription(rs.getString("DESCRIPTION")); // product.setUnitPrice(rs.getBigDecimal("UNIT_PRICE")); // product.setManufacturer(rs.getString("MANUFACTURER")); product.setCategory(rs.getString("CATEGORY")); // product.setCondition(rs.getString("PRODUCT_CONDITION")); // product.setUnitsInStock(rs.getLong("UNITS_IN_STOCK")); // product.setUnitsInOrder(rs.getLong("UNITS_IN_ORDER")); // product.setDiscontinued(rs.getBoolean("DISCONTINUED")); return product; } } // private static final class ProductSizePriceQuantityMapper implements // RowMapper<ProductSizePriceQuantity> { // // public ProductSizePriceQuantity mapRow(ResultSet rs, int rowNum) throws // SQLException { // ProductSizePriceQuantity productSPQ = new ProductSizePriceQuantity(); // productSPQ.setPriceId(rs.getString("ID")); // productSPQ.setSize(rs.getFloat("SIZE")); // productSPQ.setPrice(rs.getBigDecimal("DESCRIPTION")); //// product.setUnitPrice(rs.getBigDecimal("UNIT_PRICE")); //// product.setManufacturer(rs.getString("MANUFACTURER")); //// product.setCategory(rs.getString("CATEGORY")); //// product.setCondition(rs.getString("PRODUCT_CONDITION")); // productSPQ.setUnitsInStock(rs.getLong("UNITS_IN_STOCK")); // productSPQ.setUnitsInOrder(rs.getLong("UNITS_IN_ORDER")); //// product.setDiscontinued(rs.getBoolean("DISCONTINUED")); // return productSPQ; // } // } @Override public void updateStock(String id, long noOfUnits) { String SQL = "UPDATE PRICES SET UNITS_IN_STOCK = :unitsInStock WHERE ID = :id"; Map<String, Object> params = new HashMap<>(); params.put("unitsInStock", noOfUnits); params.put("id", id); jdbcTemplate.update(SQL, params); } // @Override public List<Product> getProductsByCategory(String category) { String SQL = "SELECT * FROM PRODUCTS WHERE CATEGORY =:category"; Map<String, Object> params = new HashMap<String, Object>(); params.put("category", category); return jdbcTemplate.query(SQL, params, new ProductMapper()); } // // public List<Product> getProductsByFilter(Map<String, List<String>> // filterParams) { // String SQL = "SELECT * FROM PRODUCTS WHERE CATEGORY IN (:categories) AND // MANUFACTURER IN (:brands)"; // return jdbcTemplate.query(SQL, filterParams, new ProductMapper()); // } @Override public Product getProductById(String productID) { String SQL = "SELECT * FROM PRODUCTS WHERE ID =:id"; Map<String, Object> params = new HashMap<String, Object>(); params.put("id", productID); try { return jdbcTemplate.queryForObject(SQL, params, new ProductMapper()); } catch (DataAccessException e) { throw new ProductNotFoundException(productID); } // return jdbcTemplate.queryForObject(SQL, params, new ProductMapper()); } // @Override // public Product getProductBycategoryAndPrice(String category, String price) { // String SQL = "SELECT * FROM PRODUCTS WHERE CATEGORY =:category AND UNIT_PRICE // =:price"; // Map<String, Object> params = new HashMap<String, Object>(); // params.put("category", category); // params.put("price", price); // return jdbcTemplate.queryForObject(SQL, params, new ProductMapper()); // } // @Override // public List<Product> getProductsByCategoryByFilters(String category, // Map<String, String> filterParams, String brand) { // String SQL = "SELECT * FROM PRODUCTS WHERE MANUFACTURER =:brand AND CATEGORY // =:category AND UNIT_PRICE BETWEEN :low AND :high"; // Map<String, String> params = new HashMap<String, String>(); // params.put("category", category); // params.put("brand", brand); // params.putAll(filterParams); // return jdbcTemplate.query(SQL, params, new ProductMapper()); // } // @Override // public List<Product> getProductsByCategoryByFilter(String category, // Map<String, String> filterParams, // String brands) { // // TODO Auto-generated method stub // // String SQL = "SELECT * FROM PRODUCTS WHERE CATEGORY IN (:category) AND // MANUFACTURER IN (:brands) AND UNIT_PRICE BETWEEN (:low) AND (:high) "; // Map<String, Object> params = new HashMap<String, Object>(); // params.put("category", category); // params.put("brands", brands); // params.putAll(filterParams); // return jdbcTemplate.query(SQL, params, new ProductMapper()); // } @Override public String addProduct(Product product) { // String SQL = "INSERT INTO PRODUCTS (ID, " + "NAME," + "DESCRIPTION," + // "UNIT_PRICE," + "MANUFACTURER," // + "CATEGORY," + "CONDITION," + "UNITS_IN_STOCK," + "UNITS_IN_ORDER," + // "DISCONTINUED) " // + "VALUES (:id, :name, :desc, :price, :manufacturer, :category, :condition, // :inStock, :inOrder, :discontinued)"; String SQL = "INSERT INTO PRODUCTS (NAME," + "DESCRIPTION," + "CATEGORY) " + "VALUES (:name, :desc, :category)"; Map<String, Object> params = new HashMap<>(); // params.put("id", product.getProductId()); params.put("name", product.getName()); params.put("desc", product.getDescription()); // params.put("price", product.getUnitPrice()); params.put("category", product.getCategory()); // params.put("inStock", product.getUnitsInStock()); // params.put("inOrder", product.getUnitsInOrder()); KeyHolder keyHolder = new GeneratedKeyHolder(); jdbcTemplate.update(SQL, new MapSqlParameterSource(params), keyHolder); // for (ProductSizePriceQuantity productSPQ : product.getUnitSPQ()) { // String SQL_SPQ = "INSERT INTO PRICES (PRODUCT_ID," + "SIZE," + "PRICE," + "UNITS_IN_STOCK," // + "UNITS_IN_ORDER) " + "VALUES (:id, :size, :price, :unitsInStock, :unitsInOrder)"; //// params.put("productId", product.getProductId()); // params.put("size", productSPQ.getSize()); // params.put("price", productSPQ.getPrice()); // params.put("unitsInStock", productSPQ.getUnitsInStock()); // params.put("unitsInOrder", productSPQ.getUnitsInOrder()); // jdbcTemplate.update(SQL, params); // } return keyHolder.getKey().toString(); } @Override public void addProductSPQ(ProductSizePriceQuantity productSPQ, String productId) { Map<String, Object> params = new HashMap<>(); String SQL_SPQ = "INSERT INTO PRICES (PRODUCT_ID," + "SIZE," + "PRICE," + "UNITS_IN_STOCK," + "UNITS_IN_ORDER) " + "VALUES (:productId, :size, :price, :unitsInStock, :unitsInOrder)"; params.put("productId", productId); params.put("size", productSPQ.getSize()); params.put("price", productSPQ.getPrice()); params.put("unitsInStock", productSPQ.getUnitsInStock()); params.put("unitsInOrder", 0); jdbcTemplate.update(SQL_SPQ, params); } }
[ "lucica_best@yahoo.com" ]
lucica_best@yahoo.com
d0b9bb79dd997cf34984d7665e97d80ecac526df
1a8ce75f91eb8b8ab7b77e89758ae0f8a53bcb31
/LearningStreamApi/src/application/ProgramStreamAPI.java
742a85b7218ce0854a6281c064de016b5725a68a
[]
no_license
LuccasYuridosSantos/javaDeveloper-digitalInnovationOne
5ec80729d46fb497e467e6757d158693ecc7719b
b6148ae3cb6955c942cfd9d7ccb483f6cce4ff82
refs/heads/main
2023-03-16T08:50:10.321933
2021-03-08T17:30:23
2021-03-08T17:30:23
343,391,774
0
0
null
null
null
null
UTF-8
Java
false
false
3,728
java
package application; import model.Student; import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.stream.Collector; import java.util.stream.Collectors; public class ProgramStreamAPI { public static void main(String[] args) { //Cria uma coleção de students List<String> students = new ArrayList<>(); //adicionando students para coleção students.add("Pedro"); students.add("Thayse"); students.add("Marcelo"); students.add("Carla"); students.add("Juliana"); students.add("Thiago"); students.add("Rafael"); //stream().count() retorna a contagem de elementos da coleção System.out.println("Contagem: " + students.stream().count()); //Retorna o elemento com maior numero de letras System.out.println("Maior numero de letras: "+students.stream().max(Comparator.comparingInt(String::length))); //Retorna o elemento com menot numero de letras System.out.println("Menor numero de letras: "+students.stream().min(Comparator.comparingInt(String::length))); //Retorna o elemento que tem a letra R no nome System.out.println("Com a letra r no nome: "+students.stream().filter((student)-> student.toLowerCase().contains("r")).collect(Collectors.toList())); //Retorna uma nova coleção com nomes concatenados a quantidade de letra de cada nome System.out.println("Coleção com a quantidade de letras: " + students.stream().map(student -> student.concat(" - ").concat(String.valueOf(student.length()))).collect(Collectors.toList())); //Retorna apenas os 3 primeiros elementos da coleção System.out.println("Retonar os 3 primeiros: "+ students.stream().limit(3).collect(Collectors.toList())); //Exibe cada elemento no console, e depois retorna a mesma coleção System.out.println("Retorna os elemetos: "+ students.stream().peek(System.out::println).collect(Collectors.toList())); //Exibe cada elemento no console, sem retorna outra coleção students.stream().forEach(System.out::println); // Retorna true se todos elementos possuem a letra W no nome System.out.println("Todos elementos com a letra W: " + students.stream().allMatch((element)-> element.contains("w")) ); // Retorna true se algum elemento possuem a letra a minúscula no nome System.out.println("Algum elemento possui a letra a: "+ students.stream().anyMatch((e) -> e.contains("a"))); //Retorna true se nenhum elemento possui a letra a minúscula no nome System.out.println("Nenhum elemento possui a letra a: " + students.stream().noneMatch((element) -> element.contains("a"))); //Retorna o primeiro elemento da coleção, se existir exibe no console System.out.print("Retorna o primeiro elemento: "); students.stream().findFirst().ifPresent(System.out::println); //Exemplo de operação encadeada System.out.print("Operação encadeada: "); System.out.println(students.stream() .peek(System.out::println) .map(student -> student.concat(" - ") .concat(String.valueOf(student.length()))) .peek(System.out::println) // .filter((student)-> // student.toLowerCase().contains("r")) // .collect(Collectors.toList())); // .collect(Collectors.joining(", "))); // .collect(Collectors.toSet())); .collect(Collectors.groupingBy(student -> student.substring(student.indexOf("-")+1)))); } }
[ "luccas.yui@hotmail.com" ]
luccas.yui@hotmail.com
a0a3fcbee780f49a6351c8125c69628e98319a49
91ba9c9cd8b86561e1d18e8d8631cafa53232f2d
/src/main/java/org/yeastrc/proteomics/spectrum/ionmass/IonMassUtils.java
1485ff9c50c78a9a7e793304c49e3b5ae139da15
[ "Apache-2.0" ]
permissive
yeastrc/proteomics-utils
373ec20da09f5b2efe7da485761e2ca5f432bc52
bd39acbc7700b633570d675f571aca80780c6b93
refs/heads/master
2021-01-19T23:00:58.343010
2020-07-09T21:31:17
2020-07-09T21:31:17
88,908,554
0
0
null
null
null
null
UTF-8
Java
false
false
1,445
java
package org.yeastrc.proteomics.spectrum.ionmass; public class IonMassUtils { /** * Masses of this type are the calculated actual mass of an * uncharged peptide (the sum of the masses of the amino acids) */ public final static int ION_MASS_TYPE_ACTUAL = 0; /** * Masses of this type are the M+H+ (mass plus a proton) of * a +1 charged peptide ion */ public final static int ION_MASS_TYPE_PLUS_PROTON = 0; /** * Get the Mass object representing the mass represented by the given m/z and charge * @param massToCharge Reported m/z value * @param charge Reported charge * @param precision Number of decimal places to store for mass * @return * @throws Exception */ public static IonMass getMassFromMassToCharge( double massToCharge, int charge, int precision ) throws Exception { if( charge < 1 ) throw new RuntimeException( "Charge must be at least 1." ); double cmass = ( massToCharge * charge ) - ( charge * IonMassConstants.PROTON ); return new IonMass( cmass, IonMassUtils.ION_MASS_TYPE_ACTUAL, precision ); } public static double getMassToCharge( IonMass mass, int charge, int precision ) throws Exception { // start with the M+H+ mass double mz = mass.getMassValue( ION_MASS_TYPE_PLUS_PROTON ).doubleValue(); mz += ( charge - 1 ) * IonMassConstants.PROTON; // add on the correct number of proton masses mz /= charge; // divide by the charge return mz; } }
[ "mriffle@uw.edu" ]
mriffle@uw.edu
c6f4db2ae1d7744d5f34044603b035578d6fa73f
610faf0810147c7999be7fc4ad12b557954d8392
/src/MultiVisitor/Client.java
27d6d3380dba69f2c9084026213eeec7689efb4c
[]
no_license
yaoyuan2018/JavaDesign
2fecdb0d37d1fefaa37e40e270a12eaf08e387de
7b3e5bff0fc12b8e1009e3e99c71c66e96b46faf
refs/heads/master
2020-04-07T15:58:31.702465
2018-12-10T02:38:14
2018-12-10T02:38:14
158,509,767
0
0
null
null
null
null
UTF-8
Java
false
false
1,887
java
package MultiVisitor; import java.util.ArrayList; import java.util.List; /** * @Author: Y_uan * @Date: 2018/12/7 11:37 * @mail: yy494818027@163.com */ public class Client { public static void main(String[] args) { //展示报表访问者 IShowVisitor showVisitor = new ShowVisitor(); //汇总报表的访问者 ITotalVisitor totalVisitor = new TotalVisitor(); for (Employee emp:mockEmployee()){ emp.accept(showVisitor);//接受展示报表访问者 emp.accept(totalVisitor);//接受汇总表访问者 } //展示报表 showVisitor.reprot(); //汇总报表 totalVisitor.totalSalary(); } //模拟出公司的人员情况,我们可以想象这个数据室通过持久层传递过来的 public static List<Employee> mockEmployee(){ List<Employee> empList = new ArrayList<Employee>(); //产生张三这个员工 CommonEmployee zhangSan = new CommonEmployee(); zhangSan.setJob("编写Java程序,绝对的蓝领、苦工加搬运工"); zhangSan.setName("张三"); zhangSan.setSalary(1800); zhangSan.setSex(VisitorPattern.Employee.MALE); empList.add(zhangSan); //产生李四这个员工 CommonEmployee liSi = new CommonEmployee(); liSi.setJob("页面美工,审美素质太不流行了!"); liSi.setName("李四"); liSi.setSalary(1900); liSi.setSex(VisitorPattern.Employee.FEMALE); empList.add(liSi); //再产生一个经理 Manager wangwu = new Manager(); wangwu.setName("王五"); wangwu.setPerformance("基本上是负值,但是我会拍马屁呀"); wangwu.setSalary(18750); wangwu.setSex(VisitorPattern.Employee.MALE); empList.add(wangwu); return empList; } }
[ "yy494818027@163.com" ]
yy494818027@163.com
7a7b05edff0c4ca8c5e823cbfbd89e4926abdb45
5688ca64cc1069c0d1293cfed09c844804caac2b
/Documents/Programms/cafe_manager/src/main/java/Entities/OrderItem.java
236ca61aa0e4a83917d476e9b431b2fcc3b3d022
[]
no_license
abdalevg/cafe_manager
366bf21125c28ddfcdfe58b3bc61d319344b1491
5cfe2070637b5b2f84db427ee084d87753e51dc7
refs/heads/master
2022-11-23T12:56:31.886509
2020-10-19T09:41:08
2020-10-19T09:41:08
140,187,919
0
0
null
2022-11-16T05:22:34
2018-07-08T17:20:59
Java
UTF-8
Java
false
false
2,624
java
package Entities; import java.io.Serializable; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; @Entity @Table(name="ORDER_ITEM") @XmlRootElement public class OrderItem implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="ID_ORDER") private int id; @Column(name="TABLE_NUMBER") private int tableNumber; @Column(name="TIME_OF_ORDER") private String orderTime; @Column(name="IS_PAID") private int isPaid; @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="ORDER_WAITER_ID",referencedColumnName="WAITER_ID") private Waiter waiter; @ManyToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL) @JoinTable(name="MENU_ITEM_ORDER", joinColumns = @JoinColumn(name="ID_ORDER"), inverseJoinColumns = @JoinColumn(name="ID_MENU_ITEM") ) private List<MenuItem> menuItems; public int getId() { return id; } public void setId(int id) { this.id = id; } public int getTableNumber() { return tableNumber; } public void setTableNumber(int tableNumber) { this.tableNumber = tableNumber; } public String getOrderTime() { return orderTime; } public void setOrderTime(String orderTime) { this.orderTime = orderTime; } public int isIsPaid() { return isPaid; } public void setIsPaid(int isPaid) { this.isPaid = isPaid; } public Waiter getWaiter() { return waiter; } public void setWaiter(Waiter waiter) { this.waiter = waiter; /*if(!waiter.getOrders().contains(this)){ waiter.getOrders().add(this); }*/ } @XmlTransient public List<MenuItem> getMenuItems() { return menuItems; } public void setMenuItems(List<MenuItem> menuItems) { this.menuItems = menuItems; } @Override public String toString() { return "Entities.orderItem[ id=" + id + " ]"; } }
[ "abdalevg@fit.cvut.cz" ]
abdalevg@fit.cvut.cz
672af25ca9367efaca3ec2d0b062dcb421a9c916
639d10b5605b03635f76511b51b0e159c35ff2b3
/CTCI/ModerateProblems/NumberSwapper.java
89625946e3e8af325c5287b50a247e301ce695b3
[]
no_license
nishant4498/CodingProblems
87d8722e1e775b287f96e0736edc5bb3f236ce90
9c4f9ebc84dc2c7cd97c5fd9a8dd22c8a48235a6
refs/heads/master
2020-09-27T20:55:17.104235
2017-03-29T22:06:40
2017-03-29T22:06:46
66,473,612
2
0
null
null
null
null
UTF-8
Java
false
false
732
java
package ModerateProblems; /** * CTCI 16.1 */ public class NumberSwapper { public static void main(String[] args) { int a = 5, b = 10; int[] result = swapNumber(a, b); System.out.println("After Swapping: "+ result[0]+ " " + result[1]); int c = 20, d = 25; int[] result1 = swapNumberXOR(c, d); System.out.println("After Swapping: "+ result1[0]+ " " + result1[1]); } public static int[] swapNumber(int a, int b){ a = a + b; b = a - b; a = a - b; int[] result = new int[2]; result[0] = a; result[1] = b; return result; } public static int[] swapNumberXOR(int a, int b){ a = a ^ b; b = a ^ b; a = a ^ b; int[] result = new int[2]; result[0] = a; result[1] = b; return result; } }
[ "nishant4498@gmail.com" ]
nishant4498@gmail.com
ed6c732cf77b4a14a1356186ab6b576c6e99fee0
f558a4ca08078f50eea38f1c363c605dede69919
/midireader/jmqt/QTHelperGUI.java
6b2c2bdf7436b1ac9106391d85420f4e6aa5cae0
[]
no_license
adamnemecek/MusicBox
2027c0f40501f0b52762356bf809ef1bcf4bb406
25402d12bd11b6148d469f3a9558b1de1a9b7d87
refs/heads/master
2021-01-15T10:54:07.310122
2015-11-11T07:28:25
2015-11-11T07:28:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,730
java
/* <This Java Class is part of the jMusic API version 1.5, March 2004.> Copyright (C) 2000 Andrew Sorensen & Andrew Brown This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package jmqt; import jm.JMC; import jm.music.data.*; import jm.util.*; import jm.audio.*; import java.awt.*; import java.awt.event.*; //import javax.swing.*; import jmqt.*; /** * This jMusic utility is designed to be extended by user classes. It will * provide a simple graphical interface that speeds up the cycle of * composing-auditioning-recomposing by minimising the need for recompiling * simple changes. It is especially useful for novice Java programmers. * * To use the HelperGUI class write a standard jMusic class that extends * this class. It shopuld have a main() method and a constructor. * Make a super() call in the constructor. Overwrite the * compose() method [which returns a Score object] and include the compositional * logic in that method. * * To render a score as an audio file, an Instrument array needs to be declared * and assigned to the Instrument array varianble 'insts' - which is already * declared in the HelperGUI class. As in this * example code fragment: * Instrument sine = new SineInst(44100); * Instrument[] instArray = {sine}; * insts = instArray; * * There are five variables each with a slider that can be accessed to change * values in the composition. Each variable, named 'variableA' to 'variableE', * returns an integer values between 0 and 127. * * @author Andrew Brown */ // To make this class use swing composents replace the GUI attributes (Button etc.) // with ones starting with the letter J (JButton etc.) and uncomment the // javax.swing import statement above and use the commented // getContentPane().add(controls) statement below. public class QTHelperGUI extends Frame implements JMC, ActionListener, AdjustmentListener{ //------------------- // Attributes //------------------- protected Score score = new Score(); private Button composeBtn, playBtn, stopBtn, showBtn, printBtn, saveBtn, renderBtn; private TextField midiName, audioName; private Scrollbar sliderA, sliderB, sliderC, sliderD, sliderE; private Label labelA, labelB, labelC, labelD, labelE; private QTUtil qtu = new QTUtil(); protected Instrument[] insts; protected int variableA, variableB, variableC, variableD, variableE; /* // for testing only public static void main(String[] args) { new HelperGUI(); }*/ //------------------- // Constructor //------------------- public QTHelperGUI() { super("jMusic Helper Interface"); //Panel bg = this.getContentPane(); this.setLayout(new BorderLayout()); Panel controls = new Panel(); controls.setLayout(new GridLayout(7, 1)); //this.getContentPane().add(controls); this.add(controls, "North"); Panel sliders = new Panel(); sliders.setLayout(new GridLayout(6, 1)); this.add(sliders, "Center"); Panel topControls = new Panel(); Panel middleControls = new Panel(); Panel middle2Controls = new Panel(); Panel bottomControls = new Panel(); Label create = new Label("Create and Review"); create.setAlignment(Label.CENTER); controls.add(create); controls.add(topControls); //Label display = new Label("Display the score"); //display.setAlignment(Label.CENTER); //controls.add(display); controls.add(middleControls); Label midi = new Label("Save as..."); midi.setAlignment(Label.CENTER); controls.add(midi); controls.add(middle2Controls); //Label audio = new Label("Save as an audio file"); //audio.setAlignment(Label.CENTER); //controls.add(audio); controls.add(bottomControls); Label variables = new Label("Control compositional parameters"); variables.setAlignment(Label.CENTER); controls.add(variables); // butons composeBtn = new Button("Compose"); composeBtn.addActionListener(this); topControls.add(composeBtn); playBtn = new Button("QT Play"); playBtn.addActionListener(this); playBtn.setEnabled(false); topControls.add(playBtn); stopBtn = new Button("QT Stop"); stopBtn.addActionListener(this); stopBtn.setEnabled(false); topControls.add(stopBtn); showBtn = new Button("View.show()"); showBtn.addActionListener(this); showBtn.setEnabled(false); middleControls.add(showBtn); printBtn = new Button("View.print()"); printBtn.addActionListener(this); printBtn.setEnabled(false); middleControls.add(printBtn); saveBtn = new Button("Write.midi()"); saveBtn.addActionListener(this); saveBtn.setEnabled(false); middle2Controls.add(saveBtn); midiName = new TextField("FileName.mid", 20); middle2Controls.add(midiName); renderBtn = new Button("Write.au()"); renderBtn.addActionListener(this); renderBtn.setEnabled(false); bottomControls.add(renderBtn); audioName = new TextField("FileName.au", 20); bottomControls.add(audioName); //sliders Panel sliderAPanel = new Panel(new BorderLayout()); labelA = new Label(" variableA = 0 "); sliderAPanel.add(labelA, "West"); sliderA = new Scrollbar(Scrollbar.HORIZONTAL, 0, 15, 0, (127+ 15)); sliderA.addAdjustmentListener(this); sliderAPanel.add(sliderA, "Center"); sliders.add(sliderAPanel); Panel sliderBPanel = new Panel(new BorderLayout()); labelB = new Label(" variableB = 0 "); sliderBPanel.add(labelB, "West"); sliderB = new Scrollbar(Scrollbar.HORIZONTAL, 0, 15, 0, (127+ 15)); sliderB.addAdjustmentListener(this); sliderBPanel.add(sliderB, "Center"); sliders.add(sliderBPanel); Panel sliderCPanel = new Panel(new BorderLayout()); labelC = new Label(" variableC = 0 "); sliderCPanel.add(labelC, "West"); sliderC = new Scrollbar(Scrollbar.HORIZONTAL, 0, 15, 0, (127+ 15)); sliderC.addAdjustmentListener(this); sliderCPanel.add(sliderC, "Center"); sliders.add(sliderCPanel); Panel sliderDPanel = new Panel(new BorderLayout()); labelD = new Label(" variableD = 0 "); sliderDPanel.add(labelD, "West"); sliderD = new Scrollbar(Scrollbar.HORIZONTAL, 0, 15, 0, (127+ 15)); sliderD.addAdjustmentListener(this); sliderDPanel.add(sliderD, "Center"); sliders.add(sliderDPanel); Panel sliderEPanel = new Panel(new BorderLayout()); labelE = new Label(" variableE = 0 "); sliderEPanel.add(labelE, "West"); sliderE = new Scrollbar(Scrollbar.HORIZONTAL, 0, 15, 0, (127+ 15)); sliderE.addAdjustmentListener(this); sliderEPanel.add(sliderE, "Center"); sliders.add(sliderEPanel); // filler Label filler = new Label(" "); sliders.add(filler); this.pack(); this.setVisible(true); } //------------------- // methods //------------------- public void actionPerformed(ActionEvent e) { if (e.getSource() == composeBtn) composeScore(); if (e.getSource() == playBtn) playScore(); if (e.getSource() == stopBtn) stopScore(); if (e.getSource() == showBtn) showScore(); if (e.getSource() == printBtn) printScore(); if (e.getSource() == saveBtn) saveScore(); if (e.getSource() == renderBtn) renderScore(); } private void composeScore() { playBtn.setEnabled(true); stopBtn.setEnabled(true); showBtn.setEnabled(true); printBtn.setEnabled(true); saveBtn.setEnabled(true); renderBtn.setEnabled(true); // get composed score score = compose(); } /** * The compose() method should be overridden by classes that extend this class. */ protected Score compose() { // Simple example composition Phrase phrase = new Phrase(); Score s = new Score(new Part(phrase)); //for(int i = 0; i < 8; i++) { Note n = new Note (48 + (int)(Math.random() * variableA), 0.5 + variableB * 0.25); phrase.addNote(n); //} //Instrument[] tempInsts = {new SineInst(22000)}; //insts = tempInsts; return s; } private void playScore() { qtu.stopPlayback(); qtu.playback(score); } private void stopScore() { qtu.stopPlayback(); } private void showScore() { View.show(score, this.getSize().width + 15, 0); } private void printScore() { View.print(score); } private void saveScore() { String fileName = midiName.getText().trim(); if (fileName != null){ Write.midi(score, fileName); } else Write.midi(score); } private void renderScore() { String fileName = audioName.getText().trim(); if (fileName != null){ Write.au(score, fileName, insts); } else Write.au(score, "RenderedFile.au", insts); } public void adjustmentValueChanged(java.awt.event.AdjustmentEvent ae) { if (ae.getSource() == sliderA) { labelA.setText(" variableA = " + sliderA.getValue()); variableA = new Integer(sliderA.getValue()).intValue(); } if (ae.getSource() == sliderB) { labelB.setText(" variableB = " + sliderB.getValue()); variableB = new Integer(sliderB.getValue()).intValue(); } if (ae.getSource() == sliderC) { labelC.setText(" variableC = " + sliderC.getValue()); variableC = new Integer(sliderC.getValue()).intValue(); } if (ae.getSource() == sliderD) { labelD.setText(" variableD = " + sliderD.getValue()); variableD = new Integer(sliderD.getValue()).intValue(); } if (ae.getSource() == sliderE) { labelE.setText(" variableE = " + sliderE.getValue()); variableE = new Integer(sliderE.getValue()).intValue(); } } }
[ "GDI@CSE510-LIU" ]
GDI@CSE510-LIU
b29b888dda5d3b54e33d51c999757ea0a619d47a
e2b3dd371fa805a80eccd26fa93559fd02e0992b
/app/src/main/java/com/HanBurhan/Tasks/Model/ToDoModel.java
2a345ab4422f717aa1ce7bf016aaf15e2738fac0
[]
no_license
HanBurhan/TasksApp
ea177bfe935a0cbeb29eea4a4b182813d904e3b5
c0fe98b7bc1a7be0218c4701b7edd1b6ec33457b
refs/heads/master
2023-08-22T17:59:35.322171
2021-10-14T09:35:45
2021-10-14T09:35:45
417,063,034
0
0
null
null
null
null
UTF-8
Java
false
false
494
java
package com.HanBurhan.Tasks.Model; public class ToDoModel { private String task; private int id, status; public String getTask() { return task; } public void setTask(String task) { this.task = task; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } }
[ "ozdemirburhan787@gmail.com" ]
ozdemirburhan787@gmail.com
bc82c780dc9b0b75e19148a3d252bb5bccb58c08
c4cda6402c0e5d354a900f34ade93e7b7867fa25
/HelloWebView/gen/com/kevingomara/hellowebview/R.java
58a1bf7e8889ca36c0c54842761110fc175d9a19
[]
no_license
neojjang/LearningAndroid
bbabaa64c4bc06a33ac603b6bba737b7c857a165
eaadbd4957f06c0c233e716ae6967093f222e58b
refs/heads/master
2021-01-15T23:51:30.635877
2011-07-12T22:35:35
2011-07-12T22:35:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.kevingomara.hellowebview; public final class R { public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; } public static final class id { public static final int webview=0x7f050000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000; } }
[ "kevin@appiction.com" ]
kevin@appiction.com
d7fb2b629a92378853cc6aa290ebc5e2dad5cbf3
be2cb98b7faca3f01aaf16a2858a00f47c757987
/lib/glm_modified to serialaze/src/main/java/jglm/Mat.java
f14220d59cc526922346df532e824f2cb46ada78
[ "MIT" ]
permissive
ibfernandes/narvaljava2d
c9781fb56e1529e3eafca30704b214ebcc6f0015
99c83211ecfd5793c96e6c2f203670fdabeba5a2
refs/heads/master
2020-12-10T02:56:13.504195
2020-01-13T01:38:30
2020-01-13T01:38:30
233,486,033
0
0
MIT
2020-10-13T18:48:23
2020-01-13T01:22:08
Java
UTF-8
Java
false
false
238
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jglm; /** * @deprecated * @author gbarbieri */ public class Mat { // protected float[] matrix; protected int order; }
[ "contasbrasil@hotmail.com" ]
contasbrasil@hotmail.com
c5c4e27de0f452c264aec8c4f373cac6a460bfb7
f86187d88375939cc299b361af3dc84cd9f705c4
/EclipseDevelop_JavaEE/05 Spring/Integration-S2SH/Integration-S2SH-03-Anno/src/test/java/com/baihoo/service/MemberServiceTest.java
12400028b7b4186daba9c8fa6c5f864c9a6f53a0
[]
no_license
ChenBaiHong/baihoo.EclipseDataBank
83c7b5ceccf80eea5e8b606893463d2d98a53d67
e4698c40f2a1d3ffc0be07115838234aebb8ba95
refs/heads/master
2020-03-26T11:45:49.204873
2018-08-15T14:37:38
2018-08-15T14:37:38
144,859,060
0
0
null
null
null
null
UTF-8
Java
false
false
2,466
java
package com.baihoo.service; import java.util.Date; import java.util.List; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Restrictions; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.baihoo.dao.MemberDao; import com.baihoo.dtobj.Member; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration("classpath:applicationContext.xml") public class MemberServiceTest { @Autowired //@Qualifier("memberService") //MemberService memberService; @Qualifier("memberDao") MemberDao memberDao; @Test public void testAdd() { Member member = new Member(); member.setId(1); member.setBirthDate(new Date()); member.setMeName("baihoo"); member.setMeAge(123); member.setMeNo("BH001"); member.setMeDesc("good"); Member member2 = new Member(); member2.setId(2); member2.setBirthDate(new Date()); member2.setMeName("baihoo2"); member2.setMeAge(123); member2.setMeNo("BH002"); member2.setMeDesc("good"); Member member3 = new Member(); member3.setId(3); member3.setBirthDate(new Date()); member3.setMeName("baihoo3"); member3.setMeAge(123); member3.setMeNo("BH003"); member3.setMeDesc("good"); Member member4 = new Member(); member4.setId(4); member4.setBirthDate(new Date()); member4.setMeName("baihoo4"); member4.setMeAge(123); member4.setMeNo("BH004"); member4.setMeDesc("good"); memberDao.add(member); memberDao.add(member2); memberDao.add(member3); memberDao.add(member4); } @Test public void testFindById() { Member member = memberDao.findById(2); System.out.println(member); } @Test public void testFindByIdLazy() { Member member = memberDao.findByIdLazy(2); System.out.println(member); } @Test public void testFindByCriteria() { DetachedCriteria criteria = DetachedCriteria.forClass(Member.class); criteria.add(Restrictions.like("meName", "%baihoo%")); criteria.add(Restrictions.and(Restrictions.between("meAge",12,134))); //criteria.add(Restrictions.and(Restrictions.or(Restrictions.le("meAge", 12), Restrictions.gt("meAge", 34)))); List<Member> members = memberDao.findByCriteria(criteria); members.forEach(e -> System.out.println(e.getMeName())); } }
[ "cbh12345661@hotmail.com.cn" ]
cbh12345661@hotmail.com.cn
c9d6e3f212fcce993b935371e660c3085271c84f
6959de1eff5ce2e80bc06c3ff6eb0610a0c7ed2e
/app/src/main/java/com/omertex/test/ui/detail/DetailPresenter.java
3c8678066e48dc3b3bd172ce130f9d4de6bc179d
[]
no_license
ArtiomRufeev/Test
6acf07de0b90bad9eddcb12b3047dd43e04fbabc
65ae6f6b1c65231d892f33df19ebc6b566e47113
refs/heads/master
2020-03-09T19:28:49.996053
2018-04-10T16:21:51
2018-04-10T16:21:51
128,958,951
0
0
null
null
null
null
UTF-8
Java
false
false
456
java
package com.omertex.test.ui.detail; import com.omertex.test.model.Data; public class DetailPresenter implements DetailContract.Presenter { private DetailContract.View view; @Override public void attachView(DetailContract.View mvpView) { view = mvpView; } @Override public void detachView() { view = null; } @Override public void onDataRetrieved(Data data) { view.fillInData(data); } }
[ "denisveremeichyk@gmail.com" ]
denisveremeichyk@gmail.com
a5e3b51234a953ef5a91d931e50f73d88696cb72
c3c59c494a074776d4b3c32a820f518359d08652
/cameraxf/cameraxf/camerax_src/org/kivy/camerax/ImageAnalysisAnalyzer.java
55aae9c8c7edc5ca8d810e6d34a05db2214b8274
[]
no_license
Oussama1403/Android-for-Python
d8477f7d1566f54c8e6cb817dbef67ce7ba44780
765ed53a672663c3a7a5f775f93a49043b9d7af8
refs/heads/main
2023-03-21T06:46:22.854371
2021-03-20T02:44:46
2021-03-20T02:44:46
350,137,317
4
0
null
2021-03-21T22:36:26
2021-03-21T22:36:25
null
UTF-8
Java
false
false
506
java
package org.kivy.camerax; import androidx.camera.core.ImageAnalysis; import androidx.camera.core.ImageProxy; import org.kivy.camerax.CallbackWrapper; public class ImageAnalysisAnalyzer implements ImageAnalysis.Analyzer { private CallbackWrapper callback_wrapper; public ImageAnalysisAnalyzer(CallbackWrapper callback_wrapper) { this.callback_wrapper = callback_wrapper; } public void analyze(ImageProxy image) { this.callback_wrapper.callback_image(image); image.close(); } }
[ "34464649+RobertFlatt@users.noreply.github.com" ]
34464649+RobertFlatt@users.noreply.github.com
34f606a098ee4cd322f547a5e825a4adbd5f9fa3
5ac434a0e21101e8c4016d2d7341780b861ddeb2
/src/main/java/com/hurenjieee/system/entity/SystemPermission.java
09ec3faddcb769531cf714a712b3180f148a171b
[]
no_license
JackKuang/HMS
4772d57a84535dc61d751bccf84431086c5ff6be
99ce363aa2d9759c5ea54304922bba1530f945ad
refs/heads/master
2020-12-30T15:41:16.289326
2018-05-08T15:14:46
2018-05-08T15:14:46
91,158,512
0
0
null
null
null
null
UTF-8
Java
false
false
4,406
java
package com.hurenjieee.system.entity; import java.util.Date; import javax.persistence.Column; import javax.persistence.Table; import com.hurenjieee.core.annotation.AutoInjection; import com.hurenjieee.core.annotation.InjectionType; import com.hurenjieee.core.entity.BaseEntity; /** * @Description: 权限 * @Author: JackKuang * @Since: 2018年4月15日下午5:28:14 */ @Table(name = "system_permission") public class SystemPermission extends BaseEntity{ @AutoInjection(type = InjectionType.CREATE_USER) @Column(name = "create_user") private String createUser; @AutoInjection(type = InjectionType.CREATE_DATE) @Column(name = "create_date") private Date createDate; @AutoInjection(type = InjectionType.UPDATE_USER) @Column(name = "update_user") private String updateUser; @AutoInjection(type = InjectionType.UPDATE_DATE) @Column(name = "update_date") private Date updateDate; @Column(name = "permission_name") private String permissionName; @Column(name = "permission_url") private String permissionUrl; @Column(name = "permission_par_uuid") private String permissionParUuid; @Column(name = "permission_state") private Integer permissionState; @Column(name = "permission_order") private Integer permissionOrder; @Column(name = "permission_desc") private String permissionDesc; @Column(name = "permission_style") private String permissionStyle; /** * @return create_user */ public String getCreateUser() { return createUser; } /** * @param createUser */ public void setCreateUser(String createUser) { this.createUser = createUser; } /** * @return create_date */ public Date getCreateDate() { return createDate; } /** * @param createDate */ public void setCreateDate(Date createDate) { this.createDate = createDate; } /** * @return update_user */ public String getUpdateUser() { return updateUser; } /** * @param updateUser */ public void setUpdateUser(String updateUser) { this.updateUser = updateUser; } /** * @return update_date */ public Date getUpdateDate() { return updateDate; } /** * @param updateDate */ public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; } /** * @return permission_name */ public String getPermissionName() { return permissionName; } /** * @param permissionName */ public void setPermissionName(String permissionName) { this.permissionName = permissionName; } /** * @return permission_url */ public String getPermissionUrl() { return permissionUrl; } /** * @param permissionUrl */ public void setPermissionUrl(String permissionUrl) { this.permissionUrl = permissionUrl; } /** * @return permission_par_uuid */ public String getPermissionParUuid() { return permissionParUuid; } /** * @param permissionParUuid */ public void setPermissionParUuid(String permissionParUuid) { this.permissionParUuid = permissionParUuid; } /** * @return permission_state */ public Integer getPermissionState() { return permissionState; } /** * @param permissionState */ public void setPermissionState(Integer permissionState) { this.permissionState = permissionState; } /** * @return permission_order */ public Integer getPermissionOrder() { return permissionOrder; } /** * @param permissionOrder */ public void setPermissionOrder(Integer permissionOrder) { this.permissionOrder = permissionOrder; } /** * @return permission_desc */ public String getPermissionDesc() { return permissionDesc; } /** * @param permissionDesc */ public void setPermissionDesc(String permissionDesc) { this.permissionDesc = permissionDesc; } public String getPermissionStyle(){ return permissionStyle; } public void setPermissionStyle(String permissionStyle){ this.permissionStyle = permissionStyle; } }
[ "1092465834@qq.com" ]
1092465834@qq.com
f3b3bcd310c445832fe35fa95174d1320ae52fa5
e6389ae47f1172b8a03f2b562a819072651af926
/04-inheritance/MortageCalculator/src/com/martinez/Console.java
11e3f9d9405290d4bead84b6fddfbe3b85954350
[]
no_license
thomasmartinez114/java-mosh-intermediate
757b4e0397c87b6e2744d785dd7a41a11f427161
c2ce5213aeff9d9c11b349ef05a09bf138208601
refs/heads/master
2021-04-16T01:50:24.548558
2020-04-22T05:14:35
2020-04-22T05:14:35
249,317,645
0
0
null
null
null
null
UTF-8
Java
false
false
624
java
package com.martinez; import java.util.Scanner; public class Console { private static Scanner scanner = new Scanner(System.in); public static double readNumber(String prompt) { return scanner.nextDouble(); } public static double readNumber(String prompt, double min, double max) { double value; while (true) { System.out.print(prompt); value = scanner.nextDouble(); if (value >= min && value <= max) break; System.out.println("Enter a number between " + min + " and " + max); } return value; } }
[ "tmartinez114@gmail.com" ]
tmartinez114@gmail.com
224f10b8700436b81fc2fd86ec8b7d49d458c7d2
1a5b7b6271a851423861721a963e312372543349
/mywebapp/src/main/java/com/ustglobal/mywebapp/servlets/MyServletContextServlet.java
a6aa9aa2fd00ffa04a8845caf317729773081bf1
[]
no_license
vaithiarsudalai/USTGLOBAL-15-JULY-19-Vaithiar-Sudalai
968001a9852e54132d31dad69147153906f50f81
378d32dd1164fbda2a556e35d527ec15286f25cd
refs/heads/master
2023-01-07T22:42:13.214758
2019-10-13T09:31:26
2019-10-13T09:31:26
210,096,924
0
0
null
null
null
null
UTF-8
Java
false
false
1,016
java
package com.ustglobal.mywebapp.servlets; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/context") public class MyServletContextServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { ServletContext context = getServletContext(); String myParam = context.getInitParameter("myParam"); resp.setContentType("text/html"); PrintWriter out = resp.getWriter(); out.println("<html>"); out.println("<body>"); out.println("<h2>Name from ServletContext </br>"); out.println(myParam); out.println("</h2>"); out.println("</body>"); out.println("</html>"); } }
[ "noreply@github.com" ]
noreply@github.com
8fc5cc47fc7a3548244f9e780f7438445b0da195
4e1f7893d22928980ffff1ff1237f4569f67fd3a
/app/src/main/java/com/example/citygame/api/client/UserPasswordChangeTokenResponseDTO.java
aaf9a2b6258a753ee1d041428e753a2b67c46ac4
[]
no_license
miloszg/city-game
6cf23461e341960891f7896e94a8b1000351925a
c17967c731f6c587d9ebc5c3a1e03762abe6cc60
refs/heads/master
2023-02-11T06:58:40.119431
2021-01-06T15:30:47
2021-01-06T15:30:47
255,667,156
0
0
null
2021-01-06T15:30:48
2020-04-14T16:45:06
Java
UTF-8
Java
false
false
587
java
package com.example.citygame.api.client; public class UserPasswordChangeTokenResponseDTO { private String token; private String password; public UserPasswordChangeTokenResponseDTO(String token, String password) { this.token = token; this.password = password; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "s165472@student.pg.edu.pl" ]
s165472@student.pg.edu.pl
69e5d8b7dd8ff78daa7ed16c165a1522cdf202cf
a703322f6db8ec36ec4da8ac37d41dc59cdae7cb
/src/main/java/lily/lab/mpred_demo/KMeansDrive.java
a4556b02b4d25465998519861c19b51c56fd03db
[]
no_license
mathlilypeng/K-Means_Hadoop
9124ff026ba515c2a6bac73cbac62b15a3a8338e
b67d9294de52e539bfd8ad4b7ea926140b980247
refs/heads/master
2020-07-05T08:05:54.860393
2016-12-02T23:32:09
2016-12-02T23:32:09
42,898,767
0
0
null
null
null
null
UTF-8
Java
false
false
6,403
java
package lily.lab.mpred_demo; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.filecache.DistributedCache; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; public class KMeansDrive { // set root directory on HDFS private final static String ROOT = "/user/myproject/"; public static void main( String[] args ) throws Exception { if (args.length != 4) { System.err.println("Usage: KMeansHadoop <input path> <output path> <centroid path> <numClusters>"); System.exit(2); } // set number of iterations and value of tolerance for kmeans iterative algorithm int numIter = 10; double tol = 1e-3; // start iterations int iter = 0; double dist = 1.0; int jobStatus = 0; String input = ROOT+args[0]; String output = ROOT+args[1]+"/" + iter; String centroid = ROOT+args[2]; String numClusters = args[3]; Configuration conf = new Configuration(); while(iter<numIter && dist>tol && jobStatus == 0) { // start a new map reduce job for each iteration conf.set("iteration.depth", iter + ""); Job job = new Job(conf, "K-Means Pixel Clustering " + iter); // distribute center pixels to distributed cache Path centroidPath = new Path(centroid); DistributedCache.addCacheFile(centroidPath.toUri(), job.getConfiguration()); // set driver class, mapper class and reducer class job.setJarByClass(KMeansDrive.class); job.setMapperClass(KMeansMapper.class); job.setReducerClass(KMeansReducer.class); // set input path and output path for the current loop FileInputFormat.addInputPath(job, new Path(input)); FileOutputFormat.setOutputPath(job, new Path(output)); job.setOutputKeyClass(PixelWritableComparable.class); job.setMapOutputValueClass(PixelWritableComparable.class); job.setOutputValueClass(Text.class); // set number of reducers to equal to number of clusters of kmeans job.setNumReduceTasks(Integer.parseInt(numClusters)); // set number of clusters for kmeans algorithm job.getConfiguration().set("numClusters", numClusters); // start map-reduce job and wait for it to complete jobStatus = job.waitForCompletion(true)? 0 : 1; // compute centers for next iteration FileSystem fs = FileSystem.get(conf); FileStatus[] fss = fs.listStatus(new Path(output)); if (fss == null) { System.err.println("No output for iteration " + iter); System.exit(2); } ArrayList<ArrayList<Double>> nextCenters = new ArrayList<ArrayList<Double>>(); for (FileStatus status : fss) { if (status.getPath().getName().startsWith("_")) { continue; } Path path = status.getPath(); BufferedReader br=new BufferedReader(new InputStreamReader(fs.open(path))); String line; try { while ((line = br.readLine()) != null) { String[] rgbaValues = line.split("\t")[0].split(","); // each array is a RGBR value which has a length of 4 if (rgbaValues.length != 4) { System.err.println("Invalid rgba value!"); System.exit(2); } ArrayList<Double> center = new ArrayList<Double>(); for (String rgbaValue : rgbaValues) { center.add(Double.parseDouble(rgbaValue)); } nextCenters.add(center); } } finally { br.close(); } } // get current centers fss = fs.listStatus(new Path(centroid)); ArrayList<ArrayList<Double>> curCenters = new ArrayList<ArrayList<Double>>(); for (FileStatus status : fss) { if (status.getPath().getName().startsWith("_")) { continue; } Path path = status.getPath(); BufferedReader br=new BufferedReader(new InputStreamReader(fs.open(path))); String line; try { while ((line = br.readLine()) != null) { String[] rgbaValues = line.split("\t")[0].split(","); if (rgbaValues.length != 4) { System.err.println("The rgba value of centroids is not valid!"); System.exit(2); } ArrayList<Double> center = new ArrayList<Double>(); for (String rgbaValue : rgbaValues) { center.add(Double.parseDouble(rgbaValue)); } curCenters.add(center); } } finally { br.close(); } } if (curCenters.size() != nextCenters.size()) { System.err.println("Incorrect number of centers!"); System.exit(2); } // compute distance between current centers and next centers double nextDist = 0.0; for (int i=0; i<curCenters.size(); i++) { ArrayList<Double> curRgba = curCenters.get(i); ArrayList<Double> nextRgba = nextCenters.get(i); for (int j=0; j<curRgba.size(); j++) { nextDist += Math.pow(curRgba.get(j)-nextRgba.get(j), 2.0); } } // update status iter++; dist = Math.sqrt(nextDist); centroid = output; output = ROOT+args[1]+"/" + iter; } } }
[ "yuepeng@yahoo-inc.com" ]
yuepeng@yahoo-inc.com
8925edca9fbd6c14694eb36b44197782144d8a7a
75af207f1f5815cbbd74839653eb86126cd09142
/jetcache/jetcache-consumer/src/main/java/com/fullmoon/study/controller/ChildController.java
38b70233a006c6766851bd7446193b7afe7b2096
[]
no_license
liu844869663/study-springboot
3295580738fd0fece82424c4b930bfdb1b1db21c
b9a786fd8d9e6e2fe3f271cc748816fee287dd55
refs/heads/master
2023-02-24T00:00:24.011289
2021-01-26T09:43:43
2021-01-26T09:43:43
299,469,684
0
0
null
null
null
null
UTF-8
Java
false
false
979
java
package com.fullmoon.study.controller; import com.alibaba.fastjson.JSON; import com.fullmoon.study.entity.Child; import com.fullmoon.study.entity.People; import com.fullmoon.study.service.ChildService; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; @Log4j2 @RestController public class ChildController { @Autowired ChildService childService; @RequestMapping(value = "/getChildren", method = {RequestMethod.POST}) public List<Child> getChildren(@RequestBody People people){ log.info("begin"); if(people != null){ log.info(JSON.toJSONString(people)); } return childService.getChildren(people); } @RequestMapping(value = "/getChild", method = {RequestMethod.GET}) public Child getChildByName(@RequestParam String name){ return childService.getChildByName(name); } }
[ "liujingping@idwzx.com" ]
liujingping@idwzx.com
3c7f8a565274a51f36e9dc97b5f2cca21d0c178a
cbb83a71e1e4785eb5f04244484964b48ac0232f
/app/src/main/java/com/raul311/turbinetest/main/activities/DetailActivity.java
dd78c9bf4eca7748587255319f24d41651be0cf1
[]
no_license
raul311/turbine-example
93c8fbe90e4bdf1fa00fa27257e99e846509c479
f1fed5da5b04ffbc8f0b343186656b3222ccc530
refs/heads/master
2021-01-21T16:48:15.945039
2017-05-20T18:07:18
2017-05-20T18:07:18
91,906,991
0
0
null
null
null
null
UTF-8
Java
false
false
1,424
java
package com.raul311.turbinetest.main.activities; import android.app.Activity; import android.app.FragmentManager; import android.content.Intent; import android.os.Bundle; import android.view.KeyEvent; import com.raul311.turbinetest.R; import com.raul311.turbinetest.main.fragments.DetailFragment; import com.raul311.turbinetest.main.fragments.FragmentConstants; import com.raul311.turbinetest.service.Ad; /** * @author raul311 */ public class DetailActivity extends Activity { private FragmentManager fragmentManager; private Ad ad; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); fragmentManager = getFragmentManager(); Intent intent = getIntent(); if (intent != null) { this.ad = (Ad) intent.getSerializableExtra(FragmentConstants.ADVERTISEMENT_SENT); } } @Override protected void onResume() { super.onResume(); DetailFragment detailFragment = DetailFragment.newInstance(ad); fragmentManager.beginTransaction().add(R.id.fragment_detail_container, detailFragment).commit(); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK)) { finish(); } return super.onKeyDown(keyCode, event); } }
[ "raul.x.ruiz.-nd@disney.com" ]
raul.x.ruiz.-nd@disney.com
fecca7c7f19df7b71e2f31266b53d703023638b8
2463bddc9ac502b91d0fd1cf414602a7621fa406
/src/main/java/com/nopainanymore/springbootmybatisplus/dao/UserDao.java
2cd09561234e175430847cbf822f26a272cfef4c
[]
no_license
nopainanymore/spring-boot-mybatis-plus
481815c2b4103f2e5cd304965822451c4f956ae1
462c3926f4a9ef41b71eaab92f19d53be664a6a8
refs/heads/master
2022-06-01T16:07:24.805870
2019-04-14T14:49:35
2019-04-14T14:49:35
178,873,808
0
0
null
2022-05-20T20:56:40
2019-04-01T13:51:17
Java
UTF-8
Java
false
false
142
java
package com.nopainanymore.springbootmybatisplus.dao; /** * @author nopainanymore * @time 2019-04-01 22:59 */ public interface UserDao { }
[ "vbof53@163.com" ]
vbof53@163.com
fec62ef7f4851757b6b94f3a7b141f97c8c06148
9871813d097e643e862da455de3f7317ecb81ae3
/client-java-http/src/main/java/com/suneee/kubernetes/http/JSON.java
c892f3737b76217b7bf2f8fad4872b1a45e0b7f2
[]
no_license
KongXiangning/kubernetes-java-client
e4ff651c4fcc689cfd9de9ad9645fce97c09185d
a6868201d69dcce2472f5b5065fda3a390157185
refs/heads/master
2020-03-22T19:41:30.446580
2018-11-20T07:52:34
2018-11-20T07:52:34
140,544,300
0
0
null
null
null
null
UTF-8
Java
false
false
11,254
java
/* * Kubernetes * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: v1.6.9 * * * 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. */ package com.suneee.kubernetes.http; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapter; import com.google.gson.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import okio.ByteString; import org.joda.time.DateTime; import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormatter; import org.joda.time.format.DateTimeFormatterBuilder; import org.joda.time.format.ISODateTimeFormat; import java.io.IOException; import java.io.StringReader; import java.lang.reflect.Type; import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; import java.util.Date; public class JSON { private Gson gson; private boolean isLenientOnJson = false; private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); private DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); private ByteArrayAdapter byteArrayTypeAdapter = new ByteArrayAdapter(); public JSON() { gson = new GsonBuilder() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(DateTime.class, dateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .registerTypeAdapter(byte[].class, byteArrayTypeAdapter) .create(); } /** * Get Gson. * * @return Gson */ public Gson getGson() { return gson; } /** * Set Gson. * * @param gson Gson * @return JSON */ public JSON setGson(Gson gson) { this.gson = gson; return this; } public JSON setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; return this; } /** * Serialize the given Java object into JSON string. * * @param obj Object * @return String representation of the JSON */ public String serialize(Object obj) { return gson.toJson(obj); } /** * Deserialize the given JSON string to Java object. * * @param <T> Type * @param body The JSON string * @param returnType The type to deserialize into * @return The deserialized Java object */ @SuppressWarnings("unchecked") public <T> T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) jsonReader.setLenient(true); return gson.fromJson(jsonReader, returnType); } else { return gson.fromJson(body, returnType); } } catch (JsonParseException e) { // Fallback processing when failed to parse JSON form response body: // return the response body string directly for the String return type; if (returnType.equals(String.class)) return (T) body; else throw (e); } } /** + * Gson TypeAdapter for Byte Array type + */ public class ByteArrayAdapter extends TypeAdapter<byte[]> { @Override public void write(JsonWriter out, byte[] value) throws IOException { boolean oldHtmlSafe = out.isHtmlSafe(); out.setHtmlSafe(false); if (value == null) { out.nullValue(); } else { out.value(ByteString.of(value).base64()); } out.setHtmlSafe(oldHtmlSafe); } @Override public byte[] read(JsonReader in) throws IOException { switch (in.peek()) { case NULL: in.nextNull(); return null; default: String bytesAsBase64 = in.nextString(); ByteString byteString = ByteString.decodeBase64(bytesAsBase64); return byteString.toByteArray(); } } } /** * Gson TypeAdapter for Joda DateTime type */ public static class DateTimeTypeAdapter extends TypeAdapter<DateTime> { private DateTimeFormatter formatter; public DateTimeTypeAdapter() { this(new DateTimeFormatterBuilder().append(ISODateTimeFormat.dateTime().getPrinter(), ISODateTimeFormat.dateOptionalTimeParser().getParser()).toFormatter()); } public DateTimeTypeAdapter(DateTimeFormatter formatter) { this.formatter = formatter; } public void setFormat(DateTimeFormatter dateFormat) { this.formatter = dateFormat; } @Override public void write(JsonWriter out, DateTime date) throws IOException { if (date == null) { out.nullValue(); } else { out.value(formatter.print(date)); } } @Override public DateTime read(JsonReader in) throws IOException { switch (in.peek()) { case NULL: in.nextNull(); return null; default: String date = in.nextString(); return formatter.parseDateTime(date); } } } /** * Gson TypeAdapter for Joda LocalDate type */ public class LocalDateTypeAdapter extends TypeAdapter<LocalDate> { private DateTimeFormatter formatter; public LocalDateTypeAdapter() { this(ISODateTimeFormat.date()); } public LocalDateTypeAdapter(DateTimeFormatter formatter) { this.formatter = formatter; } public void setFormat(DateTimeFormatter dateFormat) { this.formatter = dateFormat; } @Override public void write(JsonWriter out, LocalDate date) throws IOException { if (date == null) { out.nullValue(); } else { out.value(formatter.print(date)); } } @Override public LocalDate read(JsonReader in) throws IOException { switch (in.peek()) { case NULL: in.nextNull(); return null; default: String date = in.nextString(); return formatter.parseLocalDate(date); } } } public JSON setDateTimeFormat(DateTimeFormatter dateFormat) { dateTimeTypeAdapter.setFormat(dateFormat); return this; } public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); return this; } /** * Gson TypeAdapter for java.sql.Date type * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used * (more efficient than SimpleDateFormat). */ public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> { private DateFormat dateFormat; public SqlDateTypeAdapter() { } public SqlDateTypeAdapter(DateFormat dateFormat) { this.dateFormat = dateFormat; } public void setFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; } @Override public void write(JsonWriter out, java.sql.Date date) throws IOException { if (date == null) { out.nullValue(); } else { String value; if (dateFormat != null) { value = dateFormat.format(date); } else { value = date.toString(); } out.value(value); } } @Override public java.sql.Date read(JsonReader in) throws IOException { switch (in.peek()) { case NULL: in.nextNull(); return null; default: String date = in.nextString(); try { if (dateFormat != null) { return new java.sql.Date(dateFormat.parse(date).getTime()); } return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); } catch (ParseException e) { throw new JsonParseException(e); } } } } /** * Gson TypeAdapter for java.util.Date type * If the dateFormat is null, ISO8601Utils will be used. */ public static class DateTypeAdapter extends TypeAdapter<Date> { private DateFormat dateFormat; public DateTypeAdapter() { } public DateTypeAdapter(DateFormat dateFormat) { this.dateFormat = dateFormat; } public void setFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; } @Override public void write(JsonWriter out, Date date) throws IOException { if (date == null) { out.nullValue(); } else { String value; if (dateFormat != null) { value = dateFormat.format(date); } else { value = ISO8601Utils.format(date, true); } out.value(value); } } @Override public Date read(JsonReader in) throws IOException { try { switch (in.peek()) { case NULL: in.nextNull(); return null; default: String date = in.nextString(); try { if (dateFormat != null) { return dateFormat.parse(date); } return ISO8601Utils.parse(date, new ParsePosition(0)); } catch (ParseException e) { throw new JsonParseException(e); } } } catch (IllegalArgumentException e) { throw new JsonParseException(e); } } } public JSON setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); return this; } public JSON setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); return this; } }
[ "163583@gmail.com" ]
163583@gmail.com
9c72416dc1d7b7a86b72c54a2566f418b53f556c
e85373e8475b508f8a8186a26bdd8cb182f6b34a
/lib/dependences/opt4j-trunk/trunk/src/org/opt4j/operator/crossover/CrossoverListXPoint.java
ebefc9bbbe337fec627d19c91879d2cce628c351
[]
no_license
anhvaut/connected-mobile-digital-ecosystem
88dff9515617a28fe2cb0789959648629d53c213
baf388e0ee297354b3ae6e5889112932defe01b4
refs/heads/master
2020-03-18T19:54:28.451211
2018-05-28T16:36:33
2018-05-28T16:36:33
135,184,745
0
0
null
null
null
null
UTF-8
Java
false
false
2,709
java
/** * Opt4J 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 3 of the License, or (at your * option) any later version. * * Opt4J 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 Opt4J. If not, see http://www.gnu.org/licenses/. */ package org.opt4j.operator.crossover; import java.util.Random; import java.util.SortedSet; import java.util.TreeSet; import org.opt4j.common.random.Rand; import org.opt4j.genotype.ListGenotype; import org.opt4j.optimizer.ea.Pair; import com.google.inject.Inject; /** * <p> * The {@link CrossoverListXPoint} performs a crossover on * {@link org.opt4j.core.Genotype} objects that are lists of values. * </p> * <p> * The crossover is performed on {@code x} points of the * {@link org.opt4j.core.Genotype}. * </p> * * @author lukasiewycz * */ public abstract class CrossoverListXPoint<G extends ListGenotype<?>> implements Crossover<G> { protected final int x; protected final Random random; /** * Constructs a {@link CrossoverListXPoint}. * * @param x * the number of crossover points * @param random * the random number generator */ @Inject public CrossoverListXPoint(int x, Rand random) { this.x = x; this.random = random; } /* * (non-Javadoc) * * @see * org.opt4j.operator.crossover.Crossover#crossover(org.opt4j.core.Genotype, * org.opt4j.core.Genotype) */ @Override @SuppressWarnings("unchecked") public Pair<G> crossover(G p1, G p2) { ListGenotype<Object> o1 = p1.newInstance(); ListGenotype<Object> o2 = p2.newInstance(); int size = p1.size(); if (x <= 0 || x > size - 1) { throw new RuntimeException(this.getClass() + " : x is " + x + " for binary vector size " + size); } SortedSet<Integer> points = new TreeSet<Integer>(); while (points.size() < x) { points.add(random.nextInt(size - 1) + 1); } int flip = 0; boolean select = random.nextBoolean(); for (int i = 0; i < size; i++) { if (i == flip) { select = !select; if (points.size() > 0) { flip = points.first(); points.remove(flip); } } if (select) { o1.add(p1.get(i)); o2.add(p2.get(i)); } else { o1.add(p2.get(i)); o2.add(p1.get(i)); } } Pair<G> offspring = new Pair<G>((G) o1, (G) o2); return offspring; } }
[ "anhvaut@gmail.com" ]
anhvaut@gmail.com
20afcfe458608064139e387fd51c58570269f1a1
052f1a3a6ad8034153fde4aed68aac36d4b57a8d
/test/src/singletonfactory/TestStream.java
ce2f13edbed78b5b8fd4dc5c1ab0e78a96f278f3
[]
no_license
guojianchao/testRepositoryJava
6019d66249d59be484d4760371d98704557aabc4
1022493945b0c45a4bc8660f1ab30a7fee4a29bf
refs/heads/master
2020-05-16T22:07:35.351254
2013-08-19T08:42:24
2013-08-19T08:42:24
null
0
0
null
null
null
null
GB18030
Java
false
false
702
java
package singletonfactory; public class TestStream { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } // 该类只能有一个实例 private TestStream() { } // 私有无参构造方法 // 该类必须自行创建 // 有2种方式 /* private static final TestStream ts=new TestStream(); */ private static TestStream ts1 = null; // 这个类必须自动向整个系统提供这个实例对象 public static TestStream getTest() { if (ts1 == null) { ts1 = new TestStream(); } return ts1; } public void getInfo() { System.out.println("output message " + name); } }
[ "guojinchao@837776282@qq.com" ]
guojinchao@837776282@qq.com
8e788fa39dcc21a392e7b8479a1ee140ff090898
8ac951ce9650c004aa89d37b00ae927f3c61886b
/src/main/java/com/rfb/repository/RfbEventRepository.java
52c20806f86c373df08f2eb04fdbd39fdee60282
[]
no_license
david-navruz/rfb-loyalty
b870af0179221adb9d682ba07eaba4b1660b02c8
7eae56d5a020f10678babcf3c1317c776f235921
refs/heads/master
2023-02-15T11:59:35.905394
2020-11-29T02:08:16
2020-11-29T02:08:16
316,800,061
0
0
null
null
null
null
UTF-8
Java
false
false
341
java
package com.rfb.repository; import com.rfb.domain.RfbEvent; import org.springframework.data.jpa.repository.*; import org.springframework.stereotype.Repository; /** * Spring Data repository for the RfbEvent entity. */ @SuppressWarnings("unused") @Repository public interface RfbEventRepository extends JpaRepository<RfbEvent, Long> { }
[ "selcuk-nevruz@hotmail.com" ]
selcuk-nevruz@hotmail.com
2b3af2b16bc6dccbd740d011bdaac2d113ad8b3c
2d814714cb3a7fcce4375e65cdefff375fc76cc9
/service-modules-wechat/wechat-module-height-obesity/src/main/java/org/wechat/module/height/obesity/HeightobesityApplication.java
186a18302a59d35d978906dc62279f7e97ead394
[]
no_license
wanghuaqiang0121/micro-service2
acd1a8445bc0402cdfa81212c5c05a1652a9429c
b5e9e77f0fc287eb8294148393aee14482c1da66
refs/heads/master
2022-07-03T17:48:56.275154
2019-06-11T08:08:39
2019-06-11T08:08:39
191,322,492
0
0
null
2022-06-17T02:13:31
2019-06-11T07:57:45
Java
UTF-8
Java
false
false
732
java
package org.wechat.module.height.obesity; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.Banner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication @EnableDiscoveryClient @EnableFeignClients @MapperScan("org.wechat.module.height.obesity.dao**") public class HeightobesityApplication { public static void main(String[] args) { SpringApplication app = new SpringApplication(HeightobesityApplication.class); app.setBannerMode(Banner.Mode.OFF); app.run(args); } }
[ "1060356949@qq.com" ]
1060356949@qq.com
4e0dbbb9950e9e3e4b511571888d4c511a06cea2
7560775771f1c5f844ecb2a9757eca93ad3a3ca0
/ChemConnectExperimentalData/src/info/esblurock/reaction/experiment/client/project/RepositoryListCallback.java
2846ee9dc83ee8d0d48f581272efbd4a53197cb4
[]
no_license
blurock/ChemConnect
e5e92c68ce6ba3364e390a27c4a11c92c16af8fd
4b9fcabb04e73c646bb098e749f36191fb822f63
refs/heads/master
2020-12-31T07:10:13.859355
2017-08-11T11:33:56
2017-08-11T11:33:56
80,557,066
0
0
null
null
null
null
UTF-8
Java
false
false
609
java
package info.esblurock.reaction.experiment.client.project; import java.util.ArrayList; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; public class RepositoryListCallback implements AsyncCallback<ArrayList<String>> { AskForItemName ask; public RepositoryListCallback(AskForItemName ask) { this.ask = ask; } @Override public void onFailure(Throwable caught) { Window.alert(caught.toString()); } @Override public void onSuccess(ArrayList<String> result) { for(String element : result) { ask.addDropDownRepositoryElement(element); } } }
[ "edward.blurock@gmail.com" ]
edward.blurock@gmail.com
b7dc5c04b7a72e8afe35729ed254e5d3d2ea09e8
c349c627098417bc9cff7115af6b524718526f2d
/src/main/java/com/microprofile/petstore/openapi/BookingController.java
e0f933feb336aedfa7ab508ab39feb827c603049
[]
no_license
Pasan-basitha/Pasan-Basitha-PetStore-API
88edaf04f8eb0046c26944ccb134da3850b73aeb
eb8671c3bd607476609f779d854de4743195b336
refs/heads/master
2023-09-05T16:33:39.020942
2021-11-19T17:09:37
2021-11-19T17:09:37
429,855,793
0
0
null
null
null
null
UTF-8
Java
false
false
1,711
java
package com.microprofile.petstore.openapi; import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; import org.eclipse.microprofile.openapi.annotations.info.Info; import org.eclipse.microprofile.openapi.annotations.media.Content; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; import org.eclipse.microprofile.openapi.annotations.responses.APIResponses; import javax.enterprise.context.ApplicationScoped; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; @Path("/booking") @ApplicationScoped @OpenAPIDefinition(info = @Info(title = "Booking endpoint", version = "1.0")) public class BookingController { @APIResponses(value = { @APIResponse( responseCode = "200", description = "Booking for id", content = @Content( mediaType = MediaType.APPLICATION_JSON, schema = @Schema( ref = "Booking")) ), @APIResponse( responseCode = "404", description = "No booking found for the id.") }) @GET @Produces(MediaType.APPLICATION_JSON) @Path("{bookingId}") public Response getBooking(@PathParam("bookingId") String bookingId) { return Response .status(Response.Status.OK) .entity(Booking.booking(bookingId, Destination.destination("New Rearendia", "Wheeli"))) .build(); } }
[ "pasan@odoc.life" ]
pasan@odoc.life
7501866d891df170677359655ee112605d5517de
2ffbd1e6f3d7d79329c23349a96e57d6d3a876ae
/Algorytm1/src/test/java/pl/software/developer/academy/TowerTest.java
d5787f2e978461f9d43b6a7ee94ded52eeefeb29
[]
no_license
marekbukowski/Algorytm
c32f4bbabf69d3a1fcce73df08e28b87422b7f73
5afec33b9ef4ff6e8498b413dfaf73c2f59c7545
refs/heads/master
2020-03-26T00:35:19.900326
2018-08-10T21:59:37
2018-08-10T21:59:37
144,326,756
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package pl.software.developer.academy; import org.junit.Test; import static org.junit.Assert.*; public class TowerTest { @Test public void drawTowers() { Tower tower = new Tower(); int chessFields[][] = tower.drawTowers(8); for (int i=0;i<chessFields.length;i++) { for (int j=0;j<chessFields[i].length;j++) { System.out.print(chessFields[i][j]+" "); } System.out.println(); } } @Test public void towerBeat() { Tower tower = new Tower(); int chessFields[][] = tower.drawTowers(3); for (int i=0;i<chessFields.length;i++) { for (int j=0;j<chessFields[i].length;j++) { System.out.print(chessFields[i][j]+" "); } System.out.println(); } System.out.println("TOWER BEAT"+tower.towerBeat(chessFields)); } }
[ "bukowski-m@wp.pl" ]
bukowski-m@wp.pl
65a0a354c1de19b4d11bd9cd4248a8d0b4717192
eb011862febdc815fb5b06336580608074df850d
/src/main/java/jumpStart/ViewLoanApplicationPage.java
9970f222d74276f158fda4c8573abc23a390fd40
[]
no_license
hasheemismath/CloudBank-Automation
06b1d9b959791651e2c47032478267a99dceff63
df3da210cbc9095d700b1b0f6f19b1363678e9c3
refs/heads/master
2023-05-13T05:25:01.641003
2020-06-09T16:58:32
2020-06-09T16:58:32
271,061,226
1
0
null
2023-05-09T18:41:52
2020-06-09T17:01:45
Java
UTF-8
Java
false
false
7,312
java
package jumpStart; import Elements.LoanElements; import Elements.LoginElements; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.Assert; import utils.UIActions; import utils.Utils; import java.util.ArrayList; public class ViewLoanApplicationPage extends UIActions implements LoginElements, LoanElements { By DLFStatusTxt = By.xpath("//*[@id=\"dlf-bar\"]/div/div/div/span"); By DLFBorrowerStatusTxt = By.xpath("//*[@id=\"dlf-bar\"]/div/div/div[1]/span"); By DLFSubStatusTxt = By.xpath("//*[@id=\"dlf-bar\"]/div/div/a/span"); By DLFDecisionStatus = By.xpath("//*[@id=\"tab-actions\"]/div/div/section/div[1]/span"); By dashboardLink = By.xpath("//*[@id=\"mainNav\"]/li[1]/a"); By actionsSection = By.xpath("//*[@id=\"dlf-bar\"]/div/ul/li[7]/a"); By decisionStatusInActions = By.xpath("//*[@id='tab-actions']/div/div/div/section/div/span"); By cancelDeclineBtn = By.xpath("//*[@id=\"tab-actions\"]/div/div/div/section/form/div/button[1]"); By confirmDeclineBtn = By.xpath("//*[@id=\"tab-actions\"]/div/div/div/section/form/div/button[2]"); By confirmDeclineBtnConfirmationBOx = By.xpath("//*[@id=\"react-confirm-alert\"]/div/div/div/button[2]"); By reopenBtn = By.xpath("//*[@id=\"tab-actions\"]/div/div/div/section/div/div/button/div"); By confirmReopenBtn = By.xpath("//*[@id=\"tab-actions\"]/div/div/div/section/form/div[2]/button[2]"); By reopenComment = By.xpath("//*[@id=\"tab-actions\"]/div/div/div/section/form/div[1]/textarea"); By confirmReopenBtnInConfirmationWindow = By.xpath("//*[@id=\"react-confirm-alert\"]/div/div/div/button[2]"); By cancelReopen = By.xpath("//*[@id=\"tab-actions\"]/div/div/div/section/form/div[2]/button[1]"); By editButton = By.xpath("//*[@id=\"wr-application-view\"]/div/div[1]/div[1]/div/div/form/div[1]/a"); By approveTile = By.linkText("Approved"); By dlfHeader = By.xpath("//*[@id=\"wr-dlf\"]/div[1]/div[1]/h2"); By caName = By.xpath("//*[@id=\"wr-dlf\"]/div[1]/div[2]/div/b"); //Care Center Tab Details By childCareTab = By.xpath("//a[text()=\"Child Care Information\"]"); By careCenterValue = By.xpath("//*[@id=\"root_careCenter\"]/input"); //Personal Information Details By firstNameValue = By.xpath("//*[@id=\"wr-application-view\"]/div/div[1]/div[1]/div/div/form/div[2]/div[1]/input"); By lastNameValue = By.xpath("//*[@id=\"wr-application-view\"]/div/div[1]/div[1]/div/div/form/div[2]/div[3]/input"); static WebDriver driver = Utils.getInstance().getDriver(); public void validateDLFStatus(Status status){ driver.navigate().refresh(); waitForPageLoad(); waitForElement(DLFStatusTxt); String actValue = driver.findElement(DLFStatusTxt).getText(); String expValue = status.toString(); Assert.assertEquals(actValue, expValue, "Incorrect DLF Status!!!"); } public void validateDLFSubStatus(String status){ driver.navigate().refresh(); waitForPageLoad(); waitForElement(DLFSubStatusTxt); String actValue = driver.findElement(DLFSubStatusTxt).getText(); Assert.assertEquals(actValue, status, "Incorrect DLF Status!!!"); } public void validateReOpenedStatus(){ driver.navigate().refresh(); waitForPageLoad(); waitForElement(DLFStatusTxt); String actValue = driver.findElement(DLFStatusTxt).getText(); String expValue = "RE-OPENED"; Assert.assertEquals(actValue, expValue, "Incorrect DLF Status!!!"); } public void validateBorrowerReOpenedStatus(){ waitForPageLoad(); waitForElement(DLFStatusTxt); String actValue = driver.findElement(DLFStatusTxt).getText(); String expValue = "RE-OPENED"; Assert.assertEquals(actValue, expValue, "Incorrect DLF Status!!!"); } public void navigateToDashboard(){ waitForElementClickable(dashboardLink); pause(3); click(dashboardLink); pause(3); } public void navigateToActionsTab(){ waitForElementClickable(actionsSection); pause(3); click(actionsSection); } public void validateButtonsPresentAfterClickingDecline() { waitForPageLoad(); WebDriverWait wait = new WebDriverWait(driver, 120); wait.until(ExpectedConditions.visibilityOfElementLocated(decisionStatusInActions)); pause(5); if (!driver.findElement(cancelDeclineBtn).isDisplayed() && !driver.findElement(confirmDeclineBtn).isDisplayed()){ System.out.println("Expected Buttons are not visible!!!"); } } public void confirmDecline(){ click(confirmDeclineBtn); waitForElement(confirmDeclineBtnConfirmationBOx); click(confirmDeclineBtnConfirmationBOx); pause(3); } public void cancelDecline(){ waitForElement(cancelDeclineBtn); click(cancelDeclineBtn); } public void confirmReopenDLF(){ click(reopenBtn); validateButtonsPresentAfterClickingDecline(); waitForElement(confirmReopenBtn); sendKeys(reopenComment, "Re Opening"); click(confirmReopenBtn); waitForElementClickable(confirmReopenBtnInConfirmationWindow); click(confirmReopenBtnInConfirmationWindow); } public void cancelReopenDLF(){ click(reopenBtn); waitForElement(cancelReopen); click(cancelReopen); } public void startEditingDLF(){ waitForElementClickable(editButton); pause(8); click(editButton); } //CareCenterTab public void clickChildCareTab(){ waitForElementClickable(childCareTab); pause(3); click(childCareTab); } public String getCareCenterValue(){ waitForElement(careCenterValue); pause(3); String careCenterName = getValue(careCenterValue); return careCenterName; } public String getBorrowerNameValue(){ waitForElement(firstNameValue); pause(3); String firstName = getValue(firstNameValue) + " "; String lastName = getValue(lastNameValue); String fullName = firstName + lastName; return fullName; } public String getDLFCodeValue(){ waitForElement(dlfHeader); pause(3); String dlfCode = getDLFIdFromURL(); return dlfCode; } public String getDLFIdFromURL(){ String heading = driver.findElement(dlfHeader).getText(); String splitFromName[] = heading.split("\\Q|\\E"); String firstHalf[] = splitFromName[0].split("Digital Application #"); String id = firstHalf[1].trim(); return id; } public String getCAName(){ waitForElement(caName); pause(3); String canName = driver.findElement(caName).getText(); return canName; } public void switchToSubmittedDLF(){ ArrayList<String> tabs = new ArrayList<String> (driver.getWindowHandles()); driver.switchTo().window(tabs.get(0)); driver.close(); driver.switchTo().window(tabs.get(1)); } public enum Status{ APPROVED, DECLINED, PROCESSING } }
[ "hasheemhush@gmail.com" ]
hasheemhush@gmail.com
5a72370e5680677fa5c0a874b827f6a39c9bf6c2
3b458ba5ec8f94db3fda760b9690c6ba19bca7a6
/app/src/main/java/com/heba/uber/DriversMapActivity.java
11fdd079d83f51b45356739fb008c49bed7d595f
[]
no_license
HebaElmallah/TaxiBooking
646241b24cc1fd2d8f6943616c997863d4797768
50d330f538ea4ddb7fada1d9f80b07a2be529b43
refs/heads/master
2022-08-30T04:41:26.438087
2020-05-30T23:06:57
2020-05-30T23:06:57
268,167,937
0
0
null
null
null
null
UTF-8
Java
false
false
12,504
java
package com.heba.uber; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.app.ActivityCompat; import androidx.fragment.app.FragmentActivity; import android.Manifest; import android.content.Intent; import android.location.Location; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.RelativeLayout; import android.widget.TextView; import com.firebase.geofire.GeoFire; import com.firebase.geofire.GeoLocation; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.squareup.picasso.Picasso; import java.util.List; import de.hdodenhof.circleimageview.CircleImageView; public class DriversMapActivity extends FragmentActivity implements OnMapReadyCallback , GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, com.google.android.gms.location.LocationListener { private GoogleMap mMap; GoogleApiClient googleApiClient; Location lastLocation; LocationRequest locationRequest; Marker pickUpMarker; private Button driverLogoutButton; private Button driverSettingsButton; private ValueEventListener assignedCustomerRefListener; private FirebaseAuth mAuth; private FirebaseUser currentUser; private DatabaseReference assignedCustomerRef , assignedCustomerPickUpRef; private String driverID , customerID = ""; private Boolean currentLogOutDriverStatus = false; private TextView txtName, txtPhone, txtCarName; private CircleImageView profilePic; private RelativeLayout relativeLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_drivers_map); mAuth = FirebaseAuth.getInstance(); currentUser = mAuth.getCurrentUser(); driverID = mAuth.getCurrentUser().getUid(); driverLogoutButton = (Button) findViewById(R.id.driver_logout_btn); driverSettingsButton = (Button) findViewById(R.id.driver_settings_btn); txtCarName = findViewById(R.id.name_customer);; txtPhone = findViewById(R.id.phone_customer); profilePic = findViewById(R.id.profile_image_customer); relativeLayout = findViewById(R.id.rell2); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); driverSettingsButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(DriversMapActivity.this, SettingsActivity.class); intent.putExtra("type", "Drivers"); startActivity(intent); } }); driverLogoutButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { currentLogOutDriverStatus = true; disconnectTheDriver(); mAuth.signOut(); logOutDriver(); } }); getAssignedCustomerRequest(); } private void getAssignedCustomerRequest() { assignedCustomerRef = FirebaseDatabase.getInstance().getReference().child("users") .child("drivers").child(driverID).child("customerRideID"); assignedCustomerRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if(dataSnapshot.exists()) { customerID = dataSnapshot.getValue().toString(); getAssignedCustomerPickUpLocation(); relativeLayout.setVisibility(View.VISIBLE); getAssignedCustomerInformation(); } else { customerID = ""; if(pickUpMarker != null) { pickUpMarker.remove(); } if(assignedCustomerRefListener != null) { assignedCustomerPickUpRef.removeEventListener(assignedCustomerRefListener); } relativeLayout.setVisibility(View.GONE); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } private void getAssignedCustomerPickUpLocation() { assignedCustomerPickUpRef = FirebaseDatabase.getInstance().getReference().child("customer requests") .child(customerID).child("l"); assignedCustomerRefListener = assignedCustomerPickUpRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if(dataSnapshot.exists()) { List<Object> customerLocationMap = (List<Object>) dataSnapshot.getValue(); double locationLat = 0; double locationLng = 0; if(customerLocationMap.get(0) != null) { locationLat = Double.parseDouble(customerLocationMap.get(0).toString()); } if(customerLocationMap.get(1) != null) { locationLng = Double.parseDouble(customerLocationMap.get(0).toString()); } LatLng driverLatLog = new LatLng(locationLat, locationLng); mMap.addMarker(new MarkerOptions().position(driverLatLog).title("Customer PickUp Location").icon(BitmapDescriptorFactory.fromResource(R.drawable.customer))); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } private void logOutDriver() { Intent welcomeIntent = new Intent(DriversMapActivity.this,WelcomeActivity.class); welcomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(welcomeIntent); finish(); } @Override public void onMapReady(GoogleMap googleMap) { mMap = googleMap; buildGoogleApiClient(); mMap.setMyLocationEnabled(true); // if(ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != true){ // // return; // } mMap.setMyLocationEnabled(true); // // Add a marker in Sydney and move the camera // LatLng sydney = new LatLng(-34, 151); // mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney")); // mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); } @Override public void onConnected(@Nullable Bundle bundle) { locationRequest = new LocationRequest(); locationRequest.setInterval(1000); locationRequest.setFastestInterval(1000); locationRequest.setPriority(locationRequest.PRIORITY_HIGH_ACCURACY); // if(ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != Pa){ // // return; // } LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this); } @Override public void onConnectionSuspended(int i) { } @Override public void onConnectionFailed(@NonNull ConnectionResult connectionResult) { } @Override public void onLocationChanged(Location location) { if(getApplicationContext() != null) { lastLocation = location; LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude()); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); mMap.animateCamera(CameraUpdateFactory.zoomTo(13)); String userID = FirebaseAuth.getInstance().getCurrentUser().getUid(); DatabaseReference driverAvaliabilityRef = FirebaseDatabase.getInstance().getReference().child(" Drvers Availability"); GeoFire geoFireAvailability = new GeoFire(driverAvaliabilityRef); DatabaseReference driverWorkingRef = FirebaseDatabase.getInstance().getReference().child("drivers working"); GeoFire geoFireWorking = new GeoFire(driverWorkingRef); switch (customerID) { case "": geoFireWorking.removeLocation(userID); geoFireAvailability.setLocation(userID, new GeoLocation(location.getLatitude(), location.getLongitude())); break; default: geoFireAvailability.removeLocation(userID); geoFireWorking.setLocation(userID, new GeoLocation(location.getLatitude(), location.getLongitude())); break; } } } protected synchronized void buildGoogleApiClient() { googleApiClient = new GoogleApiClient.Builder(this) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(LocationServices.API) .build(); googleApiClient.connect(); } @Override protected void onStop() { super.onStop(); if(!currentLogOutDriverStatus){ disconnectTheDriver(); } // String userID = FirebaseAuth.getInstance().getCurrentUser().getUid(); // DatabaseReference driverAvaliabilityRef = FirebaseDatabase.getInstance().getReference().child(" Drvers Availability"); // // GeoFire geoFire = new GeoFire(driverAvaliabilityRef); // geoFire.removeLocation(userID); } private void disconnectTheDriver() { String userID = FirebaseAuth.getInstance().getCurrentUser().getUid(); DatabaseReference driverAvaliabilityRef = FirebaseDatabase.getInstance().getReference().child(" Drivers Availability"); GeoFire geoFire = new GeoFire(driverAvaliabilityRef); geoFire.removeLocation(userID); } private void getAssignedCustomerInformation() { DatabaseReference reference = FirebaseDatabase.getInstance().getReference().child("Users") .child("Customers").child(customerID); reference.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if(dataSnapshot.exists() && dataSnapshot.getChildrenCount() >0) { String name = dataSnapshot.child("name").getValue().toString(); String phone = dataSnapshot.child("phone").getValue().toString(); txtName.setText(name); txtPhone.setText(phone); if(dataSnapshot.hasChild("image")) { String image = dataSnapshot.child("image").getValue().toString(); Picasso.get().load(image).into(profilePic); } } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } }
[ "eng.heba.elmallah@gmail.com" ]
eng.heba.elmallah@gmail.com
d799afd2e2e2657494594be5dbddf6f475b33e4a
31675bc8260eed1307cc71454e69fec3a15eb457
/src/main/java/com/github/mgljava/basicstudy/leetcode/easy/ImplementStrstr.java
b6151ce5eaebe17cb1a42dde030f19a8e16e00d1
[]
no_license
mgljava/basic-study
583b005d5c988eda3cab9fedda444c3f93f5a54b
fb8f1867db78430734ca82cd12a8be86511d5aab
refs/heads/master
2021-07-23T14:29:49.696001
2021-07-04T10:16:52
2021-07-04T10:16:52
179,470,072
7
0
null
null
null
null
UTF-8
Java
false
false
734
java
package com.github.mgljava.basicstudy.leetcode.easy; public class ImplementStrstr { public static void main(String[] args) { int i = new ImplementStrstr().strStr("aaaacdacd", "acd"); System.out.println(i); } public int strStr(String haystack, String needle) { if (haystack.trim().equals("") && needle.trim().equals("")) { return 0; } if (needle.trim().equals("")) { return 0; } if (haystack.trim().equals("")) { return -1; } if (!haystack.contains(needle)) { return -1; } for (int i = 0; i < haystack.length(); i++) { if (haystack.charAt(i) == needle.charAt(0) && haystack.startsWith(needle, i)) { return i; } } return -1; } }
[ "guangliang1120@gmail.com" ]
guangliang1120@gmail.com
31fe0a3212ab0f72dcdaed58a9b0ddf538768b2d
528d5ee84641c8c90377c4e7443ec779e6a73319
/src/main/java/ro/cbn/automation/exceptions/TestFrameworkException.java
4c76706f521e66cfcd75544afcc7397ad5919c0e
[]
no_license
autoalm/selenium-automation-base
7dbe9115bf22ed09237d964983d2840670e92f1c
71204fc895e7a9a98fc05c24d113e55e0e685960
refs/heads/master
2020-03-31T21:08:41.560325
2018-10-11T13:30:15
2018-10-11T13:30:15
152,569,180
0
0
null
null
null
null
UTF-8
Java
false
false
284
java
package ro.cbn.automation.exceptions; /** * Created by ab51xj on 1/30/2017. */ public class TestFrameworkException extends RuntimeException { public TestFrameworkException(String message) { super("There is something wrong with the test framework: " + message); } }
[ "amalcea@cbn.ro" ]
amalcea@cbn.ro
77ad4c849ae4628f156b54106124fd2047d7f9b2
99728782a025186aba291f79d9cc3ea9ac2c9685
/app/src/main/java/com/example/adc/sqlite/Message.java
67122ae6871e18f0f780525764117b10eb4a91d2
[]
no_license
dheeraj15cs20/SQLiteDB
4db1268f8ede9ef7813b13aa70f68c756db4b5c6
be6381f411bd8b25928b05de4ac31b0bcef20c3f
refs/heads/master
2020-03-21T22:37:53.292568
2018-06-29T10:42:24
2018-06-29T10:42:24
139,137,526
1
0
null
null
null
null
UTF-8
Java
false
false
306
java
package com.example.adc.sqlite; import android.content.Context; import android.widget.Toast; /** * Created by adc on 29-Jun-18. */ public class Message { public static void message(Context context,String message) { Toast.makeText(context,message, Toast.LENGTH_SHORT).show(); } }
[ "dheeraj15cs20@gmail.com" ]
dheeraj15cs20@gmail.com
034a383fc805817896462eb09f0a0d56e8e4dc9d
62dd2e2cfe90c09de433a612798b786a35088613
/auto_update/src/org/xeustechnologies/jtar/TarInputStream.java
2a0e1e35007f155333d1fba33c131d26a9fac6e4
[]
no_license
wanghengquan/repository
66d2c2814a92e4f406e5955eabadc11b20995185
04f68430a2fa33d785a9aff44739b8bf9d42c7ca
refs/heads/master
2023-08-15T03:54:45.287505
2023-03-03T03:04:59
2023-03-03T03:04:59
81,539,518
2
0
null
null
null
null
UTF-8
Java
false
false
6,021
java
/** * Copyright 2012 Kamran Zafar * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.xeustechnologies.jtar; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; /** * @author Kamran Zafar * */ public class TarInputStream extends FilterInputStream { private static final int SKIP_BUFFER_SIZE = 2048; private TarEntry currentEntry; private long currentFileSize; private long bytesRead; private boolean defaultSkip = false; public TarInputStream(InputStream in) { super( in ); currentFileSize = 0; bytesRead = 0; } @Override public boolean markSupported() { return false; } /** * Not supported * */ @Override public synchronized void mark(int readlimit) { } /** * Not supported * */ @Override public synchronized void reset() throws IOException { throw new IOException( "mark/reset not supported" ); } /** * Read a byte * * @see java.io.FilterInputStream#read() */ @Override public int read() throws IOException { byte[] buf = new byte[1]; int res = this.read( buf, 0, 1 ); if (res != -1) { return buf[0]; } return res; } /** * Checks if the bytes being read exceed the entry size and adjusts the byte * array length. Updates the byte counters * * * @see java.io.FilterInputStream#read(byte[], int, int) */ @Override public int read(byte[] b, int off, int len) throws IOException { if (currentEntry != null) { if (currentFileSize == currentEntry.getSize()) { return -1; } else if (( currentEntry.getSize() - currentFileSize ) < len) { len = (int) ( currentEntry.getSize() - currentFileSize ); } } int br = super.read( b, off, len ); if (br != -1) { if (currentEntry != null) { currentFileSize += br; } bytesRead += br; } return br; } /** * Returns the next entry in the tar file * * @return TarEntry * @throws IOException */ public TarEntry getNextEntry() throws IOException { closeCurrentEntry(); byte[] header = new byte[TarConstants.HEADER_BLOCK]; byte[] theader = new byte[TarConstants.HEADER_BLOCK]; int tr = 0; // Read full header while (tr < TarConstants.HEADER_BLOCK) { int res = read( theader, 0, TarConstants.HEADER_BLOCK - tr ); if (res < 0) { break; } System.arraycopy( theader, 0, header, tr, res ); tr += res; } // Check if record is null boolean eof = true; for (byte b : header) { if (b != 0) { eof = false; break; } } if (!eof) { bytesRead += header.length; currentEntry = new TarEntry( header ); } return currentEntry; } /** * Closes the current tar entry * * @throws IOException */ protected void closeCurrentEntry() throws IOException { if (currentEntry != null) { if (currentEntry.getSize() > currentFileSize) { // Not fully read, skip rest of the bytes long bs = 0; while (bs < currentEntry.getSize() - currentFileSize) { long res = skip( currentEntry.getSize() - currentFileSize - bs ); if (res == 0 && currentEntry.getSize() - currentFileSize > 0) { throw new IOException( "Possible tar file corruption" ); } bs += res; } } currentEntry = null; currentFileSize = 0L; skipPad(); } } /** * Skips the pad at the end of each tar entry file content * * @throws IOException */ protected void skipPad() throws IOException { if (bytesRead > 0) { int extra = (int) ( bytesRead % TarConstants.DATA_BLOCK ); if (extra > 0) { long bs = 0; while (bs < TarConstants.DATA_BLOCK - extra) { long res = skip( TarConstants.DATA_BLOCK - extra - bs ); bs += res; } } } } /** * Skips 'n' bytes on the InputStream<br> * Overrides default implementation of skip * */ @Override public long skip(long n) throws IOException { if (defaultSkip) { // use skip method of parent stream // may not work if skip not implemented by parent return super.skip( n ); } if (n <= 0) { return 0; } long left = n; byte[] sBuff = new byte[SKIP_BUFFER_SIZE]; while (left > 0) { int res = read( sBuff, 0, (int) ( left < SKIP_BUFFER_SIZE ? left : SKIP_BUFFER_SIZE ) ); if (res < 0) { break; } left -= res; } return n - left; } public boolean isDefaultSkip() { return defaultSkip; } public void setDefaultSkip(boolean defaultSkip) { this.defaultSkip = defaultSkip; } }
[ "Jason.Wang@latticesemi.com" ]
Jason.Wang@latticesemi.com
e3e2e55a92bf95420f17fa6830a48a871c6f0713
5b27dae1efe7dcfce9348139aae54cbefb6c736b
/src/main/java/me/porcelli/nio/jgit/impl/daemon/ssh/GitSSHService.java
b80b667fb6ecc195d1c75ff6337fbca15442f70a
[ "Apache-2.0" ]
permissive
porcelli/jgit-nio2
ed63ce527622ef120aa3feba1ee512a0523a5f8c
ba68f5c32a388cf63fbed571f14bc7a85396c0cc
refs/heads/master
2021-06-25T18:05:58.913277
2020-01-20T15:43:11
2020-01-20T15:43:11
222,013,709
0
1
Apache-2.0
2021-04-26T19:41:42
2019-11-15T22:31:01
Java
UTF-8
Java
false
false
11,561
java
/* * Copyright 2019 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package me.porcelli.nio.jgit.impl.daemon.ssh; import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutorService; import me.porcelli.nio.jgit.impl.JGitFileSystemProvider; import me.porcelli.nio.jgit.security.AuthenticationService; import me.porcelli.nio.jgit.security.PublicKeyAuthenticator; import me.porcelli.nio.jgit.security.User; import org.apache.sshd.common.cipher.BuiltinCiphers; import org.apache.sshd.common.mac.BuiltinMacs; import org.apache.sshd.common.util.security.SecurityUtils; import org.apache.sshd.server.SshServer; import org.apache.sshd.server.auth.pubkey.CachingPublicKeyAuthenticator; import org.apache.sshd.server.keyprovider.AbstractGeneratorHostKeyProvider; import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider; import org.apache.sshd.server.scp.UnknownCommand; import org.eclipse.jgit.transport.resolver.ReceivePackFactory; import org.eclipse.jgit.transport.resolver.UploadPackFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static me.porcelli.nio.jgit.impl.daemon.common.PortUtil.validateOrGetNew; import static me.porcelli.nio.jgit.impl.util.Preconditions.checkNotEmpty; import static me.porcelli.nio.jgit.impl.util.Preconditions.checkNotNull; import static org.apache.sshd.common.NamedFactory.setUpBuiltinFactories; import static org.apache.sshd.server.ServerBuilder.builder; public class GitSSHService { private static final Logger LOG = LoggerFactory.getLogger(GitSSHService.class); private final List<BuiltinCiphers> managedCiphers = Collections.unmodifiableList(Arrays.asList( BuiltinCiphers.aes128ctr, BuiltinCiphers.aes192ctr, BuiltinCiphers.aes256ctr, BuiltinCiphers.arcfour256, BuiltinCiphers.arcfour128, BuiltinCiphers.aes192cbc, BuiltinCiphers.aes256cbc )); private final List<BuiltinMacs> managedMACs = Collections.unmodifiableList(Arrays.asList( BuiltinMacs.hmacmd5, BuiltinMacs.hmacsha1, BuiltinMacs.hmacsha256, BuiltinMacs.hmacsha512, BuiltinMacs.hmacsha196, BuiltinMacs.hmacmd596 )); private SshServer sshd; private AuthenticationService authenticationService; private PublicKeyAuthenticator publicKeyAuthenticator; private SshServer buildSshServer(String ciphersConfigured, String macsConfigured) { return builder().cipherFactories( setUpBuiltinFactories(false, checkAndSetGitCiphers(ciphersConfigured))) .macFactories( setUpBuiltinFactories(false, checkAndSetGitMacs(macsConfigured))).build(); } public void setup(final File certDir, final InetSocketAddress inetSocketAddress, final String sshIdleTimeout, final String algorithm, final ReceivePackFactory receivePackFactory, final UploadPackFactory uploadPackFactory, final JGitFileSystemProvider.RepositoryResolverImpl<BaseGitCommand> repositoryResolver, final ExecutorService executorService) { setup(certDir, inetSocketAddress, sshIdleTimeout, algorithm, receivePackFactory, uploadPackFactory, repositoryResolver, executorService, null, null); } public void setup(final File certDir, final InetSocketAddress inetSocketAddress, final String sshIdleTimeout, final String algorithm, final ReceivePackFactory receivePackFactory, final UploadPackFactory uploadPackFactory, final JGitFileSystemProvider.RepositoryResolverImpl<BaseGitCommand> repositoryResolver, final ExecutorService executorService, final String gitSshCiphers, final String gitSshMacs) { checkNotNull("certDir", certDir); checkNotEmpty("sshIdleTimeout", sshIdleTimeout); checkNotEmpty("algorithm", algorithm); checkNotNull("receivePackFactory", receivePackFactory); checkNotNull("uploadPackFactory", uploadPackFactory); checkNotNull("repositoryResolver", repositoryResolver); buildSSHServer(gitSshCiphers, gitSshMacs); sshd.getProperties().put(SshServer.IDLE_TIMEOUT, sshIdleTimeout); if (inetSocketAddress != null) { sshd.setHost(inetSocketAddress.getHostName()); sshd.setPort(validateOrGetNew(inetSocketAddress.getPort())); if (inetSocketAddress.getPort() != sshd.getPort()) { LOG.error("SSH for Git original port {} not available, new free port {} assigned.", inetSocketAddress.getPort(), sshd.getPort()); } } if (!certDir.exists()) { certDir.mkdirs(); } final AbstractGeneratorHostKeyProvider keyPairProvider = new SimpleGeneratorHostKeyProvider(new File(certDir, "hostkey.ser")); try { SecurityUtils.getKeyPairGenerator(algorithm); keyPairProvider.setAlgorithm(algorithm); } catch (final Exception ignore) { throw new RuntimeException(String.format("Can't use '%s' algorithm for ssh key pair generator.", algorithm), ignore); } sshd.setKeyPairProvider(keyPairProvider); sshd.setCommandFactory(command -> { if (command.startsWith("git-upload-pack")) { return new GitUploadCommand(command, repositoryResolver, uploadPackFactory, executorService); } else if (command.startsWith("git-receive-pack")) { return new GitReceiveCommand(command, repositoryResolver, receivePackFactory, executorService); } else { return new UnknownCommand(command); } }); sshd.setPublickeyAuthenticator(new CachingPublicKeyAuthenticator((username, key, session) -> { final User user = getPublicKeyAuthenticator().authenticate(username, key); if (user == null) { return false; } session.setAttribute(BaseGitCommand.SUBJECT_KEY, user); return true; })); sshd.setPasswordAuthenticator((username, password, session) -> { final User user = getUserPassAuthenticator().login(username, password); if (user == null) { return false; } session.setAttribute(BaseGitCommand.SUBJECT_KEY, user); return true; }); } private void buildSSHServer(String gitSshCiphers, String gitSshMacs) { sshd = buildSshServer(gitSshCiphers, gitSshMacs); } private List<BuiltinCiphers> checkAndSetGitCiphers(String gitSshCiphers) { if (gitSshCiphers == null || gitSshCiphers.isEmpty()) { return managedCiphers; } else { List<BuiltinCiphers> ciphersHandled = new ArrayList<>(); List<String> ciphers = Arrays.asList(gitSshCiphers.split(",")); for (String cipherCode : ciphers) { BuiltinCiphers cipher = BuiltinCiphers.fromFactoryName(cipherCode.trim().toLowerCase()); if (cipher != null && managedCiphers.contains(cipher)) { ciphersHandled.add(cipher); LOG.info("Added Cipher {} to the git ssh configuration. ", cipher); } else { LOG.warn("Cipher {} not handled in git ssh configuration. ", cipher); } } return ciphersHandled; } } private List<BuiltinMacs> checkAndSetGitMacs(String gitSshMacs) { if (gitSshMacs == null || gitSshMacs.isEmpty()) { return managedMACs; } else { List<BuiltinMacs> macs = new ArrayList<>(); List<String> macsInput = Arrays.asList(gitSshMacs.split(",")); for (String macCode : macsInput) { BuiltinMacs mac = BuiltinMacs.fromFactoryName(macCode.trim().toLowerCase()); if (mac != null && managedMACs.contains(mac)) { macs.add(mac); LOG.info("Added MAC {} to the git ssh configuration. ", mac); } else { LOG.warn("MAC {} not handled in git ssh configuration. ", mac); } } return macs; } } public void stop() { try { sshd.stop(true); } catch (IOException ignored) { } } public void start() { try { sshd.start(); } catch (IOException e) { throw new RuntimeException("Couldn't start SSH daemon at " + sshd.getHost() + ":" + sshd.getPort(), e); } } public boolean isRunning() { return !(sshd.isClosed() || sshd.isClosing()); } SshServer getSshServer() { return sshd; } public Map<String, Object> getProperties() { return Collections.unmodifiableMap(sshd.getProperties()); } public AuthenticationService getUserPassAuthenticator() { return authenticationService; } public void setUserPassAuthenticator(AuthenticationService authenticationService) { this.authenticationService = authenticationService; } public PublicKeyAuthenticator getPublicKeyAuthenticator() { return publicKeyAuthenticator; } public void setPublicKeyAuthenticator(PublicKeyAuthenticator publicKeyAuthenticator) { this.publicKeyAuthenticator = publicKeyAuthenticator; } public List<BuiltinCiphers> getManagedCiphers() { return managedCiphers; } public List<BuiltinMacs> getManagedMACs() { return managedMACs; } }
[ "alexandre.porcelli@gmail.com" ]
alexandre.porcelli@gmail.com
703a7a1924587b031fdc53d80d155e5b17ff5eb2
823099c771adf3e3e102d5c49decc01cddd5ab81
/MainFrame/src/lib/asynchronous/PreemtiveAuthorizationHttpRequestInterceptor.java
254c7a204997c51997b1e4daf7e88c510e08aaf1
[]
no_license
siwangqishiq/MainFramework
e04c876380dd110a263a20d1cca903ef1504de95
616aa5daae6100a609788605ba4eaa0cdb09a421
refs/heads/master
2016-09-06T20:11:01.655234
2014-11-24T09:04:55
2014-11-24T09:04:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,197
java
/* Android Asynchronous Http Client Copyright (c) 2014 Marek Sebera <marek.sebera@gmail.com> http://loopj.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package lib.asynchronous; import org.apache.http.HttpException; import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.HttpRequestInterceptor; import org.apache.http.auth.AuthScope; import org.apache.http.auth.AuthState; import org.apache.http.auth.Credentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.protocol.ClientContext; import org.apache.http.impl.auth.BasicScheme; import org.apache.http.protocol.ExecutionContext; import org.apache.http.protocol.HttpContext; import java.io.IOException; public class PreemtiveAuthorizationHttpRequestInterceptor implements HttpRequestInterceptor { public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException { AuthState authState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE); CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute( ClientContext.CREDS_PROVIDER); HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST); if (authState.getAuthScheme() == null) { AuthScope authScope = new AuthScope(targetHost.getHostName(), targetHost.getPort()); Credentials creds = credsProvider.getCredentials(authScope); if (creds != null) { authState.setAuthScheme(new BasicScheme()); authState.setCredentials(creds); } } } }
[ "525647740@qq.com" ]
525647740@qq.com
a84be323a00be5e395739c175932145b7a433b7a
5d2919d61ac27ca7bc55f2fe002585cd7dadd4d9
/app/src/main/java/com/lishi/baijiaxing/myyiyuan/model/MyYiYuanModelImpl.java
84c11909177cd880b57c12a619aac2278bc984d2
[]
no_license
1104646539/listhiyouping
f839f8bd443dec5660ddde6bc53995af4f2d37e4
a94269cfd03881e1155f3749d02028b07a90f76d
refs/heads/master
2021-01-19T01:39:11.693195
2016-12-23T00:29:24
2016-12-23T00:29:24
73,193,802
5
0
null
null
null
null
UTF-8
Java
false
false
763
java
package com.lishi.baijiaxing.myyiyuan.model; import com.lishi.baijiaxing.base.BaseModel; import com.lishi.baijiaxing.myyiyuan.MyYiYuanCallback; import java.util.ArrayList; /** * Created by Administrator on 2016/10/28. */ public class MyYiYuanModelImpl extends BaseModel implements MyYiYuanModel { private ArrayList<MyYiYuanBean> mYiYuanBeans; @Override public void loadData(MyYiYuanCallback callback) { mYiYuanBeans = new ArrayList<>(); for (int i = 0; i < 2; i++) { MyYiYuanBean myYiYuan = new MyYiYuanBean(200, "", "【利世优品】万仟堂陶瓷同心杯 带盖过滤办公茶杯水杯包邮", 250, 30, 1); mYiYuanBeans.add(myYiYuan); } callback.onLoadSuccess(mYiYuanBeans); } }
[ "1104646539@qq.com" ]
1104646539@qq.com
fffbe9825aa09c19a02fa15114130cacf793e570
e85b5bc2e55dfe8134ce4b5a96a800a604499e61
/src/test/java/omg/test/karnadaka.java
2f4aad73bc3bb33136413619c0d183e31d96e671
[]
no_license
karthirajan/CucumberJuly
ce6d074bf4284afbf34321f7c4c9281fbd3c3bb4
49a4fbd07f7971333bad8aa47730c28414b3c317
refs/heads/master
2022-11-21T17:59:30.589755
2020-07-25T11:20:44
2020-07-25T11:20:44
278,006,928
0
0
null
2020-07-25T11:20:45
2020-07-08T06:21:03
Java
UTF-8
Java
false
false
373
java
package omg.test; public class karnadaka extends tamilNadu { @Override public void dieselRate() { System.out.println(50); } @Override public void petrolRate() { System.out.println(80); } public void crudOil() { System.out.println(45); } public static void main(String[] args) { karnadaka k = new karnadaka(); k.dieselRate(); k.petrolRate(); k.crudOil(); } }
[ "thamizhsvk30@gmail.com" ]
thamizhsvk30@gmail.com
797c72273fb962d502c6c0108bec0db783edabdc
3f0710ca6c9366b87e394488df328d19318b32ec
/src/main/java/com/guga/common/util/ZipGenerator.java
4287530e4619b15a176ddeb40785117a7dd3912f
[]
no_license
gustavovaldes/algs1p1
b1a643e844039de1aa6a69dfd70a68261d694297
c9f29108ce9e6013be2631955fcecdc531db0c83
refs/heads/master
2021-01-10T10:58:01.449140
2016-03-30T02:53:34
2016-03-30T02:53:34
50,788,492
1
0
null
null
null
null
UTF-8
Java
false
false
387
java
package com.guga.common.util; /** * Created by guga */ public class ZipGenerator { public static void main(String[] args) { String path = "/Users/Gustavo/workspace/algs1p1/src/main/java/com/guga/algs1p1/week2/"; String[] files = new String[]{ "Deque.java", "RandomizedQueue.java", "Subset.java" }; } }
[ "g.valdes.aracena@gmail.com" ]
g.valdes.aracena@gmail.com
05f5d12b243963fd4ecf05240f699214ab456b5c
1fe9aecf59e35ca51827887ebfca7416961a96c1
/app/src/main/java/vay/enterwind/kesah/tested/likeanimation/library/LikeButtonView.java
598ef4fc5b4e3146cce33ab790c1aa29dc2c7bff
[ "MIT" ]
permissive
enterwind/Kesah
fa061fc60a36a7fda694b36fd6c9151837c03e41
bde9d4a6b1a8f3db24ded51d8577ccd3776047e8
refs/heads/master
2020-03-22T19:19:58.676399
2018-07-15T11:57:19
2018-07-15T11:57:19
140,521,298
0
0
null
null
null
null
UTF-8
Java
false
false
6,260
java
package vay.enterwind.kesah.tested.likeanimation.library; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.view.animation.OvershootInterpolator; import android.widget.FrameLayout; import android.widget.ImageView; import butterknife.BindView; import butterknife.ButterKnife; import vay.enterwind.kesah.R; /** * Created by novay on 15/07/18. */ public class LikeButtonView extends FrameLayout implements View.OnClickListener { private static final DecelerateInterpolator DECCELERATE_INTERPOLATOR = new DecelerateInterpolator(); private static final AccelerateDecelerateInterpolator ACCELERATE_DECELERATE_INTERPOLATOR = new AccelerateDecelerateInterpolator(); private static final OvershootInterpolator OVERSHOOT_INTERPOLATOR = new OvershootInterpolator(4); @BindView(R.id.ivStar) ImageView ivStar; @BindView(R.id.vDotsView) DotsView vDotsView; @BindView(R.id.vCircle) CircleView vCircle; private boolean isChecked; private AnimatorSet animatorSet; public LikeButtonView(Context context) { super(context); init(); } public LikeButtonView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public LikeButtonView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public LikeButtonView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); init(); } private void init() { LayoutInflater.from(getContext()).inflate(R.layout.tested_like_button, this, true); ButterKnife.bind(this); setOnClickListener(this); } @Override public void onClick(View v) { isChecked = !isChecked; ivStar.setImageResource(isChecked ? R.drawable.ic_star_rate_on : R.drawable.ic_star_rate_off); if (animatorSet != null) { animatorSet.cancel(); } if (isChecked) { ivStar.animate().cancel(); ivStar.setScaleX(0); ivStar.setScaleY(0); vCircle.setInnerCircleRadiusProgress(0); vCircle.setOuterCircleRadiusProgress(0); vDotsView.setCurrentProgress(0); animatorSet = new AnimatorSet(); ObjectAnimator outerCircleAnimator = ObjectAnimator.ofFloat(vCircle, CircleView.OUTER_CIRCLE_RADIUS_PROGRESS, 0.1f, 1f); outerCircleAnimator.setDuration(250); outerCircleAnimator.setInterpolator(DECCELERATE_INTERPOLATOR); ObjectAnimator innerCircleAnimator = ObjectAnimator.ofFloat(vCircle, CircleView.INNER_CIRCLE_RADIUS_PROGRESS, 0.1f, 1f); innerCircleAnimator.setDuration(200); innerCircleAnimator.setStartDelay(200); innerCircleAnimator.setInterpolator(DECCELERATE_INTERPOLATOR); ObjectAnimator starScaleYAnimator = ObjectAnimator.ofFloat(ivStar, ImageView.SCALE_Y, 0.2f, 1f); starScaleYAnimator.setDuration(350); starScaleYAnimator.setStartDelay(250); starScaleYAnimator.setInterpolator(OVERSHOOT_INTERPOLATOR); ObjectAnimator starScaleXAnimator = ObjectAnimator.ofFloat(ivStar, ImageView.SCALE_X, 0.2f, 1f); starScaleXAnimator.setDuration(350); starScaleXAnimator.setStartDelay(250); starScaleXAnimator.setInterpolator(OVERSHOOT_INTERPOLATOR); ObjectAnimator dotsAnimator = ObjectAnimator.ofFloat(vDotsView, DotsView.DOTS_PROGRESS, 0, 1f); dotsAnimator.setDuration(900); dotsAnimator.setStartDelay(50); dotsAnimator.setInterpolator(ACCELERATE_DECELERATE_INTERPOLATOR); animatorSet.playTogether( outerCircleAnimator, innerCircleAnimator, starScaleYAnimator, starScaleXAnimator, dotsAnimator ); animatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationCancel(Animator animation) { vCircle.setInnerCircleRadiusProgress(0); vCircle.setOuterCircleRadiusProgress(0); vDotsView.setCurrentProgress(0); ivStar.setScaleX(1); ivStar.setScaleY(1); } }); animatorSet.start(); } } @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: ivStar.animate().scaleX(0.7f).scaleY(0.7f).setDuration(150).setInterpolator(DECCELERATE_INTERPOLATOR); setPressed(true); break; case MotionEvent.ACTION_MOVE: float x = event.getX(); float y = event.getY(); boolean isInside = (x > 0 && x < getWidth() && y > 0 && y < getHeight()); if (isPressed() != isInside) { setPressed(isInside); } break; case MotionEvent.ACTION_UP: ivStar.animate().scaleX(1).scaleY(1).setInterpolator(DECCELERATE_INTERPOLATOR); if (isPressed()) { performClick(); setPressed(false); } break; case MotionEvent.ACTION_CANCEL: ivStar.animate().scaleX(1).scaleY(1).setInterpolator(DECCELERATE_INTERPOLATOR); setPressed(false); break; } return true; } public boolean isChecked() { return isChecked; } }
[ "noviyantorahmadi@gmail.com" ]
noviyantorahmadi@gmail.com
4ba04dcfdd1483ca615e3e5ef1260f59727dd731
2b0fa5aa48a02da848cad64464a4752e779ab829
/src/main/java/com/bjy/lotuas/access/service/SystemService.java
774ff14aa9bd42fa980b70308d57e15686b0a50a
[]
no_license
biejunyang/lotuas-single-sign
8a5a23d0363e71e4f837db7e1afbf67e99417d9f
ef689aa2d1d66acd3ed527ff8f431cdea8c6cf73
refs/heads/master
2021-09-06T17:44:09.213178
2018-02-09T07:21:43
2018-02-09T07:21:43
120,153,417
0
0
null
null
null
null
UTF-8
Java
false
false
1,438
java
package com.bjy.lotuas.access.service; import java.util.LinkedHashMap; import java.util.List; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.bjy.lotuas.access.entity.TSystemBean; import com.bjy.lotuas.access.vo.SystemVo; import com.bjy.lotuas.common.easyui.EasyuiGridResult; import com.bjy.lotuas.common.exception.VOCastException; import com.bjy.lotuas.common.service.BaseService; import com.bjy.lotuas.common.util.VoUtil; import com.bjy.lotuas.common.vo.CommonResultVo; import com.bjy.lotuas.common.vo.PaginatedHelper; @Service public class SystemService extends BaseService{ public EasyuiGridResult listPageSystems(PaginatedHelper paginatedHelper, LinkedHashMap<String, String> orderMap) { long count=super.getCount(TSystemBean.class); List<TSystemBean> systems=super.getList(TSystemBean.class, paginatedHelper, orderMap); return new EasyuiGridResult(systems, count); } @Transactional public CommonResultVo saveSystem(SystemVo systemVo) throws VOCastException { TSystemBean system=null; String msg=null; if(systemVo.getSystemId()!=null) { system=super.getTarget(TSystemBean.class, systemVo.getSystemId()); msg="更新成功!"; }else { system=new TSystemBean(); msg="修改成功!"; } VoUtil.copyValuesNotNull(systemVo, system, false); super.saveOrUpdate(system); return new CommonResultVo(true, msg); } }
[ "biejunyang@cngb.org" ]
biejunyang@cngb.org
81f74e7eed52478052bf96040a739ce35effd2ce
2572f47abd77cd5e4a20973f69bb862b6cce3ed7
/onlineshopping/src/main/java/shop/app/server/repository/CurrencyRepositoryImpl.java
c661d1b6debfc157a1e6b8b608518e9167c7b5f6
[]
no_license
applifireAlgo/OnlineShoppingAF
2946654068532356382b90519cc499f7d0e7d4ff
a831abc39fcda016fc08cb0178600ff876f03236
refs/heads/master
2021-01-10T13:56:26.322468
2015-11-20T14:24:26
2015-11-20T14:24:26
46,559,397
0
0
null
null
null
null
UTF-8
Java
false
false
9,985
java
package shop.app.server.repository; import com.athena.server.repository.SearchInterfaceImpl; import org.springframework.stereotype.Repository; import shop.app.shared.location.Currency; import org.springframework.context.annotation.Scope; import org.springframework.context.annotation.ScopedProxyMode; import com.athena.annotation.Complexity; import com.athena.annotation.SourceCodeAuthorClass; import com.athena.config.server.helper.ResourceFactoryManagerHelper; import org.springframework.beans.factory.annotation.Autowired; import com.athena.framework.server.helper.RuntimeLogInfoHelper; import com.athena.framework.server.exception.repository.SpartanPersistenceException; import java.lang.Override; import java.util.List; import org.springframework.transaction.annotation.Transactional; import java.util.Map; @Repository @Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS) @SourceCodeAuthorClass(createdBy = "jack@doe.com", updatedBy = "", versionNumber = "1", comments = "Repository for Currency Master table Entity", complexity = Complexity.LOW) public class CurrencyRepositoryImpl extends SearchInterfaceImpl implements CurrencyRepository<Currency> { @Autowired private ResourceFactoryManagerHelper emfResource; @Autowired private RuntimeLogInfoHelper runtimeLogInfoHelper; @Override @Transactional public List<Currency> findAll() throws SpartanPersistenceException { try { javax.persistence.EntityManager emanager = emfResource.getResource(); java.util.List<shop.app.shared.location.Currency> query = emanager.createQuery("select u from Currency u where u.systemInfo.activeStatus=1").getResultList(); return query; } catch (javax.persistence.PersistenceException e) { throw new SpartanPersistenceException("Error in retrieving entity", e); } } @Override @Transactional public Currency save(Currency entity) throws SpartanPersistenceException { try { javax.persistence.EntityManager emanager = emfResource.getResource(); emanager.persist(entity); return entity; } catch (javax.persistence.PersistenceException e) { throw new com.athena.framework.server.exception.repository.SpartanPersistenceException("Error in entity creation", e); } } @Override @Transactional public List<Currency> save(List<Currency> entity) throws SpartanPersistenceException { try { javax.persistence.EntityManager emanager = emfResource.getResource(); for (int i = 0; i < entity.size(); i++) { shop.app.shared.location.Currency obj = entity.get(i); emanager.persist(obj); } return entity; } catch (javax.persistence.PersistenceException e) { throw new com.athena.framework.server.exception.repository.SpartanPersistenceException("Error in entity Saving", e); } } @Transactional @Override public void delete(String id) throws SpartanPersistenceException { try { javax.persistence.EntityManager emanager = emfResource.getResource(); shop.app.shared.location.Currency s = emanager.find(shop.app.shared.location.Currency.class, id); emanager.remove(s); } catch (javax.persistence.PersistenceException e) { throw new SpartanPersistenceException("Error in deleting entity", e); } } @Override @Transactional public void update(Currency entity) throws SpartanPersistenceException { try { javax.persistence.EntityManager emanager = emfResource.getResource(); emanager.merge(entity); } catch (javax.persistence.PersistenceException e) { throw new com.athena.framework.server.exception.repository.SpartanPersistenceException("Error in entity creation", e); } } @Override @Transactional public void update(List<Currency> entity) throws SpartanPersistenceException { try { javax.persistence.EntityManager emanager = emfResource.getResource(); for (int i = 0; i < entity.size(); i++) { shop.app.shared.location.Currency obj = entity.get(i); emanager.merge(obj); } } catch (javax.persistence.PersistenceException e) { throw new com.athena.framework.server.exception.repository.SpartanPersistenceException("Error in entity updation", e); } } @Transactional public List<Object> search(String finderName, Map<String, Object> fields, Map<String, String> fieldMetaData) throws Exception { try { javax.persistence.EntityManager emanager = emfResource.getResource(); javax.persistence.Query query = emanager.createNamedQuery(finderName); java.util.Map<String, Object> map = new java.util.HashMap<String, Object>(); Map<String, String> metaData = new java.util.HashMap<String, String>(); metaData = fieldMetaData; java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("dd-MM-yyyy"); String inputStr = "01-01-1850"; java.util.Date date = formatter.parse(inputStr); java.sql.Timestamp timestamp = new java.sql.Timestamp(date.getTime()); for (Map.Entry<String, String> entry : metaData.entrySet()) { boolean matched = false; for (Map.Entry<String, Object> entry1 : fields.entrySet()) { if (entry.getKey() == entry1.getKey()) { if (entry.getValue().equalsIgnoreCase("integer") || entry.getValue().equalsIgnoreCase("double") || entry.getValue().equalsIgnoreCase("float") || entry.getValue().equalsIgnoreCase("long")) { map.put("min" + entry1.getKey(), entry1.getValue()); map.put("max" + entry1.getKey(), entry1.getValue()); } else if (entry.getValue().equalsIgnoreCase("String")) { map.put(entry1.getKey(), "%" + entry1.getValue() + "%"); } else { map.put(entry1.getKey(), entry1.getValue()); } matched = true; break; } } if (!matched) { if (entry.getValue().equalsIgnoreCase("String")) { map.put(entry.getKey(), "%"); } else if (entry.getValue().equalsIgnoreCase("integer")) { map.put("min" + entry.getKey(), Integer.MIN_VALUE); map.put("max" + entry.getKey(), Integer.MAX_VALUE); } else if (entry.getValue().equalsIgnoreCase("double")) { map.put("min" + entry.getKey(), java.lang.Double.MIN_VALUE); map.put("max" + entry.getKey(), java.lang.Double.MAX_VALUE); } else if (entry.getValue().equalsIgnoreCase("long")) { map.put("min" + entry.getKey(), java.lang.Long.MIN_VALUE); map.put("max" + entry.getKey(), java.lang.Long.MAX_VALUE); } else if (entry.getValue().equalsIgnoreCase("float")) { map.put("min" + entry.getKey(), java.lang.Float.MIN_VALUE); map.put("max" + entry.getKey(), java.lang.Float.MAX_VALUE); } else if (entry.getValue().equalsIgnoreCase("Date") || entry.getValue().equalsIgnoreCase("DATETIME")) { map.put(entry.getKey(), date); } else if (entry.getValue().equalsIgnoreCase("TINYINT")) { map.put(entry.getKey(), 1); } else if (entry.getValue().equalsIgnoreCase("timestamp")) { map.put(entry.getKey(), timestamp); } else if (entry.getValue().equalsIgnoreCase("integer_userAccesCode")) { map.put(entry.getKey(), runtimeLogInfoHelper.getUserAccessCode()); } } } for (Map.Entry<String, Object> entry : map.entrySet()) { query.setParameter(entry.getKey(), entry.getValue()); } java.util.List<Object> list = query.getResultList(); return list; } catch (Exception e) { throw e; } } @Transactional public List<Currency> findByCountryId(String countryId) throws Exception, SpartanPersistenceException { try { javax.persistence.EntityManager emanager = emfResource.getResource(); javax.persistence.Query query = emanager.createNamedQuery("Currency.findByCountryId"); query.setParameter("countryId", countryId); java.util.List<shop.app.shared.location.Currency> listOfCurrency = query.getResultList(); return listOfCurrency; } catch (javax.persistence.PersistenceException e) { throw new com.athena.framework.server.exception.repository.SpartanPersistenceException("Error in executing query", e); } } @Transactional public Currency findById(String currencyId) throws Exception, SpartanPersistenceException { try { javax.persistence.EntityManager emanager = emfResource.getResource(); javax.persistence.Query query = emanager.createNamedQuery("Currency.findById"); query.setParameter("currencyId", currencyId); shop.app.shared.location.Currency listOfCurrency = (shop.app.shared.location.Currency) query.getSingleResult(); return listOfCurrency; } catch (javax.persistence.PersistenceException e) { throw new com.athena.framework.server.exception.repository.SpartanPersistenceException("Error in executing query", e); } } }
[ "anagha@anagha-Lenovo-Z50-70" ]
anagha@anagha-Lenovo-Z50-70
b2da0baa310b96307c777801f7ede7cc0a82574b
abb7595a979afada4416d0b177a96ca39184b956
/lib/batik-1.9-src/batik-svggen/src/main/java/org/apache/batik/svggen/font/Font.java
785f4ce75741f6af012207fbdb4e5a2548b06f6a
[ "Apache-2.0", "MIT" ]
permissive
seanmcox/scratch-runner-implementation
6101adc3a6d5dec0f53b77f49e3357ba6260febe
20f73f009bb6a1aaa155125f6e3be4ffe112b23c
refs/heads/master
2023-02-21T14:52:52.829791
2023-02-05T04:24:22
2023-02-05T04:24:22
122,667,595
0
0
MIT
2019-02-04T07:20:50
2018-02-23T20:09:04
Java
UTF-8
Java
false
false
5,781
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.batik.svggen.font; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import org.apache.batik.svggen.font.table.CmapTable; import org.apache.batik.svggen.font.table.GlyfTable; import org.apache.batik.svggen.font.table.HeadTable; import org.apache.batik.svggen.font.table.HheaTable; import org.apache.batik.svggen.font.table.HmtxTable; import org.apache.batik.svggen.font.table.LocaTable; import org.apache.batik.svggen.font.table.MaxpTable; import org.apache.batik.svggen.font.table.NameTable; import org.apache.batik.svggen.font.table.Os2Table; import org.apache.batik.svggen.font.table.PostTable; import org.apache.batik.svggen.font.table.Table; import org.apache.batik.svggen.font.table.TableDirectory; import org.apache.batik.svggen.font.table.TableFactory; /** * The TrueType font. * @version $Id: Font.java 1733416 2016-03-03 07:07:13Z gadams $ * @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a> */ public class Font { private String path; // private Interpreter interp = null; // private Parser parser = null; private TableDirectory tableDirectory = null; private Table[] tables; private Os2Table os2; private CmapTable cmap; private GlyfTable glyf; private HeadTable head; private HheaTable hhea; private HmtxTable hmtx; private LocaTable loca; private MaxpTable maxp; private NameTable name; private PostTable post; /** * Constructor */ public Font() { } public Table getTable(int tableType) { for (int i = 0; i < tables.length; i++) { if ((tables[i] != null) && (tables[i].getType() == tableType)) { return tables[i]; } } return null; } public Os2Table getOS2Table() { return os2; } public CmapTable getCmapTable() { return cmap; } public HeadTable getHeadTable() { return head; } public HheaTable getHheaTable() { return hhea; } public HmtxTable getHmtxTable() { return hmtx; } public LocaTable getLocaTable() { return loca; } public MaxpTable getMaxpTable() { return maxp; } public NameTable getNameTable() { return name; } public PostTable getPostTable() { return post; } public int getAscent() { return hhea.getAscender(); } public int getDescent() { return hhea.getDescender(); } public int getNumGlyphs() { return maxp.getNumGlyphs(); } public Glyph getGlyph(int i) { return (glyf.getDescription(i) != null) ? new Glyph( glyf.getDescription(i), hmtx.getLeftSideBearing(i), hmtx.getAdvanceWidth(i)) : null; } public String getPath() { return path; } public TableDirectory getTableDirectory() { return tableDirectory; } /** * @param pathName Path to the TTF font file */ protected void read(String pathName) { path = pathName; File f = new File(pathName); if (!f.exists()) { // TODO: Throw TTException return; } try { RandomAccessFile raf = new RandomAccessFile(f, "r"); tableDirectory = new TableDirectory(raf); tables = new Table[tableDirectory.getNumTables()]; // Load each of the tables for (int i = 0; i < tableDirectory.getNumTables(); i++) { tables[i] = TableFactory.create (tableDirectory.getEntry(i), raf); } raf.close(); // Get references to commonly used tables os2 = (Os2Table) getTable(Table.OS_2); cmap = (CmapTable) getTable(Table.cmap); glyf = (GlyfTable) getTable(Table.glyf); head = (HeadTable) getTable(Table.head); hhea = (HheaTable) getTable(Table.hhea); hmtx = (HmtxTable) getTable(Table.hmtx); loca = (LocaTable) getTable(Table.loca); maxp = (MaxpTable) getTable(Table.maxp); name = (NameTable) getTable(Table.name); post = (PostTable) getTable(Table.post); // Initialize the tables that require it hmtx.init(hhea.getNumberOfHMetrics(), maxp.getNumGlyphs() - hhea.getNumberOfHMetrics()); loca.init(maxp.getNumGlyphs(), head.getIndexToLocFormat() == 0); glyf.init(maxp.getNumGlyphs(), loca); } catch (IOException e) { e.printStackTrace(); } } public static Font create() { return new Font(); } /** * @param pathName Path to the TTF font file */ public static Font create(String pathName) { Font f = new Font(); f.read(pathName); return f; } }
[ "git@smcox.com" ]
git@smcox.com
a0bb94ff52fc529901967f481d8d97a5c0b1327b
3090fb932af238d117f8960a8b96a9ddec78a9d2
/代码/实训一/二级页面/社区二级界面/社区关注/demo1/app/src/main/java/com/example/celia/demo1/index/paiming.java
377d6c89fdb633c7394a784d2563ad3958df6f4c
[]
no_license
RenHanbin/AndroidProject
12272d4f768a2303ec3da2ddb288cdf632f8cc95
89b66de04a2b78fa45b7dce7ba8d6057855a1079
refs/heads/master
2020-04-07T18:41:11.940685
2019-06-12T06:07:31
2019-06-12T06:07:31
158,619,889
2
1
null
null
null
null
UTF-8
Java
false
false
1,321
java
package com.example.celia.demo1.index; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.FragmentTabHost; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.Window; import android.widget.ImageView; import android.widget.TabHost; import android.widget.TextView; import com.example.celia.demo1.R; public class paiming extends AppCompatActivity { private FragmentTabHost tabHost;// 声明FragmentTabhost控件 private String[] tabHostText={"考研率","出国","就业率"}; private Class[] fragmentArr = {Paiming_learn.class,Paiming_out.class,Paiming_work.class}; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); supportRequestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.paiming); initTabHost(); } private void initTabHost() { tabHost = findViewById(android.R.id.tabhost); tabHost.setup(this,getSupportFragmentManager(),android.R.id.tabhost); for(int i=0;i<fragmentArr.length;i++){ TabHost.TabSpec tabSpec = tabHost.newTabSpec(tabHostText[i]).setIndicator(tabHostText[i]); tabHost.addTab(tabSpec,fragmentArr[i],null); } } }
[ "1627909594@qq.com" ]
1627909594@qq.com
4631cd7312fd81aab9118dfcbc852417f49fc7dc
6cfc341823dbbc6df4c15919ec6e4025764aa71d
/src/main/java/com/qfedu/SpringbootRedisLockApplication.java
a33a066277f1e5a7a833d266175da24b8859bd1d
[]
no_license
longhuiming1999/springboot_redis_lock
b315672b5d375d3c6c526dd3d73e1e63b2902c4c
920613ccce879244c927db154483e120e65833b8
refs/heads/master
2022-10-28T20:31:35.552362
2020-06-08T06:05:03
2020-06-08T06:05:03
270,549,744
0
0
null
null
null
null
UTF-8
Java
false
false
453
java
package com.qfedu; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication(scanBasePackages = "com.qfedu") @MapperScan("com.qfedu.mapper") public class SpringbootRedisLockApplication { public static void main(String[] args) { SpringApplication.run(SpringbootRedisLockApplication.class, args); } }
[ "longhuiming0122@aliyun.com" ]
longhuiming0122@aliyun.com
895a848a7b63b52836dd4790dadc37b435ef1f38
9520a1e0a7080f2a20b6123e49699c7542f15ed3
/src/main/java/com/github/appreciated/apexcharts/config/chart/Selection.java
a29156369ae21c727c51bf248ddc3ff684aba1db
[ "Apache-2.0" ]
permissive
appreciated/apexcharts-flow
aa901337a6e7a77fdb482533f27296ba8ed37522
c27f20d4bf7e96d4272861b15345d058c603efcc
refs/heads/master
2023-06-24T21:21:47.108233
2022-12-14T21:47:56
2022-12-14T21:47:56
180,203,438
52
47
Apache-2.0
2023-06-16T06:49:39
2019-04-08T17:52:44
Java
UTF-8
Java
false
false
1,373
java
package com.github.appreciated.apexcharts.config.chart; import com.github.appreciated.apexcharts.config.chart.selection.Fill; import com.github.appreciated.apexcharts.config.chart.selection.Stroke; import com.github.appreciated.apexcharts.config.chart.selection.Xaxis; import com.github.appreciated.apexcharts.config.chart.selection.Yaxis; public class Selection { private Boolean enabled; private String type; private Fill fill; private Stroke stroke; private Xaxis xaxis; private Yaxis yaxis; public Selection() { } public Boolean getEnabled() { return enabled; } public String getType() { return type; } public Fill getFill() { return fill; } public Stroke getStroke() { return stroke; } public Xaxis getXaxis() { return xaxis; } public Yaxis getYaxis() { return yaxis; } public void setEnabled(Boolean enabled) { this.enabled = enabled; } public void setType(String type) { this.type = type; } public void setFill(Fill fill) { this.fill = fill; } public void setStroke(Stroke stroke) { this.stroke = stroke; } public void setXaxis(Xaxis xaxis) { this.xaxis = xaxis; } public void setYaxis(Yaxis yaxis) { this.yaxis = yaxis; } }
[ "GoebelJohannes@gmx.net" ]
GoebelJohannes@gmx.net
98fc006cdbcdc93747710171ce41d8da6c88a410
61a5c96493dc5e39a80f8a2dabcff4123987b45d
/src/main/java/pl/sdacademy/springdata/task06/AnimalRepository.java
abe516bd8bdcaf9989c4b7281d84139dae6ba206
[]
no_license
jurekbal/spring-data
5f54a8f6f95f675c1eb5e7123c166220a121b1c2
9d8eb8c541e4fa9b7e5c014c96ae1d5ba2796bbe
refs/heads/master
2022-12-12T16:29:28.592693
2020-09-06T11:43:22
2020-09-06T11:43:22
293,264,510
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package pl.sdacademy.springdata.task06; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface AnimalRepository extends JpaRepository<Animal, Long> { //zad 6.1 public List<Animal> findByAgeGreaterThanAndNameIsLike(int age, String name); //zad 6.2 List<Animal> findByName(String name); List<Animal> findByAge(int age); List<Animal> findByNameAndAge(String name, int age); List<Animal> findTop3ByOrderByNameDesc(); }
[ "jurek_b@wp.pl" ]
jurek_b@wp.pl
874f1a7cefe53b41ce2553b3687e9d53fcc451e0
6a26e7d54bd6918242de6d2bbf716748763ba6b4
/src/christine/intermediate/symtabimpl/SymTabKeyImpl.java
5ab28560f0b2b24fc4de3c595c70e9fb468e0c0a
[]
no_license
theDavidUng/ChristineProgrammingLanguage
20fc12501a4ce4c20f5407da68567e395c956b79
72af57df7c7f49f9f4b35b282c4ee69852b90a4c
refs/heads/master
2021-04-28T01:33:32.266516
2018-02-21T02:47:07
2018-02-21T02:47:07
122,280,508
0
0
null
null
null
null
UTF-8
Java
false
false
604
java
package christine.intermediate.symtabimpl; import christine.intermediate.SymTabKey; /** * <h1>SymTabKeyImpl</h1> * * <p>Attribute keys for a symbol table entry.</p> * * <p>Copyright (c) 2009 by Ronald Mak</p> * <p>For instructional purposes only. No warranties.</p> */ public enum SymTabKeyImpl implements SymTabKey { // Constant. CONSTANT_VALUE, // Procedure or function. ROUTINE_CODE, ROUTINE_SYMTAB, ROUTINE_ICODE, ROUTINE_PARMS, ROUTINE_ROUTINES, // Variable or record field value. DATA_VALUE, // Local variables array slot numbers. SLOT, WRAP_SLOT }
[ "ung_david@yahoo.com" ]
ung_david@yahoo.com
f25ceca59535cce7e827a1ee46e7fceedda96b2d
19836df132d4da8515da993b71128f09bd6b7aca
/src/main/java/com/billJiang/framework/query/entity/Query.java
7b82cfbaf83df34f7268b7f095515ab34b1dbeb0
[ "MIT" ]
permissive
diycp/AdminEAP
3cf019bb967f929e210e1d7e18bc094c369531c0
6dd1ab7fef8d98b3f6ebe970e7a1675c709fade6
refs/heads/master
2021-01-13T04:15:30.392194
2016-12-27T03:14:18
2016-12-27T03:14:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,687
java
package com.billJiang.framework.query.entity; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.digester3.annotations.rules.BeanPropertySetter; import org.apache.commons.digester3.annotations.rules.ObjectCreate; import org.apache.commons.digester3.annotations.rules.SetNext; import org.apache.commons.digester3.annotations.rules.SetProperty; @ObjectCreate(pattern = "queryContext/query") public class Query { @SetProperty(attributeName = "id", pattern = "queryContext/query") private String id; @SetProperty(attributeName = "key", pattern = "queryContext/query") private String key; @SetProperty(attributeName = "countStr", pattern = "queryContext/query") private String countStr; @SetProperty(attributeName = "tableName", pattern = "queryContext/query") private String tableName; @SetProperty(attributeName = "className", pattern = "queryContext/query") private String className; @SetProperty(attributeName = "pageSize", pattern = "queryContext/query") private Integer pagesize; @SetProperty(attributeName = "pagesInGrp", pattern = "queryContext/query") private Integer pagesInGrp; @SetProperty(attributeName = "splitAt", pattern = "queryContext/query") private Integer splitAt; @SetProperty(attributeName = "widthType", pattern = "queryContext/query") private String widthType; @SetProperty(attributeName = "allowPaging", pattern = "queryContext/query") private Boolean allowPaging; @SetProperty(attributeName = "filter", pattern = "queryContext/query") private String filter; @SetProperty(attributeName = "order", pattern = "queryContext/query") private String order; @SetProperty(attributeName = "enableMultiline", pattern = "queryContext/query") private Boolean enableMultiline; // 排序主键 解决分页数据重复问题 2014-3-15 @SetProperty(attributeName = "sortKey", pattern = "queryContext/query") private String sortKey; // 数据权限是否存在数据库(即服务器端过滤条件) @SetProperty(attributeName = "isServerFilter", pattern = "queryContext/query") private Boolean isServerFilter; @SetProperty(attributeName = "enableMultiHeader", pattern = "queryContext/query") private Boolean enableMultiHeader; @SetProperty(attributeName = "simpleSearch", pattern = "queryContext/query") /** * 赵彬彬添加为了越过框架获取结果集,去掉用自己实现的结果集 */ // 是否沿用原来的框架提供的查询默认是true private Boolean simpleSearch; // 仅在simpleSearch设置false时生效,提供的回调service @SetProperty(attributeName = "service", pattern = "queryContext/query") private String service; // 仅在simpleSearch设置false时生效,提供回调的method @SetProperty(attributeName = "method", pattern = "queryContext/query") private String method; /** * sql 扩展 ,支持复杂查询 */ @BeanPropertySetter(pattern = "queryContext/query/sql") private String sql; @BeanPropertySetter(pattern = "queryContext/query/varSql") private String varSql; @BeanPropertySetter(pattern = "queryContext/query/startRow") private Integer startRow; @BeanPropertySetter(pattern = "query") private BeforeInit beforeInit; private List<Column> columnList; private Map<String, Column> columnMap; private List<Call> callList; private AfterInit afterInit; public Query() { pagesize = 10; pagesInGrp = 5; key = "id"; columnList = new ArrayList<Column>(); columnMap = new HashMap<String, Column>(); widthType = "px"; allowPaging = true; enableMultiline = true; countStr = "count(*)"; isServerFilter = false; enableMultiHeader = false; simpleSearch = true; startRow = 1; } public List<Call> getCallList() { return callList; } public void setCallList(List<Call> callList) { this.callList = callList; } public BeforeInit getBeforeInit() { return beforeInit; } @SetNext public void setBeforeInit(BeforeInit beforeInit) { this.beforeInit = beforeInit; } @SetNext public void setAfterInit(AfterInit afterInit) { this.afterInit = afterInit; } public Boolean getIsServerFilter() { return isServerFilter; } public void setIsServerFilter(Boolean isServerFilter) { this.isServerFilter = isServerFilter; } public String getCountStr() { return countStr; } public void setCountStr(String countStr) { this.countStr = countStr; } @SetNext public void addColumn(Column queryColumn) { columnList.add(queryColumn); columnMap.put(queryColumn.getId() != null ? queryColumn.getId() : queryColumn.getKey(), queryColumn); } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getTableName() { return tableName; } public void setTableName(String tableName) { this.tableName = tableName; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public Integer getPagesize() { return pagesize; } public void setPagesize(Integer pagesize) { this.pagesize = pagesize; } public Integer getPagesInGrp() { return pagesInGrp; } public void setPagesInGrp(Integer pagesInGrp) { this.pagesInGrp = pagesInGrp; } public Integer getSplitAt() { return splitAt; } public void setSplitAt(Integer splitAt) { this.splitAt = splitAt; } public String getWidthType() { return widthType; } public void setWidthType(String widthType) { this.widthType = widthType; } public Boolean getAllowPaging() { return allowPaging; } public void setAllowPaging(Boolean allowPaging) { this.allowPaging = allowPaging; } public String getFilter() { return filter; } public void setFilter(String filter) { this.filter = filter; } public String getOrder() { return order; } public void setOrder(String order) { this.order = order; } public List<Column> getColumnList() { return columnList; } public Map<String, Column> getColumnMap() { return columnMap; } public AfterInit getAfterInit() { return afterInit; } public Column getColumn(String key) { return (Column) columnMap.get(key); } public void setColumnList(List<Column> columnList) { this.columnList = columnList; } public void setColumnMap(Map<String, Column> columnMap) { this.columnMap = columnMap; } public Boolean getEnableMultiline() { return enableMultiline; } public void setEnableMultiline(Boolean enableMultiline) { this.enableMultiline = enableMultiline; } public String getSql() { return sql; } public void setSql(String sql) { this.sql = sql; } public String getVarSql() { return varSql; } public void setVarSql(String varSql) { this.varSql = varSql; } public String getSortKey() { return sortKey; } public void setSortKey(String sortKey) { this.sortKey = sortKey; } public Boolean getEnableMultiHeader() { return enableMultiHeader; } public void setEnableMultiHeader(Boolean enableMultiHeader) { this.enableMultiHeader = enableMultiHeader; } public Boolean getSimpleSearch() { return simpleSearch; } public void setSimpleSearch(Boolean simpleSearch) { this.simpleSearch = simpleSearch; } public String getService() { return service; } public void setService(String service) { this.service = service; } public String getMethod() { return method; } public void setMethod(String method) { this.method = method; } public Integer getStartRow() { return startRow; } public void setStartRow(Integer startRow) { this.startRow = startRow; } }
[ "jrn1012@petrochina.com.cn" ]
jrn1012@petrochina.com.cn
caa6897831281bc5f43ad091915008e9c7bf8f6b
e07ff5d81b63a320b9aac65c012da22d484d4b35
/src/schedulingDSL.parent/schedulingDSL/src-gen/scheduling/dsl/ProcessBehavior.java
4453655be76580dde5a8d38b8de995566ff0743d
[]
no_license
nhathoatran/SSpinJa
97856188fe2b55f3024470617b489c209f7afa17
e14821536b96f8f6eccc26c137ee47f8d298da66
refs/heads/main
2023-07-16T09:10:51.009289
2021-09-02T12:01:36
2021-09-02T12:01:36
311,513,765
0
0
null
null
null
null
UTF-8
Java
false
false
2,134
java
/** * generated by Xtext 2.10.0 */ package scheduling.dsl; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Process Behavior</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link scheduling.dsl.ProcessBehavior#getConstructor <em>Constructor</em>}</li> * <li>{@link scheduling.dsl.ProcessBehavior#getMethod <em>Method</em>}</li> * </ul> * * @see scheduling.dsl.DslPackage#getProcessBehavior() * @model * @generated */ public interface ProcessBehavior extends EObject { /** * Returns the value of the '<em><b>Constructor</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the value of the '<em>Constructor</em>' containment reference. * @see #setConstructor(Constructor) * @see scheduling.dsl.DslPackage#getProcessBehavior_Constructor() * @model containment="true" * @generated */ Constructor getConstructor(); /** * Sets the value of the '{@link scheduling.dsl.ProcessBehavior#getConstructor <em>Constructor</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Constructor</em>' containment reference. * @see #getConstructor() * @generated */ void setConstructor(Constructor value); /** * Returns the value of the '<em><b>Method</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the value of the '<em>Method</em>' containment reference. * @see #setMethod(Method) * @see scheduling.dsl.DslPackage#getProcessBehavior_Method() * @model containment="true" * @generated */ Method getMethod(); /** * Sets the value of the '{@link scheduling.dsl.ProcessBehavior#getMethod <em>Method</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Method</em>' containment reference. * @see #getMethod() * @generated */ void setMethod(Method value); } // ProcessBehavior
[ "hoatn@soict.hust.edu.vn" ]
hoatn@soict.hust.edu.vn
32078e6bba56ce749d48216ccfe4c034c10d4f1c
8b4a5bec6f2cbfec4df534c15be7abbfe4710ecd
/app/src/main/java/com/warrior/hangsu/administrator/strangerbookreader/widget/bar/GradientBar.java
edba8e44758151c937d31f98cb9f2360f0ed473c
[]
no_license
warriorWorld/StrangerBookReader
959d001eca5b2c160343eba0d4366ec6022465cd
f44206ffacddad13ddf5f5449ab2ed33ecd64397
refs/heads/master
2022-09-15T02:24:05.191538
2022-08-31T16:37:59
2022-08-31T16:37:59
121,765,873
8
1
null
null
null
null
UTF-8
Java
false
false
1,362
java
package com.warrior.hangsu.administrator.strangerbookreader.widget.bar;/** * Created by Administrator on 2016/10/27. */ import android.content.Context; import android.util.AttributeSet; import android.widget.RelativeLayout; /** * 作者:苏航 on 2016/10/27 16:58 * 邮箱:772192594@qq.com */ public class GradientBar extends RelativeLayout { public GradientBar(Context context) { this(context, null); } public GradientBar(Context context, AttributeSet attrs) { super(context, attrs); } /** * 修改TopBar背景的透明度 * * @alpha 透明度 取值范围在[0, 255] */ public void setBackgroundAlpha(int alpha) { //setbackgroud能避免标题也同时变透明的情况 //.mutate方法能够避免 直接修改资源值的问题 this.getBackground().mutate().setAlpha(alpha); } /*** * 计算TopBar当前的透明度 * * @param currentOffset * @param alphaTargetOffset currentOffset == alphaTargetOffset时,透明度为1 */ public void computeAndsetBackgroundAlpha(float currentOffset, int alphaTargetOffset) { float alpha = currentOffset * 1.0f / alphaTargetOffset; alpha = Math.max(0, Math.min(alpha, 1)); int alphaInt = (int) (alpha * 255); this.setBackgroundAlpha(alphaInt); } }
[ "772192594@qq.com" ]
772192594@qq.com
a9d7f1f86b1e509409fbab448c1e09808bb2bbde
58f0111fa6e364032bfcb6ba7a378d428868cad6
/Multithreading/Wait_Notify_NotifyAll/W_N_N_all_3/src/test/java/ru.skorikov/MyLockTest.java
2723ae9d229433ce985e689a66de185dad571d0a
[]
no_license
KayzerSoze/java_kurs_standart
72b6db9ac1a4ce17b4ab17e3f6aa844d90f1231a
4c4e943217aa7677dbec62299f2705877818ea52
refs/heads/master
2021-09-12T15:26:37.540547
2018-04-18T02:05:47
2018-04-18T02:05:47
104,547,153
0
0
null
null
null
null
UTF-8
Java
false
false
1,626
java
package ru.skorikov; import org.junit.Assert; import org.junit.Test; /** * Created with IntelliJ IDEA. * * @ author: Alex_Skorikov. * @ date: 14.02.18 * @ version: java_kurs_standart */ public class MyLockTest { /** * Тестовая переменная. */ private int count = 0; /** * Проверим работу блокировки. * Запустим 20 потоков. * Но блокировкой владеет только один. * тестовая переменная равна 1. */ @Test public void whenOneLockThenRezultOne() { MyLock myLock = new MyLock(); for (int i = 0; i < 20; i++) { new Thread(new Runnable() { @Override public void run() { myLock.lock(); count++; } }).start(); } Assert.assertEquals(count, 1); } /** * Проверим работу блокировки. * Запустим 20 потоков. * Блокировка по очереди. * тестовая переменная равна 20. */ @Test public void whenTwentyLockThenRezultThenty() { MyLock myLock = new MyLock(); for (int i = 0; i <= 20; i++) { new Thread(new Runnable() { @Override public void run() { myLock.lock(); count++; myLock.unlock(); } }).start(); } Assert.assertEquals(count, 20); } }
[ "insaider@bk.ru" ]
insaider@bk.ru
e6aeaded550f8d00de7250fe0aa75e5c66737dae
b57f2bbd49446379217dc31079b9dcb28e584033
/java110-servlet/src/main/java/bitcamp/java110/ex06/Servlet02.java
d7f6692927f9d63d7f3f7b579a918ca935ee9158
[]
no_license
kukyanghoon/java110
7936eb44af0956c3022bf5322aaaa8777c19f85f
e90daf9235dbf2ba667a17baa207ba3696099849
refs/heads/master
2020-03-27T23:05:16.771935
2018-11-13T01:56:07
2018-11-13T01:56:07
147,139,599
0
0
null
null
null
null
UTF-8
Java
false
false
1,763
java
/* * 서블릿 배치 정보 - 초기 파라미터 * => 서블릿이 실행하는 동안 사용할 값이 고정 값이라면 * 자바 코드로 그 값을 표현하기 보다는 * 애노테이션이나 XML 태그로 표현하는 것이 관리하기 편하다. */ package bitcamp.java110.ex06; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebInitParam; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet( // 배치 정보를 설정하는 애노테이션 value="/ex06/servlet02", initParams= { @WebInitParam(name="aaa",value="hello"), @WebInitParam(name="bbb",value="hello2"), @WebInitParam(name="ccc",value="hello3") }) public class Servlet02 extends HttpServlet{ private static final long serialVersionUID = 1L; @Override public void init() throws ServletException { System.out.println("ex06.Servlet01.init()... 호출됨!"); } @Override public void service( HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/plain;charset=UTF-8"); PrintWriter out = res.getWriter(); // 배치 정보에서 초기화 파라미터 값을 꺼내기 out.printf("aaa=%s\n",this.getInitParameter("aaa")); out.printf("bbb=%s\n",this.getInitParameter("bbb")); out.printf("ccc=%s\n",this.getInitParameter("ccc")); } }
[ "mikekuk2005@naver.com" ]
mikekuk2005@naver.com
44471e05d27141db5f5f8ad7b37e28b6494644f9
4407e50f7e46804ffd093677613d8cf06de75333
/aula-02/exercicios-aula-2/src/exercicio1/App.java
85704172547f8a65ff6d9f81aab45442ff33d16f
[]
no_license
tiagofeldens/reset-01
5cdad4f5ca479e609ef8f47a4be41e944a50490b
57f804bbd5e54a21d04961be94d28b4de3530a99
refs/heads/master
2021-02-27T20:38:39.370386
2020-04-24T22:30:09
2020-04-24T22:30:09
245,634,387
0
0
null
null
null
null
UTF-8
Java
false
false
163
java
package exercicio1; public class App { public static void main(String[] args) { Aluno aluno = new Aluno("tiago"", 5) } //terminar exercicio1 }
[ "tiagofeldens.tf@gmail.com" ]
tiagofeldens.tf@gmail.com
2e1245bbfe3e2a3de3815614c6dfd242f520cfd6
c15e54970b558120ed69f55aeec119ba945ca651
/src/main/java/com/ysh/fenu/comm/util/JwtTokenUtil.java
529933b5be86f1a6b79ba99c03da2d6341aaf669
[]
no_license
shyoon87/vue_temp1
b9be8180db414e381b51ba32bb8ad6764f0c986d
d5538013b43f3fa5ecf89e455fa509d02ea1f06a
refs/heads/master
2023-01-27T21:49:15.965735
2023-01-11T08:10:37
2023-01-11T08:10:37
225,620,810
0
0
null
2020-09-04T05:58:25
2019-12-03T12:59:15
Vue
UTF-8
Java
false
false
4,797
java
package com.ysh.fenu.comm.util; import com.ysh.fenu.comm.security.JwtUser; import io.jsonwebtoken.*; import io.jsonwebtoken.impl.DefaultClock; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import java.io.Serializable; import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.function.Function; @Component public class JwtTokenUtil implements Serializable { private static final long serialVersionUID = -3301605591108950415L; private Clock clock = DefaultClock.INSTANCE; @Value("${jwt.secret}") private String secret; @Value("${jwt.expiration}") private Long expiration; //Id public String getIdFromToken(String token){ return String.valueOf( this.getAllClaimsFromToken(token).get("id") ); } //User Id public String getUserIdFromToken(String token) { return getClaimFromToken(token, Claims::getSubject); } //Ip public String getIpFromToken(String token){ return String.valueOf( this.getAllClaimsFromToken(token).get("ip") ); } //생성 시간 public Date getIssuedAtDateFromToken(String token) { return getClaimFromToken(token, Claims::getIssuedAt); } //token 종료 시간 public Date getExpirationDateFromToken(String token) { return getClaimFromToken(token, Claims::getExpiration); } private <T> T getClaimFromToken(String token, Function<Claims, T> claimsResolver) { final Claims claims = getAllClaimsFromToken(token); return claimsResolver.apply(claims); } private Claims getAllClaimsFromToken(String token) { if(token == null || token.isEmpty()){ return null; } else { try { return Jwts.parser() .setSigningKey(secret) .parseClaimsJws(token) .getBody(); } catch(Exception ex){ return null; } } } public JwtUser getJwtUser(String token){ Claims claims = this.getAllClaimsFromToken(token); return new JwtUser(Integer.valueOf(claims.get("userId").toString()), String.valueOf(claims.get("name")), String.valueOf(claims.get("ip"))); } /* * 토큰 생성 */ public String generateToken(JwtUser userDetails) { Map<String, Object> claims = new HashMap<>(); claims.put("userId", userDetails.getUserId()); claims.put("name", userDetails.getName()); claims.put("ip", userDetails.getIp()); return doGenerateToken(claims, userDetails.getUserId()); } private String doGenerateToken(Map<String, Object> claims, int subject) { final Date createdDate = clock.now(); final Date expirationDate = calculateExpirationDate(createdDate); return Jwts.builder() .setClaims(claims) .setSubject(String.valueOf( subject )) .setIssuedAt(createdDate) .setExpiration(expirationDate) .signWith(SignatureAlgorithm.HS512, secret) .compact(); } /* * 토큰 새로고침 * validate 합격 시 --> 생성시간, 종료시간 새로정의 * */ public String refreshExpirateToken(String token) { if(token == null || "".equals(token)) return null; else { final Date createdDate = clock.now(); final Date expirationDate = calculateExpirationDate(createdDate); final Claims claims = getAllClaimsFromToken(token); claims.setIssuedAt(createdDate); claims.setExpiration(expirationDate); return Jwts.builder() .setClaims(claims) .signWith(SignatureAlgorithm.HS512, secret) .compact(); } } public Boolean validateToken(String token, String currentIp) { if("".equals(token)) return false; else { return ( this.isTokenExpired(token) && this.isTokenIpValidate(token, currentIp)); } } public Boolean isTokenIpValidate(String token, String currentIp){ Claims claims = this.getAllClaimsFromToken(token); System.out.println("istoken Ip Valid =>" + claims); try { return currentIp.equals( claims.get("ip") ); } catch(Exception ex){ return false; } } public Boolean isTokenExpired(String token) { final Date expiration = getExpirationDateFromToken(token); return expiration.before(clock.now()); } private Date calculateExpirationDate(Date createdDate) { return new Date(createdDate.getTime() + expiration * 1000); } }
[ "dotnetmate@gmail.com" ]
dotnetmate@gmail.com
7382b92ebf6887210853f0f6b42bd18cbf011ec7
e7f38e1e252fa316c875c229a0e3da35916823c6
/src/com/company/task9/Employee.java
9e00d03dd9b53d5943520e58fc814056652c95b1
[]
no_license
Aleksey136/FullPractice
68aff8e92e98a6b9b50924064e16a3e114a1f176
a81049a7e3e2effb16d423d995a4c815ded05f50
refs/heads/master
2023-02-03T18:49:53.455157
2020-12-15T15:21:49
2020-12-15T15:21:49
296,964,209
0
0
null
null
null
null
UTF-8
Java
false
false
1,571
java
package com.company.task9; import java.util.Calendar; import java.util.Date; public class Employee { private String surname; private String name; private Calendar date; private String place; private String phone; private double salary; private String position; public Employee(String name, String surname, Calendar date, String place, String phone, double salary, String position) { this.name = name; this.surname = surname; this.date = date; this.place = place; this.phone = phone; this.salary = salary; this.position = position; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Calendar getDate() { return date; } public void setDate(Calendar date) { this.date = date; } public String getPlace() { return place; } public void setPlace(String place) { this.place = place; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public double getSalary() { return salary; } public void setSalary(double salary) { this.salary = salary; } public String getPosition() { return position; } public void setPosition(String position) { this.position = position; } }
[ "leha.lebedev.02@list.ru" ]
leha.lebedev.02@list.ru
fa09779ddc7c222776fd3bc2a5772c7f29c2b8fd
0ff12c4d3965c34db8c92ceebd8b6313c12b7561
/mage4j/mage4j-php-parser/src/main/java/com/naver/mage4j/php/mage/MageExpressionLogicalNot.java
7ab04fc54efc273740eba52ed3491883debc40f1
[]
no_license
Uncontainer/proto
aba023cf12e8245abe5a72e2a5fd95aaa4b1d25a
a136bd7e4a11782927bc55d9d9cb1e35abe25013
refs/heads/master
2021-01-19T19:14:16.693873
2015-04-21T01:52:44
2015-04-21T01:52:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
920
java
package com.naver.mage4j.php.mage; import com.naver.mage4j.php.code.PhpExpressionLogicalNot; import com.naver.mage4j.php.lang.PhpType; import com.naver.mage4j.php.lang.PhpTypeFactory; import com.naver.mage4j.php.mage.visitor.JavaCodeGenerateContext; public class MageExpressionLogicalNot implements MageExpression, MageStatementInitializable<PhpExpressionLogicalNot> { private MageExpression expression; MageExpressionLogicalNot() { super(); } @Override public void init(MageContext context, PhpExpressionLogicalNot statement) { this.expression = context.buildExpression(statement.getExpression()); } @Override public void visitJava(JavaCodeGenerateContext context) { context.appendCode("!").visit(expression, "(", ")"); } @Override public PhpType getType() { return PhpTypeFactory.BOOLEAN; } @Override public void setType(PhpType type) { // throw new UnsupportedOperationException(); } }
[ "veiner.202@daumkakao.com" ]
veiner.202@daumkakao.com
fe82744db7352adb51ecbe1ecb4b6fc1ed257109
44e31b5b3ebc44a31b41ae5278e483273cc0a73f
/Minter/src/test/java/com/hida/model/PidTest.java
9086ff5d1ab24118200dd1e01b1ac1403bc58797
[]
no_license
dagnir/PID-webservice
44eba348397ccccd7d4c2181b2c61c70cd605a57
e68de33f2ebde7cac445fb5ef8a27780dbbb0ba1
refs/heads/master
2021-01-15T22:34:17.199022
2016-06-15T22:26:48
2016-06-15T22:26:48
61,245,408
0
0
null
2016-06-15T22:32:24
2016-06-15T22:32:24
null
UTF-8
Java
false
false
8,724
java
package com.hida.model; import java.util.Comparator; import junit.framework.Assert; /** * A class created to test the validity of a Pid * * @author lruffin */ public class PidTest { /** * Tests the name to see if it matches the provided prepend * * @param name Unique identifier of a Pid * @param setting The desired setting used to create a Pid */ public void testPrepend(String name, DefaultSetting setting) { String prepend = setting.getPrepend(); Assert.assertTrue(name + ", testing prepend: " + prepend, name.startsWith(prepend)); } /** * Tests the name to see if it matches the provided prefix * * @param name Unique identifier of a Pid * @param setting The desired setting used to create a Pid */ public void testPrefix(String name, Setting setting) { String prefix = setting.getPrefix(); Assert.assertTrue(name + ", testing prefix: " + prefix, name.startsWith(prefix)); } /** * Tests the name to see if it matches the provided token type * * @param name Unique identifier of a Pid * @param setting The desired setting used to create a Pid */ public void testTokenType(String name, Setting setting) { String prefix = setting.getPrefix(); TokenType tokenType = setting.getTokenType(); boolean sansVowel = setting.isSansVowels(); boolean matchesToken = containsCorrectCharacters(prefix, name, tokenType, sansVowel); Assert.assertEquals(name + ", testing tokenType: " + tokenType, true, matchesToken); } /** * Tests the name to see if it matches the provided root length * * @param name Unique identifier of a Pid * @param setting The desired setting used to create a Pid */ public void testRootLength(String name, Setting setting) { String prefix = setting.getPrefix(); name = name.replace(prefix, ""); int rootLength = name.length(); int expRootLength = setting.getRootLength(); Assert.assertEquals(name + ", testing rootLength: " + rootLength, rootLength, expRootLength); } /** * Tests the name to see if it matches the provided char map * * @param name Unique identifier of a Pid * @param setting The desired setting used to create a Pid */ public void testCharMap(String name, Setting setting) { String prefix = setting.getPrefix(); String charMap = setting.getCharMap(); boolean sansVowel = setting.isSansVowels(); boolean matchesToken = containsCorrectCharacters(prefix, name, sansVowel, charMap); Assert.assertEquals(name + ", testing charMap: " + charMap, true, matchesToken); } /** * Tests the order of two names. The previous name must have a lesser value * than the next name to pass the test. * * @param previous The previous name * @param next The next name */ public void testOrder(String previous, String next) { PidComparator comparator = new PidComparator(); Assert.assertEquals(-1, comparator.compare(previous, next)); } /** * Checks to see if the Pid matches the given parameters * * @param prefix A sequence of characters that appear in the beginning of * PIDs * @param name Unique identifier of a Pid * @param tokenType An enum used to configure PIDS * @param sansVowel Dictates whether or not vowels are allowed * @return True if the Pid matches the parameters, false otherwise */ private boolean containsCorrectCharacters(String prefix, String name, TokenType tokenType, boolean sansVowel) { String regex = retrieveRegex(tokenType, sansVowel); return name.matches(String.format("^(%s)%s$", prefix, regex)); } /** * Checks to see if the Pid matches the given parameters * * @param prefix A sequence of characters that appear in the beginning of * PIDs * @param name Unique identifier of a Pid * @param tokenType An enum used to configure PIDS * @param sansVowel Dictates whether or not vowels are allowed * @return True if the Pid matches the parameters, false otherwise */ private boolean containsCorrectCharacters(String prefix, String name, boolean sansVowel, String charMap) { String regex = retrieveRegex(charMap, sansVowel); return name.matches(String.format("^(%s)%s$", prefix, regex)); } /** * Returns an equivalent regular expression that'll map that maps to a * specific TokenType * * @param tokenType Designates what characters are contained in the id's * root * @param sansVowel Dictates whether or not vowels are allowed * @return a regular expression */ private String retrieveRegex(TokenType tokenType, boolean sansVowel) { switch (tokenType) { case DIGIT: return "([\\d]*)"; case LOWERCASE: return (sansVowel) ? "([^aeiouyA-Z\\W\\d]*)" : "([a-z]*)"; case UPPERCASE: return (sansVowel) ? "([^a-zAEIOUY\\W\\d]*)" : "([A-Z]*)"; case MIXEDCASE: return (sansVowel) ? "([^aeiouyAEIOUY\\W\\d]*)" : "([a-zA-Z]*)"; case LOWER_EXTENDED: return (sansVowel) ? "([^aeiouyA-Z\\W]*)" : "([a-z\\d]*)"; case UPPER_EXTENDED: return (sansVowel) ? "([^a-zAEIOUY\\W]*)" : "([A-Z\\d]*)"; default: return (sansVowel) ? "([^aeiouyAEIOUY\\W]*)" : "(^[a-zA-z\\d]*)"; } } /** * Returns an equivalent regular expression that'll map that maps to a * specific TokenType * * @param charMap Designates what characters are contained in the id's root * @param sansVowel Dictates whether or not vowels are allowed * @return a regular expression */ private String retrieveRegex(String charMap, boolean sansVowel) { String regex = ""; for (int i = 0; i < charMap.length(); i++) { char key = charMap.charAt(i); if (key == 'd') { regex += "[\\d]"; } else if (key == 'l') { regex += (sansVowel) ? "[^aeiouyA-Z\\W\\d]" : "[a-z]"; } else if (key == 'u') { regex += (sansVowel) ? "[^a-zAEIOUY\\W\\d]" : "[A-Z]"; } else if (key == 'm') { regex += (sansVowel) ? "[^aeiouyAEIOUY\\W\\d]" : "[a-zA-Z]"; } else if (key == 'e') { regex += (sansVowel) ? "[^aeiouyAEIOUY\\W]" : "[a-zA-z\\d]"; } } return regex; } /** * Comparator object used to compare the value of a Pid's name */ private static class PidComparator implements Comparator<String> { /** * Used to compare to ids. If the first id has a smaller value than the * second id, -1 is returned. If they are equal, 0 is returned. * Otherwise 1 is returned. In terms of value, each character has a * unique value associated with them. Numbers are valued less than * lowercase letters, which are valued less than upper case letters. * * The least and greatest valued number is 0 and 9 respectively. The * least and greatest valued lowercase letter is a and z respectively. * The least and greatest valued uppercase letter is A and Z * respectively. * * @param id1 the first id * @param id2 the second id * @return result of the comparison. */ @Override public int compare(String id1, String id2) { if (id1.length() < id2.length()) { return -1; } else if (id1.length() > id2.length()) { return 1; } else { for (int i = 0; i < id1.length(); i++) { char c1 = id1.charAt(i); char c2 = id2.charAt(i); if (Character.isDigit(c1) && Character.isLetter(c2) || Character.isLowerCase(c1) && Character.isUpperCase(c2) || c1 < c2) { return -1; } else if ((Character.isLetter(c1) && Character.isDigit(c2)) || Character.isUpperCase(c1) && Character.isLowerCase(c2) || c1 > c2) { return 1; } } return 0; } } } }
[ "lljruffin@gmail.com" ]
lljruffin@gmail.com
0607f7852981ebb5272a9ba080a22d1346df5ee9
9c7e8ffeac14f451a90bf559383ec5566ea81d1b
/projects/jgf-bench-s3/src/main/java/montecarlo/Universal.java
efb7b576377ef785e87a4e2483187049b9fc288c
[ "MIT" ]
permissive
mc-imperial/jtool-sct
fc2209f2d6c6273e9dae7a37a8209291914a7195
80811bb88e1cec0234bc720b5b47ec9e2cdf6364
refs/heads/master
2021-01-12T12:46:55.912768
2016-10-26T11:07:18
2016-10-26T11:07:20
69,858,207
0
1
null
null
null
null
UTF-8
Java
false
false
5,836
java
/************************************************************************** * * * Java Grande Forum Benchmark Suite - Thread Version 1.0 * * * * produced by * * * * Java Grande Benchmarking Project * * * * at * * * * Edinburgh Parallel Computing Centre * * * * email: epcc-javagrande@epcc.ed.ac.uk * * * * Original version of this code by Hon Yau (hwyau@epcc.ed.ac.uk) * * * * This version copyright (c) The University of Edinburgh, 2001. * * All rights reserved. * * * **************************************************************************/ package montecarlo; /** * Base class for all non-trivial classes. * Used as a centralised repository for all the functionalities which * all classes written by me, which will be of use. * * @author H W Yau * @version $Revision: 1.7 $ $Date: 1999/02/16 18:53:43 $ */ public class Universal { //------------------------------------------------------------------------ // Class variables. //------------------------------------------------------------------------ /** * Class variable, for whether to print debug messages. This one is * unique to this class, and can hence be set in the one place. */ private static boolean UNIVERSAL_DEBUG; //------------------------------------------------------------------------ // Instance variables. //------------------------------------------------------------------------ /** * Variable, for whether to print debug messages. This one can * be set by subsequent child classes. */ private boolean DEBUG; /** * The prompt to write before any debug messages. */ private String prompt; //------------------------------------------------------------------------ // Constructors. //------------------------------------------------------------------------ /** * Default constructor. */ public Universal() { super(); this.DEBUG=true; this.UNIVERSAL_DEBUG=true; this.prompt="Universal> "; } //------------------------------------------------------------------------ // Methods. //------------------------------------------------------------------------ //------------------------------------------------------------------------ // Accessor methods for class AppDemo/Universal. // Generated by 'makeJavaAccessor.pl' script. HWY. 20th January 1999. //------------------------------------------------------------------------ /** * Accessor method for private instance variable <code>DEBUG</code>. * * @return Value of instance variable <code>DEBUG</code>. */ public boolean get_DEBUG() { return(this.DEBUG); } /** * Set method for private instance variable <code>DEBUG</code>. * * @param DEBUG the value to set for the instance variable <code>DEBUG</code>. */ public void set_DEBUG(boolean DEBUG) { this.DEBUG = DEBUG; } /** * Accessor method for private instance variable <code>UNIVERSAL_DEBUG</code>. * * @return Value of instance variable <code>UNIVERSAL_DEBUG</code>. */ public boolean get_UNIVERSAL_DEBUG() { return(this.UNIVERSAL_DEBUG); } /** * Set method for private instance variable <code>DEBUG</code>. * * @param UNIVERSAL_DEBUG the value to set for the instance * variable <code>UNIVERSAL_DEBUG</code>. */ public void set_UNIVERSAL_DEBUG(boolean UNIVERSAL_DEBUG) { this.UNIVERSAL_DEBUG = UNIVERSAL_DEBUG; } /** * Accessor method for private instance variable <code>prompt</code>. * * @return Value of instance variable <code>prompt</code>. */ public String get_prompt() { return(this.prompt); } /** * Set method for private instance variable <code>prompt</code>. * * @param prompt the value to set for the instance variable <code>prompt</code>. */ public void set_prompt(String prompt) { this.prompt = prompt; } //------------------------------------------------------------------------ /** * Used to print debug messages. * * @param s The debug message to print out, to PrintStream "out". */ public void dbgPrintln(String s) { if( DEBUG || UNIVERSAL_DEBUG ) { System.out.println("DBG "+prompt+s); } } /** * Used to print debug messages. * * @param s The debug message to print out, to PrintStream "out". */ public void dbgPrint(String s) { if( DEBUG || UNIVERSAL_DEBUG ) { System.out.print("DBG "+prompt+s); } } /** * Used to print error messages. * * @param s The error message to print out, to PrintStream "err". */ public void errPrintln(String s) { System.err.println(prompt+s); } /** * Used to print error messages. * * @param s The error message to print out, to PrintStream "err". */ public void errPrint(String s) { System.err.print(prompt+s); } }
[ "paul.thomson11@imperial.ac.uk" ]
paul.thomson11@imperial.ac.uk
97bdaa120b313a85e46e3067f772fe04b4b51be7
bb6efdf230eb6025e8c77486b15fcc25baf35b73
/LetraO.java
21adad6646fb2319ba0dc7869ced7b28eeb516c6
[]
no_license
bsampaio/Greenfoot__JogoDaForca
fdfc04845a3a3b2b19c784840cfa9717ae33e0c1
c92a7b89fb1b603b09ae82ba664e71a69821dc82
refs/heads/master
2020-06-26T02:32:10.839848
2016-11-23T18:21:21
2016-11-23T18:21:21
74,603,118
0
0
null
null
null
null
UTF-8
Java
false
false
482
java
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class LetraO here. * * @author (your name) * @version (a version number or a date) */ public class LetraO extends Letra { /** * Act - do whatever the LetraO wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { super.act(); } }
[ "breno@backstagedigital.com.br" ]
breno@backstagedigital.com.br
2ebd2fde2f75dff010198b65a6ce597c2bf5d070
103ccb9e38308cd3271bf8bd4527e561bec04480
/src/test/java/com/example/etudes/strikeitrich/GameStarterShould.java
ce182892b29075773254a364bf329c48bb268752
[]
no_license
alvarogarcia7/etude-wetherell-06-strike-it-rich-java
760b9ef61a97addbe4ad5baa9e1fad0541ae4fbd
3f9f7ccb63f02f9d405e5019504b478fdaaad471
refs/heads/master
2021-05-04T10:56:58.883999
2017-09-28T05:16:09
2017-09-28T16:16:09
54,375,668
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.example.etudes.strikeitrich; import com.example.etudes.strikeitrich.player.PlayerObjectMother; import org.junit.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; public class GameStarterShould { @Test public void deal_to_players() { Player player1 = PlayerObjectMother.emptyWithCash(0); GameStarter gameStarter = new GameStarter(); gameStarter.deal(player1); assertThat(player1, is(new Player(2, 4, 2, 10_000, 0))); } }
[ "derecerca@gmail.com" ]
derecerca@gmail.com
5f524ccf8ce232a439ccfc8e1dfaad4e3266a17e
25fd34d7b3c272080921805ccd237d30c7a6c085
/src/main/java/org/example/demo4/Sender.java
b6367331da5d44d2c8a08790f6e84ae921037bdc
[]
no_license
carp-tail/rabbitmq-demo
7d0b45cd38dae549a64a5837dd210a470203e618
bceecbfd31e1736d4b99a210ffdb370c51c2f6e3
refs/heads/master
2023-06-06T13:42:22.553648
2021-06-27T15:49:04
2021-06-27T15:49:04
380,779,447
0
0
null
null
null
null
UTF-8
Java
false
false
1,392
java
package org.example.demo4; import com.rabbitmq.client.BuiltinExchangeType; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import org.example.util.ConnectionUtil; import java.io.IOException; import java.util.Random; import java.util.concurrent.TimeoutException; /** * @Author: guaniu * @Description: * @Date: Create at 16:50 2021/6/26 */ public class Sender { private static String LOGS_EXCHANGE = "logs_exchange_direct"; private enum LogTypeEnum{ INFO("info"), WARN("warn"), ERROR("error"); String type; LogTypeEnum(String type) { this.type = type; } } public static void main(String[] args) throws IOException, TimeoutException { Connection connection = ConnectionUtil.getConnection(); Channel channel = connection.createChannel(); //交换机类型为direct channel.exchangeDeclare(LOGS_EXCHANGE, BuiltinExchangeType.DIRECT); Random random = new Random(); for (int i = 1; i <= 10; i++){ String type = LogTypeEnum.values()[random.nextInt(3)].type; String log = type + "日志信息" + i; channel.basicPublish(LOGS_EXCHANGE, type, null, log.getBytes()); System.out.println(" [P] Sent '" + log + "'"); } channel.close(); connection.close(); } }
[ "2750181390@qq.com" ]
2750181390@qq.com
a9535431ce906c67917cd6618636903ff0dd59c5
007afd4b16f4ee91c2270d4304439a67ddb78b72
/sofa-ark-parent/support/ark-support-starter/src/main/java/com/alipay/sofa/ark/support/runner/ArkJUnit4Runner.java
a978e6d6af6123db43f3c139577a4d6ae564b428
[ "Apache-2.0" ]
permissive
firewolf-ljw/sofa-ark
5d5201181d5ddd5b57394976ec4969cf943885f9
34244d7e29df6c6a2613603d066a6abba6cdbc62
refs/heads/master
2020-03-16T17:22:34.396926
2018-05-09T09:24:09
2018-05-09T09:24:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,913
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alipay.sofa.ark.support.runner; import com.alipay.sofa.ark.support.common.DelegateArkContainer; import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.model.InitializationError; import org.junit.runners.model.TestClass; /** * * @author qilong.zql * @since 0.1.0 */ public class ArkJUnit4Runner extends BlockJUnit4ClassRunner { /** * Creates a BlockJUnit4ClassRunner to run {@code klass} * * @param klass * @throws InitializationError if the test class is malformed. */ public ArkJUnit4Runner(Class<?> klass) throws InitializationError { super(klass); } @Override protected TestClass createTestClass(Class<?> testClass) { try { if (!DelegateArkContainer.isStarted()) { DelegateArkContainer.launch(); } ClassLoader testClassLoader = DelegateArkContainer.getTestClassLoader(); return super.createTestClass(testClassLoader.loadClass(testClass.getName())); } catch (Exception ex) { throw new RuntimeException(ex); } } }
[ "qilong.zql@alibaba-inc.com" ]
qilong.zql@alibaba-inc.com
e4e0cecf9ac03b0e95956701364472976b445b9c
1a6319591f41a6ddb4c1afa382d358fb098b7aa5
/src/main/java/eu/toolchain/swim/Peer.java
5870b52cbbcb177de324e7909f98b8c0dedfab6c
[]
no_license
udoprog/swim
e880fad63c7a116ba383ce463921b7f0d5c00ff5
689b732dca6a5cb57024861f309a439e20f11367
refs/heads/master
2023-08-07T15:18:55.452915
2015-03-09T04:26:39
2015-03-09T04:28:58
24,102,815
0
0
null
null
null
null
UTF-8
Java
false
false
881
java
package eu.toolchain.swim; import java.net.InetSocketAddress; import lombok.Data; import lombok.RequiredArgsConstructor; @Data @RequiredArgsConstructor public class Peer { private final InetSocketAddress address; // current state according to probing. private final NodeState state; // how fresh this data is, only the originating node may increment this value. private final long inc; private final long updated; public Peer(InetSocketAddress address, long now) { this(address, NodeState.SUSPECT, 0, now); } public Peer state(NodeState state) { return new Peer(address, state, inc, updated); } public Peer inc(long inc) { return new Peer(address, state, inc, updated); } public Peer touch(long now) { return new Peer(address, state, inc, now); } }
[ "johnjohn.tedro@gmail.com" ]
johnjohn.tedro@gmail.com
df7a975c7030f8c05c0aac3e548c8cd34176b2d3
a310b3fb1b22e623c46f13b480049659cc7a9d64
/PosAztlanInfraServices/src/main/java/mx/com/aztlan/pos/infraservices/persistencia/posaztlanbd/dao/DetallePromocionDAOI.java
cfb421db6510b64f1a625eb6b0458f30e701b65d
[]
no_license
carlos4114/posaztlan
e06a232864b1f5465c71e57f99020109d2934571
8834ae1039be057bddef9f0d670e9f95f13f9f7c
refs/heads/master
2021-09-15T14:20:21.104212
2018-06-04T13:31:31
2018-06-04T13:31:31
121,021,004
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package mx.com.aztlan.pos.infraservices.persistencia.posaztlanbd.dao; import mx.com.aztlan.pos.infraservices.persistencia.GlobalHibernateDAOI; import mx.com.aztlan.pos.infraservices.persistencia.posaztlanbd.dto.DetallePromocion; public interface DetallePromocionDAOI extends GlobalHibernateDAOI<DetallePromocion> { }
[ "carlos_4114@hotmail.com" ]
carlos_4114@hotmail.com
cafa2c528503aab341863d70f917b57e72ee34b2
2149b88e1f8f180bb52d74e7caf549f617612e47
/usuario-servicio/src/main/java/com/javatutoriales/springboot/usuarioservicio/dao/UsuarioDao.java
0aa39d128be2846944c1fc8f4c63e8a061e952b1
[]
no_license
kumo829/spring-cloud-items-catalog
cfd7ca2f4975281356349dd3926beefcf2514bea
b5c5ade43487f80adbb7c7319dd3f63ed8f4714e
refs/heads/master
2021-03-06T17:51:44.669816
2020-04-02T14:11:50
2020-04-02T14:11:50
246,214,026
0
0
null
null
null
null
UTF-8
Java
false
false
789
java
package com.javatutoriales.springboot.usuarioservicio.dao; import com.javatutoriales.springboot.commons.usuarios.Usuario; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; import org.springframework.data.rest.core.annotation.RestResource; @RepositoryRestResource(path = "usuarios") public interface UsuarioDao extends PagingAndSortingRepository<Usuario, Long> { @RestResource(path = "find-username") Usuario findByUsername(@Param("username") String username); @Query("select u from Usuario u where u.username=?1") Usuario obtenerPorUsername(String username); }
[ "amonmar2000@hotmail.com" ]
amonmar2000@hotmail.com
d5768b4063a3deb903c2e3312f9422a1f21ab73e
2b4dc0a3ee6d08af33107b5b656b466f3e7df294
/src/by/tc/task01/service/validation/impl/TabletPCValidator.java
fd83bceaf234a4ad71382bcdeee259e0f7550faf
[]
no_license
iPushkevich/jwd-criteria-app
0b476aacf0cb92a5031efe43e76361d2f566bf1c
9fc165b5e392fd58220ad7af21ac7cd9fe28a789
refs/heads/master
2022-11-25T13:23:59.240913
2020-07-19T20:25:02
2020-07-19T20:25:02
280,484,031
0
0
null
null
null
null
UTF-8
Java
false
false
2,971
java
package tc.task01.service.validation.impl; import tc.task01.entity.criteria.Criteria; import tc.task01.service.validation.Validator; import java.util.Set; public class TabletPCValidator implements Validator { public TabletPCValidator() { } @Override public boolean checkCriteria(Criteria criteria) { Set<Criteria.CriteriaNameAndValue> allCriteria = criteria.getCriteria(); boolean isValid = true; for (Criteria.CriteriaNameAndValue cr: allCriteria){ String criteriaName = cr.getCriteriaName(); Object criteriaValue = cr.getCriteriaValue(); switch (criteriaName) { case "BATTERY_CAPACITY" -> isValid = checkBatteryCapacityParam(criteriaValue); case "DISPLAY_INCHES" -> isValid = checkDisplayInchesParam(criteriaValue); case "MEMORY_ROM" -> isValid = checkMemoryRomParam(criteriaValue); case "FLASH_MEMORY_CAPACITY" -> isValid = checkFlashMemoryCapacityParam(criteriaValue); case "COLOR" -> isValid = checkColorParam(criteriaValue); } if (!isValid){ System.out.println(criteriaValue + " wrong value for " + criteriaName ); } isValid = true; } return true; } private boolean checkBatteryCapacityParam(Object param){ boolean check = true; int value = 0; if (param.getClass() == Integer.class){ check = false; } else { value = (int) param; } if (value < 1 || value > 8){ check = false; } return check; } private boolean checkDisplayInchesParam(Object param){ boolean check = true; int value = 0; if (param.getClass() != Integer.class){ check = false; } else { value = (int) param; } if (value < 7 || value > 25){ check = false; } return check; } private boolean checkMemoryRomParam(Object param){ boolean check = true; int value = 0; if (param.getClass() != Integer.class){ check = false; } else { value = (int) param; } if (value < 4000 || value > 32000){ check = false; } return check; } private boolean checkFlashMemoryCapacityParam(Object param){ boolean check = true; int value = 0; if (param.getClass() != Integer.class){ check = false; } else { value = (int) param; } if (value < 1 || value > 21){ check = false; } return check; } private boolean checkColorParam(Object param){ boolean check = true; if (!(param.getClass() == String.class)){ check = false; } return check; } }
[ "igorogi@bk.ru" ]
igorogi@bk.ru
ac564c315025856b13b39ffb52f7af3c34db483c
85cdcca6a7c9756fe0391729bbb85ce4c6548ac5
/OurEarTrainer/src/com/example/musicalConcepts/Chord.java
d2e863946be9247a9a12999f299bef0b93318b9d
[]
no_license
djb12/Abschlussprojekt
3728142cfcd5c6bb71d5794ba092a24567462dd2
3aefb56cff0c6a9ce2c2eba27ec9af3d8ad76463
refs/heads/master
2020-04-06T06:43:48.650113
2014-08-17T13:17:47
2014-08-17T13:17:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
90
java
package com.example.musicalConcepts; public class Chord extends MusicalConcept { }
[ "davidbrem@t-online.de" ]
davidbrem@t-online.de
8f20419651fb15f5e93485cb2da328c8513cdeee
52b948436b826df8164565ffe69e73a92eb92cda
/Source/comingd4jmore/Arja_patch_Defects4J_Math_81_0_354/EigenDecompositionImpl/Arja_patch_Defects4J_Math_81_0_354_EigenDecompositionImpl_t.java
f13cb173f1096a6d9c8545ed20d2a2e2a6e2bbb5
[ "Apache-2.0" ]
permissive
tdurieux/ODSExperiment
910365f1388bc684e9916f46f407d36226a2b70b
3881ef06d6b8d5efb751860811def973cb0220eb
refs/heads/main
2023-07-05T21:30:30.099605
2021-08-18T15:56:56
2021-08-18T15:56:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
65,429
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.commons.math.linear; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.commons.math.MathRuntimeException; import org.apache.commons.math.MaxIterationsExceededException; import org.apache.commons.math.util.MathUtils; /** * Calculates the eigen decomposition of a <strong>symmetric</strong> matrix. * <p>The eigen decomposition of matrix A is a set of two matrices: * V and D such that A = V D V<sup>T</sup>. A, V and D are all m &times; m * matrices.</p> * <p>As of 2.0, this class supports only <strong>symmetric</strong> matrices, * and hence computes only real realEigenvalues. This implies the D matrix returned by * {@link #getD()} is always diagonal and the imaginary values returned {@link * #getImagEigenvalue(int)} and {@link #getImagEigenvalues()} are always null.</p> * <p>When called with a {@link RealMatrix} argument, this implementation only uses * the upper part of the matrix, the part below the diagonal is not accessed at all.</p> * <p>Eigenvalues are computed as soon as the matrix is decomposed, but eigenvectors * are computed only when required, i.e. only when one of the {@link #getEigenvector(int)}, * {@link #getV()}, {@link #getVT()}, {@link #getSolver()} methods is called.</p> * <p>This implementation is based on Inderjit Singh Dhillon thesis * <a href="http://www.cs.utexas.edu/users/inderjit/public_papers/thesis.pdf">A * New O(n<sup>2</sup>) Algorithm for the Symmetric Tridiagonal Eigenvalue/Eigenvector * Problem</a>, on Beresford N. Parlett and Osni A. Marques paper <a * href="http://www.netlib.org/lapack/lawnspdf/lawn155.pdf">An Implementation of the * dqds Algorithm (Positive Case)</a> and on the corresponding LAPACK routines (DLARRE, * DLASQ2, DLAZQ3, DLAZQ4, DLASQ5 and DLASQ6).</p> * <p>The authors of the original fortran version are: * <ul> * <li>Beresford Parlett, University of California, Berkeley, USA</li> * <li>Jim Demmel, University of California, Berkeley, USA</li> * <li>Inderjit Dhillon, University of Texas, Austin, USA</li> * <li>Osni Marques, LBNL/NERSC, USA</li> * <li>Christof Voemel, University of California, Berkeley, USA</li> * </ul> * </p> * @version $Revision$ $Date$ * @since 2.0 */ public class EigenDecompositionImpl implements EigenDecomposition { /** Tolerance. */ private static final double TOLERANCE = 100 * MathUtils.EPSILON; /** Squared tolerance. */ private static final double TOLERANCE_2 = TOLERANCE * TOLERANCE; /** Split tolerance. */ private double splitTolerance; /** Main diagonal of the tridiagonal matrix. */ private double[] main; /** Secondary diagonal of the tridiagonal matrix. */ private double[] secondary; /** Squared secondary diagonal of the tridiagonal matrix. */ private double[] squaredSecondary; /** Transformer to tridiagonal (may be null if matrix is already tridiagonal). */ private TriDiagonalTransformer transformer; /** Lower bound of spectra. */ private double lowerSpectra; /** Upper bound of spectra. */ private double upperSpectra; /** Minimum pivot in the Sturm sequence. */ private double minPivot; /** Current shift. */ private double sigma; /** Low part of the current shift. */ private double sigmaLow; /** Shift increment to apply. */ private double tau; /** Work array for all decomposition algorithms. */ private double[] work; /** Shift within qd array for ping-pong implementation. */ private int pingPong; /** Max value of diagonal elements in current segment. */ private double qMax; /** Min value of off-diagonal elements in current segment. */ private double eMin; /** Type of the last dqds shift. */ private int tType; /** Minimal value on current state of the diagonal. */ private double dMin; /** Minimal value on current state of the diagonal, excluding last element. */ private double dMin1; /** Minimal value on current state of the diagonal, excluding last two elements. */ private double dMin2; /** Last value on current state of the diagonal. */ private double dN; /** Last but one value on current state of the diagonal. */ private double dN1; /** Last but two on current state of the diagonal. */ private double dN2; /** Shift ratio with respect to dMin used when tType == 6. */ private double g; /** Real part of the realEigenvalues. */ private double[] realEigenvalues; /** Imaginary part of the realEigenvalues. */ private double[] imagEigenvalues; /** Eigenvectors. */ private ArrayRealVector[] eigenvectors; /** Cached value of V. */ private RealMatrix cachedV; /** Cached value of D. */ private RealMatrix cachedD; /** Cached value of Vt. */ private RealMatrix cachedVt; /** * Calculates the eigen decomposition of the given symmetric matrix. * @param matrix The <strong>symmetric</strong> matrix to decompose. * @param splitTolerance tolerance on the off-diagonal elements relative to the * geometric mean to split the tridiagonal matrix (a suggested value is * {@link MathUtils#SAFE_MIN}) * @exception InvalidMatrixException (wrapping a {@link * org.apache.commons.math.ConvergenceException} if algorithm fails to converge */ public EigenDecompositionImpl(final RealMatrix matrix, final double splitTolerance) throws InvalidMatrixException { if (isSymmetric(matrix)) { this.splitTolerance = splitTolerance; transformToTridiagonal(matrix); decompose(); } else { // as of 2.0, non-symmetric matrices (i.e. complex eigenvalues) are NOT supported // see issue https://issues.apache.org/jira/browse/MATH-235 throw new InvalidMatrixException("eigen decomposition of assymetric matrices not supported yet"); } } /** * Calculates the eigen decomposition of the given tridiagonal symmetric matrix. * @param main the main diagonal of the matrix (will be copied) * @param secondary the secondary diagonal of the matrix (will be copied) * @param splitTolerance tolerance on the off-diagonal elements relative to the * geometric mean to split the tridiagonal matrix (a suggested value is * {@link MathUtils#SAFE_MIN}) * @exception InvalidMatrixException (wrapping a {@link * org.apache.commons.math.ConvergenceException} if algorithm fails to converge */ public EigenDecompositionImpl(final double[] main, double[] secondary, final double splitTolerance) throws InvalidMatrixException { this.main = main.clone(); this.secondary = secondary.clone(); transformer = null; // pre-compute some elements squaredSecondary = new double[secondary.length]; for (int i = 0; i < squaredSecondary.length; ++i) { final double s = secondary[i]; squaredSecondary[i] = s * s; } this.splitTolerance = splitTolerance; decompose(); } /** * Check if a matrix is symmetric. * @param matrix matrix to check * @return true if matrix is symmetric */ private boolean isSymmetric(final RealMatrix matrix) { final int rows = matrix.getRowDimension(); final int columns = matrix.getColumnDimension(); final double eps = 10 * rows * columns * MathUtils.EPSILON; for (int i = 0; i < rows; ++i) { for (int j = i + 1; j < columns; ++j) { final double mij = matrix.getEntry(i, j); final double mji = matrix.getEntry(j, i); if (Math.abs(mij - mji) > (Math.max(Math.abs(mij), Math.abs(mji)) * eps)) { return false; } } } return true; } /** * Decompose a tridiagonal symmetric matrix. * @exception InvalidMatrixException (wrapping a {@link * org.apache.commons.math.ConvergenceException} if algorithm fails to converge */ private void decompose() { cachedV = null; cachedD = null; cachedVt = null; work = new double[6 * main.length]; // compute the Gershgorin circles computeGershgorinCircles(); // find all the realEigenvalues findEigenvalues(); // we will search for eigenvectors only if required eigenvectors = null; } /** {@inheritDoc} */ public RealMatrix getV() throws InvalidMatrixException { if (cachedV == null) { if (eigenvectors == null) { findEigenVectors(); } final int m = eigenvectors.length; cachedV = MatrixUtils.createRealMatrix(m, m); for (int k = 0; k < m; ++k) { cachedV.setColumnVector(k, eigenvectors[k]); } } // return the cached matrix return cachedV; } /** {@inheritDoc} */ public RealMatrix getD() throws InvalidMatrixException { if (cachedD == null) { // cache the matrix for subsequent calls cachedD = MatrixUtils.createRealDiagonalMatrix(realEigenvalues); } return cachedD; } /** {@inheritDoc} */ public RealMatrix getVT() throws InvalidMatrixException { if (cachedVt == null) { if (eigenvectors == null) { findEigenVectors(); } final int m = eigenvectors.length; cachedVt = MatrixUtils.createRealMatrix(m, m); for (int k = 0; k < m; ++k) { cachedVt.setRowVector(k, eigenvectors[k]); } } // return the cached matrix return cachedVt; } /** {@inheritDoc} */ public double[] getRealEigenvalues() throws InvalidMatrixException { return realEigenvalues.clone(); } /** {@inheritDoc} */ public double getRealEigenvalue(final int i) throws InvalidMatrixException, ArrayIndexOutOfBoundsException { return realEigenvalues[i]; } /** {@inheritDoc} */ public double[] getImagEigenvalues() throws InvalidMatrixException { return imagEigenvalues.clone(); } /** {@inheritDoc} */ public double getImagEigenvalue(final int i) throws InvalidMatrixException, ArrayIndexOutOfBoundsException { return imagEigenvalues[i]; } /** {@inheritDoc} */ public RealVector getEigenvector(final int i) throws InvalidMatrixException, ArrayIndexOutOfBoundsException { if (eigenvectors == null) { findEigenVectors(); } return eigenvectors[i].copy(); } /** * Return the determinant of the matrix * @return determinant of the matrix */ public double getDeterminant() { double determinant = 1; for (double lambda : realEigenvalues) { determinant *= lambda; } return determinant; } /** {@inheritDoc} */ public DecompositionSolver getSolver() { if (eigenvectors == null) { findEigenVectors(); } return new Solver(realEigenvalues, imagEigenvalues, eigenvectors); } /** Specialized solver. */ private static class Solver implements DecompositionSolver { /** Real part of the realEigenvalues. */ private double[] realEigenvalues; /** Imaginary part of the realEigenvalues. */ private double[] imagEigenvalues; /** Eigenvectors. */ private final ArrayRealVector[] eigenvectors; /** * Build a solver from decomposed matrix. * @param realEigenvalues real parts of the eigenvalues * @param imagEigenvalues imaginary parts of the eigenvalues * @param eigenvectors eigenvectors */ private Solver(final double[] realEigenvalues, final double[] imagEigenvalues, final ArrayRealVector[] eigenvectors) { this.realEigenvalues = realEigenvalues; this.imagEigenvalues = imagEigenvalues; this.eigenvectors = eigenvectors; } /** Solve the linear equation A &times; X = B for symmetric matrices A. * <p>This method only find exact linear solutions, i.e. solutions for * which ||A &times; X - B|| is exactly 0.</p> * @param b right-hand side of the equation A &times; X = B * @return a vector X that minimizes the two norm of A &times; X - B * @exception IllegalArgumentException if matrices dimensions don't match * @exception InvalidMatrixException if decomposed matrix is singular */ public double[] solve(final double[] b) throws IllegalArgumentException, InvalidMatrixException { if (!isNonSingular()) { throw new SingularMatrixException(); } final int m = realEigenvalues.length; if (b.length != m) { throw MathRuntimeException.createIllegalArgumentException( "vector length mismatch: got {0} but expected {1}", b.length, m); } final double[] bp = new double[m]; for (int i = 0; i < m; ++i) { final ArrayRealVector v = eigenvectors[i]; final double[] vData = v.getDataRef(); final double s = v.dotProduct(b) / realEigenvalues[i]; for (int j = 0; j < m; ++j) { bp[j] += s * vData[j]; } } return bp; } /** Solve the linear equation A &times; X = B for symmetric matrices A. * <p>This method only find exact linear solutions, i.e. solutions for * which ||A &times; X - B|| is exactly 0.</p> * @param b right-hand side of the equation A &times; X = B * @return a vector X that minimizes the two norm of A &times; X - B * @exception IllegalArgumentException if matrices dimensions don't match * @exception InvalidMatrixException if decomposed matrix is singular */ public RealVector solve(final RealVector b) throws IllegalArgumentException, InvalidMatrixException { if (!isNonSingular()) { throw new SingularMatrixException(); } final int m = realEigenvalues.length; if (b.getDimension() != m) { throw MathRuntimeException.createIllegalArgumentException( "vector length mismatch: got {0} but expected {1}", b.getDimension(), m); } final double[] bp = new double[m]; for (int i = 0; i < m; ++i) { final ArrayRealVector v = eigenvectors[i]; final double[] vData = v.getDataRef(); final double s = v.dotProduct(b) / realEigenvalues[i]; for (int j = 0; j < m; ++j) { bp[j] += s * vData[j]; } } return new ArrayRealVector(bp, false); } /** Solve the linear equation A &times; X = B for symmetric matrices A. * <p>This method only find exact linear solutions, i.e. solutions for * which ||A &times; X - B|| is exactly 0.</p> * @param b right-hand side of the equation A &times; X = B * @return a matrix X that minimizes the two norm of A &times; X - B * @exception IllegalArgumentException if matrices dimensions don't match * @exception InvalidMatrixException if decomposed matrix is singular */ public RealMatrix solve(final RealMatrix b) throws IllegalArgumentException, InvalidMatrixException { if (!isNonSingular()) { throw new SingularMatrixException(); } final int m = realEigenvalues.length; if (b.getRowDimension() != m) { throw MathRuntimeException.createIllegalArgumentException( "dimensions mismatch: got {0}x{1} but expected {2}x{3}", b.getRowDimension(), b.getColumnDimension(), m, "n"); } final int nColB = b.getColumnDimension(); final double[][] bp = new double[m][nColB]; for (int k = 0; k < nColB; ++k) { for (int i = 0; i < m; ++i) { final ArrayRealVector v = eigenvectors[i]; final double[] vData = v.getDataRef(); double s = 0; for (int j = 0; j < m; ++j) { s += v.getEntry(j) * b.getEntry(j, k); } s /= realEigenvalues[i]; for (int j = 0; j < m; ++j) { bp[j][k] += s * vData[j]; } } } return MatrixUtils.createRealMatrix(bp); } /** * Check if the decomposed matrix is non-singular. * @return true if the decomposed matrix is non-singular */ public boolean isNonSingular() { for (int i = 0; i < realEigenvalues.length; ++i) { if ((realEigenvalues[i] == 0) && (imagEigenvalues[i] == 0)) { return false; } } return true; } /** Get the inverse of the decomposed matrix. * @return inverse matrix * @throws InvalidMatrixException if decomposed matrix is singular */ public RealMatrix getInverse() throws InvalidMatrixException { if (!isNonSingular()) { throw new SingularMatrixException(); } final int m = realEigenvalues.length; final double[][] invData = new double[m][m]; for (int i = 0; i < m; ++i) { final double[] invI = invData[i]; for (int j = 0; j < m; ++j) { double invIJ = 0; for (int k = 0; k < m; ++k) { final double[] vK = eigenvectors[k].getDataRef(); invIJ += vK[i] * vK[j] / realEigenvalues[k]; } invI[j] = invIJ; } } return MatrixUtils.createRealMatrix(invData); } } /** * Transform matrix to tridiagonal. * @param matrix matrix to transform */ private void transformToTridiagonal(final RealMatrix matrix) { // transform the matrix to tridiagonal transformer = new TriDiagonalTransformer(matrix); main = transformer.getMainDiagonalRef(); secondary = transformer.getSecondaryDiagonalRef(); // pre-compute some elements squaredSecondary = new double[secondary.length]; for (int i = 0; i < squaredSecondary.length; ++i) { final double s = secondary[i]; squaredSecondary[i] = s * s; } } /** * Compute the Gershgorin circles for all rows. */ private void computeGershgorinCircles() { final int m = main.length; final int lowerStart = 4 * m; final int upperStart = 5 * m; lowerSpectra = Double.POSITIVE_INFINITY; upperSpectra = Double.NEGATIVE_INFINITY; double eMax = 0; double eCurrent = 0; for (int i = 0; i < m - 1; ++i) { final double dCurrent = main[i]; final double ePrevious = eCurrent; eCurrent = Math.abs(secondary[i]); eMax = Math.max(eMax, eCurrent); final double radius = ePrevious + eCurrent; final double lower = dCurrent - radius; work[lowerStart + i] = lower; lowerSpectra = Math.min(lowerSpectra, lower); final double upper = dCurrent + radius; work[upperStart + i] = upper; upperSpectra = Math.max(upperSpectra, upper); } final double dCurrent = main[m - 1]; final double lower = dCurrent - eCurrent; work[lowerStart + m - 1] = lower; lowerSpectra = Math.min(lowerSpectra, lower); final double upper = dCurrent + eCurrent; work[upperStart + m - 1] = upper; minPivot = MathUtils.SAFE_MIN * Math.max(1.0, eMax * eMax); } /** * Find the realEigenvalues. * @exception InvalidMatrixException if a block cannot be diagonalized */ private void findEigenvalues() throws InvalidMatrixException { // compute splitting points List<Integer> splitIndices = computeSplits(); // find realEigenvalues in each block realEigenvalues = new double[main.length]; imagEigenvalues = new double[main.length]; int begin = 0; for (final int end : splitIndices) { final int n = end - begin; switch (n) { case 1: // apply dedicated method for dimension 1 process1RowBlock(begin); break; case 2: // apply dedicated method for dimension 2 process2RowsBlock(begin); break; case 3: // apply dedicated method for dimension 3 process3RowsBlock(begin); break; default: // choose an initial shift for LDL<sup>T</sup> decomposition final double[] range = eigenvaluesRange(begin, n); final double oneFourth = 0.25 * (3 * range[0] + range[1]); final int oneFourthCount = countEigenValues(oneFourth, begin, n); final double threeFourth = 0.25 * (range[0] + 3 * range[1]); final int threeFourthCount = countEigenValues(threeFourth, begin, n); final boolean chooseLeft = (oneFourthCount - 1) >= (n - threeFourthCount); final double lambda = chooseLeft ? range[0] : range[1]; tau = (range[1] - range[0]) * MathUtils.EPSILON * n + 2 * minPivot; // decompose T-&lambda;I as LDL<sup>T</sup> ldlTDecomposition(lambda, begin, n); // apply general dqd/dqds method processGeneralBlock(n); // extract realEigenvalues if (chooseLeft) { for (int i = 0; i < n; ++i) { realEigenvalues[begin + i] = lambda + work[4 * i]; } } else { for (int i = 0; i < n; ++i) { realEigenvalues[begin + i] = lambda - work[4 * i]; } } } begin = end; } // sort the realEigenvalues in decreasing order Arrays.sort(realEigenvalues); int j = realEigenvalues.length - 1; for (int i = 0; i < j; ++i) { final double tmp = realEigenvalues[i]; realEigenvalues[i] = realEigenvalues[j]; realEigenvalues[j] = tmp; --j; } } /** * Compute splitting points. * @return list of indices after matrix can be split */ private List<Integer> computeSplits() { final List<Integer> list = new ArrayList<Integer>(); // splitting preserving relative accuracy double absDCurrent = Math.abs(main[0]); for (int i = 0; i < secondary.length; ++i) { final double absDPrevious = absDCurrent; absDCurrent = Math.abs(main[i + 1]); final double max = splitTolerance * Math.sqrt(absDPrevious * absDCurrent); if (Math.abs(secondary[i]) <= max) { list.add(i + 1); secondary[i] = 0; squaredSecondary[i] = 0; } } list.add(secondary.length + 1); return list; } /** * Find eigenvalue in a block with 1 row. * <p>In low dimensions, we simply solve the characteristic polynomial.</p> * @param index index of the first row of the block */ private void process1RowBlock(final int index) { realEigenvalues[index] = main[index]; } /** * Find realEigenvalues in a block with 2 rows. * <p>In low dimensions, we simply solve the characteristic polynomial.</p> * @param index index of the first row of the block * @exception InvalidMatrixException if characteristic polynomial cannot be solved */ private void process2RowsBlock(final int index) throws InvalidMatrixException { // the characteristic polynomial is // X^2 - (q0 + q1) X + q0 q1 - e1^2 final double q0 = main[index]; final double q1 = main[index + 1]; final double e12 = squaredSecondary[index]; final double s = q0 + q1; final double p = q0 * q1 - e12; final double delta = s * s - 4 * p; if (delta < 0) { throw new InvalidMatrixException("cannot solve degree {0} equation", 2); } final double largestRoot = 0.5 * (s + Math.sqrt(delta)); realEigenvalues[index] = largestRoot; realEigenvalues[index + 1] = p / largestRoot; } /** * Find realEigenvalues in a block with 3 rows. * <p>In low dimensions, we simply solve the characteristic polynomial.</p> * @param index index of the first row of the block * @exception InvalidMatrixException if diagonal elements are not positive */ private void process3RowsBlock(final int index) throws InvalidMatrixException { // the characteristic polynomial is // X^3 - (q0 + q1 + q2) X^2 + (q0 q1 + q0 q2 + q1 q2 - e1^2 - e2^2) X + q0 e2^2 + q2 e1^2 - q0 q1 q2 final double q0 = main[index]; final double q1 = main[index + 1]; final double q2 = main[index + 2]; final double e12 = squaredSecondary[index]; final double q1q2Me22 = q1 * q2 - squaredSecondary[index + 1]; // compute coefficients of the cubic equation as: x^3 + b x^2 + c x + d = 0 final double b = -(q0 + q1 + q2); final double c = q0 * q1 + q0 * q2 + q1q2Me22 - e12; final double d = q2 * e12 - q0 * q1q2Me22; // solve cubic equation final double b2 = b * b; final double q = (3 * c - b2) / 9; final double r = ((9 * c - 2 * b2) * b - 27 * d) / 54; final double delta = q * q * q + r * r; if (delta >= 0) { // in fact, there are solutions to the equation, but in the context // of symmetric realEigenvalues problem, there should be three distinct // real roots, so we throw an error if this condition is not met throw new InvalidMatrixException("cannot solve degree {0} equation", 3); } final double sqrtMq = Math.sqrt(-q); final double theta = Math.acos(r / (-q * sqrtMq)); final double alpha = 2 * sqrtMq; final double beta = b / 3; double z0 = alpha * Math.cos(theta / 3) - beta; double z1 = alpha * Math.cos((theta + 2 * Math.PI) / 3) - beta; double z2 = alpha * Math.cos((theta + 4 * Math.PI) / 3) - beta; if (z0 < z1) { final double t = z0; z0 = z1; z1 = t; } if (z1 < z2) { final double t = z1; z1 = z2; z2 = t; } if (z0 < z1) { final double t = z0; z0 = z1; z1 = t; } realEigenvalues[index] = z0; realEigenvalues[index + 1] = z1; realEigenvalues[index + 2] = z2; } /** * Find realEigenvalues using dqd/dqds algorithms. * <p>This implementation is based on Beresford N. Parlett * and Osni A. Marques paper <a * href="http://www.netlib.org/lapack/lawnspdf/lawn155.pdf">An * Implementation of the dqds Algorithm (Positive Case)</a> and on the * corresponding LAPACK routine DLASQ2.</p> * @param n number of rows of the block * @exception InvalidMatrixException if block cannot be diagonalized * after 30 * n iterations */ private void processGeneralBlock(final int n) throws InvalidMatrixException { // check decomposed matrix data range double sumOffDiag = 0; for (int i = 0; i < n - 1; ++i) { final int fourI = 4 * i; final double ei = work[fourI + 2]; sumOffDiag += ei; } if (sumOffDiag == 0) { // matrix is already diagonal return; } // initial checks for splits (see Parlett & Marques section 3.3) flipIfWarranted(n, 2); // two iterations with Li's test for initial splits initialSplits(n); // initialize parameters used by goodStep tType = 0; dMin1 = 0; dMin2 = 0; dN = 0; dN1 = 0; dN2 = 0; tau = 0; // process split segments int i0 = 0; int n0 = n; while (n0 > 0) { // retrieve shift that was temporarily stored as a negative off-diagonal element sigma = (n0 == n) ? 0 : -work[4 * n0 - 2]; sigmaLow = 0; // find start of a new split segment to process double offDiagMin = (i0 == n0) ? 0 : work[4 * n0 - 6]; double offDiagMax = 0; double diagMax = work[4 * n0 - 4]; double diagMin = diagMax; i0 = 0; for (int i = 4 * (n0 - 2); i >= 0; i -= 4) { if (work[i + 2] <= 0) { i0 = 1 + i / 4; break; } if (diagMin >= 4 * offDiagMax) { diagMin = Math.min(diagMin, work[i + 4]); offDiagMax = Math.max(offDiagMax, work[i + 2]); } diagMax = Math.max(diagMax, work[i] + work[i + 2]); offDiagMin = Math.min(offDiagMin, work[i + 2]); } work[4 * n0 - 2] = offDiagMin; // lower bound of Gershgorin disk dMin = -Math.max(0, diagMin - 2 * Math.sqrt(diagMin * offDiagMax)); pingPong = 0; int maxIter = 30 * (n0 - i0); for (int k = 0; i0 < n0; ++k) { if (k >= maxIter) { throw new InvalidMatrixException(new MaxIterationsExceededException(maxIter)); } // perform one step n0 = goodStep(i0, n0); pingPong = 1 - pingPong; // check for new splits after "ping" steps // when the last elements of qd array are very small if ((pingPong == 0) && (n0 - i0 > 3) && (work[4 * n0 - 1] <= TOLERANCE_2 * diagMax) && (work[4 * n0 - 2] <= TOLERANCE_2 * sigma)) { int split = i0 - 1; diagMax = work[4 * i0]; offDiagMin = work[4 * i0 + 2]; double previousEMin = work[4 * i0 + 3]; for (int i = 4 * i0; i < 4 * n0 - 11; i += 4) { if ((work[i + 3] <= TOLERANCE_2 * work[i]) && (work[i + 2] <= TOLERANCE_2 * sigma)) { // insert a split work[i + 2] = -sigma; split = i / 4; diagMax = 0; offDiagMin = work[i + 6]; previousEMin = work[i + 7]; } else { diagMax = Math.max(diagMax, work[i + 4]); offDiagMin = Math.min(offDiagMin, work[i + 2]); previousEMin = Math.min(previousEMin, work[i + 3]); } } work[4 * n0 - 2] = offDiagMin; work[4 * n0 - 1] = previousEMin; i0 = split + 1; } } } } /** * Perform two iterations with Li's tests for initial splits. * @param n number of rows of the matrix to process */ private void initialSplits(final int n) { pingPong = 0; for (int k = 0; k < 2; ++k) { // apply Li's reverse test double d = work[4 * (n - 1) + pingPong]; for (int i = 4 * (n - 2) + pingPong; i >= 0; i -= 4) { if (work[i + 2] <= TOLERANCE_2 * d) { work[i + 2] = -0.0; d = work[i]; } else { d *= work[i] / (d + work[i + 2]); } } // apply dqd plus Li's forward test. d = work[pingPong]; for (int i = 2 + pingPong; i < 4 * n - 2; i += 4) { final int j = i - 2 * pingPong - 1; work[j] = d + work[i]; if (work[i] <= TOLERANCE_2 * d) { work[i] = -0.0; work[j] = d; work[j + 2] = 0.0; d = work[i + 2]; } else if ((MathUtils.SAFE_MIN * work[i + 2] < work[j]) && (MathUtils.SAFE_MIN * work[j] < work[i + 2])) { final double tmp = work[i + 2] / work[j]; work[j + 2] = work[i] * tmp; d *= tmp; } else { work[j + 2] = work[i + 2] * (work[i] / work[j]); d *= work[i + 2] / work[j]; } } work[4 * n - 3 - pingPong] = d; // from ping to pong pingPong = 1 - pingPong; } } /** * Perform one "good" dqd/dqds step. * <p>This implementation is based on Beresford N. Parlett * and Osni A. Marques paper <a * href="http://www.netlib.org/lapack/lawnspdf/lawn155.pdf">An * Implementation of the dqds Algorithm (Positive Case)</a> and on the * corresponding LAPACK routine DLAZQ3.</p> * @param start start index * @param end end index * @return new end (maybe deflated) */ private int goodStep(final int start, final int end) { g = 0.0; // step 1: accepting realEigenvalues int deflatedEnd = end; for (boolean deflating = true; deflating;) { if (start >= deflatedEnd) { // the array has been completely deflated return deflatedEnd; } final int k = 4 * deflatedEnd + pingPong - 1; if ((start == deflatedEnd - 1) || ((start != deflatedEnd - 2) && ((work[k - 5] <= TOLERANCE_2 * (sigma + work[k - 3])) || (work[k - 2 * pingPong - 4] <= TOLERANCE_2 * work[k - 7])))) { // one eigenvalue found, deflate array work[4 * deflatedEnd - 4] = sigma + work[4 * deflatedEnd - 4 + pingPong]; deflatedEnd -= 1; } else if ((start == deflatedEnd - 2) || (work[k - 9] <= TOLERANCE_2 * sigma) || (work[k - 2 * pingPong - 8] <= TOLERANCE_2 * work[k - 11])) { // two realEigenvalues found, deflate array if (work[k - 3] > work[k - 7]) { final double tmp = work[k - 3]; work[k - 3] = work[k - 7]; work[k - 7] = tmp; } if (work[k - 5] > TOLERANCE_2 * work[k - 3]) { double t = 0.5 * ((work[k - 7] - work[k - 3]) + work[k - 5]); double s = work[k - 3] * (work[k - 5] / t); if (s <= t) { s = work[k - 3] * work[k - 5] / (t * (1 + Math.sqrt(1 + s / t))); } else { s = work[k - 3] * work[k - 5] / (t + Math.sqrt(t * (t + s))); } t = work[k - 7] + (s + work[k - 5]); work[k - 3] *= work[k - 7] / t; work[k - 7] = t; } work[4 * deflatedEnd - 8] = sigma + work[k - 7]; work[4 * deflatedEnd - 4] = sigma + work[k - 3]; deflatedEnd -= 2; } else { // no more realEigenvalues found, we need to iterate deflating = false; } } final int l = 4 * deflatedEnd + pingPong - 1; // step 2: flip array if needed if ((dMin <= 0) || (deflatedEnd < end)) { if (flipIfWarranted(deflatedEnd, 1)) { dMin2 = Math.min(dMin2, work[l - 1]); work[l - 1] = Math.min(work[l - 1], Math.min(work[3 + pingPong], work[7 + pingPong])); work[l - 2 * pingPong] = Math.min(work[l - 2 * pingPong], Math.min(work[6 + pingPong], work[6 + pingPong])); qMax = Math.max(qMax, Math.max(work[3 + pingPong], work[7 + pingPong])); dMin = -0.0; } } if ((dMin < 0) || (MathUtils.SAFE_MIN * qMax < Math.min(work[l - 1], Math.min(work[l - 9], dMin2 + work[l - 2 * pingPong])))) { // step 3: choose a shift computeShiftIncrement(start, deflatedEnd, end - deflatedEnd); // step 4a: dqds for (boolean loop = true; loop;) { // perform one dqds step with the chosen shift dqds(start, deflatedEnd); // check result of the dqds step if ((dMin >= 0) && (dMin1 > 0)) { // the shift was good updateSigma(tau); return deflatedEnd; } else if ((dMin < 0.0) && (dMin1 > 0.0) && (work[4 * deflatedEnd - 5 - pingPong] < TOLERANCE * (sigma + dN1)) && (Math.abs(dN) < TOLERANCE * sigma)) { // convergence hidden by negative DN. work[4 * deflatedEnd - 3 - pingPong] = 0.0; dMin = 0.0; updateSigma(tau); return deflatedEnd; } else if (dMin < 0.0) { // tau too big. Select new tau and try again. if (tType < -22) { // failed twice. Play it safe. tau = 0.0; } else if (dMin1 > 0.0) { // late failure. Gives excellent shift. tau = (tau + dMin) * (1.0 - 2.0 * MathUtils.EPSILON); tType -= 11; } else { // early failure. Divide by 4. tau *= 0.25; tType -= 12; } } else if (Double.isNaN(dMin)) { tau = 0.0; } else { // possible underflow. Play it safe. loop = false; } } } // perform a dqd step (i.e. no shift) dqd(start, deflatedEnd); return deflatedEnd; } /** * Flip qd array if warranted. * @param n number of rows in the block * @param step within the array (1 for flipping all elements, 2 for flipping * only every other element) * @return true if qd array was flipped */ private boolean flipIfWarranted(final int n, final int step) { if (1.5 * work[pingPong] < work[4 * (n - 1) + pingPong]) { // flip array int j = 4 * n - 1; for (int i = 0; i < j; i += 4) { for (int k = 0; k < 4; k += step) { final double tmp = work[i + k]; work[i + k] = work[j - k]; work[j - k] = tmp; } j -= 4; } return true; } return false; } /** * Compute an interval containing all realEigenvalues of a block. * @param index index of the first row of the block * @param n number of rows of the block * @return an interval containing the realEigenvalues */ private double[] eigenvaluesRange(final int index, final int n) { // find the bounds of the spectra of the local block final int lowerStart = 4 * main.length; final int upperStart = 5 * main.length; double lower = Double.POSITIVE_INFINITY; double upper = Double.NEGATIVE_INFINITY; for (int i = 0; i < n; ++i) { lower = Math.min(lower, work[lowerStart + index +i]); upper = Math.max(upper, work[upperStart + index +i]); } // set thresholds final double tNorm = Math.max(Math.abs(lower), Math.abs(upper)); final double relativeTolerance = Math.sqrt(MathUtils.EPSILON); final double absoluteTolerance = 4 * minPivot; final int maxIter = 2 + (int) ((Math.log(tNorm + minPivot) - Math.log(minPivot)) / Math.log(2.0)); final double margin = 2 * (tNorm * MathUtils.EPSILON * n + 2 * minPivot); // search lower eigenvalue double left = lower - margin; double right = upper + margin; for (int i = 0; i < maxIter; ++i) { final double range = right - left; if ((range < absoluteTolerance) || (range < relativeTolerance * Math.max(Math.abs(left), Math.abs(right)))) { // search has converged break; } final double middle = 0.5 * (left + right); if (countEigenValues(middle, index, n) >= 1) { right = middle; } else { left = middle; } } lower = Math.max(lower, left - 100 * MathUtils.EPSILON * Math.abs(left)); // search upper eigenvalue left = lower - margin; right = upper + margin; for (int i = 0; i < maxIter; ++i) { final double range = right - left; if ((range < absoluteTolerance) || (range < relativeTolerance * Math.max(Math.abs(left), Math.abs(right)))) { // search has converged break; } final double middle = 0.5 * (left + right); if (countEigenValues(middle, index, n) >= n) { right = middle; } else { left = middle; } } upper = Math.min(upper, right + 100 * MathUtils.EPSILON * Math.abs(right)); return new double[] { lower, upper }; } /** * Count the number of realEigenvalues below a point. * @param t value below which we must count the number of realEigenvalues * @param index index of the first row of the block * @param n number of rows of the block * @return number of realEigenvalues smaller than t */ private int countEigenValues(final double t, final int index, final int n) { double ratio = main[index] - t; int count = (ratio > 0) ? 0 : 1; for (int i = 1; i < n; ++i) { ratio = main[index + i] - squaredSecondary[index + i - 1] / ratio - t; if (ratio <= 0) { ++count; } } return count; } /** * Decompose the shifted tridiagonal matrix T-&lambda;I as LDL<sup>T</sup>. * <p>A shifted symmetric tridiagonal matrix T can be decomposed as * LDL<sup>T</sup> where L is a lower bidiagonal matrix with unit diagonal * and D is a diagonal matrix. This method is an implementation of * algorithm 4.4.7 from Dhillon's thesis.</p> * @param lambda shift to add to the matrix before decomposing it * to ensure it is positive definite * @param index index of the first row of the block * @param n number of rows of the block */ private void ldlTDecomposition(final double lambda, final int index, final int n) { double di = main[index] - lambda; work[0] = Math.abs(di); for (int i = 1; i < n; ++i) { final int fourI = 4 * i; final double eiM1 = secondary[index + i - 1]; final double ratio = eiM1 / di; work[fourI - 2] = ratio * ratio * Math.abs(di); di = (main[index + i] - lambda) - eiM1 * ratio; work[fourI] = Math.abs(di); } } /** * Perform a dqds step, using current shift increment. * <p>This implementation is a translation of the LAPACK routine DLASQ5.</p> * @param start start index * @param end end index */ private void dqds(final int start, final int end) { eMin = work[4 * start + pingPong + 4]; double d = work[4 * start + pingPong] - tau; dMin = d; dMin1 = -work[4 * start + pingPong]; if (pingPong == 0) { for (int j4 = 4 * start + 3; j4 <= 4 * (end - 3); j4 += 4) { work[j4 - 2] = d + work[j4 - 1]; final double tmp = work[j4 + 1] / work[j4 - 2]; d = d * tmp - tau; dMin = Math.min(dMin, d); work[j4] = work[j4 - 1] * tmp; eMin = Math.min(work[j4], eMin); } } else { for (int j4 = 4 * start + 3; j4 <= 4 * (end - 3); j4 += 4) { work[j4 - 3] = d + work[j4]; final double tmp = work[j4 + 2] / work[j4 - 3]; d = d * tmp - tau; dMin = Math.min(dMin, d); work[j4 - 1] = work[j4] * tmp; eMin = Math.min(work[j4 - 1], eMin); } } // unroll last two steps. dN2 = d; dMin2 = dMin; int j4 = 4 * (end - 2) - pingPong - 1; int j4p2 = j4 + 2 * pingPong - 1; work[j4 - 2] = dN2 + work[j4p2]; work[j4] = work[j4p2 + 2] * (work[j4p2] / work[j4 - 2]); dN1 = work[j4p2 + 2] * (dN2 / work[j4 - 2]) - tau; dMin = Math.min(dMin, dN1); dMin1 = dMin; j4 = j4 + 4; j4p2 = j4 + 2 * pingPong - 1; work[j4 - 2] = dN1 + work[j4p2]; work[j4] = work[j4p2 + 2] * (work[j4p2] / work[j4 - 2]); dN = work[j4p2 + 2] * (dN1 / work[j4 - 2]) - tau; dMin = Math.min(dMin, dN); work[j4 + 2] = dN; work[4 * end - pingPong - 1] = eMin; } /** * Perform a dqd step. * <p>This implementation is a translation of the LAPACK routine DLASQ6.</p> * @param start start index * @param end end index */ private void dqd(final int start, final int end) { eMin = work[4 * start + pingPong + 4]; double d = work[4 * start + pingPong]; dMin = d; if (pingPong == 0) { for (int j4 = 4 * start + 3; j4 < 4 * (end - 3); j4 += 4) { work[j4 - 2] = d + work[j4 - 1]; if (work[j4 - 2] == 0.0) { work[j4] = 0.0; d = work[j4 + 1]; dMin = d; eMin = 0.0; } else if ((MathUtils.SAFE_MIN * work[j4 + 1] < work[j4 - 2]) && (MathUtils.SAFE_MIN * work[j4 - 2] < work[j4 + 1])) { final double tmp = work[j4 + 1] / work[j4 - 2]; work[j4] = work[j4 - 1] * tmp; d *= tmp; } else { work[j4] = work[j4 + 1] * (work[j4 - 1] / work[j4 - 2]); d *= work[j4 + 1] / work[j4 - 2]; } dMin = Math.min(dMin, d); eMin = Math.min(eMin, work[j4]); } } else { for (int j4 = 4 * start + 3; j4 < 4 * (end - 3); j4 += 4) { work[j4 - 3] = d + work[j4]; if (work[j4 - 3] == 0.0) { work[j4 - 1] = 0.0; d = work[j4 + 2]; dMin = d; eMin = 0.0; } else if ((MathUtils.SAFE_MIN * work[j4 + 2] < work[j4 - 3]) && (MathUtils.SAFE_MIN * work[j4 - 3] < work[j4 + 2])) { final double tmp = work[j4 + 2] / work[j4 - 3]; work[j4 - 1] = work[j4] * tmp; d *= tmp; } else { work[j4 - 1] = work[j4 + 2] * (work[j4] / work[j4 - 3]); d *= work[j4 + 2] / work[j4 - 3]; } dMin = Math.min(dMin, d); eMin = Math.min(eMin, work[j4 - 1]); } } // Unroll last two steps dN2 = d; dMin2 = dMin; int j4 = 4 * (end - 2) - pingPong - 1; int j4p2 = j4 + 2 * pingPong - 1; work[j4 - 2] = dN2 + work[j4p2]; if (work[j4 - 2] == 0.0) { work[j4] = 0.0; dN1 = work[j4p2 + 2]; dMin = dN1; eMin = 0.0; } else if ((MathUtils.SAFE_MIN * work[j4p2 + 2] < work[j4 - 2]) && (MathUtils.SAFE_MIN * work[j4 - 2] < work[j4p2 + 2])) { final double tmp = work[j4p2 + 2] / work[j4 - 2]; work[j4] = work[j4p2] * tmp; dN1 = dN2 * tmp; } else { work[j4] = work[j4p2 + 2] * (work[j4p2] / work[j4 - 2]); dN1 = work[j4p2 + 2] * (dN2 / work[j4 - 2]); } dMin = Math.min(dMin, dN1); dMin1 = dMin; j4 = j4 + 4; j4p2 = j4 + 2 * pingPong - 1; work[j4 - 2] = dN1 + work[j4p2]; if (work[j4 - 2] == 0.0) { work[j4] = 0.0; dN = work[j4p2 + 2]; dMin = dN; eMin = 0.0; } else if ((MathUtils.SAFE_MIN * work[j4p2 + 2] < work[j4 - 2]) && (MathUtils.SAFE_MIN * work[j4 - 2] < work[j4p2 + 2])) { final double tmp = work[j4p2 + 2] / work[j4 - 2]; work[j4] = work[j4p2] * tmp; dN = dN1 * tmp; } else { work[j4] = work[j4p2 + 2] * (work[j4p2] / work[j4 - 2]); dN = work[j4p2 + 2] * (dN1 / work[j4 - 2]); } dMin = Math.min(dMin, dN); work[j4 + 2] = dN; work[4 * end - pingPong - 1] = eMin; } /** * Compute the shift increment as an estimate of the smallest eigenvalue. * <p>This implementation is a translation of the LAPACK routine DLAZQ4.</p> * @param start start index * @param end end index * @param deflated number of realEigenvalues just deflated */ private void computeShiftIncrement(final int start, final int end, final int deflated) { final double cnst1 = 0.563; final double cnst2 = 1.010; final double cnst3 = 1.05; // a negative dMin forces the shift to take that absolute value // tType records the type of shift. if (dMin <= 0.0) { tau = -dMin; tType = -1; return; } int nn = 4 * end + pingPong - 1; switch (deflated) { case 0 : // no realEigenvalues deflated. if (dMin == dN || dMin == dN1) { double b1 = Math.sqrt(work[nn - 3]) * Math.sqrt(work[nn - 5]); double b2 = Math.sqrt(work[nn - 7]) * Math.sqrt(work[nn - 9]); double a2 = work[nn - 7] + work[nn - 5]; if (dMin == dN && dMin1 == dN1) { // cases 2 and 3. final double gap2 = dMin2 - a2 - dMin2 * 0.25; final double gap1 = a2 - dN - ((gap2 > 0.0 && gap2 > b2) ? (b2 / gap2) * b2 : (b1 + b2)); if (gap1 > 0.0 && gap1 > b1) { tau = Math.max(dN - (b1 / gap1) * b1, 0.5 * dMin); tType = -2; } else { double s = 0.0; if (dN > b1) { s = dN - b1; } if (a2 > (b1 + b2)) { s = Math.min(s, a2 - (b1 + b2)); } tau = Math.max(s, 0.333 * dMin); tType = -3; } } else { // case 4. tType = -4; double s = 0.25 * dMin; double gam; int np; if (dMin == dN) { gam = dN; a2 = 0.0; if (work[nn - 5] > work[nn - 7]) { return; } b2 = work[nn - 5] / work[nn - 7]; np = nn - 9; } else { np = nn - 2 * pingPong; b2 = work[np - 2]; gam = dN1; if (work[np - 4] > work[np - 2]) { return; } a2 = work[np - 4] / work[np - 2]; if (work[nn - 9] > work[nn - 11]) { return; } b2 = work[nn - 9] / work[nn - 11]; np = nn - 13; } // approximate contribution to norm squared from i < nn-1. a2 = a2 + b2; for (int i4 = np; i4 >= 4 * start + 2 + pingPong; i4 -= 4) { if(b2 == 0.0) { break; } b1 = b2; if (work[i4] > work[i4 - 2]) { return; } b2 = b2 * (work[i4] / work[i4 - 2]); a2 = a2 + b2; if (100 * Math.max(b2, b1) < a2 || cnst1 < a2) { break; } } a2 = cnst3 * a2; tType = -4; tau = s; } } else if (dMin == dN2) { // case 5. tType = -5; double s = 0.25 * dMin; // compute contribution to norm squared from i > nn-2. final int np = nn - 2 * pingPong; double b1 = work[np - 2]; double b2 = work[np - 6]; final double gam = dN2; if (work[np - 8] > b2 || work[np - 4] > b1) { return; } double a2 = (work[np - 8] / b2) * (1 + work[np - 4] / b1); // approximate contribution to norm squared from i < nn-2. if (end - start > 2) { b2 = work[nn - 13] / work[nn - 15]; a2 = a2 + b2; for (int i4 = nn - 17; i4 >= 4 * start + 2 + pingPong; i4 -= 4) { if (b2 == 0.0) { break; } b1 = b2; if (work[i4] > work[i4 - 2]) { return; } b2 = b2 * (work[i4] / work[i4 - 2]); a2 = a2 + b2; if (100 * Math.max(b2, b1) < a2 || cnst1 < a2) { break; } } a2 = cnst3 * a2; } if (a2 < cnst1) { tau = gam * (1 - Math.sqrt(a2)) / (1 + a2); } else { tau = s; } } else { // case 6, no information to guide us. if (tType == -6) { g += 0.333 * (1 - g); } else if (tType == -18) { g = 0.25 * 0.333; } else { g = 0.25; } tau = g * dMin; tType = -6; } break; case 1 : // one eigenvalue just deflated. use dMin1, dN1 for dMin and dN. ; break; case 2 : // two realEigenvalues deflated. use dMin2, dN2 for dMin and dN. // cases 10 and 11. if (dMin2 == dN2 && 2 * work[nn - 5] < work[nn - 7]) { tType = -10; final double s = 0.333 * dMin2; if (work[nn - 5] > work[nn - 7]) { return; } double b1 = work[nn - 5] / work[nn - 7]; double b2 = b1; if (b2 != 0.0){ for (int i4 = 4 * end - 9 + pingPong; i4 >= 4 * start + 2 + pingPong; i4 -= 4) { if (work[i4] > work[i4 - 2]) { return; } b1 *= work[i4] / work[i4 - 2]; b2 += b1; if (100 * b1 < b2) { break; } } } b2 = Math.sqrt(cnst3 * b2); final double a2 = dMin2 / (1 + b2 * b2); final double gap2 = work[nn - 7] + work[nn - 9] - Math.sqrt(work[nn - 11]) * Math.sqrt(work[nn - 9]) - a2; if (gap2 > 0.0 && gap2 > b2 * a2) { tau = Math.max(s, a2 * (1 - cnst2 * a2 * (b2 / gap2) * b2)); } else { tau = Math.max(s, a2 * (1 - cnst2 * b2)); } } else { tau = 0.25 * dMin2; tType = -11; } break; default : // case 12, more than two realEigenvalues deflated. no information. tau = 0.0; tType = -12; } } /** * Update sigma. * @param shift shift to apply to sigma */ private void updateSigma(final double shift) { // BEWARE: do NOT attempt to simplify the following statements // the expressions below take care to accumulate the part of sigma // that does not fit within a double variable into sigmaLow if (shift < sigma) { sigmaLow += shift; final double t = sigma + sigmaLow; sigmaLow -= t - sigma; sigma = t; } else { final double t = sigma + shift; sigmaLow += sigma - (t - shift); sigma = t; } } /** * Find eigenvectors. */ private void findEigenVectors() { final int m = main.length; eigenvectors = new ArrayRealVector[m]; // perform an initial non-shifted LDLt decomposition final double[] d = new double[m]; final double[] l = new double[m - 1]; // avoid zero divide on indefinite matrix final double mu = realEigenvalues[m-1] <= 0 && realEigenvalues[0] > 0 ? 0.5-realEigenvalues[m-1] : 0; double di = main[0]+mu; d[0] = di; for (int i = 1; i < m; ++i) { final double eiM1 = secondary[i - 1]; final double ratio = eiM1 / di; di = main[i] - eiM1 * ratio + mu; l[i - 1] = ratio; d[i] = di; } // compute eigenvectors for (int i = 0; i < m; ++i) { eigenvectors[i] = findEigenvector(realEigenvalues[i]+mu, d, l); } } /** * Find an eigenvector corresponding to an eigenvalue, using bidiagonals. * <p>This method corresponds to algorithm X from Dhillon's thesis.</p> * * @param eigenvalue eigenvalue for which eigenvector is desired * @param d diagonal elements of the initial non-shifted D matrix * @param l off-diagonal elements of the initial non-shifted L matrix * @return an eigenvector */ private ArrayRealVector findEigenvector(final double eigenvalue, final double[] d, final double[] l) { // compute the LDLt and UDUt decompositions of the // perfectly shifted tridiagonal matrix final int m = main.length; stationaryQuotientDifferenceWithShift(d, l, eigenvalue); progressiveQuotientDifferenceWithShift(d, l, eigenvalue); // select the twist index leading to // the least diagonal element in the twisted factorization int r = m - 1; double minG = Math.abs(work[6 * r] + work[6 * r + 3] + eigenvalue); int sixI = 0; for (int i = 0; i < m - 1; ++i) { final double absG = Math.abs(work[sixI] + d[i] * work[sixI + 9] / work[sixI + 10]); if (absG < minG) { r = i; minG = absG; } sixI += 6; } // solve the singular system by ignoring the equation // at twist index and propagating upwards and downwards double[] eigenvector = new double[m]; double n2 = 1; eigenvector[r] = 1; double z = 1; for (int i = r - 1; i >= 0; --i) { z *= -work[6 * i + 2]; eigenvector[i] = z; n2 += z * z; } z = 1; for (int i = r + 1; i < m; ++i) { z *= -work[6 * i - 1]; eigenvector[i] = z; n2 += z * z; } // normalize vector final double inv = 1.0 / Math.sqrt(n2); for (int i = 0; i < m; ++i) { eigenvector[i] *= inv; } return (transformer == null) ? new ArrayRealVector(eigenvector, false) : new ArrayRealVector(transformer.getQ().operate(eigenvector), false); } /** * Decompose matrix LDL<sup>T</sup> - &lambda; I as * L<sub>+</sub>D<sub>+</sub>L<sub>+</sub><sup>T</sup>. * <p>This method corresponds to algorithm 4.4.3 (dstqds) from Dhillon's thesis.</p> * @param d diagonal elements of D, * @param l off-diagonal elements of L * @param lambda shift to apply */ private void stationaryQuotientDifferenceWithShift(final double[] d, final double[] l, final double lambda) { final int nM1 = d.length - 1; double si = -lambda; int sixI = 0; for (int i = 0; i < nM1; ++i) { final double di = d[i]; final double li = l[i]; final double diP1 = di + si; final double liP1 = li * di / diP1; work[sixI] = si; work[sixI + 1] = diP1; work[sixI + 2] = liP1; si = li * liP1 * si - lambda; sixI += 6; } work[6 * nM1 + 1] = d[nM1] + si; work[6 * nM1] = si; } /** * Decompose matrix LDL<sup>T</sup> - &lambda; I as * U<sub>-</sub>D<sub>-</sub>U<sub>-</sub><sup>T</sup>. * <p>This method corresponds to algorithm 4.4.5 (dqds) from Dhillon's thesis.</p> * @param d diagonal elements of D * @param l off-diagonal elements of L * @param lambda shift to apply */ private void progressiveQuotientDifferenceWithShift(final double[] d, final double[] l, final double lambda) { final int nM1 = d.length - 1; double pi = d[nM1] - lambda; int sixI = 6 * (nM1 - 1); for (int i = nM1 - 1; i >= 0; --i) { final double di = d[i]; final double li = l[i]; final double diP1 = di * li * li + pi; final double t = di / diP1; work[sixI + 9] = pi; work[sixI + 10] = diP1; work[sixI + 5] = li * t; pi = pi * t - lambda; sixI -= 6; } work[3] = pi; work[4] = pi; } }
[ "he_ye_90s@hotmail.com" ]
he_ye_90s@hotmail.com
056991a8862114fa47fd9c68602c1477421cdb92
13c5ddaab54e5cfbb4c19549056972a773543ca3
/src/main/java/org/byteskript/skript/lang/syntax/flow/error/EffectTry.java
14c166e770f72b37caaa8ef48557d0171803ca08
[ "BSD-3-Clause" ]
permissive
Moderocky/ByteSkript
e218b093a6623c62c7440a37fddb8f317c470296
65ea545567a680bc0062572f48500d9e061e1b35
refs/heads/master
2023-05-24T01:11:47.510143
2022-11-16T10:43:49
2022-11-16T10:43:49
392,628,098
28
8
NOASSERTION
2023-09-03T14:22:37
2021-08-04T09:28:53
Java
UTF-8
Java
false
false
3,109
java
/* * Copyright (c) 2021 ByteSkript org (Moderocky) * View the full licence information and permissions: * https://github.com/Moderocky/ByteSkript/blob/master/LICENSE */ package org.byteskript.skript.lang.syntax.flow.error; import mx.kenzie.foundation.MethodBuilder; import mx.kenzie.foundation.WriteInstruction; import org.byteskript.skript.api.note.Documentation; import org.byteskript.skript.api.syntax.Effect; import org.byteskript.skript.compiler.CompileState; import org.byteskript.skript.compiler.Context; import org.byteskript.skript.compiler.Pattern; import org.byteskript.skript.compiler.SkriptLangSpec; import org.byteskript.skript.compiler.structure.MultiLabel; import org.byteskript.skript.compiler.structure.TryCatchTree; import org.byteskript.skript.error.ScriptCompileError; import org.byteskript.skript.lang.element.StandardElements; import org.objectweb.asm.Label; import org.objectweb.asm.Opcodes; @Documentation( name = "Inline Try", description = """ Attempts the following effect, failing silently if an error occurs. This is a meta-effect and follows an unusual pattern. """, examples = { """ try: assert 1 is 2 """ } ) public class EffectTry extends Effect { public EffectTry() { super(SkriptLangSpec.LIBRARY, StandardElements.EFFECT, "try[ to]: %Effect%"); } @Override public CompileState getSubState() { return CompileState.CODE_BODY; // need to run an effect inside this! } @Override public void preCompile(Context context, Pattern.Match match) throws Throwable { final TryCatchTree tree = new TryCatchTree(context.getSection(1), new MultiLabel()); context.createTree(tree); tree.start(context); super.preCompile(context, match); } @Override public void compile(Context context, Pattern.Match match) throws Throwable { if (!(context.getCurrentTree() instanceof TryCatchTree tree)) throw new ScriptCompileError(context.lineNumber(), "Inline 'try' cannot be used on a section header."); final Label label = tree.getEnd().use(); final Label next = tree.getStartCatch(); final MethodBuilder method = context.getMethod(); if (method == null) throw new ScriptCompileError(context.lineNumber(), "Try effect used outside method."); context.getMethod().writeCode(((writer, visitor) -> { visitor.visitJumpInsn(Opcodes.GOTO, label); visitor.visitLabel(next); })); method.writeCode(WriteInstruction.pop()); tree.close(context); context.setState(CompileState.CODE_BODY); } @Override public Pattern.Match match(String thing, Context context) { if (!thing.startsWith("try")) return null; if (!thing.contains(":")) return null; if (thing.endsWith(":")) { context.getError().addHint(this, "Section headers cannot be used in the 'try-to' effect."); return null; } return super.match(thing, context); } }
[ "admin@moderocky.com" ]
admin@moderocky.com
41a798c91aaf16816d94932b8e3622794ba56c32
95b50a95a920d2e09de11e1b471c24a8ae0e72b2
/MOOC_JAVA_OFFER/src/Socket/TCP/Server.java
7ca734783e140d0e9be2d3e910e2cbdefd7f4aa5
[]
no_license
HongbinW/Java
5db4668d263681ce52b9cfb8a6148abadd967969
e8a9c952a860fcae8c382c93039f939d334e4ec8
refs/heads/master
2021-07-01T21:04:11.933749
2020-09-16T05:43:05
2020-09-16T05:43:05
162,947,163
1
0
null
null
null
null
UTF-8
Java
false
false
1,554
java
package Socket.TCP; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.ServerSocket; import java.net.Socket; /** * @Author: HongbinW * @Date: 2019/8/9 21:31 * @Version 1.0 * @Description: */ public class Server { public static void main(String[] args) { ServerSocket ss = null; InputStream is = null; OutputStream os = null; Socket socket = null; try { ss = new ServerSocket(65000); socket = ss.accept(); is = socket.getInputStream(); byte[] input = new byte[64]; int len = 0; String rcvStr = null; while ((len = is.read(input)) != -1){ rcvStr = new String(input, 0, len); System.out.println(rcvStr); } os = socket.getOutputStream(); os.write(rcvStr.length()); }catch (IOException e){ e.printStackTrace(); }finally { try{ is.close(); }catch (IOException e){ e.printStackTrace(); } try { os.close(); } catch (IOException e) { e.printStackTrace(); } try { socket.close(); } catch (IOException e) { e.printStackTrace(); } try{ ss.close(); }catch (IOException e){ e.printStackTrace(); } } } }
[ "501245176@qq.com" ]
501245176@qq.com
4faa44440b218400965f269488ba0361e03617eb
1bee3a7f6e9d5bd26a65c0aa8cfd4440e0f449f3
/sm-core-model/src/main/java/com/salesmanager/core/model/order/orderproduct/OrderProductPrice.java
dc514136e617c52f655670d9ef999afae6a0f64d
[]
permissive
msadiqh/shopizer
112ce2eff91650764261adbd3721169368aac18c
e246e6655e0eb5bbb596c0d6cd46dc4237d613bc
refs/heads/master
2022-10-17T08:40:59.838170
2020-07-23T11:58:26
2020-07-23T11:58:26
248,799,644
0
4
Apache-2.0
2020-03-29T10:22:30
2020-03-20T16:16:06
Java
UTF-8
Java
false
false
3,658
java
package com.salesmanager.core.model.order.orderproduct; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.TableGenerator; import javax.persistence.Temporal; import javax.persistence.TemporalType; import com.fasterxml.jackson.annotation.JsonIgnore; import com.salesmanager.core.constants.SchemaConstant; @Entity @Table (name="ORDER_PRODUCT_PRICE" , schema=SchemaConstant.SALESMANAGER_SCHEMA) public class OrderProductPrice implements Serializable { private static final long serialVersionUID = 3734737890163564311L; @Id @Column (name="ORDER_PRODUCT_PRICE_ID") @TableGenerator(name = "TABLE_GEN", table = "SM_SEQUENCER", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "ORDER_PRD_PRICE_ID_NEXT_VAL") @GeneratedValue(strategy = GenerationType.TABLE, generator = "TABLE_GEN") private Long id; @JsonIgnore @ManyToOne @JoinColumn(name = "ORDER_PRODUCT_ID", nullable = false) private OrderProduct orderProduct; @Column(name = "PRODUCT_PRICE_CODE", nullable = false , length=64 ) private String productPriceCode; @Column(name = "PRODUCT_PRICE", nullable = false) private BigDecimal productPrice; @Column(name = "PRODUCT_PRICE_SPECIAL") private BigDecimal productPriceSpecial; @Temporal(TemporalType.TIMESTAMP) @Column (name="PRD_PRICE_SPECIAL_ST_DT" , length=0) private Date productPriceSpecialStartDate; @Temporal(TemporalType.TIMESTAMP) @Column (name="PRD_PRICE_SPECIAL_END_DT" , length=0) private Date productPriceSpecialEndDate; @Column(name = "DEFAULT_PRICE", nullable = false) private Boolean defaultPrice; @Column(name = "PRODUCT_PRICE_NAME", nullable = true) private String productPriceName; public OrderProductPrice() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Boolean getDefaultPrice() { return defaultPrice; } public void setDefaultPrice(Boolean defaultPrice) { this.defaultPrice = defaultPrice; } public String getProductPriceName() { return productPriceName; } public void setProductPriceName(String productPriceName) { this.productPriceName = productPriceName; } public OrderProduct getOrderProduct() { return orderProduct; } public void setOrderProduct(OrderProduct orderProduct) { this.orderProduct = orderProduct; } public void setProductPriceCode(String productPriceCode) { this.productPriceCode = productPriceCode; } public String getProductPriceCode() { return productPriceCode; } public void setProductPriceSpecialStartDate( Date productPriceSpecialStartDate) { this.productPriceSpecialStartDate = productPriceSpecialStartDate; } public Date getProductPriceSpecialStartDate() { return productPriceSpecialStartDate; } public void setProductPriceSpecialEndDate(Date productPriceSpecialEndDate) { this.productPriceSpecialEndDate = productPriceSpecialEndDate; } public Date getProductPriceSpecialEndDate() { return productPriceSpecialEndDate; } public void setProductPriceSpecial(BigDecimal productPriceSpecial) { this.productPriceSpecial = productPriceSpecial; } public BigDecimal getProductPriceSpecial() { return productPriceSpecial; } public void setProductPrice(BigDecimal productPrice) { this.productPrice = productPrice; } public BigDecimal getProductPrice() { return productPrice; } }
[ "csamson777@yahoo.com" ]
csamson777@yahoo.com
bbb9318117b837c73c6659a84b905fad50df9d8c
0f250a51adcc99b2c441feba3ca30bb03799d0dc
/src/java/Servlet/RegisterServlets.java
90a9fd57ebb8b8ed010a4b2c1b436a543a8d3d1e
[]
no_license
AnuPrajapati/EmployeePerformanceEvaluation
a46eeab10c1d38d1760101d1a19d293060b9cb23
70728f4d89f9d0a941cf671a0da043cac1a3b549
refs/heads/master
2020-07-07T00:23:57.839990
2019-08-22T07:42:16
2019-08-22T07:42:16
203,184,146
0
0
null
null
null
null
UTF-8
Java
false
false
3,434
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 Servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import model.RegisterDAO; import model.RegisterModel; /** * * @author User */ public class RegisterServlets extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); String companyname = request.getParameter("companyname"); String managername = request.getParameter("managername"); String username = request.getParameter("emailid"); String password = request.getParameter("password"); PrintWriter out = response.getWriter(); RegisterModel model = new RegisterModel(username, password, companyname, managername); RegisterDAO registerDao = new RegisterDAO(); //The core Logic of the Registration application is present here. We are going to insert user data in to the database. String userRegistered = registerDao.registerUser(model); if (userRegistered.equals("SUCCESS")) //On success, you can display a message to user on Home page { response.sendRedirect("index.jsp"); } else //On Failure, display a meaningful message to the User. { request.setAttribute("errMessage", userRegistered); request.getRequestDispatcher("/register.jsp").forward(request, response); } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
[ "hasily.prazapati@gmail.com" ]
hasily.prazapati@gmail.com
7356a8158766b60013a130654da7586ff46d7014
6e723af03a2ba0ff9c5068f253b97b65679e7041
/src/main/java/com/yjq/BMS/controller/admin/AdminController.java
03926ed23c634550aef19b67afdf190b28b133f4
[]
no_license
sudongzhao/BMS
e4b01c6be840c9336f9c7d98a5e4c6e26e966f93
6c700e59cdcafe05bfd11cf173e59a25ea685a20
refs/heads/master
2023-01-30T12:49:57.116998
2020-12-11T00:51:25
2020-12-11T00:51:25
320,427,931
0
0
null
null
null
null
UTF-8
Java
false
false
5,652
java
package com.yjq.BMS.controller.admin; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import com.yjq.BMS.bean.CodeMsg; import com.yjq.BMS.constant.SessionConstant; import com.yjq.BMS.dao.admin.AdminMapper; import com.yjq.BMS.dao.admin.AuthorityMapper; import com.yjq.BMS.dao.admin.MenuMapper; import com.yjq.BMS.dao.admin.RoleMapper; import com.yjq.BMS.enums.MenuStateEnum; import com.yjq.BMS.pojo.admin.Admin; import com.yjq.BMS.pojo.admin.Authority; import com.yjq.BMS.pojo.admin.Menu; import com.yjq.BMS.service.admin.IAdminService; import com.yjq.BMS.service.admin.IMenuService; import com.yjq.BMS.vo.common.ResponseVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.github.pagehelper.util.StringUtil; /** * 后台管理系统管理员控制器 * @author 82320 * */ @RequestMapping("/admin/admin") @Controller public class AdminController { @Autowired private IMenuService menuService; @Autowired private MenuMapper menuMapper; @Autowired private AdminMapper adminMapper; @Autowired private IAdminService adminService; @Autowired private RoleMapper roleMapper; @Autowired private AuthorityMapper authorityMapper; /** * 管理员列表页面 * @param model * @param id * @return */ @RequestMapping(value="/index",method=RequestMethod.GET) public String index(Model model,Integer id,String name,HttpServletRequest request, @RequestParam(required = false, defaultValue = "1") Integer pageNum, @RequestParam(required = false, defaultValue = "5") Integer pageSize //每页5个数据 ) { //获取列表展示有关信息 if(StringUtil.isEmpty(name)) { //如果查询信息为空 model.addAttribute("PageInfo", adminService.getAdminListByPage(pageNum, pageSize).getData()); }else { model.addAttribute("PageInfo", adminService.getAdminListByPageAndName(pageNum, pageSize, name).getData()); model.addAttribute("name",name); } model.addAttribute("RoleList", roleMapper.selectAll()); //获取路径上有关信息 Menu selectByPrimaryKey = menuMapper.selectByPrimaryKey(id); if(selectByPrimaryKey == null) { return "error/404"; } Admin loginedAdmin = (Admin) request.getSession().getAttribute(SessionConstant.SESSION_ADMIN_LOGIN_KEY); List<Authority> selectByRoleId = authorityMapper.selectByRoleId(loginedAdmin.getRoleId()); //获取当前用户所有权限 Set<Integer> menuIdSet = selectByRoleId.stream().map(Authority :: getMenuId).collect(Collectors.toSet());//把权限中所有菜单id取出来 List<Menu> allMenusByStateAndPrimaryKeys = menuMapper.selectByStateAndPrimaryKeys(MenuStateEnum.OPEN.getCode(), menuIdSet); model.addAttribute("onThirdMenus", menuService.getThirdMenus(allMenusByStateAndPrimaryKeys).getData()); model.addAttribute("parentMenu", menuMapper.selectByPrimaryKey(selectByPrimaryKey.getParentId())); model.addAttribute("currentMenu", selectByPrimaryKey); return "admin/admin/index"; } /** * 管理员添加页面 * @param model * @return */ @RequestMapping(value="/add",method=RequestMethod.GET) public String add(Model model) { model.addAttribute("RoleList", roleMapper.selectAll()); return "admin/admin/add"; } /** * 管理员编辑页面 * @param model * @param id * @return */ @RequestMapping(value="/edit",method=RequestMethod.GET) public String edit(Model model,Integer id) { Admin selectByPrimaryKey = adminMapper.selectByPrimaryKey(id); if(selectByPrimaryKey == null) { return "error/404"; } model.addAttribute("RoleList", roleMapper.selectAll()); model.addAttribute("editAdmin", selectByPrimaryKey); return "admin/admin/edit"; } /** * 管理员添加表单处理 * @param admin * @return */ @RequestMapping(value="/add",method=RequestMethod.POST) @ResponseBody public ResponseVo<Boolean> add(Admin admin){ return adminService.add(admin); } /** * 管理员编辑表单处理 * @param admin * @return */ @RequestMapping(value="/edit",method=RequestMethod.POST) @ResponseBody public ResponseVo<Boolean> edit(Admin admin,HttpServletRequest request){ Admin loginedAdmin = (Admin) request.getSession().getAttribute(SessionConstant.SESSION_ADMIN_LOGIN_KEY); ResponseVo<Admin> editAdmin = adminService.edit(admin); if(editAdmin.getCode().intValue() == CodeMsg.SUCCESS.getCode()) { if(loginedAdmin.getId().intValue() == editAdmin.getData().getId().intValue()) { //更新权限 request.getSession().setAttribute(SessionConstant.SESSION_ADMIN_LOGIN_KEY, editAdmin.getData()); } return ResponseVo.successByMsg(true, "编辑成功!"); }else { CodeMsg codeMsg = new CodeMsg(); codeMsg.setCode(editAdmin.getCode()); codeMsg.setMsg(editAdmin.getMsg()); return ResponseVo.errorByMsg(codeMsg); } } /** * 管理员删除处理 * @param id * @return */ @RequestMapping(value="/delete",method=RequestMethod.POST) @ResponseBody public ResponseVo<Boolean> delete(Integer id){ return adminService.delete(id); } /** * 管理员更改状态处理 * @param id * @return */ @RequestMapping(value="/change_state",method=RequestMethod.POST) @ResponseBody public ResponseVo<Boolean> chageState(Integer id){ return adminService.chageState(id); } }
[ "1692419780@qq.com" ]
1692419780@qq.com
b44af1793b076e0efdd1268c15fd95d0a9bb9654
21e401ab2b25081e0f3d4be99f56539680019415
/Java/src/main/java/com/anexsys/recruitment/challenge/PairsGame.java
d1841f27c4064702a72505a8899b3ed74f44a415
[]
no_license
Anexsys/recruitment-challenge
85c0fbc3b711f6edc89c66394edcded6b49edbfc
3434ff428a189e31dd455794c8e26f155888a539
refs/heads/master
2020-04-04T20:29:05.146619
2018-12-07T15:35:07
2018-12-07T15:35:07
156,248,407
1
1
null
null
null
null
UTF-8
Java
false
false
960
java
package com.anexsys.recruitment.challenge; import java.util.concurrent.CompletableFuture; /** * Implement Game to play pairs, such that all cards are spread out in a grid * and each player takes it in turn to turn over two cards. They make a trick if * the cards have the same rank, regardless of suit. If they make a trick, they * get to have another go. The winner is the player with the most tricks. No * jokers are required. */ class PairsGame implements Game { @Override public Game shuffle() { return this; } @Override public Game assign(Player[] players) { return this; } @Override public Game deal() { return this; } @Override public CompletableFuture<GameComplete> start() { return CompletableFuture.completedFuture(new Game.GameComplete(){ @Override public Player winner() { return null; } }); } }
[ "alex.horn@anexsys.com" ]
alex.horn@anexsys.com
dc7327588dcc5c45d91c560a675e3cfab4a6286b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_3b788917df5ab472fd2d97ab07b5fce49606a4d8/Image/5_3b788917df5ab472fd2d97ab07b5fce49606a4d8_Image_t.java
0bc60e3372144aa3bc4c5a52cd79eb662adfdf4c
[]
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
13,523
java
package org.newdawn.slick; import java.io.IOException; import java.io.InputStream; import org.lwjgl.opengl.EXTSecondaryColor; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GLContext; import org.newdawn.slick.opengl.Texture; import org.newdawn.slick.opengl.TextureLoader; import org.newdawn.slick.util.Log; import org.newdawn.slick.util.ResourceLoader; /** * An image loaded from a file and renderable to the canvas * * @author kevin */ public class Image { /** The sprite sheet currently in use */ protected static Image inUse; /** Use Linear Filtering */ public static final int FILTER_LINEAR = 1; /** Use Nearest Filtering */ public static final int FILTER_NEAREST = 2; /** The OpenGL texture for this image */ protected Texture texture; /** The width of the image */ protected int width; /** The height of the image */ protected int height; /** The texture coordinate width to use to find our image */ private float textureWidth; /** The texture coordinate height to use to find our image */ private float textureHeight; /** The x texture offset to use to find our image */ private float textureOffsetX; /** The y texture offset to use to find our image */ private float textureOffsetY; /** The name given for the image */ private String ref; /** * Create a texture as a copy of another * * @param other The other texture to copy */ protected Image(Image other) { this.texture = other.texture; this.width = other.width; this.height = other.height; this.textureWidth = other.textureWidth; this.textureHeight = other.textureHeight; this.ref = other.ref; this.textureOffsetX = other.textureOffsetX; this.textureOffsetY = other.textureOffsetY; } /** * Cloning constructor - only used internally. */ private Image() { } /** * Create an image based on a file at the specified location * * @param ref The location of the image file to load * @throws SlickException Indicates a failure to load the image */ public Image(String ref) throws SlickException { this(ref, true); } /** * Create an image based on a file at the specified location * * @param ref The location of the image file to load * @param flipped True if the image should be flipped on the y-axis on load * @throws SlickException Indicates a failure to load the image */ public Image(String ref, boolean flipped) throws SlickException { this(ResourceLoader.getResourceAsStream(ref), ref, flipped); } /** * Create an image based on a file at the specified location * * @param ref The location of the image file to load * @param flipped True if the image should be flipped on the y-axis on load * @param filter The filtering method to use when scaling this image * @throws SlickException Indicates a failure to load the image */ public Image(String ref, boolean flipped, int filter) throws SlickException { this(ResourceLoader.getResourceAsStream(ref), ref, flipped, filter); } /** * Create an image based on a file at the specified location * * @param in The input stream to read the image from * @param ref The name that should be assigned to the image * @param flipped True if the image should be flipped on the y-axis on load * @throws SlickException Indicates a failure to load the image */ public Image(InputStream in, String ref, boolean flipped) throws SlickException { this(in, ref, flipped, FILTER_LINEAR); } /** * Create an image based on a file at the specified location * * @param in The input stream to read the image from * @param ref The name that should be assigned to the image * @param flipped True if the image should be flipped on the y-axis on load * @param filter The filter to use when scaling this image * @throws SlickException Indicates a failure to load the image */ public Image(InputStream in, String ref, boolean flipped,int filter) throws SlickException { load(in, ref, flipped, filter); } /** * Create an image from a buffer of pixels * * @param buffer The buffer to use to create the image */ Image(ImageBuffer buffer) { this(buffer, FILTER_LINEAR); } /** * Create an image from a buffer of pixels * * @param buffer The buffer to use to create the image * @param filter The filter to use when scaling this image */ Image(ImageBuffer buffer, int filter) { texture = TextureLoader.get().getTexture(buffer, filter == FILTER_LINEAR ? GL11.GL_LINEAR : GL11.GL_NEAREST); ref = texture.toString(); init(); } /** * Load the image * * @param in The input stream to read the image from * @param ref The name that should be assigned to the image * @param flipped True if the image should be flipped on the y-axis on load * @param filter The filter to use when scaling this image * @throws SlickException Indicates a failure to load the image */ private void load(InputStream in, String ref, boolean flipped, int filter) throws SlickException { try { this.ref = ref; texture = TextureLoader.get().getTexture(in, ref, flipped, filter == FILTER_LINEAR ? GL11.GL_LINEAR : GL11.GL_NEAREST); } catch (IOException e) { Log.error(e); throw new SlickException("Failed to load image from: "+ref, e); } init(); } /** * Initialise internal data */ private void init() { width = texture.getImageWidth(); height = texture.getImageHeight(); textureOffsetX = 0; textureOffsetY = 0; textureWidth = texture.getWidth(); textureHeight = texture.getHeight(); } /** * Draw this image at the current location */ public void draw() { draw(0,0); } /** * Draw this image at the specified location * * @param x The x location to draw the image at * @param y The y location to draw the image at */ public void draw(int x, int y) { draw(x,y,width,height); } /** * Draw this image at the specified location * * @param x The x location to draw the image at * @param y The y location to draw the image at * @param filter The color to filter with when drawing */ public void draw(int x, int y, Color filter) { draw(x,y,width,height, filter); } /** * Draw this image as part of a collection of images * * @param x The x location to draw the image at * @param y The y location to draw the image at * @param width The width to render the image at * @param height The height to render the image at */ public void drawEmbedded(int x,int y,int width,int height) { GL11.glTexCoord2f(textureOffsetX, textureOffsetY); GL11.glVertex3f(x, y, 0); GL11.glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight); GL11.glVertex3f(x, y + height, 0); GL11.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY + textureHeight); GL11.glVertex3f(x + width, y + height, 0); GL11.glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY); GL11.glVertex3f(x + width, y, 0); } /** * Draw this image at a specified location and size * * @param x * The x location to draw the image at * @param y * The y location to draw the image at * @param width * The width to render the image at * @param height * The height to render the image at */ public void draw(int x,int y,int width,int height) { draw(x,y,width,height,Color.white); } /** * Draw this image at a specified location and size * * @param x The x location to draw the image at * @param y The y location to draw the image at * @param width The width to render the image at * @param height The height to render the image at * @param filter The color to filter with while drawing */ public void draw(int x,int y,int width,int height,Color filter) { if (filter != null) { filter.bind(); } texture.bind(); GL11.glBegin(GL11.GL_QUADS); drawEmbedded(x,y,width,height); GL11.glEnd(); } /** * Draw this image at a specified location and size as a silohette * * @param x The x location to draw the image at * @param y The y location to draw the image at * @param width The width to render the image at * @param height The height to render the image at */ public void drawFlash(int x,int y,int width,int height) { Color.white.bind(); texture.bind(); if (GLContext.getCapabilities().GL_EXT_secondary_color) { GL11.glEnable(EXTSecondaryColor.GL_COLOR_SUM_EXT); EXTSecondaryColor.glSecondaryColor3ubEXT((byte)255, (byte)255, (byte)255); } GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE); GL11.glBegin(GL11.GL_QUADS); drawEmbedded(x,y,width,height); GL11.glEnd(); if (GLContext.getCapabilities().GL_EXT_secondary_color) { GL11.glDisable(EXTSecondaryColor.GL_COLOR_SUM_EXT); } } /** * Draw this image at a specified location and size in a white silohette * * @param x The x location to draw the image at * @param y The y location to draw the image at */ public void drawFlash(int x,int y) { drawFlash(x,y,getWidth(),getHeight()); } /** * Get a sub-part of this image. Note that the create image retains a reference to the * image data so should anything change it will affect sub-images too. * * @param x The x coordinate of the sub-image * @param y The y coordinate of the sub-image * @param width The width of the sub-image * @param height The height of the sub-image * @return The image represent the sub-part of this image */ public Image getSubImage(int x,int y,int width,int height) { float newTextureOffsetX = ((x / (float) this.width) * textureWidth) + textureOffsetX; float newTextureOffsetY = ((y / (float) this.height) * textureHeight) + textureOffsetY; float newTextureWidth = ((width / (float) this.width) * textureWidth); float newTextureHeight = ((height / (float) this.height) * textureHeight); Image sub = new Image(); sub.texture = this.texture; sub.textureOffsetX = newTextureOffsetX; sub.textureOffsetY = newTextureOffsetY; sub.textureWidth = newTextureWidth; sub.textureHeight = newTextureHeight; sub.width = width; sub.height = height; sub.ref = ref; return sub; } /** * Get the width of this image * * @return The width of this image */ public int getWidth() { return width; } /** * Get the height of this image * * @return The height of this image */ public int getHeight() { return height; } /** * Get a copy of this image. This is a shallow copy and does not * duplicate image adata. * * @return The copy of this image */ public Image copy() { return getSubImage(0,0,width,height); } /** * Get a scaled copy of this image * * @param width The width of the copy * @param height The height of the copy * @return The new scaled image */ public Image getScaledCopy(int width, int height) { Image image = copy(); image.width = width; image.height = height; return image; } /** * Get a copy image flipped on potentially two axis * * @param flipHorizontal True if we want to flip the image horizontally * @param flipVertical True if we want to flip the image vertically * @return The flipped image instance */ public Image getFlippedCopy(boolean flipHorizontal, boolean flipVertical) { Image image = copy(); if (flipHorizontal) { image.textureOffsetX = textureOffsetX + textureWidth; image.textureWidth = -textureWidth; } if (flipVertical) { image.textureOffsetY = textureOffsetY + textureHeight; image.textureHeight = -textureHeight; } return image; } /** * End the use of this sprite sheet and release the lock. * * @see #startUse */ public void endUse() { if (inUse != this) { throw new RuntimeException("The sprite sheet is not currently in use"); } inUse = null; GL11.glEnd(); } /** * Start using this sheet. This method can be used for optimal rendering of a collection * of sprites from a single sprite sheet. First, startUse(). Then render each sprite by * calling renderInUse(). Finally, endUse(). Between start and end there can be no rendering * of other sprites since the rendering is locked for this sprite sheet. */ public void startUse() { if (inUse != null) { throw new RuntimeException("Attempt to start use of a sprite sheet before ending use with another - see endUse()"); } inUse = this; Color.white.bind(); texture.bind(); GL11.glBegin(GL11.GL_QUADS); } /** * @see java.lang.Object#toString() */ public String toString() { return "[Image "+ref+" "+width+"x"+height+" "+textureOffsetX+","+textureOffsetY+","+textureWidth+","+textureHeight+"]"; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
e3931419077eafeb8b000450d27423cd091fbaa0
c5a49faedc2ffa5adb27903e37e71123f03f828a
/src/test/java/com/udacity/jwdnd/course1/cloudstorage/LoginPage.java
7a6225aaaac373db3bd82215bdeaaa08dc0b76ed
[]
no_license
Namita2197/SuperDuperDrive
9119b0aac72a2aeab7b2bb6c2500ecac38f363c0
60fcfe85ed5e8dedf2b325d904e0b0d641e54452
refs/heads/main
2023-03-19T01:53:39.503931
2021-03-02T05:48:52
2021-03-02T05:48:52
342,380,391
0
0
null
null
null
null
UTF-8
Java
false
false
1,044
java
package com.udacity.jwdnd.course1.cloudstorage; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; public class LoginPage { @FindBy(id="inputUsername") private WebElement inputUsername; @FindBy(id = "inputPassword") private WebElement inputPassword; @FindBy(id = "submitButton") private WebElement submitButton; private final WebDriver driver; public LoginPage(WebDriver driver) { this.driver = driver; PageFactory.initElements(driver, this); } public void login(String username, String password) { ((JavascriptExecutor) driver).executeScript("arguments[0].value='" + username + "';", inputUsername); ((JavascriptExecutor) driver).executeScript("arguments[0].value='" + password + "';", inputPassword); ((JavascriptExecutor) driver).executeScript("arguments[0].click();", submitButton); } }
[ "raghuvanshinamita@gmail.com" ]
raghuvanshinamita@gmail.com
6d68f3d0002cf44b439e62861d59bcd58f27bb5d
4f7d9488ef1c1c893e2550b2480a517d990383cc
/src/main/java/com/yanglinkui/ab/dsl/MyString.java
fa5fe1d9a43a1c86830bbbec552b87a57a65efbc
[ "MIT" ]
permissive
xiaoyu830411/abtesting_dsl
72d705cf0979a89dbd80762200f473a0e3cec993
9ff8ac666be7a0e5dd0c588d0f18ad1980ba463d
refs/heads/master
2021-01-12T00:59:33.344810
2020-02-09T11:22:40
2020-02-09T11:22:40
78,329,341
7
0
MIT
2020-10-12T22:20:52
2017-01-08T07:57:43
Java
UTF-8
Java
false
false
385
java
package com.yanglinkui.ab.dsl; /** * Created by jonas on 2017/1/7. */ public class MyString implements Value<String> { private final String value; public MyString(String value) { this.value = value; } public String getValue() { return this.value; } @Override public String toString() { return "String: " + this.value; } }
[ "jonas@jonasdeMacBook-Pro.local" ]
jonas@jonasdeMacBook-Pro.local