blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
2b79ebcf7cb77f3f8fbcfd80a46a840e0ef5ff18
024858afe9167703c7ba6a554526145061d98b70
/src/year2020/cs40s/gridgameadvanced/tools/Reactor.java
a6b15e5358501b7dfe855ad134b5fe5fcd0a8b53
[]
no_license
mrLWachs/FinalExample
590a326f0638196fbe06591b2c13999b2a7187be
e01f62d21014cd7a04c103387cc3a4c5431781b7
refs/heads/master
2023-01-27T11:24:04.479012
2023-01-19T14:20:06
2023-01-19T14:20:06
135,295,510
0
1
null
null
null
null
UTF-8
Java
false
false
8,969
java
/** required package class namespace */ package year2020.cs40s.gridgameadvanced.tools; /** * Reactor.java - methods to react to collisions in various ways * * @author Mr. Wachs * @since 14-May-2019 */ public class Reactor { private Coordinates source; private Coordinates target; private int numberOfDirections; private Detector detector; /** * Constructor for the class, sets class properties * * @param coordinates the coordinate data to assign to this class * @param numberOfDirections the number of movements in this game */ public Reactor(Coordinates coordinates, int numberOfDirections, Detector detector) { this.source = coordinates; this.numberOfDirections = numberOfDirections; this.detector = detector; } /** * Positions the coordinate data correctly against (sticks to) the target * coordinate data * * @param hitbox the other game object to stick to */ public void stickTo(GameObject hitbox) { if (numberOfDirections == Directions.TWO_DIRECTIONS || numberOfDirections == Directions.FOUR_DIRECTIONS) { if (source.direction == Directions.LEFT) stickToRight(hitbox); else if (source.direction == Directions.RIGHT) stickToLeft(hitbox); else if (source.direction == Directions.UP) stickToBottom(hitbox); else if (source.direction == Directions.DOWN) stickToTop(hitbox); } else if (numberOfDirections == Directions.EIGHT_DIRECTIONS) { if (source.direction == Directions.NORTH) stickToBottom(hitbox); else if (source.direction == Directions.SOUTH) stickToTop(hitbox); else if (source.direction == Directions.EAST) stickToLeft(hitbox); else if (source.direction == Directions.WEST) stickToRight(hitbox); else if (source.direction == Directions.NORTH_EAST) { if (detector.isBelow(hitbox)) stickToBottom(hitbox); else if (detector.isLeftOf(hitbox)) stickToLeft(hitbox); } else if (source.direction == Directions.SOUTH_EAST) { if (detector.isAbove(hitbox)) stickToTop(hitbox); else if (detector.isLeftOf(hitbox)) stickToLeft(hitbox); } else if (source.direction == Directions.SOUTH_WEST) { if (detector.isAbove(hitbox)) stickToTop(hitbox); else if (detector.isRightOf(hitbox)) stickToRight(hitbox); } else if (source.direction == Directions.NORTH_WEST) { if (detector.isBelow(hitbox)) stickToBottom(hitbox); else if (detector.isRightOf(hitbox)) stickToRight(hitbox); } } } /** * Positions the coordinate data correctly against (sticks to) the targets * bottom edge coordinate data * * @param hitbox the other game object to stick to */ public void stickToBottom(GameObject hitbox) { target = hitbox.coordinates; source.y = target.bottom + 1; source.recalculate(); } /** * Positions the coordinate data correctly against (sticks to) the targets * top edge coordinate data * * @param hitbox the other game object to stick to */ public void stickToTop(GameObject hitbox) { target = hitbox.coordinates; source.y = target.top - source.height - 1; source.recalculate(); } /** * Positions the coordinate data correctly against (sticks to) the targets * left edge coordinate data * * @param hitbox the other game object to stick to */ public void stickToLeft(GameObject hitbox) { target = hitbox.coordinates; source.x = target.left - source.width - 1; source.recalculate(); } /** * Positions the coordinate data correctly against (sticks to) the targets * right edge coordinate data * * @param hitbox the other game object to stick to */ public void stickToRight(GameObject hitbox) { target = hitbox.coordinates; source.x = target.right + 1; source.recalculate(); } /** * Changes current direction and bounces off the target coordinate data * * @param hitbox the other game object to stick to */ public void bounceOff(GameObject hitbox) { stickTo(hitbox); if (numberOfDirections == Directions.TWO_DIRECTIONS || numberOfDirections == Directions.FOUR_DIRECTIONS) { if (source.direction == Directions.LEFT) source.direction = Directions.RIGHT; else if (source.direction == Directions.RIGHT) source.direction = Directions.LEFT; else if (source.direction == Directions.UP) source.direction = Directions.DOWN; else if (source.direction == Directions.DOWN) source.direction = Directions.UP; } else if (numberOfDirections == Directions.EIGHT_DIRECTIONS) { if (source.direction == Directions.NORTH) source.direction = Directions.SOUTH; else if (source.direction == Directions.SOUTH) source.direction = Directions.NORTH; else if (source.direction == Directions.EAST) source.direction = Directions.WEST; else if (source.direction == Directions.WEST) source.direction = Directions.EAST; else if (source.direction == Directions.NORTH_EAST) { if (detector.isBelow(hitbox)) source.direction = Directions.SOUTH_EAST; else if (detector.isLeftOf(hitbox)) source.direction = Directions.NORTH_WEST; } else if (source.direction == Directions.SOUTH_EAST) { if (detector.isAbove(hitbox)) source.direction = Directions.NORTH_EAST; else if (detector.isLeftOf(hitbox)) source.direction = Directions.SOUTH_WEST; } else if (source.direction == Directions.SOUTH_WEST) { if (detector.isAbove(hitbox)) source.direction = Directions.NORTH_WEST; else if (detector.isRightOf(hitbox)) source.direction = Directions.SOUTH_EAST; } else if (source.direction == Directions.NORTH_WEST) { if (detector.isBelow(hitbox)) source.direction = Directions.SOUTH_WEST; else if (detector.isRightOf(hitbox)) source.direction = Directions.NORTH_EAST; } } } /** * Puts this object's position in the middle both horizontally and * vertically to the target * * @param hitbox the other game object to stick to */ public void centerOn(GameObject hitbox) { target = hitbox.coordinates; if (target.width > source.width) source.x = target.centerX - (source.width / 2); else if (source.width > target.width) source.x = target.centerX + (source.width / 2); if (target.height > source.height) source.y = target.centerY - (source.height / 2); else if (source.height > target.height) source.y = target.centerY + (source.height / 2); source.recalculate(); } /** * Centers this object's position in the center and above the top of * the target * * @param hitbox the other game object to stick to */ public void centerOnTop(GameObject hitbox) { target = hitbox.coordinates; centerOn(hitbox); source.y = target.top - source.height - 1; source.recalculate(); } /** * Centers this object's position in the center and below the bottom of * the target * * @param hitbox the other game object to stick to */ public void centerOnBottom(GameObject hitbox) { target = hitbox.coordinates; centerOn(hitbox); source.y = target.bottom + 1; source.recalculate(); } /** * Centers this object's position in the center and to the left of the * target * * @param hitbox the other game object to stick to */ public void centerOnLeft(GameObject hitbox) { target = hitbox.coordinates; centerOn(hitbox); source.x = target.left - source.width - 1; source.recalculate(); } /** * Centers this object's position in the center and to the right of the * target * * @param hitbox the other game object to stick to */ public void centerOnRight(GameObject hitbox) { target = hitbox.coordinates; centerOn(hitbox); source.x = target.right + 1; source.recalculate(); } }
[ "mrLWachs@gmail.com" ]
mrLWachs@gmail.com
48837531103820c3150e4d3251665440235f9eaf
e1a83f768c43886877182b70ba5914068f48efcf
/app/src/main/java/com/yitahutu/cn/wxapi/AppRegister.java
07ba209058ceff6aa1f27be535f7ce0830685af1
[]
no_license
MrChangc/Yitahutu
5480efd699f2dfb6b4c01bff605e9234ea4ae4cf
628756f9719f546cd028d1ac0c47799ca7b25479
refs/heads/master
2021-09-15T02:06:48.138706
2018-05-24T02:08:59
2018-05-24T02:08:59
110,082,902
0
0
null
null
null
null
UTF-8
Java
false
false
512
java
package com.yitahutu.cn.wxapi; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.tencent.mm.opensdk.openapi.IWXAPI; import com.tencent.mm.opensdk.openapi.WXAPIFactory; public class AppRegister extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { final IWXAPI msgApi = WXAPIFactory.createWXAPI(context, null); // ����appע�ᵽ΢�� msgApi.registerApp("wx4bd3c0ec831f0b78"); } }
[ "15003459671@163.com" ]
15003459671@163.com
7242fe5bdeda51b1dfa15aa8e6e4b197f8e2c0c1
25d6db7b451c2ba1f9af5cfdc9e6be81995ca71b
/monitrack-commons/src/main/java/com/monitrack/enumeration/RequestSender.java
95490ca1f9cbcb3c2df3560c61e69ef3d02955cc
[]
no_license
KONE-Yaya/monitrack
e8c05b6ac8ba2597323eaf27d0930b169dd1ac4f
09343d2d74accd5b27651d0eb63dfd08d8509f1b
refs/heads/master
2023-02-18T16:41:35.562905
2019-05-14T16:07:53
2019-05-14T16:07:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
387
java
package com.monitrack.enumeration; public enum RequestSender { CLIENT, CLIENT_FOR_SENSOR_STATE, CLIENT_FOR_ACTIVE_SENSOR, SENSOR; public static RequestSender getValueOf(String sender) { RequestSender[] values = RequestSender.values(); for(RequestSender value : values) { if(value.toString().equalsIgnoreCase(sender)) return value; } return null; } }
[ "cheikna.dansoko@etu.u-pec.fr" ]
cheikna.dansoko@etu.u-pec.fr
e689e2a9e1b2ba98f9f3a302fca5155b913a6f75
686eb567137c9f4232d3b3bd68255c41ba4e890d
/src/main/java/com/example/review/config/WebSecurityConfig.java
fe00e6f4be310cf3828ee99499188c1ee03f1902
[]
no_license
tareksfouda/simple-spring-boot-app
a2500cdec8930c442bba4414873c0eed55e7667b
31f68f6735396728d269bb316ddd504713a59cc5
refs/heads/master
2020-05-25T14:38:05.165996
2019-05-21T14:05:59
2019-05-21T14:05:59
187,849,518
0
0
null
null
null
null
UTF-8
Java
false
false
1,977
java
package com.example.review.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.crypto.password.PasswordEncoder; @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private UserDetailsService customUserDetailsService; @Autowired private PasswordEncoder passwordEncoder; @Autowired public void configureGlobal(final AuthenticationManagerBuilder auth) throws Exception { auth .userDetailsService(customUserDetailsService) .passwordEncoder(passwordEncoder); } @Override public void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/oauth/token").permitAll() .anyRequest().authenticated() .and() .httpBasic() .and() .csrf().disable(); } /** * See: https://github.com/spring-projects/spring-boot/issues/11136 * * @return * @throws Exception */ @Bean @Override public AuthenticationManager authenticationManagerBean() throws Exception { return super.authenticationManagerBean(); } }
[ "tareksfouda@gmail.com" ]
tareksfouda@gmail.com
0488013c984aca2f92bcb464b8d6fcab973fd279
fb4da55f1bb05481a7e512345929d25328e46e36
/ChatNow/app/src/main/java/com/jin10/chatnow/Chat.java
281a370e81a097482fa4ea7d605d5b48a5bd4171
[]
no_license
jinesh1077/RecorderApp
a88e0e480d21953aed032dc82d9aacb80bdb486e
b78dc5de3642cb655166f077793c5a783c6d6b40
refs/heads/master
2020-05-24T13:00:14.837805
2019-05-17T21:04:28
2019-05-17T21:04:28
187,280,257
0
0
null
null
null
null
UTF-8
Java
false
false
759
java
package com.jin10.chatnow; public class Chat { private String sender; private String receiver; private String message; public Chat(String _sender,String _receiver,String _message){ sender=_sender; receiver=_receiver; message=_message; } public Chat() { } public String getSender() { return sender; } public void setSender(String sender) { this.sender = sender; } public String getReceiver() { return receiver; } public void setReceiver(String receiver) { this.receiver = receiver; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
[ "jinesh1077@gmail.com" ]
jinesh1077@gmail.com
7dc2d400cb8e4941ed66f2bf4309d074aba61f1a
cc4eb6bf0f4b29a9acfd83918eaf24304476952f
/src/main/java/stu/learning/service/products/services/PriceChangeService.java
294c9f0a1c339ffd2a2c80cd34f5ccae7d4f8dd6
[]
no_license
Stu-P/products-service
694aa8c0f2d62aeb5b5b301ec5fea7bcfef0f55d
97558adccb2f77ee40bce4dff44b846d0aea3145
refs/heads/master
2022-12-03T13:50:16.636648
2020-08-26T05:36:57
2020-08-26T05:36:57
288,311,241
0
0
null
null
null
null
UTF-8
Java
false
false
2,700
java
package stu.learning.service.products.services; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.Instant; import java.util.*; import stu.learning.service.products.entities.Product; import stu.learning.service.products.events.PriceChangedEvent; import stu.learning.service.products.persistence.IProductsRepository; @Service public class PriceChangeService implements CommandLineRunner { Logger logger = LoggerFactory.getLogger(PriceChangeService.class); private final IProductsRepository repo; private final IEventPublisher publisher; private final FeatureFlagProvider flags; private final Random randomGen; private List<Product> products; @Autowired public PriceChangeService( IProductsRepository repo, FeatureFlagProvider flags, @Qualifier("kafka") IEventPublisher publisher ) { this.repo = repo; this.flags = flags; this.publisher = publisher; this.randomGen = new Random(); } @Override public void run(String... args) throws Exception { // get all products products = repo.findAll(); Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { products = repo.findAll(); } }, 1 * 60 * 1000, 1 * 60 * 1000); while (true) { boolean isEnabled = flags.isPricePublishEnabled(); if (isEnabled) { for (Product p : products) { try { var event = new PriceChangedEvent( UUID.randomUUID(), Instant.now(), p.getId(), generateNewPrice()); logger.info("publish price change *** product: {} | price: {}", event.getProductId(), event.getNewPrice()); publisher.Publish(event); } catch (Exception ex) { logger.error("error publishing {} | {}", ex.getMessage(), ex.getCause()); } } } // Thread.sleep(0); } } private BigDecimal generateNewPrice() { return new BigDecimal(randomGen.nextDouble() * 100).setScale(2, RoundingMode.HALF_EVEN); } }
[ "stuartparton@gmail.com" ]
stuartparton@gmail.com
833f4363b65c7aa44fc0486667916dc0a7177b64
722a98119e564db7383470d4b49273a517e90a1a
/src/snap/util/Node.java
1985a36b64b8cd817513e2b22f7fb519e23bd2a4
[]
no_license
BEAST2-Dev/SNAPP
52f3c3b21e9e5777ac94a72370371d3e0363da38
4261c543727c061b1a56a500cee0dc1fa6a34616
refs/heads/master
2023-06-01T17:42:05.212989
2023-05-22T00:12:26
2023-05-22T00:12:26
32,816,326
4
10
null
2022-12-14T01:37:56
2015-03-24T18:12:35
Java
UTF-8
Java
false
false
8,556
java
package snap.util; import java.text.DecimalFormat; import java.util.Vector; /** class for nodes in building tree data structure **/ public class Node { /** length of branch in the tree **/ public float m_fLength = -1; /** height of the node. This is a derived variable from m_fLength **/ //float m_fHeight = -1; /** x & y coordinate of node **/ public float m_fPosX = 0; public float m_fPosY = 0; /** label nr of node, only used when this is a leaf **/ public int m_iLabel; public int getNr() {return m_iLabel;} /** metadata contained in square brackers in Newick **/ public String m_sMetaData; /** user data generated by other applications (e.g. DensiTreeG)**/ public Object m_data = null; /** list of children of this node **/ public Node m_left; public Node m_right; //Node[] m_children; /** parent node in the tree, null if root **/ Node m_Parent = null; /** return parent node, or null if this is root **/ public Node getParent() { return m_Parent; } public void setParent(Node parent) { m_Parent = parent; } /** check if current node is root node **/ public boolean isRoot() { return m_Parent == null; } /** check if current node is a leaf node **/ public boolean isLeaf() { return m_left == null; } /** count number of nodes in tree, starting with current node **/ int getNodeCount() { if (isLeaf()) { return 1; } return 1 + m_left.getNodeCount() + m_right.getNodeCount(); } /** * print tree in Newick format, without any length or meta data * information **/ public String toShortNewick() { StringBuffer buf = new StringBuffer(); if (m_left != null) { buf.append("("); buf.append(m_left.toShortNewick()); buf.append(','); buf.append(m_right.toShortNewick()); buf.append(")"); } else { buf.append(m_iLabel); } return buf.toString(); } /** * print tree in long Newick format, with all length and meta data * information **/ public String toNewick() { StringBuffer buf = new StringBuffer(); if (m_left != null) { buf.append("("); buf.append(m_left.toNewick()); buf.append(','); buf.append(m_right.toNewick()); buf.append(")"); } else { buf.append(m_iLabel); } if (m_sMetaData != null) { buf.append('['); buf.append(m_sMetaData); buf.append(']'); } buf.append(":" + m_fLength); return buf.toString(); } /** * print tree in long Newick format, with position meta data * information **/ public String toNewickWithPos(double fMinLat, double fMaxLat, double fMinLong) { StringBuffer buf = new StringBuffer(); if (m_left != null) { buf.append("("); buf.append(m_left.toNewickWithPos(fMinLat, fMaxLat, fMinLong)); buf.append(','); buf.append(m_right.toNewickWithPos(fMinLat, fMaxLat, fMinLong)); buf.append(")"); } else { buf.append(m_iLabel); } buf.append("[pos="); DecimalFormat df = new DecimalFormat("#.##"); buf.append(df.format(toLongitude(m_fPosX, fMinLat, fMaxLat)) + "x" + df.format(toLatitude(m_fPosY, fMinLong))); buf.append(']'); buf.append(":" + m_fLength); return buf.toString(); } double toLongitude(double fPosX, double fMinLat, double fMaxLat) { return fMaxLat - fPosX + (fMaxLat-fMinLat) / 100.0f; } double toLatitude(double fPosY, double fMinLong) { return fPosY + fMinLong; } /** * print tree in long Newick format, with all length and meta data * information, but with leafs labelled with their names **/ public String toString(Vector<String> sLabels) { StringBuffer buf = new StringBuffer(); if (m_left != null) { buf.append("("); buf.append(m_left.toString(sLabels)); buf.append(','); buf.append(m_right.toString(sLabels)); buf.append(")"); } else { if (sLabels == null) { buf.append(m_iLabel); } else { buf.append(sLabels.elementAt(m_iLabel)); } } if (sLabels != null) { if (m_sMetaData != null) { buf.append('['); buf.append(m_sMetaData); buf.append(']'); } buf.append(":" + m_fLength); } return buf.toString(); } public String toString() { return toNewick(); } /** * 'draw' tree into an array of x & positions. This draws the tree as * block diagram. * * @param nX * @param nY * @param iPos * @return */ public int drawDry(float[] nX, float[] nY, int iPos, boolean[] bNeedsDrawing, boolean [] bSelection, float fOffset, float fScale) { if (isLeaf()) { bNeedsDrawing[0] = bSelection[m_iLabel]; } else { boolean[] bChildNeedsDrawing = new boolean[2]; iPos = m_left.drawDry(nX, nY, iPos, bNeedsDrawing, bSelection, fOffset, fScale); bChildNeedsDrawing[0] = bNeedsDrawing[0]; iPos = m_right.drawDry(nX, nY, iPos, bNeedsDrawing, bSelection, fOffset, fScale); bChildNeedsDrawing[1] = bNeedsDrawing[0]; bNeedsDrawing[0] = false; if (bChildNeedsDrawing[0]) { nX[iPos] = m_left.m_fPosX; nY[iPos] = (m_left.m_fPosY - fOffset) * fScale; iPos++; nX[iPos] = nX[iPos - 1]; nY[iPos] = (m_fPosY - fOffset) * fScale; bNeedsDrawing[0] = true; } else { nX[iPos] = m_fPosX; nY[iPos] = (m_fPosY - fOffset) * fScale; iPos++; nX[iPos] = m_fPosX; nY[iPos] = (m_fPosY - fOffset) * fScale; } iPos++; if (bChildNeedsDrawing[1]) { nX[iPos] = m_right.m_fPosX; nY[iPos] = nY[iPos - 1]; iPos++; nX[iPos] = nX[iPos - 1]; nY[iPos] = (m_right.m_fPosY - fOffset) * fScale; bNeedsDrawing[0] = true; } else { nX[iPos] = m_fPosX; nY[iPos] = (m_fPosY - fOffset) * fScale; iPos++; nX[iPos] = m_fPosX; nY[iPos] = (m_fPosY - fOffset) * fScale; } iPos++; if (isRoot()) { nX[iPos] = m_fPosX; nY[iPos] = (m_fPosY - fOffset) * fScale; iPos++; nX[iPos] = m_fPosX; nY[iPos] = (m_fPosY - m_fLength - fOffset) * fScale; iPos++; } } return iPos; } // /** // * 'draw' tree into an array of x & positions. This draws the tree using // * triangles // * // * @param nX // * @param nY // * @param iPos // * @return // */ // public int drawDryTriangle(float[] nX, float[] nY, int iPos, boolean[] bNeedsDrawing, boolean [] bSelection) { // if (isLeaf()) { // bNeedsDrawing[0] = bSelection[m_iLabel]; // } else { // boolean[] bChildNeedsDrawing = new boolean[2]; // iPos = m_left.drawDryTriangle(nX, nY, iPos, bNeedsDrawing, bSelection); // bChildNeedsDrawing[0] = bNeedsDrawing[0]; // iPos = m_right.drawDryTriangle(nX, nY, iPos, bNeedsDrawing, bSelection); // bChildNeedsDrawing[1] = bNeedsDrawing[0]; // bNeedsDrawing[0] = false; // if (bChildNeedsDrawing[0]) { // nX[iPos] = m_left.m_fPosX; // nY[iPos] = m_left.m_fPosY; // bNeedsDrawing[0] = true; // } else { // nX[iPos] = m_fPosX; // nY[iPos] = m_fPosY; // } // iPos++; // nX[iPos] = m_fPosX; // nY[iPos] = m_fPosY; // iPos++; // if (bChildNeedsDrawing[1]) { // nX[iPos] = m_right.m_fPosX; // nY[iPos] = m_right.m_fPosY; // bNeedsDrawing[0] = true; // } else { // nX[iPos] = m_fPosX; // nY[iPos] = m_fPosY; // } // iPos++; // } // if (isRoot()) { // nX[iPos] = m_fPosX; // nY[iPos] = m_fPosY; // iPos++; // nX[iPos] = m_fPosX; // nY[iPos] = m_fPosY - m_fLength; // iPos++; // } // return iPos; // } /** * sorts nodes in children according to lowest numbered label in subtree **/ int sort() { if (m_left != null) { int iChild1 = m_left.sort(); int iChild2 = m_right.sort(); if (iChild1 > iChild2) { Node tmp = m_left; m_left = m_right; m_right = tmp; return iChild2; } return iChild1; } // this is a leaf node, just return the label nr return m_iLabel; } // sort /** during parsing, leaf nodes are numbered 0...m_nNrOfLabels-1 * but internal nodes are left to zero. After labeling internal * nodes, m_iLabel uniquely identifies a node in a tree. */ int labelInternalNodes(int iLabel) { if (isLeaf()) { return iLabel; } else { iLabel = m_left.labelInternalNodes(iLabel); iLabel = m_right.labelInternalNodes(iLabel); m_iLabel = iLabel++; } return iLabel; } // labelInternalNodes /** create deep copy **/ Node copy() { Node node = new Node(); node.m_fLength = m_fLength; node.m_fPosX = m_fPosX; node.m_fPosY = m_fPosY; node.m_iLabel = m_iLabel; node.m_sMetaData = m_sMetaData; node.m_Parent = null; if (m_left != null) { node.m_left = m_left.copy(); node.m_right = m_right.copy(); node.m_left.m_Parent = node; node.m_right.m_Parent = node; } return node; } // copy } // class Node
[ "rbouckaert@users.noreply.github.com" ]
rbouckaert@users.noreply.github.com
7e7ff9031d02f455db52c951dab802c32ae575e7
7935cc5c2cb800debf057e3520e03c50fa6f5c75
/app/src/main/java/com/glens/jksd/bean/repair_task_bean/RepairGroundBean.java
235866374bc51eb4ee162febe32279591797558e
[]
no_license
hetaoyuan-android/jksd_code
c46b90535cf5d7736dd7bf96d9d4c942ce60a558
440fdca9b075f2451657e0471a5c1eba13bb1673
refs/heads/master
2020-06-16T05:22:29.351060
2019-07-06T02:45:16
2019-07-06T02:45:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,190
java
package com.glens.jksd.bean.repair_task_bean; import java.util.List; /** * Created by wkc on 2019/6/20. */ public class RepairGroundBean { /** * total : 1 * records : [{"checkTime":"2019-06-05 17:55","checker":"王斌","createTime":"2019-06-05 17:46","demolitionPerson":"王斌","demolitionTime":"2019-06-05 17:56","fixPerson":"王斌","fixTime":"2019-06-05 17:55","groudWireName":"20190605174601","groudWireType":5,"recordCode":"17769947a7274099bc5b2b8c9c21ea2f","returnTime":"2019-06-05 17:57","returner":"王斌","takedTime":"2019-06-05 17:46","takenPerson":"王斌","taskCode":"1"}] */ private int total; private List<RecordsBean> records; public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public List<RecordsBean> getRecords() { return records; } public void setRecords(List<RecordsBean> records) { this.records = records; } public static class RecordsBean { /** * checkTime : 2019-06-05 17:55 * checker : 王斌 * createTime : 2019-06-05 17:46 * demolitionPerson : 王斌 * demolitionTime : 2019-06-05 17:56 * fixPerson : 王斌 * fixTime : 2019-06-05 17:55 * groudWireName : 20190605174601 * groudWireType : 5 * recordCode : 17769947a7274099bc5b2b8c9c21ea2f * returnTime : 2019-06-05 17:57 * returner : 王斌 * takedTime : 2019-06-05 17:46 * takenPerson : 王斌 * taskCode : 1 */ private String checkTime; private String checker; private String createTime; private String demolitionPerson; private String demolitionTime; private String fixPerson; private String fixTime; private String groudWireName; private int groudWireType; private String recordCode; private String returnTime; private String returner; private String takedTime; private String takenPerson; private String taskCode; public String getCheckTime() { return checkTime; } public void setCheckTime(String checkTime) { this.checkTime = checkTime; } public String getChecker() { return checker; } public void setChecker(String checker) { this.checker = checker; } public String getCreateTime() { return createTime; } public void setCreateTime(String createTime) { this.createTime = createTime; } public String getDemolitionPerson() { return demolitionPerson; } public void setDemolitionPerson(String demolitionPerson) { this.demolitionPerson = demolitionPerson; } public String getDemolitionTime() { return demolitionTime; } public void setDemolitionTime(String demolitionTime) { this.demolitionTime = demolitionTime; } public String getFixPerson() { return fixPerson; } public void setFixPerson(String fixPerson) { this.fixPerson = fixPerson; } public String getFixTime() { return fixTime; } public void setFixTime(String fixTime) { this.fixTime = fixTime; } public String getGroudWireName() { return groudWireName; } public void setGroudWireName(String groudWireName) { this.groudWireName = groudWireName; } public int getGroudWireType() { return groudWireType; } public void setGroudWireType(int groudWireType) { this.groudWireType = groudWireType; } public String getRecordCode() { return recordCode; } public void setRecordCode(String recordCode) { this.recordCode = recordCode; } public String getReturnTime() { return returnTime; } public void setReturnTime(String returnTime) { this.returnTime = returnTime; } public String getReturner() { return returner; } public void setReturner(String returner) { this.returner = returner; } public String getTakedTime() { return takedTime; } public void setTakedTime(String takedTime) { this.takedTime = takedTime; } public String getTakenPerson() { return takenPerson; } public void setTakenPerson(String takenPerson) { this.takenPerson = takenPerson; } public String getTaskCode() { return taskCode; } public void setTaskCode(String taskCode) { this.taskCode = taskCode; } @Override public String toString() { return "RecordsBean{" + "checkTime='" + checkTime + '\'' + ", checker='" + checker + '\'' + ", createTime='" + createTime + '\'' + ", demolitionPerson='" + demolitionPerson + '\'' + ", demolitionTime='" + demolitionTime + '\'' + ", fixPerson='" + fixPerson + '\'' + ", fixTime='" + fixTime + '\'' + ", groudWireName='" + groudWireName + '\'' + ", groudWireType=" + groudWireType + ", recordCode='" + recordCode + '\'' + ", returnTime='" + returnTime + '\'' + ", returner='" + returner + '\'' + ", takedTime='" + takedTime + '\'' + ", takenPerson='" + takenPerson + '\'' + ", taskCode='" + taskCode + '\'' + '}'; } } @Override public String toString() { return "RepairGroundBean{" + "total=" + total + ", records=" + records + '}'; } }
[ "183023376@qq.com" ]
183023376@qq.com
1fe137ce1dc519a6003edf9594e299f9c614b492
801ea23bf1e788dee7047584c5c26d99a4d0b2e3
/com/planet_ink/coffee_mud/Libraries/layouts/AbstractLayout.java
be8132b6ee69c1a67996eab136c61a610672975f
[ "Apache-2.0" ]
permissive
Tearstar/CoffeeMud
61136965ccda651ff50d416b6c6af7e9a89f5784
bb1687575f7166fb8418684c45f431411497cef9
refs/heads/master
2021-01-17T20:23:57.161495
2014-10-18T08:03:37
2014-10-18T08:03:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,293
java
package com.planet_ink.coffee_mud.Libraries.layouts; import java.util.*; import com.planet_ink.coffee_mud.core.CMStrings; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.AreaGenerationLibrary.LayoutNode; import com.planet_ink.coffee_mud.Libraries.interfaces.AreaGenerationLibrary.*; import com.planet_ink.coffee_mud.core.Directions; /* Copyright 2007-2014 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * Abstract area layout pattern * node tags: * nodetype: surround, leaf, offleaf, street, square, interior * nodeexits: n,s,e,w, n,s, e,w, n,e,w, etc * nodeflags: corner, gate, intersection, tee * NODEGATEEXIT: (for gate, offleaf, square): n s e w etc * noderun: (for surround, street): n,s e,w * * @author Bo Zimmerman */ public abstract class AbstractLayout implements LayoutManager { Random r = new Random(); public int diff(int width, int height, int num) { final int x = width * height; return (x<num) ? (num - x) : (x - num); } @Override public abstract String name(); @Override public abstract List<LayoutNode> generate(int num, int dir); public static int getDirection(LayoutNode from, LayoutNode to) { if(to.coord()[1]<from.coord()[1]) return Directions.NORTH; if(to.coord()[1]>from.coord()[1]) return Directions.SOUTH; if(to.coord()[0]<from.coord()[0]) return Directions.WEST; if(to.coord()[0]>from.coord()[0]) return Directions.EAST; return -1; } public static LayoutRuns getRunDirection(int dirCode) { switch(dirCode) { case Directions.NORTH: case Directions.SOUTH: return LayoutRuns.ns; case Directions.EAST: case Directions.WEST: return LayoutRuns.ew; } return LayoutRuns.ns; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
8dde175778e8dcc9aa13eb0722a28f0f405c4c04
0f9b55bd76a9dca62a720788ed43bbdc710a065e
/hardware1112/src/main/java/com/controller/SoilphController.java
3f67dc0eaa9758fe972ce25f7ce267352f0a2095
[]
no_license
Oceantears/IntelIDEAwork
9559da89b6d5769bbd8ef40468a7f31f8539138c
ab74382b4fb9e16e24ac635275d47902bae45e7c
refs/heads/master
2022-12-22T11:03:19.488413
2021-08-26T14:57:49
2021-08-26T14:57:49
208,036,056
0
0
null
2022-12-16T00:35:11
2019-09-12T11:32:58
JavaScript
UTF-8
Java
false
false
2,325
java
package com.controller; import com.bean.Soilph; import com.google.gson.JsonArray; import com.google.gson.JsonParser; import com.interfaces.AirpressureInterface; import com.interfaces.SoilphInterface; import com.mapper.QxpreMapper; import com.mapper.SoilphMapper; import com.utils.InterfacesUtils; import net.sf.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.List; public class SoilphController { private static final Logger log = LoggerFactory.getLogger(SoilphController.class); public static void dop(ArrayList<String> array, Soilph soilph, SoilphMapper SoilphMapper, QxpreMapper qxpreMapper) throws IOException { array = InterfacesUtils.dop(qxpreMapper); //进行设备SN迭代 for (String s : array) { System.out.println(s); //调用风速工具类 List<String> aa = SoilphInterface.dop(s, qxpreMapper); for (String a : aa) { //接受json data数组 JSONObject jb = JSONObject.fromObject(a); //进行主体信息判断是否存在data if (jb.containsKey("data")) { //data数组 JsonArray userArray = new JsonParser().parse(a).getAsJsonObject().get("data").getAsJsonArray(); for (int i = 0; i < userArray.size(); i++) { soilph.setKEYID(SoilphMapper.idPlusSoilph()); Date date = new Date(System.currentTimeMillis()+28800000); soilph.setSO_DATE(date); soilph.setSOILPH(userArray.get(i).getAsJsonObject().get("value").getAsDouble()); soilph.setSN(s); //执行数据存入操作 SoilphMapper.insertSoilph(soilph); log.info("土壤ph数据入库成功===-----"); } }else{ /*soilph.setKEYID(SoilphMapper.idPlusSoilph()); soilph.setSO_DATE(null); soilph.setSN(s); soilph.setSOILPH(0); SoilphMapper.insertSoilph(soilph); */ continue; } } } } }
[ "44494020+Oceantears@users.noreply.github.com" ]
44494020+Oceantears@users.noreply.github.com
4c7a23a450826647a7f241e26f2a11855e042511
5a11ad4d2c044cd9e290bbcd8581f13a54ad1090
/zimuapi/src/main/java/com/zimu/my2018/quyouapi/data/scenic/scenicattention/ScenicFocalBean.java
edcc63daa2529a616460a83139307fbcfb26ceff
[]
no_license
zimuL/myProject
d979dd66908308e098269c3acc1ec1305629d707
7be94e24462e25541e4bc9dfec00e66f3e05a548
refs/heads/master
2020-03-19T07:36:07.845713
2018-12-05T07:55:26
2018-12-05T07:55:26
136,129,804
0
0
null
null
null
null
UTF-8
Java
false
false
793
java
package com.zimu.my2018.quyouapi.data.scenic.scenicattention; import java.io.Serializable; /** * 功能: * 描述: * Created by hxl on 2018/10/26 */ public class ScenicFocalBean implements Serializable { private int scenic_id; private int user_id; private long focus_time; public int getScenic_id() { return scenic_id; } public void setScenic_id(int scenic_id) { this.scenic_id = scenic_id; } public int getUser_id() { return user_id; } public void setUser_id(int user_id) { this.user_id = user_id; } public long getFocus_time() { return focus_time; } public void setFocus_time(long focus_time) { this.focus_time = focus_time; } }
[ "2799081971@qq.com" ]
2799081971@qq.com
191deb09d72f06886cc6c058be5a5b6c6c935e24
438023f985c56bbbef6bc5994101c7bde4b2d3c8
/src/test/TestChi.java
2515ef98bce3c346ef03e251edfdbcc3a986d501
[]
no_license
DiegoBuitrago/Taller13
93a6fc5fe666cf6da10919a53599a02b4f938520
f4b0e92868cc64c3599c6e06ef200cefa672e3bd
refs/heads/master
2023-01-24T00:29:40.561140
2020-12-03T03:41:42
2020-12-03T03:41:42
315,823,600
0
0
null
null
null
null
UTF-8
Java
false
false
1,303
java
package test; import methodsTest.Chi; import models.Intro; import models.LineChiTest; import java.util.ArrayList; public class TestChi { public static void main(String[] args) { p1(); } private static void p1(){ ArrayList<Intro> list = new ArrayList<Intro>(); list.add(new Intro(0.1214)); list.add(new Intro(0.4267)); list.add(new Intro(0.1379)); list.add(new Intro(0.7385)); list.add(new Intro(0.8432)); list.add(new Intro(0.5801)); list.add(new Intro(0.0100)); list.add(new Intro(0.3703)); list.add(new Intro(0.7205)); list.add(new Intro(0.5427)); list.add(new Intro(0.3795)); list.add(new Intro(0.7389)); list.add(new Intro(0.1266)); list.add(new Intro(0.6429)); list.add(new Intro(0.8298)); int numIntervalos = 8; Chi chi = new Chi(list, numIntervalos); ArrayList<LineChiTest> lines = chi.getLines(); for (int i=0;i<lines.size();i++) { System.out.println(lines.get(i).toString()); } System.out.println(chi.getTotalChi2()); System.out.println(chi.getLibertyGrade()); System.out.println(chi.getDistributionChi()); System.out.println(chi.isResult()); } }
[ "alejobq@hotmail.com" ]
alejobq@hotmail.com
fb5324ed8bf476baaf25771e225a5d75f4bfcac5
d17c2ff5922b71dbfd1a330d11ec004c595afab1
/src/main/java/br/com/rodolfocugler/dtos/ResponseDTO.java
8718f0b6132200d25669fb4e5f81bd82adb92b37
[]
no_license
rodolfocugler/radioactive-game
25138d55619a401005b034870d676ad81227e0a9
ad66a1b952750baf518bd6eccb03f181e2c88955
refs/heads/main
2023-03-02T16:41:37.314217
2021-02-07T11:24:13
2021-02-07T11:24:13
323,475,624
0
0
null
null
null
null
UTF-8
Java
false
false
226
java
package br.com.rodolfocugler.dtos; import lombok.*; @Builder @Getter @Setter @AllArgsConstructor @NoArgsConstructor public class ResponseDTO { private String account; private String response; private long timestamp; }
[ "rodolfocugler@outlook.com" ]
rodolfocugler@outlook.com
0befa26e5542c1feff5e71e9db25a32c8ee86e7e
4c99fa62a3079504ca7a6cd74e06eb5cf2946aa3
/lib/Excel/src/testcases/org/apache/poi/ss/formula/functions/TestEDate.java
96cc31c1becbc1ba511556ae175143027a7e7371
[]
no_license
chenyurong/XINPINHUIV
68d9a77fe80389fb41d1d303a365e12095fb1973
6d5dee74235600c76841a1acf366a5d7f7fc4f2c
refs/heads/master
2021-05-30T20:01:34.634555
2016-03-25T09:11:35
2016-03-25T09:11:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,987
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.poi.ss.formula.functions; import junit.framework.TestCase; import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.ss.usermodel.ErrorConstants; import java.util.Calendar; import java.util.Date; public class TestEDate extends TestCase{ public void testEDateProperValues() { EDate eDate = new EDate(); NumberEval result = (NumberEval) eDate.evaluate(new ValueEval[]{new NumberEval(1000), new NumberEval(0)}, null); assertEquals(1000d, result.getNumberValue()); } public void testEDateInvalidValues() { EDate eDate = new EDate(); ErrorEval result = (ErrorEval) eDate.evaluate(new ValueEval[]{new NumberEval(1000)}, null); assertEquals(ErrorConstants.ERROR_VALUE, result.getErrorCode()); } public void testEDateIncrease() { EDate eDate = new EDate(); Date startDate = new Date(); int offset = 2; NumberEval result = (NumberEval) eDate.evaluate(new ValueEval[]{new NumberEval(DateUtil.getExcelDate(startDate)), new NumberEval(offset)}, null); Date resultDate = DateUtil.getJavaDate(result.getNumberValue()); Calendar instance = Calendar.getInstance(); instance.setTime(startDate); instance.add(Calendar.MONTH, offset); assertEquals(resultDate, instance.getTime()); } public void testEDateDecrease() { EDate eDate = new EDate(); Date startDate = new Date(); int offset = -2; NumberEval result = (NumberEval) eDate.evaluate(new ValueEval[]{new NumberEval(DateUtil.getExcelDate(startDate)), new NumberEval(offset)}, null); Date resultDate = DateUtil.getJavaDate(result.getNumberValue()); Calendar instance = Calendar.getInstance(); instance.setTime(startDate); instance.add(Calendar.MONTH, offset); assertEquals(resultDate, instance.getTime()); } }
[ "573413672@qq.com" ]
573413672@qq.com
78a019ad080c151630d738ebdaec5dcb6a5a5b05
b8683adbe20ccb78884bd7bba2e5a5f22553ef24
/src/main/java/uk/co/jemos/podam/typeManufacturers/FloatTypeManufacturerImpl.java
59a96cec0e27f7764fb374b78b3e61d0684bbcd8
[ "MIT" ]
permissive
jmhanna/podam
edd55b3297406061a08e4577a450b5dc56c87e49
e256e415db08940de0df3b3fbdf01ec6548cbae4
refs/heads/master
2022-07-22T11:26:58.317090
2016-07-02T15:57:53
2016-07-02T15:57:53
62,456,982
0
0
MIT
2022-07-07T22:43:38
2016-07-02T15:22:29
Java
UTF-8
Java
false
false
2,447
java
package uk.co.jemos.podam.typeManufacturers; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import uk.co.jemos.podam.api.DataProviderStrategy; import uk.co.jemos.podam.common.PodamConstants; import uk.co.jemos.podam.common.PodamFloatValue; import java.lang.annotation.Annotation; /** * Default float type manufacturer. * * Created by tedonema on 17/05/2015. * * @since 6.0.0.RELEASE */ public class FloatTypeManufacturerImpl extends AbstractTypeManufacturer { /** The application logger */ private static final Logger LOG = LoggerFactory.getLogger(FloatTypeManufacturerImpl.class); /** * {@inheritDoc} */ @Override public Float getType(TypeManufacturerParamsWrapper wrapper) { super.checkWrapperIsValid(wrapper); DataProviderStrategy strategy = wrapper.getDataProviderStrategy(); Float retValue = null; for (Annotation annotation : wrapper.getAttributeMetadata().getAttributeAnnotations()) { if (PodamFloatValue.class.isAssignableFrom(annotation.getClass())) { PodamFloatValue floatStrategy = (PodamFloatValue) annotation; String numValueStr = floatStrategy.numValue(); if (null != numValueStr && !"".equals(numValueStr)) { try { retValue = Float.valueOf(numValueStr); } catch (NumberFormatException nfe) { String errMsg = PodamConstants.THE_ANNOTATION_VALUE_STR + numValueStr + " could not be converted to a Float. An exception will be thrown."; LOG.error(errMsg); throw new IllegalArgumentException(errMsg, nfe); } } else { float minValue = floatStrategy.minValue(); float maxValue = floatStrategy.maxValue(); // Sanity check if (minValue > maxValue) { maxValue = minValue; } retValue = strategy.getFloatInRange(minValue, maxValue, wrapper.getAttributeMetadata()); } break; } } if (retValue == null) { retValue = strategy.getFloat(wrapper.getAttributeMetadata()); } return retValue; } }
[ "marco.tedone@gmail.com" ]
marco.tedone@gmail.com
a0ab78d91e7a3ee4edaf067514ed86680aee5551
72300177cbf06804b025b363d08770abe2e8f8b7
/src/main/java/me/earth/phobos/mixin/mixins/MixinEntityPlayerSP.java
4a945c30316f855397d5cb10aee2a05e9c0620ff
[]
no_license
IceCruelStuff/Phobos-1.9.0-BUILDABLE-SRC
b1f0e5dd8e12d681d3496b556ded70575bc6a331
cabebefe13a9ca747288a0abc1aaa9ff3c49a3fd
refs/heads/main
2023-03-24T18:43:55.223380
2021-03-21T02:05:21
2021-03-21T02:05:21
349,879,386
1
0
null
2021-03-21T02:06:44
2021-03-21T02:05:00
Java
UTF-8
Java
false
false
5,617
java
package me.earth.phobos.mixin.mixins; import me.earth.phobos.Phobos; import me.earth.phobos.event.events.ChatEvent; import me.earth.phobos.event.events.MoveEvent; import me.earth.phobos.event.events.PushEvent; import me.earth.phobos.event.events.UpdateWalkingPlayerEvent; import me.earth.phobos.features.modules.misc.BetterPortals; import me.earth.phobos.features.modules.movement.Speed; import me.earth.phobos.features.modules.movement.Sprint; import me.earth.phobos.util.Util; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.entity.MoverType; import net.minecraft.stats.RecipeBook; import net.minecraft.stats.StatisticsManager; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.Event; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(value={EntityPlayerSP.class}, priority=9998) public abstract class MixinEntityPlayerSP extends AbstractClientPlayer { public MixinEntityPlayerSP(Minecraft p_i47378_1_, World p_i47378_2_, NetHandlerPlayClient p_i47378_3_, StatisticsManager p_i47378_4_, RecipeBook p_i47378_5_) { super(p_i47378_2_, p_i47378_3_.getGameProfile()); } @Inject(method={"sendChatMessage"}, at={@At(value="HEAD")}, cancellable=true) public void sendChatMessage(String message, CallbackInfo callback) { ChatEvent chatEvent = new ChatEvent(message); MinecraftForge.EVENT_BUS.post((Event)chatEvent); } @Redirect(method={"onLivingUpdate"}, at=@At(value="INVOKE", target="Lnet/minecraft/client/entity/EntityPlayerSP;closeScreen()V")) public void closeScreenHook(EntityPlayerSP entityPlayerSP) { if (!BetterPortals.getInstance().isOn() || !BetterPortals.getInstance().portalChat.getValue().booleanValue()) { entityPlayerSP.closeScreen(); } } @Redirect(method={"onLivingUpdate"}, at=@At(value="INVOKE", target="Lnet/minecraft/client/Minecraft;displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V")) public void displayGuiScreenHook(Minecraft mc, GuiScreen screen) { if (!BetterPortals.getInstance().isOn() || !BetterPortals.getInstance().portalChat.getValue().booleanValue()) { mc.displayGuiScreen(screen); } } @Redirect(method={"onLivingUpdate"}, at=@At(value="INVOKE", target="Lnet/minecraft/client/entity/EntityPlayerSP;setSprinting(Z)V", ordinal=2)) public void onLivingUpdate(EntityPlayerSP entityPlayerSP, boolean sprinting) { if (Sprint.getInstance().isOn() && Sprint.getInstance().mode.getValue() == Sprint.Mode.RAGE && (Util.mc.player.movementInput.moveForward != 0.0f || Util.mc.player.movementInput.moveStrafe != 0.0f)) { entityPlayerSP.setSprinting(true); } else { entityPlayerSP.setSprinting(sprinting); } } @Inject(method={"pushOutOfBlocks"}, at={@At(value="HEAD")}, cancellable=true) private void pushOutOfBlocksHook(double x, double y, double z, CallbackInfoReturnable<Boolean> info) { PushEvent event = new PushEvent(1); MinecraftForge.EVENT_BUS.post((Event)event); if (event.isCanceled()) { info.setReturnValue(false); } } @Inject(method={"onUpdateWalkingPlayer"}, at={@At(value="HEAD")}, cancellable=true) private void preMotion(CallbackInfo info) { UpdateWalkingPlayerEvent event = new UpdateWalkingPlayerEvent(0); MinecraftForge.EVENT_BUS.post((Event)event); if (event.isCanceled()) { info.cancel(); } } @Redirect(method={"onUpdateWalkingPlayer"}, at=@At(value="FIELD", target="net/minecraft/util/math/AxisAlignedBB.minY:D")) private double minYHook(AxisAlignedBB bb) { if (Speed.getInstance().isOn() && Speed.getInstance().mode.getValue() == Speed.Mode.VANILLA && Speed.getInstance().changeY) { Speed.getInstance().changeY = false; return Speed.getInstance().minY; } return bb.minY; } @Inject(method={"onUpdateWalkingPlayer"}, at={@At(value="RETURN")}) private void postMotion(CallbackInfo info) { UpdateWalkingPlayerEvent event = new UpdateWalkingPlayerEvent(1); MinecraftForge.EVENT_BUS.post((Event)event); } @Inject(method={"Lnet/minecraft/client/entity/EntityPlayerSP;setServerBrand(Ljava/lang/String;)V"}, at={@At(value="HEAD")}) public void getBrand(String brand, CallbackInfo callbackInfo) { if (Phobos.serverManager != null) { Phobos.serverManager.setServerBrand(brand); } } @Redirect(method={"move"}, at=@At(value="INVOKE", target="Lnet/minecraft/client/entity/AbstractClientPlayer;move(Lnet/minecraft/entity/MoverType;DDD)V")) public void move(AbstractClientPlayer player, MoverType moverType, double x, double y, double z) { MoveEvent event = new MoveEvent(0, moverType, x, y, z); MinecraftForge.EVENT_BUS.post((Event)event); if (!event.isCanceled()) { super.move(event.getType(), event.getX(), event.getY(), event.getZ()); } } }
[ "hqrion@gmail.com" ]
hqrion@gmail.com
274c58398fad4ce3a2cc1fd35a46dcc8d664b559
c9018fc3bac96e82392e78e844cb8d3931d5c188
/_05Hibernate/src/main/java/cn/hibernate/day10Priviliege/Privilege.java
ebf1c8b4aee8c6f8ef96bbb949ecec4c3fc5c5c8
[]
no_license
yufanfan/ssm
43fdc6fa2ba69b8b142046e0c5ea163bf2e4eabd
45f3b8397a08d395eb320f0ec0f0e015edf7d014
refs/heads/master
2021-09-03T00:24:15.728832
2018-01-04T08:56:33
2018-01-04T08:56:34
111,258,592
0
0
null
null
null
null
UTF-8
Java
false
false
812
java
package cn.hibernate.day10Priviliege; import javax.persistence.*; import java.util.HashSet; import java.util.Set; /** * Created by yu fan on 2018/1/4. */ @Entity @Table(name = "PRIVILEGE2") public class Privilege { @Id @GeneratedValue private Integer pid; @Column private String pname; @ManyToMany(mappedBy = "privileges") private Set<Role> roles=new HashSet<Role>(); public Set<Role> getRoles() { return roles; } public void setRoles(Set<Role> roles) { this.roles = roles; } public Integer getPid() { return pid; } public void setPid(Integer pid) { this.pid = pid; } public String getPname() { return pname; } public void setPname(String pname) { this.pname = pname; } }
[ "1915326957@qq.com" ]
1915326957@qq.com
c485471d9ab2ebf3fb09f62ce297e2eeda58bc8f
5b8f0cbd2076b07481bd62f26f5916d09a050127
/src/B1358.java
d92af6a49632539adac8800efc42d7add5cba6d7
[]
no_license
micgogi/micgogi_algo
b45664de40ef59962c87fc2a1ee81f86c5d7c7ba
7cffe8122c04059f241270bf45e033b1b91ba5df
refs/heads/master
2022-07-13T00:00:56.090834
2022-06-15T14:02:51
2022-06-15T14:02:51
209,986,655
7
3
null
2020-10-20T07:41:03
2019-09-21T13:06:43
Java
UTF-8
Java
false
false
976
java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.lang.reflect.Array; import java.util.Arrays; /** * @author Micgogi * on 7/1/2020 5:32 PM * Rahul Gogyani */ public class B1358 { public static void main(String[] args) { try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); while(t--!=0){ int n = Integer.parseInt(br.readLine()); int a[]; String s[] = br.readLine().split(" "); a = Arrays.stream(s).mapToInt(Integer::parseInt).toArray(); Arrays.sort(a); System.out.println(ans(a)); } }catch (Exception e){ } } public static int ans(int a[]){ for (int i = a.length-1; i >=0 ; i--) { if(a[i]<=i+1){ return i+2; } } return 1; } }
[ "rahul.gogyani@gmail.com" ]
rahul.gogyani@gmail.com
33b5d1659d30b5ebddd12e87d298ba925cea9011
d33a195fc7e9d343682b357a4a8a1459936516ea
/src/main/java/com/qa/ExtentReportListener/ExtentReporterNG.java
8bcfd913968d1e88cc3c6bb4252c7209be6bcd2a
[]
no_license
sumantug/GitDemo
2feb55f57b426e21f4187da75a041e23058f0643
2786de8f4603725b7a9e35ba857dcffa5ff740db
refs/heads/master
2023-08-18T21:16:00.438423
2021-10-11T11:10:12
2021-10-11T11:10:12
415,494,834
0
0
null
null
null
null
UTF-8
Java
false
false
2,043
java
package com.qa.ExtentReportListener; import java.util.List; import org.testng.IReporter; import java.io.File; import java.util.Calendar; import java.util.Date; import java.util.Map; import org.testng.IResultMap; import org.testng.ISuite; import org.testng.ISuiteResult; import org.testng.ITestContext; import org.testng.ITestResult; import org.testng.xml.XmlSuite; import com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.ExtentTest; import com.relevantcodes.extentreports.LogStatus; public class ExtentReporterNG implements IReporter { private ExtentReports extent; public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory) { extent = new ExtentReports(outputDirectory + File.separator + "Extent.html", true); for (ISuite suite : suites) { Map<String, ISuiteResult> result = suite.getResults(); for (ISuiteResult r : result.values()) { ITestContext context = r.getTestContext(); buildTestNodes(context.getPassedTests(), LogStatus.PASS); buildTestNodes(context.getFailedTests(), LogStatus.FAIL); buildTestNodes(context.getSkippedTests(), LogStatus.SKIP); } } extent.flush(); extent.close(); } private void buildTestNodes(IResultMap tests, LogStatus status) { ExtentTest test; if (tests.size() > 0) { for (ITestResult result : tests.getAllResults()) { test = extent.startTest(result.getMethod().getMethodName()); test.setStartedTime(getTime(result.getStartMillis())); test.setEndedTime(getTime(result.getEndMillis())); for (String group : result.getMethod().getGroups()) test.assignCategory(group); if (result.getThrowable() != null) { test.log(status, result.getThrowable()); } else { test.log(status, "Test " + status.toString().toLowerCase() + "ed"); } extent.endTest(test); } } } private Date getTime(long millis) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(millis); return calendar.getTime(); } }
[ "sumantugalgali@gmail.com" ]
sumantugalgali@gmail.com
5514c31909a1d3f775e2a56529798a095a439bd5
463cc04423def1f47f1e7ea31750244916f27631
/PracticeApplication/javase/src/main/java/wxj/me/javase/concurrency/exercise/E5Callable.java
03f8f54f69e3b5202a44d59ec289558f0fa5ce6d
[]
no_license
wangxuejiaome/LearningNotes
89df50eff6c57a7c64350ee0d17399e2e63f7dbf
bf90cd5536dbb40240e379c2a8317a856798da23
refs/heads/master
2022-03-09T08:25:44.367008
2022-02-17T03:00:45
2022-02-17T03:00:45
140,399,320
1
0
null
null
null
null
UTF-8
Java
false
false
1,488
java
package wxj.me.javase.concurrency.exercise; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; class FibonacciSeqCallable implements Callable<Integer> { public static int count; public final int id = ++count; public int n; public FibonacciSeqCallable(int n) { this.n = n; } public int fibonacciSeq(int n) { if (n < 2) { return n; } else { return fibonacciSeq(n - 1) + fibonacciSeq(n - 2); } } @Override public Integer call() { return fibonacciSeq(n); } } public class E5Callable { public static void main(String[] args) { ExecutorService executorService = Executors.newCachedThreadPool(); List<Future<Integer>> futures = new ArrayList<>(); for (int i = 0; i < 10; i++) { futures.add(executorService.submit(new FibonacciSeqCallable(i))); } for (Future<Integer> future : futures){ try { System.out.println(future.get()); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); } finally { executorService.shutdown(); } } } }
[ "12W15X92J" ]
12W15X92J
4c7cd21e90d1a429bcb47717054d18772e99efef
9803ad5f92bef8cf79da6a27d7e2f4e9a9a6db74
/src/main/java/application/controller/web/ProductCategoryController.java
996d750d91299a163a1364be7aa1479d08d78844
[]
no_license
DucHiep/demo_product
417379a90e6986a4d1ee5914b7e198ad9c67c285
b2ad1c96f9a189f10ed8d1500cb91a35961dcaf9
refs/heads/master
2020-09-14T11:28:52.463736
2019-11-21T07:49:47
2019-11-21T07:49:47
223,116,319
0
0
null
null
null
null
UTF-8
Java
false
false
7,040
java
package application.controller.web; import application.data.model.Cart; import application.data.model.Order; import application.data.model.Product; import application.data.model.User; import application.data.service.CartService; import application.data.service.OrderService; import application.data.service.ProductCategoryService; import application.data.service.UserService; import application.extension.ProductPriceComparatorDecrease; import application.extension.ProductPriceComparatorIncrease; import application.viewmodel.list_product_category.ListProductCategoryViewModel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.security.Principal; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.UUID; @Controller public class ProductCategoryController { @Autowired private ProductCategoryService productCategoryService; @Autowired private CartService cartService; @GetMapping(path="/") public String index(Model model, @RequestParam(value = "categoryId", required = false) String productCategoryId, @RequestParam(value = "sortBy", required = false) String sortBy, HttpServletResponse response, HttpServletRequest request, final Principal principal){ String username = SecurityContextHolder.getContext().getAuthentication().getName(); if(principal == null) System.out.println("an danh"); else System.out.println(username); ListProductCategoryViewModel vm = new ListProductCategoryViewModel(); if(principal!=null){ Cookie cookie[] = request.getCookies(); int kt1 = 0; int kt2 = 0; int kt3 = 0; String guid_1 = ""; for(Cookie c : cookie){ if(c.getName().equals("username")){ kt1 = 1; } if(c.getName().equals("guid")){ kt2 = 1; guid_1 = c.getValue(); } if(c.getName().equals("cartid")){ kt3 = 1; } } if(kt1 == 0){ Cookie cookie1 = new Cookie("username",username); response.addCookie(cookie1); List<Cart> carts = cartService.findByUserName(username); if(carts.size()>0){ String guid_2 = carts.get(0).getGuid(); Cookie cookie2 = new Cookie("guid",guid_2); response.addCookie(cookie2); Cookie cookie3 = new Cookie("cartid",Integer.toString(carts.get(0).getId())); response.addCookie(cookie3); }else { UUID uuid = UUID.randomUUID(); String guid = uuid.toString(); Cart cart = new Cart(); cart.setUserName(username); cart.setGuid(guid); cartService.addNewCart(cart); System.out.println(cart.getUserName()); System.out.println(cart.getGuid()); Cookie cookie2 = new Cookie("guid", guid); response.addCookie(cookie2); Cookie cookie3 = new Cookie("cartid",Integer.toString(cart.getId())); response.addCookie(cookie3); } }else { if (kt2 == 0 ){ UUID uuid = UUID.randomUUID(); String guid = uuid.toString(); Cart cart = new Cart(); cart.setUserName(username); cart.setGuid(guid); cartService.addNewCart(cart); Cookie cookie1 = new Cookie("guid", guid); response.addCookie(cookie1); Cookie cookie2 = new Cookie("cartid",Integer.toString(cart.getId())); response.addCookie(cookie2); } } if(kt1!=0&&kt2!=0&&kt3==0){ Cart cart = new Cart(); cart.setUserName(username); cart.setGuid(guid_1); cartService.addNewCart(cart); Cookie cookie2 = new Cookie("cartid",Integer.toString(cart.getId())); response.addCookie(cookie2); } }else { Cookie cookie[] = request.getCookies(); int kt1=0; int kt2=0; String guid2 =""; if(cookie!=null){ for (Cookie c : cookie){ if(c.getName().equals("guid")){ kt1=1; guid2= c.getValue(); } if(c.getName().equals("cartid")){ kt2=1; } } } if(kt1==0){ UUID uuid = UUID.randomUUID(); String guid = uuid.toString(); Cart cart = new Cart(); cart.setGuid(guid); cartService.addNewCart(cart); Cookie cookie1 = new Cookie("guid",guid); response.addCookie(cookie1); Cookie cookie2 = new Cookie("cartid", Integer.toString(cart.getId())); response.addCookie(cookie2); } if(kt1==1&&kt2==0){ Cart cart = new Cart(); cart.setGuid(guid2); cartService.addNewCart(cart); Cookie cookie2 = new Cookie("cartid", Integer.toString(cart.getId())); response.addCookie(cookie2); } } int categoryId; if(productCategoryId!=null) categoryId = Integer.parseInt(productCategoryId); else categoryId=1; vm.setProductCategory(productCategoryService.findOne(categoryId)); List<Product> products = vm.getProductCategory().getListProducts(); if(sortBy!=null){ if(sortBy.equals("increase")){ Collections.sort(products, new ProductPriceComparatorIncrease()); }else { Collections.sort(products, new ProductPriceComparatorDecrease()); } } vm.setProductList(products); vm.setProductCategoryList(productCategoryService.getListAllProductCategories()); model.addAttribute("vm",vm); return "/menu"; } }
[ "hiepmasters97@gmail.com" ]
hiepmasters97@gmail.com
9cffc417fce84693a64fb6f2de20880f00606823
5c21ab6e2cbcc4469c9965f720f214a8cccae4b3
/sso-server/src/main/java/com/xjbg/sso/server/config/WebMvcConfig.java
60318f5a79d5ef3a4f4cd682503f0804831c334f
[ "Apache-2.0" ]
permissive
Kestrong/sso
ff62be1d2bb0947879c936a99a44aaa4d69f5ef8
36ebb9d02dc35a1b33955b49aaea6dec896c447e
refs/heads/master
2023-02-24T00:05:48.974189
2021-06-11T02:16:55
2021-06-11T02:16:55
188,661,393
15
8
Apache-2.0
2023-02-22T07:28:21
2019-05-26T09:04:20
Java
UTF-8
Java
false
false
4,279
java
package com.xjbg.sso.server.config; import com.fasterxml.jackson.databind.ObjectMapper; import com.xjbg.sso.core.util.CollectionUtil; import com.xjbg.sso.core.util.CustomObjectMapper; import com.xjbg.sso.server.properties.EnvProperties; import com.xjbg.sso.server.service.oauth.AuthTokenInterceptor; import com.xjbg.sso.server.service.oauth.OauthService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.web.HttpMessageConverters; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.validation.Validator; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import org.springframework.web.multipart.commons.CommonsMultipartResolver; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; import java.util.*; /** * @author kesc * @since 2019/2/27 */ @Configuration @EnableConfigurationProperties(EnvProperties.class) public class WebMvcConfig extends WebMvcConfigurationSupport { @Autowired private EnvProperties envProperties; @Autowired private LocalValidatorFactoryBean validator; @Autowired private OauthService oauthService; @Bean public AuthTokenInterceptor authTokenInterceptor() { AuthTokenInterceptor authTokenInterceptor = new AuthTokenInterceptor(); authTokenInterceptor.setOauthService(oauthService); return authTokenInterceptor; } @Override protected void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(authTokenInterceptor()).addPathPatterns("/user/**"); super.addInterceptors(registry); } @Override protected void addResourceHandlers(ResourceHandlerRegistry registry) { Map<String, String> resourceMapping = envProperties.getResourceMapping(); if (CollectionUtil.isNotEmpty(resourceMapping)) { for (Map.Entry<String, String> entry : resourceMapping.entrySet()) { registry.addResourceHandler(entry.getKey()).addResourceLocations(entry.getValue()); } } } @Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { converters.addAll(messageConverters()); } private List<HttpMessageConverter<?>> messageConverters() { List<HttpMessageConverter<?>> messageConverters = new ArrayList<HttpMessageConverter<?>>(); MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter(); jsonConverter.setObjectMapper(createDefaultObjectMapper()); messageConverters.add(jsonConverter); return messageConverters; } private ObjectMapper createDefaultObjectMapper() { CustomObjectMapper mapper = new CustomObjectMapper(); mapper.setCamelCaseToLowerCaseWithUnderscores(false); mapper.setDateFormatPattern("yyyy-MM-dd HH:mm:ss"); mapper.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); mapper.init(); return mapper; } @Bean public HttpMessageConverters getHttpMessageConverters() { return new HttpMessageConverters(Collections.emptyList()); } @Bean @Primary public CommonsMultipartResolver getCommonsMultipartResolver() { CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver(); commonsMultipartResolver.setMaxUploadSize(1024 * 1024 * 100); commonsMultipartResolver.setMaxInMemorySize(1024 * 2); commonsMultipartResolver.setDefaultEncoding("UTF-8"); commonsMultipartResolver.setResolveLazily(Boolean.TRUE); return commonsMultipartResolver; } @Override protected Validator getValidator() { return validator; } }
[ "492167585@qq.com" ]
492167585@qq.com
ef6f00e3511b5ea693ff269efab271fa6a669c3c
ea954f862714e132dfb0d2db8bc9c52da8dcda64
/frame/src/main/java/com/lvqingyang/frame/helper/DrawableHelper.java
16372b162116120e95c88123b274096c58708534
[]
no_license
biloba123/iWuster
3edf4393efbdd5526ee5434ee620f2d294ad9b42
43d1c657b87c53590b4541a5da2a6cfedaaf3690
refs/heads/master
2021-05-05T17:05:36.187670
2018-05-26T08:26:02
2018-05-26T08:26:02
117,342,209
0
0
null
null
null
null
UTF-8
Java
false
false
10,601
java
package com.lvqingyang.frame.helper; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.ColorFilter; import android.graphics.LightingColorFilter; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.ShapeDrawable; import android.support.annotation.ColorInt; import android.support.annotation.DrawableRes; import android.support.annotation.FloatRange; import android.support.annotation.Nullable; import android.support.v7.widget.AppCompatDrawableManager; import android.view.View; import android.widget.ImageView; /** * @author cginechen * @date 2016-03-17 */ public class DrawableHelper { private static final String TAG = DrawableHelper.class.getSimpleName(); //节省每次创建时产生的开销,但要注意多线程操作synchronized private static final Canvas sCanvas = new Canvas(); /** * 从一个view创建Bitmap。 * 注意点:绘制之前要清掉 View 的焦点,因为焦点可能会改变一个 View 的 UI 状态。 * 来源:https://github.com/tyrantgit/ExplosionField * * @param view 传入一个 View,会获取这个 View 的内容创建 Bitmap。 * @param scale 缩放比例,对创建的 Bitmap 进行缩放,数值支持从 0 到 1。 */ public static Bitmap createBitmapFromView(View view, float scale) { if (view instanceof ImageView) { Drawable drawable = ((ImageView) view).getDrawable(); if (drawable != null && drawable instanceof BitmapDrawable) { return ((BitmapDrawable) drawable).getBitmap(); } } view.clearFocus(); Bitmap bitmap = createBitmapSafely((int) (view.getWidth() * scale), (int) (view.getHeight() * scale), Bitmap.Config.ARGB_8888, 1); if (bitmap != null) { synchronized (sCanvas) { Canvas canvas = sCanvas; canvas.setBitmap(bitmap); canvas.save(); canvas.drawColor(Color.WHITE); // 防止 View 上面有些区域空白导致最终 Bitmap 上有些区域变黑 canvas.scale(scale, scale); view.draw(canvas); canvas.restore(); canvas.setBitmap(null); } } return bitmap; } public static Bitmap createBitmapFromView(View view) { return createBitmapFromView(view, 1f); } /** * 从一个view创建Bitmap。把view的区域截掉leftCrop/topCrop/rightCrop/bottomCrop */ public static Bitmap createBitmapFromView(View view, int leftCrop, int topCrop, int rightCrop, int bottomCrop) { Bitmap originBitmap = createBitmapFromView(view); if (originBitmap == null) { return null; } Bitmap cutBitmap = createBitmapSafely(view.getWidth() - rightCrop - leftCrop, view.getHeight() - topCrop - bottomCrop, Bitmap.Config.ARGB_8888, 1); if (cutBitmap == null) { return null; } Canvas canvas = new Canvas(cutBitmap); Rect src = new Rect(leftCrop, topCrop, view.getWidth() - rightCrop, view.getHeight() - bottomCrop); Rect dest = new Rect(0, 0, view.getWidth() - rightCrop - leftCrop, view.getHeight() - topCrop - bottomCrop); canvas.drawColor(Color.WHITE); // 防止 View 上面有些区域空白导致最终 Bitmap 上有些区域变黑 canvas.drawBitmap(originBitmap, src, dest, null); originBitmap.recycle(); return cutBitmap; } /** * 安全的创建bitmap。 * 如果新建 Bitmap 时产生了 OOM,可以主动进行一次 GC - System.gc(),然后再次尝试创建。 * * @param width Bitmap 宽度。 * @param height Bitmap 高度。 * @param config 传入一个 Bitmap.Config。 * @param retryCount 创建 Bitmap 时产生 OOM 后,主动重试的次数。 * @return 返回创建的 Bitmap。 */ public static Bitmap createBitmapSafely(int width, int height, Bitmap.Config config, int retryCount) { try { return Bitmap.createBitmap(width, height, config); } catch (OutOfMemoryError e) { e.printStackTrace(); if (retryCount > 0) { System.gc(); return createBitmapSafely(width, height, config, retryCount - 1); } return null; } } /** * 创建一张指定大小的纯色图片,支持圆角 * * @param resources Resources对象,用于创建BitmapDrawable * @param width 图片的宽度 * @param height 图片的高度 * @param cornerRadius 图片的圆角,不需要则传0 * @param filledColor 图片的填充色 * @return 指定大小的纯色图片 */ public static BitmapDrawable createDrawableWithSize(Resources resources, int width, int height, int cornerRadius, @ColorInt int filledColor) { Bitmap output = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(output); if (filledColor == 0) { filledColor = Color.TRANSPARENT; } if (cornerRadius > 0) { Paint paint = new Paint(); paint.setAntiAlias(true); paint.setStyle(Paint.Style.FILL); paint.setColor(filledColor); canvas.drawRoundRect(new RectF(0, 0, width, height), cornerRadius, cornerRadius, paint); } else { canvas.drawColor(filledColor); } return new BitmapDrawable(resources, output); } /** * 设置Drawable的颜色 * <b>这里不对Drawable进行mutate(),会影响到所有用到这个Drawable的地方,如果要避免,请先自行mutate()</b> */ public static ColorFilter setDrawableTintColor(Drawable drawable, @ColorInt int tintColor) { LightingColorFilter colorFilter = new LightingColorFilter(Color.argb(255, 0, 0, 0), tintColor); drawable.setColorFilter(colorFilter); return colorFilter; } /** * 由一个drawable生成bitmap */ public static Bitmap drawableToBitmap(Drawable drawable) { if (drawable == null) return null; else if (drawable instanceof BitmapDrawable) { return ((BitmapDrawable) drawable).getBitmap(); } int intrinsicWidth = drawable.getIntrinsicWidth(); int intrinsicHeight = drawable.getIntrinsicHeight(); if (!(intrinsicWidth > 0 && intrinsicHeight > 0)) return null; try { Bitmap bitmap = Bitmap.createBitmap(intrinsicWidth, intrinsicHeight, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); drawable.draw(canvas); return bitmap; } catch (OutOfMemoryError e) { return null; } } /** * 创建一张渐变图片,支持韵脚。 * * @param startColor 渐变开始色 * @param endColor 渐变结束色 * @param radius 圆角大小 * @param centerX 渐变中心点 X 轴坐标 * @param centerY 渐变中心点 Y 轴坐标 * @return 返回所创建的渐变图片。 */ @TargetApi(16) public static GradientDrawable createCircleGradientDrawable(@ColorInt int startColor, @ColorInt int endColor, int radius, @FloatRange(from = 0f, to = 1f) float centerX, @FloatRange(from = 0f, to = 1f) float centerY) { GradientDrawable gradientDrawable = new GradientDrawable(); gradientDrawable.setColors(new int[]{ startColor, endColor }); gradientDrawable.setGradientType(GradientDrawable.RADIAL_GRADIENT); gradientDrawable.setGradientRadius(radius); gradientDrawable.setGradientCenter(centerX, centerY); return gradientDrawable; } /** * 动态创建带上分隔线或下分隔线的Drawable。 * * @param separatorColor 分割线颜色。 * @param bgColor Drawable 的背景色。 * @param top true 则分割线为上分割线,false 则为下分割线。 * @return 返回所创建的 Drawable。 */ public static LayerDrawable createItemSeparatorBg(@ColorInt int separatorColor, @ColorInt int bgColor, int separatorHeight, boolean top) { ShapeDrawable separator = new ShapeDrawable(); separator.getPaint().setStyle(Paint.Style.FILL); separator.getPaint().setColor(separatorColor); ShapeDrawable bg = new ShapeDrawable(); bg.getPaint().setStyle(Paint.Style.FILL); bg.getPaint().setColor(bgColor); Drawable[] layers = {separator, bg}; LayerDrawable layerDrawable = new LayerDrawable(layers); layerDrawable.setLayerInset(1, 0, top ? separatorHeight : 0, 0, top ? 0 : separatorHeight); return layerDrawable; } /////////////// VectorDrawable ///////////////////// @SuppressLint("RestrictedApi") public static @Nullable Drawable getVectorDrawable(Context context, @DrawableRes int resVector) { try { return AppCompatDrawableManager.get().getDrawable(context, resVector); } catch (Exception e) { e.printStackTrace(); return null; } } public static Bitmap vectorDrawableToBitmap(Context context, @DrawableRes int resVector) { Drawable drawable = getVectorDrawable(context, resVector); if (drawable != null) { Bitmap b = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888); Canvas c = new Canvas(b); drawable.setBounds(0, 0, c.getWidth(), c.getHeight()); drawable.draw(c); return b; } return null; } /////////////// VectorDrawable ///////////////////// }
[ "2373880422@qq.com" ]
2373880422@qq.com
93238d75ba3330ccd47ac28aaf2c039129f87567
9e4494c107ebf0c7fb1d2d6b4ef012f4a056df1a
/Dineout-Search/src/main/java/com/dineout/search/service/YouMayLikeRecommendationService.java
fda472d07b2b925273032fa1d75a822c24300d17
[]
no_license
krishan111284/Test
e7fd873f0e25cf798f45da011caf35edc9ddbbd7
b44d22bbc7a15d4393dee7d3bd01904086efb266
refs/heads/master
2021-01-17T07:43:24.877367
2016-04-27T14:00:07
2016-04-27T14:00:07
17,359,746
0
0
null
null
null
null
UTF-8
Java
false
false
5,430
java
package com.dineout.search.service; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.apache.log4j.Logger; import org.apache.solr.client.solrj.SolrServer; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocument; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.dineout.search.exception.ErrorCode; import com.dineout.search.exception.SearchError; import com.dineout.search.exception.SearchErrors; import com.dineout.search.query.DORestQueryCreator; import com.dineout.search.query.QueryParam; import com.dineout.search.query.RecommendationQueryCreator; import com.dineout.search.request.RecommendationRequest; import com.dineout.search.response.DORecoResult; import com.dineout.search.server.SolrConnectionUtils; @Service("youMayLikeRecommendationService") public class YouMayLikeRecommendationService implements RecommendationService{ Logger logger = Logger.getLogger(YouMayLikeRecommendationService.class); @Autowired RecommendationQueryCreator recommendationQueryCreator; @Autowired DORestQueryCreator restQueryCreator; @Autowired SolrConnectionUtils solrConnectionUtils; @Autowired SimilarVisitedRecommendationService similarVisitedRecommendationService; @SuppressWarnings("unchecked") @Override public List<DORecoResult> getRecommendedResults(RecommendationRequest request, SearchErrors errors) { QueryParam doqp = null; QueryResponse qres = null; List<DORecoResult> finalresultList = new ArrayList<DORecoResult>(); try { String[] restaurantIds = null; SolrServer server = solrConnectionUtils.getDinerSolrServer(); doqp = recommendationQueryCreator.getDinerIdSearchQuery(request); qres = server.query(doqp); if(qres!=null){ Iterator<SolrDocument> resultIterator = qres.getResults().iterator(); while(resultIterator.hasNext()){ SolrDocument solrDoc = resultIterator.next(); if(solrDoc.get("restaurants_booked")!=null) restaurantIds = ((List<DORecoResult>) solrDoc.get("restaurants_booked")).toArray(new String[0]); } } if(restaurantIds!=null && restaurantIds.length>0){ DORecoResult result = getRecommendedRestaurants(request,restaurantIds,errors); finalresultList.add(result); } } catch (SolrServerException e) { logger.error(e.getMessage(),e); SearchError error = new SearchError(ErrorCode.SOLR_ERROR_CODE, e.getMessage()); errors.add(error); }catch (Exception e) { logger.error(e.getMessage(),e); SearchError error = new SearchError(ErrorCode.SOLR_ERROR_CODE, e.getMessage()); errors.add(error); } return finalresultList; } private DORecoResult getRecommendedRestaurants(RecommendationRequest request, String[] restaurantIds, SearchErrors errors) { List<Map<Object, Object>> resultList = new ArrayList<Map<Object,Object>>(); request.setRestIds(restaurantIds); for (String restId: restaurantIds) { request.setRestId(restId); List<DORecoResult> result = similarVisitedRecommendationService.getRecommendedResults(request, errors); for (Map<Object, Object> map : result.get(0).getDocs()) { resultList.add(map); } } Map<Integer,Integer> countMap = new HashMap<Integer, Integer>(); for(Map<Object,Object> m:resultList){ Integer count = countMap.get(m.get("r_id")); if(count==null){ Integer newCount = new Integer(1); Integer id = (Integer)m.get("r_id"); countMap.put(id,newCount); continue; } count++; } Map<Map<Object,Object>,Integer> uniqueMap = new HashMap<Map<Object,Object>, Integer>(); for(Map<Object,Object> m:resultList){ Integer count = countMap.remove(m.get("r_id")); if(count!=null){ uniqueMap.put(m, count); } } List<Entry<Map<Object, Object>, Integer>> listOfSortedResults = sortByValue(uniqueMap); List<Map<Object, Object>> result = new ArrayList<Map<Object,Object>>(); for(Entry<Map<Object, Object>, Integer> entry:listOfSortedResults){ result.add(entry.getKey()); } DORecoResult finalResult = new DORecoResult(); finalResult.setDocs(new ArrayList<Map<Object,Object>>(result).subList(0, 10)); return finalResult; } public static List<Map.Entry<Map<Object,Object>, Integer>> sortByValue( Map<Map<Object,Object>, Integer> map ){ List<Map.Entry<Map<Object,Object>, Integer>> list = new LinkedList<>( map.entrySet() ); Collections.sort( list, new Comparator<Map.Entry<Map<Object,Object>, Integer>>(){ @Override public int compare( Map.Entry<Map<Object,Object>, Integer> o1, Map.Entry<Map<Object,Object>, Integer> o2 ) { return ((Float) o1.getKey().get("eucledianDistance")).compareTo((Float) o2.getKey().get("eucledianDistance")); } } ); Collections.sort( list, new Comparator<Map.Entry<Map<Object,Object>, Integer>>(){ @Override public int compare( Map.Entry<Map<Object,Object>, Integer> o1, Map.Entry<Map<Object,Object>, Integer> o2 ) { return (o1.getValue()).compareTo(o2.getValue()); } } ); return list; } }
[ "shrey.09@gmail.com" ]
shrey.09@gmail.com
5cc8af233a63d7801743255301b52b75fc19f40d
b82ac609cb6773f65e283247f673c0f07bf09c6a
/week-07/day-1/src/main/java/spring/sql/practice/repository/ToDo.java
19d101cf9b171f222b3fcc50830217dfbb2d67a1
[]
no_license
green-fox-academy/scerios
03b2c2cc611a02f332b3ce1edd9743446b0a8a12
f829d62bdf1518e3e01dc125a98f90e484c9dce4
refs/heads/master
2020-04-02T22:36:36.470006
2019-01-07T16:38:20
2019-01-07T16:38:20
154,839,007
0
0
null
null
null
null
UTF-8
Java
false
false
612
java
package spring.sql.practice.repository; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class ToDo { @Id @GeneratedValue private long ID; private String title; private boolean isUrgent; private boolean isDone; public ToDo(String title) { this.title = title; this.isUrgent = false; this.isDone = false; } public long getID() { return ID; } public String getTitle() { return title; } public boolean isUrgent() { return isUrgent; } public boolean isDone() { return isDone; } }
[ "89.t.robert@gmail.com" ]
89.t.robert@gmail.com
b9570a3341388943746dd22e5a283c467f53a930
b74e2ca3c95bc5781c84d71c24b708bc6048cbe9
/app/src/androidTest/java/com/itla/mudat/test/testUsuarios.java
de4ebba648ac88c8cdd6b3a71dc5548a81419c68
[]
no_license
FrandyJavier/mudat
bd6250194b56e87f23bb1d7dec52276e246dc163
b4738c75ae1978db7b8a31285d1ccc312f8b6960
refs/heads/master
2021-08-24T11:49:35.684240
2017-12-09T16:32:29
2017-12-09T16:32:29
110,348,553
0
0
null
null
null
null
UTF-8
Java
false
false
1,138
java
package com.itla.mudat.test; import android.content.Context; import android.test.InstrumentationTestCase; import com.itla.mudat.dao.UsuariosDbo; import com.itla.mudat.entity.TipoUsuario; import com.itla.mudat.entity.Usuario; import java.util.ArrayList; import java.util.List; /** * Created by Frandy Javier AP on 11/28/2017. */ public class testUsuarios extends InstrumentationTestCase { public void test_Crear() { Usuario usuario = new Usuario(); UsuariosDbo db = new UsuariosDbo(getInstrumentation().getTargetContext()); usuario.setNombre("Prueba"); usuario.setTipoUsuario(TipoUsuario.CLIENTE); usuario.setIdentificacion(1); usuario.setEmail("prueba@gmail.com"); usuario.setTelefono("809-000-0000"); usuario.setClave("123"); usuario.setEstatus(true); assertTrue(db.crear(usuario) > 0); } public void testListar() { UsuariosDbo db = new UsuariosDbo(getInstrumentation().getTargetContext()); List<Usuario> usuarios = new ArrayList<>(); usuarios = db.listar(); assertTrue(usuarios.size() > 0); } }
[ "frandyjavierap@gmail.com" ]
frandyjavierap@gmail.com
8c19584cb731a7d51ff93df0cbc970d28f0645a5
451a88553fd93a3d5364cf7323f8344c4eec50ed
/src/main/java/io/swagger/client/model/ClusterMetadataPortInfo.java
4fa2342d972b7bdcd96eccc997f4cdd3a6caf280
[ "Apache-2.0" ]
permissive
aravindputrevu/ess-cloud-sdk-java
c5bbc15b15f1eaf4c799e9687db683548f7bb82b
d6abda92d896fd41ace86802158d4d5c497299b6
refs/heads/master
2022-09-09T04:01:00.777907
2020-06-03T10:08:57
2020-06-03T10:08:57
249,352,663
3
0
null
null
null
null
UTF-8
Java
false
false
3,183
java
/* * Elastic Cloud API * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: 1 * * * 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 io.swagger.client.model; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; /** * Information about the ports that allow communication between the Elasticsearch cluster and various protocols. */ @Schema(description = "Information about the ports that allow communication between the Elasticsearch cluster and various protocols.") @javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-03-10T16:33:30.970+05:30[Asia/Kolkata]") public class ClusterMetadataPortInfo { @SerializedName("http") private Integer http = null; @SerializedName("https") private Integer https = null; public ClusterMetadataPortInfo http(Integer http) { this.http = http; return this; } /** * Port where the cluster listens for HTTP traffic * @return http **/ @Schema(required = true, description = "Port where the cluster listens for HTTP traffic") public Integer getHttp() { return http; } public void setHttp(Integer http) { this.http = http; } public ClusterMetadataPortInfo https(Integer https) { this.https = https; return this; } /** * Port where the cluster listens for HTTPS traffic * @return https **/ @Schema(required = true, description = "Port where the cluster listens for HTTPS traffic") public Integer getHttps() { return https; } public void setHttps(Integer https) { this.https = https; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ClusterMetadataPortInfo clusterMetadataPortInfo = (ClusterMetadataPortInfo) o; return Objects.equals(this.http, clusterMetadataPortInfo.http) && Objects.equals(this.https, clusterMetadataPortInfo.https); } @Override public int hashCode() { return Objects.hash(http, https); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ClusterMetadataPortInfo {\n"); sb.append(" http: ").append(toIndentedString(http)).append("\n"); sb.append(" https: ").append(toIndentedString(https)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "aravind.putrevu@gmail.com" ]
aravind.putrevu@gmail.com
bbc4b5def926e4896a4972933f5303a8d6a16e0b
24487cdfa5a41d5a5c969ba5002cb49454ff8420
/src/main/java/com/jgw/supercodeplatform/project/zaoyangpeach/service/FarmInfoService.java
c38ec460bd3fb175375a3b3e4711d2baa4d83846
[]
no_license
jiangtingfeng/tttttttttttttttttttttttttttttttttttttt
3d85a515c5d229d6b6d44bcab93a1ba24cb162a9
7f7dee932a084d54c469d24792e2b3429379a9d9
refs/heads/master
2022-10-09T06:02:47.823332
2019-07-03T10:56:07
2019-07-03T10:56:07
197,173,501
0
0
null
2022-10-04T23:53:25
2019-07-16T10:33:04
Java
UTF-8
Java
false
false
1,485
java
package com.jgw.supercodeplatform.project.zaoyangpeach.service; import com.jgw.supercodeplatform.trace.common.model.ObjectUniqueValueResult; import com.jgw.supercodeplatform.trace.common.model.ReturnParamsMap; import com.jgw.supercodeplatform.trace.common.model.page.AbstractPageService; import com.jgw.supercodeplatform.trace.dao.mapper1.zaoyangpeach.FarmInfoMapper; import com.jgw.supercodeplatform.trace.pojo.zaoyangpeach.FarmInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @Service public class FarmInfoService extends AbstractPageService { @Autowired private FarmInfoMapper farmInfoMapper; public Map<String, Object> listFarmInfo(Map<String, Object> map) throws Exception { ReturnParamsMap returnParamsMap=null; Map<String, Object> dataMap=null; Integer total=null; total=farmInfoMapper.getCountByCondition(map); returnParamsMap = getPageAndRetuanMap(map, total); List<FarmInfo> testingTypes= farmInfoMapper.selectFarmInfo(map); List<ObjectUniqueValueResult> objectUniqueValueResults= testingTypes.stream().map(e->new ObjectUniqueValueResult(String.valueOf(e.getId()),e.getFarmName())).collect(Collectors.toList()); dataMap = returnParamsMap.getReturnMap(); getRetunMap(dataMap, objectUniqueValueResults); return dataMap; } }
[ "wangzhaoqing@app315.net" ]
wangzhaoqing@app315.net
214e2f6f47566bddd7d6053bce8664a6b7b2df9d
7033d33d0ce820499b58da1d1f86f47e311fd0e1
/org/newdawn/slick/openal/DeferredSound.java
91c8c07155f1437498959152235693bd2381eecd
[ "MIT" ]
permissive
gabrielvicenteYT/melon-client-src
1d3f1f65c5a3bf1b6bc3e1cb32a05bf1dd56ee62
e0bf34546ada3afa32443dab838b8ce12ce6aaf8
refs/heads/master
2023-04-04T05:47:35.053136
2021-04-19T18:34:36
2021-04-19T18:34:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,681
java
package org.newdawn.slick.openal; import org.newdawn.slick.loading.*; import org.newdawn.slick.util.*; import java.io.*; public class DeferredSound extends AudioImpl implements DeferredResource { public static final int OGG = 1; public static final int WAV = 2; public static final int MOD = 3; public static final int AIF = 4; private int type; private String ref; private Audio target; private InputStream in; public DeferredSound(final String ref, final InputStream in, final int type) { this.ref = ref; this.type = type; if (ref.equals(in.toString())) { this.in = in; } LoadingList.get().add(this); } private void checkTarget() { if (this.target == null) { throw new RuntimeException("Attempt to use deferred sound before loading"); } } @Override public void load() throws IOException { final boolean before = SoundStore.get().isDeferredLoading(); SoundStore.get().setDeferredLoading(false); if (this.in != null) { switch (this.type) { case 1: { this.target = SoundStore.get().getOgg(this.in); break; } case 2: { this.target = SoundStore.get().getWAV(this.in); break; } case 3: { this.target = SoundStore.get().getMOD(this.in); break; } case 4: { this.target = SoundStore.get().getAIF(this.in); break; } default: { Log.error("Unrecognised sound type: " + this.type); break; } } } else { switch (this.type) { case 1: { this.target = SoundStore.get().getOgg(this.ref); break; } case 2: { this.target = SoundStore.get().getWAV(this.ref); break; } case 3: { this.target = SoundStore.get().getMOD(this.ref); break; } case 4: { this.target = SoundStore.get().getAIF(this.ref); break; } default: { Log.error("Unrecognised sound type: " + this.type); break; } } } SoundStore.get().setDeferredLoading(before); } @Override public boolean isPlaying() { this.checkTarget(); return this.target.isPlaying(); } @Override public int playAsMusic(final float pitch, final float gain, final boolean loop) { this.checkTarget(); return this.target.playAsMusic(pitch, gain, loop); } @Override public int playAsSoundEffect(final float pitch, final float gain, final boolean loop) { this.checkTarget(); return this.target.playAsSoundEffect(pitch, gain, loop); } @Override public int playAsSoundEffect(final float pitch, final float gain, final boolean loop, final float x, final float y, final float z) { this.checkTarget(); return this.target.playAsSoundEffect(pitch, gain, loop, x, y, z); } @Override public void stop() { this.checkTarget(); this.target.stop(); } @Override public String getDescription() { return this.ref; } }
[ "haroldthesenpai@gmail.com" ]
haroldthesenpai@gmail.com
724df4dd3ffd5fbbf547d2911d342df1de864408
44ca3cf84dd9802dea2327e9d6a15065301db520
/src/orm/MedicoDetachedCriteria.java
6415729fb9a15743d1b6b4c52e948d2dd7c8a0d7
[]
no_license
rcarrasco02/HospitalWS
cb5f7a2f40710f6d9aef0912cd015cb0f01d02c1
9be031793f38161f088405bbb81a91b2fb6a811e
refs/heads/master
2021-01-10T05:01:19.658029
2015-05-28T11:25:19
2015-05-28T11:25:19
36,203,331
0
0
null
null
null
null
UTF-8
Java
false
false
2,761
java
/** * "Visual Paradigm: DO NOT MODIFY THIS FILE!" * * This is an automatic generated file. It will be regenerated every time * you generate persistence class. * * Modifying its content may cause the program not work, or your work may lost. */ /** * Licensee: Universidad de La Frontera * License Type: Academic */ package orm; import java.util.List; import org.hibernate.criterion.DetachedCriteria; import org.orm.PersistentSession; import org.orm.criteria.*; public class MedicoDetachedCriteria extends AbstractORMDetachedCriteria { public final IntegerExpression id; public final IntegerExpression personaId; public final AssociationExpression persona; public final IntegerExpression especialidadId; public final AssociationExpression especialidad; public final CollectionExpression hora_medica; public MedicoDetachedCriteria() { super(orm.Medico.class, orm.MedicoCriteria.class); id = new IntegerExpression("id", this.getDetachedCriteria()); personaId = new IntegerExpression("persona.id", this.getDetachedCriteria()); persona = new AssociationExpression("persona", this.getDetachedCriteria()); especialidadId = new IntegerExpression("especialidad.id", this.getDetachedCriteria()); especialidad = new AssociationExpression("especialidad", this.getDetachedCriteria()); hora_medica = new CollectionExpression("ORM_hora_medica", this.getDetachedCriteria()); } public MedicoDetachedCriteria(DetachedCriteria aDetachedCriteria) { super(aDetachedCriteria, orm.MedicoCriteria.class); id = new IntegerExpression("id", this.getDetachedCriteria()); personaId = new IntegerExpression("persona.id", this.getDetachedCriteria()); persona = new AssociationExpression("persona", this.getDetachedCriteria()); especialidadId = new IntegerExpression("especialidad.id", this.getDetachedCriteria()); especialidad = new AssociationExpression("especialidad", this.getDetachedCriteria()); hora_medica = new CollectionExpression("ORM_hora_medica", this.getDetachedCriteria()); } public PersonaDetachedCriteria createPersonaCriteria() { return new PersonaDetachedCriteria(createCriteria("persona")); } public EspecialidadDetachedCriteria createEspecialidadCriteria() { return new EspecialidadDetachedCriteria(createCriteria("especialidad")); } public Hora_medicaDetachedCriteria createHora_medicaCriteria() { return new Hora_medicaDetachedCriteria(createCriteria("ORM_hora_medica")); } public Medico uniqueMedico(PersistentSession session) { return (Medico) super.createExecutableCriteria(session).uniqueResult(); } public Medico[] listMedico(PersistentSession session) { List list = super.createExecutableCriteria(session).list(); return (Medico[]) list.toArray(new Medico[list.size()]); } }
[ "rccursach@gmail.com" ]
rccursach@gmail.com
376fe749b6ed46c0aeb881efd992e2feca633a4f
b045a3975623e719e7a5f0d57d90172a4792673a
/api/src/main/java/codes/writeonce/deltastore/api/map/BooleanDescendingSimpleIterator.java
98562ad0bd2b036b658455404debefae138289b9
[ "Apache-2.0" ]
permissive
trade-mate/deltastore
e08f55395841f5e15751fad5b0faa68030d4b5cc
fdf2b64183f39c0cc75d9fda09a04c4d883b6f8e
refs/heads/main
2023-08-25T01:15:17.182513
2021-10-27T03:26:57
2021-10-27T03:26:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,289
java
package codes.writeonce.deltastore.api.map; import codes.writeonce.deltastore.api.ArrayPool; final class BooleanDescendingSimpleIterator<V> extends AbstractBooleanDescendingSimpleIterator<V> { @SuppressWarnings("rawtypes") private static final ArrayPool<BooleanDescendingSimpleIterator> POOL = new ArrayPool<>(POOL_SIZE, BooleanDescendingSimpleIterator::new); @SuppressWarnings("unchecked") public static <V> BooleanDescendingSimpleIterator<V> create() { final BooleanDescendingSimpleIterator<V> value = POOL.get(); value.init(); return value; } @SuppressWarnings("unchecked") public static <V> BooleanDescendingSimpleIterator<V> create(boolean exclusive, boolean fromKey) { final BooleanDescendingSimpleIterator<V> value = POOL.get(); value.init(exclusive, fromKey); return value; } private BooleanDescendingSimpleIterator() { // empty } @Override protected boolean ended() { return false; } @Override protected boolean nullEnded() { return false; } @Override protected boolean ended(boolean key) { return false; } @Override public void close() { super.close(); POOL.put(this); } }
[ "alexey.romenskiy@gmail.com" ]
alexey.romenskiy@gmail.com
2513e1b8391fe6cfc768d8695a5b0d969e31ac8e
bcfc7e3b77ca8b41d42df9476041d5157e622b7a
/Project_Koback_Client/src/kr/or/kosta/koback/util/GUIUtil.java
730548c4956fd7d166ab7b25dfc91211efc7807a
[]
no_license
moyaiori/biningChatProject
df9b22dbec83e90e0f6400d1ff1ee5f2d647d1d4
222dfe0862772fbb38a9a1450fd390ba034b1297
refs/heads/master
2016-09-16T13:37:24.631898
2015-08-26T01:01:40
2015-08-26T01:01:40
41,134,148
1
2
null
null
null
null
UTF-8
Java
false
false
1,936
java
package kr.or.kosta.koback.util; import java.awt.Container; import java.awt.Toolkit; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; /** * GUI 관련된 공통 유틸리티 메소드 * * @author AS * */ public class GUIUtil { /** 화면 중앙 배치 */ public static void setCenterScreen(Container con) { Toolkit toolkit = Toolkit.getDefaultToolkit(); int x = (toolkit.getScreenSize().width - con.getWidth()) / 2;; int y = (toolkit.getScreenSize().height - con.getHeight()) / 2;; con.setLocation(x, y); // 프레임의 위치염 } /** 화면 풀 배치 */ public static void setFullScreen(Container con){ Toolkit toolkit = Toolkit.getDefaultToolkit(); // Dimension dimension = toolkit.getScreenSize(); con.setSize(toolkit.getScreenSize());; // 프레임의 위치염 } public static final String THEME_SWING = "javax.swing.plaf.metal.MetalLookAndFeel"; public static final String THEME_WINDOW = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; public static final String THEME_UNIX = "com.sun.java.swing.plaf.motif.MotifLookAndFeel"; public static final String THEME_NIMBUS = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"; public static final String THEME_OS = "UIManager.getSystemLookAndFeelClassName()"; /** Look&Feel 설정*/ public static void setLookAndFeel(Container component,String className){ try { UIManager.setLookAndFeel(className); } catch (Exception e) { e.printStackTrace(); } SwingUtilities.updateComponentTreeUI(component); } /** 일반 메세지 출력 메소드 */ public static void showMessage(String message) { JOptionPane.showMessageDialog(null, message, "알 림", JOptionPane.DEFAULT_OPTION); } /** 에러 메세지 출력 메소드 */ public static void showErrorMessage(String message) { JOptionPane.showMessageDialog(null, message, "경 고", JOptionPane.ERROR_MESSAGE); } }
[ "moyaiori1@gmail.com" ]
moyaiori1@gmail.com
a009a10f45f06f0d0b1b2d1d266289905ed53279
d9f6304a82dd3423b8f212671cff7910f289cc12
/src/com/java24hours/Point3D.java
1c1d34d62584a80e670947f6e2141b79eda28751
[]
no_license
kdotzenrod517/Java24Hours
39ea0260fc61c36c38648d4a73211c8f22fd746d
67a915073ca6b272143efa65f17c3f86f5ca8142
refs/heads/master
2020-12-02T09:55:02.818459
2017-07-09T03:37:43
2017-07-09T03:37:43
96,659,042
1
0
null
null
null
null
UTF-8
Java
false
false
340
java
package com.java24hours; import java.awt.*; public class Point3D extends Point{ public int z; public Point3D(int x, int y, int z){ super(x, y); this.z = z; } public void move(int x, int y, int z){ this.z = z; super.move(x, y); } public void translate(int x, int y, int z){ this.z = z; super.translate(x, y); } }
[ "kdotzenrod517@gmail.com" ]
kdotzenrod517@gmail.com
01258b6af70fe726560937a36d43f7c05ce241ce
a8e26a187623a17973144a1636a0088a1828fb23
/opb-plsql/src/test/java/com/butterfill/opb/plsql/translation/PlsqlTreeParserTest.java
12965862219644b5e9fec1ab1547f7bbdff612a6
[]
no_license
pete88b/object-procedural-bridge
c49670df7ca59a82e6c35e5a3089f2506c48b9bd
3afa96a7b068612b0318c7185fb183282f59d577
refs/heads/master
2020-05-27T10:44:02.617094
2015-11-02T11:39:16
2015-11-02T11:39:16
32,593,520
0
1
null
null
null
null
UTF-8
Java
false
false
3,797
java
/** * Copyright (C) 2008 Peter Butterfill. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.butterfill.opb.plsql.translation; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * * @author Peter Butterfill */ public class PlsqlTreeParserTest extends TestCase { public PlsqlTreeParserTest(String testName) { super(testName); } public static Test suite() { TestSuite suite = new TestSuite(PlsqlTreeParserTest.class); return suite; } @Override protected void setUp() throws Exception { super.setUp(); } @Override protected void tearDown() throws Exception { super.tearDown(); } /** * Test of getTokenNames method, of class PlsqlTreeParser. */ public void testGetTokenNames() { // No need to test this method } /** * Test of getGrammarFileName method, of class PlsqlTreeParser. */ public void testGetGrammarFileName() { // No need to test this method } /** * Test of startRule method, of class PlsqlTreeParser. */ public void testStartRule() throws Exception { // No need to test this method } /** * Test of createOrReplacePackage method, of class PlsqlTreeParser. */ public void testCreateOrReplacePackage() throws Exception { // No need to test this method } /** * Test of element method, of class PlsqlTreeParser. */ public void testElement() throws Exception { // No need to test this method } /** * Test of mlComment method, of class PlsqlTreeParser. */ public void testMlComment() throws Exception { // No need to test this method } /** * Test of constantDeclaration method, of class PlsqlTreeParser. */ public void testConstantDeclaration() throws Exception { // No need to test this method } /** * Test of literal method, of class PlsqlTreeParser. */ public void testLiteral() throws Exception { // No need to test this method } /** * Test of function method, of class PlsqlTreeParser. */ public void testFunction() throws Exception { // No need to test this method } /** * Test of procedure method, of class PlsqlTreeParser. */ public void testProcedure() throws Exception { // No need to test this method } /** * Test of ignore method, of class PlsqlTreeParser. */ public void testIgnore() throws Exception { // No need to test this method } /** * Test of param method, of class PlsqlTreeParser. */ public void testParam() throws Exception { // No need to test this method } /** * Test of dataType method, of class PlsqlTreeParser. */ public void testDataType() throws Exception { // No need to test this method } /** * Test of id method, of class PlsqlTreeParser. */ public void testId() throws Exception { // No need to test this method } }
[ "pete88b@users.noreply.github.com" ]
pete88b@users.noreply.github.com
04a6dffeb7de47191baf976d8affd157621e2322
0d6572d242f741ca10b08d1ac0ee246685f60967
/IBDP/src/com/sdu/AnalyseMethods/CorrelationMethod.java
9e290dd8aa1136b327e456e7786d81e9c17ebf55
[]
no_license
luckyyangz/IBDP2.0
f2b5bb08188be3608fcfc15838b30c491bd845aa
5e1a50e2f66ff74ad06a5caeb12cbec9eca833f8
refs/heads/master
2021-08-20T06:46:06.382147
2017-11-28T12:02:07
2017-11-28T12:02:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,537
java
package com.sdu.AnalyseMethods; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.http.HttpServletRequest; import org.apache.struts2.ServletActionContext; import org.json.JSONArray; import org.json.JSONObject; import org.rosuda.REngine.REXP; import org.rosuda.REngine.REXPMismatchException; import org.rosuda.REngine.Rserve.RConnection; import org.rosuda.REngine.Rserve.RserveException; import com.sdu.ToolsUse.AdviceHibernate; import com.sdu.ToolsUse.DataFileHibernate; import com.sdu.ToolsUse.HDFSTools; import com.sdu.entity.Admin; import com.sdu.entity.Advice; import com.sdu.entity.DataFile; import com.sdu.entity.Project; public class CorrelationMethod extends BasicMethod{ public DataFile beiginAnalyse(int index, DataFile dataFile, Admin user, Project project, JSONObject projectJSON, JSONArray algorithmJSON) { System.out.println("compute correlation"); String filepath=dataFile.getD_localpath(); String dataFileName=dataFile.getD_name(); JSONObject algorithm_obj=algorithmJSON.getJSONObject(index); JSONArray params= algorithm_obj.getJSONArray("param"); String chosecolumn=params.getJSONObject(1).getString("value"); String chosework=params.getJSONObject(0).getString("value"); DataFile resultFile=null; //开始执行分析相关性 try { RConnection c = new RConnection(); REXP x = c.eval("R.version.string"); System.out.println(x.asString()); String cor_method="pearson"; if(chosework.equals("kendall")) cor_method="kendall"; else if(chosework.equals("spearman")) cor_method="spearman"; String savePath=filepath.substring(0,filepath.lastIndexOf('/')); System.out.println(savePath); System.out.println("setwd(\""+savePath+"\")"); c.eval("setwd(\""+savePath+"\")"); c.eval("library(openxlsx)"); String aa = dataFileName.substring(dataFileName.lastIndexOf(".")); if(aa.equals(".xlsx")) { c.eval("datafile <- read.xlsx(\""+dataFileName+"\",1)"); }else if (aa.equals(".txt")) { c.eval("datafile <- read.table(\""+dataFileName+"\",header="+dataFile.getD_hasheader()+")"); }else if (aa.equals(".csv")) { c.eval("datafile<-read.csv(\""+dataFileName+"\",header="+dataFile.getD_hasheader()+",sep=\",\")"); }else if(aa.equals(".Rdata")) { c.eval("load(\""+dataFileName+"\")"); } double [][]cormatrix=c.eval("res<-cor(datafile[,c("+chosecolumn+")],method='"+cor_method+"')").asDoubleMatrix(); //double [][]cormatrix=c.eval("round(cor(cordata[,c("+chosecolumn+")],method='"+cor_method+"'),6)").asDoubleMatrix(); System.out.println("matrix计算完成"); String resultFileName=dataFileName.substring(0,dataFileName.lastIndexOf('.'))+"_correlation"; System.out.println("开始写入结果文件:"+resultFileName); c.eval("png(file=\""+resultFileName+".png\", bg=\"transparent\")"); c.eval("print(GGally::ggpairs(datafile[,c("+chosecolumn+")]))"); c.eval("dev.off()"); //保存图像 resultFile=FormResultFileAndAdvice.formFile(user, project, resultFileName+".png", savePath+"/"+resultFileName+".png"); resultFile.setD_type("ResultFile"); DataFileHibernate.saveDataFile(resultFile); HDFSTools.LoadSingleFileToHDFS(resultFile); if(index==algorithmJSON.length()-1) { resultFileName=resultFileName+".txt"; c.eval("sink(\""+resultFileName+"\")"); c.eval("print(res)"); c.eval("sink()"); resultFile=FormResultFileAndAdvice.formFile(user, project, resultFileName, savePath+"/"+resultFileName); resultFile.setD_type("ResultFile"); DataFileHibernate.saveDataFile(resultFile); HDFSTools.LoadSingleFileToHDFS(resultFile); //通知分析完成 FormResultFileAndAdvice.FormAdvice(user, project); } else { resultFileName=resultFileName+".Rdata"; c.eval("save(res,\""+resultFileName+"\" )"); resultFile=FormResultFileAndAdvice.formFile(user, project, resultFileName, savePath+"/"+resultFileName+".png"); resultFile.setD_type("IntermediateFile"); } c.close(); System.out.println("Rserve连接关闭"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return resultFile; } }
[ "shixtwy@163.com" ]
shixtwy@163.com
58514ab2f0daa057402e3a2b01bf305505322e6b
605a14887506b9d68d7b5a38d12a7c7aded9a024
/labs/lab03/lab03/src/exec04/GenericPhone.java
d1bb24409b5fbf5e350440d2d9d57e6ae113b1a7
[]
no_license
eduardohferreiras/ces28_2017_eduardo.silva
6ad70927f147468a0d652b5e273bbcf4eae7f862
2cb8ccd946700119c55a05e73fc9626aae448061
refs/heads/master
2021-01-16T19:49:13.080470
2017-11-27T21:40:02
2017-11-27T21:40:02
100,188,942
0
0
null
null
null
null
UTF-8
Java
false
false
516
java
package exec04; import java.util.HashMap; public class GenericPhone { GenericPhone(int areaCode, int number) { areaCode_ = areaCode; number_ = number; } protected int areaCode_; protected int number_; public String toPrint() { return null; } public GenericPhone getSpecificPhone(String idiom) { if(idiom.equals("EN_US")) { return new EN_USPPhone(areaCode_, number_); } else if(idiom.equals("PT_BR")) { return new PT_BRPhone1(areaCode_, number_); } else return null; } }
[ "guima.felipec@gmail.com" ]
guima.felipec@gmail.com
9c7142d419b63e98366f07bdccb8f1d1ac451461
88fba1850edaee8d7dcebb9313b2759557848081
/pixmm-manager/pixmm-manager-web/src/main/java/com/ydhd/pixmm/controller/ContentCategoryController.java
90dafc5c87863becb0bfbf609c37e7767d26f4e6
[]
no_license
victorWangpb/pixmm
210a6c482d31f68cf85edbc67dd25cfbe7eaf79c
744e45a29c9432fa2770383d61ede8dd4eddbcda
refs/heads/master
2021-01-18T17:06:02.429829
2017-08-17T12:06:22
2017-08-17T12:06:22
100,481,816
0
0
null
null
null
null
UTF-8
Java
false
false
1,212
java
package com.ydhd.pixmm.controller; import com.ydhd.pixmm.pojo.EasyUITreeNode; import com.ydhd.pixmm.service.ContentCategoryService; import com.ydhd.pixmm.utils.PixmmResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; /** * Created by 王朋波 on 13/08/2017. */ @Controller @RequestMapping("/content/category") public class ContentCategoryController { @Autowired private ContentCategoryService contentCategoryService; @RequestMapping("/list") @ResponseBody public List<EasyUITreeNode> getContentCatList(@RequestParam(value="id", defaultValue="0")Long parentId) { List<EasyUITreeNode> list = contentCategoryService.getContentCatList(parentId); return list; } @RequestMapping("/create") @ResponseBody public PixmmResult createNode(Long parentId, String name) { PixmmResult result = contentCategoryService.insertCatgory(parentId, name); return result; } }
[ "1065104613@qq.com" ]
1065104613@qq.com
317d214147652b249a658482413a16aea71ff59c
030585fcfdec43597c0a81dfefdc841c547d3751
/src/window/ventanaDebug.java
c2d4e05bfc874b3d9b468f48529d3384fd3da960
[]
no_license
ridv0ver/0ver
2ec7b741803749619431e37517bdcae578a1d4d0
25eceb63f562e803332919d421162bebcb654a47
refs/heads/main
2023-02-07T16:27:57.654534
2021-01-04T06:44:43
2021-01-04T06:44:43
324,018,471
0
0
null
null
null
null
UTF-8
Java
false
false
1,408
java
package src.window; import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class ventanaDebug extends JFrame implements ActionListener{ JTextField debug; JButton button; /** * */ private static final long serialVersionUID = 1L; public ventanaDebug(){ setTitle("Over"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLayout(null); setSize(1200, 600); setLocationRelativeTo(null); this.setIconImage(new ImageIcon(getClass().getResource("/icon.png")).getImage()); } public void debugger(){ debug = new JTextField(); debug.setBounds(200,300,500,50); add(debug); button = new JButton("1001010"); button.addActionListener(this); button.setBounds(750, 250, 200, 200); add(button); setVisible(true); } public void debugsCodes(String code){ if(code.equalsIgnoreCase("1432")){ dispose(); fullAdmin ventana = new fullAdmin(); ventana.setVisible(true); } if(code.equalsIgnoreCase("0")){ dispose(); ventanaPrincipal ventana = new ventanaPrincipal(); ventana.setVisible(true); } } @Override public void actionPerformed(ActionEvent e) { debugsCodes(debug.getText()); } }
[ "76539567+ridv0ver@users.noreply.github.com" ]
76539567+ridv0ver@users.noreply.github.com
8883400e3d5ffc5cf905a7b91826729d0245973c
dabc84aeaafa2eb63ffe0397e370ae3794079bba
/src/main/java/cc/before30/service/SchedulerService.java
5ad366b4645c2004d38c57f3e684c312b7b6b752
[]
no_license
before30/ddul-scheduler
3379b3df08693a1a8ff8b6cc5fde8914e2f9e6f5
20b5345b5d8a5e55e89f21bbc45b42a59e0047db
refs/heads/master
2021-01-20T08:36:59.886304
2019-02-15T01:36:20
2019-02-15T01:36:20
89,929,365
0
0
null
null
null
null
UTF-8
Java
false
false
1,750
java
package cc.before30.service; import cc.before30.config.DdulProperties; import com.github.seratch.jslack.Slack; import com.github.seratch.jslack.api.webhook.Payload; import com.github.seratch.jslack.api.webhook.WebhookResponse; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import java.io.IOException; import java.time.ZoneId; import java.time.ZonedDateTime; /** * Created by before30 on 01/05/2017. */ @Slf4j @Component public class SchedulerService { @Autowired private Slack slack; @Autowired private DdulProperties ddulProperties; @Autowired private RestTemplate restTemplate; @Scheduled(cron = "0 1 7-23 * * *", zone = "Asia/Seoul") public void requestToWriteWhatDidUDo() { int hour = ZonedDateTime.now(ZoneId.of("Asia/Seoul")).getHour(); log.info("current hour : {}", hour); hour = (hour-1)>0?(hour-1)%24:23; Payload payload = Payload.builder() .channel(ddulProperties.getSlackChannelName()) .username("coach") .iconEmoji(":smile_cat:") .text("[" + hour + ":00-" + hour + ":59]: What did you do??" ) .build(); try { WebhookResponse send = slack.send(ddulProperties.getSlackWebhookUrl(), payload); log.info("{}", ddulProperties.getSlackWebhookUrl()); log.info("response {} {}", send.getCode(), send.getBody()); } catch (IOException e) { log.error("exception in sending message", e.getMessage()); } } }
[ "before30@gmail.com" ]
before30@gmail.com
80caebd44ac255b57eecaa93dcc2c14214801545
96539ab1c9944cf66a90975a35087fab9913a0b9
/src/main/java/model/Qr.java
2b5fad70cbe0af20b112f96d9e0751b3caed996d
[]
no_license
HoracioMM/reservation
a3ddac0a5b7ef366c4635d49bc601ca3b249ca31
226f25df12885e67a010c09799e3403ad15de6a2
refs/heads/master
2021-01-15T10:45:51.283081
2016-09-18T18:14:14
2016-09-18T18:14:14
68,538,563
0
0
null
null
null
null
UTF-8
Java
false
false
1,230
java
package model; import java.io.Serializable; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToOne; @Entity public class Qr implements Serializable { private static final long serialVersionUID = -2817403522882362922L; @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) private int qrId; private String qrCode; private String alarmTrigger; @OneToOne(mappedBy = "qr", cascade = CascadeType.ALL) private Traveller traveller; public String getQrCode() { return qrCode; } public void setQrCode(String qrCode) { this.qrCode = qrCode; } public String getAlarmTrigger() { return alarmTrigger; } public void setAlarmTrigger(String alarmTrigger) { this.alarmTrigger = alarmTrigger; } public Traveller getTraveller() { return traveller; } public void setTraveller(Traveller traveller) { this.traveller = traveller; } public int getQrId() { return qrId; } @Override public String toString() { return "Qr [qrId=" + qrId + ", qrCode=" + qrCode + ", alarmTrigger=" + alarmTrigger + ", traveller=" + traveller + "]"; } }
[ "HoracioMM@HoracioMM-PC" ]
HoracioMM@HoracioMM-PC
ae134f3a2c6ab21702a69f97bc4abd4886a38d93
06f233236143781954e18772d0b75689a99d9410
/ewaiter/src/main/java/com/ewaiter/model/Product.java
98427f9e6f7b5a1ac3a07e1bd1d5b39415ead05a
[]
no_license
klaskowski/SDAcademyProjects
6b9876d58100025799575458f8a3f93583dfa325
2c1e042846cd5f6432402b17d2c3003969b498a2
refs/heads/master
2020-12-20T23:35:17.612215
2018-10-11T20:22:26
2018-10-11T20:22:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
725
java
package com.ewaiter.model; import javax.persistence.*; @Entity @javax.persistence.Table(name = "product") public class Product { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long productId; @Column private String name; @Column private Double price; public Long getProductId() { return productId; } public void setProductId(Long productId) { this.productId = productId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Double getPrice() { return price; } public void setPrice(Double price) { this.price = price; } }
[ "jitaruvictor@gmail.com" ]
jitaruvictor@gmail.com
2a9a38ae1c4f11a9dbab3688bd13d08a7f40eb13
3e7f810ec56e88abdcdf75c0d58a84a0526ab2c5
/src/main/java/com/wq/xxx/utils/date/DateUtil.java
7d03089186733b8efe7d9dd2fc66ca40814702e1
[]
no_license
siyawu/commonUtils
3eec0c38fa54d815fda71e112aa51b5a489b34b3
60ae46d2dbd2ebbf02bda51381366df5ab7cd50d
refs/heads/master
2023-04-13T17:19:50.957531
2022-02-07T11:00:03
2022-02-07T11:00:03
148,906,942
0
0
null
2023-03-27T22:22:04
2018-09-15T14:01:52
FreeMarker
UTF-8
Java
false
false
19,068
java
package com.wq.xxx.utils.date; import com.wq.xxx.utils.StringUtil; import org.apache.commons.lang.time.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.text.ParseException; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.*; import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Created by Jason on 2017/11/22. */ public class DateUtil { private static final Logger LOGGER = LoggerFactory.getLogger(DateUtil.class); //可能出现的时间格式 private static final String[] patterns = { "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy年MM月dd日", "yyyy-MM-dd", "yyyy/MM/dd", "yyyyMMdd" }; /** * 格式化日期 * * @param format 日期格式模板 yyyy-MM-dd yyyy/MM/dd * @param date 日期 */ public static String formatStr(String format, Date date) { if (null != date && !StringUtil.isNullOrEmpty(format)) { SimpleDateFormat simpleFormat = new SimpleDateFormat(format); return simpleFormat.format(date); } return StringUtil.EMPTY; } /** * 格式化日期 * * @param format 日期格式模板 yyyy-MM-dd yyyy/MM/dd * @param date 日期 */ public static Date formatDate(String format, Date date) throws ParseException { if (null != date && !StringUtil.isNullOrEmpty(format)) { SimpleDateFormat simpleFormat = new SimpleDateFormat(format); String dateStr = simpleFormat.format(date); return simpleFormat.parse(dateStr); } return date; } /** * 格式化日期 * * @param format 日期格式模板 * @param strDate 日期 */ public static Date parse(String format, String strDate) throws ParseException { if (null != strDate && !StringUtil.isNullOrEmpty(format)) { SimpleDateFormat simpleFormat = new SimpleDateFormat(format); return simpleFormat.parse(strDate); } return null; } /** * @param inputDate 要解析的字符串 * @return 解析出来的日期,如果没有匹配的返回null */ public static Date parseDate(String inputDate) { SimpleDateFormat df = new SimpleDateFormat(); for (String pattern : patterns) { df.applyPattern(pattern); df.setLenient(false);//设置解析日期格式是否严格解析日期 ParsePosition pos = new ParsePosition(0); Date date = df.parse(inputDate, pos); if (date != null) { return date; } } return null; } /** * 获取标准日期,忽略时间 yyyy-MM-dd * * @param date 原始日期 * @return 处理后的日期 */ public static Date getNormalDate(Date date) throws ParseException { return formatDate(DatePattern.NORM_DATE_FORMAT, date); } /** * 获取标准日期,忽略时间 yyyy-MM-dd * * @param date 原始日期 * @return 处理后的日期 */ public static Date getNormalDate(String date) throws ParseException { return parse(DatePattern.NORM_DATE_FORMAT, date); } /** * 转换字符串为标准日期+时间 yyyy-MM-dd HH:mm:ss * * @param date 原始日期 * @return 处理后的日期 */ public static Date getNormalDateTime(String date) throws ParseException { return parse(DatePattern.NORM_DATETIME_FORMAT, date); } /** * 获取月份标识 * * @param date 日期 * @return 月份 */ public static Integer getDataMonthNumber(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar.get(Calendar.MONTH) + 1; } /** * 转换格式 yyyyMM * * @param date 日期 * @return */ public static Integer getSimpleMonth(Date date) { String month = formatStr(DatePattern.SIMPLE_MONTH_FORMAT, date); return Integer.parseInt(month); } /** * 转换格式 yyyyMMdd * * @param date 日期 * @return */ public static Integer getSimpleDate(Date date) { if (date == null) { return -1; } String month = formatStr(DatePattern.SIMPLE_DATE_FORMAT, date); return Integer.parseInt(month); } /** * 转换格式 yyyyMMdd * * @param date 日期 * @return */ public static Date getSimpleDate(Integer date, Date defaultDate) throws ParseException { if (date == null) { return defaultDate; } return parse(DatePattern.SIMPLE_DATE_FORMAT, String.valueOf(date)); } /** * 转换格式 yyyyMM * * @param date * @param defaultDate * @return */ public static Date getSimpleMonth(Integer date, Date defaultDate) throws ParseException { if (date == null) { return defaultDate; } return parse(DatePattern.SIMPLE_MONTH_FORMAT, String.valueOf(date)); } /** * 格式转换 yyyyMMdd * * @param date 数字格式 * @return 日期格式 */ public static Date getSimpleDate(Integer date) throws ParseException { return parse(DatePattern.SIMPLE_DATE_FORMAT, String.valueOf(date)); } public static boolean timeMatch(Date startTime, Date endTime, Date targetStartTime, Date targetEndTime) { return (targetStartTime.compareTo(startTime) <= 0 && targetEndTime.compareTo(startTime) >= 0) || (targetStartTime.compareTo(endTime) <= 0 && targetEndTime.compareTo(endTime) >= 0) || (targetStartTime.compareTo(startTime) >= 0 && targetEndTime.compareTo(endTime) <= 0); } /** * 格式化日期(当前时间) * * @param format 日期格式模板 */ public static String formatNow(String format) { return formatStr(format, new Date()); } /** * 获取日期之间天数差 * * @param lessDate * @param bigDate * @return */ public static Integer daysBetween(Date lessDate, Date bigDate) { if (null == lessDate || null == bigDate) { return 0; } Calendar cNow = Calendar.getInstance(); Calendar cReturnDate = Calendar.getInstance(); cNow.setTime(lessDate); cReturnDate.setTime(bigDate); setTimeToMidnight(cNow); setTimeToMidnight(cReturnDate); Long todayMs = cNow.getTimeInMillis(); Long returnMs = cReturnDate.getTimeInMillis(); long intervalMs = Math.abs(todayMs - returnMs); long days = (intervalMs / (1000 * 86400)); return (int) days; } public static boolean sameDate(Date d1, Date d2) { LocalDate localDate1 = ZonedDateTime.ofInstant(d1.toInstant(), ZoneId.systemDefault()).toLocalDate(); LocalDate localDate2 = ZonedDateTime.ofInstant(d2.toInstant(), ZoneId.systemDefault()).toLocalDate(); return localDate1.isEqual(localDate2); } /** * 获取日期之间小时差 * * @param lessDate * @param bigDate * @return */ public static Double hourBetween(Date lessDate, Date bigDate) { if (null == lessDate || null == bigDate) { return 0D; } Calendar cNow = Calendar.getInstance(); Calendar cReturnDate = Calendar.getInstance(); cNow.setTime(lessDate); cReturnDate.setTime(bigDate); long todayMs = cNow.getTimeInMillis(); long returnMs = cReturnDate.getTimeInMillis(); long intervalMs = Math.abs(todayMs - returnMs); return intervalMs / (1000 * 3600.0); } private static void setTimeToMidnight(Calendar calendar) { changeTimeDetail(calendar, 0, 0); } /** * 获取给定日期所在的年 * * @param dateTime 给定的日期 * @return yyyy */ public static int getYearByDate(Date dateTime) { Calendar cal = Calendar.getInstance(); cal.setTime(dateTime); return cal.get(Calendar.YEAR); } /** * 获取昨天日期 * * @return */ public static Date getYesterday() { return getYesterday(null); } /** * 获取昨天日期 * * @return */ public static Date getYesterday(Date date) { Calendar cNow = Calendar.getInstance(); //获取前一天 cNow.setTime(date == null ? new Date() : date); cNow.add(Calendar.DAY_OF_MONTH, -1); return cNow.getTime(); } public static Date addDay(Date date) { int amount = 1; return addDay(date, amount, Calendar.DAY_OF_MONTH); } public static Date addDay(Date date, int amount, int dayOfMonth) { Calendar cNow = Calendar.getInstance(); cNow.setTime(date); cNow.add(dayOfMonth, amount); return cNow.getTime(); } /** * 是否是月初第一天 * * @param date 日期 * @return */ public static boolean monthStart(Date date) { Calendar cNow = Calendar.getInstance(); cNow.setTime(date); int day = cNow.get(Calendar.DAY_OF_MONTH); int first = cNow.getMinimum(Calendar.DAY_OF_MONTH); return day == first; } /** * 获取今天结束 * * @return 结束 */ public static String getCurrentDayEnd() { Calendar cNow = Calendar.getInstance(); changeTimeDetail(cNow, 0, 0); return Long.toString(cNow.getTimeInMillis()); } private static void changeTimeDetail(Calendar cNow, int dayHour, int minute) { cNow.set(Calendar.HOUR_OF_DAY, dayHour); cNow.set(Calendar.MINUTE, minute); cNow.set(Calendar.SECOND, minute); cNow.set(Calendar.MILLISECOND, 0); } public static Date changeTimeDetail(Date date, int dayHour, int minute) { Calendar cNow = Calendar.getInstance(); cNow.setTime(date); changeTimeDetail(cNow, dayHour, minute); return cNow.getTime(); } /** * 获取gps对接时间 * * @param currentDate 数据日期 * @param forEnd 是否获取结束时间(结束时间日期往后延一天) * @return gps对接时间 */ public static Date convertToGpsDockTime(Date currentDate, boolean forEnd) { Calendar cNow = Calendar.getInstance(); cNow.setTime(currentDate); if (forEnd) { //如果是结束时间则时间跳转到次日 cNow.add(Calendar.DAY_OF_MONTH, 1); } changeTimeDetail(cNow, 0, 0); return cNow.getTime(); } /** * 获取月份最后一天 * * @param reportMonth * @return */ public static Date getEndOfMonth(Date reportMonth) { Calendar calendar = Calendar.getInstance(); calendar.setTime(reportMonth); calendar.set(Calendar.DAY_OF_MONTH, 1); changeTimeDetail(calendar, 0, 0); calendar.add(Calendar.MONTH, 1); calendar.add(Calendar.SECOND, -1); return calendar.getTime(); } /** * 获取月份第一天 * * @param reportMonth * @return */ public static Date getStartOfMonth(Date reportMonth) { Calendar calendar = Calendar.getInstance(); calendar.setTime(reportMonth); calendar.set(Calendar.DAY_OF_MONTH, 1); changeTimeDetail(calendar, 0, 0); return calendar.getTime(); } public static Date getStartOfYear(Date reportMonth) { Calendar calendar = Calendar.getInstance(); calendar.setTime(reportMonth); calendar.set(Calendar.DAY_OF_YEAR, 1); changeTimeDetail(calendar, 0, 0); return calendar.getTime(); } /** * 获取一天的开始时间 * * @param date 日期 * @return 当天的最后时间 */ public static Date getStartOfDay(Date date) throws ParseException { SimpleDateFormat dateFormat = new SimpleDateFormat(DatePattern.NORM_DATE_FORMAT); String endStr = dateFormat.format(date) + " 00:00:00"; return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(endStr); } /** * 获取一天的结束时间 * * @param date 日期 * @return 当天的最后时间 */ public static Date getEndOfDay(Date date) throws ParseException { SimpleDateFormat dateFormat = new SimpleDateFormat(DatePattern.NORM_DATE_FORMAT); String endStr = dateFormat.format(date) + " 23:59:59"; return new SimpleDateFormat(DatePattern.NORM_DATETIME_FORMAT).parse(endStr); } public static boolean isTimeFormat(String timeSting) { String regExp = "([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$"; return checkFormat(timeSting, regExp); } public static boolean isMonthFormat(String timeSting) { String regExp = "(?!0000)[0-9]{4}-((0[1-9]|1[0-2]))$"; return checkFormat(timeSting, regExp); } public static boolean checkFormat(String timeSting, String regExp) { if (timeSting == null) { return false; } Pattern p = Pattern.compile(regExp); Matcher m = p.matcher(timeSting); return m.matches(); } /** * 时间加减 * * @param date 时间 * @param field 加减字段 * @param amount 加减值 * @return 处理后日期 */ public static Date timeAdd(Date date, int field, int amount) { return addDay(date, amount, field); } /** * 获取今天结束 * * @return 结束 */ public static String getFileDataTag() { Calendar cNow = Calendar.getInstance(); return formatStr(DatePattern.SIMPLE_DATETIME_MS_FORMAT, cNow.getTime()); } //获取两个时间点最小的时间 public static Date getLatestDate(Date firstDate, Date secondDate) { //无法比较返回null if (Objects.isNull(firstDate) || Objects.isNull(secondDate)) { return null; } return 0 > firstDate.compareTo(secondDate) ? firstDate : secondDate; } public static List<String> getYearMonthDayList(Date startTime, Date endTime, String formatted) { return getDateForMatList(startTime, endTime, formatted, calendar -> calendar.add(Calendar.DAY_OF_MONTH, 1)); } /** * 获取一天所在月份的所有日期 * * @param date * @return */ public static List<String> getYearMonthDayList(Date date) { Date startOfDay = DateUtil.getStartOfMonth(date); Date endOfMonth = DateUtil.getEndOfMonth(date); return getYearMonthDayList(startOfDay, endOfMonth); } /** * 获取两个时间的日期列表 yyyy-MM-dd * * @param startTime 开始时间 * @param endTime 结束时间 * @return */ public static List<String> getYearMonthDayList(Date startTime, Date endTime) { return getYearMonthDayList(startTime, endTime, DatePattern.NORM_DATE_FORMAT); } /** * 获取两个时间的年月列表 yyyyMM * * @param startTime 开始时间 * @param endTime 结束时间 * @return */ public static List<String> calcYearMonthList(Date startTime, Date endTime) { return getDateForMatList(startTime, endTime, DatePattern.SIMPLE_MONTH_FORMAT, calendar -> calendar.add(Calendar.MONTH, 1)); } /** * 获取两个时间的年列表 yyyy * * @param startTime 开始时间 * @param endTime 结束时间 * @return */ public static List<String> calcYearList(Date startTime, Date endTime) { return getDateForMatList(startTime, endTime, DatePattern.YEAR_FORMAT, calendar -> calendar.add(Calendar.YEAR, 1)); } public static List<String> getDateForMatList(Date startTime, Date endTime, String formatString, Consumer<Calendar> nextConsumer) { List<String> dateList = new ArrayList<>(); if (Objects.isNull(startTime) || Objects.isNull(endTime)) { return dateList; } Date calcStartTime; Date calcEndTime; if (startTime.compareTo(endTime) < 0) { calcStartTime = startTime; calcEndTime = endTime; } else { calcStartTime = endTime; calcEndTime = startTime; } Calendar calendarStart = Calendar.getInstance(); calendarStart.setTime(calcStartTime); calendarStart.set(Calendar.HOUR_OF_DAY, 0); calendarStart.set(Calendar.MINUTE, 0); calendarStart.set(Calendar.SECOND, 0); Calendar calendarEnd = Calendar.getInstance(); calendarEnd.setTime(calcEndTime); calendarEnd.set(Calendar.HOUR_OF_DAY, 23); calendarEnd.set(Calendar.MINUTE, 59); calendarEnd.set(Calendar.SECOND, 59); while (calendarStart.compareTo(calendarEnd) <= 0) { dateList.add(DateUtil.formatStr(formatString, calendarStart.getTime())); nextConsumer.accept(calendarStart); } return dateList; } /** * 比较两个日期,按天比较(不考虑时间) * * @param srcDate 源日期 * @param desDate 目标日期 * @return srcDate>desDate 1, srcDate==desDate 0 ,stcDate<DesDate -1 */ public static int compareDateByDay(Date srcDate, Date desDate) { if (srcDate == null) { if (desDate == null) { return 0; } else { return -1; } } else { if (desDate == null) { return 1; } else { srcDate = changeTimeDetail(srcDate, 0, 0); desDate = changeTimeDetail(desDate, 0, 0); return DateUtils.isSameDay(srcDate, desDate) ? 0 : srcDate.compareTo(desDate); } } } public static boolean isInDateRange(Date checkDate, Date startDate, Date endDate) { if (Objects.isNull(checkDate)) { checkDate = new Date(); } List<String> rangeDateList = getYearMonthDayList(startDate, endDate); return rangeDateList.contains(formatStr(DatePattern.NORM_DATE_FORMAT, checkDate)); } /** * yyyyMMddHHmmssSSS * * @return {@link String} */ public static String getSecondTimeStr() { return formatStr(DatePattern.SIMPLE_DATETIME_MS_FORMAT, new Date()); } }
[ "siyawu@126.com" ]
siyawu@126.com
1252e14c7f0bc7379791e41952a65165df1320bd
8a43ca36a71b430096c609e96889aae94e93ddc9
/spincast-plugins/spincast-plugins-jdbc-parent/spincast-plugins-jdbc/src/main/java/org/spincast/plugins/jdbc/utils/ItemsAndTotalCountDefault.java
219769027886484ea695779dd59359f388ab8d31
[ "Apache-2.0" ]
permissive
spincast/spincast-framework
18163ee0d5ed3571113ad6f3112cf7f951eee910
fc25e6e61f1d20643662ed94e42003b23fe651f6
refs/heads/master
2022-10-20T11:20:43.008571
2022-10-11T23:21:41
2022-10-11T23:21:41
56,924,959
48
0
null
null
null
null
UTF-8
Java
false
false
709
java
package org.spincast.plugins.jdbc.utils; import java.util.ArrayList; import java.util.List; public class ItemsAndTotalCountDefault<T> implements ItemsAndTotalCount<T> { private final List<T> items; private final long totalCount; /** * Empty result. */ public ItemsAndTotalCountDefault() { this.items = new ArrayList<T>(); this.totalCount = 0; } public ItemsAndTotalCountDefault(List<T> items, long totalCount) { this.items = items; this.totalCount = totalCount; } @Override public List<T> getItems() { return this.items; } @Override public long getTotalCount() { return this.totalCount; } }
[ "electrotype@gmail.com" ]
electrotype@gmail.com
24194d6f262f293556eb64b72829707754dc43b7
de810c12d77476b44d74146f35169210e2c7d944
/ExternalController/src/AgentEnvironment.java
31f43010e6ddf2bd3d3d2536c42cbb9af3b52a96
[]
no_license
adhnous/BookTradingDemo
6e1dfe60bc4c27fe4f42bff1f19d0484f94a00bb
9e416a6c3e0eca3c3fc3e9f4c3313b4e889cf5ca
refs/heads/master
2020-07-02T15:04:57.041890
2019-08-10T02:11:47
2019-08-10T02:11:47
201,566,661
0
0
null
2019-08-10T02:09:53
2019-08-10T02:09:52
null
UTF-8
Java
false
false
9,258
java
import jade.core.Profile; import jade.core.ProfileImpl; import jade.core.Runtime; import jade.wrapper.ContainerController; import jade.wrapper.StaleProxyException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Scanner; import org.apache.commons.cli.BasicParser; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import bookTrading.IO.interpreter.BookAgentInterpreter; import bookTrading.IO.interpreter.BookBuyerInterpreter; import bookTrading.IO.interpreter.BookSellerInterpreter; /** * Command-line arguments: * -agentcontainer * if this is specified, run the platform as an agent container and * connect to another main container; otherwise, run as a main container. * -mainhost [hostname] * the host name of the MAIN container to connect to (default is * localhost) * -mainport [port] * the port number of the MAIN container to connect to (default 1099) * -buyers [buyer1;buyer2] * any buyer agents to instantiate (separated by semi-colons) * -sellers [seller1;seller2] * any seller agents to instantiate (separated by semi-colons) * @author peter * */ public class AgentEnvironment { // arguments public static final String S_AGENTCONTAINER = "ac"; public static final String L_AGENTCONTAINER = "agentcontainer"; public static final String S_MAINHOST = "mh"; public static final String L_MAINHOST = "mainhost"; public static final String S_MAINPORT = "mp"; public static final String L_MAINPORT = "mainport"; public static final String S_BUYERS = "b"; public static final String L_BUYERS = "buyers"; public static final String S_SELLERS = "s"; public static final String L_SELLERS = "sellers"; // default values public static final boolean AGENTCONTAINER = false; public static final String MAINHOST = "localhost"; public static final String MAINPORT = "1099"; public static final List<String> BUYERS = new ArrayList<String>(); public static final List<String> SELLERS = new ArrayList<String>(); public static Options defineOptions() { // create Options object Options options = new Options(); // add the options options.addOption( S_AGENTCONTAINER, L_AGENTCONTAINER, false, "run the platform as an agent container (rather than a main container)" ); options.addOption( S_MAINHOST, L_MAINHOST, true, "the host name of the main container to connect to (default is " + MAINHOST + ")" ); options.addOption( S_MAINPORT, L_MAINPORT, true, "the port number of the main container to connect to (default is " + MAINPORT + ")" ); options.addOption( S_BUYERS, L_BUYERS, true, "any buyer agents to instantiate (separated by ;) - eg. buyer1;buyer2;buyer3" ); options.addOption( S_SELLERS, L_SELLERS, true, "any seller agents to instantiate (separated by ;) - eg. seller1;seller2;seller3" ); // return these options return options; } public static CommandLine parseArguments(Options options, String args[]) throws ParseException { // very simply, parse the arguments and return an object containing them CommandLineParser parser = new BasicParser(); return parser.parse(options, args); } public static Settings interpretArguments(CommandLine cl) { Settings settings = new Settings(); // if the agent container argument is there then run that way settings.setAgentContainer(cl.hasOption(S_AGENTCONTAINER)); // host and port stuff if(cl.hasOption(S_MAINHOST)) { settings.setMainHost(cl.getOptionValue(S_MAINHOST)); } if(cl.hasOption(S_MAINPORT)) { settings.setMainPort(cl.getOptionValue(S_MAINPORT)); } // buyer and seller agents if(cl.hasOption(S_BUYERS)) { settings.setBuyers(Arrays.asList(cl.getOptionValue(S_BUYERS).split(";"))); } if(cl.hasOption(S_SELLERS)) { settings.setSellers(Arrays.asList(cl.getOptionValue(S_SELLERS).split(";"))); } // return the overriden settings return settings; } private ContainerController container; private List<ExternalAgent> agents; private Map<String, BookAgentInterpreter> interpreters; private Thread interpreterThread; /** * Start a new container with the given settings. */ private void startContainer(Settings settings) { // get the JADE runtime singleton instance Runtime rt = Runtime.instance(); // prepare the settings for the platform that we want to get onto Profile p = new ProfileImpl(); p.setParameter(Profile.MAIN_HOST, settings.getMainHost()); p.setParameter(Profile.MAIN_PORT, settings.getMainPort()); // create a container container = settings.isAgentContainer() ? rt.createAgentContainer(p) : rt.createMainContainer(p); } public AgentEnvironment(Settings settings) { // create a new container startContainer(settings); // create some new agents and interpreters agents = new ArrayList<ExternalAgent>(settings.getBuyers().size() + settings.getSellers().size()); interpreters = new HashMap<String, BookAgentInterpreter>(agents.size()); for(String buyerName : settings.getBuyers()) { ExternalAgent buyer; // create a new external agent for each buyer buyer = new ExternalAgent(container, buyerName, ExternalAgent.BUYER_CLASS_NAME); // add them to the list of agents agents.add(buyer); // create and add an interpreter for them interpreters.put(buyerName.toLowerCase(), new BookBuyerInterpreter(buyer)); } for(String sellerName : settings.getSellers()) { ExternalAgent seller; // create a new external agent for each seller seller = new ExternalAgent(container, sellerName, ExternalAgent.SELLER_CLASS_NAME); // add them to the list of agents agents.add(seller); // create and add an interpreter for them interpreters.put(sellerName.toLowerCase(), new BookSellerInterpreter(seller)); } // start the RMA agents.add(new ExternalAgent(container, "rma" + (settings.isAgentContainer() ? "-agent" : ""), "jade.tools.rma.rma")); // start interpreting user input interpreterThread = new Thread(new Runnable() { @Override public void run() { boolean continuePolling = true; // get input from stdin Scanner s = new Scanner(System.in); // keep interpreting until there's no more input, or until // neither agents want to continue while(s.hasNextLine() && continuePolling) { try { // get the next line String line = s.nextLine(); // if the line includes a colon (:) if(line.contains(":")) { // split it at the colon String[] tokens = line.split(":"); // the first token should say which agent is meant by this message String agent = tokens[0].toLowerCase(); // let the agent meant by it interpret it continuePolling = interpreters.get(agent).interpret(tokens[1]); // otherwise } else { // let all the agents interpret it for(BookAgentInterpreter interpreter : interpreters.values()) { if(!interpreter.interpret(line)) { continuePolling = false; } } } } catch(Exception e) { // do nothing } } // close the scanner s.close(); } }); interpreterThread.start(); } public void kill() { // stop the interpreter thread interpreterThread.interrupt(); // kill the agents for(ExternalAgent agent : agents) { agent.kill(); } // kill the container try { container.kill(); } catch (StaleProxyException e) { // do nothing } // free all the memory agents = null; container = null; interpreters = null; interpreterThread = null; } public static void main(String[] args) { // work through the command-line arguments try { // read and parse them Options options = defineOptions(); CommandLine cl = parseArguments(options, args); // start a new environment based on them new AgentEnvironment(interpretArguments(cl)); } catch(ParseException e) { System.err.println("Invalid arguments provided! Type -h for help."); return; } } // a bean for the settings of the environment static class Settings { // default settings private boolean agentContainer = AGENTCONTAINER; private String mainHost = MAINHOST; private String mainPort = MAINPORT; private List<String> buyers = BUYERS; private List<String> sellers = SELLERS; public boolean isAgentContainer() { return agentContainer; } public void setAgentContainer(boolean agentContainer) { this.agentContainer = agentContainer; } public String getMainHost() { return mainHost; } public void setMainHost(String mainHost) { this.mainHost = mainHost; } public String getMainPort() { return mainPort; } public void setMainPort(String mainPort) { this.mainPort = mainPort; } public List<String> getBuyers() { return buyers; } public void setBuyers(List<String> buyers) { this.buyers = buyers; } public List<String> getSellers() { return sellers; } public void setSellers(List<String> sellers) { this.sellers = sellers; } } }
[ "pmansour112@gmail.com" ]
pmansour112@gmail.com
e0a7907696cd9746235cae082d626eadf4a44b59
745142e46466b5ceb4c798644405dfa0a70b9f84
/app/src/main/java/any/audio/Activity/UpdateThemedActivity.java
dec4ae75376adaee4dfc3b009e4c07aec9431220
[]
no_license
yibulaxi/AnyAudio
c686e819c6709cd82124fa798e6c021b351b86fa
9a2f305defa250f2f584af60372c8f898f04032b
refs/heads/master
2021-06-10T23:33:09.518457
2017-01-17T05:49:00
2017-01-17T05:49:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,613
java
package any.audio.Activity; import android.content.Intent; import android.graphics.Typeface; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.TextView; import any.audio.Config.Constants; import any.audio.Managers.FontManager; import any.audio.R; import any.audio.SharedPreferences.SharedPrefrenceUtils; public class UpdateThemedActivity extends AppCompatActivity { TextView tvUpdateMessage; TextView tvUpdateDescription; TextView btnCancel; TextView btnDownload; Typeface tf; CheckBox mUpdateCheckBox; private String newInThisUpdateDescription; private String newAppDownloadUrl; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_update_themed); tf = FontManager.getInstance(this).getTypeFace(FontManager.FONT_RALEWAY_REGULAR); tvUpdateMessage = (TextView) findViewById(R.id.updateMsg); tvUpdateDescription = (TextView) findViewById(R.id.updateDescription); btnCancel = (TextView) findViewById(R.id.cancel_update_msg_dialog); btnDownload = (TextView) findViewById(R.id.download_btn_update_msg); mUpdateCheckBox = (CheckBox) findViewById(R.id.checkedConfirmation); mUpdateCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean byUser) { if (byUser) { if (compoundButton.isChecked()) { SharedPrefrenceUtils.getInstance(UpdateThemedActivity.this).setDoNotRemindMeAgainForAppUpdate(true); } else { SharedPrefrenceUtils.getInstance(UpdateThemedActivity.this).setDoNotRemindMeAgainForAppUpdate(false); } } } }); //Regular TypeFace btnDownload.setTypeface(tf); btnCancel.setTypeface(tf); tvUpdateMessage.setTypeface(tf); tvUpdateDescription.setTypeface(tf); // data setters newInThisUpdateDescription = getIntent().getExtras().getString(Constants.EXTRAA_NEW_UPDATE_DESC); newAppDownloadUrl = getIntent().getExtras().getString(Constants.KEY_NEW_UPDATE_URL); tvUpdateDescription.setText(newInThisUpdateDescription); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_update_themed, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } public void download(View view) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(newAppDownloadUrl)); startActivity(intent); finish(); } public void cancel(View view) { finish(); } }
[ "zeseeit@gmail.com" ]
zeseeit@gmail.com
c0607ccb1a974937949f80a56fd08511350457f7
b80b63956bd7167159efa1f41cf65bd7a2290287
/Unique Paths II-2.java
a4dc04ce2f50f0ac3d8c39e5ddac5e8b0d623a0b
[]
no_license
winterfly/Lintcode
6a3ea3ce0748a3edc7f7257d5b65e94ff514dbe8
9ff0375f24b2241341b21f19f8937177e973ab42
refs/heads/master
2021-01-21T04:55:44.308851
2016-06-22T03:17:20
2016-06-22T03:17:20
55,869,211
0
0
null
null
null
null
UTF-8
Java
false
false
959
java
public class Solution { /** * @param obstacleGrid: A list of lists of integers * @return: An integer */ public int uniquePathsWithObstacles(int[][] obstacleGrid) { if (obstacleGrid == null || obstacleGrid.length == 0) return 0; int m = obstacleGrid.length; if (obstacleGrid[0] == null || obstacleGrid[0].length == 0) return 0; int n = obstacleGrid[0].length; if (obstacleGrid[m-1][n-1] == 1) { return 0; } int[] dp = new int[n]; dp[0] = 1 - obstacleGrid[0][0]; for (int j = 1; j < n; j++) { dp[j] = obstacleGrid[0][j] == 0 ? dp[j-1] : 0; } for (int i = 1; i < m; i++) { dp[0] = obstacleGrid[i][0] == 0 ? dp[0] : 0; for (int j = 1; j < n; j++) { dp[j] = obstacleGrid[i][j] == 0 ? dp[j] + dp[j-1] : 0; } } return dp[n-1]; } }
[ "winterflyfei@gmail.com" ]
winterflyfei@gmail.com
cacb9ce965e399c0336801fbc6d583b240893d11
ceaf02b284566cf1c6c75e739a812f7edb232fe4
/Implementation/src/main/java/de/kumpelblase2/remoteentities/api/goals/DesirePanic.java
96a85843449bd81077f88621cbddacefd3d68961
[ "MIT" ]
permissive
kumpelblase2/remote-entities-nxt
a0dff1ee9288416eb34209968da2003047af4263
17f706041eb26170737a588f8dbea03168e64fba
refs/heads/master
2021-01-15T22:29:25.424070
2014-12-14T11:55:30
2014-12-14T11:55:30
24,538,107
0
1
null
null
null
null
UTF-8
Java
false
false
2,039
java
package de.kumpelblase2.remoteentities.api.goals; import de.kumpelblase2.remoteentities.api.RemoteEntity; import de.kumpelblase2.remoteentities.api.thinking.DesireBase; import de.kumpelblase2.remoteentities.api.thinking.DesireType; import de.kumpelblase2.remoteentities.nms.RandomPositionGenerator; import de.kumpelblase2.remoteentities.persistence.ParameterData; import de.kumpelblase2.remoteentities.persistence.SerializeAs; import de.kumpelblase2.remoteentities.utilities.ReflectionUtil; import net.minecraft.server.v1_7_R1.Vec3D; import org.bukkit.Location; /** * Using this desire the entity will move around in panic when it gets damaged. */ public class DesirePanic extends DesireBase { protected double m_x; protected double m_y; protected double m_z; @SerializeAs(pos = 1) protected double m_speed; @Deprecated public DesirePanic(RemoteEntity inEntity) { super(inEntity); this.m_type = DesireType.PRIMAL_INSTINCT; } public DesirePanic() { this(-1); } public DesirePanic(double inSpeed) { super(); this.m_speed = inSpeed; this.m_type = DesireType.PRIMAL_INSTINCT; } @Override public boolean shouldExecute() { if(this.getEntityHandle() == null || (this.getEntityHandle().getLastDamager() == null && !this.getEntityHandle().isBurning())) return false; else { Vec3D vec = RandomPositionGenerator.a(this.getEntityHandle(), 5, 4); if(vec == null) return false; else { this.m_x = vec.c; this.m_y = vec.d; this.m_z = vec.e; Vec3D.a.release(vec); return true; } } } @Override public void startExecuting() { this.getRemoteEntity().move(new Location(this.getRemoteEntity().getBukkitEntity().getWorld(), this.m_x, this.m_y, this.m_z), (this.m_speed == -1 ? this.getRemoteEntity().getSpeed() : this.m_speed)); } @Override public boolean canContinue() { return !this.getNavigation().g(); } @Override public ParameterData[] getSerializableData() { return ReflectionUtil.getParameterDataForClass(this).toArray(new ParameterData[0]); } }
[ "tim@infinityblade.de" ]
tim@infinityblade.de
024fabd9c8d537fafac8508362f86a9dac8c48a3
2b3c91ef240f972d3f7ac3077fcfc3e8e03e3064
/src/main/java/com/clesun/web/skyland/entity/ZhnyNsglXqExample.java
86b893e783253ae1802fee4bbc0574b2ce5933b4
[]
no_license
MrQunZhu/skyland
1b9d67fa28ab0b7e3854efd36ea614108548618b
bb5e0723a0c3263ba560b7d906686b35a812e924
refs/heads/master
2022-07-26T12:28:16.583846
2020-03-01T07:21:02
2020-03-01T07:21:02
196,967,340
0
0
null
2022-07-06T20:41:28
2019-07-15T09:25:49
JavaScript
UTF-8
Java
false
false
37,663
java
package com.clesun.web.skyland.entity; import java.util.ArrayList; import java.util.Date; import java.util.List; public class ZhnyNsglXqExample { /** * This field was generated by MyBatis Generator. * This field corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ protected String orderByClause; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ protected boolean distinct; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ protected List<Criteria> oredCriteria; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ protected int offset = -1; /** * This field was generated by MyBatis Generator. * This field corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ protected int limit = -1; /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public ZhnyNsglXqExample() { oredCriteria = new ArrayList<Criteria>(); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public String getOrderByClause() { return orderByClause; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public void setDistinct(boolean distinct) { this.distinct = distinct; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public boolean isDistinct() { return distinct; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public List<Criteria> getOredCriteria() { return oredCriteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public void or(Criteria criteria) { oredCriteria.add(criteria); } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public void setOffset(int offset) { this.offset=offset; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public int getOffset() { return offset; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public void setLimit(int limit) { this.limit=limit; } /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public int getLimit() { return limit; } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } public void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } public void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThanOrEqualTo(Integer value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria andIdLessThanOrEqualTo(Integer value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andNsglIdIsNull() { addCriterion("NSGL_ID is null"); return (Criteria) this; } public Criteria andNsglIdIsNotNull() { addCriterion("NSGL_ID is not null"); return (Criteria) this; } public Criteria andNsglIdEqualTo(Integer value) { addCriterion("NSGL_ID =", value, "nsglId"); return (Criteria) this; } public Criteria andNsglIdNotEqualTo(Integer value) { addCriterion("NSGL_ID <>", value, "nsglId"); return (Criteria) this; } public Criteria andNsglIdGreaterThan(Integer value) { addCriterion("NSGL_ID >", value, "nsglId"); return (Criteria) this; } public Criteria andNsglIdGreaterThanOrEqualTo(Integer value) { addCriterion("NSGL_ID >=", value, "nsglId"); return (Criteria) this; } public Criteria andNsglIdLessThan(Integer value) { addCriterion("NSGL_ID <", value, "nsglId"); return (Criteria) this; } public Criteria andNsglIdLessThanOrEqualTo(Integer value) { addCriterion("NSGL_ID <=", value, "nsglId"); return (Criteria) this; } public Criteria andNsglIdIn(List<Integer> values) { addCriterion("NSGL_ID in", values, "nsglId"); return (Criteria) this; } public Criteria andNsglIdNotIn(List<Integer> values) { addCriterion("NSGL_ID not in", values, "nsglId"); return (Criteria) this; } public Criteria andNsglIdBetween(Integer value1, Integer value2) { addCriterion("NSGL_ID between", value1, value2, "nsglId"); return (Criteria) this; } public Criteria andNsglIdNotBetween(Integer value1, Integer value2) { addCriterion("NSGL_ID not between", value1, value2, "nsglId"); return (Criteria) this; } public Criteria andCzrIsNull() { addCriterion("CZR is null"); return (Criteria) this; } public Criteria andCzrIsNotNull() { addCriterion("CZR is not null"); return (Criteria) this; } public Criteria andCzrEqualTo(String value) { addCriterion("CZR =", value, "czr"); return (Criteria) this; } public Criteria andCzrNotEqualTo(String value) { addCriterion("CZR <>", value, "czr"); return (Criteria) this; } public Criteria andCzrGreaterThan(String value) { addCriterion("CZR >", value, "czr"); return (Criteria) this; } public Criteria andCzrGreaterThanOrEqualTo(String value) { addCriterion("CZR >=", value, "czr"); return (Criteria) this; } public Criteria andCzrLessThan(String value) { addCriterion("CZR <", value, "czr"); return (Criteria) this; } public Criteria andCzrLessThanOrEqualTo(String value) { addCriterion("CZR <=", value, "czr"); return (Criteria) this; } public Criteria andCzrLike(String value) { addCriterion("CZR like", value, "czr"); return (Criteria) this; } public Criteria andCzrNotLike(String value) { addCriterion("CZR not like", value, "czr"); return (Criteria) this; } public Criteria andCzrIn(List<String> values) { addCriterion("CZR in", values, "czr"); return (Criteria) this; } public Criteria andCzrNotIn(List<String> values) { addCriterion("CZR not in", values, "czr"); return (Criteria) this; } public Criteria andCzrBetween(String value1, String value2) { addCriterion("CZR between", value1, value2, "czr"); return (Criteria) this; } public Criteria andCzrNotBetween(String value1, String value2) { addCriterion("CZR not between", value1, value2, "czr"); return (Criteria) this; } public Criteria andCzlxIsNull() { addCriterion("CZLX is null"); return (Criteria) this; } public Criteria andCzlxIsNotNull() { addCriterion("CZLX is not null"); return (Criteria) this; } public Criteria andCzlxEqualTo(String value) { addCriterion("CZLX =", value, "czlx"); return (Criteria) this; } public Criteria andCzlxNotEqualTo(String value) { addCriterion("CZLX <>", value, "czlx"); return (Criteria) this; } public Criteria andCzlxGreaterThan(String value) { addCriterion("CZLX >", value, "czlx"); return (Criteria) this; } public Criteria andCzlxGreaterThanOrEqualTo(String value) { addCriterion("CZLX >=", value, "czlx"); return (Criteria) this; } public Criteria andCzlxLessThan(String value) { addCriterion("CZLX <", value, "czlx"); return (Criteria) this; } public Criteria andCzlxLessThanOrEqualTo(String value) { addCriterion("CZLX <=", value, "czlx"); return (Criteria) this; } public Criteria andCzlxLike(String value) { addCriterion("CZLX like", value, "czlx"); return (Criteria) this; } public Criteria andCzlxNotLike(String value) { addCriterion("CZLX not like", value, "czlx"); return (Criteria) this; } public Criteria andCzlxIn(List<String> values) { addCriterion("CZLX in", values, "czlx"); return (Criteria) this; } public Criteria andCzlxNotIn(List<String> values) { addCriterion("CZLX not in", values, "czlx"); return (Criteria) this; } public Criteria andCzlxBetween(String value1, String value2) { addCriterion("CZLX between", value1, value2, "czlx"); return (Criteria) this; } public Criteria andCzlxNotBetween(String value1, String value2) { addCriterion("CZLX not between", value1, value2, "czlx"); return (Criteria) this; } public Criteria andCzlbIsNull() { addCriterion("CZLB is null"); return (Criteria) this; } public Criteria andCzlbIsNotNull() { addCriterion("CZLB is not null"); return (Criteria) this; } public Criteria andCzlbEqualTo(String value) { addCriterion("CZLB =", value, "czlb"); return (Criteria) this; } public Criteria andCzlbNotEqualTo(String value) { addCriterion("CZLB <>", value, "czlb"); return (Criteria) this; } public Criteria andCzlbGreaterThan(String value) { addCriterion("CZLB >", value, "czlb"); return (Criteria) this; } public Criteria andCzlbGreaterThanOrEqualTo(String value) { addCriterion("CZLB >=", value, "czlb"); return (Criteria) this; } public Criteria andCzlbLessThan(String value) { addCriterion("CZLB <", value, "czlb"); return (Criteria) this; } public Criteria andCzlbLessThanOrEqualTo(String value) { addCriterion("CZLB <=", value, "czlb"); return (Criteria) this; } public Criteria andCzlbLike(String value) { addCriterion("CZLB like", value, "czlb"); return (Criteria) this; } public Criteria andCzlbNotLike(String value) { addCriterion("CZLB not like", value, "czlb"); return (Criteria) this; } public Criteria andCzlbIn(List<String> values) { addCriterion("CZLB in", values, "czlb"); return (Criteria) this; } public Criteria andCzlbNotIn(List<String> values) { addCriterion("CZLB not in", values, "czlb"); return (Criteria) this; } public Criteria andCzlbBetween(String value1, String value2) { addCriterion("CZLB between", value1, value2, "czlb"); return (Criteria) this; } public Criteria andCzlbNotBetween(String value1, String value2) { addCriterion("CZLB not between", value1, value2, "czlb"); return (Criteria) this; } public Criteria andCzkssjIsNull() { addCriterion("CZKSSJ is null"); return (Criteria) this; } public Criteria andCzkssjIsNotNull() { addCriterion("CZKSSJ is not null"); return (Criteria) this; } public Criteria andCzkssjEqualTo(Date value) { addCriterion("CZKSSJ =", value, "czkssj"); return (Criteria) this; } public Criteria andCzkssjNotEqualTo(Date value) { addCriterion("CZKSSJ <>", value, "czkssj"); return (Criteria) this; } public Criteria andCzkssjGreaterThan(Date value) { addCriterion("CZKSSJ >", value, "czkssj"); return (Criteria) this; } public Criteria andCzkssjGreaterThanOrEqualTo(Date value) { addCriterion("CZKSSJ >=", value, "czkssj"); return (Criteria) this; } public Criteria andCzkssjLessThan(Date value) { addCriterion("CZKSSJ <", value, "czkssj"); return (Criteria) this; } public Criteria andCzkssjLessThanOrEqualTo(Date value) { addCriterion("CZKSSJ <=", value, "czkssj"); return (Criteria) this; } public Criteria andCzkssjIn(List<Date> values) { addCriterion("CZKSSJ in", values, "czkssj"); return (Criteria) this; } public Criteria andCzkssjNotIn(List<Date> values) { addCriterion("CZKSSJ not in", values, "czkssj"); return (Criteria) this; } public Criteria andCzkssjBetween(Date value1, Date value2) { addCriterion("CZKSSJ between", value1, value2, "czkssj"); return (Criteria) this; } public Criteria andCzkssjNotBetween(Date value1, Date value2) { addCriterion("CZKSSJ not between", value1, value2, "czkssj"); return (Criteria) this; } public Criteria andCzjssjIsNull() { addCriterion("CZJSSJ is null"); return (Criteria) this; } public Criteria andCzjssjIsNotNull() { addCriterion("CZJSSJ is not null"); return (Criteria) this; } public Criteria andCzjssjEqualTo(Date value) { addCriterion("CZJSSJ =", value, "czjssj"); return (Criteria) this; } public Criteria andCzjssjNotEqualTo(Date value) { addCriterion("CZJSSJ <>", value, "czjssj"); return (Criteria) this; } public Criteria andCzjssjGreaterThan(Date value) { addCriterion("CZJSSJ >", value, "czjssj"); return (Criteria) this; } public Criteria andCzjssjGreaterThanOrEqualTo(Date value) { addCriterion("CZJSSJ >=", value, "czjssj"); return (Criteria) this; } public Criteria andCzjssjLessThan(Date value) { addCriterion("CZJSSJ <", value, "czjssj"); return (Criteria) this; } public Criteria andCzjssjLessThanOrEqualTo(Date value) { addCriterion("CZJSSJ <=", value, "czjssj"); return (Criteria) this; } public Criteria andCzjssjIn(List<Date> values) { addCriterion("CZJSSJ in", values, "czjssj"); return (Criteria) this; } public Criteria andCzjssjNotIn(List<Date> values) { addCriterion("CZJSSJ not in", values, "czjssj"); return (Criteria) this; } public Criteria andCzjssjBetween(Date value1, Date value2) { addCriterion("CZJSSJ between", value1, value2, "czjssj"); return (Criteria) this; } public Criteria andCzjssjNotBetween(Date value1, Date value2) { addCriterion("CZJSSJ not between", value1, value2, "czjssj"); return (Criteria) this; } public Criteria andTpdzIsNull() { addCriterion("TPDZ is null"); return (Criteria) this; } public Criteria andTpdzIsNotNull() { addCriterion("TPDZ is not null"); return (Criteria) this; } public Criteria andTpdzEqualTo(String value) { addCriterion("TPDZ =", value, "tpdz"); return (Criteria) this; } public Criteria andTpdzNotEqualTo(String value) { addCriterion("TPDZ <>", value, "tpdz"); return (Criteria) this; } public Criteria andTpdzGreaterThan(String value) { addCriterion("TPDZ >", value, "tpdz"); return (Criteria) this; } public Criteria andTpdzGreaterThanOrEqualTo(String value) { addCriterion("TPDZ >=", value, "tpdz"); return (Criteria) this; } public Criteria andTpdzLessThan(String value) { addCriterion("TPDZ <", value, "tpdz"); return (Criteria) this; } public Criteria andTpdzLessThanOrEqualTo(String value) { addCriterion("TPDZ <=", value, "tpdz"); return (Criteria) this; } public Criteria andTpdzLike(String value) { addCriterion("TPDZ like", value, "tpdz"); return (Criteria) this; } public Criteria andTpdzNotLike(String value) { addCriterion("TPDZ not like", value, "tpdz"); return (Criteria) this; } public Criteria andTpdzIn(List<String> values) { addCriterion("TPDZ in", values, "tpdz"); return (Criteria) this; } public Criteria andTpdzNotIn(List<String> values) { addCriterion("TPDZ not in", values, "tpdz"); return (Criteria) this; } public Criteria andTpdzBetween(String value1, String value2) { addCriterion("TPDZ between", value1, value2, "tpdz"); return (Criteria) this; } public Criteria andTpdzNotBetween(String value1, String value2) { addCriterion("TPDZ not between", value1, value2, "tpdz"); return (Criteria) this; } public Criteria andCzbzIsNull() { addCriterion("CZBZ is null"); return (Criteria) this; } public Criteria andCzbzIsNotNull() { addCriterion("CZBZ is not null"); return (Criteria) this; } public Criteria andCzbzEqualTo(String value) { addCriterion("CZBZ =", value, "czbz"); return (Criteria) this; } public Criteria andCzbzNotEqualTo(String value) { addCriterion("CZBZ <>", value, "czbz"); return (Criteria) this; } public Criteria andCzbzGreaterThan(String value) { addCriterion("CZBZ >", value, "czbz"); return (Criteria) this; } public Criteria andCzbzGreaterThanOrEqualTo(String value) { addCriterion("CZBZ >=", value, "czbz"); return (Criteria) this; } public Criteria andCzbzLessThan(String value) { addCriterion("CZBZ <", value, "czbz"); return (Criteria) this; } public Criteria andCzbzLessThanOrEqualTo(String value) { addCriterion("CZBZ <=", value, "czbz"); return (Criteria) this; } public Criteria andCzbzLike(String value) { addCriterion("CZBZ like", value, "czbz"); return (Criteria) this; } public Criteria andCzbzNotLike(String value) { addCriterion("CZBZ not like", value, "czbz"); return (Criteria) this; } public Criteria andCzbzIn(List<String> values) { addCriterion("CZBZ in", values, "czbz"); return (Criteria) this; } public Criteria andCzbzNotIn(List<String> values) { addCriterion("CZBZ not in", values, "czbz"); return (Criteria) this; } public Criteria andCzbzBetween(String value1, String value2) { addCriterion("CZBZ between", value1, value2, "czbz"); return (Criteria) this; } public Criteria andCzbzNotBetween(String value1, String value2) { addCriterion("CZBZ not between", value1, value2, "czbz"); return (Criteria) this; } public Criteria andBy1IsNull() { addCriterion("BY1 is null"); return (Criteria) this; } public Criteria andBy1IsNotNull() { addCriterion("BY1 is not null"); return (Criteria) this; } public Criteria andBy1EqualTo(String value) { addCriterion("BY1 =", value, "by1"); return (Criteria) this; } public Criteria andBy1NotEqualTo(String value) { addCriterion("BY1 <>", value, "by1"); return (Criteria) this; } public Criteria andBy1GreaterThan(String value) { addCriterion("BY1 >", value, "by1"); return (Criteria) this; } public Criteria andBy1GreaterThanOrEqualTo(String value) { addCriterion("BY1 >=", value, "by1"); return (Criteria) this; } public Criteria andBy1LessThan(String value) { addCriterion("BY1 <", value, "by1"); return (Criteria) this; } public Criteria andBy1LessThanOrEqualTo(String value) { addCriterion("BY1 <=", value, "by1"); return (Criteria) this; } public Criteria andBy1Like(String value) { addCriterion("BY1 like", value, "by1"); return (Criteria) this; } public Criteria andBy1NotLike(String value) { addCriterion("BY1 not like", value, "by1"); return (Criteria) this; } public Criteria andBy1In(List<String> values) { addCriterion("BY1 in", values, "by1"); return (Criteria) this; } public Criteria andBy1NotIn(List<String> values) { addCriterion("BY1 not in", values, "by1"); return (Criteria) this; } public Criteria andBy1Between(String value1, String value2) { addCriterion("BY1 between", value1, value2, "by1"); return (Criteria) this; } public Criteria andBy1NotBetween(String value1, String value2) { addCriterion("BY1 not between", value1, value2, "by1"); return (Criteria) this; } public Criteria andBy2IsNull() { addCriterion("BY2 is null"); return (Criteria) this; } public Criteria andBy2IsNotNull() { addCriterion("BY2 is not null"); return (Criteria) this; } public Criteria andBy2EqualTo(String value) { addCriterion("BY2 =", value, "by2"); return (Criteria) this; } public Criteria andBy2NotEqualTo(String value) { addCriterion("BY2 <>", value, "by2"); return (Criteria) this; } public Criteria andBy2GreaterThan(String value) { addCriterion("BY2 >", value, "by2"); return (Criteria) this; } public Criteria andBy2GreaterThanOrEqualTo(String value) { addCriterion("BY2 >=", value, "by2"); return (Criteria) this; } public Criteria andBy2LessThan(String value) { addCriterion("BY2 <", value, "by2"); return (Criteria) this; } public Criteria andBy2LessThanOrEqualTo(String value) { addCriterion("BY2 <=", value, "by2"); return (Criteria) this; } public Criteria andBy2Like(String value) { addCriterion("BY2 like", value, "by2"); return (Criteria) this; } public Criteria andBy2NotLike(String value) { addCriterion("BY2 not like", value, "by2"); return (Criteria) this; } public Criteria andBy2In(List<String> values) { addCriterion("BY2 in", values, "by2"); return (Criteria) this; } public Criteria andBy2NotIn(List<String> values) { addCriterion("BY2 not in", values, "by2"); return (Criteria) this; } public Criteria andBy2Between(String value1, String value2) { addCriterion("BY2 between", value1, value2, "by2"); return (Criteria) this; } public Criteria andBy2NotBetween(String value1, String value2) { addCriterion("BY2 not between", value1, value2, "by2"); return (Criteria) this; } public Criteria andBy3IsNull() { addCriterion("BY3 is null"); return (Criteria) this; } public Criteria andBy3IsNotNull() { addCriterion("BY3 is not null"); return (Criteria) this; } public Criteria andBy3EqualTo(String value) { addCriterion("BY3 =", value, "by3"); return (Criteria) this; } public Criteria andBy3NotEqualTo(String value) { addCriterion("BY3 <>", value, "by3"); return (Criteria) this; } public Criteria andBy3GreaterThan(String value) { addCriterion("BY3 >", value, "by3"); return (Criteria) this; } public Criteria andBy3GreaterThanOrEqualTo(String value) { addCriterion("BY3 >=", value, "by3"); return (Criteria) this; } public Criteria andBy3LessThan(String value) { addCriterion("BY3 <", value, "by3"); return (Criteria) this; } public Criteria andBy3LessThanOrEqualTo(String value) { addCriterion("BY3 <=", value, "by3"); return (Criteria) this; } public Criteria andBy3Like(String value) { addCriterion("BY3 like", value, "by3"); return (Criteria) this; } public Criteria andBy3NotLike(String value) { addCriterion("BY3 not like", value, "by3"); return (Criteria) this; } public Criteria andBy3In(List<String> values) { addCriterion("BY3 in", values, "by3"); return (Criteria) this; } public Criteria andBy3NotIn(List<String> values) { addCriterion("BY3 not in", values, "by3"); return (Criteria) this; } public Criteria andBy3Between(String value1, String value2) { addCriterion("BY3 between", value1, value2, "by3"); return (Criteria) this; } public Criteria andBy3NotBetween(String value1, String value2) { addCriterion("BY3 not between", value1, value2, "by3"); return (Criteria) this; } public Criteria andCzrbhIsNull() { addCriterion("CZRBH is null"); return (Criteria) this; } public Criteria andCzrbhIsNotNull() { addCriterion("CZRBH is not null"); return (Criteria) this; } public Criteria andCzrbhEqualTo(String value) { addCriterion("CZRBH =", value, "czrbh"); return (Criteria) this; } public Criteria andCzrbhNotEqualTo(String value) { addCriterion("CZRBH <>", value, "czrbh"); return (Criteria) this; } public Criteria andCzrbhGreaterThan(String value) { addCriterion("CZRBH >", value, "czrbh"); return (Criteria) this; } public Criteria andCzrbhGreaterThanOrEqualTo(String value) { addCriterion("CZRBH >=", value, "czrbh"); return (Criteria) this; } public Criteria andCzrbhLessThan(String value) { addCriterion("CZRBH <", value, "czrbh"); return (Criteria) this; } public Criteria andCzrbhLessThanOrEqualTo(String value) { addCriterion("CZRBH <=", value, "czrbh"); return (Criteria) this; } public Criteria andCzrbhLike(String value) { addCriterion("CZRBH like", value, "czrbh"); return (Criteria) this; } public Criteria andCzrbhNotLike(String value) { addCriterion("CZRBH not like", value, "czrbh"); return (Criteria) this; } public Criteria andCzrbhIn(List<String> values) { addCriterion("CZRBH in", values, "czrbh"); return (Criteria) this; } public Criteria andCzrbhNotIn(List<String> values) { addCriterion("CZRBH not in", values, "czrbh"); return (Criteria) this; } public Criteria andCzrbhBetween(String value1, String value2) { addCriterion("CZRBH between", value1, value2, "czrbh"); return (Criteria) this; } public Criteria andCzrbhNotBetween(String value1, String value2) { addCriterion("CZRBH not between", value1, value2, "czrbh"); return (Criteria) this; } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated do_not_delete_during_merge Mon Jan 21 10:33:42 CST 2019 */ public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } /** * This class was generated by MyBatis Generator. * This class corresponds to the database table ZHNY_NSGL_XQ * * @mbggenerated Mon Jan 21 10:33:42 CST 2019 */ public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
[ "1450962534@qq.com" ]
1450962534@qq.com
94ffde86a9b1e1dc3486828dc3f9d75754ba40c5
1349a70213bf2ebe13d7a11e7fa2f34009b44294
/src/main/java/javaguru/sunday/teacher/lesson_15/homework/level_6_middle/videostore/Movie.java
4f60fbc8d53f7843ce446d8dee0902faec329f87
[]
no_license
AlexJavaGuru/java_1_sunday_2020_september
4a72519dfe643eaea417df65429d2ef4e9aff882
1539f396311c28d2e625f3b18427ae4586f078a7
refs/heads/master
2023-03-12T03:27:43.378963
2021-02-19T07:39:40
2021-02-19T07:39:40
298,872,670
1
0
null
null
null
null
UTF-8
Java
false
false
516
java
package javaguru.sunday.teacher.lesson_15.homework.level_6_middle.videostore; class Movie { public static final String REGULAR = "REGULAR"; public static final String NEW_RELEASE = "NEW_RELEASE"; public static final String CHILDRENS = "CHILDRENS"; private String title; private String priceCode; public Movie(String title, String priceCode) { this.title = title; this.priceCode = priceCode; } public String getTitle () { return title; } public String getPriceCode() { return priceCode; } }
[ "alexoverd01@gmail.com" ]
alexoverd01@gmail.com
8fc6508c7689edd96ac0bde9daa7459d320b8013
bac897b6c61d8c4e31e3542da20bd4d360cda98c
/src/main/java/daily_coding_challenges/Prob118_Sorted_Squares_List.java
1e98989b4b5f7f0b220e775cd9fb811d9a204c55
[]
no_license
prathameshtajane/java-coding-practice
9dd76cd9b038e66058877d1264fa8a349ace20ec
4b03be0c65d4eee21e20a7a7c19e4271e268b15b
refs/heads/master
2020-04-03T17:44:39.522101
2019-02-14T03:47:00
2019-02-14T03:47:00
155,457,535
0
0
null
null
null
null
UTF-8
Java
false
false
1,965
java
package daily_coding_challenges; /* This problem was asked by Google. Given a sorted list of integers, square the elements and give the output in sorted order. For example, given [-9, -2, 0, 2, 3], return [0, 4, 4, 9, 81]. */ import java.util.Arrays; import java.util.Collections; import java.util.List; public class Prob118_Sorted_Squares_List { //Brute force approach //Time complexity : O(nlogn) //Space complexity : O(1) private static List<Integer> sortedSquresList(List<Integer> input_list){ //calculate squares of each number in list for(int i = 0;i<input_list.size() ;i++){ input_list.set(i,(int) Math.pow(input_list.get(i),2)); } //sorting Collections.sort(input_list); return input_list; } //Linear approach //Time complexity : O(n) //Space complexity : O(n) private static List<Integer> sortedSquresListLinear(List<Integer> input_list){ int p1 = 0; int p2 = input_list.size()-1; int op_list_index = input_list.size(); Integer[] op_arr = new Integer[op_list_index]; --op_list_index; while(p2 >= p1){ if(Math.abs(input_list.get(p1)) >= Math.abs(input_list.get(p2))){ op_arr[op_list_index]=(int)Math.pow(input_list.get(p1),2); p1++; }else{ op_arr[op_list_index]=(int)Math.pow(input_list.get(p2),2); p2--; } op_list_index--; } return Arrays.asList(op_arr); } public static void main(String[] args) { System.out.println("Sorted Squares List"); Integer[] input = {-9, -2, 0, 2, 3}; // for(Integer each :sortedSquresList(Arrays.asList(input))){ // System.out.println(each); // } for(Integer each :sortedSquresListLinear(Arrays.asList(input))){ System.out.println(each); } } }
[ "tajane.p@husky.neu.edu" ]
tajane.p@husky.neu.edu
708a84386765434350ecce2ae3417a979ba9f0dd
dc8094cceac6d43e8b771ad278b58931bb92d709
/2020/src/test/java/net/jjshanks/InputReaderTest.java
10a72af39266dc094ded1bdfa5deefaa1cd6f463
[]
no_license
jjshanks/adventofcode-legacy
c54bb6ab1ef98131a26efb6d9d9a474175b00239
9278208a284fb32996dc183c6cdcece7049475db
refs/heads/master
2023-01-27T15:56:09.768986
2020-12-07T05:27:46
2020-12-07T05:27:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,147
java
package net.jjshanks; import java.util.List; import java.util.function.Function; import junit.framework.TestCase; import net.jjshanks.error.JollyException; public class InputReaderTest extends TestCase { public void testStringReader() throws JollyException { InputReader<String> ir = new InputReader<>("testInput1"); List<String> actual = ir.getInput(Function.identity()); List<String> expected = List.of("2", "3", "5", "7"); assertEquals(expected, actual); } public void testFunctionReader() throws JollyException { InputReader<Integer> ir = new InputReader<>("testInput1"); List<Integer> actual = ir.getInput(Integer::parseInt); List<Integer> expected = List.of(2, 3, 5, 7); assertEquals(expected, actual); } public void testReaderWithScannerInput() throws JollyException { InputReader<String> ir = new InputReader<>("testInput2"); List<String> actual = ir.getInput(Function.identity(), ir.DEFAULT_COLLECTOR, "[\r\n][\r\n]+"); List<String> expected = List.of("1\n2", "3\n4", "123"); assertEquals(expected, actual); } }
[ "jjshanks@gmail.com" ]
jjshanks@gmail.com
a0e8ca8a30e386b3153beee6c19753d1e86726df
7761c124eaec8e60504fc7bb27dbf136dde0bd4b
/map_application_android/app/src/main/java/finki/ukim/mk/map_application/DeleteAlertDialog.java
8d46b70e81ca3e1c4b113a0eb99aa84aeba53766
[]
no_license
vblazhes/map-app-stack
c45f4ccf297a8c8f4a4ccced0fc15a03ffdecfee
47d40a54050ae5fa4bbe4572f011cd1db91a4eff
refs/heads/master
2022-12-21T10:06:18.940338
2020-09-22T19:25:44
2020-09-22T19:25:44
297,743,627
0
0
null
null
null
null
UTF-8
Java
false
false
2,179
java
package finki.ukim.mk.map_application; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatDialogFragment; public class DeleteAlertDialog extends AppCompatDialogFragment { private DeleteAlertDialogListener listener; private int POSITION; public static DeleteAlertDialog newInstance(int position) { Bundle args = new Bundle(); args.putInt("position", position); DeleteAlertDialog fragment = new DeleteAlertDialog(); fragment.setArguments(args); return fragment; } @NonNull @Override public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { // return super.onCreateDialog(savedInstanceState); POSITION = getArguments().getInt("position"); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle("Delete") .setMessage("Are you sure you want to delete this map?") .setNegativeButton("cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }) .setPositiveButton("yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { listener.onYesClicked(POSITION); } }); return builder.create(); } public interface DeleteAlertDialogListener{ void onYesClicked(int position); } @Override public void onAttach(@NonNull Context context) { super.onAttach(context); try { listener = (DeleteAlertDialogListener) context; }catch (ClassCastException e){ throw new ClassCastException(context.toString() +" must implement DeleteAlertDialogListener"); } } }
[ "62813356+vblazhes@users.noreply.github.com" ]
62813356+vblazhes@users.noreply.github.com
46f3d1a9de5e7d09ae6a808f3acb84a49185df0e
3af6963d156fc1bf7409771d9b7ed30b5a207dc1
/runtime/src/main/java/apple/eventkitui/EKCalendarChooserDelegateAdapter.java
5ed120c6b8c6aa57364fa638069764f7efcbc63d
[ "Apache-2.0" ]
permissive
yava555/j2objc
1761d7ffb861b5469cf7049b51f7b73c6d3652e4
dba753944b8306b9a5b54728a40ca30bd17bdf63
refs/heads/master
2020-12-30T23:23:50.723961
2015-09-03T06:57:20
2015-09-03T06:57:20
48,475,187
0
0
null
2015-12-23T07:08:22
2015-12-23T07:08:22
null
UTF-8
Java
false
false
1,073
java
package apple.eventkitui; import java.io.*; import java.nio.*; import java.util.*; import com.google.j2objc.annotations.*; import com.google.j2objc.runtime.*; import com.google.j2objc.runtime.block.*; import apple.audiotoolbox.*; import apple.corefoundation.*; import apple.coregraphics.*; import apple.coreservices.*; import apple.foundation.*; import apple.eventkit.*; import apple.uikit.*; /*<javadoc>*/ /*</javadoc>*/ @Adapter public abstract class EKCalendarChooserDelegateAdapter extends Object implements EKCalendarChooserDelegate { @NotImplemented("calendarChooserSelectionDidChange:") public void didChangeSelection(EKCalendarChooser calendarChooser) { throw new UnsupportedOperationException(); } @NotImplemented("calendarChooserDidFinish:") public void didFinish(EKCalendarChooser calendarChooser) { throw new UnsupportedOperationException(); } @NotImplemented("calendarChooserDidCancel:") public void didCancel(EKCalendarChooser calendarChooser) { throw new UnsupportedOperationException(); } }
[ "pchen@sellegit.com" ]
pchen@sellegit.com
f855718590188eae3464cd200b2fdaad307e939b
2b63ea53d6cc2f62663880118f1dcfc16a673ab2
/src/concurrent/DiningPhilosophers.java
99997ddbfac47c8edbbb653d38501a308f1530c6
[]
no_license
smagellan/interview
9ea602a212405db7346b5e1dba0e155ed684f960
8767c7c7be31651280bfee45ae44637aadc000d7
refs/heads/master
2021-01-20T05:40:10.303291
2012-11-15T06:30:21
2012-11-15T06:30:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,373
java
package concurrent; import java.util.concurrent.locks.*; public class DiningPhilosophers { public static void main(String[] args) { int count = 5; Chopstick[] chopsticks = new Chopstick[count]; for (int i = 0; i < count; i++) chopsticks[i] = new Chopstick(); Philosopher[] profs = new Philosopher[count]; for (int i = 0; i < count; i++) { profs[i] = new SmartPhilosopher(i, chopsticks[i], chopsticks[(i + 1) % count]); Thread t = new Thread(profs[i]); t.start(); } } } // will cause deadlock class Philosopher implements Runnable { protected Chopstick _left; protected Chopstick _right; protected String _name; protected int _count = 10; public Philosopher(int name, Chopstick left, Chopstick right) { _left = left; _right = right; _name = "Prof. " + name; } protected boolean Eat() { System.out.println(_name + " try to pickup."); Pickup(); System.out.println(_name + " eating."); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(_name + " putdown."); Putdown(); System.out.println(_name + " leave."); return true; } protected void Pickup() { _left.Pickup(); _right.Pickup(); } protected void Putdown() { _left.Putdown(); _right.Putdown(); } @Override public void run() { for (int i = 0; i < _count; i++) { if(!Eat()) i++; } } } class SmartPhilosopher extends Philosopher { public SmartPhilosopher(int name, Chopstick left, Chopstick right) { super(name, left, right); } protected boolean Eat() { System.out.println(_name + " try to pickup."); if (tryPickup()) { System.out.println(_name + " eating."); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(_name + " putdown."); Putdown(); System.out.println(_name + " leave."); return true; } return false; } protected boolean tryPickup() { if (!_left.tryPickup()) return false; else if (!_right.tryPickup()) { _left.Putdown(); return false; } return true; } } class Chopstick { private Lock _lock; public Chopstick() { _lock = new ReentrantLock(); } public void Pickup() { _lock.lock(); } public boolean tryPickup() { return _lock.tryLock(); } public void Putdown() { _lock.unlock(); } }
[ "cnhuang@gmail.com" ]
cnhuang@gmail.com
e76eb16786ccb5aba1f013d17f5e1bf6314a616a
5b14625d9a7851ec40c14a209af9e90acef51e0e
/mahjong/src/main/java/com/rafo/chess/model/battle/BattleStep.java
ae6fa94fc3a9fd7ff685b929a784df42ccc290f2
[]
no_license
leroyBoys/ChaoShanMaJiang
3d5807fac4cbd64e13800ddb5dd8e220fa96ea38
bd2364ed92abc8580f516427735ec9c3e3647bad
refs/heads/master
2020-03-08T02:02:18.317518
2018-05-16T08:37:06
2018-05-16T08:37:06
127,847,893
0
0
null
null
null
null
UTF-8
Java
false
false
4,731
java
package com.rafo.chess.model.battle; import com.rafo.chess.utils.MathUtils; import com.smartfoxserver.v2.entities.data.SFSObject; import org.apache.commons.lang.StringUtils; import java.util.*; /** * Created by Administrator on 2016/9/17. */ public class BattleStep { private int ownerId ; // 出牌玩家id private int targetId ; // 目标玩家id private int playType ; // 战斗类型 private List<Integer> card = new ArrayList<>(); // 牌值 private int remainCardCount ; // 剩余牌数 private boolean ignoreOther; private boolean auto =false; //是否自动打牌 private boolean isBettwenEnter = false;//是否中途进入 private boolean sendClient=true; /** 扩展字段*/ private SFSObject ex=new SFSObject(); public BattleStep(){ } public BattleStep(int ownerId, int targetId, int playType){ this.ownerId = ownerId; this.targetId = targetId; this.playType = playType; } public int getOwnerId() { return ownerId; } public void setOwnerId(int ownerId) { this.ownerId = ownerId; } public int getTargetId() { return targetId; } public boolean isSendClient() { return sendClient; } public void setSendClient(boolean sendClient) { this.sendClient = sendClient; } public boolean isBettwenEnter() { return isBettwenEnter; } public void setBettwenEnter(boolean bettwenEnter) { this.isBettwenEnter = bettwenEnter; } public void setTargetId(int targetId) { this.targetId = targetId; } public int getPlayType() { return playType; } public void setPlayType(int playType) { this.playType = playType; } public List<Integer> getCard() { return card; } public void setCard(List<Integer> card) { this.card = card; } public int getRemainCardCount() { return remainCardCount; } public void setRemainCardCount(int remainCardCount) { this.remainCardCount = remainCardCount; } public void addCard(Integer card) { this.card.add(card); } public boolean isIgnoreOther() { return ignoreOther; } public void setIgnoreOther(boolean ignoreOther) { this.ignoreOther = ignoreOther; } public boolean isAuto() { return auto; } public void setAuto(boolean auto) { this.auto = auto; } public void addExValueInt(exEnum key,int value){ ex.putInt(key.name(), value); } public SFSObject getEx() { return ex; } public void setEx(SFSObject ex) { this.ex = ex; } public BattleStep clone(){ BattleStep step = new BattleStep(); step.setOwnerId(ownerId); step.setTargetId(targetId); step.setPlayType(playType); List<Integer> nCards = new ArrayList<>(); for(Integer c : card){ nCards.add(c); } step.setAuto(auto); step.setCard(nCards); step.setRemainCardCount(remainCardCount); step.setEx(this.ex); step.setBettwenEnter(isBettwenEnter); return step; } public SFSObject toSFSObject(){ SFSObject obj = new SFSObject(); obj.putInt("oid",ownerId); obj.putInt("tid",targetId); obj.putInt("pt",playType); /* if(gangTingTypeCards.size() > 0){ obj.putSFSObject("cd", gangTingCardsToArray()); }else {*/ obj.putIntArray("cd", card); //} obj.putInt("rc",remainCardCount); if(auto) { obj.putInt("auto", 1); } obj.putBool("enter",isBettwenEnter); obj.putSFSObject("ex",ex); return obj; } public String toFormatString(){ StringBuffer sb = new StringBuffer("{"); sb.append("oid=").append(ownerId).append(","); sb.append("tid=").append(targetId).append(","); sb.append("pt=").append(playType).append(","); sb.append("rc=").append(remainCardCount).append(","); if(card != null){ sb.append("cd={").append(StringUtils.join(card, ",")).append("}").append(","); } if(!ex.getKeys().isEmpty()){ sb.append("ex=").append(MathUtils.FormateStringForLua(ex)).append(","); } if(auto){ sb.append("auto=").append(1).append(","); } sb.append("}"); return sb.toString(); } public enum exEnum{ /** * 抢杠胡 */ ht, /** * 抢杠胡的牌的剩余数量 */ qg, /** * 胡牌 */ hi, } }
[ "wlvxiaohui@163.com" ]
wlvxiaohui@163.com
72ce9d5243d0430c19a9cf97f084b9284c02c4fb
4ab1b890fcfcdbe2f29990f151b3d491b7a68958
/EngineerMode/src/com/mediatek/engineermode/dualtalknetworkinfo/NetworkInfoSimType.java
61230af4717fc58f55768508d3d33657e9a296d9
[ "Apache-2.0" ]
permissive
Herrie82/android_device_wileyfox_porridge_x32
4455d5262fc984e2af547a7d540da4a63c625dc9
e9d017148265859f43b75a851b5bbaaeab608fda
refs/heads/master
2020-07-24T00:47:06.761679
2019-09-11T07:43:02
2019-09-11T07:43:02
207,752,981
0
0
Apache-2.0
2019-09-11T07:42:21
2019-09-11T07:42:21
null
UTF-8
Java
false
false
4,589
java
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein is * confidential and proprietary to MediaTek Inc. and/or its licensors. Without * the prior written permission of MediaTek inc. and/or its licensors, any * reproduction, modification, use or disclosure of MediaTek Software, and * information contained herein, in whole or in part, shall be strictly * prohibited. * * MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek * Software") have been modified by MediaTek Inc. All revisions are subject to * any receiver's applicable license agreements with MediaTek Inc. */ package com.mediatek.engineermode.dualtalknetworkinfo; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ArrayAdapter; import android.widget.ListView; import com.android.internal.telephony.PhoneConstants; import com.mediatek.engineermode.R; import java.util.ArrayList; public class NetworkInfoSimType extends Activity implements OnItemClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dualtalk_networkinfo); ListView simTypeListView = (ListView) findViewById(R.id.ListView_dualtalk_networkinfo); ArrayList<String> items = new ArrayList<String>(); items.add(getString(R.string.networkinfo_sim1)); items.add(getString(R.string.networkinfo_sim2)); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items); simTypeListView.setAdapter(adapter); simTypeListView.setOnItemClickListener(this); } /** * @see android.widget.AdapterView.OnItemClickListener#onItemClick(android.widget.AdapterView, * android.view.View, int, long) * @param arg0 * the Adapter for parent * @param arg1 * the View to display * @param position * the integer of item position * @param arg3 * the long of ignore */ public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) { Intent intent = new Intent(); int simType; switch (position) { case 0: intent.setClassName(this, "com.mediatek.engineermode.networkinfo.NetworkInfo"); simType = PhoneConstants.SIM_ID_1; intent.putExtra("mSimType", simType); break; case 1: intent.setClassName(this, "com.mediatek.engineermode.networkinfo.NetworkInfo"); simType = PhoneConstants.SIM_ID_2; intent.putExtra("mSimType", simType); break; default: break; } this.startActivity(intent); } }
[ "skyrimus@yandex.ru" ]
skyrimus@yandex.ru
62ac7ddb5d39a247f56e1f369df9252b45d35d8e
fd2767083209bd7e2b639c88b0c8fae591e8985f
/src/main/java/com/awesome/pro/db/mysql/WrappedConnection.java
c74edf61e8c82e09bcdeee6b7abb2206d93ad2ce
[ "MIT" ]
permissive
siddharth-sahoo/SQLDatabaseQuery
63797a9b01fdc04d6882e3ae5c6e8a1208f600fd
c09d93b7b7737cebbd47e110c8e2d34c51a0bcdf
refs/heads/master
2020-12-25T19:15:17.718939
2014-12-01T09:51:49
2014-12-01T09:51:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,324
java
package com.awesome.pro.db.mysql; import java.sql.Connection; import java.sql.SQLException; import org.apache.log4j.Logger; import com.awesome.pro.pool.WrappedResource; /** * Wrapper class for JDBC MySQL connection. * @author siddharth.s * */ public class WrappedConnection implements WrappedResource<Connection> { /** * JDBC connection. */ private final Connection connection; /** * Root logger instance. */ private static final Logger LOGGER = Logger.getLogger(WrappedConnection.class); /** * @param connection JDBC connection to be wrapped. */ public WrappedConnection(final Connection connection) { this.connection = connection; } /* (non-Javadoc) * @see com.awesome.pro.pool.IResource#close() */ @Override public void close() { try { connection.close(); } catch (SQLException e) { LOGGER.error("Unable to close connection.", e); System.exit(1); } } /* (non-Javadoc) * @see com.awesome.pro.pool.IResource#isClosed() */ @Override public boolean isClosed() { if (connection == null) { return true; } try { return connection.isClosed(); } catch (SQLException e) { return true; } } /* (non-Javadoc) * @see com.awesome.pro.pool.WrappedResource#getResource() */ @Override public Connection getResource() { return connection; } }
[ "siddharth.s@247-inc.com" ]
siddharth.s@247-inc.com
bd5eba3a4fd5f8264f5858c4eb93ea2af704d473
6c8987d48d600fe9ad2640174718b68932ed4a22
/OpenCylocs-Gradle/src/main/java/nl/strohalm/cyclos/dao/access/PasswordHistoryLogDAO.java
8339c0ca115850c440b6f00f71d8863014a48078
[]
no_license
hvarona/ocwg
f89140ee64c48cf52f3903348349cc8de8d3ba76
8d4464ec66ea37e6ad10255efed4236457b1eacc
refs/heads/master
2021-01-11T20:26:38.515141
2017-03-04T19:49:40
2017-03-04T19:49:40
79,115,248
0
0
null
null
null
null
UTF-8
Java
false
false
1,537
java
/* This file is part of Cyclos (www.cyclos.org). A project of the Social Trade Organisation (www.socialtrade.org). Cyclos is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Cyclos 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 Cyclos; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package nl.strohalm.cyclos.dao.access; import nl.strohalm.cyclos.dao.BaseDAO; import nl.strohalm.cyclos.dao.InsertableDAO; import nl.strohalm.cyclos.entities.access.PasswordHistoryLog; import nl.strohalm.cyclos.entities.access.PasswordHistoryLog.PasswordType; import nl.strohalm.cyclos.entities.access.User; /** * DAO interface for PasswordHistoryLog * * @author luis */ public interface PasswordHistoryLogDAO extends BaseDAO<PasswordHistoryLog>, InsertableDAO<PasswordHistoryLog> { /** * Checks whether the given password was already used for the given user */ public boolean wasAlreadyUsed(User user, PasswordType type, String password); }
[ "wladimir2113@gmail.com" ]
wladimir2113@gmail.com
86f161d20b7080c48119f4c06be9c009e8ccdd9c
0f72e71884e8bb07b40e0eeb243cb12107dced6e
/cs355/Lab6/Lab6/src/cs355/controller/CircleState.java
1a892808b3c000056f8ed6c3c89f988a7696d3c7
[]
no_license
PaulCloward/cs355
4ccb65f7b103f85bde0852a10d38c78473bc8f5c
176db48b577f73bbeb6034b9f39772e60fecf02f
refs/heads/master
2021-01-01T05:15:54.630613
2016-05-05T20:03:38
2016-05-05T20:03:38
58,155,276
0
0
null
null
null
null
UTF-8
Java
false
false
1,855
java
package cs355.controller; import java.awt.event.MouseEvent; import java.awt.geom.Point2D; import cs355.model.drawing.Circle; import cs355.model.drawing.Ellipse; import cs355.model.drawing.MyModel; public class CircleState extends State { protected Circle currentCircle; protected Point2D.Double firstPoint; public CircleState(MyModel model) { super(model); } @Override public void mousePress(Point2D.Double e) { this.firstPoint = new Point2D.Double(e.getX(),e.getY()); currentCircle= new Circle(color, this.firstPoint,0); model.addShape(currentCircle); } @Override public void mouseDragged(Point2D.Double e) { int mouseX = (int)e.getX(); int mouseY = (int)e.getY(); double height = mouseY - this.firstPoint.getY(); double width = mouseX - this.firstPoint.getX(); Point2D.Double center; double radius = 0.0; if(Math.abs(height) > Math.abs(width)) { radius = (Math.abs(width)/2); } else { radius = (Math.abs(height)/2); } if(height > 0 && width > 0) { center = new Point2D.Double(this.firstPoint.getX() + radius, this.firstPoint.getY() + radius); } else if (height <= 0 && width > 0) { center = new Point2D.Double(this.firstPoint.getX() + radius, this.firstPoint.getY() - radius); } else if(height <= 0 && width <= 0) { center = new Point2D.Double(this.firstPoint.getX() - radius,this.firstPoint.getY() - radius); } else { center = new Point2D.Double(this.firstPoint.getX() - radius, this.firstPoint.getY() + radius); } this.currentCircle.setCenter(center); this.currentCircle.setRadius(radius); model.update(); } @Override public void mouseRelease(Point2D.Double e) { this.currentCircle = null; this.firstPoint = null; } @Override public void mouseClicked(Point2D.Double e) { // TODO Auto-generated method stub } }
[ "randalpp@cambodia.cs.byu.edu" ]
randalpp@cambodia.cs.byu.edu
ab9eb25eb538875f2f2fd8bca4e38b2487b8f389
a0a3e155a459e7f1f0259332c2511e071c6d4bc8
/src/com/aop/service/aspect/MyAspect2.java
b276130ce58514b6ebf1c716b33f9ddcb2b72c27
[]
no_license
JimmyYangMJ/MyAOPSpring
dc0bdebc3ba1c14829539c5a8f5a53efc5f5382f
7cf61b50230b9882d7931663109f10e8adab3e09
refs/heads/master
2020-06-26T15:52:58.737066
2019-07-30T15:29:15
2019-07-30T15:29:15
199,678,272
0
0
null
null
null
null
UTF-8
Java
false
false
276
java
package com.aop.service.aspect; /** * 切面类:增加代码 与 切入点 结合 */ public class MyAspect2 { public void before(){ System.out.println("开启事务..."); } public void after(){ System.out.println("提交事务..."); } }
[ "2237895205@qq.com" ]
2237895205@qq.com
7b4468322f60217d943e76f4872dabe02a861af8
be54b2f131efe010ab55400810a07b9e512582cc
/demo/Jee/Spring_Hibernate/RestaurantManager/src/java/entities/Categorizetable.java
dbbad13a3df8b39310cc8799f0e1af1e9670392c
[]
no_license
phuongGH/java
4572ef8b96aac0e2a3abb039b371f6ecfbc33db3
b8230dadfb8c79e69198d8351bdf3566533a5aa2
refs/heads/master
2021-01-02T08:39:53.308836
2015-03-30T22:58:57
2015-03-30T22:58:57
33,132,826
0
0
null
null
null
null
UTF-8
Java
false
false
1,549
java
package entities; // Generated Jul 30, 2014 10:45:27 PM by Hibernate Tools 3.6.0 import java.util.HashSet; import java.util.Set; /** * Categorizetable generated by hbm2java */ public class Categorizetable implements java.io.Serializable { private Integer categorizeTableId; private String categorizeTableName; private String description; private Set tableTs = new HashSet(0); public Categorizetable() { } public Categorizetable(String description) { this.description = description; } public Categorizetable(String categorizeTableName, String description, Set tableTs) { this.categorizeTableName = categorizeTableName; this.description = description; this.tableTs = tableTs; } public Integer getCategorizeTableId() { return this.categorizeTableId; } public void setCategorizeTableId(Integer categorizeTableId) { this.categorizeTableId = categorizeTableId; } public String getCategorizeTableName() { return this.categorizeTableName; } public void setCategorizeTableName(String categorizeTableName) { this.categorizeTableName = categorizeTableName; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public Set getTableTs() { return this.tableTs; } public void setTableTs(Set tableTs) { this.tableTs = tableTs; } }
[ "phuongdct1082@gmail.com" ]
phuongdct1082@gmail.com
81ac8fb6f5194eaae5994f90854fe7064fcddce6
cd4d970e33f963512005dccbae10e445e7f518d4
/src/com/hy/xp/app/XApplication.java
7d9fa2bb8d568f16981aea42697ba92cf75975be
[]
no_license
tianqiwangpai/xprivacy_mastor
ea9139e2b88dcefb5a2dd3b814d373c949130de4
38b18c357071bcebde3ccfe08d1c93a57f7e6761
refs/heads/master
2016-08-03T23:07:02.058757
2015-10-22T11:50:58
2015-10-22T11:50:58
40,159,189
3
0
null
null
null
null
UTF-8
Java
false
false
3,707
java
package com.hy.xp.app; import java.util.ArrayList; import java.util.List; import android.app.Application; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Process; import android.util.Log; public class XApplication extends XHook { private Methods mMethod; private static boolean mReceiverInstalled = false; public static String cAction = "Action"; public static String cActionKillProcess = "Kill"; public static String cActionFlush = "Flush"; public static String ACTION_MANAGE_PACKAGE = "com.hy.xp.app.ACTION_MANAGE_PACKAGE"; public static String PERMISSION_MANAGE_PACKAGES = "com.hy.xp.app.MANAGE_PACKAGES"; public XApplication(Methods method, String restrictionName, String actionName) { super(restrictionName, method.name(), actionName); mMethod = method; } @Override public String getClassName() { return "android.app.Application"; } // public void onCreate() // frameworks/base/core/java/android/app/Application.java // http://developer.android.com/reference/android/app/Application.html private enum Methods { onCreate }; public static List<XHook> getInstances() { List<XHook> listHook = new ArrayList<XHook>(); listHook.add(new XApplication(Methods.onCreate, null, null)); return listHook; } @Override protected void before(XParam param) throws Throwable { // do nothing } @Override protected void after(XParam param) throws Throwable { switch (mMethod) { case onCreate: // Install receiver for package management if (PrivacyManager.isApplication(Process.myUid()) && !mReceiverInstalled) try { Application app = (Application) param.thisObject; if (app != null) { mReceiverInstalled = true; Util.log(this, Log.INFO, "Installing receiver uid=" + Process.myUid()); app.registerReceiver(new Receiver(app), new IntentFilter(ACTION_MANAGE_PACKAGE), PERMISSION_MANAGE_PACKAGES, null); } } catch (SecurityException ignored) { } catch (Throwable ex) { Util.bug(this, ex); } break; } } public static void manage(Context context, int uid, String action) { if (uid == 0) manage(context, null, action); else { String[] packageName = context.getPackageManager().getPackagesForUid(uid); if (packageName != null && packageName.length > 0) manage(context, packageName[0], action); else Util.log(null, Log.WARN, "No packages uid=" + uid + " action=" + action); } } public static void manage(Context context, String packageName, String action) { Util.log(null, Log.INFO, "Manage package=" + packageName + " action=" + action); if (packageName == null && XApplication.cActionKillProcess.equals(action)) { Util.log(null, Log.WARN, "Kill all"); return; } Intent manageIntent = new Intent(XApplication.ACTION_MANAGE_PACKAGE); manageIntent.putExtra(XApplication.cAction, action); if (packageName != null) manageIntent.setPackage(packageName); context.sendBroadcast(manageIntent); } private class Receiver extends BroadcastReceiver { public Receiver(Application app) { } @Override public void onReceive(Context context, Intent intent) { try { String action = intent.getExtras().getString(cAction); Util.log(null, Log.WARN, "Managing uid=" + Process.myUid() + " action=" + action); if (cActionKillProcess.equals(action)) android.os.Process.killProcess(Process.myPid()); else if (cActionFlush.equals(action)) { PrivacyManager.flush(); } else Util.log(null, Log.WARN, "Unknown management action=" + action); } catch (Throwable ex) { Util.bug(null, ex); } } } }
[ "hunanliutian@gmail.com" ]
hunanliutian@gmail.com
8681f66a06f107f39332134c6c7fb0e507465491
3093fda798dc4f4f5a8cb6e92364829edd23984e
/src/main/java/me/stonerivers/leetcode/hard/MedianOfTwoSortedArrays_4.java
14e180f9be8a724390acfffb50ed775ea934a6d4
[]
no_license
StoneRivers/LeetCode
938faba405abb34c0e25addbbefa775ba6a18e1c
a004d9090b497ece0b691526bcc778433ddae05c
refs/heads/master
2020-03-31T09:05:40.502359
2019-07-22T14:53:06
2019-07-22T14:53:06
152,082,279
0
0
null
null
null
null
UTF-8
Java
false
false
2,334
java
package me.stonerivers.leetcode.hard; /** * @author Zhangyuanan * @version 1.0 * @since 2019-06-30 */ public class MedianOfTwoSortedArrays_4 { public double findMedianSortedArrays(int[] nums1, int[] nums2) { int len1 = nums1.length; int len2 = nums2.length; int start = (len1 + len2 + 1) / 2 - 1; int end = (len1 + len2) / 2 + 1 - 1; return merge(nums1, nums2, start, end); } private double merge(int[] nums1, int[] nums2, int aimIndex1, int aimIndex2) { int len1 = nums1.length; int len2 = nums2.length; boolean success = false; int aim1 = 0, aim2 = 0; int index1 = 0, index2 = 0, index = 0; while (index1 < len1 && index2 < len2 && !success) { if (nums1[index1] < nums2[index2]) { if (index == aimIndex1) { aim1 = nums1[index1]; } if (index == aimIndex2) { aim2 = nums1[index1]; success = true; } index++; index1++; } else { if (index == aimIndex1) { aim1 = nums2[index2]; } if (index == aimIndex2) { aim2 = nums2[index2]; success = true; } index++; index2++; } } while (index1 < len1 && !success) { if (index == aimIndex1) { aim1 = nums1[index1]; } if (index == aimIndex2) { aim2 = nums1[index1]; success = true; } index++; index1++; } while (index2 < len2 && !success) { if (index == aimIndex1) { aim1 = nums2[index2]; } if (index == aimIndex2) { aim2 = nums2[index2]; success = true; } index++; index2++; } return ((double) (aim1 + aim2)) / 2; } public static void main(String[] args) { int[] num1 = new int[]{1, 2}; int[] num2 = new int[]{3, 4}; System.out.println(new MedianOfTwoSortedArrays_4().findMedianSortedArrays(num1, num2)); } }
[ "zhangyuanan@meituan.com" ]
zhangyuanan@meituan.com
3b92be5f4d072686fd5f0eb6ab113c4f44000dd4
ef3632a70d37cfa967dffb3ddfda37ec556d731c
/aws-java-sdk-omics/src/main/java/com/amazonaws/services/omics/model/transform/ImportReadSetSourceItemMarshaller.java
c3c84fc4b4eec08a543cfe2e6c3486c61bab222e
[ "Apache-2.0" ]
permissive
ShermanMarshall/aws-sdk-java
5f564b45523d7f71948599e8e19b5119f9a0c464
482e4efb50586e72190f1de4e495d0fc69d9816a
refs/heads/master
2023-01-23T16:35:51.543774
2023-01-19T03:21:46
2023-01-19T03:21:46
134,658,521
0
0
Apache-2.0
2019-06-12T21:46:58
2018-05-24T03:54:38
Java
UTF-8
Java
false
false
5,237
java
/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.omics.model.transform; import java.util.Map; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.omics.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * ImportReadSetSourceItemMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class ImportReadSetSourceItemMarshaller { private static final MarshallingInfo<String> DESCRIPTION_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("description").build(); private static final MarshallingInfo<String> GENERATEDFROM_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("generatedFrom").build(); private static final MarshallingInfo<String> NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("name").build(); private static final MarshallingInfo<String> REFERENCEARN_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("referenceArn").build(); private static final MarshallingInfo<String> SAMPLEID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("sampleId").build(); private static final MarshallingInfo<String> SOURCEFILETYPE_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sourceFileType").build(); private static final MarshallingInfo<StructuredPojo> SOURCEFILES_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("sourceFiles").build(); private static final MarshallingInfo<String> STATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("status").build(); private static final MarshallingInfo<String> STATUSMESSAGE_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("statusMessage").build(); private static final MarshallingInfo<String> SUBJECTID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("subjectId").build(); private static final MarshallingInfo<Map> TAGS_BINDING = MarshallingInfo.builder(MarshallingType.MAP).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("tags").build(); private static final ImportReadSetSourceItemMarshaller instance = new ImportReadSetSourceItemMarshaller(); public static ImportReadSetSourceItemMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(ImportReadSetSourceItem importReadSetSourceItem, ProtocolMarshaller protocolMarshaller) { if (importReadSetSourceItem == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(importReadSetSourceItem.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getGeneratedFrom(), GENERATEDFROM_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getName(), NAME_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getReferenceArn(), REFERENCEARN_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getSampleId(), SAMPLEID_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getSourceFileType(), SOURCEFILETYPE_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getSourceFiles(), SOURCEFILES_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getStatusMessage(), STATUSMESSAGE_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getSubjectId(), SUBJECTID_BINDING); protocolMarshaller.marshall(importReadSetSourceItem.getTags(), TAGS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
73ad88858890df10f40f1d67aa2950f9641d3ef9
075fcfbbb498f8cd7373a9c165cd56b952af25b8
/src/Work/PR_work_8/State/Developer.java
385a5f4f6bca0c0ae80bbda4fcbdd6023259c828
[]
no_license
gmom-cyber/newJava
ab0b02b55d7d5c6d5495a1ec6438cacba781b54f
e1d42fd3ccc27167385644de313231a9b46a6361
refs/heads/main
2023-05-07T01:48:18.207083
2021-06-03T15:20:54
2021-06-03T15:20:54
338,027,467
0
0
null
null
null
null
UTF-8
Java
false
false
660
java
package Work.PR_work_8.State; public class Developer { Activity activity; public Developer() { } public void setActivity(Activity activity) { this.activity = activity; } public void changeActivity(){ if(activity instanceof Sleeping){ setActivity(new Training()); }else if(activity instanceof Training){ setActivity(new Writing()); }else if (activity instanceof Writing){ setActivity(new Reading()); }else if (activity instanceof Reading){ setActivity(new Sleeping()); } } void justDoIt(){ activity.jastDoIt(); } }
[ "moifoto2014@yandex.ru" ]
moifoto2014@yandex.ru
801526001ecb2737dc2261ca466ad1d9e2c24782
5de63a6ea4a86c68ee6dcee6133cb3610d87ad8e
/wxxr-mobile-client/wxxr-mobile-communicationhelper-android-quanguo/src/com/wxxr/callhelper/qg/widget/ResizeLayout.java
5b8b9bb497d734e16971cc84aa93ada8db575e7f
[]
no_license
richie1412/git_hub_rep
487702601cc655f0213c6a601440a66fba14080b
633be448911fed685139e19e66c6c54d21df7fe3
refs/heads/master
2016-09-05T14:37:19.096475
2014-07-18T01:52:03
2014-07-18T01:52:03
21,963,815
0
2
null
null
null
null
UTF-8
Java
false
false
1,029
java
package com.wxxr.callhelper.qg.widget; import android.content.Context; import android.util.AttributeSet; import android.widget.LinearLayout; /** * * 自定义的view,为了监听高度的变化,来判断键盘的显示和隐藏 * * @since 1.0 */ public class ResizeLayout extends LinearLayout{ private OnResizeListener mListener; private static final int BIGGER = 1; private static final int SMALLER = 2; private static final int MSG_RESIZE = 1; public interface OnResizeListener { void OnResize(int w, int h, int oldw, int oldh); } public void setOnResizeListener(OnResizeListener l) { mListener = l; } public ResizeLayout(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); if (mListener != null) { mListener.OnResize(w, h, oldw, oldh); } } }
[ "richie1412@gmail.com" ]
richie1412@gmail.com
5e83c6b7c4d60f4464b50556b10ad0be75f83907
ac481da2fb839e9a8455cad3868dc375be9d133c
/producer/src/main/java/com/rongyixuan/producer/ProducerApplication.java
97fbfca1cba6d7751db4879f4569c9efa305d232
[]
no_license
rongyixuan2019/demo11
c5b91a4432666c77de7c979b96d86972c5c6512f
d4d6d59db984c967005194f0381b9bbfb588b1e1
refs/heads/master
2022-04-25T21:09:49.742807
2020-04-19T09:34:42
2020-04-19T09:34:42
256,961,751
0
0
null
null
null
null
UTF-8
Java
false
false
420
java
package com.rongyixuan.producer; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; @EnableEurekaClient @SpringBootApplication public class ProducerApplication { public static void main(String[] args) { SpringApplication.run(ProducerApplication.class, args); } }
[ "735388653@qq.com" ]
735388653@qq.com
dbf3d6dbc8c4b482dc6914a78d20d30161d4fb2f
1ae6abc37d7844879916e8f612ba1d616bc0c3cb
/src/public/nc/bs/pf/changedir/CHGXC77TOXC69.java
6c61a8ad6a3c3bc51af371f1f18d031242d82990
[]
no_license
menglingrui/xcgl
7a3b3f03f14b21fbd25334042f87fa570758a7ad
525b4e38cf52bb75c83762a9c27862b4f86667e8
refs/heads/master
2020-06-05T20:10:09.263291
2014-09-11T11:00:34
2014-09-11T11:00:34
null
0
0
null
null
null
null
GB18030
Java
false
false
7,680
java
package nc.bs.pf.changedir; import nc.bs.pf.change.ConversionPolicyEnum; import nc.vo.pf.change.UserDefineFunction; /** * 从精粉调拨单到其它入库单的 * 取调入信息 * 后台交换类 * @author Jay * */ public class CHGXC77TOXC69 extends nc.bs.pf.change.VOConversion{ public CHGXC77TOXC69(){ super(); } /** * 获得交换后处理类 全名称 * @return java.lang.String */ public String getAfterClassName() { return null; } /** * 获得交换后处理类 全名称 * @return java.lang.String */ public String getOtherClassName() { return null; } /** * 返回交换类型枚举ConversionPolicyEnum,默认为单据项目-单据项目 * @return ConversionPolicyEnum * @since 5.5 */ public ConversionPolicyEnum getConversionPolicy() { return ConversionPolicyEnum.BILLITEM_BILLITEM; } /** * 获得映射类型的交换规则 * @return java.lang.String[] */ public String[] getField() { return new String[] { "H_pk_corp->H_pk_corp", "H_pk_factory->H_pk_factory1",//调入选厂 //"H_pk_beltline->H_pk_beltline",//生产线 //"H_pk_classorder->H_pk_classorder",//班次 //"H_pk_minarea->H_pk_minarea",//部门--取样单位 "H_pk_stordoc->H_pk_stordoc1",//调入仓库 "H_pk_minarea->B_pk_deptdoc1",//调入部门--取样单位 "B_pk_invmandoc->B_pk_invmandoc", "B_pk_father->B_pk_invmandoc", "B_pk_invbasdoc->B_pk_invbasdoc", //"H_dweighdate->H_dbilldate", "H_dbilldate->H_dbilldate",//单据日期 "H_pk_busitype->H_pk_busitype",//业务流程 //"H_pk_vehicle->B_pk_vehicle", "B_nwetweight->B_ndryweight",//数量 "H_vmemo->H_vmemo", "B_vmemo->B_vmemo", "H_ireserve1->H_ireserve1", "H_ireserve10->H_ireserve10", "H_ireserve2->H_ireserve2", "H_ireserve3->H_ireserve3", "H_ireserve4->H_ireserve4", "H_ireserve5->H_ireserve5", "H_ireserve6->H_ireserve6", "H_ireserve7->H_ireserve7", "H_ireserve8->H_ireserve8", "H_ireserve9->H_ireserve9", "H_nreserve1->H_nreserve1", "H_nreserve10->H_nreserve10", "H_nreserve2->H_nreserve2", "H_nreserve3->H_nreserve3", "H_nreserve4->H_nreserve4", "H_nreserve5->H_nreserve5", "H_nreserve6->H_nreserve6", "H_nreserve7->H_nreserve7", "H_nreserve8->H_nreserve8", "H_nreserve9->H_nreserve9", "H_pk_defdoc1->H_pk_defdoc1", "H_pk_defdoc10->H_pk_defdoc10", "H_pk_defdoc11->H_pk_defdoc11", "H_pk_defdoc12->H_pk_defdoc12", "H_pk_defdoc13->H_pk_defdoc13", "H_pk_defdoc14->H_pk_defdoc14", "H_pk_defdoc15->H_pk_defdoc15", "H_pk_defdoc16->H_pk_defdoc16", "H_pk_defdoc17->H_pk_defdoc17", "H_pk_defdoc18->H_pk_defdoc18", "H_pk_defdoc19->H_pk_defdoc19", "H_pk_defdoc2->H_pk_defdoc2", "H_pk_defdoc20->H_pk_defdoc20", "H_pk_defdoc3->H_pk_defdoc3", "H_pk_defdoc4->H_pk_defdoc4", "H_pk_defdoc5->H_pk_defdoc5", "H_pk_defdoc6->H_pk_defdoc6", "H_pk_defdoc7->H_pk_defdoc7", "H_pk_defdoc8->H_pk_defdoc8", "H_pk_defdoc9->H_pk_defdoc9", //"H_pk_deptdoc->H_pk_deptdoc",//部门档案 "H_ureserve1->H_ureserve1", "H_ureserve10->H_ureserve10", "H_ureserve2->H_ureserve2", "H_ureserve3->H_ureserve3", "H_ureserve4->H_ureserve4", "H_ureserve5->H_ureserve5", "H_ureserve6->H_ureserve6", "H_ureserve7->H_ureserve7", "H_ureserve8->H_ureserve8", "H_ureserve9->H_ureserve9", "H_vdef1->H_vdef1", "H_vdef10->H_vdef10", "H_vdef11->H_vdef11", "H_vdef12->H_vdef12", "H_vdef13->H_vdef13", "H_vdef14->H_vdef14", "H_vdef15->H_vdef15", "H_vdef16->H_vdef16", "H_vdef17->H_vdef17", "H_vdef18->H_vdef18", "H_vdef19->H_vdef19", "H_vdef2->H_vdef2", "H_vdef20->H_vdef20", "H_vdef3->H_vdef3", "H_vdef4->H_vdef4", "H_vdef5->H_vdef5", "H_vdef6->H_vdef6", "H_vdef7->H_vdef7", "H_vdef8->H_vdef8", "H_vdef9->H_vdef9", "H_vreserve1->H_vreserve1", "H_vreserve10->H_vreserve10", "H_vreserve2->H_vreserve2", "H_vreserve3->H_vreserve3", "H_vreserve4->H_vreserve4", "H_vreserve5->H_vreserve5", "H_vreserve6->H_vreserve6", "H_vreserve7->H_vreserve7", "H_vreserve8->H_vreserve8", "H_vreserve9->H_vreserve9", "B_ireserve1->B_ireserve1", "B_ireserve10->B_ireserve10", "B_ireserve2->B_ireserve2", "B_ireserve3->B_ireserve3", "B_ireserve4->B_ireserve4", "B_ireserve5->B_ireserve5", "B_ireserve6->B_ireserve6", "B_ireserve7->B_ireserve7", "B_ireserve8->B_ireserve8", "B_ireserve9->B_ireserve9", "B_nreserve1->B_nreserve1", "B_nreserve10->B_nreserve10", "B_nreserve2->B_nreserve2", "B_nreserve3->B_nreserve3", "B_nreserve4->B_nreserve4", "B_nreserve5->B_nreserve5", "B_nreserve6->B_nreserve6", "B_nreserve7->B_nreserve7", "B_nreserve8->B_nreserve8", "B_nreserve9->B_nreserve9", "B_pk_defdoc1->B_pk_defdoc1", "B_pk_defdoc10->B_pk_defdoc10", "B_pk_defdoc11->B_pk_defdoc11", "B_pk_defdoc12->B_pk_defdoc12", "B_pk_defdoc13->B_pk_defdoc13", "B_pk_defdoc14->B_pk_defdoc14", "B_pk_defdoc15->B_pk_defdoc15", "B_pk_defdoc16->B_pk_defdoc16", "B_pk_defdoc17->B_pk_defdoc17", "B_pk_defdoc18->B_pk_defdoc18", "B_pk_defdoc19->B_pk_defdoc19", "B_pk_defdoc2->B_pk_defdoc2", "B_pk_defdoc20->B_pk_defdoc20", "B_pk_defdoc3->B_pk_defdoc3", "B_pk_defdoc4->B_pk_defdoc4", "B_pk_defdoc5->B_pk_defdoc5", "B_pk_defdoc6->B_pk_defdoc6", "B_pk_defdoc7->B_pk_defdoc7", "B_pk_defdoc8->B_pk_defdoc8", "B_pk_defdoc9->B_pk_defdoc9", "B_ureserve1->B_ureserve1", "B_ureserve10->B_ureserve10", "B_ureserve2->B_ureserve2", "B_ureserve3->B_ureserve3", "B_ureserve4->B_ureserve4", "B_ureserve5->B_ureserve5", "B_ureserve6->B_ureserve6", "B_ureserve7->B_ureserve7", "B_ureserve8->B_ureserve8", "B_ureserve9->B_ureserve9", "B_vdef1->B_vdef1", "B_vdef10->B_vdef10", "B_vdef11->B_vdef11", "B_vdef12->B_vdef12", "B_vdef13->B_vdef13", "B_vdef14->B_vdef14", "B_vdef15->B_vdef15", "B_vdef16->B_vdef16", "B_vdef17->B_vdef17", "B_vdef18->B_vdef18", "B_vdef19->B_vdef19", "B_vdef2->B_vdef2", "B_vdef20->B_vdef20", "B_vdef3->B_vdef3", "B_vdef4->B_vdef4", "B_vdef5->B_vdef5", "B_vdef6->B_vdef6", "B_vdef7->B_vdef7", "B_vdef8->B_vdef8", "B_vdef9->B_vdef9", "B_vreserve1->B_vreserve1", "B_vreserve10->B_vreserve10", "B_vreserve2->B_vreserve2", "B_vreserve3->B_vreserve3", "B_vreserve4->B_vreserve4", "B_vreserve5->B_vreserve5", "B_vreserve6->B_vreserve6", "B_vreserve7->B_vreserve7", "B_vreserve8->B_vreserve8", "B_vreserve9->B_vreserve9", "B_vlastbillcode->H_vbillno", "B_vlastbillid->B_pk_general_h", "B_vlastbillrowid->B_pk_general_b", "B_vlastbilltype->H_pk_billtype", "B_csourcebillcode->H_vbillno", "B_vsourcebillid->B_pk_general_h", "B_vsourcebillrowid->B_pk_general_b", "B_vsourcebilltype->H_pk_billtype", }; } /** * 获得赋值类型的交换规则 * @return java.lang.String[] */ public String[] getAssign() { return null; } /** * 获得公式类型的交换规则 * @return java.lang.String[] */ public String[] getFormulas() { return null; } /** * 返回用户自定义函数 */ public UserDefineFunction[] getUserDefineFunction() { return null; } }
[ "menlging.rui@163.com" ]
menlging.rui@163.com
ca3eb5e6459d322a8a87ec6951fdd87f0da61750
79cc848fc081f2f2b1eb42d229ef380890e9bc4f
/Falling-Ball/src/Box.java
13ed3c9efa5359682d402ee9eadf16ca441000ea
[]
no_license
papanmanna/My_Code
4367db81d854eff89b4529c719ba13c2ec373863
c7943e4e47957696d23b8553968404a65c9be765
refs/heads/master
2021-01-21T11:49:46.520293
2017-08-31T17:29:44
2017-08-31T17:29:44
102,025,294
0
0
null
null
null
null
UTF-8
Java
false
false
174
java
import java.awt.Color; import java.awt.Graphics; public class Box { public void paint(Graphics g) { g.setColor(Color.red); g.fillRect(145,300, 80, 80); } }
[ "mannapapan.r@gmail.com" ]
mannapapan.r@gmail.com
b5cdefb60d421430e5d8f481bba9e632d544118b
59e6dc1030446132fb451bd711d51afe0c222210
/components/webapp-mgt/org.wso2.carbon.jaxws.webapp.mgt.ui/4.2.0/src/main/java/org/wso2/carbon/jaxws/webapp/mgt/ui/JaxwsWebappAdminClient.java
63e8544946f00c36941bdf53948df1e941606506
[]
no_license
Alsan/turing-chunk07
2f7470b72cc50a567241252e0bd4f27adc987d6e
e9e947718e3844c07361797bd52d3d1391d9fb5e
refs/heads/master
2020-05-26T06:20:24.554039
2014-02-07T12:02:53
2014-02-07T12:02:53
38,284,349
0
1
null
null
null
null
UTF-8
Java
false
false
3,722
java
/* * Copyright 2004,2005 The Apache Software Foundation. * * 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.wso2.carbon.jaxws.webapp.mgt.ui; import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; import org.apache.axis2.client.Options; import org.apache.axis2.client.ServiceClient; import org.apache.axis2.context.ConfigurationContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.webapp.mgt.stub.WebappAdminStub; import org.wso2.carbon.webapp.mgt.stub.types.carbon.SessionsWrapper; import org.wso2.carbon.webapp.mgt.stub.types.carbon.WebappMetadata; import org.wso2.carbon.webapp.mgt.stub.types.carbon.WebappUploadData; import org.wso2.carbon.webapp.mgt.stub.types.carbon.WebappsWrapper; import javax.activation.DataHandler; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.InputStream; import java.rmi.RemoteException; import java.util.Locale; import java.util.ResourceBundle; /** * Client which communicates with the JaxwsWebappAdmin service */ public class JaxwsWebappAdminClient { public static final String BUNDLE = "org.wso2.carbon.jaxws.webapp.mgt.ui.i18n.Resources"; public static final int MILLISECONDS_PER_MINUTE = 60 * 1000; private static final Log log = LogFactory.getLog(JaxwsWebappAdminClient.class); private ResourceBundle bundle; public WebappAdminStub stub; public JaxwsWebappAdminClient(String cookie, String backendServerURL, ConfigurationContext configCtx, Locale locale) throws AxisFault { String serviceURL = backendServerURL + "JaxwsWebappAdmin"; bundle = ResourceBundle.getBundle(BUNDLE, locale); stub = new WebappAdminStub(configCtx, serviceURL); ServiceClient client = stub._getServiceClient(); Options option = client.getOptions(); option.setManageSession(true); option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); option.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); } public void uploadWebapp(WebappUploadData [] webappUploadDataList) throws AxisFault { try { stub.uploadWebapp(webappUploadDataList); } catch (RemoteException e) { handleException("cannot.upload.webapps", e); } } private void handleException(String msgKey, Exception e) throws AxisFault { String msg = bundle.getString(msgKey); log.error(msg, e); throw new AxisFault(msg, e); } }
[ "malaka@wso2.com" ]
malaka@wso2.com
9c776e9cfc491af87608c5f4dbf46a889002bdaf
725b0c33af8b93b557657d2a927be1361256362b
/com/planet_ink/coffee_mud/MOBS/GenDeity.java
124579d6559e2a7263c92ab3c270e1c42125fcb6
[ "Apache-2.0" ]
permissive
mcbrown87/CoffeeMud
7546434750d1ae0418ac2c76d27f872106d2df97
0d4403d466271fe5d75bfae8f33089632ac1ddd6
refs/heads/master
2020-12-30T19:23:07.758257
2014-06-25T00:01:20
2014-06-25T00:01:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,423
java
package com.planet_ink.coffee_mud.MOBS; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; /* Copyright 2000-2014 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ public class GenDeity extends StdDeity { @Override public String ID(){return "GenDeity";} public GenDeity() { super(); username="a generic deity"; setDescription("He is a run-of-the-mill deity."); setDisplayText("A generic deity stands here."); basePhyStats().setAbility(11); // his only off-default recoverMaxState(); resetToMaxState(); recoverPhyStats(); recoverCharStats(); } @Override public boolean isGeneric(){return true;} @Override public String text() { if(CMProps.getBoolVar(CMProps.Bool.MOBCOMPRESS)) miscText=CMLib.encoder().compressString(CMLib.coffeeMaker().getPropertiesStr(this,false)); else miscText=CMLib.coffeeMaker().getPropertiesStr(this,false); return super.text(); } @Override public void setMiscText(String newText) { super.setMiscText(newText); CMLib.coffeeMaker().resetGenMOB(this,newText); } private final static String[] MYCODES={"CLERREQ","CLERRIT","WORREQ","WORRIT","SVCRIT"}; @Override public String getStat(String code) { if(CMLib.coffeeMaker().getGenMobCodeNum(code)>=0) return CMLib.coffeeMaker().getGenMobStat(this,code); switch(getCodeNum(code)) { case 0: return getClericRequirements(); case 1: return getClericRitual(); case 2: return getWorshipRequirements(); case 3: return getWorshipRitual(); case 4: return getServiceRitual(); default: return CMProps.getStatCodeExtensionValue(getStatCodes(), xtraValues, code); } } @Override public void setStat(String code, String val) { if(CMLib.coffeeMaker().getGenMobCodeNum(code)>=0) CMLib.coffeeMaker().setGenMobStat(this,code,val); else switch(getCodeNum(code)) { case 0: setClericRequirements(val); break; case 1: setClericRitual(val); break; case 2: setWorshipRequirements(val); break; case 3: setWorshipRitual(val); break; case 4: setServiceRitual(val); break; default: CMProps.setStatCodeExtensionValue(getStatCodes(), xtraValues, code, val); break; } } @Override protected int getCodeNum(String code) { for(int i=0;i<MYCODES.length;i++) if(code.equalsIgnoreCase(MYCODES[i])) return i; return -1; } private static String[] codes=null; @Override public String[] getStatCodes() { if(codes!=null) return codes; final String[] MYCODES=CMProps.getStatCodesList(GenDeity.MYCODES,this); final String[] superCodes=GenericBuilder.GENMOBCODES; codes=new String[superCodes.length+MYCODES.length]; int i=0; for(;i<superCodes.length;i++) codes[i]=superCodes[i]; for(int x=0;x<MYCODES.length;i++,x++) codes[i]=MYCODES[x]; return codes; } @Override public boolean sameAs(Environmental E) { if(!(E instanceof GenDeity)) return false; final String[] codes=getStatCodes(); for(int i=0;i<codes.length;i++) if(!E.getStat(codes[i]).equals(getStat(codes[i]))) return false; return true; } }
[ "bo@0d6f1817-ed0e-0410-87c9-987e46238f29" ]
bo@0d6f1817-ed0e-0410-87c9-987e46238f29
8b65a9a938980ad342bed060bdb6a8962ad38a87
94e335aac5905bdcbcfc86988bfaa7c7086d4322
/src/JavaStart10/homework/pojazdyWypozyczalnia/Person.java
64c842bded99b031eb0d7dbbb924cde77b3996af
[]
no_license
ToFatToBat/JavaStart
da6ddaae9ef44f6a336f7367b7e1859b7d995c92
5486660206df70a55079e517ca09eb3f17ae9c45
refs/heads/master
2022-11-25T15:31:52.899955
2020-07-28T20:04:20
2020-07-28T20:04:20
275,402,585
0
0
null
2020-07-28T20:04:21
2020-06-27T15:41:59
Java
UTF-8
Java
false
false
681
java
package JavaStart10.homework.pojazdyWypozyczalnia; public class Person { private String firsName; private String lastName; private int id; public String getFirsName() { return firsName; } public String getLastName() { return lastName; } public int getId() { return id; } public Person(String firsName, String lastName, int id) { this.firsName = firsName; this.lastName = lastName; this.id = id; } @Override public String toString() { return "firsName= " + firsName + '\n' + "lastName= " + lastName + '\n' + "id= " + id + '\n'; } }
[ "kpapiernia@wp.pl" ]
kpapiernia@wp.pl
54c6b0e2485f97bbcdc41192d1d864d147f1ea66
650f7ce2090a2e91c11b2a42b3c85f3d4ef5a36b
/src/main/java/com/allcoolboys/flyweight/v2/Character.java
a3bfbfed7ac1b6331986b39698a2ee9586d173c1
[ "Apache-2.0" ]
permissive
cokestewpotato/DesignPatterns
04cb142eb4ca4a48ba5f638b429eb4bdb43d3a5d
a56575699acc684c23d33e51e10011209bb46db7
refs/heads/main
2022-12-31T13:01:34.712503
2020-10-25T14:18:50
2020-10-25T14:18:50
306,099,860
0
0
null
null
null
null
UTF-8
Java
false
false
387
java
package com.allcoolboys.flyweight.v2; /** * 享元抽象:字符 * 单纯享元模式:FlyWeight子类都可以被共享,那就是所有的享元对象都可以被共享 * @author coolboy */ public abstract class Character { /** * 抽象的业务逻辑方法,接受外部状态作为参数 * @param outerState */ abstract void display(String outerState); }
[ "private_game@163.com" ]
private_game@163.com
a050446388b799778cab0c823738fd06eb00103f
67984d7d945b67709b24fda630efe864b9ae9c72
/core/src/main/java/com/ey/piit/core/paginator/domain/Paginator.java
9d67a29a1d50129f36a93e581b761f802b493b60
[]
no_license
JackPaiPaiNi/Piit
76c7fb6762912127a665fa0638ceea1c76893fc6
89b8d79487e6d8ff21319472499b6e255104e1f6
refs/heads/master
2020-04-07T22:30:35.105370
2018-11-23T02:58:31
2018-11-23T02:58:31
158,773,760
0
0
null
null
null
null
UTF-8
Java
false
false
6,027
java
package com.ey.piit.core.paginator.domain; import java.io.Serializable; /** * 分页器,根据page,limit,totalCount用于页面上分页显示多项内容,计算页码和当前页的偏移量,方便页面分页使用. * * @author badqiu * @author miemiedev */ public class Paginator implements Serializable { private static final long serialVersionUID = -2429864663690465105L; private static final int DEFAULT_SLIDERS_COUNT = 7; /** * 分页大小 */ private int limit; /** * 页数 */ private int page; /** * 总记录数 */ private int totalCount; public Paginator(int page, int limit, int totalCount) { super(); this.limit = limit; this.totalCount = totalCount; this.page = computePageNo(page); } /** * 取得当前页。 */ public int getPage() { return page; } public int getLimit() { return limit; } /** * 取得总项数。 * * @return 总项数 */ public int getTotalCount() { return totalCount; } /** * 是否是首页(第一页),第一页页码为1 * * @return 首页标识 */ public boolean isFirstPage() { return page <= 1; } /** * 是否是最后一页 * * @return 末页标识 */ public boolean isLastPage() { return page >= getTotalPages(); } public int getPrePage() { if (isHasPrePage()) { return page - 1; } else { return page; } } public int getNextPage() { if (isHasNextPage()) { return page + 1; } else { return page; } } /** * 判断指定页码是否被禁止,也就是说指定页码超出了范围或等于当前页码。 * * @param page 页码 * @return boolean 是否为禁止的页码 */ public boolean isDisabledPage(int page) { return ((page < 1) || (page > getTotalPages()) || (page == this.page)); } /** * 是否有上一页 * * @return 上一页标识 */ public boolean isHasPrePage() { return (page - 1 >= 1); } /** * 是否有下一页 * * @return 下一页标识 */ public boolean isHasNextPage() { return (page + 1 <= getTotalPages()); } /** * 开始行,可以用于oracle分页使用 (1-based)。 */ public int getStartRow() { if (getLimit() <= 0 || totalCount <= 0) return 0; return page > 0 ? (page - 1) * getLimit() + 1 : 0; } /** * 结束行,可以用于oracle分页使用 (1-based)。 */ public int getEndRow() { return page > 0 ? Math.min(limit * page, getTotalCount()) : 0; } /** * offset,计数从0开始,可以用于mysql分页使用(0-based) */ public int getOffset() { return page > 0 ? (page - 1) * getLimit() : 0; } /** * 得到 总页数 * * @return */ public int getTotalPages() { if (totalCount <= 0) { return 0; } if (limit <= 0) { return 0; } int count = totalCount / limit; if (totalCount % limit > 0) { count++; } return count; } protected int computePageNo(int page) { return computePageNumber(page, limit, totalCount); } /** * 页码滑动窗口,并将当前页尽可能地放在滑动窗口的中间部位。 * * @return */ public Integer[] getSlider() { return slider(DEFAULT_SLIDERS_COUNT); } /** * 页码滑动窗口,并将当前页尽可能地放在滑动窗口的中间部位。 * 注意:不可以使用 getSlider(1)方法名称,因为在JSP中会与 getSlider()方法冲突,报exception * * @return */ public Integer[] slider(int slidersCount) { return generateLinkPageNumbers(getPage(), (int) getTotalPages(), slidersCount); } private static int computeLastPageNumber(int totalItems, int pageSize) { if (pageSize <= 0) return 1; int result = (int) (totalItems % pageSize == 0 ? totalItems / pageSize : totalItems / pageSize + 1); if (result <= 1) result = 1; return result; } private static int computePageNumber(int page, int pageSize, int totalItems) { if (page <= 1) { return 1; } if (Integer.MAX_VALUE == page || page > computeLastPageNumber(totalItems, pageSize)) { //last page return computeLastPageNumber(totalItems, pageSize); } return page; } private static Integer[] generateLinkPageNumbers(int currentPageNumber, int lastPageNumber, int count) { int avg = count / 2; int startPageNumber = currentPageNumber - avg; if (startPageNumber <= 0) { startPageNumber = 1; } int endPageNumber = startPageNumber + count - 1; if (endPageNumber > lastPageNumber) { endPageNumber = lastPageNumber; } if (endPageNumber - startPageNumber < count) { startPageNumber = endPageNumber - count; if (startPageNumber <= 0) { startPageNumber = 1; } } java.util.List<Integer> result = new java.util.ArrayList<Integer>(); for (int i = startPageNumber; i <= endPageNumber; i++) { result.add(new Integer(i)); } return result.toArray(new Integer[result.size()]); } @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("Paginator"); sb.append("{page=").append(page); sb.append(", limit=").append(limit); sb.append(", totalCount=").append(totalCount); sb.append('}'); return sb.toString(); } }
[ "1210287515@master" ]
1210287515@master
53904f1dd49c38cb3a05459e62c041373a65b03a
dbc7f4f5dc94006fd3309b40dd537c05dc3c24a2
/libs/src/main/java/com/juphoon/cmcc/app/lemon/MtcUtil.java
ba6b0cc2b5cfb5c75ff5a7917073614213b98db7
[]
no_license
sherry5707/CallDemo
584d3a1c8dec235f10bd7fa266d18e80c09ac872
626599ebda89c4d2828466c3d50cc842ee6258e8
refs/heads/master
2020-04-09T07:02:12.249448
2018-12-03T05:43:09
2018-12-03T05:43:09
160,137,611
0
0
null
null
null
null
UTF-8
Java
false
false
9,784
java
/** * @file MtcUtil.java * @brief MtcUtil interface */ /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 3.0.2 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.juphoon.cmcc.app.lemon; /** * @brief MtcUtil interface */ public class MtcUtil implements MtcUtilConstants { /** * @brief Print ERROR log with format string information. * User can specific log name as the log module prefix * Log print level can be set by Mtc_CliDbSetLogLevel. * * @param [in] pcLogName The log name. Default name is "ZOS" if no log name. * @param [in] pcFormat String format. * @param [in] ... String vars. * * @see @ref MtcUtil::Mtc_AnyLogInfoStr */ public static void Mtc_AnyLogErrStr(String pcLogName, String pcFormat) { MtcUtilJNI.Mtc_AnyLogErrStr(pcLogName, pcFormat); } /** * @brief Print INFO log with format string information. * User can specific log name as the log module prefix * Log print level can be set by Mtc_CliDbSetLogLevel. * * @param [in] pcLogName The log name. Default name is "ZOS" if no log name. * @param [in] pcFormat String format. * @param [in] ... String vars. * * @see @ref MtcUtil::Mtc_AnyLogErrStr */ public static void Mtc_AnyLogInfoStr(String pcLogName, String pcFormat) { MtcUtilJNI.Mtc_AnyLogInfoStr(pcLogName, pcFormat); } /** * @brief Print DEBUG log with format string information. * User can specific log name as the log module prefix * Log print level can be set by Mtc_DbSetLogLevel. * * @param [in] pcLogName The log name. Default name is "ZOS" if no log name. * @param [in] pcFormat String format. * @param [in] ... String vars. * * @see @ref MtcUtil::Mtc_AnyLogInfoStr */ public static void Mtc_AnyLogDbgStr(String pcLogName, String pcFormat) { MtcUtilJNI.Mtc_AnyLogDbgStr(pcLogName, pcFormat); } /** * @brief This function flushs buffer into log file. * * @param [in] zLogId The log ID. * * @retval MtcCommonConstants::ZOK Flush operation successfully. * @retval MtcCommonConstants::ZFAILED Flush operation failed. * * @see */ public static int Mtc_AnyLogFlush() { return MtcUtilJNI.Mtc_AnyLogFlush(); } /** * @brief Print login ERROR log with format string information. * User can specific log name as the log module prefix * Log print level can be set by Mtc_CliDbSetLogLevel. * * @param [in] pcLogName The login log name. Default name is "ZOS" if no log name. * @param [in] pcFormat String format. * @param [in] ... String vars. * * @see @ref MtcUtil::Mtc_AnyLogLoginInfoStr */ public static void Mtc_AnyLogLoginErrStr(String pcLogName, String pcFormat) { MtcUtilJNI.Mtc_AnyLogLoginErrStr(pcLogName, pcFormat); } /** * @brief Print login INFO log with format string information. * User can specific log name as the log module prefix * Log print level can be set by Mtc_CliDbSetLogLevel. * * @param [in] pcLogName The login log name. Default name is "ZOS" if no log name. * @param [in] pcFormat String format. * @param [in] ... String vars. * * @see @ref MtcUtil::Mtc_AnyLogLoginErrStr */ public static void Mtc_AnyLogLoginInfoStr(String pcLogName, String pcFormat) { MtcUtilJNI.Mtc_AnyLogLoginInfoStr(pcLogName, pcFormat); } /** * @brief Print login DEBUG log with format string information. * User can specific log name as the log module prefix * Log print level can be set by Mtc_DbSetLogLevel. * * @param [in] pcLogName The login log name. Default name is "ZOS" if no log name. * @param [in] pcFormat String format. * @param [in] ... String vars. * * @see @ref MtcUtil::Mtc_AnyLogLoginInfoStr */ public static void Mtc_AnyLogLoginDbgStr(String pcLogName, String pcFormat) { MtcUtilJNI.Mtc_AnyLogLoginDbgStr(pcLogName, pcFormat); } /** * @brief This function flushs buffer into login log file. * * @param [in] zLogId The login log ID. * * @retval MtcCommonConstants::ZOK Flush operation successfully. * @retval MtcCommonConstants::ZFAILED Flush operation failed. * * @see */ public static int Mtc_AnyLogLoginFlush() { return MtcUtilJNI.Mtc_AnyLogLoginFlush(); } /** * @brief Get local ip count. * * @return Local ip count successfully, otherwise retrun 0. * * @see @ref MtcUtil::Mtc_GetLclIp */ public static int Mtc_GetLclIpCnt() { return MtcUtilJNI.Mtc_GetLclIpCnt(); } /** * @brief Get local ip. * * @param [in] iIndex Local ip index. * * @return Local ip successfully, otherwise return loopback address. * the caller must copy it, then use. * * @see @ref MtcUtil::Mtc_GetLclIpCnt */ public static String Mtc_GetLclIp(int iIndex) { return MtcUtilJNI.Mtc_GetLclIp(iIndex); } /** * @brief Get access network type. * * @return Access network type successfully, * otherwise return MTC_ANET_UNKNOWN. */ public static int Mtc_GetAccessNetType() { return MtcUtilJNI.Mtc_GetAccessNetType(); } /** * @brief Create a new timer. * * @param [in] iTimerType User defined timer type. * @param [in] bCycle Timer mode, cycle or once a time. * @param [in] pfnActive Timer active callback. * @param [out] pzTimerId Timer ID. * * @retval MtcCommonConstants::ZOK Timer create successfully. * @retval MtcCommonConstants::ZFAILED Timer create failed. * * @see @ref MtcUtil::Mtc_TimerDelete */ public static int Mtc_TimerCreate(int iTimerType, boolean bCycle, SWIGTYPE_p_f_unsigned_int_size_t__void pfnActive, MtcNumber pzTimerId) { return MtcUtilJNI.Mtc_TimerCreate(iTimerType, bCycle, SWIGTYPE_p_f_unsigned_int_size_t__void.getCPtr(pfnActive), pzTimerId); } /** * @brief Delete a timer. * * @param [in] zTimerId Timer ID. * * @retval MtcCommonConstants::ZOK Timer delete successfully. * @retval MtcCommonConstants::ZFAILED Timer delete failed. * * @see @ref MtcUtil::Mtc_TimerCreate */ public static int Mtc_TimerDelete(int zTimerId) { return MtcUtilJNI.Mtc_TimerDelete(zTimerId); } /** * @brief Start a timer. * * @param [in] zTimerId Timer ID. * @param [in] iTimeLen Time interval in milliseconds. * * @retval MtcCommonConstants::ZOK Timer start successfully. * @retval MtcCommonConstants::ZFAILED Timer start failed. * * @note Timer must not in running state. * * @see @ref MtcUtil::Mtc_TimerStop */ public static int Mtc_TimerStart(int zTimerId, int iTimeLen) { return MtcUtilJNI.Mtc_TimerStart(zTimerId, iTimeLen); } /** * @brief Stop a timer. * * @param [in] zTimerId Timer ID. * * @retval MtcCommonConstants::ZOK Timer stop successfully. * @retval MtcCommonConstants::ZFAILED Timer stop failed. * * @see @ref MtcUtil::Mtc_TimerStart */ public static int Mtc_TimerStop(int zTimerId) { return MtcUtilJNI.Mtc_TimerStop(zTimerId); } /** * @brief Check if a timer is running. * * @param [in] zTimerId Timer ID. * * @retval true Timer has been started and still in counting. * @retval false Otherwise. * * @see @ref MtcUtil::Mtc_TimerStart */ public static boolean Mtc_TimerIsRun(int zTimerId) { return MtcUtilJNI.Mtc_TimerIsRun(zTimerId); } /** * @brief Schedule a new timer after some seconds. * * @param [in] iTimerType User defined timer type. * @param [in] pfnSchedule User defined schedule callback. * @param [in] iTimeLen Time interval in milliseconds. * * @retval MtcCommonConstants::ZOK Timer start successfully. * @retval MtcCommonConstants::ZFAILED Timer start failed. * * @note Timer must not in running state. * * @see @ref MtcUtil::Mtc_TimerCreate */ public static int Mtc_TimerSchedule(int iTimerType, SWIGTYPE_p_f_size_t__void pfnSchedule, int iTimeLen) { return MtcUtilJNI.Mtc_TimerSchedule(iTimerType, SWIGTYPE_p_f_size_t__void.getCPtr(pfnSchedule), iTimeLen); } /** * @brief Convert time value from ZTIME_T to ST_MTC_SYS_TIME structure. * * @param [in] zTime Time value. * @param [out] pstTime Time value in ST_MTC_SYS_TIME structure. * * @retval MtcCommonConstants::ZOK Convert successfully. * @retval MtcCommonConstants::ZFAILED Convert failed. * * @see */ public static int Mtc_Time2SysTime(int zTime, ST_MTC_SYS_TIME pstTime) { return MtcUtilJNI.Mtc_Time2SysTime(zTime, ST_MTC_SYS_TIME.getCPtr(pstTime), pstTime); } /** * @brief Convert time value from ST_MTC_SYS_TIME structure to ZTIME_T. * * @param [in] pstTime Time value in ST_MTC_SYS_TIME structure. * @param [out] pzTime Time value in ZTIME_T structure. * * @retval MtcCommonConstants::ZOK Convert successfully. * @retval MtcCommonConstants::ZFAILED Convert failed. * * @see */ public static int Mtc_SysTime2Time(ST_MTC_SYS_TIME pstTime, MtcNumber pzTime) { return MtcUtilJNI.Mtc_SysTime2Time(ST_MTC_SYS_TIME.getCPtr(pstTime), pstTime, pzTime); } /** * @brief Run debug command. * * @param [in] pcCmd Command string. * * @retval MtcCommonConstants::ZOK Run command successfully. * @retval MtcCommonConstants::ZFAILED Run command failed. * * @see */ public static int Mtc_CmdRun(String pcCmd) { return MtcUtilJNI.Mtc_CmdRun(pcCmd); } /** * @brief Test sip decode. * * @param [in] pcData SIP data string. * * @retval MtcCommonConstants::ZOK Test successfully. * @retval MtcCommonConstants::ZFAILED Test failed. */ public static int Mtc_TestSipDecode(String pcData) { return MtcUtilJNI.Mtc_TestSipDecode(pcData); } /** * @brief Test http decode. * * @param [in] pcData HTTP data string. * * @retval MtcCommonConstants::ZOK Test successfully. * @retval MtcCommonConstants::ZFAILED Test failed. */ public static int Mtc_TestHttpDecode(String pcData) { return MtcUtilJNI.Mtc_TestHttpDecode(pcData); } }
[ "meng.zhaoxue@shuzijiayuan.com" ]
meng.zhaoxue@shuzijiayuan.com
74ac6d10ce71d1e6a02ca2e265ce14779f04fa88
7fff54f4b074f7f0161a3612a094aeb99eae9f06
/Player v1.5/Ranger.java
fedaf4073ac148edf35d31d90a14716a198c9969
[]
no_license
virenvshah/BattleCode
36e09ac3c8c1161110f29cf4fea7f9820203def3
249574175a9917a8acc818935bd65092c4bc82b4
refs/heads/master
2021-09-05T23:25:34.987219
2018-01-28T20:33:23
2018-01-28T20:33:23
119,709,820
1
1
null
null
null
null
UTF-8
Java
false
false
303
java
import bc.*; /** * Represents a ranger robot in the game * @author virsain */ public class Ranger extends AbstractRobot { public Ranger(int i, GameController g, Map map, MapLocation location) { super(i, g, map, location, UnitType.Ranger); state = State.Idle; previousState = State.Idle; } }
[ "vvs24@cornell.edu" ]
vvs24@cornell.edu
5d347daa667440fe4dade7b541bf7dbd068b18cb
c85b5e17379f6c7a8aa8eae0278d85833ed710da
/epoint-template-msg/src/main/java/com/epoint/tmsg/dto/StoreMsgTemplateDto.java
5b117d8e43e7fab631723b59fd0c0a8615400a69
[]
no_license
vigorous/epoint-modules
9301477249e8711168f3144aff0f9dc0a6c84ac3
1c4d45af21228560d591477b8cf292c66f0b86f0
refs/heads/master
2021-01-01T18:19:58.171879
2017-07-25T13:20:54
2017-07-25T13:20:54
98,308,389
0
0
null
null
null
null
UTF-8
Java
false
false
1,161
java
package com.epoint.tmsg.dto; import com.epoint.tmsg.enums.StoreMsgTemplateConstant; /** * Created by chiang on 2017/5/13. */ public class StoreMsgTemplateDto implements java.io.Serializable{ /** * 模版消息标题 */ private String title; /** * 模版消息标题-ERP开启显示 */ private String subTitle; private String templateIdShort; private Integer status; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getSubTitle() { return subTitle; } public void setSubTitle(String subTitle) { this.subTitle = subTitle; } public String getTemplateIdShort() { return templateIdShort; } public void setTemplateIdShort(String templateIdShort) { this.templateIdShort = templateIdShort; } public Integer getStatus() { if (status == null){ return StoreMsgTemplateConstant.Status.CLOSED.getCode(); } return status; } public void setStatus(Integer status) { this.status = status; } }
[ "cj989824" ]
cj989824
2d01c611509d7489638644559f704cde69da70fe
16dfec7df208ec48698814e96e029f7820dedb2c
/app/src/main/java/brandon/example/com/despachador/MainActivity.java
6c24f55612b54c6603050c5de87a2b6c13e38e1b
[]
no_license
Brandonitas/DespachadorApp
fd899615772b251af7e9bbe3b4b3fad5fe52b2e0
eefb22d5899b34e14a5e906f2b9589c26476a479
refs/heads/master
2021-07-19T20:04:26.133371
2017-10-31T05:49:38
2017-10-31T05:49:38
108,800,762
0
0
null
null
null
null
UTF-8
Java
false
false
3,988
java
package brandon.example.com.despachador; import android.content.Intent; import android.os.Parcelable; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.CheckBox; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class MainActivity extends AppCompatActivity { EditText editText, editText1, editText2, editText3; Button button, button2; CheckBox checkBox; TextView textView; public static int micros=2; public static int cuantum=3000; public static int tcc=15; public static int tb=15; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); editText = (EditText)findViewById(R.id.editText); editText1 = (EditText)findViewById(R.id.editText1); editText2 = (EditText)findViewById(R.id.editText2); editText3 = (EditText)findViewById(R.id.editText3); checkBox = (CheckBox) findViewById(R.id.checkBox); button=(Button) findViewById(R.id.button); button2=(Button) findViewById(R.id.button2); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (!editText.getText().toString().isEmpty() && !editText1.getText() .toString().isEmpty() && !editText2.getText() .toString().isEmpty() && !editText3.getText().toString().isEmpty()) { micros = Integer.parseInt(editText.getText().toString()); cuantum = Integer.parseInt(editText1.getText().toString()); tcc = Integer.parseInt(editText2.getText().toString()); tb = Integer.parseInt(editText3.getText().toString()); if (micros >= 1 && cuantum >= 1 && tcc >= 0 && tb >= 0) { if (checkBox.isChecked()) { Intent intent = new Intent(MainActivity.this, EditartxtActivity.class); intent.putExtra("micros", micros); intent.putExtra("cuantum", cuantum); intent.putExtra("tcc", tcc); intent.putExtra("tb", tb); startActivity(intent); } else{ Intent intent = new Intent(MainActivity.this, TablaActivity.class); intent.putExtra("micros", micros); intent.putExtra("cuantum", cuantum); intent.putExtra("tcc", tcc); intent.putExtra("tb", tb); intent.putExtra("modificado", false); startActivity(intent); } } else { Toast.makeText(MainActivity.this, "Ingresa numeros positivos mayores a 0", Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(MainActivity.this, "Debes ingresar todos los valores", Toast.LENGTH_SHORT).show(); } } }); button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { editText.setText("2"); editText1.setText("3000"); editText2.setText("15"); editText3.setText("15"); } }); } }
[ "angiebrand10@hotmail.com" ]
angiebrand10@hotmail.com
0b24cc26d755186e1d78588ee93b080f0200e569
26639ec8cc9e12a3f3aa4911f217a2a5d381a870
/.svn/pristine/0b/0b24cc26d755186e1d78588ee93b080f0200e569.svn-base
cf6f5d8428da33e6c63bd778aab99399a5e4f63d
[]
no_license
shaojava/v3.6.3
a8b4d587a48ec166d21bfe791897c6bacced2119
8c2352d67c2282fc587fc90686936e6ce451eb00
refs/heads/master
2021-12-15T02:59:25.593407
2017-07-24T05:55:49
2017-07-24T05:55:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,600
/* Copyright (c) 2011 Rapture In Venice Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package com.jinr.graph_view; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.animation.AlphaAnimation; import android.widget.*; public class WebImageView extends ImageView { public String urlString; AlphaAnimation animation; private SharedPreferences shared; private SharedPreferences.Editor editor; public WebImageView(Context context) { super(context); } public WebImageView(Context context, AttributeSet attSet) { super(context, attSet); animation = new AlphaAnimation(0, 1); animation.setDuration(500);//设置动画持续时间 } public WebImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public static void setMemoryCachingEnabled(boolean enabled) { WebImageCache.setMemoryCachingEnabled(enabled); } public static void setDiskCachingEnabled(boolean enabled) { WebImageCache.setDiskCachingEnabled(enabled); } public static void setDiskCachingDefaultCacheTimeout(int seconds) { WebImageCache.setDiskCachingDefaultCacheTimeout(seconds); } @Override public void onDetachedFromWindow() { // cancel loading if view is removed cancelCurrentLoad(); } public void setImageWithURL(Context context, String urlString, Drawable placeholderDrawable, int diskCacheTimeoutInSeconds) { if (urlString != null ) { if (null != this.urlString && urlString.compareTo(this.urlString) == 0) { return; } final WebImageManager mgr = WebImageManager.getInstance(); if(null != this.urlString) { cancelCurrentLoad(); } setImageDrawable(placeholderDrawable); this.urlString = urlString; mgr.downloadURL(context, urlString, WebImageView.this, diskCacheTimeoutInSeconds); } } public void setImageWithURL(Context context, String urlString, Drawable placeholderDrawable) { setImageWithURL(context, urlString, placeholderDrawable, -1); } // public void setImageWithURL(final Context context, final String urlString, int diskCacheTimeoutInSeconds) { // setImageWithURL(context, urlString, null, diskCacheTimeoutInSeconds); // } public void setImageWithURL(final Context context, final String urlString, int resId) { Resources rsrc = this.getResources(); Drawable placeholderDrawable = rsrc.getDrawable(resId); setImageWithURL(context, urlString, placeholderDrawable, -1); } public void setImageWithURL(final Context context, final String urlString, int resId,int diskCacheTimeoutInSeconds) { Resources rsrc = this.getResources(); Drawable placeholderDrawable = rsrc.getDrawable(resId); setImageWithURL(context, urlString, placeholderDrawable, diskCacheTimeoutInSeconds); } public void setImageWithURL(final Context context, final String urlString) { setImageWithURL(context, urlString, null, -1); } public void cancelCurrentLoad() { WebImageManager mgr = WebImageManager.getInstance(); // cancel any existing request mgr.cancelForWebImageView(this); } @Override public void setImageBitmap(Bitmap bm) { super.setImageBitmap(bm); this.startAnimation(animation); } }
[ "Zhongrong.Yu@lavainternational.com" ]
Zhongrong.Yu@lavainternational.com
c3a22f027e5504e456e6c5c6cd7736043897334e
27dcd4a0eb931a1d8f4712ddf58b3a851b05c8b2
/core/src/test/java/io/github/jtsato/bookstore/core/author/usecase/FindAuthorsByIdsUseCaseTest.java
f968ec2cd08a768dfb51be0bdbb19898d20298d0
[ "Apache-2.0" ]
permissive
jtsato/java-clean-architecture-example
65ec928df6b02603dc4324200b1a5a78bd983bbc
0e753814d9cf5301b0921da4a0c125fe9eabd4b3
refs/heads/master
2021-07-06T21:43:09.722694
2021-05-07T00:02:47
2021-05-07T00:02:47
282,562,948
16
5
Apache-2.0
2021-06-24T21:16:41
2020-07-26T02:46:51
Java
UTF-8
Java
false
false
6,614
java
package io.github.jtsato.bookstore.core.author.usecase; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; import java.time.LocalDate; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Mockito; import io.github.jtsato.bookstore.core.author.domain.Author; import io.github.jtsato.bookstore.core.author.domain.Gender; import io.github.jtsato.bookstore.core.author.gateway.FindAuthorsByIdsGateway; import io.github.jtsato.bookstore.core.author.action.FindAuthorsByIdsAction; import io.github.jtsato.bookstore.core.common.paging.Page; import io.github.jtsato.bookstore.core.common.paging.PageImpl; import io.github.jtsato.bookstore.core.common.paging.Pageable; import io.github.jtsato.bookstore.core.exception.InvalidParameterException; /** * @author Jorge Takeshi Sato */ @DisplayName("Find Authors By Ids") class FindAuthorsByIdsUseCaseTest { @Mock private final FindAuthorsByIdsGateway findAuthorsByIdsGateway = Mockito.mock(FindAuthorsByIdsGateway.class); @InjectMocks private final FindAuthorsByIdsUseCase findAuthorsByIdsUseCase = new FindAuthorsByIdsAction(findAuthorsByIdsGateway); @DisplayName("Fail to find authors by IDs if parameters are not valid") @Test void failToFindAuthorsByIdsIfParametersAreNotValid() { when(findAuthorsByIdsGateway.execute(null)).thenReturn(null); final Exception exception = Assertions.assertThrows(Exception.class, () -> findAuthorsByIdsUseCase.findAuthorsByIds(null)); assertThat(exception).isInstanceOf(InvalidParameterException.class); final InvalidParameterException invalidParameterException = (InvalidParameterException) exception; assertThat(invalidParameterException.getMessage()).isEqualTo("validation.authors.ids.null"); } @DisplayName("Successful to find authors by IDs, when at least one is found") @Test void successfulToFindAuthorsByIdsIfFound() { final List<Long> ids = Arrays.asList(1L, 2L); when(findAuthorsByIdsGateway.execute(ids)).thenReturn(mockFindAuthorsByIdsGatewayOut()); final Page<Author> pageOfAuthors = findAuthorsByIdsUseCase.findAuthorsByIds(ids); assertThat(pageOfAuthors).isNotNull(); final Pageable pageable = pageOfAuthors.getPageable(); assertThat(pageable).isNotNull(); assertThat(pageable.getPage()).isZero(); assertThat(pageable.getSize()).isOne(); assertThat(pageable.getNumberOfElements()).isOne(); assertThat(pageable.getTotalOfElements()).isOne(); assertThat(pageable.getTotalPages()).isOne(); final List<Author> authors = pageOfAuthors.getContent(); assertThat(authors).isNotNull().isNotEmpty(); assertThat(authors.size()).isOne(); final Author author = authors.get(0); assertThat(author.getId()).isEqualTo(1L); assertThat(author.getName()).isEqualTo("Joshua Bloch"); assertThat(author.getGender()).isEqualTo(Gender.MALE); assertThat(author.getBirthdate()).isEqualTo(LocalDate.parse("1961-08-28")); } private Page<Author> mockFindAuthorsByIdsGatewayOut() { final List<Author> content = new ArrayList<>(1); content.add(new Author(1L, "Joshua Bloch", Gender.MALE, LocalDate.parse("1961-08-28"))); return new PageImpl<>(content, new Pageable(0, 1, 1, 1L, 1)); } @DisplayName("Fail to find authors by IDs if not found") @Test void failToFindAuthorsByIdsIfNotFound() { final List<Long> ids = Arrays.asList(1L, 2L); final Page<Author> pageOfAuthors = new PageImpl<>(Collections.emptyList(), new Pageable(0, 1, 0, 0L, 0)); when(findAuthorsByIdsGateway.execute(ids)).thenReturn(pageOfAuthors); final Pageable pageable = pageOfAuthors.getPageable(); assertThat(pageable).isNotNull(); assertThat(pageable.getPage()).isZero(); assertThat(pageable.getSize()).isOne(); assertThat(pageable.getNumberOfElements()).isZero(); assertThat(pageable.getTotalOfElements()).isZero(); assertThat(pageable.getTotalPages()).isZero(); } @DisplayName("Fail to find authors by IDs if the limit is exceeded") @Test void failToFindAuthorsByIdsIfTheLimitIsExceeded() { final List<Long> ids = new ArrayList<>(1001); for (int index = 1; index <= 1001; index++) { ids.add((long) index); } when(findAuthorsByIdsGateway.execute(ids)).thenReturn(mockFindAuthorsByIdsGatewayOut()); final Exception exception = Assertions.assertThrows(Exception.class, () -> findAuthorsByIdsUseCase.findAuthorsByIds(ids)); assertThat(exception).isInstanceOf(InvalidParameterException.class); final InvalidParameterException invalidParameterException = (InvalidParameterException) exception; assertThat(invalidParameterException.getMessage()).isEqualTo("validation.get.by.ids.limit"); } @DisplayName("Successful to find authors by IDs if the limit is exceeded") @Test void successfulToFindAuthorsByIdsIfTheLimitIsNotExceeded() { final List<Long> ids = new ArrayList<>(1000); for (int index = 1; index <= 1000; index++) { ids.add((long) index); } when(findAuthorsByIdsGateway.execute(ids)).thenReturn(mockFindAuthorsByIdsGatewayOut()); final Page<Author> pageOfAuthors = findAuthorsByIdsUseCase.findAuthorsByIds(ids); assertThat(pageOfAuthors).isNotNull(); final Pageable pageable = pageOfAuthors.getPageable(); assertThat(pageable).isNotNull(); assertThat(pageable.getPage()).isZero(); assertThat(pageable.getSize()).isOne(); assertThat(pageable.getNumberOfElements()).isOne(); assertThat(pageable.getTotalOfElements()).isOne(); assertThat(pageable.getTotalPages()).isOne(); final List<Author> authors = pageOfAuthors.getContent(); assertThat(authors).isNotNull().isNotEmpty(); assertThat(authors.size()).isOne(); final Author author = authors.get(0); assertThat(author.getId()).isEqualTo(1L); assertThat(author.getName()).isEqualTo("Joshua Bloch"); assertThat(author.getGender()).isEqualTo(Gender.MALE); assertThat(author.getBirthdate()).isEqualTo(LocalDate.parse("1961-08-28")); } }
[ "jorge.takeshi.sato@gmail.com" ]
jorge.takeshi.sato@gmail.com
9a21b01d256be8e9bc8893fdbc60eabc3a39e87b
7b9bb48e9fad83bbee196996feea6f162d8f0118
/src/main/java/com/laselva/kafka/CustomerListener.java
35159939480cb6f1579085131fac6ad04a0e5a53
[]
no_license
adrianolaselva/blueprint-java-springboot-kafka
5569ebbd75d87671e112714b7dd3e86a42e20e2d
66cfba9f51e5eb93744fef3a12f1e43961db4738
refs/heads/master
2020-09-19T16:56:46.570119
2019-11-26T17:28:19
2019-11-26T17:28:19
224,248,385
0
1
null
null
null
null
UTF-8
Java
false
false
1,232
java
package com.laselva.kafka; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.common.header.Headers; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.kafka.annotation.KafkaListener; import org.springframework.messaging.handler.annotation.Payload; import org.springframework.stereotype.Service; import java.util.stream.StreamSupport; @Service public class CustomerListener { private static final Logger logger = LoggerFactory.getLogger(CustomerListener.class); @KafkaListener(topics = "customer-topic", clientIdPrefix = "json", containerFactory = "kafkaListenerContainerFactory") public void listenAsObject(ConsumerRecord<String, Customer> cr, @Payload Customer payload) { logger.info("Logger 1 [JSON] received key {}: Type [{}] | Payload: {} | Record: {}", cr.key(), typeIdHeader(cr.headers()), payload, cr.toString()); } private static String typeIdHeader(Headers headers) { return StreamSupport.stream(headers.spliterator(), false) .filter(header -> header.key().equals("__TypeId__")) .findFirst().map(header -> new String(header.value())).orElse("N/A"); } }
[ "adriano.selva@picpay.com" ]
adriano.selva@picpay.com
277ab396aaa2f2a65114ca92952cdecaae6db89c
9a9f8bfc04c39aa9e9008ded5e3eb4d1fb018aa6
/src/com/collection/methods/EmployeeManagement.java
8862bc39dbe1ecf77e79e6eb04c64dd385234ef5
[]
no_license
amrendrabagga/Task-4-30-aug-19
77559ef0c0e4b0205bfe1d93f7ff66df40028b6b
89c4454a2f19391f9cae06a3366cf9f8f33cd9bb
refs/heads/master
2020-07-14T23:44:50.331067
2019-08-30T17:41:09
2019-08-30T17:41:09
205,429,671
0
0
null
null
null
null
UTF-8
Java
false
false
3,341
java
package com.collection.methods; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; public class EmployeeManagement { public static void main(String args[]) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int i = 1; ArrayList<Employee> empList = new ArrayList<>(); while (i != 0) { System.out.println("OPTIONS"); System.out.println("============================================================="); System.out.println("1. ADD EMPLOYEE"); System.out.println("2. VIEW EMPLOYEES"); System.out.println("3. REMOVE EMPLOYEE"); System.out.println("4. CLEAR DATA"); System.out.println("5. CHANGE SALARY"); System.out.println("6. SEARCH EMPLOYEE"); System.out.println("7. VIEW DEPARTMENT WISE LIST"); System.out.println("8. EXIT"); int input = Integer.parseInt(reader.readLine()); if (input == 8) System.exit(0); switch (input) { case 1: System.out.println("ENTER EMPLOYEE DETAILS - "); System.out.println("ENTER ENO "); int eno = Integer.parseInt(reader.readLine()); System.out.println("ENTER ENAME "); String ename = reader.readLine(); System.out.println("ENTER SALARY "); long salary = Integer.parseInt(reader.readLine()); System.out.println("ENTER DESIGNATION "); String designation = reader.readLine(); System.out.println("ENTER DEPARTMENT NAME "); String dept = reader.readLine(); Employee emp = new Employee(eno, ename, salary, designation, dept); empList.add(emp); System.out.println(emp); System.out.println("EMPLOYEE ADDED SUCCESSFULLY"); break; case 2: if (empList.size() != 0) { for (Employee e : empList) { System.out.println(e); } } else System.out.println("NO DATA PRESENT"); break; case 3: System.out.println("ENTER ENO "); int eno1 = Integer.parseInt(reader.readLine()); empList.removeIf(x -> x.getEno() == eno1); System.out.println("EMPLOYEE REMOVED SUCCESSFULLY"); break; case 4: empList.clear(); System.out.println("DATA REMOVED"); break; case 5: System.out.println("ENTER ENO AND NEW SALARY "); int eno2 = Integer.parseInt(reader.readLine()); long newSalary = Long.parseLong(reader.readLine()); Employee fetchEmp = empList.stream().filter(x -> x.getEno() == eno2).findFirst().orElse(null); if (fetchEmp != null) { fetchEmp.setSalary(newSalary); System.out.println("SALARY CHANGED SUCCESSFULLY"); } else System.out.println("NO SUCH ENO FOUND"); break; case 6: System.out.println("ENTER ENO "); int eno3 = Integer.parseInt(reader.readLine()); empList.stream().filter(x -> x.getEno() == eno3).forEach(x -> System.out.println(x)); break; case 7: System.out.println("ENTER DEPARTMENT NAME "); String dept1 = reader.readLine(); Map<String, List<Employee>> deptWiseEmployee = empList.stream().filter(x -> x.getDept().equals(dept1)) .collect(Collectors.groupingBy(x -> x.getDept(), Collectors.toList())); deptWiseEmployee.forEach((k, v) -> System.out.println(k + " ->" + v)); break; } } reader.close(); } }
[ "amrendrabagga@gmail.com" ]
amrendrabagga@gmail.com
ecf5dc7ec23d9f70d398a5208cdd23708581a0b7
125602e06883342f57a55489119bd504b71f9289
/test/unit/java/com/articulate/sigma/trans/TPTP3ProofProcTest.java
15a95f4d299e75808bf26287f31fb11fc3daed11
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
manisabri/sigmakee
45fe3591071104176c80cfbaae7a9bb407ce2f98
16eab15a396e01976bac7795df902984c1079513
refs/heads/master
2022-05-26T02:19:27.357494
2020-04-28T20:32:50
2020-04-28T20:32:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,165
java
package com.articulate.sigma.trans; import com.articulate.sigma.FormulaPreprocessor; import com.articulate.sigma.trans.*; import com.articulate.sigma.*; import org.junit.Test; import org.junit.Before; import java.io.File; import java.io.FileWriter; import java.io.PrintWriter; import java.util.*; import static org.junit.Assert.*; import org.junit.Ignore; import org.junit.BeforeClass; /** */ public class TPTP3ProofProcTest extends UnitTestBase { /** *************************************************************** */ @BeforeClass public static void init() { } /** *************************************************************** */ public void test(String input, String expected, String label) { System.out.println("============================="); System.out.println("TPTP3ProofProcTest: " + label); System.out.println(); TPTP3ProofProcessor tpp = new TPTP3ProofProcessor(); String actual = tpp.getPrologArgs(input).toString(); System.out.println("Expected: " + expected); if (!StringUtil.emptyString(actual) && actual.equals(expected)) System.out.println(label + " : Success"); else System.out.println(label + " : fail!"); assertEquals(expected, actual); } /** *************************************************************** */ @Test public void testGetPrologArgs1() { String input = "fof(c_0_5, axiom, (s__subclass(s__Artifact,s__Object)), c_0_3)."; String expected = "[fof, c_0_5, axiom, (s__subclass(s__Artifact,s__Object)), c_0_3]"; test(input,expected,"testGetPrologArgs1"); } /** *************************************************************** */ @Test public void testGetPrologArgs2() { String input = "fof(c_0_2, negated_conjecture,(~(?[X1]:(s__subclass(X1,s__Object)&~$answer(esk1_1(X1)))))," + "inference(assume_negation,[status(cth)],[inference(add_answer_literal,[status(thm)],[c_0_0, theory(answers)])]))."; String expected = "[fof, c_0_2, negated_conjecture, (~(?[X1]:(s__subclass(X1,s__Object)&~$answer(esk1_1(X1))))), " + "inference(assume_negation,[status(cth)],[inference(add_answer_literal,[status(thm)],[c_0_0, theory(answers)])])]"; test(input,expected,"testGetPrologArgs2"); } /** *************************************************************** */ @Test public void testGetPrologArgs3() { String input = "cnf(c_0_14,negated_conjecture,($false), " + "inference(eval_answer_literal,[status(thm)], " + "[inference(spm,[status(thm)],[c_0_12, c_0_13, theory(equality)]), theory(answers)]), ['proof'])."; String expected = "[cnf, c_0_14, negated_conjecture, ($false), inference(eval_answer_literal,[status(thm)], " + "[inference(spm,[status(thm)],[c_0_12, c_0_13, theory(equality)]), theory(answers)]), ['proof']]"; test(input,expected,"testGetPrologArgs3"); } /** *************************************************************** */ @Test public void testGetPrologArgs4() { String input = "fof(f185,conjecture,(" + " ? [X15] : s__subclass(X15,s__Entity))," + " file('/home/apease/.sigmakee/KBs/temp-comb.tptp',unknown))."; String expected = "[fof, f185, conjecture, ( ? [X15] : s__subclass(X15,s__Entity)), " + "file('/home/apease/.sigmakee/KBs/temp-comb.tptp',unknown)]"; test(input,expected,"testGetPrologArgs4"); } /** *************************************************************** */ @Test public void testParseProofStep () { System.out.println("========================"); String ps1 = "fof(c_0_5, axiom, (s__subclass(s__Artifact,s__Object)), c_0_3)."; String ps2 = "fof(c_0_2, negated_conjecture,(~(?[X1]:(s__subclass(X1,s__Object)&~$answer(esk1_1(X1)))))," + "inference(assume_negation,[status(cth)],[inference(add_answer_literal,[status(thm)],[c_0_0, theory(answers)])]))."; String ps3 = "cnf(c_0_14,negated_conjecture,($false), " + "inference(eval_answer_literal,[status(thm)], [inference(spm,[status(thm)],[c_0_12, c_0_13, theory(equality)]), theory(answers)]), ['proof'])."; String ps4 = "fof(f185,conjecture,(" + " ? [X15] : s__subclass(X15,s__Entity))," + " file('/home/apease/.sigmakee/KBs/temp-comb.tptp',unknown))."; TPTP3ProofProcessor tpp = new TPTP3ProofProcessor(); tpp.idTable.put("c_0_0", Integer.valueOf(0)); tpp.idTable.put("c_0_3", Integer.valueOf(1)); tpp.idTable.put("c_0_12", Integer.valueOf(2)); tpp.idTable.put("c_0_13", Integer.valueOf(3)); System.out.println(tpp.parseProofStep(ps1)); System.out.println(); System.out.println(tpp.parseProofStep(ps2)); System.out.println(); System.out.println(tpp.parseProofStep(ps3)); System.out.println(); tpp.idTable.put("f185", Integer.valueOf(4)); System.out.println(tpp.parseProofStep(ps4)); } /** *************************************************************** */ @Test public void testParseAnswers () { System.out.println("========================"); String label = "testParseAnswers"; System.out.println("TPTP3ProofProcTest: " + label); System.out.println(); String line = "[[s__A,s__B]|_]"; TPTP3ProofProcessor tpp = new TPTP3ProofProcessor(); tpp.processAnswers(line); String actual = tpp.bindings.toString(); String expected = "[A, B]"; System.out.println("Actual: " + actual); System.out.println("Expected: " + expected); if (!StringUtil.emptyString(actual) && actual.equals(expected)) System.out.println(label + " : Success"); else System.out.println(label + " : fail!"); assertEquals(expected, actual); line = "% SZS answers Tuple [[s__A,s__B]|_] for temp-comb"; tpp = new TPTP3ProofProcessor(); tpp.processAnswers(line.substring(20,line.lastIndexOf(']')+1).trim()); actual = tpp.bindings.toString(); expected = "[A, B]"; System.out.println("Actual: " + actual); System.out.println("Expected: " + expected); if (!StringUtil.emptyString(actual) && actual.equals(expected)) System.out.println(label + " : Success"); else System.out.println(label + " : fail!"); assertEquals(expected, actual); } /** *************************************************************** */ @Test public void testExtractAnswerClause () { System.out.println("========================"); String label = "testExtractAnswerClause"; String input = "(forall (?X0) (or (not (instance ?X0 Relation)) (not (ans0 ?X0))))"; TPTP3ProofProcessor tpp = new TPTP3ProofProcessor(); Formula ans = tpp.extractAnswerClause(new Formula(input)); assertFalse(ans == null); String actual = ans.toString(); String expected = "(ans0 ?X0)"; System.out.println("Actual: " + actual); System.out.println("Expected: " + expected); if (!StringUtil.emptyString(actual) && actual.equals(expected)) System.out.println(label + " : Success"); else System.out.println(label + " : fail!"); assertEquals(expected, actual); } /** *************************************************************** */ @Test public void testProcessAnswersFromProof () { System.out.println("========================"); String label = "testProcessAnswersFromProof"; ArrayList<String> input = new ArrayList(); input.add("% SZS status Theorem for temp-comb"); input.add("% SZS answers Tuple [[s__TransitFn__m]|_] for temp-comb"); input.add("% SZS output start Proof for temp-comb"); input.add("fof(f916,plain,( $false), inference(unit_resulting_resolution,[],[f915,f914]))."); input.add("fof(f914,plain,( ~ans0(s__TransitFn__m)), inference(resolution,[],[f601,f822]))."); input.add("fof(f822,plain,( s__instance(s__TransitFn__m,s__Relation)), inference(cnf_transformation,[],[f200]))."); input.add("fof(f200,axiom,( s__instance(s__TransitFn__m,s__Relation)), file('/home/apease/.sigmakee/KBs/temp-comb.tptp',kb_SUMO_200))."); input.add("fof(f601,plain,( ( ! [X0] : (~s__instance(X0,s__Relation) | ~ans0(X0)) )), inference(cnf_transformation,[],[f553]))."); input.add("fof(f553,plain,( ! [X0] : (~s__instance(X0,s__Relation) | ~ans0(X0))), inference(ennf_transformation,[],[f395]))."); input.add("fof(f395,plain,( ~? [X0] : (s__instance(X0,s__Relation) & ans0(X0))), inference(rectify,[],[f394]))."); input.add("fof(f394,plain,( ~? [X16] : (s__instance(X16,s__Relation) & ans0(X16))), inference(answer_literal,[],[f393]))."); input.add("fof(f393,negated_conjecture,( ~? [X16] : s__instance(X16,s__Relation)), inference(negated_conjecture,[],[f392]))."); input.add("fof(f392,conjecture,( ? [X16] : s__instance(X16,s__Relation)), file('/home/apease/.sigmakee/KBs/temp-comb.tptp',query_0))."); input.add("fof(f915,plain,( ( ! [X0] : (ans0(X0)) )), introduced(answer_literal,[]))."); TPTP3ProofProcessor tpp = new TPTP3ProofProcessor(); KB kb = KBmanager.getMgr().getKB(KBmanager.getMgr().getPref("sumokbname")); tpp = tpp.parseProofOutput(input,kb); tpp.processAnswersFromProof("(instance ?X Entity)"); String actual = tpp.bindingMap.toString(); String expected = "{?X=TransitFn}"; System.out.println("Actual: " + actual); System.out.println("Expected: " + expected); if (!StringUtil.emptyString(actual) && actual.equals(expected)) System.out.println(label + " : Success"); else System.out.println(label + " : fail!"); assertEquals(expected, actual); } }
[ "apease@articulatesoftware.com" ]
apease@articulatesoftware.com
00d246ec41a7ac8cdffe95c82404a649545ca1c9
b4655fab5adb703af8df9a896ebcbcb986bbbb43
/src/com/company/pokerTables/TexasHoldemPokerTable.java
60ec145bb16b340db57d288046c2357f920629c3
[]
no_license
genrihssaruhanovs/Poker
f4a334cf97a3cee21999f0e000ae7a6534515c1d
136cc202e0a9b5b15e38c1c27b38149993ab6fcb
refs/heads/master
2022-12-15T00:19:01.049221
2020-09-15T14:25:24
2020-09-15T14:25:24
293,905,455
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package com.company.pokerTables; import com.company.CardSet; import com.company.EvaluatedHand; import com.company.combinations.CombinationFactory; import com.company.enums.PokerTableTypes; import java.util.Collections; public class TexasHoldemPokerTable extends HoldemPokerTable { public TexasHoldemPokerTable(String inputString) { super(inputString, PokerTableTypes.TEXAS); } @Override public void evaluateTable() { for (CardSet hand : hands) { evaluatedHands.add(new EvaluatedHand(hand, CombinationFactory.getBestCombination(board, hand))); } Collections.sort(evaluatedHands); } }
[ "genrihs.saruhanovs@gmail.com" ]
genrihs.saruhanovs@gmail.com
4d2ea4c1fd849a4fc10a65d5a338c20dcc6f5725
5d3d78d93c49823a91f5e1e18bd1565893002321
/src/main/java/org/gwtproject/i18n/shared/cldr/impl/CurrencyList_ru_UA.java
0535e8257b765bda35669e7adebaac21ab247e5e
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
vegegoku/gwt-i18n-cldr
ecf38343c0448bab21118c8cdc017ed91b628e71
fdf25c7f898993a50ef9d10fe41ccc44c1ee500f
refs/heads/master
2021-06-11T05:07:57.695293
2020-08-27T08:26:12
2020-08-27T08:26:12
128,426,644
2
1
null
2020-07-17T17:29:11
2018-04-06T17:38:54
Java
UTF-8
Java
false
false
53,016
java
package org.gwtproject.i18n.shared.cldr.impl; import java.lang.Override; import java.lang.String; import java.util.HashMap; import javax.annotation.Generated; import org.gwtproject.i18n.shared.cldr.CurrencyData; import org.gwtproject.i18n.shared.cldr.CurrencyDataImpl; @Generated("gwt-cldr-importer : org.gwtproject.tools.cldr.CurrencyListProcessor, CLDR version : release-34") public class CurrencyList_ru_UA extends CurrencyList_ru { public CurrencyData getDefault() { return new CurrencyDataImpl("UAH","грн.",2,"грн.","грн."); } protected HashMap<String, CurrencyData> loadCurrencyMap() { HashMap<String,CurrencyData> result = super.loadCurrencyMap(); // Андоррская песета result.put("ADP", new CurrencyDataImpl("ADP","ADP",128,"ADP","ADP")); // дирхам ОАЭ result.put("AED", new CurrencyDataImpl("AED","AED",2,"AED","AED")); // Афгани (1927–2002) result.put("AFA", new CurrencyDataImpl("AFA","AFA",130,"AFA","AFA")); // афгани result.put("AFN", new CurrencyDataImpl("AFN","AFN",0,"AFN","AFN")); // ALK result.put("ALK", new CurrencyDataImpl("ALK","ALK",130,"ALK","ALK")); // албанский лек result.put("ALL", new CurrencyDataImpl("ALL","ALL",0,"ALL","ALL")); // армянский драм result.put("AMD", new CurrencyDataImpl("AMD","AMD",2,"AMD","AMD")); // нидерландский антильский гульден result.put("ANG", new CurrencyDataImpl("ANG","ANG",2,"ANG","ANG")); // ангольская кванза result.put("AOA", new CurrencyDataImpl("AOA","AOA",2,"AOA","AOA")); // Ангольская кванза (1977–1990) result.put("AOK", new CurrencyDataImpl("AOK","AOK",130,"AOK","AOK")); // Ангольская новая кванза (1990–2000) result.put("AON", new CurrencyDataImpl("AON","AON",130,"AON","AON")); // Ангольская кванза реюстадо (1995–1999) result.put("AOR", new CurrencyDataImpl("AOR","AOR",130,"AOR","AOR")); // Аргентинский аустрал result.put("ARA", new CurrencyDataImpl("ARA","ARA",130,"ARA","ARA")); // ARL result.put("ARL", new CurrencyDataImpl("ARL","ARL",130,"ARL","ARL")); // ARM result.put("ARM", new CurrencyDataImpl("ARM","ARM",130,"ARM","ARM")); // Аргентинское песо (1983–1985) result.put("ARP", new CurrencyDataImpl("ARP","ARP",130,"ARP","ARP")); // аргентинский песо result.put("ARS", new CurrencyDataImpl("ARS","ARS",2,"ARS","ARS")); // Австрийский шиллинг result.put("ATS", new CurrencyDataImpl("ATS","ATS",130,"ATS","ATS")); // австралийский доллар result.put("AUD", new CurrencyDataImpl("AUD","A$",2,"A$","A$")); // арубанский флорин result.put("AWG", new CurrencyDataImpl("AWG","AWG",2,"AWG","AWG")); // Старый азербайджанский манат result.put("AZM", new CurrencyDataImpl("AZM","AZM",130,"AZM","AZM")); // азербайджанский манат result.put("AZN", new CurrencyDataImpl("AZN","AZN",2,"AZN","AZN")); // Динар Боснии и Герцеговины result.put("BAD", new CurrencyDataImpl("BAD","BAD",130,"BAD","BAD")); // конвертируемая марка Боснии и Герцеговины result.put("BAM", new CurrencyDataImpl("BAM","BAM",2,"BAM","BAM")); // BAN result.put("BAN", new CurrencyDataImpl("BAN","BAN",130,"BAN","BAN")); // барбадосский доллар result.put("BBD", new CurrencyDataImpl("BBD","BBD",2,"BBD","BBD")); // бангладешская така result.put("BDT", new CurrencyDataImpl("BDT","BDT",2,"BDT","BDT")); // Бельгийский франк (конвертируемый) result.put("BEC", new CurrencyDataImpl("BEC","BEC",130,"BEC","BEC")); // Бельгийский франк result.put("BEF", new CurrencyDataImpl("BEF","BEF",130,"BEF","BEF")); // Бельгийский франк (финансовый) result.put("BEL", new CurrencyDataImpl("BEL","BEL",130,"BEL","BEL")); // Лев result.put("BGL", new CurrencyDataImpl("BGL","BGL",130,"BGL","BGL")); // BGM result.put("BGM", new CurrencyDataImpl("BGM","BGM",130,"BGM","BGM")); // болгарский лев result.put("BGN", new CurrencyDataImpl("BGN","BGN",2,"BGN","BGN")); // BGO result.put("BGO", new CurrencyDataImpl("BGO","BGO",130,"BGO","BGO")); // бахрейнский динар result.put("BHD", new CurrencyDataImpl("BHD","BHD",3,"BHD","BHD")); // бурундийский франк result.put("BIF", new CurrencyDataImpl("BIF","BIF",0,"BIF","BIF")); // бермудский доллар result.put("BMD", new CurrencyDataImpl("BMD","BMD",2,"BMD","BMD")); // брунейский доллар result.put("BND", new CurrencyDataImpl("BND","BND",2,"BND","BND")); // боливийский боливиано result.put("BOB", new CurrencyDataImpl("BOB","BOB",2,"BOB","BOB")); // BOL result.put("BOL", new CurrencyDataImpl("BOL","BOL",130,"BOL","BOL")); // Боливийское песо result.put("BOP", new CurrencyDataImpl("BOP","BOP",130,"BOP","BOP")); // Боливийский мвдол result.put("BOV", new CurrencyDataImpl("BOV","BOV",130,"BOV","BOV")); // Бразильский новый крузейро (1967–1986) result.put("BRB", new CurrencyDataImpl("BRB","BRB",130,"BRB","BRB")); // Бразильское крузадо result.put("BRC", new CurrencyDataImpl("BRC","BRC",130,"BRC","BRC")); // Бразильский крузейро (1990–1993) result.put("BRE", new CurrencyDataImpl("BRE","BRE",130,"BRE","BRE")); // бразильский реал result.put("BRL", new CurrencyDataImpl("BRL","R$",2,"R$","R$")); // Бразильское новое крузадо result.put("BRN", new CurrencyDataImpl("BRN","BRN",130,"BRN","BRN")); // Бразильский крузейро result.put("BRR", new CurrencyDataImpl("BRR","BRR",130,"BRR","BRR")); // BRZ result.put("BRZ", new CurrencyDataImpl("BRZ","BRZ",130,"BRZ","BRZ")); // багамский доллар result.put("BSD", new CurrencyDataImpl("BSD","BSD",2,"BSD","BSD")); // бутанский нгултрум result.put("BTN", new CurrencyDataImpl("BTN","BTN",2,"BTN","BTN")); // Джа result.put("BUK", new CurrencyDataImpl("BUK","BUK",130,"BUK","BUK")); // ботсванская пула result.put("BWP", new CurrencyDataImpl("BWP","BWP",2,"BWP","BWP")); // Белорусский рубль (1994–1999) result.put("BYB", new CurrencyDataImpl("BYB","BYB",130,"BYB","BYB")); // белорусский рубль result.put("BYN", new CurrencyDataImpl("BYN","BYN",2,"BYN","BYN")); // Белорусский рубль (2000–2016) result.put("BYR", new CurrencyDataImpl("BYR","BYR",128,"BYR","BYR")); // белизский доллар result.put("BZD", new CurrencyDataImpl("BZD","BZD",2,"BZD","BZD")); // канадский доллар result.put("CAD", new CurrencyDataImpl("CAD","CA$",2,"CA$","CA$")); // конголезский франк result.put("CDF", new CurrencyDataImpl("CDF","CDF",2,"CDF","CDF")); // WIR евро result.put("CHE", new CurrencyDataImpl("CHE","CHE",130,"CHE","CHE")); // швейцарский франк result.put("CHF", new CurrencyDataImpl("CHF","CHF",2,"CHF","CHF")); // WIR франк result.put("CHW", new CurrencyDataImpl("CHW","CHW",130,"CHW","CHW")); // CLE result.put("CLE", new CurrencyDataImpl("CLE","CLE",130,"CLE","CLE")); // Условная расчетная единица Чили result.put("CLF", new CurrencyDataImpl("CLF","CLF",132,"CLF","CLF")); // чилийский песо result.put("CLP", new CurrencyDataImpl("CLP","CLP",0,"CLP","CLP")); // китайский офшорный юань result.put("CNH", new CurrencyDataImpl("CNH","CNH",130,"CNH","CNH")); // CNX result.put("CNX", new CurrencyDataImpl("CNX","CNX",130,"CNX","CNX")); // китайский юань result.put("CNY", new CurrencyDataImpl("CNY","CN¥",2,"CN¥","CN¥")); // колумбийский песо result.put("COP", new CurrencyDataImpl("COP","COP",2,"COP","COP")); // Единица реальной стоимости Колумбии result.put("COU", new CurrencyDataImpl("COU","COU",130,"COU","COU")); // костариканский колон result.put("CRC", new CurrencyDataImpl("CRC","CRC",2,"CRC","CRC")); // Старый Сербский динар result.put("CSD", new CurrencyDataImpl("CSD","CSD",130,"CSD","CSD")); // Чехословацкая твердая крона result.put("CSK", new CurrencyDataImpl("CSK","CSK",130,"CSK","CSK")); // кубинский конвертируемый песо result.put("CUC", new CurrencyDataImpl("CUC","CUC",2,"CUC","CUC")); // кубинский песо result.put("CUP", new CurrencyDataImpl("CUP","CUP",2,"CUP","CUP")); // эскудо Кабо-Верде result.put("CVE", new CurrencyDataImpl("CVE","CVE",2,"CVE","CVE")); // Кипрский фунт result.put("CYP", new CurrencyDataImpl("CYP","CYP",130,"CYP","CYP")); // чешская крона result.put("CZK", new CurrencyDataImpl("CZK","CZK",2,"CZK","CZK")); // Восточногерманская марка result.put("DDM", new CurrencyDataImpl("DDM","DDM",130,"DDM","DDM")); // Немецкая марка result.put("DEM", new CurrencyDataImpl("DEM","DEM",130,"DEM","DEM")); // франк Джибути result.put("DJF", new CurrencyDataImpl("DJF","DJF",0,"DJF","DJF")); // датская крона result.put("DKK", new CurrencyDataImpl("DKK","DKK",2,"DKK","DKK")); // доминиканский песо result.put("DOP", new CurrencyDataImpl("DOP","DOP",2,"DOP","DOP")); // алжирский динар result.put("DZD", new CurrencyDataImpl("DZD","DZD",2,"DZD","DZD")); // Эквадорский сукре result.put("ECS", new CurrencyDataImpl("ECS","ECS",130,"ECS","ECS")); // Постоянная единица стоимости Эквадора result.put("ECV", new CurrencyDataImpl("ECV","ECV",130,"ECV","ECV")); // Эстонская крона result.put("EEK", new CurrencyDataImpl("EEK","EEK",130,"EEK","EEK")); // египетский фунт result.put("EGP", new CurrencyDataImpl("EGP","EGP",2,"EGP","EGP")); // эритрейская накфа result.put("ERN", new CurrencyDataImpl("ERN","ERN",2,"ERN","ERN")); // Испанская песета (А) result.put("ESA", new CurrencyDataImpl("ESA","ESA",130,"ESA","ESA")); // Испанская песета (конвертируемая) result.put("ESB", new CurrencyDataImpl("ESB","ESB",130,"ESB","ESB")); // Испанская песета result.put("ESP", new CurrencyDataImpl("ESP","ESP",128,"ESP","ESP")); // эфиопский быр result.put("ETB", new CurrencyDataImpl("ETB","ETB",2,"ETB","ETB")); // евро result.put("EUR", new CurrencyDataImpl("EUR","€",2,"€","€")); // Финская марка result.put("FIM", new CurrencyDataImpl("FIM","FIM",130,"FIM","FIM")); // доллар Фиджи result.put("FJD", new CurrencyDataImpl("FJD","FJD",2,"FJD","FJD")); // фунт Фолклендских островов result.put("FKP", new CurrencyDataImpl("FKP","FKP",2,"FKP","FKP")); // Французский франк result.put("FRF", new CurrencyDataImpl("FRF","FRF",130,"FRF","FRF")); // британский фунт стерлингов result.put("GBP", new CurrencyDataImpl("GBP","£",2,"£","£")); // Грузинский купон result.put("GEK", new CurrencyDataImpl("GEK","GEK",130,"GEK","GEK")); // грузинский лари result.put("GEL", new CurrencyDataImpl("GEL","₾",2,"₾","₾")); // Ганский седи (1979–2007) result.put("GHC", new CurrencyDataImpl("GHC","GHC",130,"GHC","GHC")); // ганский седи result.put("GHS", new CurrencyDataImpl("GHS","GHS",2,"GHS","GHS")); // гибралтарский фунт result.put("GIP", new CurrencyDataImpl("GIP","GIP",2,"GIP","GIP")); // гамбийский даласи result.put("GMD", new CurrencyDataImpl("GMD","GMD",2,"GMD","GMD")); // гвинейский франк result.put("GNF", new CurrencyDataImpl("GNF","GNF",0,"GNF","GNF")); // Гвинейская сили result.put("GNS", new CurrencyDataImpl("GNS","GNS",130,"GNS","GNS")); // Эквеле экваториальной Гвинеи result.put("GQE", new CurrencyDataImpl("GQE","GQE",130,"GQE","GQE")); // Греческая драхма result.put("GRD", new CurrencyDataImpl("GRD","GRD",130,"GRD","GRD")); // гватемальский кетсаль result.put("GTQ", new CurrencyDataImpl("GTQ","GTQ",2,"GTQ","GTQ")); // Эскудо Португальской Гвинеи result.put("GWE", new CurrencyDataImpl("GWE","GWE",130,"GWE","GWE")); // Песо Гвинеи-Бисау result.put("GWP", new CurrencyDataImpl("GWP","GWP",130,"GWP","GWP")); // гайанский доллар result.put("GYD", new CurrencyDataImpl("GYD","GYD",2,"GYD","GYD")); // гонконгский доллар result.put("HKD", new CurrencyDataImpl("HKD","HK$",2,"HK$","HK$")); // гондурасская лемпира result.put("HNL", new CurrencyDataImpl("HNL","HNL",2,"HNL","HNL")); // Хорватский динар result.put("HRD", new CurrencyDataImpl("HRD","HRD",130,"HRD","HRD")); // хорватская куна result.put("HRK", new CurrencyDataImpl("HRK","HRK",2,"HRK","HRK")); // гаитянский гурд result.put("HTG", new CurrencyDataImpl("HTG","HTG",2,"HTG","HTG")); // венгерский форинт result.put("HUF", new CurrencyDataImpl("HUF","HUF",2,"HUF","HUF")); // индонезийская рупия result.put("IDR", new CurrencyDataImpl("IDR","IDR",2,"IDR","IDR")); // Ирландский фунт result.put("IEP", new CurrencyDataImpl("IEP","IEP",130,"IEP","IEP")); // Израильский фунт result.put("ILP", new CurrencyDataImpl("ILP","ILP",130,"ILP","ILP")); // ILR result.put("ILR", new CurrencyDataImpl("ILR","ILR",130,"ILR","ILR")); // новый израильский шекель result.put("ILS", new CurrencyDataImpl("ILS","₪",2,"₪","₪")); // индийская рупия result.put("INR", new CurrencyDataImpl("INR","₹",2,"₹","₹")); // иракский динар result.put("IQD", new CurrencyDataImpl("IQD","IQD",0,"IQD","IQD")); // иранский риал result.put("IRR", new CurrencyDataImpl("IRR","IRR",0,"IRR","IRR")); // ISJ result.put("ISJ", new CurrencyDataImpl("ISJ","ISJ",130,"ISJ","ISJ")); // исландская крона result.put("ISK", new CurrencyDataImpl("ISK","ISK",0,"ISK","ISK")); // Итальянская лира result.put("ITL", new CurrencyDataImpl("ITL","ITL",128,"ITL","ITL")); // ямайский доллар result.put("JMD", new CurrencyDataImpl("JMD","JMD",2,"JMD","JMD")); // иорданский динар result.put("JOD", new CurrencyDataImpl("JOD","JOD",3,"JOD","JOD")); // японская иена result.put("JPY", new CurrencyDataImpl("JPY","¥",0,"¥","¥")); // кенийский шиллинг result.put("KES", new CurrencyDataImpl("KES","KES",2,"KES","KES")); // киргизский сом result.put("KGS", new CurrencyDataImpl("KGS","KGS",2,"KGS","KGS")); // камбоджийский риель result.put("KHR", new CurrencyDataImpl("KHR","KHR",2,"KHR","KHR")); // коморский франк result.put("KMF", new CurrencyDataImpl("KMF","KMF",0,"KMF","KMF")); // северокорейская вона result.put("KPW", new CurrencyDataImpl("KPW","KPW",0,"KPW","KPW")); // KRH result.put("KRH", new CurrencyDataImpl("KRH","KRH",130,"KRH","KRH")); // KRO result.put("KRO", new CurrencyDataImpl("KRO","KRO",130,"KRO","KRO")); // южнокорейская вона result.put("KRW", new CurrencyDataImpl("KRW","₩",0,"₩","₩")); // кувейтский динар result.put("KWD", new CurrencyDataImpl("KWD","KWD",3,"KWD","KWD")); // доллар Островов Кайман result.put("KYD", new CurrencyDataImpl("KYD","KYD",2,"KYD","KYD")); // казахский тенге result.put("KZT", new CurrencyDataImpl("KZT","KZT",2,"KZT","KZT")); // лаосский кип result.put("LAK", new CurrencyDataImpl("LAK","LAK",0,"LAK","LAK")); // ливанский фунт result.put("LBP", new CurrencyDataImpl("LBP","LBP",0,"LBP","LBP")); // шри-ланкийская рупия result.put("LKR", new CurrencyDataImpl("LKR","LKR",2,"LKR","LKR")); // либерийский доллар result.put("LRD", new CurrencyDataImpl("LRD","LRD",2,"LRD","LRD")); // Лоти result.put("LSL", new CurrencyDataImpl("LSL","LSL",2,"LSL","LSL")); // Литовский лит result.put("LTL", new CurrencyDataImpl("LTL","LTL",130,"LTL","LTL")); // Литовский талон result.put("LTT", new CurrencyDataImpl("LTT","LTT",130,"LTT","LTT")); // Конвертируемый франк Люксембурга result.put("LUC", new CurrencyDataImpl("LUC","LUC",130,"LUC","LUC")); // Люксембургский франк result.put("LUF", new CurrencyDataImpl("LUF","LUF",128,"LUF","LUF")); // Финансовый франк Люксембурга result.put("LUL", new CurrencyDataImpl("LUL","LUL",130,"LUL","LUL")); // Латвийский лат result.put("LVL", new CurrencyDataImpl("LVL","LVL",130,"LVL","LVL")); // Латвийский рубль result.put("LVR", new CurrencyDataImpl("LVR","LVR",130,"LVR","LVR")); // ливийский динар result.put("LYD", new CurrencyDataImpl("LYD","LYD",3,"LYD","LYD")); // марокканский дирхам result.put("MAD", new CurrencyDataImpl("MAD","MAD",2,"MAD","MAD")); // Марокканский франк result.put("MAF", new CurrencyDataImpl("MAF","MAF",130,"MAF","MAF")); // MCF result.put("MCF", new CurrencyDataImpl("MCF","MCF",130,"MCF","MCF")); // MDC result.put("MDC", new CurrencyDataImpl("MDC","MDC",130,"MDC","MDC")); // молдавский лей result.put("MDL", new CurrencyDataImpl("MDL","MDL",2,"MDL","MDL")); // малагасийский ариари result.put("MGA", new CurrencyDataImpl("MGA","MGA",0,"MGA","MGA")); // Малагасийский франк result.put("MGF", new CurrencyDataImpl("MGF","MGF",128,"MGF","MGF")); // македонский денар result.put("MKD", new CurrencyDataImpl("MKD","MKD",2,"MKD","MKD")); // MKN result.put("MKN", new CurrencyDataImpl("MKN","MKN",130,"MKN","MKN")); // Малийский франк result.put("MLF", new CurrencyDataImpl("MLF","MLF",130,"MLF","MLF")); // мьянманский кьят result.put("MMK", new CurrencyDataImpl("MMK","MMK",0,"MMK","MMK")); // монгольский тугрик result.put("MNT", new CurrencyDataImpl("MNT","MNT",2,"MNT","MNT")); // патака Макао result.put("MOP", new CurrencyDataImpl("MOP","MOP",2,"MOP","MOP")); // мавританская угия (1973–2017) result.put("MRO", new CurrencyDataImpl("MRO","MRO",128,"MRO","MRO")); // мавританская угия result.put("MRU", new CurrencyDataImpl("MRU","MRU",2,"MRU","MRU")); // Мальтийская лира result.put("MTL", new CurrencyDataImpl("MTL","MTL",130,"MTL","MTL")); // Мальтийский фунт result.put("MTP", new CurrencyDataImpl("MTP","MTP",130,"MTP","MTP")); // маврикийская рупия result.put("MUR", new CurrencyDataImpl("MUR","MUR",2,"MUR","MUR")); // MVP result.put("MVP", new CurrencyDataImpl("MVP","MVP",130,"MVP","MVP")); // мальдивская руфия result.put("MVR", new CurrencyDataImpl("MVR","MVR",2,"MVR","MVR")); // малавийская квача result.put("MWK", new CurrencyDataImpl("MWK","MWK",2,"MWK","MWK")); // мексиканский песо result.put("MXN", new CurrencyDataImpl("MXN","MX$",2,"MX$","MX$")); // Мексиканское серебряное песо (1861–1992) result.put("MXP", new CurrencyDataImpl("MXP","MXP",130,"MXP","MXP")); // Мексиканская пересчетная единица (UDI) result.put("MXV", new CurrencyDataImpl("MXV","MXV",130,"MXV","MXV")); // малайзийский ринггит result.put("MYR", new CurrencyDataImpl("MYR","MYR",2,"MYR","MYR")); // Мозамбикское эскудо result.put("MZE", new CurrencyDataImpl("MZE","MZE",130,"MZE","MZE")); // Старый мозамбикский метикал result.put("MZM", new CurrencyDataImpl("MZM","MZM",130,"MZM","MZM")); // мозамбикский метикал result.put("MZN", new CurrencyDataImpl("MZN","MZN",2,"MZN","MZN")); // доллар Намибии result.put("NAD", new CurrencyDataImpl("NAD","NAD",2,"NAD","NAD")); // нигерийская найра result.put("NGN", new CurrencyDataImpl("NGN","NGN",2,"NGN","NGN")); // Никарагуанская кордоба (1988–1991) result.put("NIC", new CurrencyDataImpl("NIC","NIC",130,"NIC","NIC")); // никарагуанская кордоба result.put("NIO", new CurrencyDataImpl("NIO","NIO",2,"NIO","NIO")); // Нидерландский гульден result.put("NLG", new CurrencyDataImpl("NLG","NLG",130,"NLG","NLG")); // норвежская крона result.put("NOK", new CurrencyDataImpl("NOK","NOK",2,"NOK","NOK")); // непальская рупия result.put("NPR", new CurrencyDataImpl("NPR","NPR",2,"NPR","NPR")); // новозеландский доллар result.put("NZD", new CurrencyDataImpl("NZD","NZ$",2,"NZ$","NZ$")); // оманский риал result.put("OMR", new CurrencyDataImpl("OMR","OMR",3,"OMR","OMR")); // панамский бальбоа result.put("PAB", new CurrencyDataImpl("PAB","PAB",2,"PAB","PAB")); // Перуанское инти result.put("PEI", new CurrencyDataImpl("PEI","PEI",130,"PEI","PEI")); // перуанский соль result.put("PEN", new CurrencyDataImpl("PEN","PEN",2,"PEN","PEN")); // Перуанский соль (1863–1965) result.put("PES", new CurrencyDataImpl("PES","PES",130,"PES","PES")); // кина Папуа – Новой Гвинеи result.put("PGK", new CurrencyDataImpl("PGK","PGK",2,"PGK","PGK")); // филиппинский песо result.put("PHP", new CurrencyDataImpl("PHP","PHP",2,"PHP","PHP")); // пакистанская рупия result.put("PKR", new CurrencyDataImpl("PKR","PKR",2,"PKR","PKR")); // польский злотый result.put("PLN", new CurrencyDataImpl("PLN","PLN",2,"PLN","PLN")); // Злотый result.put("PLZ", new CurrencyDataImpl("PLZ","PLZ",130,"PLZ","PLZ")); // Португальское эскудо result.put("PTE", new CurrencyDataImpl("PTE","PTE",130,"PTE","PTE")); // парагвайский гуарани result.put("PYG", new CurrencyDataImpl("PYG","PYG",0,"PYG","PYG")); // катарский риал result.put("QAR", new CurrencyDataImpl("QAR","QAR",2,"QAR","QAR")); // Родезийский доллар result.put("RHD", new CurrencyDataImpl("RHD","RHD",130,"RHD","RHD")); // Старый Румынский лей result.put("ROL", new CurrencyDataImpl("ROL","ROL",130,"ROL","ROL")); // румынский лей result.put("RON", new CurrencyDataImpl("RON","RON",2,"RON","RON")); // сербский динар result.put("RSD", new CurrencyDataImpl("RSD","RSD",0,"RSD","RSD")); // российский рубль result.put("RUB", new CurrencyDataImpl("RUB","₽",2,"₽","₽")); // Российский рубль (1991–1998) result.put("RUR", new CurrencyDataImpl("RUR","р.",130,"р.","р.")); // франк Руанды result.put("RWF", new CurrencyDataImpl("RWF","RWF",0,"RWF","RWF")); // саудовский риял result.put("SAR", new CurrencyDataImpl("SAR","SAR",2,"SAR","SAR")); // доллар Соломоновых Островов result.put("SBD", new CurrencyDataImpl("SBD","SBD",2,"SBD","SBD")); // сейшельская рупия result.put("SCR", new CurrencyDataImpl("SCR","SCR",2,"SCR","SCR")); // Суданский динар result.put("SDD", new CurrencyDataImpl("SDD","SDD",130,"SDD","SDD")); // суданский фунт result.put("SDG", new CurrencyDataImpl("SDG","SDG",2,"SDG","SDG")); // Старый суданский фунт result.put("SDP", new CurrencyDataImpl("SDP","SDP",130,"SDP","SDP")); // шведская крона result.put("SEK", new CurrencyDataImpl("SEK","SEK",2,"SEK","SEK")); // сингапурский доллар result.put("SGD", new CurrencyDataImpl("SGD","SGD",2,"SGD","SGD")); // фунт острова Святой Елены result.put("SHP", new CurrencyDataImpl("SHP","SHP",2,"SHP","SHP")); // Словенский толар result.put("SIT", new CurrencyDataImpl("SIT","SIT",130,"SIT","SIT")); // Словацкая крона result.put("SKK", new CurrencyDataImpl("SKK","SKK",130,"SKK","SKK")); // леоне result.put("SLL", new CurrencyDataImpl("SLL","SLL",0,"SLL","SLL")); // сомалийский шиллинг result.put("SOS", new CurrencyDataImpl("SOS","SOS",0,"SOS","SOS")); // суринамский доллар result.put("SRD", new CurrencyDataImpl("SRD","SRD",2,"SRD","SRD")); // Суринамский гульден result.put("SRG", new CurrencyDataImpl("SRG","SRG",130,"SRG","SRG")); // южносуданский фунт result.put("SSP", new CurrencyDataImpl("SSP","SSP",2,"SSP","SSP")); // добра Сан-Томе и Принсипи (1977–2017) result.put("STD", new CurrencyDataImpl("STD","STD",128,"STD","STD")); // добра Сан-Томе и Принсипи result.put("STN", new CurrencyDataImpl("STN","STN",2,"STN","STN")); // Рубль СССР result.put("SUR", new CurrencyDataImpl("SUR","SUR",130,"SUR","SUR")); // Сальвадорский колон result.put("SVC", new CurrencyDataImpl("SVC","SVC",130,"SVC","SVC")); // сирийский фунт result.put("SYP", new CurrencyDataImpl("SYP","SYP",0,"SYP","SYP")); // свазилендский лилангени result.put("SZL", new CurrencyDataImpl("SZL","SZL",2,"SZL","SZL")); // таиландский бат result.put("THB", new CurrencyDataImpl("THB","฿",2,"฿","฿")); // Таджикский рубль result.put("TJR", new CurrencyDataImpl("TJR","TJR",130,"TJR","TJR")); // таджикский сомони result.put("TJS", new CurrencyDataImpl("TJS","TJS",2,"TJS","TJS")); // Туркменский манат result.put("TMM", new CurrencyDataImpl("TMM","TMM",128,"TMM","TMM")); // новый туркменский манат result.put("TMT", new CurrencyDataImpl("TMT","ТМТ",2,"ТМТ","ТМТ")); // тунисский динар result.put("TND", new CurrencyDataImpl("TND","TND",3,"TND","TND")); // тонганская паанга result.put("TOP", new CurrencyDataImpl("TOP","TOP",2,"TOP","TOP")); // Тиморское эскудо result.put("TPE", new CurrencyDataImpl("TPE","TPE",130,"TPE","TPE")); // Турецкая лира (1922–2005) result.put("TRL", new CurrencyDataImpl("TRL","TRL",128,"TRL","TRL")); // турецкая лира result.put("TRY", new CurrencyDataImpl("TRY","TL",2,"TL","TL")); // доллар Тринидада и Тобаго result.put("TTD", new CurrencyDataImpl("TTD","TTD",2,"TTD","TTD")); // новый тайваньский доллар result.put("TWD", new CurrencyDataImpl("TWD","NT$",2,"NT$","NT$")); // танзанийский шиллинг result.put("TZS", new CurrencyDataImpl("TZS","TZS",2,"TZS","TZS")); // украинская гривна result.put("UAH", new CurrencyDataImpl("UAH","грн.",2,"грн.","грн.")); // Карбованец (украинский) result.put("UAK", new CurrencyDataImpl("UAK","UAK",130,"UAK","UAK")); // Старый угандийский шиллинг result.put("UGS", new CurrencyDataImpl("UGS","UGS",130,"UGS","UGS")); // угандийский шиллинг result.put("UGX", new CurrencyDataImpl("UGX","UGX",0,"UGX","UGX")); // доллар США result.put("USD", new CurrencyDataImpl("USD","$",2,"$","$")); // Доллар США следующего дня result.put("USN", new CurrencyDataImpl("USN","USN",130,"USN","USN")); // Доллар США текущего дня result.put("USS", new CurrencyDataImpl("USS","USS",130,"USS","USS")); // Уругвайский песо (индекс инфляции) result.put("UYI", new CurrencyDataImpl("UYI","UYI",128,"UYI","UYI")); // Уругвайское старое песо (1975–1993) result.put("UYP", new CurrencyDataImpl("UYP","UYP",130,"UYP","UYP")); // уругвайский песо result.put("UYU", new CurrencyDataImpl("UYU","UYU",2,"UYU","UYU")); // UYW result.put("UYW", new CurrencyDataImpl("UYW","UYW",132,"UYW","UYW")); // узбекский сум result.put("UZS", new CurrencyDataImpl("UZS","UZS",2,"UZS","UZS")); // Венесуэльский боливар (1871–2008) result.put("VEB", new CurrencyDataImpl("VEB","VEB",130,"VEB","VEB")); // венесуэльский боливар (2008–2018) result.put("VEF", new CurrencyDataImpl("VEF","VEF",130,"VEF","VEF")); // венесуэльский боливар result.put("VES", new CurrencyDataImpl("VES","VES",2,"VES","VES")); // вьетнамский донг result.put("VND", new CurrencyDataImpl("VND","₫",0,"₫","₫")); // VNN result.put("VNN", new CurrencyDataImpl("VNN","VNN",130,"VNN","VNN")); // вату Вануату result.put("VUV", new CurrencyDataImpl("VUV","VUV",0,"VUV","VUV")); // самоанская тала result.put("WST", new CurrencyDataImpl("WST","WST",2,"WST","WST")); // франк КФА BEAC result.put("XAF", new CurrencyDataImpl("XAF","FCFA",0,"FCFA","FCFA")); // Серебро result.put("XAG", new CurrencyDataImpl("XAG","XAG",130,"XAG","XAG")); // Золото result.put("XAU", new CurrencyDataImpl("XAU","XAU",130,"XAU","XAU")); // Европейская составная единица result.put("XBA", new CurrencyDataImpl("XBA","XBA",130,"XBA","XBA")); // Европейская денежная единица result.put("XBB", new CurrencyDataImpl("XBB","XBB",130,"XBB","XBB")); // расчетная единица европейского валютного соглашения (XBC) result.put("XBC", new CurrencyDataImpl("XBC","XBC",130,"XBC","XBC")); // расчетная единица европейского валютного соглашения (XBD) result.put("XBD", new CurrencyDataImpl("XBD","XBD",130,"XBD","XBD")); // восточно-карибский доллар result.put("XCD", new CurrencyDataImpl("XCD","EC$",2,"EC$","EC$")); // СДР (специальные права заимствования) result.put("XDR", new CurrencyDataImpl("XDR","XDR",130,"XDR","XDR")); // ЭКЮ (единица европейской валюты) result.put("XEU", new CurrencyDataImpl("XEU","XEU",130,"XEU","XEU")); // Французский золотой франк result.put("XFO", new CurrencyDataImpl("XFO","XFO",130,"XFO","XFO")); // Французский UIC-франк result.put("XFU", new CurrencyDataImpl("XFU","XFU",130,"XFU","XFU")); // франк КФА ВСЕАО result.put("XOF", new CurrencyDataImpl("XOF","CFA",0,"CFA","CFA")); // Палладий result.put("XPD", new CurrencyDataImpl("XPD","XPD",130,"XPD","XPD")); // французский тихоокеанский франк result.put("XPF", new CurrencyDataImpl("XPF","CFPF",0,"CFPF","CFPF")); // Платина result.put("XPT", new CurrencyDataImpl("XPT","XPT",130,"XPT","XPT")); // единица RINET-фондов result.put("XRE", new CurrencyDataImpl("XRE","XRE",130,"XRE","XRE")); // XSU result.put("XSU", new CurrencyDataImpl("XSU","XSU",130,"XSU","XSU")); // тестовый валютный код result.put("XTS", new CurrencyDataImpl("XTS","XTS",130,"XTS","XTS")); // XUA result.put("XUA", new CurrencyDataImpl("XUA","XUA",130,"XUA","XUA")); // неизвестная валюта result.put("XXX", new CurrencyDataImpl("XXX","XXXX",130,"XXXX","XXXX")); // Йеменский динар result.put("YDD", new CurrencyDataImpl("YDD","YDD",130,"YDD","YDD")); // йеменский риал result.put("YER", new CurrencyDataImpl("YER","YER",0,"YER","YER")); // Югославский твердый динар result.put("YUD", new CurrencyDataImpl("YUD","YUD",130,"YUD","YUD")); // Югославский новый динар result.put("YUM", new CurrencyDataImpl("YUM","YUM",130,"YUM","YUM")); // Югославский динар result.put("YUN", new CurrencyDataImpl("YUN","YUN",130,"YUN","YUN")); // YUR result.put("YUR", new CurrencyDataImpl("YUR","YUR",130,"YUR","YUR")); // Южноафриканский рэнд (финансовый) result.put("ZAL", new CurrencyDataImpl("ZAL","ZAL",130,"ZAL","ZAL")); // южноафриканский рэнд result.put("ZAR", new CurrencyDataImpl("ZAR","ZAR",2,"ZAR","ZAR")); // Квача (замбийская) (1968–2012) result.put("ZMK", new CurrencyDataImpl("ZMK","ZMK",128,"ZMK","ZMK")); // замбийская квача result.put("ZMW", new CurrencyDataImpl("ZMW","ZMW",2,"ZMW","ZMW")); // Новый заир result.put("ZRN", new CurrencyDataImpl("ZRN","ZRN",130,"ZRN","ZRN")); // Заир result.put("ZRZ", new CurrencyDataImpl("ZRZ","ZRZ",130,"ZRZ","ZRZ")); // Доллар Зимбабве result.put("ZWD", new CurrencyDataImpl("ZWD","ZWD",128,"ZWD","ZWD")); // Доллар Зимбабве (2009) result.put("ZWL", new CurrencyDataImpl("ZWL","ZWL",130,"ZWL","ZWL")); // ZWR result.put("ZWR", new CurrencyDataImpl("ZWR","ZWR",130,"ZWR","ZWR")); return result; } @Override protected HashMap<String, String> loadNamesMap() { HashMap<String, String> result = super.loadNamesMap(); result.put("ADP","Андоррская песета"); result.put("AED","дирхам ОАЭ"); result.put("AFA","Афгани (1927–2002)"); result.put("AFN","афгани"); result.put("ALL","албанский лек"); result.put("AMD","армянский драм"); result.put("ANG","нидерландский антильский гульден"); result.put("AOA","ангольская кванза"); result.put("AOK","Ангольская кванза (1977–1990)"); result.put("AON","Ангольская новая кванза (1990–2000)"); result.put("AOR","Ангольская кванза реюстадо (1995–1999)"); result.put("ARA","Аргентинский аустрал"); result.put("ARP","Аргентинское песо (1983–1985)"); result.put("ARS","аргентинский песо"); result.put("ATS","Австрийский шиллинг"); result.put("AUD","австралийский доллар"); result.put("AWG","арубанский флорин"); result.put("AZM","Старый азербайджанский манат"); result.put("AZN","азербайджанский манат"); result.put("BAD","Динар Боснии и Герцеговины"); result.put("BAM","конвертируемая марка Боснии и Герцеговины"); result.put("BBD","барбадосский доллар"); result.put("BDT","бангладешская така"); result.put("BEC","Бельгийский франк (конвертируемый)"); result.put("BEF","Бельгийский франк"); result.put("BEL","Бельгийский франк (финансовый)"); result.put("BGL","Лев"); result.put("BGN","болгарский лев"); result.put("BHD","бахрейнский динар"); result.put("BIF","бурундийский франк"); result.put("BMD","бермудский доллар"); result.put("BND","брунейский доллар"); result.put("BOB","боливийский боливиано"); result.put("BOP","Боливийское песо"); result.put("BOV","Боливийский мвдол"); result.put("BRB","Бразильский новый крузейро (1967–1986)"); result.put("BRC","Бразильское крузадо"); result.put("BRE","Бразильский крузейро (1990–1993)"); result.put("BRL","бразильский реал"); result.put("BRN","Бразильское новое крузадо"); result.put("BRR","Бразильский крузейро"); result.put("BSD","багамский доллар"); result.put("BTN","бутанский нгултрум"); result.put("BUK","Джа"); result.put("BWP","ботсванская пула"); result.put("BYB","Белорусский рубль (1994–1999)"); result.put("BYN","белорусский рубль"); result.put("BYR","Белорусский рубль (2000–2016)"); result.put("BZD","белизский доллар"); result.put("CAD","канадский доллар"); result.put("CDF","конголезский франк"); result.put("CHE","WIR евро"); result.put("CHF","швейцарский франк"); result.put("CHW","WIR франк"); result.put("CLF","Условная расчетная единица Чили"); result.put("CLP","чилийский песо"); result.put("CNH","китайский офшорный юань"); result.put("CNY","китайский юань"); result.put("COP","колумбийский песо"); result.put("COU","Единица реальной стоимости Колумбии"); result.put("CRC","костариканский колон"); result.put("CSD","Старый Сербский динар"); result.put("CSK","Чехословацкая твердая крона"); result.put("CUC","кубинский конвертируемый песо"); result.put("CUP","кубинский песо"); result.put("CVE","эскудо Кабо-Верде"); result.put("CYP","Кипрский фунт"); result.put("CZK","чешская крона"); result.put("DDM","Восточногерманская марка"); result.put("DEM","Немецкая марка"); result.put("DJF","франк Джибути"); result.put("DKK","датская крона"); result.put("DOP","доминиканский песо"); result.put("DZD","алжирский динар"); result.put("ECS","Эквадорский сукре"); result.put("ECV","Постоянная единица стоимости Эквадора"); result.put("EEK","Эстонская крона"); result.put("EGP","египетский фунт"); result.put("ERN","эритрейская накфа"); result.put("ESA","Испанская песета (А)"); result.put("ESB","Испанская песета (конвертируемая)"); result.put("ESP","Испанская песета"); result.put("ETB","эфиопский быр"); result.put("EUR","евро"); result.put("FIM","Финская марка"); result.put("FJD","доллар Фиджи"); result.put("FKP","фунт Фолклендских островов"); result.put("FRF","Французский франк"); result.put("GBP","британский фунт стерлингов"); result.put("GEK","Грузинский купон"); result.put("GEL","грузинский лари"); result.put("GHC","Ганский седи (1979–2007)"); result.put("GHS","ганский седи"); result.put("GIP","гибралтарский фунт"); result.put("GMD","гамбийский даласи"); result.put("GNF","гвинейский франк"); result.put("GNS","Гвинейская сили"); result.put("GQE","Эквеле экваториальной Гвинеи"); result.put("GRD","Греческая драхма"); result.put("GTQ","гватемальский кетсаль"); result.put("GWE","Эскудо Португальской Гвинеи"); result.put("GWP","Песо Гвинеи-Бисау"); result.put("GYD","гайанский доллар"); result.put("HKD","гонконгский доллар"); result.put("HNL","гондурасская лемпира"); result.put("HRD","Хорватский динар"); result.put("HRK","хорватская куна"); result.put("HTG","гаитянский гурд"); result.put("HUF","венгерский форинт"); result.put("IDR","индонезийская рупия"); result.put("IEP","Ирландский фунт"); result.put("ILP","Израильский фунт"); result.put("ILS","новый израильский шекель"); result.put("INR","индийская рупия"); result.put("IQD","иракский динар"); result.put("IRR","иранский риал"); result.put("ISK","исландская крона"); result.put("ITL","Итальянская лира"); result.put("JMD","ямайский доллар"); result.put("JOD","иорданский динар"); result.put("JPY","японская иена"); result.put("KES","кенийский шиллинг"); result.put("KGS","киргизский сом"); result.put("KHR","камбоджийский риель"); result.put("KMF","коморский франк"); result.put("KPW","северокорейская вона"); result.put("KRW","южнокорейская вона"); result.put("KWD","кувейтский динар"); result.put("KYD","доллар Островов Кайман"); result.put("KZT","казахский тенге"); result.put("LAK","лаосский кип"); result.put("LBP","ливанский фунт"); result.put("LKR","шри-ланкийская рупия"); result.put("LRD","либерийский доллар"); result.put("LSL","Лоти"); result.put("LTL","Литовский лит"); result.put("LTT","Литовский талон"); result.put("LUC","Конвертируемый франк Люксембурга"); result.put("LUF","Люксембургский франк"); result.put("LUL","Финансовый франк Люксембурга"); result.put("LVL","Латвийский лат"); result.put("LVR","Латвийский рубль"); result.put("LYD","ливийский динар"); result.put("MAD","марокканский дирхам"); result.put("MAF","Марокканский франк"); result.put("MDL","молдавский лей"); result.put("MGA","малагасийский ариари"); result.put("MGF","Малагасийский франк"); result.put("MKD","македонский денар"); result.put("MLF","Малийский франк"); result.put("MMK","мьянманский кьят"); result.put("MNT","монгольский тугрик"); result.put("MOP","патака Макао"); result.put("MRO","мавританская угия (1973–2017)"); result.put("MRU","мавританская угия"); result.put("MTL","Мальтийская лира"); result.put("MTP","Мальтийский фунт"); result.put("MUR","маврикийская рупия"); result.put("MVR","мальдивская руфия"); result.put("MWK","малавийская квача"); result.put("MXN","мексиканский песо"); result.put("MXP","Мексиканское серебряное песо (1861–1992)"); result.put("MXV","Мексиканская пересчетная единица (UDI)"); result.put("MYR","малайзийский ринггит"); result.put("MZE","Мозамбикское эскудо"); result.put("MZM","Старый мозамбикский метикал"); result.put("MZN","мозамбикский метикал"); result.put("NAD","доллар Намибии"); result.put("NGN","нигерийская найра"); result.put("NIC","Никарагуанская кордоба (1988–1991)"); result.put("NIO","никарагуанская кордоба"); result.put("NLG","Нидерландский гульден"); result.put("NOK","норвежская крона"); result.put("NPR","непальская рупия"); result.put("NZD","новозеландский доллар"); result.put("OMR","оманский риал"); result.put("PAB","панамский бальбоа"); result.put("PEI","Перуанское инти"); result.put("PEN","перуанский соль"); result.put("PES","Перуанский соль (1863–1965)"); result.put("PGK","кина Папуа – Новой Гвинеи"); result.put("PHP","филиппинский песо"); result.put("PKR","пакистанская рупия"); result.put("PLN","польский злотый"); result.put("PLZ","Злотый"); result.put("PTE","Португальское эскудо"); result.put("PYG","парагвайский гуарани"); result.put("QAR","катарский риал"); result.put("RHD","Родезийский доллар"); result.put("ROL","Старый Румынский лей"); result.put("RON","румынский лей"); result.put("RSD","сербский динар"); result.put("RUB","российский рубль"); result.put("RUR","Российский рубль (1991–1998)"); result.put("RWF","франк Руанды"); result.put("SAR","саудовский риял"); result.put("SBD","доллар Соломоновых Островов"); result.put("SCR","сейшельская рупия"); result.put("SDD","Суданский динар"); result.put("SDG","суданский фунт"); result.put("SDP","Старый суданский фунт"); result.put("SEK","шведская крона"); result.put("SGD","сингапурский доллар"); result.put("SHP","фунт острова Святой Елены"); result.put("SIT","Словенский толар"); result.put("SKK","Словацкая крона"); result.put("SLL","леоне"); result.put("SOS","сомалийский шиллинг"); result.put("SRD","суринамский доллар"); result.put("SRG","Суринамский гульден"); result.put("SSP","южносуданский фунт"); result.put("STD","добра Сан-Томе и Принсипи (1977–2017)"); result.put("STN","добра Сан-Томе и Принсипи"); result.put("SUR","Рубль СССР"); result.put("SVC","Сальвадорский колон"); result.put("SYP","сирийский фунт"); result.put("SZL","свазилендский лилангени"); result.put("THB","таиландский бат"); result.put("TJR","Таджикский рубль"); result.put("TJS","таджикский сомони"); result.put("TMM","Туркменский манат"); result.put("TMT","новый туркменский манат"); result.put("TND","тунисский динар"); result.put("TOP","тонганская паанга"); result.put("TPE","Тиморское эскудо"); result.put("TRL","Турецкая лира (1922–2005)"); result.put("TRY","турецкая лира"); result.put("TTD","доллар Тринидада и Тобаго"); result.put("TWD","новый тайваньский доллар"); result.put("TZS","танзанийский шиллинг"); result.put("UAH","украинская гривна"); result.put("UAK","Карбованец (украинский)"); result.put("UGS","Старый угандийский шиллинг"); result.put("UGX","угандийский шиллинг"); result.put("USD","доллар США"); result.put("USN","Доллар США следующего дня"); result.put("USS","Доллар США текущего дня"); result.put("UYI","Уругвайский песо (индекс инфляции)"); result.put("UYP","Уругвайское старое песо (1975–1993)"); result.put("UYU","уругвайский песо"); result.put("UZS","узбекский сум"); result.put("VEB","Венесуэльский боливар (1871–2008)"); result.put("VEF","венесуэльский боливар (2008–2018)"); result.put("VES","венесуэльский боливар"); result.put("VND","вьетнамский донг"); result.put("VUV","вату Вануату"); result.put("WST","самоанская тала"); result.put("XAF","франк КФА BEAC"); result.put("XAG","Серебро"); result.put("XAU","Золото"); result.put("XBA","Европейская составная единица"); result.put("XBB","Европейская денежная единица"); result.put("XBC","расчетная единица европейского валютного соглашения (XBC)"); result.put("XBD","расчетная единица европейского валютного соглашения (XBD)"); result.put("XCD","восточно-карибский доллар"); result.put("XDR","СДР (специальные права заимствования)"); result.put("XEU","ЭКЮ (единица европейской валюты)"); result.put("XFO","Французский золотой франк"); result.put("XFU","Французский UIC-франк"); result.put("XOF","франк КФА ВСЕАО"); result.put("XPD","Палладий"); result.put("XPF","французский тихоокеанский франк"); result.put("XPT","Платина"); result.put("XRE","единица RINET-фондов"); result.put("XTS","тестовый валютный код"); result.put("XXX","неизвестная валюта"); result.put("YDD","Йеменский динар"); result.put("YER","йеменский риал"); result.put("YUD","Югославский твердый динар"); result.put("YUM","Югославский новый динар"); result.put("YUN","Югославский динар"); result.put("ZAL","Южноафриканский рэнд (финансовый)"); result.put("ZAR","южноафриканский рэнд"); result.put("ZMK","Квача (замбийская) (1968–2012)"); result.put("ZMW","замбийская квача"); result.put("ZRN","Новый заир"); result.put("ZRZ","Заир"); result.put("ZWD","Доллар Зимбабве"); result.put("ZWL","Доллар Зимбабве (2009)"); return result; } }
[ "akabme@gmail.com" ]
akabme@gmail.com
798bc128ec928febee41e11ef1c0fac4db37832c
2cd9a5c94534abb37ed7eba5cced87eb2ca0b33f
/app/src/main/java/com/koudle/navigationbarexample/MainActivity.java
25c27896630eeb90aaa9d3042697ce93a7c8d3f5
[ "Apache-2.0" ]
permissive
koudle/NavigationBar
5606f875635aaebb67197f6b49a6ea091e3d2044
50e95276ab62745c133b4fe177e51312c34faff7
refs/heads/master
2021-01-10T07:57:11.300428
2016-03-02T09:56:20
2016-03-02T09:56:20
51,905,891
2
1
null
null
null
null
UTF-8
Java
false
false
1,695
java
package com.koudle.navigationbarexample; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import com.koudle.navigationbar.TabBarView; import com.koudle.navigationbar.TabItemClickEvent; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; public class MainActivity extends AppCompatActivity { private final static String TAG = "MainActivity"; private MyTabBarView tabBarView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tabBarView = (MyTabBarView) findViewById(R.id.navigationBarView); EventBus.getDefault().register(this); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @Subscribe( threadMode = ThreadMode.MAIN ) public void onItemClick(TabItemClickEvent event){ } }
[ "xiaoshuai.renxs@alibaba-inc.com" ]
xiaoshuai.renxs@alibaba-inc.com
e4e9cfc0bee89a7267fd88bd58aeaecc6f50f3ba
5b32e98519d905a412a7f3f6de65346ee026c823
/app/src/main/java/br/ufrn/locationtracker/Activities/MainActivity.java
b469cb4774f70bb0d0260a2fc42af7b05153f65c
[]
no_license
LocationTracker/LocationTrackerAPP
b7371d520eef01d50064bf7e27ca4e0291b70e2e
701c1db337b98812ca84009293d37769074cbf16
refs/heads/master
2020-03-17T02:20:08.932608
2018-06-15T01:41:11
2018-06-15T01:41:31
133,186,357
0
0
null
null
null
null
UTF-8
Java
false
false
10,068
java
package br.ufrn.locationtracker.Activities; import android.Manifest; import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.pm.PackageManager; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.design.widget.TabLayout; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v4.view.ViewPager; import android.telephony.TelephonyManager; import android.view.View; import android.support.design.widget.NavigationView; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import org.json.JSONObject; import java.util.ArrayList; import br.ufrn.locationtracker.Api.LocationApi; import br.ufrn.locationtracker.Api.OnJSONObjectResponseCallback; import br.ufrn.locationtracker.Fragment.TabPagerAdapter; import br.ufrn.locationtracker.R; import br.ufrn.locationtracker.Utl.Utl; public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { boolean todasPermissoes = true; public static final int MULTIPLY_PERMISSIONS = 4; TabPagerAdapter pagerAdapter; ViewPager viewPager; TabLayout tabLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); DrawerLayout drawer = findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.addDrawerListener(toggle); toggle.syncState(); //setUpFacebook(); //setupPublicidade(); setupPermissions(); while (!todasPermissoes){ setupPermissions(); } //getToken(); configureTabLayout(); } private void setupPermissions(){ int fineLocationAccess = ActivityCompat.checkSelfPermission(getBaseContext(), Manifest.permission.ACCESS_FINE_LOCATION); int permissionIMEI = ContextCompat.checkSelfPermission(getBaseContext(), Manifest.permission.READ_PHONE_STATE); ArrayList<String> listaPermissoes = new ArrayList<>(); if(permissionIMEI != PackageManager.PERMISSION_GRANTED){ listaPermissoes.add(Manifest.permission.READ_PHONE_STATE); todasPermissoes = false; } else { TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); @SuppressLint("MissingPermission") String imei = tm.getDeviceId(); Utl.setDevice(getBaseContext(), imei); } if(fineLocationAccess != PackageManager.PERMISSION_GRANTED){ listaPermissoes.add(Manifest.permission.ACCESS_FINE_LOCATION); todasPermissoes = false; } if(listaPermissoes.size()>0){ ActivityCompat.requestPermissions(this, listaPermissoes.toArray(new String[listaPermissoes.size()]), MULTIPLY_PERMISSIONS); } else { todasPermissoes = true; } } private void configureTabLayout() { // Get the ViewPager and set it's PagerAdapter so that it can display items viewPager = findViewById(R.id.viewpager); viewPager.setOffscreenPageLimit(2); pagerAdapter = new TabPagerAdapter(getSupportFragmentManager(), MainActivity.this, viewPager); viewPager.setAdapter(pagerAdapter); // Give the TabLayout the ViewPager tabLayout = findViewById(R.id.tab_layout); tabLayout.setupWithViewPager(viewPager); tabLayout.getTabAt(0).setIcon(R.drawable.ic_menu_mapa_selecionado); //tabLayout.getTabAt(1).setIcon(R.drawable.ic_menu_linha); //tabLayout.getTabAt(2).setIcon(R.drawable.ic_menu_meuonibus); tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { setTitle(tab.getText()); int position = tab.getPosition(); switch (position){ case 0: tab.setIcon(R.drawable.ic_menu_mapa_selecionado); break; /*case 1: tab.setIcon(R.drawable.ic_menu_linha_selecionado); break; case 2: tab.setIcon(R.drawable.ic_menu_meuonibus_selecionado); break;*/ default: break; } } @Override public void onTabUnselected(TabLayout.Tab tab) { int position = tab.getPosition(); switch (position) { case 0: tab.setIcon(R.drawable.ic_menu_mapa); break; /*case 1: tab.setIcon(R.drawable.ic_menu_linha); break; case 2: tab.setIcon(R.drawable.ic_menu_meuonibus); break;*/ default: break; } } @Override public void onTabReselected(TabLayout.Tab tab) { int position = tab.getPosition(); switch (position) { case 0: tab.setIcon(R.drawable.ic_menu_mapa_selecionado); return; /* case 1: tab.setIcon(R.drawable.ic_menu_linha_selecionado); return; case 2: tab.setIcon(R.drawable.ic_menu_meuonibus_selecionado); return;*/ default: return; } } }); } @Override public void onBackPressed() { DrawerLayout drawer = findViewById(R.id.drawer_layout); if (drawer.isDrawerOpen(GravityCompat.START)) { drawer.closeDrawer(GravityCompat.START); } else { super.onBackPressed(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.enviarPosicao) { enviarLocalizacao(this); } return true; } LocationApi locationApi; private void enviarLocalizacao(final Activity activity){ if(locationApi== null){ locationApi = new LocationApi(getBaseContext()); locationApi.postSendLocation(1, Utl.getLatitude(getBaseContext()), Utl.getLongitude(getBaseContext()), new OnJSONObjectResponseCallback() { @Override public void onJSONObjectResponse(boolean success, JSONObject response) { if(success){ new AlertDialog.Builder(activity) .setTitle("Sucesso") .setMessage("Enviado com Sucesso!") .setCancelable(false) .setPositiveButton("ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }).show(); locationApi = null; } else { new AlertDialog.Builder(activity) .setTitle("Ops") .setMessage("Erro no envio`!") .setCancelable(false) .setPositiveButton("ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }).show(); locationApi = null; } } }); } } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.nav_camera) { // Handle the camera action } else if (id == R.id.nav_gallery) { } else if (id == R.id.nav_slideshow) { } else if (id == R.id.nav_manage) { } else if (id == R.id.nav_share) { } else if (id == R.id.nav_send) { } DrawerLayout drawer = findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } }
[ "wreuel@gmail.com" ]
wreuel@gmail.com
2fa9530b8a9569ab9303c450f2d65d63f14f4ce9
6fa7a245b15f8aef1878f82a1a54ca76aef5ccd4
/src/memory/Gracz.java
2cf5a769a232d29ca191d2b7417f820738a28b23
[]
no_license
Mateusz530/Memory
2618fba037b8412ae981308467f26a75db04eeb9
b05aadc567c2921abc513b0d5278a40ba35a5244
refs/heads/master
2020-06-22T05:33:21.272409
2019-07-18T19:36:50
2019-07-18T19:36:50
197,644,661
0
0
null
null
null
null
UTF-8
Java
false
false
814
java
package memory; import java.io.Serializable; public class Gracz implements Serializable, Comparable<Gracz> { String nick; String czas; int rozmiar; Integer punkty; public Gracz(){ } public Gracz(String nick, String czas, int rozmiar, Integer punkty){ this.nick = nick; this.czas = czas; this.rozmiar = rozmiar; this.punkty = punkty; } public String toString(){ return nick + " (Czas: " + czas + ", rozmiar: " + rozmiar + "x" + rozmiar + ", memory.Wynik: " + punkty + "pkt)"; } @Override public int compareTo(Gracz o) { int compare = this.punkty.compareTo(o.punkty); if(compare > 0) return -1; if(compare < 0) return 1; return 0; } }
[ "mateusz.530@wp.pl" ]
mateusz.530@wp.pl
4e5d6ed64a2e16e937950c6f52cfc6cff112fc41
11502fe559b083fb281052b11955919a4d531838
/src/main/java/flud/necan/AppIdeasProjectApplication.java
ce4c49a81459762e92a7b3d84d943bea6546a4bd
[]
no_license
fnecan/ideas-api
e5a2f77fc443423e84b8f6d90b887b9d0829eaa5
f9196932dd5a2285a852678a86c0977d94ab3f64
refs/heads/master
2020-06-12T22:29:53.893832
2019-07-16T12:01:41
2019-07-16T12:01:41
194,447,613
0
0
null
2019-07-16T12:01:43
2019-06-29T20:54:41
Java
UTF-8
Java
false
false
543
java
package flud.necan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) @SpringBootApplication public class AppIdeasProjectApplication { public static void main(String[] args) { SpringApplication.run(AppIdeasProjectApplication.class, args); } }
[ "fludnecan@gmail.com" ]
fludnecan@gmail.com
537e720253d5a7a97dc2d17a64972315800f0428
985b30ade6bb55358b925df6a2b7855ff5c3ae0d
/zenodot-tests/test/dd/kms/zenodot/tests/common/AbstractTest.java
a2a34e42b026c3e66d44f51cb66a7a73fd5e2be4
[ "LicenseRef-scancode-free-unknown", "Apache-2.0", "MIT" ]
permissive
tbrunsch/Zenodot
cc38f2793a9b3f761fab5ffa9607a7ab596fae44
2036f311e2e548f77f9ad56ae8cf44bdc2e5c74f
refs/heads/master
2023-06-27T14:51:22.227490
2023-06-21T21:21:54
2023-06-21T21:30:12
227,767,280
0
0
MIT
2023-06-21T21:05:56
2019-12-13T05:57:29
Java
UTF-8
Java
false
false
2,910
java
package dd.kms.zenodot.tests.common; import com.google.common.collect.ImmutableList; import dd.kms.zenodot.api.Variables; import dd.kms.zenodot.api.common.AccessModifier; import dd.kms.zenodot.api.debug.ParserConsoleLogger; import dd.kms.zenodot.api.debug.ParserLogger; import dd.kms.zenodot.api.settings.EvaluationMode; import dd.kms.zenodot.api.settings.ObjectTreeNode; import dd.kms.zenodot.api.settings.ParserSettingsBuilder; import dd.kms.zenodot.impl.debug.ParserLoggers; import org.junit.Assert; import java.util.Arrays; /** * This test uses {@link EvaluationMode#STATIC_TYPING} by default. */ public class AbstractTest<T extends AbstractTest> { public static final boolean SKIP_UNSTABLE_TESTS = "true".equalsIgnoreCase(System.getProperty("skipUnstableTests")); protected final Object testInstance; protected final ParserSettingsBuilder settingsBuilder = ParserSettingsBuilder.create() .minimumAccessModifier(AccessModifier.PRIVATE) .evaluationMode(EvaluationMode.STATIC_TYPING); protected final Variables variables = Variables.create(); private boolean stopAtError = false; private boolean printLogEntriesAtError = false; protected AbstractTest(Object testInstance) { this.testInstance = testInstance; } public void createVariable(String name, Object value, boolean isFinal) { variables.createVariable(name, value, isFinal); } public void minimumAccessModifier(AccessModifier minimumAccessModifier) { settingsBuilder.minimumAccessModifier(minimumAccessModifier); } public void importClasses(String... classNames) { try { settingsBuilder.importClassesByName(Arrays.asList(classNames)); } catch (ClassNotFoundException e) { Assert.fail("ClassNotFoundException: " + e.getMessage()); } } public void importPackages(String... packageNames) { settingsBuilder.importPackages(Arrays.asList(packageNames)); } public void customHierarchyRoot(ObjectTreeNode root) { settingsBuilder.customHierarchyRoot(root); } public void evaluationMode(EvaluationMode evaluationMode) { settingsBuilder.evaluationMode(evaluationMode); } public void enableConsideringAllClassesForClassCompletions() { settingsBuilder.considerAllClassesForClassCompletions(true); } public void stopAtError() { stopAtError = true; } public void printLogEntriesAtError() { printLogEntriesAtError = true; } protected ParserLogger prepareLogger(boolean printToConsole, int numLoggedEntriesToStopAfter) { ParserLogger logger = printToConsole ? new ParserConsoleLogger().printNumberOfLoggedEntries(true) : ParserLoggers.createNullLogger(); logger.stopAfter(numLoggedEntriesToStopAfter); settingsBuilder.logger(logger); return logger; } protected boolean isStopAtError() { return stopAtError; } protected boolean isPrintLogEntriesAtError() { return printLogEntriesAtError; } }
[ "tobias.brunsch@aol.de" ]
tobias.brunsch@aol.de
33f6a503929d4ecafec8f64fcca21c15343b1995
d369f332eee40d4168ccc061c7b1ff2e82485284
/src/main/java/com/suprun/periodicals/view/constants/PagesPath.java
ac6effc82abd6d8692dec7bbfb7a798aa1645110
[]
no_license
AndreiSuprun/periodicals
3c4bddcaa01ae4e959e8818949df30018b8466a7
15477a5d7f6b069531cb2a7558ce99f520a90c7e
refs/heads/master
2023-03-24T00:24:03.380915
2021-02-17T00:02:01
2021-02-17T00:02:01
312,561,622
0
0
null
null
null
null
UTF-8
Java
false
false
2,698
java
package com.suprun.periodicals.view.constants; import com.suprun.periodicals.util.Resource; /** * Relative path of pages */ public final class PagesPath { public static final String SITE_PREFIX = Resource.PATH.getProperty("site.prefix"); public static final String SIGN_IN_PATH = Resource.PATH.getProperty("path.signin"); public static final String REGISTER_PATH = Resource.PATH.getProperty("path.register"); public static final String HOME_PATH = Resource.PATH.getProperty("path.home"); public static final String PERIODICAL_PATH = Resource.PATH.getProperty("path.periodical"); public static final String CATALOG_PATH = Resource.PATH.getProperty("path.catalog"); public static final String SEARCH_PATH = Resource.PATH.getProperty("path.fulltext.search"); public static final String PROFILE_PATH = Resource.PATH.getProperty("path.profile"); public static final String SIGN_OUT_PATH = Resource.PATH.getProperty("path.signout"); public static final String BIN_PATH = Resource.PATH.getProperty("path.bin"); public static final String BIN_ADD_ITEM_PATH = Resource.PATH.getProperty("path.bin.add.item"); public static final String BIN_REMOVE_ITEM_PATH = Resource.PATH.getProperty("path.bin.remove.item"); public static final String BIN_REMOVE_ALL_ITEM_PATH = Resource.PATH.getProperty("path.bin.remove.all.item"); public static final String BIN_SUBSCRIPTION_PAYMENT_PATH = Resource.PATH.getProperty("path.bin.subscription.payment"); public static final String SUBSCRIPTIONS_PATH = Resource.PATH.getProperty("path.user.subscriptions"); public static final String ADMIN_CATALOG_PATH = Resource.PATH.getProperty("path.admin.catalog"); public static final String CREATE_PERIODICAL_PATH = Resource.PATH.getProperty("path.admin.catalog.periodical.create"); public static final String ADD_PUBLISHER_PATH = Resource.PATH.getProperty("path.admin.catalog.publisher.add"); public static final String EDIT_PERIODICAL_PATH = Resource.PATH.getProperty("path.admin.catalog.periodical.edit"); public static final String CHANGE_STATUS_PERIODICAL_PATH = Resource.PATH.getProperty("path.admin.catalog.change.status"); public static final String PAYMENTS_PATH = Resource.PATH.getProperty("path.admin.payments"); public static final String PAYMENT_OVERVIEW_PATH = Resource.PATH.getProperty("path.admin.payment"); public static final String USER_PATH = Resource.PATH.getProperty("path.admin.user"); public static final String ERROR_PATH = Resource.PATH.getProperty("path.error"); private PagesPath() { } }
[ "suprun-an@mail.ru" ]
suprun-an@mail.ru
796b7c6f5e7f6a0d60f63918d98a1ea02200db01
86cf61187d22b867d1e5d3c8a23d97e806636020
/src/main/java/base/operators/operator/nlp/word2vec/core/domain/Neuron.java
6e311a6c830d3ec41463cc1380b2c80fd82cd34d
[]
no_license
hitaitengteng/abc-pipeline-engine
f94bb3b1888ad809541c83d6923a64c39fef9b19
165a620b94fb91ae97647135cc15a66d212a39e8
refs/heads/master
2022-02-22T18:49:28.915809
2019-10-27T13:40:58
2019-10-27T13:40:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
497
java
package base.operators.operator.nlp.word2vec.core.domain; public abstract class Neuron implements Comparable<Neuron> { public double freq; public Neuron parent; public int code; // 语料预分类 public int category = -1; @Override public int compareTo(Neuron neuron) { if (this.category == neuron.category) { if (this.freq > neuron.freq) { return 1; } else { return -1; } } else if (this.category > neuron.category) { return 1; } else { return -1; } } }
[ "wangj_lc@inspur.com" ]
wangj_lc@inspur.com
654f4a2ef09b61d40b2e1407b4e2a0386d059445
037c46361f3d77a7af36f99437d0ae5ed1a17714
/pangjiao/src/main/java/com/pxy/pangjiao/compiler/mpv/MvpCompiler.java
08099a8338661e05e7f0612a9ab11756c6d307a7
[]
no_license
xinyupu/pangjiao
293e9f8b3782bbf3d33eaef24c296e3f3a82ec47
3cd7c0cb1fb460ff7efc1f04ac74c5a4c25af6f5
refs/heads/master
2021-04-09T10:16:48.366639
2018-08-04T08:50:07
2018-08-04T08:50:07
125,300,723
1
0
null
null
null
null
UTF-8
Java
false
false
11,853
java
package com.pxy.pangjiao.compiler.mpv; import com.pxy.pangjiao.compiler.mpv.annotation.Autowire; import com.pxy.pangjiao.compiler.mpv.annotation.AutowireProxy; import com.pxy.pangjiao.compiler.mpv.annotation.DataField; import com.pxy.pangjiao.compiler.mpv.annotation.Presenter; import com.pxy.pangjiao.compiler.mpv.annotation.Service; import com.pxy.pangjiao.compiler.mpv.annotation.ViewData; import com.pxy.pangjiao.compiler.mpv.annotation.Views; import com.pxy.pangjiao.compiler.mpv.config.AutoWireCompilerConfig; import com.pxy.pangjiao.compiler.mpv.config.CompilerClassConfig; import com.pxy.pangjiao.compiler.mpv.config.CompilerFieldConfig; import com.pxy.pangjiao.compiler.mpv.config.CompilerMethodConfig; import com.pxy.pangjiao.compiler.mpv.config.IConfig; import com.pxy.pangjiao.compiler.mpv.config.InterfaceConfig; import com.pxy.pangjiao.compiler.mpv.config.ViewDataConfig; import com.pxy.pangjiao.compiler.mpv.config.ViewsConfig; import com.pxy.pangjiao.compiler.mpv.factory.AutoWireInjectProduct; import com.pxy.pangjiao.databus.DataEvent; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.processing.RoundEnvironment; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; import javax.lang.model.type.MirroredTypeException; import javax.lang.model.type.TypeMirror; import javax.lang.model.util.Elements; /** * Created by pxy on 2018/3/13. */ public class MvpCompiler { private Elements mElementUtils; private RoundEnvironment env; private List<IConfig> configs; private AutoWireInjectProduct injectProduct; private Map<String, List<InterfaceConfig>> interfaceMaps; private Map<String, List<AutoWireCompilerConfig>> autoWireConfigMaps; private Map<String, List<AutoWireCompilerConfig>> autoWireProxyConfigMaps; private Map<String, ViewsConfig> viewConfigMaps; public MvpCompiler(RoundEnvironment env, Elements mElementUtils, AutoWireInjectProduct injectProduct) { this.env = env; this.mElementUtils = mElementUtils; this.injectProduct = injectProduct; configs = new ArrayList<>(); interfaceMaps = new HashMap<>(); autoWireConfigMaps = new HashMap<>(); autoWireProxyConfigMaps = new HashMap<>(); viewConfigMaps = new HashMap<>(); initService(); initPresent(); initViews(); initViewData(); parse(Autowire.class, autoWireConfigMaps); parse(AutowireProxy.class, autoWireConfigMaps); initDataEvent(); } private void initService() { Set<? extends Element> elements = this.env.getElementsAnnotatedWith(Service.class); for (Element element : elements) { if (element.getKind() == ElementKind.CLASS) { TypeElement typeElement = (TypeElement) element; List<? extends TypeMirror> interfaces = typeElement.getInterfaces(); for (TypeMirror type : interfaces) { String interfaceName = type.toString(); if (interfaceMaps.get(interfaceName) == null) { List<InterfaceConfig> interfaceList = new ArrayList<>(); interfaceList.add(new InterfaceConfig(interfaceName, typeElement.toString())); interfaceMaps.put(interfaceName, interfaceList); } else { List<InterfaceConfig> interfaceConfigs = interfaceMaps.get(interfaceName); interfaceConfigs.add(new InterfaceConfig(interfaceName, typeElement.toString())); } } CompilerClassConfig beanConfig = new CompilerClassConfig(element, Service.class, mElementUtils); configs.add(beanConfig); } } } private void initViewData(){ Set<? extends Element> elements = this.env.getElementsAnnotatedWith(ViewData.class); for (Element element:elements){ if (element.getKind() == ElementKind.CLASS){ TypeElement typeElement = (TypeElement) element; ViewData annotation = typeElement.getAnnotation(ViewData.class); // TypeMirror viewDataClass = getViewDataClass(annotation); // Class[] value = annotation.value(); // new ViewDataConfig(env,element,value); }else { throw new RuntimeException("@ViewData must on Type"); } } } private void initPresent() { Set<? extends Element> elements = this.env.getElementsAnnotatedWith(Presenter.class); for (Element element : elements) { if (element.getKind() == ElementKind.CLASS) { TypeElement typeElement = (TypeElement) element; List<? extends TypeMirror> interfaces = typeElement.getInterfaces(); for (TypeMirror type : interfaces) { String interfaceName = type.toString(); if (interfaceMaps.get(interfaceName) == null) { List<InterfaceConfig> interfaceList = new ArrayList<>(); interfaceList.add(new InterfaceConfig(interfaceName, typeElement.toString())); interfaceMaps.put(interfaceName, interfaceList); } else { List<InterfaceConfig> interfaceConfigs = interfaceMaps.get(interfaceName); interfaceConfigs.add(new InterfaceConfig(interfaceName, typeElement.toString())); } } CompilerClassConfig beanConfig = new CompilerClassConfig(element, Presenter.class, mElementUtils); configs.add(beanConfig); } } } private <T extends Annotation> void parse(Class<T> clsT, Map<String, List<AutoWireCompilerConfig>> map) { Set<? extends Element> elements = this.env.getElementsAnnotatedWith(clsT); for (Element element : elements) { TypeElement typeElement = (TypeElement) element.getEnclosingElement(); Views viewsAnnotation= typeElement.getAnnotation(Views.class); Service serviceAnnotation = typeElement.getAnnotation(Service.class); Presenter presenterAnnotation = typeElement.getAnnotation(Presenter.class); if (viewsAnnotation==null&&serviceAnnotation==null&&presenterAnnotation==null){ throw new NullPointerException("\n"+typeElement.asType().toString()+" must add @Views or @Service or @Presenter"); } if (element.getKind() != ElementKind.FIELD) { throw new IllegalArgumentException(String.format("Only FIELD can be annotated with @%s", clsT.getSimpleName())); } T annotation = element.getAnnotation(clsT); TypeMirror autowireImp = null; if (clsT == Autowire.class) { autowireImp = getAutowireImp((Autowire) annotation); } else if (clsT == AutowireProxy.class) { autowireImp = getAutowireImp((AutowireProxy) annotation); } String autoWireClassName = ""; if (null != autowireImp) { autoWireClassName = autowireImp.toString(); } VariableElement fieldElement = (VariableElement) element; List<AutoWireCompilerConfig> configLists = map.get(typeElement.asType().toString()); String fieldTypeClassName = fieldElement.asType().toString(); AutoWireCompilerConfig compilerConfig = new AutoWireCompilerConfig(); compilerConfig.setFieldName(element.getSimpleName().toString()); compilerConfig.setAutoFieldClassName(element.toString()); compilerConfig.setSimpleName(element.getSimpleName()); compilerConfig.setFieldName(element.getSimpleName().toString()); compilerConfig.setAutoFieldClassName(fieldTypeClassName); if (configLists == null) { configLists = new ArrayList<>(); pareAutoWire(fieldTypeClassName, compilerConfig, autoWireClassName); configLists.add(compilerConfig); map.put(typeElement.asType().toString(), configLists); } else { pareAutoWire(fieldTypeClassName, compilerConfig, autoWireClassName); configLists.add(compilerConfig); } CompilerFieldConfig beanConfig = new CompilerFieldConfig(element, clsT); configs.add(beanConfig); } } private void pareAutoWire(String fieldTypeClassName, AutoWireCompilerConfig compilerConfig, String autoWireClassName) { List<InterfaceConfig> interfaceConfigs = interfaceMaps.get(fieldTypeClassName); if (interfaceConfigs != null && interfaceConfigs.size() > 0) { compilerConfig.setInterface(true); List<String> interfaceImp = new ArrayList<>(); for (InterfaceConfig config : interfaceConfigs) { interfaceImp.add(config.getInterfaceImpClassName()); } if (!autoWireClassName.equals("java.lang.Void")) { if (interfaceImp.contains(autoWireClassName)) { compilerConfig.setAutoFieldClassImpName(autoWireClassName); } else if (!autoWireClassName.equals("java.lang.Void")) { throw new NullPointerException(String.format("\ncause by:\n"+"not add @Service or @Presenter on %s", autoWireClassName)); } } else { compilerConfig.setAutoFieldClassImpName(interfaceConfigs.get(0).getInterfaceImpClassName()); } } else { compilerConfig.setInterface(false); } } private void initViews() { Set<? extends Element> elements = this.env.getElementsAnnotatedWith(Views.class); for (Element element : elements) { CompilerClassConfig compilerClassConfig = new CompilerClassConfig(element, Views.class, mElementUtils); String typeName = compilerClassConfig.getType().toString(); if (viewConfigMaps.get(typeName) == null) { ViewsConfig viewsConfig = new ViewsConfig(); viewsConfig.setClassName(typeName); viewConfigMaps.put(typeName, viewsConfig); } } } private void initDataEvent() { Set<? extends Element> elements = this.env.getElementsAnnotatedWith(DataEvent.class); for (Element element : elements) { CompilerMethodConfig beanConfig = new CompilerMethodConfig(element, DataEvent.class); configs.add(beanConfig); } } public List<IConfig> getConfigs() { return configs; } public Map<String, List<AutoWireCompilerConfig>> getAutoWireConfigMaps() { return autoWireConfigMaps; } public Map<String, List<AutoWireCompilerConfig>> getAutoWireProxyConfigMaps() { return autoWireProxyConfigMaps; } public Map<String, ViewsConfig> getViewConfigMaps() { return viewConfigMaps; } private TypeMirror getAutowireImp(Autowire annotation) { try { annotation.imp(); } catch (MirroredTypeException mte) { return mte.getTypeMirror(); } return null; } private TypeMirror getAutowireImp(AutowireProxy annotation) { try { annotation.imp(); } catch (MirroredTypeException mte) { return mte.getTypeMirror(); } return null; } }
[ "526966586@qq.com" ]
526966586@qq.com
8d4b31930bf03b27202e7e7d18c28e2ebfb942e4
637b4faf515c75451a10c580287f7e5f44423ba0
/2.JavaCore/src/com/javarush/task/task18/task1814/TxtInputStream.java
8740546dbef40ce100018367d75b1898fa418f99
[]
no_license
Abrekov/JavaRushTasks
ccc51f357ee542801e90811dbbc2a4c99845e0e6
b1703a05303f3b1442e373a853a861bf793031b0
refs/heads/master
2020-09-07T05:57:18.878059
2019-12-08T17:19:18
2019-12-08T17:19:18
220,676,965
0
0
null
null
null
null
UTF-8
Java
false
false
461
java
package com.javarush.task.task18.task1814; import java.io.*; /* UnsupportedFileName */ public class TxtInputStream extends FileInputStream { public TxtInputStream(String fileName) throws IOException, UnsupportedFileNameException { super(fileName); if (!fileName.endsWith(".txt")) { super.close(); throw new UnsupportedFileNameException(); } } public static void main(String[] args) { } }
[ "abrekov@ya.ru" ]
abrekov@ya.ru
45aea828373af16c8d8d06e86da20808bfc278c1
205d18401445f4bb5e955e270b0f072202b0ec22
/api/src/main/java/de/learnlib/api/oracle/SingleQueryOmegaOracle.java
c81a1dba31c8f9d64197cc74ed665d942cd31a33
[ "Apache-2.0", "LicenseRef-scancode-free-unknown" ]
permissive
damascenodiego/learnlib
b56d07bb904a9b6a770496e09bac687304dee053
09b7f505bcee188efe4605a038536a36a2e4c98c
refs/heads/develop
2021-06-04T12:26:36.840535
2018-11-26T19:02:56
2018-11-26T19:02:56
159,353,246
0
0
Apache-2.0
2021-02-18T09:46:00
2018-11-27T15:02:47
Java
UTF-8
Java
false
false
1,748
java
/* Copyright (C) 2013-2018 TU Dortmund * This file is part of LearnLib, http://www.learnlib.de/. * * 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 de.learnlib.api.oracle; import java.util.Collection; import de.learnlib.api.query.OmegaQuery; import net.automatalib.commons.util.Pair; import net.automatalib.words.Word; /** * An {@link OmegaMembershipOracle} that answers single queries. * * @author Jeroen Meijer * * @see OmegaMembershipOracle * @see SingleQueryOracle */ public interface SingleQueryOmegaOracle<S, I, D> extends OmegaMembershipOracle<S, I, D> { @Override default void processQuery(OmegaQuery<I, D> query) { Pair<D, Integer> output = answerQuery(query.getPrefix(), query.getLoop(), query.getRepeat()); query.answer(output.getFirst(), output.getSecond()); } @Override default void processQueries(Collection<? extends OmegaQuery<I, D>> queries) { queries.forEach(this::processQuery); } interface SingleQueryOmegaOracleDFA<S, I> extends SingleQueryOmegaOracle<S, I, Boolean>, DFAOmegaMembershipOracle<S, I> {} interface SingleQueryOmegaOracleMealy<S, I, O> extends SingleQueryOmegaOracle<S, I, Word<O>>, MealyOmegaMembershipOracle<S, I, O> {} }
[ "mtf90@users.noreply.github.com" ]
mtf90@users.noreply.github.com
01b1538b37cd57d33cd693f145842ff8a3268ffd
e33d289f3e78263eedc7f5ea92695acab91ab318
/OpenglDemo/src/com/cdm/opengl/activity/Sample6/Sample6_5_Activity.java
073d958cd3e83bd25cb97ba2b4a62faed840cf8e
[]
no_license
iflove/android_apps_gallery
3ca69894e3f247965c4cd794d267c0137317efa0
8441785b8f1816658c085370a6e7420137023100
refs/heads/master
2023-03-17T06:20:56.235895
2015-04-08T11:20:16
2015-04-08T11:20:16
null
0
0
null
null
null
null
GB18030
Java
false
false
1,848
java
package com.cdm.opengl.activity.Sample6; import android.app.Activity; import android.content.pm.ActivityInfo; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import android.widget.LinearLayout; import android.widget.SeekBar; import com.cdm.opengl.R; import com.cdm.opengl.view.Sample6.MySurfaceView6_5; public class Sample6_5_Activity extends Activity { private MySurfaceView6_5 mGLSurfaceView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 设置为全屏 requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//设置为横屏 // 初始化GLSurfaceView mGLSurfaceView = new MySurfaceView6_5(this); // 切换到主界面 setContentView(R.layout.main6_3); LinearLayout ll = (LinearLayout) findViewById(R.id.main_liner6_3); ll.addView(mGLSurfaceView); SeekBar sb=(SeekBar)this.findViewById(R.id.SeekBar6_3); sb.setOnSeekBarChangeListener( new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { mGLSurfaceView.setLightOffset((seekBar.getMax()/2.0f-progress)/(seekBar.getMax()/2.0f)*-4); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } } ); } @Override protected void onResume() { super.onResume(); mGLSurfaceView.onResume(); } @Override protected void onPause() { super.onPause(); mGLSurfaceView.onPause(); } }
[ "pengpan85@gmail.com" ]
pengpan85@gmail.com
4df589b023bf95d28fbf9f39637adecddd304b02
77a788678ba5c1c42fdb7372850732fadd81382e
/Servidor/branches/PruebasHibernateCasino/src/Beans/Partidas.java
ef3115d41115b8e27e235a8fe60afa9791c6e799
[]
no_license
gruize/is0809casino
6165c60402f498ac219e9cdfb37af8abdd698009
10637627c5e153bb376362c59b47514e665bc136
refs/heads/master
2021-01-19T11:20:53.909460
2009-05-28T07:01:09
2009-05-28T07:01:09
40,656,814
0
0
null
null
null
null
UTF-8
Java
false
false
1,773
java
package Beans; // Generated 09-mar-2009 10:54:47 by Hibernate Tools 3.2.1.GA import java.util.HashSet; import java.util.Set; /** * Partidas generated by hbm2java */ public class Partidas implements java.io.Serializable { private int codigo; private Mesas mesas; private int numjugadores; private int ganador; private Set clienteses = new HashSet(0); public Partidas() { } public Partidas(int codigo, Mesas mesas, int numjugadores, int ganador) { this.codigo = codigo; this.mesas = mesas; this.numjugadores = numjugadores; this.ganador = ganador; } public Partidas(int codigo, Mesas mesas, int numjugadores, int ganador, Set clienteses) { this.codigo = codigo; this.mesas = mesas; this.numjugadores = numjugadores; this.ganador = ganador; this.clienteses = clienteses; } public int getCodigo() { return this.codigo; } public void setCodigo(int codigo) { this.codigo = codigo; } public Mesas getMesas() { return this.mesas; } public void setMesas(Mesas mesas) { this.mesas = mesas; } public int getNumjugadores() { return this.numjugadores; } public void setNumjugadores(int numjugadores) { this.numjugadores = numjugadores; } public int getGanador() { return this.ganador; } public void setGanador(int ganador) { this.ganador = ganador; } public Set getClienteses() { return this.clienteses; } public void setClienteses(Set clienteses) { this.clienteses = clienteses; } }
[ "asct86@cc0f0ba8-a479-11dd-a8c6-677c70d10fe4" ]
asct86@cc0f0ba8-a479-11dd-a8c6-677c70d10fe4
4fbaf563ef057b4bae9fbcf03e6715c3032671b8
78bd7a8e8d4db38eb775f10d56a8498595458fba
/src/main/java/com/dimatech/backend/apirest/models/dao/iEquipoDao.java
3e8420d7b5321f138ef4aafc351b82307193ca6d
[]
no_license
edgarconrado/dimatech-backend-apirest
1fa99c4c92cd0bf44ee8079ab592a41d6f4e4bf9
c94736397b3693c746a29783ee38afaf542d2e7f
refs/heads/master
2022-12-21T19:54:18.389949
2020-09-24T20:45:48
2020-09-24T20:45:48
298,387,648
0
0
null
null
null
null
UTF-8
Java
false
false
239
java
package com.dimatech.backend.apirest.models.dao; import org.springframework.data.repository.CrudRepository; import com.dimatech.backend.apirest.models.entity.Equipo; public interface iEquipoDao extends CrudRepository<Equipo, Long> { }
[ "edgar.conrado@sanmina.com" ]
edgar.conrado@sanmina.com
d8f894275eaba611a0c32fb143c86ba8b27698ce
c7ffea75dee67125f76983a822195fa834ce47f6
/faza-3/UnitTest.java
4b3b7369f45982e6d0dded2e38e2054a29aab4d5
[]
no_license
vrusi/blockchain
06b625c175185e463ac83c0fce00e9fc675ff90b
ac755e77aac6f9f4cb2d1527aa26a1332efe349c
refs/heads/master
2023-03-25T01:17:40.833510
2021-03-24T15:32:16
2021-03-24T15:32:16
346,499,138
0
0
null
null
null
null
UTF-8
Java
false
false
96
java
import org.junit.Test; import static org.junit.Assert.assertEquals; public class UnitTest { }
[ "v.rusinkova97@gmail.com" ]
v.rusinkova97@gmail.com
b03d67166adcb29d4060766e87ae30556b8a1169
3a9f7febd26844ce3829267d1180079c4a90c7f2
/Read.java
7eb585f30079ab6c7e140eec5163692168bf16b1
[]
no_license
maganoegi/hepial
2ae8245230cc2f6f27279de2e40e894424a537ca
3ba4e7a948f0617b23c4b423f0ba9118523ccec9
refs/heads/master
2023-02-22T19:20:18.900134
2021-01-25T03:11:32
2021-01-25T03:11:32
330,738,425
0
0
null
null
null
null
UTF-8
Java
false
false
418
java
public class Read extends Instruction { protected Expression destination; public Read(Expression e, String fl, int line, int col){ super(fl, line, col); this.destination = e; } public Expression getDestination() { return this.destination; } /** * Accepts a AST visitor */ Object accept(ASTVisitor visitor){ return visitor.visit(this); } }
[ "platserg94@yahoo.com" ]
platserg94@yahoo.com