blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
sequencelengths
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
689M
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
131 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
32 values
content
stringlengths
3
9.45M
authors
sequencelengths
1
1
author_id
stringlengths
0
313
a03c3836a7084f7725794015770a1a4e9a5ac25f
e40aae90169ca94c3bbdbeb30e38db9e44949773
/src/main/java/com/cg/goa/service/EMParserSalesReport.java
3f8c2d419c0e93e82b700ecfa47af41b2cee55b7
[]
no_license
aditya01kumar/GreatOutdoorApplication-midway
616726ed0fb348358159134e743a505cf013d911
a1571c8691cdc913d36e381d80174d4310e6deab
refs/heads/master
2023-05-04T11:19:35.227571
2021-05-05T07:13:49
2021-05-05T07:13:49
364,491,928
0
0
null
null
null
null
UTF-8
Java
false
false
936
java
package com.cg.goa.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.cg.goa.dao.ISalesReportRepository; import com.cg.goa.entity.SalesReportEntity; import com.cg.goa.model.SalesReportModel; @Service public class EMParserSalesReport { @Autowired private ISalesReportRepository salesrepo; public SalesReportEntity parse(SalesReportModel source) { return source == null ? null : new SalesReportEntity(source.getSalesReportId(), source.getProductId(), source.getProductName(), source.getQuantitySold(), source.getTotalSale() ); } public SalesReportModel parse(SalesReportEntity source) { return source == null ? null : new SalesReportModel(source.getSalesReportId(), source.getProductId(), source.getProductName(), source.getQuantitySold(), source.getTotalSale() ); } }
[ "65329259shubh01" ]
65329259shubh01
6b193de865865d9a2525d65eb83005311de0b15e
bf6413b98076d8d86da4c4d0653af5dc448e0332
/src/main/io/github/seba244c/icespire/graphics/Transformation.java
4aaf3a9744b3b27736867b5af369d0d8b4d00d41
[ "Apache-2.0" ]
permissive
Seba244c/Icespire
0ac0f1860b11bda57d9535543272d813c1df9c3d
e0ca22617e21abeb461c9359f7bbcc7411729f77
refs/heads/master
2023-06-09T14:42:23.669775
2023-06-02T16:05:09
2023-06-02T16:05:09
263,026,510
1
1
Apache-2.0
2023-04-17T06:23:29
2020-05-11T11:45:11
Java
UTF-8
Java
false
false
2,912
java
package io.github.seba244c.icespire.graphics; import org.joml.Matrix4f; import org.joml.Vector3f; import io.github.seba244c.icespire.ecs.Entity; /** * @author Sebsa * @since 1.0.2 */ public class Transformation { private final Matrix4f projectionMatrix; private final Matrix4f viewMatrix; private final Matrix4f modelViewMatrix; private final Matrix4f orthoMatrix; public Transformation() { modelViewMatrix = new Matrix4f(); projectionMatrix = new Matrix4f(); viewMatrix = new Matrix4f(); orthoMatrix = new Matrix4f(); } public final Matrix4f getProjectionMatrix(float fov, float width, float height, float zNear, float zFar) { return projectionMatrix.setPerspective(fov, width / height, zNear, zFar); } public Matrix4f getModelViewMatrix(Entity gameObject, Matrix4f viewMatrix) { Vector3f rotation = gameObject.getTransform().getRotation(); modelViewMatrix.identity().translate(gameObject.getTransform().getPosition()). rotateX((float)Math.toRadians(-rotation.x)). rotateY((float)Math.toRadians(-rotation.y)). rotateZ((float)Math.toRadians(-rotation.z)). scale(gameObject.getTransform().getScale()); Matrix4f viewCurr = new Matrix4f(viewMatrix); return viewCurr.mul(modelViewMatrix); } public Matrix4f getViewMatrix(Entity camera) { Vector3f cameraPos = camera.getTransform().getPosition(); Vector3f rotation = camera.getTransform().getRotation(); viewMatrix.identity(); // First do the rotation so camera rotates over its position viewMatrix.rotate((float)Math.toRadians(rotation.x), new Vector3f(1, 0, 0)) .rotate((float)Math.toRadians(rotation.y), new Vector3f(0, 1, 0)); // Then do the translation viewMatrix.translate(-cameraPos.x, -cameraPos.y, -cameraPos.z); return viewMatrix; } public final Matrix4f getOrthoProjectionMatrix(float left, float right, float bottom, float top) { orthoMatrix.identity(); orthoMatrix.setOrtho2D(left, right, bottom, top); return orthoMatrix; } public Matrix4f getOrtoProjModelMatrix(Entity entity, Matrix4f orthoMatrix) { Vector3f rotation = entity.getTransform().getRotation(); Matrix4f modelMatrix = new Matrix4f(); modelMatrix.identity().translate(entity.getTransform().getPosition()). rotateX((float)Math.toRadians(-rotation.x)). rotateY((float)Math.toRadians(-rotation.y)). rotateZ((float)Math.toRadians(-rotation.z)). scale(entity.getTransform().getScale()); Matrix4f orthoMatrixCurr = new Matrix4f(orthoMatrix); orthoMatrixCurr.mul(modelMatrix); return orthoMatrixCurr; } }
0149d945a1c20a2866a728d9c14bd95cb2872ba2
cd9be9950055af86f5f293b3e212ed8a68ffe17f
/ScriptProxy/src/main/java/tapi/api/service/AsyncService.java
75af0f7263dda91ed76e24e26aaa3b5ea6422d03
[ "MIT" ]
permissive
AlphaWallet/Web3E-Application
8b207d9986aadf82801c87fad5d593e2b5da66e9
834f0581159d57afeb1ce8b4ffca65336d19a7bf
refs/heads/master
2023-07-20T16:56:01.325219
2023-03-24T12:05:44
2023-03-24T12:05:44
150,229,653
14
8
MIT
2021-10-09T00:40:33
2018-09-25T08:10:55
C++
UTF-8
Java
false
false
10,050
java
package tapi.api.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Service; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; import org.web3j.utils.Numeric; import java.io.IOException; import java.math.BigInteger; import java.net.InetAddress; import java.net.SocketException; import java.net.UnknownHostException; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import tapi.api.service.connection.UDPClient; import tapi.api.service.connection.UDPClientInstance; @Service public class AsyncService { private List<UDPClient> udpClients; private Map<BigInteger, UDPClientInstance> tokenToClient = new ConcurrentHashMap<>(); private Map<String, List<UDPClientInstance>> addressToClient = new ConcurrentHashMap<>(); private Map<String, Integer> IoTAddrToQueryID = new ConcurrentHashMap<>(); private final static int UDP_PORT = 5000; private final static int UDP_TOP_PORT = 5004; private final static long CONNECTION_CLEANUP_TIME = 5L * 60L * 1000L; //after 5 minutes of silence remove a connection private UDPClientInstance getLatestClient(String ethAddress) { List<UDPClientInstance> clients = addressToClient.get(ethAddress); if (clients != null && clients.size() > 0) return clients.get(clients.size() - 1); else return null; } @Autowired private RestTemplate restTemplate; @Bean public RestTemplate restTemplate() { return new RestTemplate(); } public AsyncService() { udpClients = new ArrayList<>(); for (int port = UDP_PORT; port <= UDP_TOP_PORT; port++) { try { UDPClient client = new UDPClient(); client.init(this, port); client.start(); udpClients.add(client); } catch (Exception e) { System.out.println("Couldn't start Port: " + port + " Already in use."); } } System.out.println("UDP server started"); } public CompletableFuture<String> getResponse(String address, String method, MultiValueMap<String, String> argMap, String origin) throws InterruptedException, IOException { UDPClientInstance instance = getLatestClient(address.toLowerCase()); if (instance == null) return CompletableFuture.completedFuture("No device found"); //is there an identical call in progress from the same client? int methodId; int checkId = instance.getMatchingQuery(origin, method); if (checkId != -1) { methodId = checkId; System.out.println("Duplicate MethodID: " + checkId); } else { methodId = instance.sendToClient(origin, method, argMap); } if (methodId == -1) return CompletableFuture.completedFuture("API send error"); int resendIntervalCounter = 0; int resendCount = 30; //resend packet 20 times before timeout - attempt connection for 30 * 500ms = 15 seconds timeout boolean responseReceived = false; while (!responseReceived && resendCount > 0) { Thread.sleep(10); instance = getLatestClient(address.toLowerCase()); if (instance != null) { if (resendIntervalCounter++ > 50) //resend every 500 ms (thread sleep time = 10ms) { resendIntervalCounter = 0; instance.reSendToClient(methodId); resendCount--; } if (instance.hasResponse(methodId)) responseReceived = true; } } String response = instance.getResponse(methodId); if (resendCount == 0) { System.out.println("Timed out"); response = "Timed out"; } else { System.out.println("Received: (" + methodId + ") " + response + ((checkId > -1) ? " (*)" : "")); } return CompletableFuture.completedFuture(response); } public CompletableFuture<String> getDeviceAddress(String ipAddress) throws UnknownHostException { boolean useFilter = isLocal(ipAddress); InetAddress inetAddress = InetAddress.getByName(ipAddress); StringBuilder sb = new StringBuilder(); sb.append("Devices found on IP address: "); sb.append(ipAddress); byte[] filter; boolean foundAddr = false; if (useFilter) { filter = inetAddress.getAddress(); filter[3] = 0; inetAddress = InetAddress.getByAddress(filter); } for (List<UDPClientInstance> instances : addressToClient.values()) { UDPClientInstance instance = instances.get(instances.size() - 1); byte[] ipBytes = instance.getIPAddress().getAddress(); if (useFilter) ipBytes[3] = 0; InetAddress instanceAddr = InetAddress.getByAddress(ipBytes); if (instanceAddr.equals(inetAddress)) { foundAddr = true; sb.append("</br>"); sb.append(instance.getEthAddress()); } } if (!foundAddr) { sb.append("</br>No devices"); } return CompletableFuture.completedFuture(sb.toString()); } private boolean isLocal(String ipAddress) throws UnknownHostException { InetAddress inetAddress = InetAddress.getByName(ipAddress); byte[] filter = inetAddress.getAddress(); return filter[0] == (byte) 192 && filter[1] == (byte) 168; } public static void log(InetAddress addr, String msg) { DateTimeFormatter dtf = DateTimeFormatter.ofPattern("HH:mm:ss"); LocalDateTime now = LocalDateTime.now(); System.out.println(dtf.format(now) + ":" + addr.getHostAddress() + ": " + msg); } /** * Checks to see if any of the server threads have terminated, restart if so. */ public void checkServices() { for (UDPClient client : udpClients) { if (!client.isRunning()) { System.out.println("Warning: restarting listener: " + client.getPort()); try { client.init(this, client.getPort()); client.start(); } catch (SocketException e) { e.printStackTrace(); } } } //check for very old client connections for (List<UDPClientInstance> instances : addressToClient.values()) { if (instances != null && instances.size() > 0) { UDPClientInstance instance = instances.get(instances.size() - 1); if (System.currentTimeMillis() > (instance.getValidationTime() + CONNECTION_CLEANUP_TIME)) { log(instance.getIPAddress(), "Removing old client: " + instance.getEthAddress()); //remove all instances of this connection IoTAddrToQueryID.remove(instance.getEthAddress()); addressToClient.remove(instance.getEthAddress()); instances.clear(); break; } } } //remove orphaned session tokens for (BigInteger sessionToken : tokenToClient.keySet()) { UDPClientInstance instance = tokenToClient.get(sessionToken); if (System.currentTimeMillis() > (instance.getValidationTime() + CONNECTION_CLEANUP_TIME)) { log(instance.getIPAddress(), "Removing old token: " + sessionToken.toString(16) + " : " + instance.getEthAddress()); tokenToClient.remove(sessionToken); break; } } } public UDPClientInstance getClientFromToken(BigInteger tokenValue) { return tokenToClient.get(tokenValue); } public void updateClientFromToken(BigInteger tokenValue, UDPClientInstance client) { tokenToClient.put(tokenValue, client); } public List<UDPClientInstance> getClientListFromAddress(String recoveredAddr) { return addressToClient.get(recoveredAddr); } public List<UDPClientInstance> initAddrList(String recoveredAddr) { List<UDPClientInstance> addrList = new ArrayList<>(); addressToClient.put(recoveredAddr, addrList); return addrList; } public void pruneClientList(String recoveredAddr) { List<UDPClientInstance> addrList = getClientListFromAddress(recoveredAddr); //check for out of date client if (addrList.size() >= 3) { UDPClientInstance oldClient = addrList.get(0); log(oldClient.getIPAddress(), "Removing client from addr map #" + oldClient.getSessionTokenStr()); addrList.remove(oldClient); //remove this guy from main list too if (tokenToClient.containsKey(Numeric.toBigInt(oldClient.getSessionToken()))) { tokenToClient.remove(Numeric.toBigInt(oldClient.getSessionToken())); log(oldClient.getIPAddress(), "Removing client from token map #" + oldClient.getSessionTokenStr()); } } } public int getLatestQueryID(String ethAddress) { int val = IoTAddrToQueryID.getOrDefault(ethAddress, 0); if (++val > 256) val = 0; IoTAddrToQueryID.put(ethAddress, val); return val; } }
cc0a316ac1c0d1ce5ff3db142bc74eb6afbdadc6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/20/20_4d6456c10c465062066bd498dcccb1dbb38a9352/OptWnd/20_4d6456c10c465062066bd498dcccb1dbb38a9352_OptWnd_t.java
b306ac1eec3ac9f9ba05cdbafdf6c6dd50a119ca
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
20,387
java
/* * This file is part of the Haven & Hearth game client. * Copyright (C) 2009 Fredrik Tolf <[email protected]>, and * Björn Johannessen <[email protected]> * * Redistribution and/or modification of this file is subject to the * terms of the GNU Lesser General Public License, version 3, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Other parts of this source tree adhere to other copying * rights. Please see the file `COPYING' in the root directory of the * source tree for details. * * A copy the GNU Lesser General Public License is distributed along * with the source tree of which this file is a part in the file * `doc/LPGL-3'. If it is missing for any reason, please see the Free * Software Foundation's website at <http://www.fsf.org/>, or write * to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA */ package haven; import haven.SelectorWnd.Callback; import java.awt.font.TextAttribute; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; public class OptWnd extends Window { public static final RichText.Foundry foundry = new RichText.Foundry(TextAttribute.FAMILY, "SansSerif", TextAttribute.SIZE, 10); private static final BufferedImage cfgimgu = Resource.loadimg("gfx/hud/buttons/centeru"); private static final BufferedImage cfgimgd = Resource.loadimg("gfx/hud/buttons/centerd"); private Tabs body; private String curcam; private Map<String, CamInfo> caminfomap = new HashMap<String, CamInfo>(); private Map<String, String> camname2type = new HashMap<String, String>(); private Map<String, String[]> camargs = new HashMap<String, String[]>(); private Comparator<String> camcomp = new Comparator<String>() { public int compare(String a, String b) { if(a.startsWith("The ")) a = a.substring(4); if(b.startsWith("The ")) b = b.substring(4); return (a.compareTo(b)); } }; private static class CamInfo { String name, desc; Tabs.Tab args; public CamInfo(String name, String desc, Tabs.Tab args) { this.name = name; this.desc = desc; this.args = args; } } public OptWnd(Coord c, Widget parent) { super(c, new Coord(550, 445), parent, "Options"); body = new Tabs(Coord.z, new Coord(530, 445), this) { public void changed(Tab from, Tab to) { Utils.setpref("optwndtab", to.btn.text.text); from.btn.c.y = 0; to.btn.c.y = -2; }}; Widget tab; { /* GENERAL TAB */ tab = body.new Tab(new Coord(0, 0), 60, "General"); new Button(new Coord(10, 40), 125, tab, "Quit") { public void click() { HackThread.tg().interrupt(); }}; new Button(new Coord(10, 70), 125, tab, "Log out") { public void click() { ui.sess.close(); }}; new Button(new Coord(10, 100), 125, tab, "Toggle fullscreen") { public void click() { if (ui.fsm != null) { if(ui.fsm.hasfs()) ui.fsm.setwnd(); else ui.fsm.setfs(); } }}; (new CheckBox(new Coord(10, 130), tab, "Use new minimap (restart required)") { public void changed(boolean val) { Config.new_minimap = val; Config.saveOptions(); } }).a = Config.new_minimap; (new CheckBox(new Coord(10, 165), tab, "Use new chat (restart required)") { public void changed(boolean val) { Config.new_chat = val; Config.saveOptions(); } }).a = Config.new_chat; (new CheckBox(new Coord(10, 200), tab, "Add timestamp in chat") { public void changed(boolean val) { Config.timestamp = val; Config.saveOptions(); } }).a = Config.timestamp; (new CheckBox(new Coord(10, 235), tab, "Show dowsing direcion") { public void changed(boolean val) { Config.showDirection = val; Config.saveOptions(); } }).a = Config.showDirection; (new CheckBox(new Coord(10, 270), tab, "Always show heartling names") { public void changed(boolean val) { Config.showNames = val; Config.saveOptions(); } }).a = Config.showNames; (new CheckBox(new Coord(10, 305), tab, "Always show other kin names") { public void changed(boolean val) { Config.showOtherNames = val; Config.saveOptions(); } }).a = Config.showOtherNames; (new CheckBox(new Coord(10, 340), tab, "Show smileys in chat") { public void changed(boolean val) { Config.use_smileys = val; Config.saveOptions(); } }).a = Config.use_smileys; (new CheckBox(new Coord(10, 375), tab, "Show item quality") { public void changed(boolean val) { Config.showq = val; Config.saveOptions(); } }).a = Config.showq; (new CheckBox(new Coord(10, 410), tab, "Show player path") { public void changed(boolean val) { Config.showpath = val; Config.saveOptions(); } }).a = Config.showpath; (new CheckBox(new Coord(220, 130), tab, "Fast menu") { public void changed(boolean val) { Config.fastFlowerAnim = val; Config.saveOptions(); } }).a = Config.fastFlowerAnim; (new CheckBox(new Coord(220, 165), tab, "Compress screenshots") { public void changed(boolean val) { Config.sshot_compress = val; Config.saveOptions(); } }).a = Config.sshot_compress; (new CheckBox(new Coord(220, 200), tab, "Exclude UI from screenshot") { public void changed(boolean val) { Config.sshot_noui = val; Config.saveOptions(); } }).a = Config.sshot_noui; (new CheckBox(new Coord(220, 235), tab, "Exclude names from screenshot") { public void changed(boolean val) { Config.sshot_nonames = val; Config.saveOptions(); } }).a = Config.sshot_nonames; (new CheckBox(new Coord(220, 270), tab, "Use optimized claim higlighting") { public void changed(boolean val) { Config.newclaim = val; Config.saveOptions(); } }).a = Config.newclaim; (new CheckBox(new Coord(220, 305), tab, "Show digit toolbar") { public void changed(boolean val) { ui.mnu.digitbar.visible = val; Config.setWindowOpt(ui.mnu.digitbar.name, val); } }).a = ui.mnu.digitbar.visible; (new CheckBox(new Coord(220, 340), tab, "Show F-button toolbar") { public void changed(boolean val) { ui.mnu.functionbar.visible = val; Config.setWindowOpt(ui.mnu.functionbar.name, val); } }).a = ui.mnu.functionbar.visible; (new CheckBox(new Coord(220, 375), tab, "Show numpad toolbar") { public void changed(boolean val) { ui.mnu.numpadbar.visible = val; Config.setWindowOpt(ui.mnu.numpadbar.name, val); } }).a = ui.mnu.numpadbar.visible; (new CheckBox(new Coord(220, 410), tab, "Highlight combat skills") { public void changed(boolean val) { Config.highlightSkills = val; Config.saveOptions(); } }).a = Config.highlightSkills; (new CheckBox(new Coord(440, 130), tab, "Auto-hearth") { public void changed(boolean val) { Config.autohearth = val; Config.saveOptions(); } }).a = Config.autohearth; (new CheckBox(new Coord(455, 165), tab, "Unknown") { public void changed(boolean val) { Config.hearthunknown = val; Config.saveOptions(); } }).a = Config.hearthunknown; (new CheckBox(new Coord(455, 195), tab, "Red") { public void changed(boolean val) { Config.hearthred = val; Config.saveOptions(); } }).a = Config.hearthred; Widget editbox = new Frame(new Coord(310, 30), new Coord(90, 100), tab); new Label(new Coord(20, 10), editbox, "Edit mode:"); RadioGroup editmode = new RadioGroup(editbox) { public void changed(int btn, String lbl) { Utils.setpref("editmode", lbl.toLowerCase()); }}; editmode.add("Emacs", new Coord(10, 25)); editmode.add("PC", new Coord(10, 50)); if(Utils.getpref("editmode", "pc").equals("emacs")) editmode.check("Emacs"); else editmode.check("PC"); } { /* CAMERA TAB */ curcam = Utils.getpref("defcam", "border"); tab = body.new Tab(new Coord(70, 0), 60, "Camera"); new Label(new Coord(10, 40), tab, "Camera type:"); final RichTextBox caminfo = new RichTextBox(new Coord(180, 70), new Coord(210, 180), tab, "", foundry); caminfo.bg = new java.awt.Color(0, 0, 0, 64); String dragcam = "\n\n$col[225,200,100,255]{You can drag and recenter with the middle mouse button.}"; String fscam = "\n\n$col[225,200,100,255]{Should be used in full-screen mode.}"; addinfo("orig", "The Original", "The camera centers where you left-click.", null); addinfo("predict", "The Predictor", "The camera tries to predict where your character is heading - à la Super Mario World - and moves ahead of your character. Works unlike a charm." + dragcam, null); addinfo("border", "Freestyle", "You can move around freely within the larger area of the window; the camera only moves along to ensure the character does not reach the edge of the window. Boom chakalak!" + dragcam, null); addinfo("fixed", "The Fixator", "The camera is fixed, relative to your character." + dragcam, null); addinfo("kingsquest", "King's Quest", "The camera is static until your character comes close enough to the edge of the screen, at which point the camera snaps around the edge.", null); addinfo("cake", "Pan-O-Rama", "The camera centers at the point between your character and the mouse cursor. It's pantastic!", null); final Tabs cambox = new Tabs(new Coord(100, 60), new Coord(300, 200), tab); Tabs.Tab ctab; /* clicktgt arg */ ctab = cambox.new Tab(); new Label(new Coord(45, 10), ctab, "Fast"); new Label(new Coord(45, 180), ctab, "Slow"); new Scrollbar(new Coord(60, 20), 160, ctab, 0, 20) { { val = Integer.parseInt(Utils.getpref("clicktgtarg1", "10")); setcamargs("clicktgt", calcarg()); } public boolean mouseup(Coord c, int button) { if (super.mouseup(c, button)) { setcamargs(curcam, calcarg()); setcamera(curcam); Utils.setpref("clicktgtarg1", String.valueOf(val)); return (true); } return (false); } private String calcarg() { return (String.valueOf(Math.cbrt(Math.cbrt(val / 24.0)))); }}; addinfo("clicktgt", "The Target Seeker", "The camera recenters smoothly where you left-click." + dragcam, ctab); /* fixedcake arg */ ctab = cambox.new Tab(); new Label(new Coord(45, 10), ctab, "Fast"); new Label(new Coord(45, 180), ctab, "Slow"); new Scrollbar(new Coord(60, 20), 160, ctab, 0, 20) { { val = Integer.parseInt(Utils.getpref("fixedcakearg1", "10")); setcamargs("fixedcake", calcarg()); } public boolean mouseup(Coord c, int button) { if (super.mouseup(c, button)) { setcamargs(curcam, calcarg()); setcamera(curcam); Utils.setpref("fixedcakearg1", String.valueOf(val)); return (true); } return (false); } private String calcarg() { return (String.valueOf(Math.pow(1 - (val / 20.0), 2))); }}; addinfo("fixedcake", "The Borderizer", "The camera is fixed, relative to your character unless you touch one of the screen's edges with the mouse, in which case the camera peeks in that direction." + dragcam + fscam, ctab); final RadioGroup cameras = new RadioGroup(tab) { public void changed(int btn, String lbl) { if (camname2type.containsKey(lbl)) lbl = camname2type.get(lbl); if (!lbl.equals(curcam)) { if (camargs.containsKey(lbl)) setcamargs(lbl, camargs.get(lbl)); setcamera(lbl); } CamInfo inf = caminfomap.get(lbl); if (inf == null) { cambox.showtab(null); caminfo.settext(""); } else { cambox.showtab(inf.args); caminfo.settext(String.format("$size[12]{%s}\n\n$col[200,175,150,255]{%s}", inf.name, inf.desc)); } }}; List<String> clist = new ArrayList<String>(); for (String camtype : MapView.camtypes.keySet()) clist.add(caminfomap.containsKey(camtype) ? caminfomap.get(camtype).name : camtype); Collections.sort(clist, camcomp); int y = 25; for (String camname : clist) cameras.add(camname, new Coord(10, y += 25)); cameras.check(caminfomap.containsKey(curcam) ? caminfomap.get(curcam).name : curcam); (new CheckBox(new Coord(50, 270), tab, "Allow zooming with mouse wheel") { public void changed(boolean val) { Config.zoom = val; Config.saveOptions(); } }).a = Config.zoom; (new CheckBox(new Coord(50, 300), tab, "Disable camera borders") { public void changed(boolean val) { Config.noborders = val; Config.saveOptions(); } }).a = Config.noborders; } { /* AUDIO TAB */ tab = body.new Tab(new Coord(140, 0), 60, "Audio"); new Label(new Coord(10, 40), tab, "Sound volume:"); new Frame(new Coord(10, 65), new Coord(20, 206), tab); new Label(new Coord(210, 40), tab, "Music volume:"); new Frame(new Coord(210, 65), new Coord(20, 206), tab); final Label sfxvol = new Label(new Coord(35, 69 + (int)(Config.sfxVol * 1.86)), tab, String.valueOf(100 - getsfxvol()) + " %"); final Label musicvol = new Label(new Coord(235, 69 + (int)(Config.musicVol * 1.86)), tab, String.valueOf(100 - getsfxvol()) + " %"); (new Scrollbar(new Coord(25, 70), 196, tab, 0, 100) {{ val = 100 - Config.sfxVol; } public void changed() { //Audio.setvolume((100 - val) / 100.0); Config.sfxVol = 100 - val; sfxvol.c.y = 69 + (int) (val * 1.86); sfxvol.settext(String.valueOf(100 - val) + " %"); Config.saveOptions(); } public boolean mousewheel(Coord c, int amount) { val = Utils.clip(val + amount, min, max); changed(); return (true); } }).changed(); (new Scrollbar(new Coord(225, 70), 196, tab, 0, 100) {{ val = 100 - Config.musicVol; } public void changed() { //Audio.setvolume((100 - val) / 100.0); Config.musicVol = 100 - val; Music.setVolume(Config.getMusicVolume()); musicvol.c.y = 69 + (int) (val * 1.86); musicvol.settext(String.valueOf(100 - val) + " %"); Config.saveOptions(); } public boolean mousewheel(Coord c, int amount) { val = Utils.clip(val + amount, min, max); changed(); return (true); } }).changed(); (new CheckBox(new Coord(10, 270), tab, "Sound enabled") { public void changed(boolean val) { Config.isSoundOn = val; }}).a = Config.isSoundOn; (new CheckBox(new Coord(210, 270), tab, "Music enabled") { public void changed(boolean val) { Config.isMusicOn = val; Music.setVolume(Config.getMusicVolume()); }}).a = Config.isMusicOn; } { /* HIDE OBJECTS TAB */ tab = body.new Tab(new Coord(210, 0), 80, "Hide Objects"); String[][] checkboxesList = { { "Walls", "gfx/arch/walls" }, { "Gates", "gfx/arch/gates" }, { "Wooden Houses", "gfx/arch/cabin" }, { "Stone Mansions", "gfx/arch/inn" }, { "Plants", "gfx/terobjs/plants" }, { "Trees", "gfx/terobjs/trees" }, { "Stones", "gfx/terobjs/bumlings" }, { "Flavor objects", "flavobjs" }, { "Bushes", "gfx/tiles/wald" }, { "Thicket", "gfx/tiles/dwald" } }; int y = 0; for (final String[] checkbox : checkboxesList) { CheckBox chkbox = new CheckBox(new Coord(10, y += 30), tab, checkbox[0]) { public void changed(boolean val) { if (val) { Config.addhide(checkbox[1]); } else { Config.remhide(checkbox[1]); } Config.saveOptions(); } }; chkbox.a = Config.hideObjectList.contains(checkbox[1]); } } { /* HIGHLIGHT OPTIONS TAB */ tab = body.new Tab(new Coord(300, 0), 80, "Highlight"); int i = 1; for (final String group : Config.hlgroups.keySet()) { final CheckBox chkbox = new CheckBox(new Coord(20, 30*i), tab, group) { public void changed(boolean val) { if (val) { Config.highlightItemList.addAll(Config.hlcgroups.get(group)); } else { Config.highlightItemList.removeAll(Config.hlgroups.get(group)); } Config.saveOptions(); } }; chkbox.a = Config.highlightItemList.containsAll(Config.hlcgroups.get(group)); new IButton(new Coord(1, 30*i + 17), tab, cfgimgu, cfgimgd){ private boolean v = false; public void click() { if(v){return;} v = true; SelectorWnd wnd = new SelectorWnd(ui.root, group); wnd.setData(Config.hlgroups.get(group), Config.hlcgroups.get(group), new Callback() { @Override public void callback() { v = false; Config.highlightItemList.removeAll(Config.hlgroups.get(group)); if(chkbox.a){ Config.highlightItemList.addAll(Config.hlcgroups.get(group)); } Config.saveCurrentHighlights(); Config.saveOptions(); } }); } private Text tooltip = Text.render("Config group"); @Override public Object tooltip(Coord c, boolean again) { return checkhit(c)?tooltip:null; } }; i++; } CheckBox chkbox = new CheckBox(new Coord(150, 30), tab, "Don't scale minimap icons") { public void changed(boolean val) { Config.dontScaleMMIcons = val; Config.saveOptions(); } }; chkbox.a = Config.dontScaleMMIcons; chkbox = new CheckBox(new Coord(150, 60), tab, "Show view distance") { public void changed(boolean val) { Config.showViewDistance = val; Config.saveOptions(); } }; chkbox.a = Config.showViewDistance; } new Frame(new Coord(-10, 20), new Coord(550, 430), this); String last = Utils.getpref("optwndtab", ""); for (Tabs.Tab t : body.tabs) { if (t.btn.text.text.equals(last)) body.showtab(t); } } private void setcamera(String camtype) { curcam = camtype; Utils.setpref("defcam", curcam); String[] args = camargs.get(curcam); if(args == null) args = new String[0]; MapView mv = ui.mainview; if (mv != null) { if (curcam.equals("clicktgt")) mv.cam = new MapView.OrigCam2(args); else if(curcam.equals("fixedcake")) mv.cam = new MapView.FixedCakeCam(args); else { try { mv.cam = MapView.camtypes.get(curcam).newInstance(); } catch (InstantiationException e) { } catch(IllegalAccessException e) {} } } } private void setcamargs(String camtype, String... args) { camargs.put(camtype, args); if (args.length > 0 && curcam.equals(camtype)) Utils.setprefb("camargs", Utils.serialize(args)); } private int getsfxvol() { return ((int) (100 - Double.parseDouble(Utils.getpref("sfxvol", "1.0")) * 100)); } private void addinfo(String camtype, String title, String text, Tabs.Tab args) { caminfomap.put(camtype, new CamInfo(title, text, args)); camname2type.put(title, camtype); } public void wdgmsg(Widget sender, String msg, Object... args) { if ((sender == cbtn) || (sender == fbtn)) super.wdgmsg(sender, msg, args); } public class Frame extends Widget { private IBox box; public Frame(Coord c, Coord sz, Widget parent) { super(c, sz, parent); box = new IBox("gfx/hud", "tl", "tr", "bl", "br", "extvl", "extvr", "extht", "exthb"); } public void draw(GOut og) { super.draw(og); GOut g = og.reclip(Coord.z, sz); g.chcolor(150, 200, 125, 255); box.draw(g, Coord.z, sz); } } }
b1ee85ea51d5fe8dbf7899e6d18f19ab741fa7b8
3ee4e2ac837a82c2baceb59053ac883e0207a96a
/app/src/main/java/com/example/weatherapp/CityPreference.java
433cccac1c325f471416aef7ddeed2bb43ae6547
[]
no_license
Vadim-GIT-free/Pogoda
e2423b5f660a9e82168daabff3063fd6ff6874f0
80bbf87565bae2816a7140909658dc738b6ac9da
refs/heads/master
2023-04-03T07:02:09.315133
2021-04-10T22:22:32
2021-04-10T22:22:32
271,283,825
0
0
null
2020-07-05T14:40:49
2020-06-10T13:25:23
Java
UTF-8
Java
false
false
460
java
package com.example.weatherapp; import android.app.Activity; import android.content.SharedPreferences; public class CityPreference { SharedPreferences prefs; public CityPreference(Activity activity) { prefs = activity.getPreferences(Activity.MODE_PRIVATE); } String getCity() { return prefs.getString("city", "Kiev"); } void setCity(String city) { prefs.edit().putString("city", city).commit(); } }
c9fc9602ecec006e1a750e1c9d503e66d5b2a642
d3331fd10ac3df9cced967dc4504ce50f40c32d1
/halo-flow/src/main/java/org/xujin/halo/flow/annotation/transaction/InsertTarget.java
c705e3fc036fcfef6dfa9782826d031397c17b5d
[]
no_license
CharlesYooSky/halo
7c83853884de5cb3e88d151dc0895312c8d5da3d
a1a7cac08db40f1aac85462dcb4c7edb4f092910
refs/heads/master
2020-03-23T14:23:57.175022
2018-07-18T05:23:00
2018-07-18T05:23:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
950
java
package org.xujin.halo.flow.annotation.transaction; import java.lang.annotation.*; /** * 插入目标对象到数据库 * <p> * 本注解的作用:创建一个新事务用来插入目标对象到数据库并提交,前提是调用流程引擎的insertTargetAndStart方法。 * 本注解存在的原因:在开启流程事务情况下,流程引擎是创建新事务进行执行,如果插入目标对象到数据库的事务未提交就执行流程引擎,则流程引擎在锁目标对象时就会出现死锁。 * 所以流程引擎留一个口子新开启一个事务来插入目标对象到数据库。 * 注意:如果插入目标对象时发现目标对象在数据库中已存在,根据幂等性原则,应该使用数据库中的已存在的目标对象(流程引擎是通过锁目标对象来实现)) */ @Documented @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface InsertTarget { }
f0ee12e32b5dd85dfb2ece6eed047285360ed73a
63df758e33e605fcedda051618362c0a214ef484
/app/src/main/java/test/net/atshq/imagetotextoct/MainActivity.java
ff3850297d9d8c82a95711d2adc714c031a47135
[]
no_license
R3l0ad3d/ImageToTextOCR
3496d51b1bc5eab2e4bad15f7fe5e65eee80199c
be9c45d94499166cf434072824bb6616fdaa803d
refs/heads/master
2021-04-12T05:40:38.397107
2018-03-21T08:58:01
2018-03-21T08:58:01
125,974,407
0
0
null
null
null
null
UTF-8
Java
false
false
8,757
java
package test.net.atshq.imagetotextoct; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.net.Uri; import android.os.Environment; import android.provider.MediaStore; import android.support.v4.content.FileProvider; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.SparseArray; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.vision.Frame; import com.google.android.gms.vision.text.TextBlock; import com.google.android.gms.vision.text.TextRecognizer; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; public class MainActivity extends AppCompatActivity { private TextView text; private int REQUEST_CAMERA = 0, SELECT_FILE = 1; private ImageView ivImage; private String userChoosenTask; private String mCurrentPhotoPath; private static boolean flag = false; private static boolean camera = false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); text = findViewById(R.id.tvText); ivImage = findViewById(R.id.ivImage); ivImage.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { selectImage(); } }); } public void readImageClick(View view) { //Bitmap bitmap = BitmapFactory.decodeResource(getApplicationContext().getResources(),R.drawable.image1); Bitmap bm = ((BitmapDrawable)ivImage.getDrawable()).getBitmap(); TextRecognizer textRecognizer = new TextRecognizer.Builder(getApplicationContext()).build(); if(!textRecognizer.isOperational()){ text.setText("no text found"); }else { Frame frame = new Frame.Builder().setBitmap(bm).build(); SparseArray<TextBlock> items = textRecognizer.detect(frame); StringBuilder sb = new StringBuilder(); for(int i=0;i<items.size();i++){ TextBlock bloc = items.valueAt(i); sb.append(bloc.getValue()); sb.append("\n"); } text.setText(sb.toString()); } } @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { switch (requestCode) { case Utility.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { flag=true; Utility.checkCameraPermission(MainActivity.this); } else { Utility.checkPermission(MainActivity.this); } break; case Utility.MY_PERMISSIONS_REQUEST_CAMERA: if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { camera = true; if (userChoosenTask.equals("Take Photo")) { if (flag && camera) dispatchTakePictureIntent(); } else if (userChoosenTask.equals("Choose from Library")) { if (flag && camera) galleryIntent(); } }else { Utility.checkCameraPermission(MainActivity.this); } } } private void selectImage() { final CharSequence[] items = { "Take Photo", "Choose from Library", "Cancel" }; AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setTitle("Add Photo!"); builder.setItems(items, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int item) { flag =Utility.checkPermission(MainActivity.this); if (items[item].equals("Take Photo")) { userChoosenTask ="Take Photo"; if(flag&&camera) //cameraIntent(); dispatchTakePictureIntent(); } else if (items[item].equals("Choose from Library")) { userChoosenTask ="Choose from Library"; if(flag&&camera) galleryIntent(); } else if (items[item].equals("Cancel")) { dialog.dismiss(); } } }); builder.show(); } private void galleryIntent() { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT);// startActivityForResult(Intent.createChooser(intent, "Select File"),SELECT_FILE); } private void dispatchTakePictureIntent() { Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); // Ensure that there's a camera activity to handle the intent if (takePictureIntent.resolveActivity(getPackageManager()) != null) { // Create the File where the photo should go File photoFile = null; try { photoFile = createImageFile(); } catch (IOException ex) { // Error occurred while creating the File } // Continue only if the File was successfully created if (photoFile != null) { Uri photoURI = FileProvider.getUriForFile(this, "com.example.android.fileprovider", photoFile); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI); startActivityForResult(takePictureIntent, REQUEST_CAMERA); } } } private File createImageFile() throws IOException { // Create an image file name String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); String imageFileName = "JPEG_" + timeStamp + "_"; File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES); File image = File.createTempFile( imageFileName, /* prefix */ ".jpg", /* suffix */ storageDir /* directory */ ); // Save a file: path for use with ACTION_VIEW intents mCurrentPhotoPath = image.getAbsolutePath(); return image; } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == Activity.RESULT_OK) { if (requestCode == SELECT_FILE) onSelectFromGalleryResult(data); else if (requestCode == REQUEST_CAMERA) setPic(); } } private void setPic() { // Get the dimensions of the View int targetW = ivImage.getWidth(); int targetH = ivImage.getHeight(); // Get the dimensions of the bitmap BitmapFactory.Options bmOptions = new BitmapFactory.Options(); bmOptions.inJustDecodeBounds = true; BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions); int photoW = bmOptions.outWidth; int photoH = bmOptions.outHeight; // Determine how much to scale down the image int scaleFactor = Math.min(photoW/targetW, photoH/targetH); // Decode the image file into a Bitmap sized to fill the View bmOptions.inJustDecodeBounds = false; bmOptions.inSampleSize = scaleFactor; bmOptions.inPurgeable = true; Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions); ivImage.setImageBitmap(bitmap); } @SuppressWarnings("deprecation") private void onSelectFromGalleryResult(Intent data) { Bitmap bm=null; if (data != null) { try { bm = MediaStore.Images.Media.getBitmap(getApplicationContext().getContentResolver(), data.getData()); } catch (IOException e) { e.printStackTrace(); } } ivImage.setImageBitmap(bm); } }
d0af9a56fbb012de604fb9c4dbca2ba808e3b6c9
075e0ef731109ec156f9e62b2b393745cc2a385f
/src/main/java/com/zimmur/platform/manage/web/service/IAccountPermissionService.java
1c73ff3e3dd506f5536589c584a0aced8fab7f11
[]
no_license
huangsx0512/manage-web
42009f9984ae8fc0a6b593da617c6f184dc4efa8
ceb3ac7fc5c64820fa9bab1a7d4b4e3958954810
refs/heads/master
2020-04-13T10:42:48.486616
2019-04-09T13:50:06
2019-04-09T13:50:06
163,150,429
0
0
null
null
null
null
UTF-8
Java
false
false
179
java
package com.zimmur.platform.manage.web.service; import java.util.Set; public interface IAccountPermissionService { Set<String> findPermissionByaccountId(Integer accountId); }
9157ab1a7e6fb981fbf0ad7e8ec3b66e71ff6de4
694f247e3f94a7659181ccbcb428bc2307e2f944
/app/src/main/java/com/example/x_etc_33_43/adapter/X_List_adapter.java
0d52cb96a58abc00a91bb1626f4618f74d131012
[]
no_license
XGKerwin/X_ETC_33_43
9bfdeaa696224cdcf544c731187ee631b3e9f809
e065fcf9af0a9acf55e02c2f65716eee98072653
refs/heads/master
2023-02-09T21:07:22.862064
2020-12-29T00:56:18
2020-12-29T00:56:18
325,150,933
0
0
null
null
null
null
UTF-8
Java
false
false
2,566
java
package com.example.x_etc_33_43.adapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.example.x_etc_33_43.R; import com.example.x_etc_33_43.bean.CLSF; import com.example.x_etc_33_43.bean.CLSF2; import java.util.List; /** * author : 关鑫 * Github : XGKerwin * date : 2020/12/12 19:24 */ public class X_List_adapter extends BaseAdapter { private List<CLSF> clsfList; private List<CLSF2> clsf2List; public X_List_adapter(List<CLSF> clsfList, List<CLSF2> clsf2List) { this.clsf2List = clsf2List; this.clsfList = clsfList; } @Override public int getCount() { if (clsfList.size()==0) return 0; return clsfList.size(); } @Override public Object getItem(int position) { return null; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_clsf, null); holder = new ViewHolder(convertView); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } CLSF clsf = clsfList.get(position); holder.txtKahao.setText(clsf.getId()); holder.txtCp.setText(clsf.getPlate()); holder.time1.setText(clsf.getEntrance()); holder.time2.setText(clsf.getExit()); holder.txtJine.setText(clsf.getPrice()); for (int i=0;i<clsf2List.size();i++){ CLSF2 clsf2 = clsf2List.get(i); if (clsf.getNumber().equals(clsf2.getNumber())){ holder.txtName.setText(clsf2.getOwner()); } } return convertView; } class ViewHolder { private TextView txtKahao; private TextView txtCp; private TextView txtName; private TextView time1; private TextView time2; private TextView txtJine; public ViewHolder(View view) { txtKahao = view.findViewById(R.id.txt_kahao); txtCp = view.findViewById(R.id.txt_cp); txtName = view.findViewById(R.id.txt_name); time1 = view.findViewById(R.id.time1); time2 = view.findViewById(R.id.time2); txtJine = view.findViewById(R.id.txt_jine); } } }
725c094d73489121384a35b973e70024d178a6ea
fa246dd5793248c9ad76afa20069ba583f902c21
/AppBucles.java
238095cfbc197834938ad3f752a7a90006e20308
[]
no_license
dperaltajdaw1/ENTRE-02-UT4-Bucles
68c238f3bcc1a63a6afcbf01943f746b3bab69b6
2b0b05b50007e7c2877c67942781496431cf2b61
refs/heads/master
2023-01-06T18:43:14.052081
2020-11-09T10:21:48
2020-11-09T10:21:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
381
java
import java.util.Scanner; /** * @author - * * Punto de entrada a la aplicación * */ public class AppBucles { /** * Punto de entrada a la aplicación. * * */ public static void main(String[] args) { IUTexto interfaz = new IUTexto(new CalculadoraOctal(), new PintorFiguras()); interfaz.iniciar(); } }
67c4ee0dce956059199d3dca524d3876561de1ba
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project3/src/test/java/org/gradle/test/performance/largejavamultiproject/project3/p17/Test342.java
040b837bed7f254bcc028204f4bfb8ea37cedc9b
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
2,103
java
package org.gradle.test.performance.largejavamultiproject.project3.p17; import org.junit.Test; import static org.junit.Assert.*; public class Test342 { Production342 objectUnderTest = new Production342(); @Test public void testProperty0() { String value = "value"; objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { String value = "value"; objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { String value = "value"; objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
2ea5b409c0ec3df6a03d7a3e1bec0aa37bab9680
bd3a0ee7bbc1bc2d0b65fe3488976d40963a1485
/simple/src/main/java/application/LoserHello.java
ebcaeadcc21e64cf429443ba079f0c3e6251aa5c
[]
no_license
xinxin321198/springLearning
ad88aec77fcfd992b1faf65b8fe339329f098478
48261dd53c269935a50b2dd9a2cdb3516c9a35e1
refs/heads/master
2021-01-14T02:29:52.444135
2017-03-03T06:39:36
2017-03-03T06:39:36
81,941,447
0
0
null
null
null
null
UTF-8
Java
false
false
2,276
java
package application; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; public class LoserHello { private String string ;//用于常量注入和无参构造村塾 private Hello hello;//bean注入 private String[] names;//数组注入 private List<String> list;//list注入 private Map<String, Object> map;//map注入 private Set<String> set;//set的注入 private String isNull;//null注入 private Properties properties;//properties注入 public void setProperties(Properties properties) { this.properties = properties; } public void setIsNull(String isNull) { this.isNull = isNull; } public void setSet(Set<String> set) { this.set = set; } public void setList(List<String> list) { this.list = list; } public void setMap(Map<String, Object> map) { this.map = map; } public void setNames(String[] names) { this.names = names; } public void setString(String string) { this.string = string; } public void setHello(Hello hello) { this.hello = hello; } public LoserHello() { super(); this.string = "LoserHello无参构造方法"; } public LoserHello(String name){ super(); this.string = name; } /** * 方法校验注入的对象 */ public void say() { System.out.println("this is LoserHello calss!~"+" 使用"+this.string); if (null!=hello) { System.out.println("bean注入:---------------"); System.out.println("调用hello的say方法"); hello.say(); } if (null!=names) { System.out.println("数组注入:------------------"); for (String string : names) { System.out.println(string); } } if (null!=list) { System.out.println("list注入:----------------"); for (String s : list) { System.out.println(s); } } if (null!=map) { System.out.println("map注入:---------------"); System.out.println(map); Hello map3 = (Hello)map.get("map3"); map3.say(); } if (null!=set) { System.out.println("set注入:---------------"); System.out.println(set); } if (null==isNull) { System.out.println("null注入:---------------"); } if (null!=properties) { System.out.println("properties注入:----------------"); System.out.println(properties); } } }
3a7ef8b1e056a3339285ba7c429085d88af4e12e
df677ad87b5be97afa0d433d8f1f056cd352b29e
/app/src/main/java/com/example/mymosque/Fragments/FragmentMyMasjid.java
e07d9ce8582815928bbab4c198017630dc5cf329
[]
no_license
syedumair123/MOSQUE
18f16e4db3f81ceb6521d50a2ba996f20cfebd87
436556ab6c5fb34f912ed5ebfa5d2f6c9d2d703e
refs/heads/master
2020-05-24T08:39:00.168232
2019-05-29T06:15:46
2019-05-29T06:15:46
187,187,595
1
0
null
2019-05-17T09:26:54
2019-05-17T09:26:53
null
UTF-8
Java
false
false
2,169
java
package com.example.mymosque.Fragments; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import com.example.mymosque.R; public class FragmentMyMasjid extends Fragment { View v; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); }//end of onCreate method @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { v = inflater.inflate(R.layout.fragment_my_masjid, container, false); //<For Toolbar> android.support.v7.widget.Toolbar toolbar = (android.support.v7.widget.Toolbar) getActivity().findViewById(R.id.toolbar); toolbar.setVisibility(View.VISIBLE); TextView mTitle = (TextView) toolbar.findViewById(R.id.toolbar_title); mTitle.setText("My Mosque"); //</For Toolbar> Button prayertimesBtn = (Button) v.findViewById(R.id.PrayerTimesBTN); prayertimesBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { AppCompatActivity activity = (AppCompatActivity) v.getContext(); activity.getSupportFragmentManager().beginTransaction().replace(R.id.Screen_Area,new FragmentAskImam()).commit(); } }); Button mosqueBtn = (Button) v.findViewById(R.id.MosqueBTN); mosqueBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { AppCompatActivity activity = (AppCompatActivity) v.getContext(); activity.getSupportFragmentManager().beginTransaction().replace(R.id.Screen_Area,new FragmentPrayerTimes()).commit(); } }); return v; }//End onCreateView Method }
03435f46b507c4a47bce184933a77146d0890c55
45d82fc9986065bf773486583cfa84d8e4173d35
/graphene-function/src/main/java/net/iponweb/disthene/reader/graphite/evaluation/TargetEvaluator.java
56c1bb5b9d04a78a20ad9f97f3844071a169fed6
[ "MIT" ]
permissive
Dark0096/graphene
0eeac95192d69de8bb6e65f1b6561915edefb9d3
cd60d2f1f9004ae1839b14ef78b689e05528d933
refs/heads/master
2020-06-17T11:48:40.156537
2019-09-30T15:01:37
2019-09-30T15:01:37
195,914,460
6
3
MIT
2019-09-14T04:10:45
2019-07-09T02:04:51
Java
UTF-8
Java
false
false
4,470
java
package net.iponweb.disthene.reader.graphite.evaluation; import com.google.common.collect.Lists; import com.google.common.collect.ObjectArrays; import net.iponweb.disthene.reader.beans.TimeSeries; import net.iponweb.disthene.reader.config.Rollup; import net.iponweb.disthene.reader.exceptions.EvaluationException; import net.iponweb.disthene.reader.exceptions.InvalidNumberOfSeriesException; import net.iponweb.disthene.reader.exceptions.TimeSeriesNotAlignedException; import net.iponweb.disthene.reader.exceptions.TooMuchDataExpectedException; import net.iponweb.disthene.reader.graphite.PathTarget; import net.iponweb.disthene.reader.graphite.Target; import net.iponweb.disthene.reader.graphite.functions.DistheneFunction; import net.iponweb.disthene.reader.service.index.IndexService; import net.iponweb.disthene.reader.service.metric.MetricService; import net.iponweb.disthene.reader.utils.TimeSeriesUtils; import org.apache.log4j.Logger; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.concurrent.ExecutionException; /** @author Andrei Ivanov */ public class TargetEvaluator { static final Logger logger = Logger.getLogger(TargetEvaluator.class); private MetricService metricService; private IndexService indexService; public TargetEvaluator(MetricService metricService, IndexService indexService) { this.metricService = metricService; this.indexService = indexService; } public List<TimeSeries> eval(Target target) throws EvaluationException { return target.evaluate(this); } public List<TimeSeries> visit(PathTarget pathTarget) throws EvaluationException { try { Set<String> paths = indexService.getPaths(pathTarget.getTenant(), Lists.newArrayList(pathTarget.getPath())); logger.debug("resolved paths : " + paths); return metricService.getMetricsAsList( pathTarget.getTenant(), Lists.newArrayList(paths), pathTarget.getFrom(), pathTarget.getTo()); } catch (ExecutionException | InterruptedException | TooMuchDataExpectedException e) { logger.error(e.getMessage()); logger.debug(e); throw new EvaluationException(e); } } public List<TimeSeries> visit(DistheneFunction function) throws EvaluationException { return function.evaluate(this); } // todo: the logic below is duplicated several times - fix it! public TimeSeries getEmptyTimeSeries(long from, long to) { Long now = System.currentTimeMillis() * 1000; Long effectiveTo = Math.min(to, now); Rollup bestRollup = metricService.getRollup(from); Long effectiveFrom = (from % bestRollup.getRollup()) == 0 ? from : from + bestRollup.getRollup() - (from % bestRollup.getRollup()); effectiveTo = effectiveTo - (effectiveTo % bestRollup.getRollup()); int length = (int) ((effectiveTo - effectiveFrom) / bestRollup.getRollup() + 1); TimeSeries ts = new TimeSeries("", effectiveFrom, effectiveTo, bestRollup.getRollup()); ts.setValues(new Double[length]); return ts; } // todo: suboptimal public List<TimeSeries> bootstrap(Target target, List<TimeSeries> original, long period) throws EvaluationException { if (original.size() == 0) return new ArrayList<>(); List<TimeSeries> bootstrapped = new ArrayList<>(); bootstrapped.addAll(eval(target.previous(period))); if (bootstrapped.size() != original.size()) throw new InvalidNumberOfSeriesException(); if (!TimeSeriesUtils.checkAlignment(bootstrapped)) throw new TimeSeriesNotAlignedException(); int step = original.get(0).getStep(); // normalize (assuming bootstrapped step can only be bigger if (bootstrapped.get(0).getStep() != step) { int ratio = bootstrapped.get(0).getStep() / step; for (TimeSeries ts : bootstrapped) { List<Double> values = new ArrayList<>(); for (int i = 0; i < ts.getValues().length; i++) { values.addAll(Collections.nCopies(ratio, ts.getValues()[i])); } ts.setValues(values.toArray(new Double[values.size()])); } } for (int i = 0; i < bootstrapped.size(); i++) { bootstrapped .get(i) .setValues( ObjectArrays.concat( bootstrapped.get(i).getValues(), original.get(i).getValues(), Double.class)); bootstrapped.get(i).setStep(step); } return bootstrapped; } }
168696eaec7fefeb12bdf31efcc68d503c99db53
678a3d58c110afd1e9ce195d2f20b2531d45a2e0
/sources/com/airbnb/android/lib/tripassistant/amenities/HTAmenitiesSelectionView$$Lambda$2.java
6f9eaaaca082caddb7933b4a43de6c13331c3051
[]
no_license
jasonnth/AirCode
d1c37fb9ba3d8087efcdd9fa2103fb85d13735d5
d37db1baa493fca56f390c4205faf5c9bbe36604
refs/heads/master
2020-07-03T08:35:24.902940
2019-08-12T03:34:56
2019-08-12T03:34:56
201,842,970
0
2
null
null
null
null
UTF-8
Java
false
false
551
java
package com.airbnb.android.lib.tripassistant.amenities; import com.google.common.base.Function; final /* synthetic */ class HTAmenitiesSelectionView$$Lambda$2 implements Function { private static final HTAmenitiesSelectionView$$Lambda$2 instance = new HTAmenitiesSelectionView$$Lambda$2(); private HTAmenitiesSelectionView$$Lambda$2() { } public static Function lambdaFactory$() { return instance; } public Object apply(Object obj) { return ((HelpThreadAmenitySelectionViewItem) obj).getAmenity(); } }
17cd13a1439d35618103c2a93dc7b615e61a89c9
c9ff4c7d1c23a05b4e5e1e243325d6d004829511
/aws-java-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractClient.java
d2b6da58e8ca43fb315b77b5959e674f4cc9cd03
[ "Apache-2.0" ]
permissive
Purushotam-Thakur/aws-sdk-java
3c5789fe0b0dbd25e1ebfdd48dfd71e25a945f62
ab58baac6370f160b66da96d46afa57ba5bdee06
refs/heads/master
2020-07-22T23:27:57.700466
2019-09-06T23:28:26
2019-09-06T23:28:26
207,350,924
1
0
Apache-2.0
2019-09-09T16:11:46
2019-09-09T16:11:45
null
UTF-8
Java
false
false
48,579
java
/* * Copyright 2014-2019 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.textract; import org.w3c.dom.*; import java.net.*; import java.util.*; import javax.annotation.Generated; import org.apache.commons.logging.*; import com.amazonaws.*; import com.amazonaws.annotation.SdkInternalApi; import com.amazonaws.auth.*; import com.amazonaws.handlers.*; import com.amazonaws.http.*; import com.amazonaws.internal.*; import com.amazonaws.internal.auth.*; import com.amazonaws.metrics.*; import com.amazonaws.regions.*; import com.amazonaws.transform.*; import com.amazonaws.util.*; import com.amazonaws.protocol.json.*; import com.amazonaws.util.AWSRequestMetrics.Field; import com.amazonaws.annotation.ThreadSafe; import com.amazonaws.client.AwsSyncClientParams; import com.amazonaws.client.builder.AdvancedConfig; import com.amazonaws.services.textract.AmazonTextractClientBuilder; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.textract.model.*; import com.amazonaws.services.textract.model.transform.*; /** * Client for accessing Amazon Textract. All service calls made using this client are blocking, and will not return * until the service call completes. * <p> * <p> * Amazon Textract detects and analyzes text in documents and converts it into machine-readable text. This is the API * reference documentation for Amazon Textract. * </p> */ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonTextractClient extends AmazonWebServiceClient implements AmazonTextract { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AmazonTextract.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "textract"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final AdvancedConfig advancedConfig; private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.AccessDeniedExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("BadDocumentException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.BadDocumentExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidParameterException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.InvalidParameterExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("DocumentTooLargeException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.DocumentTooLargeExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ProvisionedThroughputExceededException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.ProvisionedThroughputExceededExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("UnsupportedDocumentException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.UnsupportedDocumentExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidJobIdException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.InvalidJobIdExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidS3ObjectException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.InvalidS3ObjectExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalServerError").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.InternalServerErrorExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.ThrottlingExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LimitExceededException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.LimitExceededExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("IdempotentParameterMismatchException").withExceptionUnmarshaller( com.amazonaws.services.textract.model.transform.IdempotentParameterMismatchExceptionUnmarshaller.getInstance())) .withBaseServiceExceptionClass(com.amazonaws.services.textract.model.AmazonTextractException.class)); public static AmazonTextractClientBuilder builder() { return AmazonTextractClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on Amazon Textract using the specified parameters. * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AmazonTextractClient(AwsSyncClientParams clientParams) { this(clientParams, false); } /** * Constructs a new client to invoke service methods on Amazon Textract using the specified parameters. * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AmazonTextractClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("textract.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/textract/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/textract/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** * <p> * Analyzes an input document for relationships between detected items. * </p> * <p> * The types of information returned are as follows: * </p> * <ul> * <li> * <p> * Words and lines that are related to nearby lines and words. The related information is returned in two * <a>Block</a> objects each of type <code>KEY_VALUE_SET</code>: a KEY Block object and a VALUE Block object. For * example, <i>Name: Ana Silva Carolina</i> contains a key and value. <i>Name:</i> is the key. <i>Ana Silva * Carolina</i> is the value. * </p> * </li> * <li> * <p> * Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object * is returned for each cell in a table. * </p> * </li> * <li> * <p> * Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information * about a selectable element. * </p> * </li> * <li> * <p> * Lines and words of text. A LINE Block object contains one or more WORD Block objects. * </p> * </li> * </ul> * <p> * You can choose which type of analysis to perform by specifying the <code>FeatureTypes</code> list. * </p> * <p> * The output is returned in a list of <code>BLOCK</code> objects. * </p> * <p> * <code>AnalyzeDocument</code> is a synchronous operation. To analyze documents asynchronously, use * <a>StartDocumentAnalysis</a>. * </p> * <p> * For more information, see <a * href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html">Document Text Analysis</a>. * </p> * * @param analyzeDocumentRequest * @return Result of the AnalyzeDocument operation returned by the service. * @throws InvalidParameterException * An input parameter violated a constraint. For example, in synchronous operations, an * <code>InvalidParameterException</code> exception occurs when neither of the <code>S3Object</code> or * <code>Bytes</code> values are supplied in the <code>Document</code> request parameter. Validate your * parameter before calling the API operation again. * @throws InvalidS3ObjectException * Amazon Textract is unable to access the S3 object that's specified in the request. * @throws UnsupportedDocumentException * The format of the input document isn't supported. Amazon Textract supports documents that are .png or * .jpg format. * @throws DocumentTooLargeException * The document can't be processed because it's too large. The maximum document size for synchronous * operations 5 MB. The maximum document size for asynchronous operations is 500 MB for PDF format files. * @throws BadDocumentException * Amazon Textract isn't able to read the document. * @throws AccessDeniedException * You aren't authorized to perform the action. * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Textract. * @throws InternalServerErrorException * Amazon Textract experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Textract is temporarily unable to process the request. Try your call again. * @sample AmazonTextract.AnalyzeDocument * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/AnalyzeDocument" target="_top">AWS API * Documentation</a> */ @Override public AnalyzeDocumentResult analyzeDocument(AnalyzeDocumentRequest request) { request = beforeClientExecution(request); return executeAnalyzeDocument(request); } @SdkInternalApi final AnalyzeDocumentResult executeAnalyzeDocument(AnalyzeDocumentRequest analyzeDocumentRequest) { ExecutionContext executionContext = createExecutionContext(analyzeDocumentRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<AnalyzeDocumentRequest> request = null; Response<AnalyzeDocumentResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new AnalyzeDocumentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(analyzeDocumentRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Textract"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AnalyzeDocument"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<AnalyzeDocumentResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AnalyzeDocumentResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Detects text in the input document. Amazon Textract can detect lines of text and the words that make up a line of * text. The input document must be an image in JPG or PNG format. <code>DetectDocumentText</code> returns the * detected text in an array of <a>Block</a> objects. * </p> * <p> * Each document page has as an associated <code>Block</code> of type PAGE. Each PAGE <code>Block</code> object is * the parent of LINE <code>Block</code> objects that represent the lines of detected text on a page. A LINE * <code>Block</code> object is a parent for each word that makes up the line. Words are represented by * <code>Block</code> objects of type WORD. * </p> * <p> * <code>DetectDocumentText</code> is a synchronous operation. To analyze documents asynchronously, use * <a>StartDocumentTextDetection</a>. * </p> * <p> * For more information, see <a * href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works-detecting.html">Document Text Detection</a>. * </p> * * @param detectDocumentTextRequest * @return Result of the DetectDocumentText operation returned by the service. * @throws InvalidParameterException * An input parameter violated a constraint. For example, in synchronous operations, an * <code>InvalidParameterException</code> exception occurs when neither of the <code>S3Object</code> or * <code>Bytes</code> values are supplied in the <code>Document</code> request parameter. Validate your * parameter before calling the API operation again. * @throws InvalidS3ObjectException * Amazon Textract is unable to access the S3 object that's specified in the request. * @throws UnsupportedDocumentException * The format of the input document isn't supported. Amazon Textract supports documents that are .png or * .jpg format. * @throws DocumentTooLargeException * The document can't be processed because it's too large. The maximum document size for synchronous * operations 5 MB. The maximum document size for asynchronous operations is 500 MB for PDF format files. * @throws BadDocumentException * Amazon Textract isn't able to read the document. * @throws AccessDeniedException * You aren't authorized to perform the action. * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Textract. * @throws InternalServerErrorException * Amazon Textract experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Textract is temporarily unable to process the request. Try your call again. * @sample AmazonTextract.DetectDocumentText * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/DetectDocumentText" target="_top">AWS * API Documentation</a> */ @Override public DetectDocumentTextResult detectDocumentText(DetectDocumentTextRequest request) { request = beforeClientExecution(request); return executeDetectDocumentText(request); } @SdkInternalApi final DetectDocumentTextResult executeDetectDocumentText(DetectDocumentTextRequest detectDocumentTextRequest) { ExecutionContext executionContext = createExecutionContext(detectDocumentTextRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DetectDocumentTextRequest> request = null; Response<DetectDocumentTextResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DetectDocumentTextRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(detectDocumentTextRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Textract"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DetectDocumentText"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DetectDocumentTextResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DetectDocumentTextResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document. * </p> * <p> * You start asynchronous text analysis by calling <a>StartDocumentAnalysis</a>, which returns a job identifier ( * <code>JobId</code>). When the text analysis operation finishes, Amazon Textract publishes a completion status to * the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to * <code>StartDocumentAnalysis</code>. To get the results of the text-detection operation, first check that the * status value published to the Amazon SNS topic is <code>SUCCEEDED</code>. If so, call * <code>GetDocumentAnalysis</code>, and pass the job identifier (<code>JobId</code>) from the initial call to * <code>StartDocumentAnalysis</code>. * </p> * <p> * <code>GetDocumentAnalysis</code> returns an array of <a>Block</a> objects. The following types of information are * returned: * </p> * <ul> * <li> * <p> * Words and lines that are related to nearby lines and words. The related information is returned in two * <a>Block</a> objects each of type <code>KEY_VALUE_SET</code>: a KEY Block object and a VALUE Block object. For * example, <i>Name: Ana Silva Carolina</i> contains a key and value. <i>Name:</i> is the key. <i>Ana Silva * Carolina</i> is the value. * </p> * </li> * <li> * <p> * Table and table cell data. A TABLE Block object contains information about a detected table. A CELL Block object * is returned for each cell in a table. * </p> * </li> * <li> * <p> * Selectable elements such as checkboxes and radio buttons. A SELECTION_ELEMENT Block object contains information * about a selectable element. * </p> * </li> * <li> * <p> * Lines and words of text. A LINE Block object contains one or more WORD Block objects. * </p> * </li> * </ul> * <p> * Use the <code>MaxResults</code> parameter to limit the number of blocks returned. If there are more results than * specified in <code>MaxResults</code>, the value of <code>NextToken</code> in the operation response contains a * pagination token for getting the next set of results. To get the next page of results, call * <code>GetDocumentAnalysis</code>, and populate the <code>NextToken</code> request parameter with the token value * that's returned from the previous call to <code>GetDocumentAnalysis</code>. * </p> * <p> * For more information, see <a * href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html">Document Text Analysis</a>. * </p> * * @param getDocumentAnalysisRequest * @return Result of the GetDocumentAnalysis operation returned by the service. * @throws InvalidParameterException * An input parameter violated a constraint. For example, in synchronous operations, an * <code>InvalidParameterException</code> exception occurs when neither of the <code>S3Object</code> or * <code>Bytes</code> values are supplied in the <code>Document</code> request parameter. Validate your * parameter before calling the API operation again. * @throws AccessDeniedException * You aren't authorized to perform the action. * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Textract. * @throws InvalidJobIdException * An invalid job identifier was passed to <a>GetDocumentAnalysis</a> or to <a>GetDocumentAnalysis</a>. * @throws InternalServerErrorException * Amazon Textract experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Textract is temporarily unable to process the request. Try your call again. * @sample AmazonTextract.GetDocumentAnalysis * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/GetDocumentAnalysis" target="_top">AWS * API Documentation</a> */ @Override public GetDocumentAnalysisResult getDocumentAnalysis(GetDocumentAnalysisRequest request) { request = beforeClientExecution(request); return executeGetDocumentAnalysis(request); } @SdkInternalApi final GetDocumentAnalysisResult executeGetDocumentAnalysis(GetDocumentAnalysisRequest getDocumentAnalysisRequest) { ExecutionContext executionContext = createExecutionContext(getDocumentAnalysisRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<GetDocumentAnalysisRequest> request = null; Response<GetDocumentAnalysisResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetDocumentAnalysisRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDocumentAnalysisRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Textract"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDocumentAnalysis"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<GetDocumentAnalysisResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDocumentAnalysisResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Gets the results for an Amazon Textract asynchronous operation that detects text in a document. Amazon Textract * can detect lines of text and the words that make up a line of text. * </p> * <p> * You start asynchronous text detection by calling <a>StartDocumentTextDetection</a>, which returns a job * identifier (<code>JobId</code>). When the text detection operation finishes, Amazon Textract publishes a * completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial * call to <code>StartDocumentTextDetection</code>. To get the results of the text-detection operation, first check * that the status value published to the Amazon SNS topic is <code>SUCCEEDED</code>. If so, call * <code>GetDocumentTextDetection</code>, and pass the job identifier (<code>JobId</code>) from the initial call to * <code>StartDocumentTextDetection</code>. * </p> * <p> * <code>GetDocumentTextDetection</code> returns an array of <a>Block</a> objects. * </p> * <p> * Each document page has as an associated <code>Block</code> of type PAGE. Each PAGE <code>Block</code> object is * the parent of LINE <code>Block</code> objects that represent the lines of detected text on a page. A LINE * <code>Block</code> object is a parent for each word that makes up the line. Words are represented by * <code>Block</code> objects of type WORD. * </p> * <p> * Use the MaxResults parameter to limit the number of blocks that are returned. If there are more results than * specified in <code>MaxResults</code>, the value of <code>NextToken</code> in the operation response contains a * pagination token for getting the next set of results. To get the next page of results, call * <code>GetDocumentTextDetection</code>, and populate the <code>NextToken</code> request parameter with the token * value that's returned from the previous call to <code>GetDocumentTextDetection</code>. * </p> * <p> * For more information, see <a * href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works-detecting.html">Document Text Detection</a>. * </p> * * @param getDocumentTextDetectionRequest * @return Result of the GetDocumentTextDetection operation returned by the service. * @throws InvalidParameterException * An input parameter violated a constraint. For example, in synchronous operations, an * <code>InvalidParameterException</code> exception occurs when neither of the <code>S3Object</code> or * <code>Bytes</code> values are supplied in the <code>Document</code> request parameter. Validate your * parameter before calling the API operation again. * @throws AccessDeniedException * You aren't authorized to perform the action. * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Textract. * @throws InvalidJobIdException * An invalid job identifier was passed to <a>GetDocumentAnalysis</a> or to <a>GetDocumentAnalysis</a>. * @throws InternalServerErrorException * Amazon Textract experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Textract is temporarily unable to process the request. Try your call again. * @sample AmazonTextract.GetDocumentTextDetection * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/GetDocumentTextDetection" * target="_top">AWS API Documentation</a> */ @Override public GetDocumentTextDetectionResult getDocumentTextDetection(GetDocumentTextDetectionRequest request) { request = beforeClientExecution(request); return executeGetDocumentTextDetection(request); } @SdkInternalApi final GetDocumentTextDetectionResult executeGetDocumentTextDetection(GetDocumentTextDetectionRequest getDocumentTextDetectionRequest) { ExecutionContext executionContext = createExecutionContext(getDocumentTextDetectionRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<GetDocumentTextDetectionRequest> request = null; Response<GetDocumentTextDetectionResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new GetDocumentTextDetectionRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(getDocumentTextDetectionRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Textract"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDocumentTextDetection"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<GetDocumentTextDetectionResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDocumentTextDetectionResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Starts asynchronous analysis of an input document for relationships between detected items such as key and value * pairs, tables, and selection elements. * </p> * <p> * <code>StartDocumentAnalysis</code> can analyze text in documents that are in JPG, PNG, and PDF format. The * documents are stored in an Amazon S3 bucket. Use <a>DocumentLocation</a> to specify the bucket name and file name * of the document. * </p> * <p> * <code>StartDocumentAnalysis</code> returns a job identifier (<code>JobId</code>) that you use to get the results * of the operation. When text analysis is finished, Amazon Textract publishes a completion status to the Amazon * Simple Notification Service (Amazon SNS) topic that you specify in <code>NotificationChannel</code>. To get the * results of the text analysis operation, first check that the status value published to the Amazon SNS topic is * <code>SUCCEEDED</code>. If so, call <a>GetDocumentAnalysis</a>, and pass the job identifier (<code>JobId</code>) * from the initial call to <code>StartDocumentAnalysis</code>. * </p> * <p> * For more information, see <a * href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html">Document Text Analysis</a>. * </p> * * @param startDocumentAnalysisRequest * @return Result of the StartDocumentAnalysis operation returned by the service. * @throws InvalidParameterException * An input parameter violated a constraint. For example, in synchronous operations, an * <code>InvalidParameterException</code> exception occurs when neither of the <code>S3Object</code> or * <code>Bytes</code> values are supplied in the <code>Document</code> request parameter. Validate your * parameter before calling the API operation again. * @throws InvalidS3ObjectException * Amazon Textract is unable to access the S3 object that's specified in the request. * @throws UnsupportedDocumentException * The format of the input document isn't supported. Amazon Textract supports documents that are .png or * .jpg format. * @throws DocumentTooLargeException * The document can't be processed because it's too large. The maximum document size for synchronous * operations 5 MB. The maximum document size for asynchronous operations is 500 MB for PDF format files. * @throws BadDocumentException * Amazon Textract isn't able to read the document. * @throws AccessDeniedException * You aren't authorized to perform the action. * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Textract. * @throws InternalServerErrorException * Amazon Textract experienced a service issue. Try your call again. * @throws IdempotentParameterMismatchException * A <code>ClientRequestToken</code> input parameter was reused with an operation, but at least one of the * other input parameters is different from the previous call to the operation. * @throws ThrottlingException * Amazon Textract is temporarily unable to process the request. Try your call again. * @throws LimitExceededException * An Amazon Textract service limit was exceeded. For example, if you start too many asynchronous jobs * concurrently, calls to start operations (<code>StartDocumentTextDetection</code>, for example) raise a * LimitExceededException exception (HTTP status code: 400) until the number of concurrently running jobs is * below the Amazon Textract service limit. * @sample AmazonTextract.StartDocumentAnalysis * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/StartDocumentAnalysis" target="_top">AWS * API Documentation</a> */ @Override public StartDocumentAnalysisResult startDocumentAnalysis(StartDocumentAnalysisRequest request) { request = beforeClientExecution(request); return executeStartDocumentAnalysis(request); } @SdkInternalApi final StartDocumentAnalysisResult executeStartDocumentAnalysis(StartDocumentAnalysisRequest startDocumentAnalysisRequest) { ExecutionContext executionContext = createExecutionContext(startDocumentAnalysisRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<StartDocumentAnalysisRequest> request = null; Response<StartDocumentAnalysisResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StartDocumentAnalysisRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startDocumentAnalysisRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Textract"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartDocumentAnalysis"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<StartDocumentAnalysisResult>> responseHandler = protocolFactory .createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartDocumentAnalysisResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * <p> * Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of text and the words * that make up a line of text. * </p> * <p> * <code>StartDocumentTextDetection</code> can analyze text in documents that are in JPG, PNG, and PDF format. The * documents are stored in an Amazon S3 bucket. Use <a>DocumentLocation</a> to specify the bucket name and file name * of the document. * </p> * <p> * <code>StartTextDetection</code> returns a job identifier (<code>JobId</code>) that you use to get the results of * the operation. When text detection is finished, Amazon Textract publishes a completion status to the Amazon * Simple Notification Service (Amazon SNS) topic that you specify in <code>NotificationChannel</code>. To get the * results of the text detection operation, first check that the status value published to the Amazon SNS topic is * <code>SUCCEEDED</code>. If so, call <a>GetDocumentTextDetection</a>, and pass the job identifier ( * <code>JobId</code>) from the initial call to <code>StartDocumentTextDetection</code>. * </p> * <p> * For more information, see <a * href="https://docs.aws.amazon.com/textract/latest/dg/how-it-works-detecting.html">Document Text Detection</a>. * </p> * * @param startDocumentTextDetectionRequest * @return Result of the StartDocumentTextDetection operation returned by the service. * @throws InvalidParameterException * An input parameter violated a constraint. For example, in synchronous operations, an * <code>InvalidParameterException</code> exception occurs when neither of the <code>S3Object</code> or * <code>Bytes</code> values are supplied in the <code>Document</code> request parameter. Validate your * parameter before calling the API operation again. * @throws InvalidS3ObjectException * Amazon Textract is unable to access the S3 object that's specified in the request. * @throws UnsupportedDocumentException * The format of the input document isn't supported. Amazon Textract supports documents that are .png or * .jpg format. * @throws DocumentTooLargeException * The document can't be processed because it's too large. The maximum document size for synchronous * operations 5 MB. The maximum document size for asynchronous operations is 500 MB for PDF format files. * @throws BadDocumentException * Amazon Textract isn't able to read the document. * @throws AccessDeniedException * You aren't authorized to perform the action. * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Textract. * @throws InternalServerErrorException * Amazon Textract experienced a service issue. Try your call again. * @throws IdempotentParameterMismatchException * A <code>ClientRequestToken</code> input parameter was reused with an operation, but at least one of the * other input parameters is different from the previous call to the operation. * @throws ThrottlingException * Amazon Textract is temporarily unable to process the request. Try your call again. * @throws LimitExceededException * An Amazon Textract service limit was exceeded. For example, if you start too many asynchronous jobs * concurrently, calls to start operations (<code>StartDocumentTextDetection</code>, for example) raise a * LimitExceededException exception (HTTP status code: 400) until the number of concurrently running jobs is * below the Amazon Textract service limit. * @sample AmazonTextract.StartDocumentTextDetection * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/textract-2018-06-27/StartDocumentTextDetection" * target="_top">AWS API Documentation</a> */ @Override public StartDocumentTextDetectionResult startDocumentTextDetection(StartDocumentTextDetectionRequest request) { request = beforeClientExecution(request); return executeStartDocumentTextDetection(request); } @SdkInternalApi final StartDocumentTextDetectionResult executeStartDocumentTextDetection(StartDocumentTextDetectionRequest startDocumentTextDetectionRequest) { ExecutionContext executionContext = createExecutionContext(startDocumentTextDetectionRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<StartDocumentTextDetectionRequest> request = null; Response<StartDocumentTextDetectionResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new StartDocumentTextDetectionRequestProtocolMarshaller(protocolFactory).marshall(super .beforeMarshalling(startDocumentTextDetectionRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Textract"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartDocumentTextDetection"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<StartDocumentTextDetectionResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartDocumentTextDetectionResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } } /** * Returns additional metadata for a previously executed successful, request, typically used for debugging issues * where a service isn't acting as expected. This data isn't considered part of the result data returned by an * operation, so it's available through this separate, diagnostic interface. * <p> * Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic * information for an executed request, you should use this method to retrieve it as soon as possible after * executing the request. * * @param request * The originally executed request * * @return The response metadata for the specified request, or null if none is available. */ public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) { return client.getResponseMetadataForRequest(request); } /** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext) { return invoke(request, responseHandler, executionContext, null, null); } /** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) { executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider)); return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait); } /** * Invoke with no authentication. Credentials are not required and any credentials set on the client or request will * be ignored for this operation. **/ private <X, Y extends AmazonWebServiceRequest> Response<X> anonymousInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext) { return doInvoke(request, responseHandler, executionContext, null, null); } /** * Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the * ExecutionContext beforehand. **/ private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) { if (discoveredEndpoint != null) { request.setEndpoint(discoveredEndpoint); request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery"); } else if (uriFromEndpointTrait != null) { request.setEndpoint(uriFromEndpointTrait); } else { request.setEndpoint(endpoint); } request.setTimeOffset(timeOffset); HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata()); return client.execute(request, responseHandler, errorResponseHandler, executionContext); } @com.amazonaws.annotation.SdkInternalApi static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() { return protocolFactory; } }
[ "" ]
5897c4751e246fb3be7e5f79fb86e33f7ad307bd
2db3e75f296081044f35d4b4c435a4c7a98038ea
/PhotonLabs_AutomationFramework_BDD_TDMS_MDD-JPMC_Demo_New/src/test/java/platforms/AndroidPlatform.java
8f10e18a54d3b2ecc2eb603109f27edfe357da1d
[]
no_license
pravallikapravi1994/Cucumber
c3810d1a4f67f419b1444bec30ac4ffbf46d7474
df55aa0f41062cada07a0814dfaaae939d98c048
refs/heads/main
2023-02-10T04:51:50.255085
2021-01-10T18:12:55
2021-01-10T18:12:55
328,448,179
0
0
null
null
null
null
UTF-8
Java
false
false
16,519
java
package platforms; import java.io.File; import java.net.URL; import java.time.Duration; import java.util.concurrent.TimeUnit; import io.appium.java_client.MobileElement; import io.appium.java_client.TouchAction; import models.States; import org.openqa.selenium.By; import org.openqa.selenium.Point; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import helpers.ConfigurationHelper; import io.appium.java_client.android.AndroidDriver; import org.testng.Assert; import pageobjects.android.*; public class AndroidPlatform implements MobilePlatform { private static AndroidDriver driver; private static WebDriverWait wait; private static AndroidLoginPage loginPage; private static AndroidInitialSignUpPage signUpPage; private static AndroidSettingsPage settingPage; private static AndroidHomePage homePage; private static AndroidPersonalPage personalPage; private static AndroidChangeAddressPage addressPage; public static AndroidDriver getDriver(){ return driver; } @Override public void launch() throws Exception { //if (driver == null) { try { ConfigurationHelper.init(); DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", ConfigurationHelper.getDeviceName()); capabilities.setCapability("platformVersion", ConfigurationHelper.getPlatformVersion()); capabilities.setCapability("platformName", ConfigurationHelper.getPlatformName()); capabilities.setCapability("appPackage", ConfigurationHelper.getAppPackage()); capabilities.setCapability("appActivity", ConfigurationHelper.getAppActivity()); capabilities.setCapability("newCommandTimeout", 300); String ADB = System.getenv("ANDROID_HOME"); String cmd = "/platform-tools/adb shell input keyevent 224"; Runtime run = Runtime.getRuntime(); Process pr = run.exec(ADB + cmd); pr.waitFor(); driver = new AndroidDriver(new URL(ConfigurationHelper.getDriverUrl()), capabilities); signUpPage = new AndroidInitialSignUpPage(driver); loginPage = new AndroidLoginPage(driver); settingPage = new AndroidSettingsPage(driver); homePage = new AndroidHomePage(driver); personalPage = new AndroidPersonalPage(driver); addressPage = new AndroidChangeAddressPage(driver); wait = new WebDriverWait(driver, 30); driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS); } catch (Exception e) { throw new Exception("Unable to connect to the Appium server."); } //} } @Override public void navigateToSignUp() throws Exception { try { loginPage.getSignUpButton().click(); } catch(Exception e){ throw new Exception("Unknown Error navigating to sign up"); } } @Override public void signUpWithEmail(String email, String password) throws Exception { try { driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS); signUpPage.getNewUserEmail().sendKeys(email); signUpPage.getNewUserPassword().sendKeys(password); if (driver.isKeyboardShown() != false) { driver.hideKeyboard(); } signUpPage.getTermsAndConditionsCheckBox().click(); signUpPage.getNextButton().click(); }catch(Exception e){ throw new Exception("Unknown error occurred while signing up with email"); } } @Override public void validatePasswordErrorMessage(String message) throws Exception { try{ String errorMessage = signUpPage.getErrorMessage().getText(); Assert.assertEquals(errorMessage,message,"Password error message does not match"); }catch (Exception e){ throw new Exception("Unknown error while validating password error messages"); } } @Override public void navigateToLogin() throws Exception { try { driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); loginPage.getEmailTextBox().clear(); driver.hideKeyboard(); }catch (Exception e){ throw new Exception("Unknown Error while navigating to login"); } } @Override public void validateLogIn() throws Exception { try { driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); boolean isElementMissing = homePage.getHomePageIcon().isEmpty(); if (isElementMissing) { throw new Exception("User is not logged in"); } } catch (Exception e) { throw new Exception("Unknown error while Log in"); } } @Override public void navigateToPersonalSettings() throws Exception { try { wait.until(ExpectedConditions.elementToBeClickable(homePage.getMoreIconButton().get(0))); homePage.getMoreIconButton().get(0).click(); boolean isElementMissing = settingPage.getSettingsButton().isEmpty(); if (!isElementMissing) { settingPage.getSettingsButton().get(0).click(); } personalPage.getPersonalButton().get(0).click(); } catch (Exception e) { throw new Exception("Unknown error while navigating to Account Settings", e); } } @Override public void validateAddress(String state) throws Exception { try { driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); personalPage.getAddressButton().click(); // String streetAddress = addressPage.getStreetAddress().getText(); // String cityValue = addressPage.getCity().getText(); String stateValue = addressPage.getStateListDropDown().getText(); // String zipCodeValue = addressPage.getZipCode().getText(); String stateName = States.getStateName(state); if (!stateValue.equalsIgnoreCase(stateName)) { throw new Exception("Account Settings - Address Mismatch. \nExpected address: " + state + "\nActual address: " + stateValue); } } catch (Exception e) { throw new Exception("Unknown error while validating address in Account settings", e); } } @Override public void changeAddress(String stateKey) throws Exception { try { //addressPage.getStreetAddress().sendKeys(address); //addressPage.getCity().sendKeys(city); addressPage.getStateListDropDown().click(); getStateName(stateKey); // addressPage.getZipCode().sendKeys(zipCode); /*if (driver.isKeyboardShown()) { driver.hideKeyboard(); }*/ addressPage.getChangeButton().click(); driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); driver.navigate().back(); boolean isBackButton = personalPage.getNavigateUpButton().isDisplayed(); if(isBackButton) personalPage.getNavigateUpButton().click(); } catch (Exception e) { throw new Exception("Unknown error while changing address"); } } @Override public void getStateName(String stateKey) throws Exception { try { String currentStateName = addressPage.getStateListDropDown().getText(); String stateName = States.getStateName(stateKey); WebElement stateElement = null; if (currentStateName.compareTo(stateName) <= 0) { stateElement = scrollUntilTheElementIsFound(addressPage.getState(stateName), addressPage.getStateListView(), 5, false); } else { stateElement = scrollUntilTheElementIsFound(addressPage.getState(stateName), addressPage.getStateListView(), 5, true); } if (stateElement == null) { throw new Exception("Unknown error while scrolling to find state"); } stateElement.click(); } catch (Exception e) { throw new Exception("Unknown error while changing address"); } } public WebElement scrollUntilTheElementIsFound(By elment, By frameElement, int iteration, boolean isScrollUp) throws Exception { try { for (int i = 0; i < iteration; i++) { driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); boolean isPresent = driver.findElements(elment).size() > 0; if (isPresent) { return driver.findElement(elment); } else { WebElement finalFrameElement = driver.findElement(frameElement); // scrollVertical(finalFrameElement, 3000, isScrollUp); } } return null; } catch (Exception e) { throw new Exception("Unknown error while scrolling to find the element", e); } } // To scroll down or scroll up this method can be utilized. The exact frame // to // scrolled should be passed as a parameter. // private void scrollVertical(WebElement frameElement, int duration, boolean isScrollUp) throws Exception { // try { // driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); // Point startCoordinatesOfYearList = frameElement.getLocation(); // Point centerCoordinatesOfYearList = ((MobileElement) frameElement).getCenter(); // int frameStartXCoordinate = startCoordinatesOfYearList.getX(); // int frameStartYCoordinate = startCoordinatesOfYearList.getY(); // int centerXCoordinate = centerCoordinatesOfYearList.getX(); // int centerYCoordinate = centerCoordinatesOfYearList.getY(); // int commonXCoordinate = ((centerXCoordinate - frameStartXCoordinate) / 2); // int startYCoordinate, endYCoordinate; // if (isScrollUp) { // startYCoordinate = frameStartYCoordinate + 50; // endYCoordinate = ((centerYCoordinate - frameStartYCoordinate) + centerYCoordinate) - 50; // } else { // startYCoordinate = ((centerYCoordinate - frameStartYCoordinate) + centerYCoordinate) - 50; // endYCoordinate = frameStartYCoordinate + 50; // } // driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); // new TouchAction(driver).press(commonXCoordinate, startYCoordinate).waitAction(Duration.ofMillis(duration)) // .moveTo(commonXCoordinate, endYCoordinate).release().perform(); // } catch (Exception e) { // throw new Exception("Unknown error while scrolling vertically", e); // } // } @Override public void logOut() throws Exception { driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); settingPage.getLogOutButtonList().get(0).click(); } private boolean logoutIfHomePage() throws Exception { try { boolean isLoginMissing = loginPage.getLogInText().isEmpty(); if (!isLoginMissing) { // Already logged out return true; } boolean isLogoutMissing = settingPage.getLogOutButtonList().isEmpty(); if (!isLogoutMissing) { // Logout button found settingPage.getLogOutButtonList().get(0).click(); return true; } boolean getMoreIconMissing = homePage.getMoreIconButton().isEmpty(); if (getMoreIconMissing) { return false; } homePage.getMoreIconButton().get(0).click(); WebElement settingsList = settingPage.getSettingsButton().get(0); settingsList.click(); settingPage.getLogOutButtonList().get(0).click(); return true; } catch (Exception e) { throw e; } } @Override public File takeScreenshot() throws Exception { // TODO Auto-generated method stub return null; } @Override public void login() throws Exception { } @Override public void validateLogOut() throws Exception { try { driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); boolean isElementMissing = loginPage.getLogInText().isEmpty(); if (isElementMissing) { throw new Exception("User not logged out successfully"); } } catch (Exception e) { throw new Exception("Unknown error while validating logout", e); } } @Override public void enterEmailAndPassword(String email, String password) throws Exception { } @Override public void validateUnsuccessfulLogin(String error) throws Exception { } @Override public void validateReward() throws Exception { } @Override public void validateOpenAccount() throws Exception { } @Override public void validateBrowseCards() throws Exception { } @Override public void validateManageMyAccount() throws Exception { } @Override public void validateTravelCards() throws Exception { } @Override public void validateRewardCards() throws Exception { } @Override public void validateCashBackCards() throws Exception { } @Override public void validatePartnerCards() throws Exception { } @Override public void validateSmallBusinessCards() throws Exception { } @Override public void signUp() throws Exception { } @Override public void fillAccountNumber(String accountNumber) throws Exception { } @Override public void fillSsnNumber(String ssnNumber) throws Exception { } @Override public void fillUserName(String userName) throws Exception { } @Override public void submitInformation() throws Exception { } @Override public void loginWithUserName(String username) throws Exception { try { loginPage.getEmailTextBox().sendKeys(username); loginPage.getNextButton().click(); } catch (Exception e) { throw new Exception("Unknown error while trying to enter user name"); } } @Override public void loginWithPassword(String password) throws Exception { try { loginPage.getPwdTextBox().sendKeys(password); loginPage.getLogInButton().click(); } catch (Exception e) { throw new Exception("Unknown error while trying to enter password"); } } @Override public void validateLoginUserNameField() throws Exception { // TODO Auto-generated method stub } @Override public void validateLoginpasswordField() throws Exception { // TODO Auto-generated method stub } @Override public void validateLoginrememberMe(String rememberMe) throws Exception { // TODO Auto-generated method stub } @Override public void validateLoginuseTokenLink(String useToken) throws Exception { // TODO Auto-generated method stub } @Override public void validateLoginsignInButton(String signInButton) throws Exception { // TODO Auto-generated method stub } @Override public void validateLoginforgotLink(String forgotLink) throws Exception { // TODO Auto-generated method stub } @Override public void validateLoginsignUpLink(String signUp) throws Exception { // TODO Auto-generated method stub } @Override public void validateSignuperrorMessage(String errorMessaage) throws Exception { // TODO Auto-generated method stub } @Override public void validateErrorMessageWhileSignUp(String errorMessage) throws Exception { // TODO Auto-generated method stub } @Override public void navigateToSigninPage() throws Exception { // TODO Auto-generated method stub } }
ae859670699da2084b3e6292e58d43dfb0ca5841
ce49d2d87313470011260a3ee529fbfe174829ab
/Blog/src/com/xupt/service/UserService.java
31cf56f4318bc93fd9add8225a734101c5df7c88
[]
no_license
zxdAreca/BlogProject
b53d47b2665ec045ee970a3b30027e3ceedf8463
34c3217fa60b84bceeb63c3d575ed8e2b51b37d2
refs/heads/master
2020-04-11T12:31:41.058999
2018-12-19T14:18:02
2018-12-19T14:18:02
161,783,732
0
0
null
null
null
null
UTF-8
Java
false
false
215
java
package com.xupt.service; import com.xupt.domain.User; public interface UserService { /** * 注册接口 */ void register(User user); /** * 登录 */ User login(String username,String password); }
51c720df272d4624d173fc98896ddd895ac9c071
d7ef0c5c39adce02df1b4d6ffb3e257b4e8b54fe
/src/main/java/com/kinteg/FileParserInDb/lib/parser/file/fixer/TableModelFixer.java
c91c132108436a466c4a9f8b5c6c54e0fa8c6d14
[]
no_license
kinteg/FileParserInDb
22e9c336f64039944cf9766832e355f6a30fc77e
bc12752143273f26536c25447c5c39f13cde70dc
refs/heads/master
2022-08-02T06:51:44.216135
2020-05-30T11:01:19
2020-05-30T11:01:19
260,282,571
0
0
null
null
null
null
UTF-8
Java
false
false
382
java
package com.kinteg.FileParserInDb.lib.parser.file.fixer; import com.kinteg.FileParserInDb.lib.common.model.TableModel; import com.kinteg.FileParserInDb.lib.parser.file.reader.Reader; import java.io.File; public interface TableModelFixer { TableModel fixTableModel(File file, Reader reader); TableModel fixTableModel(File file, TableModel tableModel, Reader reader); }
744d9b92c090221cc77b80e2dd21d80d7ca3d2bc
d890685e8b9696839a504cfed6cb818eb7b22baf
/project/src/app/main/src/java/PayActivity.java
7d49b07fce1a136bad8d596fa3642649abdf0b63
[]
no_license
SimeonIloski/NajdiParking
d7e6ac02d47b9dd11965bbb8fd74c69df44ebdc8
b6dac9419cd340e0e2f23d6fbcf6c828c8c3ef5a
refs/heads/master
2021-01-22T17:40:09.733720
2018-05-25T21:27:26
2018-05-25T21:27:26
102,399,590
0
0
null
null
null
null
UTF-8
Java
false
false
8,836
java
package com.example.simeon.najdiparking; import android.app.PendingIntent; import android.bluetooth.BluetoothClass; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.provider.Telephony; import android.support.annotation.IdRes; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.telephony.PhoneNumberFormattingTextWatcher; import android.telephony.PhoneNumberUtils; import android.telephony.SmsManager; import android.util.Log; import android.view.View; import android.view.accessibility.AccessibilityManager; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.NumberPicker; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.ScrollView; import android.widget.ShareActionProvider; import android.widget.Spinner; import android.widget.Toast; import android.preference.PreferenceManager; import java.util.ArrayList; import java.util.HashSet; import java.util.Objects; import java.util.Set; public class PayActivity extends AppCompatActivity { public final int[] pos=new int[2]; ArrayList<String> registrations=new ArrayList<>(); Set<String> regs=new HashSet<>(); EditText editMsg; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pay); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); Button btnStart=(Button) findViewById(R.id.btnStart); Button btnStop=(Button) findViewById(R.id.btnStop); final ArrayList<String> zones=getIntent().getStringArrayListExtra("zones"); final int ind=0; ArrayAdapter<String> adapter=new ArrayAdapter<String>(getApplicationContext(),android.R.layout.simple_list_item_1,zones); final Spinner spinner=(Spinner) findViewById(R.id.spinner); editMsg=(EditText) findViewById(R.id.editTextMsg); Spinner spinner1=(Spinner) findViewById(R.id.spinner2); Button addBtn=(Button) findViewById(R.id.button2); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int position, long l) { pos[0]=position; } @Override public void onNothingSelected(AdapterView<?> adapterView) { pos[0]=-1; } }); Preference preference=new Preference(getApplicationContext()); Set<String> set=preference.get(Preference.my_pref); for(String s:set){ registrations.add(s); } ArrayAdapter<String> adapter1=new ArrayAdapter<String>(getApplicationContext(),android.R.layout.simple_list_item_1,registrations); adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner1.setAdapter(adapter1); spinner1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) { pos[1]=i; } @Override public void onNothingSelected(AdapterView<?> adapterView) { pos[1]=-1; } }); String str=""; CheckBox checkBoxExist=(CheckBox) findViewById(R.id.checkBox2); checkBoxExist.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { if(compoundButton.isChecked()){ editMsg.setText(registrations.get(pos[1])); compoundButton.setChecked(false); } } }); editMsg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { editMsg.setText(""); } }); final String freg=str; btnStart.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(checkCorrect(editMsg.getText().toString())){ String msg=""; msg=String.format("%s %s %s","START",zones.get(pos[0]),editMsg.getText().toString()); SmsManager menager=SmsManager.getDefault(); String phone="070350915"; try { menager.sendTextMessage(phone, null, msg, null, null); Toast.makeText(getApplicationContext(), "Пораката е успешно испратена", Toast.LENGTH_SHORT).show(); } catch (SecurityException e){ Toast.makeText(getApplicationContext(),"Пораката не е успешно испратена",Toast.LENGTH_SHORT).show(); } } else{ Toast.makeText(getApplicationContext(),"Пораката е во невалиден формат",Toast.LENGTH_SHORT).show(); } } }); btnStop.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(checkCorrect(editMsg.getText().toString())){ String msg=""; msg=String.format("%s %s %s","STOP",zones.get(pos[0]),editMsg.getText().toString()); SmsManager menager=SmsManager.getDefault(); String phone="070350915"; try { menager.sendTextMessage(phone, null, msg, null, null); Toast.makeText(getApplicationContext(), "Пораката е успешно испратена", Toast.LENGTH_SHORT).show(); } catch (SecurityException e){ Toast.makeText(getApplicationContext(),"Пораката не е успешно испратена",Toast.LENGTH_SHORT).show(); Toast.makeText(getApplicationContext(),editMsg.getText().toString(),Toast.LENGTH_SHORT).show(); } } else{ Toast.makeText(getApplicationContext(),"Пораката е во невалиден формат",Toast.LENGTH_SHORT).show(); } } }); addBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Preference preference=new Preference(getApplicationContext()); Set<String> set=new HashSet<>(); for(String s:registrations){ set.add(s); } set.add(editMsg.getText().toString()); registrations.add(editMsg.getText().toString()); preference.set(Preference.my_pref,set); } }); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Вашата порака треба да биде во облик:регистрација без празни места" , Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } boolean checkCorrect(String str){ boolean b=false; char l[]=str.toCharArray(); if(str.trim().length()==7 || str.trim().length()==8) { b=true; } return b; } String makereg(int i){ String reg=""; if(i!=-1){ reg=registrations.get(i); } return reg; } @Override public void onStart() { super.onStart(); } @Override public void onPause(){ super.onPause(); } @Override public void onResume(){ super.onResume(); } }
8e747c721a74bd375ac58bc8fefd7813e35b541d
91fe845353f3323265ac5979efcda5b0f2b008a3
/dubbo-consumer-webapp/src/main/java/com/allen/interceptor/SecurityInterceptor.java
3b9b337e2b27c860b4d16c8cad396c9fcba4e727
[]
no_license
allencf/dubbo-consumer-webApp
aa12fe5f45f147f21a404094626b82fe30d4e698
46725c62e9f10238bab8650d71b490b9a323268b
refs/heads/master
2022-11-24T02:43:03.892567
2020-11-26T09:52:05
2020-11-26T09:52:05
72,418,290
0
0
null
2022-11-16T06:44:14
2016-10-31T08:44:33
Java
UTF-8
Java
false
false
1,064
java
package com.allen.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; public class SecurityInterceptor implements HandlerInterceptor{ private final static Logger logger = LoggerFactory.getLogger(SecurityInterceptor.class); @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { logger.info("securityInterceptor preHandle ……"); return true; } @Override public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { // TODO Auto-generated method stub } @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { // TODO Auto-generated method stub } }
2b461fe3c74687413c6649282639992e147449a0
26327e88a7b19ef9b09e6ed786db9fb522a3e1e7
/csv/src/main/java/works/tonny/mobile/demo6/LoginActivity.java
fd5dacf498c1b7f62f4f18cf55f41df95e22a4ff
[]
no_license
tonny1228/android
63b99a592bc3d68cd2385d698b42cbc68c5b4bbc
4a0c31444fb180df01273f0678e1f360f4a81db8
refs/heads/master
2021-01-01T04:19:34.738943
2016-04-28T12:25:21
2016-04-28T12:25:21
55,973,330
1
0
null
null
null
null
UTF-8
Java
false
false
3,347
java
package works.tonny.mobile.demo6; import android.app.Activity; import android.app.Fragment; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import works.tonny.mobile.ActivityHelper; import works.tonny.mobile.Application; import works.tonny.mobile.IntentUtils; import works.tonny.mobile.demo6.user.RegisterActivity; import works.tonny.mobile.widget.TipWatcher; public class LoginActivity extends Activity { public static final int RESULT_LOGINED = 1228; private TextView username; private TextView password; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); TitleHelper.getInstance(this).setTitle("登录").enableBack().setButton("注册", new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = IntentUtils.newInstance(LoginActivity.this, RegisterActivity.class); LoginActivity.this.startActivity(intent); } }); ActivityHelper.getInstance(this).setOnClickListener(R.id.goback, new View.OnClickListener() { @Override public void onClick(View v) { MainActivity.home(); finish(); } }); username = (TextView) findViewById(R.id.login_username); final TextView tip = (TextView) findViewById(R.id.username_tip); username.addTextChangedListener(new TipWatcher(tip)); password = (TextView) findViewById(R.id.login_password); Button loginButton = (Button) findViewById(R.id.button_login); loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String username = LoginActivity.this.username.getText().toString(); String password = LoginActivity.this.password.getText().toString(); Application.login(username, password); if (LoginActivity.this.getIntent().getStringExtra("goon") == null) { finish(); return; } Intent intent = new Intent(); try { intent.setClass(LoginActivity.this, Class.forName(LoginActivity.this.getIntent().getStringExtra("goon"))); } catch (ClassNotFoundException e) { e.printStackTrace(); } intent.putExtras(LoginActivity.this.getIntent().getExtras()); startActivity(intent); finish(); // Toast.makeText(getBaseContext(), "用户名或密码错误", Toast.LENGTH_SHORT).show(); } }); } public static void startLoginActivity(Activity activity, Class result) { Intent intent = new Intent(); // intent.putExtra("goon", ""); intent.setClass(activity, LoginActivity.class); activity.startActivity(intent); } public static void startLoginActivity(Fragment activity, Class result) { Intent intent = new Intent(); // intent.putExtra("goon", ""); activity.startActivityForResult(intent, RESULT_LOGINED); } }
caf52851ebf04f236c5ab32cea748915d938eb96
474777ae8d530f67f202c45e11a5712167cad39d
/base/src/main/java/com/szj/hello/dao/ImageMapper.java
78962c392c22e2c6824fa3ba0bde5457860bbaf8
[]
no_license
sunzengjun/kotlin-boot
9c49b6a1bf145187cb108e84dc82990457009562
1c325452db56482c9ac3a720ffbadc8d2d64a312
refs/heads/master
2021-09-07T19:58:05.574003
2018-02-28T07:25:05
2018-02-28T07:25:05
108,363,827
0
0
null
null
null
null
UTF-8
Java
false
false
313
java
package com.szj.hello.dao; import com.szj.hello.dao.domain.Image; import java.util.List; /** * Created by Sun on 2017/3/31. */ public interface ImageMapper { /** * 单个查询 * @param refundId 图片id * @return 单个图片 */ Image selectById(Long refundId); }
cb06bf8ad631091926de0c4bbf50ba2606ca4f3d
a31031af11a68970a733e992bdd4129bbaf212cf
/xsb_test/src/test/java/com/xsb/test/ApiClientLogPostParamsTest.java
da41db3c227bc5c3995b9097ea0e94581e53e34f
[]
no_license
hejuanz/hjz
90ff7ae163aff5b06ac9c4f5833a4e72f8920101
bd011c777a3ebe7b43f267a79769114fd53795b1
refs/heads/master
2020-06-28T04:50:18.046753
2017-07-13T07:21:28
2017-07-13T07:21:28
97,089,987
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package com.xsb.test; import com.jayway.restassured.RestAssured; import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Created by juanzhihe on 2017/7/13. */ public class ApiClientLogPostParamsTest { @Before public void before(){ RestAssured.baseURI = "http://10.100.62.205"; RestAssured.port = 80; //http默认端口为80,如有特殊端口可写具体定义的端口 } @Test /* URL地址为:http://10.100.62.205/api/client_log/new_batch,post方式 */ public void testGetParamsStartPage() { try { RestAssured.given() .param("aa", "1") .param("logs", "[{\"id\":50000,\"level\":1,\"date\":1499908268452,\"model\":1,\"place\":201}]") .param("session_id", "59546c8dedfe26460ac6e6cb") .param("vc", "040000") .post("/api/client_log/new_batch") .then() .assertThat() //状态相应码验证 .statusCode(200) //最外层数据类型及值验证 .body("msg", Matchers.equalTo("ok")) .body("result", Matchers.equalTo(1)) .body("code", Matchers.equalTo(1)); }finally { RestAssured.reset(); } } }
84de98dac65e725ce2ff4cc438ef5062a1fe057d
cea6f93feaff651e62a96c687e00fd1c446df2a9
/chapter_011springcars/src/main/java/ru/job4j/springmvc/config/RESTAuthenticationSuccessHandler.java
592343dc67042a573f01a41a98b33d1124bbc0eb
[ "Apache-2.0" ]
permissive
alexeremeev/aeremeev
732ce19d0a205da119c47ae0e894136b838e1fae
09a2a2e6a999df28502378da5747ebe8f7aff529
refs/heads/master
2021-01-19T17:26:53.877162
2018-05-20T09:51:40
2018-05-20T09:51:40
101,058,390
0
1
null
null
null
null
UTF-8
Java
false
false
782
java
package ru.job4j.springmvc.config; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler; import org.springframework.stereotype.Component; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @Component public class RESTAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuccessHandler { @Override public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { clearAuthenticationAttributes(request); } }
572e8408a6a7e5de5edba82e8f467e48e6873d78
5aa98cef51a09ed84ba45dc5f3b636a70790cf15
/src/main/java/de/appsist/commons/process/EventAnnotation.java
2d8016bcae898566b9ed58287d2436303ba7ea06
[]
no_license
APPsist/commons-process
a500250fc811f5264e7b678bdae5cdc8cdfcb7c1
9986ead48f8cb7ba595bc2c7fb2f1e2d7fba0e6c
refs/heads/master
2020-06-22T05:07:16.894900
2016-11-25T11:47:10
2016-11-25T11:47:10
74,754,192
0
1
null
null
null
null
UTF-8
Java
false
false
825
java
package de.appsist.commons.process; import java.util.Map; /** * Annotation for a event generated during the processing of a process element. * @author simon.schwantzer(at)im-c.de */ public interface EventAnnotation { /** * Type of the event. A event is either generated when the element becomes active or when is completed. * @author simon.schwantzer(at)im-c.de */ public enum Type { START, END } /** * Returns the ID of the event which is instantiated. * @return ID of a event model- */ public String getEventId(); /** * Returns the type of the event annotation. * @return Type of the event annotation. */ public Type getType(); /** * Returns the properties for the event. * @return (Recursive) map of keys and references. */ public Map<String, Object> getProperties(); }
4c6ce7195968f59a24b888ab8a3e3fe480a1bff0
843965272383b14817862104c548becd58f05e93
/clientes-api/src/main/java/io/github/ricardoaps72/clientes/rest/exception/ApiErrors.java
f02ff769a85cf3926ab7bfbda0d93c48ba1bd36d
[]
no_license
ricardoaps72/cliente-app
9de349c575728c14ec4f7170200ddc6276e10910
a07aefa5bed42d32e2d9ddef5a79ad98381e679e
refs/heads/master
2023-03-18T23:27:49.809328
2021-03-05T02:33:50
2021-03-05T02:33:50
315,776,126
0
0
null
null
null
null
UTF-8
Java
false
false
374
java
package io.github.ricardoaps72.clientes.rest.exception; import lombok.Getter; import java.util.Arrays; import java.util.List; public class ApiErrors { @Getter private List<String> errors; public ApiErrors(List<String> errors){ this.errors = errors; } public ApiErrors(String message){ this.errors = Arrays.asList(message); } }
6b26cae09db201c62fc351915357294d58fb5245
13d2524b800070f190b30d5b7157b7d90035e67c
/SpringBoot-Rest-Monolith-Sample/src/main/java/com/assetify/service/util/RandomUtil.java
b6a1a9c537259796eae800e197f336a08749480f
[]
no_license
jerrykurian/workshop
28a89a046d5f05dd2091fe4e6284902d097b3ae7
d05aa2a8868dfc931fbe24173f92425b1d80db36
refs/heads/master
2021-05-15T09:10:03.777881
2017-11-09T04:17:01
2017-11-09T04:17:01
108,004,132
0
2
null
null
null
null
UTF-8
Java
false
false
882
java
package com.assetify.service.util; import org.apache.commons.lang3.RandomStringUtils; /** * Utility class for generating random Strings. */ public final class RandomUtil { private static final int DEF_COUNT = 20; private RandomUtil() { } /** * Generate a password. * * @return the generated password */ public static String generatePassword() { return RandomStringUtils.randomAlphanumeric(DEF_COUNT); } /** * Generate an activation key. * * @return the generated activation key */ public static String generateActivationKey() { return RandomStringUtils.randomNumeric(DEF_COUNT); } /** * Generate a reset key. * * @return the generated reset key */ public static String generateResetKey() { return RandomStringUtils.randomNumeric(DEF_COUNT); } }
[ "jerrykurian" ]
jerrykurian
89034cef09ae76c6fd907b3390ef42ac8b861018
dbc3e4cb86739ca7e30c3ad7bd901ab4ab5c8cce
/12_02324_F13-Final/src/ase/SequenceHelper.java
02f498d445d9bf130ecd432d72669b2230459d10
[]
no_license
Modii/CDIO_Final
f3e6130be1d3f4ed7f743872c7314ebe9504ff5f
c50a8d756ed2f5192b5c78ed3a19aa1591cbd0de
refs/heads/master
2021-01-01T20:00:02.917892
2013-06-23T14:13:50
2013-06-23T14:13:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,931
java
package ase; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.IOException; import java.text.DecimalFormat; import java.util.Calendar; import java.util.List; import dao_interfaces.DALException; import db_mysqldao.MySQLReceptKompDAO; import dto.ReceptKompDTO; public class SequenceHelper { private MySQLReceptKompDAO mRecKomp = new MySQLReceptKompDAO(); private String dato, weightMsg, serverInput, itemName, userInput; private int oprID, pbID, receptID, rbID, raavareID, itemNoInput, itemNoStore; private double tara, netto, brutto, bruttoCheck, tolerance, totPosTol, totNegTol; private String[] splittedInput = new String[10]; private List<ReceptKompDTO> listen; public String generateDato(){ Calendar d = Calendar.getInstance(); DecimalFormat df = new DecimalFormat("00"); dato = d.get(Calendar.YEAR) + "-" + df.format(d.get(Calendar.MONTH) + 1) + "-" + df.format(d.get(Calendar.DATE)) + " " + df.format(d.get(Calendar.HOUR_OF_DAY)) + ":" + df.format(d.get(Calendar.MINUTE)) + ":" + df.format(d.get(Calendar.SECOND)); return dato; } public double trimDecimal(double d) { DecimalFormat df = new DecimalFormat("#.###"); String trimmed = (df.format(d)); String trimmed1 = trimmed.replace(',' , '.'); double trimmedTemp = Double.parseDouble(trimmed1); return trimmedTemp; } public int splitInt(BufferedReader inFromServer, DataOutputStream outToServer) throws IOException{ this.setSplittedInput(this.getServerInput().split(" ")); int returnSplitInt = Integer.parseInt(this.getSplittedInput()[2].replaceAll("\"","")); return returnSplitInt; } public double splitDouble(BufferedReader inFromServer, DataOutputStream outToServer) throws IOException{ this.setSplittedInput(this.getServerInput().split(" ")); double returnSplitDouble = (Double.parseDouble(this.getSplittedInput()[7])); return returnSplitDouble; } // Metoden tjekker hvilken type RM-kommando, der er tale om. Derefter kommer den krævede efterfulgte integerværdi og dernæst vægtbeskeden. public void RMPrintOgRead(int RMType, int x1, String weightMsg, BufferedReader inFromServer, DataOutputStream outToServer) throws IOException { this.setWeightMsg(weightMsg); if(RMType == 49) outToServer.writeBytes("RM49 " + x1 + " \"" + this.getWeightMsg() + "\"\r\n"); else if (RMType == 20) outToServer.writeBytes("RM20 " + x1 + " \"" + this.getWeightMsg() + "\" \" \" \"&3\"\r\n"); outToServer.flush(); this.setServerInput(inFromServer.readLine()); } public double getBrutto() { return brutto; } public void setBrutto(double brutto) { this.brutto = brutto; } public List<ReceptKompDTO> getListen() { return listen; } public void setListen(List<ReceptKompDTO> listen) { this.listen = listen; } public int getRbID() { return rbID; } public void setRbID(int rbID) { this.rbID = rbID; } public int getReceptID() { return receptID; } public void setReceptID(int receptID) { this.receptID = receptID; } public String getWeightMsg() { return weightMsg; } public void setWeightMsg(String weightMsg) { // System.out.println("setWeightMsg: " + weightMsg); this.weightMsg = weightMsg; } public int getOprID() { return oprID; } public void setOprID(int oprID) { this.oprID = oprID; } public String getServerInput() { return serverInput; } public void setServerInput(String serverInput) { //System.out.println("setServerInput: " + serverInput); this.serverInput = serverInput; } public String getItemName() { return itemName; } public void setItemName(String itemName) { this.itemName = itemName; } public String getUserInput() { return userInput; } public void setUserInput(String userInput) { this.userInput = userInput; } public int getItemNoInput() { return itemNoInput; } public void setItemNoInput(int itemNoInput) { this.itemNoInput = itemNoInput; } public int getItemNoStore() { return itemNoStore; } public void setItemNoStore(int iteNoStore) { this.itemNoStore = iteNoStore; } public String[] getSplittedInput() { return splittedInput; } public void setSplittedInput(String[] splittedInput) { this.splittedInput = splittedInput; } public double getTara() { return tara; } public void setTara(double tara) { this.tara = tara; } public double getNetto() { return netto; } public void setNetto(double netto) { this.netto = netto; } public double getBruttoCheck() { return bruttoCheck; } public void setBruttoCheck(double bruttoCheck) { this.bruttoCheck = bruttoCheck; } public int getPbID() { return pbID; } public void setPbID(int pbID) { this.pbID = pbID; } public int getRaavareID() { return raavareID; } public void setRaavareID(int raavareID) { this.raavareID = raavareID; } public double getTolerance() { return tolerance; } public void setTolerance() { try { tolerance = this.trimDecimal(((mRecKomp.getReceptKomp(this.getReceptID(), this.getRaavareID()).getNomNetto()) * (mRecKomp.getReceptKomp(this.getReceptID(), this.getRaavareID()).getTolerance()) / 100)); } catch (DALException e) { e.printStackTrace(); } } public double getTotPosTol() { return totPosTol; } public void setTotPosTol() { try { totPosTol = this.trimDecimal(((mRecKomp.getReceptKomp(this.getReceptID(), this.getRaavareID()).getNomNetto())) + this.getTolerance()); } catch (DALException e) { e.printStackTrace(); } } public double getTotNegTol() { return totNegTol; } public void setTotNegTol() { try { totNegTol = this.trimDecimal(((mRecKomp.getReceptKomp(this.getReceptID(), this.getRaavareID()).getNomNetto())) - this.getTolerance()); } catch (DALException e) { e.printStackTrace(); } } }
d4bdf2e7beec55c495c7867124b876bc5b5b8bc5
3ab0c599279515d8eea2cd06f10d5ffffcb8527e
/src/org/qihuasoft/core/util/reader/RtfReader.java
03c9058640c7aac843653fc29c3ac0f7018b3677
[]
no_license
stillywud/gdzc-1228
452455da57f2bcbe57195c315a259f4235a265f3
25f0aa58416bbc7779a60a145a70706b7d723277
refs/heads/master
2021-10-09T12:54:26.393355
2018-12-28T07:18:25
2018-12-28T07:18:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,272
java
package org.qihuasoft.core.util.reader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import javax.swing.text.BadLocationException; import javax.swing.text.DefaultStyledDocument; import javax.swing.text.rtf.RTFEditorKit; public class RtfReader { public RtfReader(){ } /** * @param filePath 文件路径 * @return 读出的rtf的内容 */ public String getTextFromRtf(String filePath) { String result = null; File file = new File(filePath); try { DefaultStyledDocument styledDoc = new DefaultStyledDocument(); InputStream is = new FileInputStream(file); new RTFEditorKit().read(is, styledDoc, 0); result = new String(styledDoc.getText(0,styledDoc.getLength()).getBytes("ISO8859_1")); //提取文本,读取中文需要使用ISO8859_1编码,否则会出现乱码 } catch (IOException e) { e.printStackTrace(); } catch (BadLocationException e) { e.printStackTrace(); } return result; } }
[ "yumang@" ]
yumang@
cdc6d74585df1cd9f4a3bc7342c9dd179957af64
bbec3e25b806708c012c04cd61e0134ac0827374
/week_8/day_1/homework/Calculator2/app/src/main/java/com/codeclan/com/calculator/CalculatorActivity.java
c9ff101ad8b9625a1b50812536fbb7c2e84714ed
[]
no_license
DanMcDonald91/Code-Clan-Work
9540d05d5c222d400061ca5da9da5bad9824de95
12cf67bb64be098545dc26343b265fbf67c390aa
refs/heads/master
2021-01-20T09:36:40.703806
2017-05-04T13:27:53
2017-05-04T13:27:53
90,266,397
0
0
null
null
null
null
UTF-8
Java
false
false
1,868
java
package com.codeclan.com.calculator; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class CalculatorActivity extends AppCompatActivity { EditText number1Text; EditText number2Text; Button addbtn; Button subBtn; Button multBtn; Button dvdBtn; Calculator calc; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_calculator); number1Text = (EditText) findViewById(R.id.number1EditText); number2Text = (EditText) findViewById(R.id.number2EditText); addbtn = (Button) findViewById(R.id.addBtn); subBtn = (Button) findViewById(R.id.subtractBtn); multBtn = (Button) findViewById(R.id.multiplyBtn); dvdBtn = (Button) findViewById(R.id.divideBtn); calc = new Calculator(); } public void onCalcButtonClick(View view){ int num1 = Integer.parseInt(number1Text.getText().toString()); int num2 = Integer.parseInt(number2Text.getText().toString()); int result = 0; switch (view.getId()) { case R.id.addBtn: result = calc.add(num1, num2); break; case R.id.subtractBtn: result = calc.subtract(num1, num2); break; case R.id.multiplyBtn: result = calc.multiply(num1, num2); break; case R.id.divideBtn: result = calc.divide(num1, num2); break; } Intent intent = new Intent(CalculatorActivity.this, ResultActivity.class); intent.putExtra("answer", result); startActivity(intent); } }
aeb9353b1fef12a13508893d3017d6d98effc328
e7e497b20442a4220296dea1550091a457df5a38
/main_project/XSB/thriftex/java/src/com/renren/thriftex/xmq/Message.java
7e746fa5d56b10f118935606d85efc9c8bb87c1d
[]
no_license
gunner14/old_rr_code
cf17a2dedf8dfcdcf441d49139adaadc770c0eea
bb047dc88fa7243ded61d840af0f8bad22d68dee
refs/heads/master
2021-01-17T18:23:28.154228
2013-12-02T23:45:33
2013-12-02T23:45:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,672
java
package com.renren.thriftex.xmq; // ---------------------------------------- // Message format // ---------------------------------------- // | opCode | SequenceID | DataLen | Data | // | 1 Byte | 8 Byte | 2 Byte | < 16M | public class Message { public byte opCode; public long seqID; public byte[] data; public static final int Meta_Len = 11; public static byte[] packMessage(byte opCode, long seqID, byte[] data, int len) { byte [] result = new byte[Meta_Len + len]; int off = 0; // opCode result[off] = opCode; // seqID result[off + 1] = (byte)(0xff & (seqID >> 56)); result[off + 2] = (byte)(0xff & (seqID >> 48)); result[off + 3] = (byte)(0xff & (seqID >> 40)); result[off + 4] = (byte)(0xff & (seqID >> 32)); result[off + 5] = (byte)(0xff & (seqID >> 24)); result[off + 6] = (byte)(0xff & (seqID >> 16)); result[off + 7] = (byte)(0xff & (seqID >> 8)); result[off + 8] = (byte)(0xff & (seqID)); // dataLen result[off + 9] = (byte)(0xff & (len>> 8)); result[off + 10] = (byte)(0xff & (len)); // data off = 11; for (int i = 0; i < len; i++) { result[off++] = data[i]; } return result; } public static Message unpackMessage(byte[] buf) { Message message = new Message(); int off = 1; message.opCode = buf[0]; message.seqID = ((long)(buf[off] & 0xff) << 56) | ((long)(buf[off+1] & 0xff) << 48) | ((long)(buf[off+2] & 0xff) << 40) | ((long)(buf[off+3] & 0xff) << 32) | ((long)(buf[off+4] & 0xff) << 24) | ((long)(buf[off+5] & 0xff) << 16) | ((long)(buf[off+6] & 0xff) << 8) | ((long)(buf[off+7] & 0xff)); int dataLen = (short)(((buf[off+8] & 0xff) << 8) | ((buf[off+9] & 0xff))); if (dataLen != buf.length - Meta_Len) { message.opCode = Constant.INVALID_MESSAGE; return message; } message.data = new byte[dataLen]; for (int i = 0; i < dataLen; i++) { message.data[i] = buf[Meta_Len + i]; } return message; } @Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("opcode: [").append(opCode); sb.append("] | seqID: [").append(seqID).append("]\n"); return sb.toString(); } }
93829e5565eb3eb91435c86a627ea0f12d2fa9ec
ed15e568fa8f3f514fa80cc48a4f4c0284e5782c
/src/xupt/se/ttms/view/sellticket/SellTicketUI.java
4edc41bbc679d1eb5b25aa84e8f5cf99114b8d9f
[]
no_license
TheCoderWw/TTMS-GUI
c6c57dd3ef662d138afdef67a5b2b76038d4d35f
8eefc1d3885d1db275641c6abd2e6a70c335ca0e
refs/heads/master
2020-04-13T04:13:04.982900
2018-12-24T05:52:44
2018-12-24T05:52:44
162,954,809
1
1
null
null
null
null
UTF-8
Java
false
false
10,301
java
package xupt.se.ttms.view.sellticket; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JOptionPane; import xupt.se.ttms.model.Sale; import xupt.se.ttms.model.SaleItem; import xupt.se.ttms.model.Schedule; import xupt.se.ttms.model.Seat; import xupt.se.ttms.model.Ticket; import xupt.se.ttms.model.User; import xupt.se.ttms.service.DictSrv; import xupt.se.ttms.service.LoginedUser; import xupt.se.ttms.service.PlaySrv; import xupt.se.ttms.service.SaleItemSrv; import xupt.se.ttms.service.SaleSrv; import xupt.se.ttms.service.ScheduleSrv; import xupt.se.ttms.service.SeatSrv; import xupt.se.ttms.service.TicketSrv; import xupt.se.ttms.service.UserSrv; import xupt.se.ttms.view.nowshowing.NowShowingUI; import xupt.se.ttms.view.seat.SeatSelectUI; import xupt.se.ttms.view.tmpl.PopUITmpl; import xupt.se.util.MouseListerDemo; //传入 选中座位id,schedid; public class SellTicketUI extends PopUITmpl { private static final long serialVersionUID = 1L; private JLabel ticketInfo = new JLabel("电影信息:"); private JLabel nowBuying = new JLabel("已选座位:"); private JLabel nowSeatInfo = new JLabel(); private JLabel tkInfo = new JLabel(); private JLabel time = new JLabel(); private JLabel allMoney = new JLabel(); private JButton yes = new JButton("确认支付"); private JButton no = new JButton("取消支付"); private Seat seat; protected int sched_id; private Schedule schedule; private ScheduleSrv scheduleSrv; private PlaySrv playSrv; private DictSrv dictSrv; private Sale saleLog; public Sale createSaleLog(int user_id, int pay) { // 获取当前时间 Calendar now = Calendar.getInstance(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String nowTime = df.format(now.getTime()); Sale saleNow = new Sale(user_id, nowTime, pay); return saleNow; } public Ticket createTicketLog(int sched_id, int seat_id) { // 获取当前时间 Calendar now = Calendar.getInstance(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String nowTime = df.format(now.getTime()); ScheduleSrv schedSrv = new ScheduleSrv(); Double price = schedSrv.Fetch("sched_id = " + sched_id).get(0).getSched_ticket_price(); Ticket ticketNow = new Ticket(sched_id, seat_id, price, nowTime); return ticketNow; } // Set<ticket> public SellTicketUI(Set<Ticket> ticketSet) { SeatSrv seatSrv = new SeatSrv(); Seat seat = new Seat(); Ticket ticket = new Ticket(); // Schedule schedule = new Schedule(); // Set<Ticket> 迭代器 Iterator<Ticket> itTicket1 = ticketSet.iterator(); // 随意获取一张票的信息 ticket = itTicket1.next(); // 接收schedId int schedId = ticket.getSched_id(); Iterator<Ticket> itTicket = ticketSet.iterator(); Set<Seat> seatSet = new HashSet<Seat>(); List<Seat> seatList = new ArrayList<Seat>(); while (itTicket.hasNext()) { Ticket ticketNow = itTicket.next(); seat = seatSrv.Fetch("seat_id = " + ticketNow.getSeat_id() + ";").get(0); // seatSrv.Fetch(condt)ticketNow.getSeat_id() seatSet.add(seat); } // List<Seat> seatList = seatSrv.Fetch("seat_id = " +ticket.getSeat_id()+";"); scheduleSrv = new ScheduleSrv(); playSrv = new PlaySrv(); dictSrv = new DictSrv(); this.sched_id = schedId; // 获取当前演出计划的所有信息List List<Schedule> schedList = scheduleSrv.Fetch("sched_id = " + schedId + ";"); schedule = schedList.get(0); // this.setSize(800, 600); this.setTitle("购票"); ticketInfo.setForeground(Color.WHITE); ticketInfo.setFont(new java.awt.Font("宋体", 1, 20)); ticketInfo.setBounds(100, 50, 100, 30); tkInfo.setForeground(Color.WHITE); tkInfo.setFont(new java.awt.Font("宋体", 1, 20)); tkInfo.setBounds(210, 50, 500, 30); String tickTem = ""; schedule = schedList.get(0); tickTem += playSrv.Fetch("play_id = " + schedule.getPlay_id() + ";").get(0).getPlay_name(); tickTem += " 时长:" + playSrv.Fetch("play_id = " + schedule.getPlay_id() + ";").get(0).getPlay_length(); tickTem += " 语言:" + dictSrv.FetchByID(playSrv.Fetch("play_id = " + schedule.getPlay_id() + ";").get(0).getLang_id()) .get(0).getDict_value(); time.setText("上映时间:" + schedule.getSched_time()); time.setForeground(Color.WHITE); time.setFont(new java.awt.Font("宋体", 1, 20)); time.setBounds(100, 100, 500, 30); tkInfo.setText(tickTem); nowBuying.setForeground(Color.WHITE); nowBuying.setFont(new java.awt.Font("宋体", 1, 20)); nowBuying.setBounds(100, 150, 100, 30); Iterator<Seat> itSeat = seatSet.iterator(); String tem = ""; while (itSeat.hasNext()) { seat = itSeat.next(); tem = tem + seat.getRow() + "排" + seat.getColumn() + "座 . "; } tem += "单价:" + schedule.getSched_ticket_price(); nowSeatInfo.setText(tem); nowSeatInfo.setForeground(Color.WHITE); nowSeatInfo.setFont(new java.awt.Font("宋体", 1, 20)); nowSeatInfo.setBounds(210, 150, 500, 30); allMoney.setForeground(Color.WHITE); allMoney.setFont(new java.awt.Font("宋体", 1, 20)); allMoney.setBounds(100, 200, 500, 30); allMoney.setText("总价 :" + schedule.getSched_ticket_price() * seatSet.size()); yes.setForeground(Color.YELLOW); yes.setFont(new java.awt.Font("宋体", 1, 15)); yes.setBounds(100, 300, 100, 30); yes.setContentAreaFilled(false); // 设置为false让button透明; yes.setFocusable(false); MouseListerDemo.setMouseLister(yes); yes.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { Date dateTime; Iterator<Ticket> ittem = ticketSet.iterator(); Ticket tk1 = ittem.next(); SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { // 获取当前票的加锁时间 dateTime = sim.parse(tk1.getTicket_locked_time()); // 计算该加锁时间+10分钟后的时间 long curren = dateTime.getTime(); curren += 10 * 60 * 1000; Date da = new Date(curren); if (da.before(new Date())) { JOptionPane.showMessageDialog(null, "该票锁定时间已过"); new NowShowingUI().setVisible(true); setVisible(false); } else { btnYesClicked(ticketSet); } } catch (Exception e) { System.out.println(e.getMessage()); } } }); no.setForeground(Color.YELLOW); no.setFont(new java.awt.Font("宋体", 1, 15)); no.setBounds(250, 300, 100, 30); no.setContentAreaFilled(false); // 设置为false让button透明; no.setFocusable(false); MouseListerDemo.setMouseLister(no); no.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { Date dateTime; Iterator<Ticket> ittem = ticketSet.iterator(); Ticket tk1 = ittem.next(); SimpleDateFormat sim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { // 获取当前票的加锁时间 dateTime = sim.parse(tk1.getTicket_locked_time()); // 计算该加锁时间+10分钟后的时间 long curren = dateTime.getTime(); curren += 10 * 60 * 1000; Date da = new Date(curren); if (da.before(new Date())) { JOptionPane.showMessageDialog(null, "该票锁定时间已过"); new NowShowingUI().setVisible(true); setVisible(false); } else { Iterator<Ticket> it = ticketSet.iterator(); while (it.hasNext()) { Ticket ticket = new Ticket(); ticket = it.next(); ticket.setTicket_status(0); TicketSrv ticketSrv = new TicketSrv(); ticketSrv.modify(ticket); } JOptionPane.showMessageDialog(null, "用户取消支付"); SeatSelectUI seatSelect = new SeatSelectUI(sched_id); seatSelect.initCd(); seatSelect.setVisible(true); setVisible(false); } } catch (Exception e) { System.out.println(e.getMessage()); } } }); contPan.add(nowBuying); contPan.add(nowSeatInfo); contPan.add(ticketInfo); contPan.add(tkInfo); contPan.add(allMoney); contPan.add(yes); contPan.add(no); contPan.add(time); } public void btnYesClicked(Set<Ticket> ticketSet) { if (LoginedUser.getInstance().getUserMoney() >= (int) schedule.getSched_ticket_price() * ticketSet.size()) { int nowMoney = LoginedUser.getInstance().getUserMoney() - (int) schedule.getSched_ticket_price() * ticketSet.size(); User user = new User(); UserSrv userSrv = new UserSrv(); user.setUserMoney(nowMoney); user.setUserName(LoginedUser.getInstance().getEmpName()); user.setPassWord(LoginedUser.getInstance().getPassWord()); if (userSrv.update(user)) { Iterator<Ticket> it = ticketSet.iterator(); while (it.hasNext()) { Ticket ticket = new Ticket(); ticket = it.next(); ticket.setTicket_locked_time(schedule.getSched_time()); ticket.setTicket_status(2); // SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 设置日期格式 // System.out.println(df.format(new Date())); // ticket.setTicket_locked_time(df.format(new Date())); TicketSrv ticketSrv = new TicketSrv(); ticketSrv.modify(ticket); } JOptionPane.showMessageDialog(null, "购买成功,祝您观影愉快!" + ""); LoginedUser.getInstance().setUserMoney(user.getUserMoney()); // 初始化一个sale对象,存储当前的交易记录 saleLog = createSaleLog(LoginedUser.getInstance().getUserID(), (int) schedule.getSched_ticket_price() * ticketSet.size()); new SaleSrv().add(saleLog); new NowShowingUI().setVisible(true); setVisible(false); } // 数据操作 for (Ticket s : ticketSet) { // 链接票与交易记录 SaleItem saleItemNow = new SaleItem(); saleItemNow.setSale_ID(saleLog.getSale_ID()); saleItemNow.setTicket_id(s.getTicket_id()); saleItemNow.setSale_item_price(schedule.getSched_ticket_price()); new SaleItemSrv().add(saleItemNow); } } else { JOptionPane.showMessageDialog(null, "余额不足,请充值"); } } }
676d661dfb6fe2faa51fecd46edcc1daba14f48e
a370ff524a6e317488970dac65d93a727039f061
/archive/unsorted/2021.01/2021.01.08 - CSES - CSES Problem Set/BracketSequencesII.java
704cfc981cc5871e255b2cbb281f31a4ab0897c0
[]
no_license
taodaling/contest
235f4b2a033ecc30ec675a4526e3f031a27d8bbf
86824487c2e8d4fc405802fff237f710f4e73a5c
refs/heads/master
2023-04-14T12:41:41.718630
2023-04-10T14:12:47
2023-04-10T14:12:47
213,876,299
9
1
null
2021-06-12T06:33:05
2019-10-09T09:28:43
Java
UTF-8
Java
false
false
1,150
java
package contest; import template.io.FastInput; import template.io.FastOutput; import template.math.Combination; import template.math.DigitUtils; public class BracketSequencesII { int mod = (int) 1e9 + 7; Combination comb = new Combination((int) 1e6, mod); public void solve(int testNumber, FastInput in, FastOutput out) { int n = in.ri(); char[] s = new char[(int) 1e6]; int k = in.rs(s, 0); if (n % 2 == 1) { out.println(0); return; } int sum = 0; int half = n / 2; int a = half; int b = half; for (int i = 0; i < k; i++) { if (s[i] == '(') { sum++; a--; } else { sum--; b--; } if (sum < 0) { out.println(0); return; } } if(a < 0 || b < 0){ out.println(0); return; } int ans = comb.combination(a + b, a) - comb.combination(a + b, a + 1 + sum); ans = DigitUtils.mod(ans, mod); out.println(ans); } }
c1779133304e4aefded676748727d825a20b0baf
5df89447cf1a5528c6cdc2fef12ea67f36384c2d
/app/src/main/java/com/jacstuff/musicplayer/service/db/DbHelper.java
12c4d0f5e47925bf635a11c16d4ac3d3ca7b761c
[]
no_license
johncrawley/MusicPlayer
9cf7c452bdab74322338f5b9e701c8895bec4969
5b17aaeee9600717e99ca5697c4dd6f4745aa6a0
refs/heads/master
2023-07-09T15:09:29.832600
2023-06-30T22:52:57
2023-06-30T22:52:57
180,191,347
0
0
null
null
null
null
UTF-8
Java
false
false
6,258
java
package com.jacstuff.musicplayer.service.db; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class DbHelper extends SQLiteOpenHelper { private static DbHelper instance; // If you change the database schema, you must increment the database version. private static final int DATABASE_VERSION = 3; private static final String DATABASE_NAME = "MusicPlayer.db"; private static final String OPENING_BRACKET = " ("; private static final String CLOSING_BRACKET = " );"; private static final String INTEGER = " INTEGER"; private static final String TEXT = " TEXT"; private static final String BLOB = " BLOB"; private static final String COMMA = ","; public static final String UNIQUE = " UNIQUE "; private static final String PRIMARY_KEY = " PRIMARY KEY"; private static final String CREATE_TABLE_IF_NOT_EXISTS = "CREATE TABLE IF NOT EXISTS "; private static final String SQL_CREATE_TRACKS_TABLE = CREATE_TABLE_IF_NOT_EXISTS + DbContract.TracksEntry.TABLE_NAME + OPENING_BRACKET + DbContract.TracksEntry._ID + INTEGER + PRIMARY_KEY + COMMA + DbContract.TracksEntry.COL_TITLE + TEXT + COMMA + DbContract.TracksEntry.COL_PATH + TEXT + COMMA + DbContract.TracksEntry.COL_ALBUM + TEXT + COMMA + DbContract.TracksEntry.COL_ALBUM_ID + TEXT + COMMA + DbContract.TracksEntry.COL_ARTIST + TEXT + COMMA + DbContract.TracksEntry.COL_ARTIST_ID + INTEGER + COMMA + DbContract.TracksEntry.COL_TRACK_NUMBER + INTEGER + COMMA + DbContract.TracksEntry.COL_DURATION + INTEGER + COMMA + DbContract.TracksEntry.COL_GENRE + TEXT + CLOSING_BRACKET; private static final String SQL_CREATE_PLAYLIST_TABLE = CREATE_TABLE_IF_NOT_EXISTS + DbContract.PlaylistEntry.TABLE_NAME + OPENING_BRACKET + DbContract.PlaylistEntry._ID + INTEGER + PRIMARY_KEY + COMMA + DbContract.PlaylistEntry.COL_NAME + TEXT + CLOSING_BRACKET; private static final String SQL_CREATE_ARTISTS_TABLE = CREATE_TABLE_IF_NOT_EXISTS + DbContract.ArtistsEntry.TABLE_NAME + OPENING_BRACKET + DbContract.ArtistsEntry._ID + INTEGER + PRIMARY_KEY + COMMA + DbContract.ArtistsEntry.COL_NAME + TEXT + CLOSING_BRACKET; private static final String SQL_CREATE_ALBUMS_TABLE = CREATE_TABLE_IF_NOT_EXISTS + DbContract.AlbumsEntry.TABLE_NAME + OPENING_BRACKET + DbContract.AlbumsEntry._ID + INTEGER + PRIMARY_KEY + COMMA + DbContract.AlbumsEntry.COL_NAME + TEXT + CLOSING_BRACKET; private static final String PLAYLISTS_TABLE_PRIMARY_KEY = DbContract.PlaylistEntry.TABLE_NAME + "." + DbContract.PlaylistEntry._ID; private static final String SQL_CREATE_PLAYLIST_ITEMS_TABLE = CREATE_TABLE_IF_NOT_EXISTS + DbContract.PlaylistItemsEntry.TABLE_NAME + OPENING_BRACKET + DbContract.PlaylistItemsEntry._ID + INTEGER + PRIMARY_KEY + COMMA + DbContract.PlaylistItemsEntry.COL_PLAYLIST_ID + INTEGER + " REFERENCES " + DbContract.PlaylistEntry.TABLE_NAME + "(" + DbContract.PlaylistEntry._ID + ") ON DELETE CASCADE" + COMMA + DbContract.PlaylistItemsEntry.COL_INDEX + INTEGER + COMMA + DbContract.PlaylistItemsEntry.COL_PATH + TEXT + COMMA + DbContract.PlaylistItemsEntry.COL_TITLE + TEXT + COMMA + DbContract.PlaylistItemsEntry.COL_ALBUM + TEXT + COMMA + DbContract.PlaylistItemsEntry.COL_ALBUM_ID + INTEGER + COMMA + DbContract.PlaylistItemsEntry.COL_ARTIST + TEXT + COMMA + DbContract.PlaylistItemsEntry.COL_ARTIST_ID + INTEGER + COMMA + DbContract.PlaylistItemsEntry.COL_TRACK_NUMBER + INTEGER + COMMA + DbContract.PlaylistItemsEntry.COL_GENRE + TEXT + COMMA + DbContract.PlaylistItemsEntry.COL_DURATION + INTEGER + CLOSING_BRACKET; /* + " CONSTRAINT fk_playlists " + " FOREIGN KEY (" + PlaylistItemsEntry.COL_PLAYLIST_ID + ")" + " REFERENCES " + PlaylistEntry.TABLE_NAME + "(" + PlaylistEntry._ID + ")" + " ON DELETE CASCADE " */ private DbHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } public static DbHelper getInstance(Context context) { if (instance == null) { instance = new DbHelper(context); } return instance; } public void onCreate(SQLiteDatabase db) { db.execSQL(SQL_CREATE_TRACKS_TABLE); db.execSQL(SQL_CREATE_PLAYLIST_TABLE); db.execSQL(SQL_CREATE_PLAYLIST_ITEMS_TABLE); db.execSQL(SQL_CREATE_ARTISTS_TABLE); db.execSQL(SQL_CREATE_ALBUMS_TABLE); } public void dropAndRecreateTracksArtistsAndAlbumsTables(SQLiteDatabase db){ dropTable(DbContract.TracksEntry.TABLE_NAME, db); dropTable(DbContract.ArtistsEntry.TABLE_NAME, db); dropTable(DbContract.AlbumsEntry.TABLE_NAME, db); db.execSQL(SQL_CREATE_TRACKS_TABLE); db.execSQL(SQL_CREATE_ARTISTS_TABLE); db.execSQL(SQL_CREATE_ALBUMS_TABLE); } private void dropTable(String tableName, SQLiteDatabase db){ db.execSQL("DROP TABLE " + tableName + ";"); } public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { //db.execSQL(SQL_DELETE_ENTRIES); onCreate(db); } public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { onUpgrade(db, oldVersion, newVersion); } }
f4298dc1d4768460708bfdc2556e0dbff7b3c47a
ce5a87321d7efde6e9f80b53b434c005b0d6606a
/src/main/java/io/github/jhipster/test_app/domain/Entry.java
1c469b05da91d30129f54a47cbbdbfc2392b9644
[]
no_license
leonelngande/jhipsterTestApp
2a355a212f3f78d70e64c990ff5d6c14e09594a2
4fd6c38ca5db8085ece80ddf56d6b8898c86e652
refs/heads/master
2020-03-21T15:34:57.378930
2018-06-26T15:18:49
2018-06-26T15:18:49
138,721,136
0
0
null
2018-06-26T15:18:50
2018-06-26T10:15:07
Java
UTF-8
Java
false
false
3,830
java
package io.github.jhipster.test_app.domain; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import javax.persistence.*; import javax.validation.constraints.*; import java.io.Serializable; import java.time.Instant; import java.util.HashSet; import java.util.Set; import java.util.Objects; /** * A Entry. */ @Entity @Table(name = "entry") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class Entry implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotNull @Column(name = "title", nullable = false) private String title; @Lob @Column(name = "content") private String content; @NotNull @Column(name = "_date", nullable = false) private Instant date; @ManyToOne @JsonIgnoreProperties("") private Blog blog; @ManyToMany @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @JoinTable(name = "entry_tag", joinColumns = @JoinColumn(name = "entries_id", referencedColumnName = "id"), inverseJoinColumns = @JoinColumn(name = "tags_id", referencedColumnName = "id")) private Set<Tag> tags = new HashSet<>(); // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitle() { return title; } public Entry title(String title) { this.title = title; return this; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public Entry content(String content) { this.content = content; return this; } public void setContent(String content) { this.content = content; } public Instant getDate() { return date; } public Entry date(Instant date) { this.date = date; return this; } public void setDate(Instant date) { this.date = date; } public Blog getBlog() { return blog; } public Entry blog(Blog blog) { this.blog = blog; return this; } public void setBlog(Blog blog) { this.blog = blog; } public Set<Tag> getTags() { return tags; } public Entry tags(Set<Tag> tags) { this.tags = tags; return this; } public Entry addTag(Tag tag) { this.tags.add(tag); tag.getEntries().add(this); return this; } public Entry removeTag(Tag tag) { this.tags.remove(tag); tag.getEntries().remove(this); return this; } public void setTags(Set<Tag> tags) { this.tags = tags; } // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Entry entry = (Entry) o; if (entry.getId() == null || getId() == null) { return false; } return Objects.equals(getId(), entry.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override public String toString() { return "Entry{" + "id=" + getId() + ", title='" + getTitle() + "'" + ", content='" + getContent() + "'" + ", date='" + getDate() + "'" + "}"; } }
2a3adc63b212d3d058024a9683cae762d2f3b232
d8d7b08b22da22351aa0ee7b1262c07754b33ea1
/CustomListView/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/appcompat/R.java
e46ca174688a247a0749d8d7c37a77c2d6b9990b
[]
no_license
alyawilmiakbar/ListView
8974c07a66e6db431667e8d5c80add048cf83bd3
51a63baf9faccd16db6aa591b89959876f82ffe2
refs/heads/master
2020-08-17T01:41:39.515130
2019-10-16T16:00:07
2019-10-16T16:00:07
215,549,281
0
0
null
null
null
null
UTF-8
Java
false
false
127,006
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.appcompat; public final class R { private R() {} public static final class anim { private anim() {} public static final int abc_fade_in = 0x7f010000; public static final int abc_fade_out = 0x7f010001; public static final int abc_grow_fade_in_from_bottom = 0x7f010002; public static final int abc_popup_enter = 0x7f010003; public static final int abc_popup_exit = 0x7f010004; public static final int abc_shrink_fade_out_from_bottom = 0x7f010005; public static final int abc_slide_in_bottom = 0x7f010006; public static final int abc_slide_in_top = 0x7f010007; public static final int abc_slide_out_bottom = 0x7f010008; public static final int abc_slide_out_top = 0x7f010009; public static final int abc_tooltip_enter = 0x7f01000a; public static final int abc_tooltip_exit = 0x7f01000b; public static final int btn_checkbox_to_checked_box_inner_merged_animation = 0x7f01000c; public static final int btn_checkbox_to_checked_box_outer_merged_animation = 0x7f01000d; public static final int btn_checkbox_to_checked_icon_null_animation = 0x7f01000e; public static final int btn_checkbox_to_unchecked_box_inner_merged_animation = 0x7f01000f; public static final int btn_checkbox_to_unchecked_check_path_merged_animation = 0x7f010010; public static final int btn_checkbox_to_unchecked_icon_null_animation = 0x7f010011; public static final int btn_radio_to_off_mtrl_dot_group_animation = 0x7f010012; public static final int btn_radio_to_off_mtrl_ring_outer_animation = 0x7f010013; public static final int btn_radio_to_off_mtrl_ring_outer_path_animation = 0x7f010014; public static final int btn_radio_to_on_mtrl_dot_group_animation = 0x7f010015; public static final int btn_radio_to_on_mtrl_ring_outer_animation = 0x7f010016; public static final int btn_radio_to_on_mtrl_ring_outer_path_animation = 0x7f010017; } public static final class attr { private attr() {} public static final int actionBarDivider = 0x7f020000; public static final int actionBarItemBackground = 0x7f020001; public static final int actionBarPopupTheme = 0x7f020002; public static final int actionBarSize = 0x7f020003; public static final int actionBarSplitStyle = 0x7f020004; public static final int actionBarStyle = 0x7f020005; public static final int actionBarTabBarStyle = 0x7f020006; public static final int actionBarTabStyle = 0x7f020007; public static final int actionBarTabTextStyle = 0x7f020008; public static final int actionBarTheme = 0x7f020009; public static final int actionBarWidgetTheme = 0x7f02000a; public static final int actionButtonStyle = 0x7f02000b; public static final int actionDropDownStyle = 0x7f02000c; public static final int actionLayout = 0x7f02000d; public static final int actionMenuTextAppearance = 0x7f02000e; public static final int actionMenuTextColor = 0x7f02000f; public static final int actionModeBackground = 0x7f020010; public static final int actionModeCloseButtonStyle = 0x7f020011; public static final int actionModeCloseDrawable = 0x7f020012; public static final int actionModeCopyDrawable = 0x7f020013; public static final int actionModeCutDrawable = 0x7f020014; public static final int actionModeFindDrawable = 0x7f020015; public static final int actionModePasteDrawable = 0x7f020016; public static final int actionModePopupWindowStyle = 0x7f020017; public static final int actionModeSelectAllDrawable = 0x7f020018; public static final int actionModeShareDrawable = 0x7f020019; public static final int actionModeSplitBackground = 0x7f02001a; public static final int actionModeStyle = 0x7f02001b; public static final int actionModeWebSearchDrawable = 0x7f02001c; public static final int actionOverflowButtonStyle = 0x7f02001d; public static final int actionOverflowMenuStyle = 0x7f02001e; public static final int actionProviderClass = 0x7f02001f; public static final int actionViewClass = 0x7f020020; public static final int activityChooserViewStyle = 0x7f020021; public static final int alertDialogButtonGroupStyle = 0x7f020022; public static final int alertDialogCenterButtons = 0x7f020023; public static final int alertDialogStyle = 0x7f020024; public static final int alertDialogTheme = 0x7f020025; public static final int allowStacking = 0x7f020026; public static final int alpha = 0x7f020027; public static final int alphabeticModifiers = 0x7f020028; public static final int arrowHeadLength = 0x7f020029; public static final int arrowShaftLength = 0x7f02002a; public static final int autoCompleteTextViewStyle = 0x7f02002b; public static final int autoSizeMaxTextSize = 0x7f02002c; public static final int autoSizeMinTextSize = 0x7f02002d; public static final int autoSizePresetSizes = 0x7f02002e; public static final int autoSizeStepGranularity = 0x7f02002f; public static final int autoSizeTextType = 0x7f020030; public static final int background = 0x7f020031; public static final int backgroundSplit = 0x7f020032; public static final int backgroundStacked = 0x7f020033; public static final int backgroundTint = 0x7f020034; public static final int backgroundTintMode = 0x7f020035; public static final int barLength = 0x7f020036; public static final int borderlessButtonStyle = 0x7f020039; public static final int buttonBarButtonStyle = 0x7f02003a; public static final int buttonBarNegativeButtonStyle = 0x7f02003b; public static final int buttonBarNeutralButtonStyle = 0x7f02003c; public static final int buttonBarPositiveButtonStyle = 0x7f02003d; public static final int buttonBarStyle = 0x7f02003e; public static final int buttonCompat = 0x7f02003f; public static final int buttonGravity = 0x7f020040; public static final int buttonIconDimen = 0x7f020041; public static final int buttonPanelSideLayout = 0x7f020042; public static final int buttonStyle = 0x7f020043; public static final int buttonStyleSmall = 0x7f020044; public static final int buttonTint = 0x7f020045; public static final int buttonTintMode = 0x7f020046; public static final int checkboxStyle = 0x7f020048; public static final int checkedTextViewStyle = 0x7f020049; public static final int closeIcon = 0x7f02004a; public static final int closeItemLayout = 0x7f02004b; public static final int collapseContentDescription = 0x7f02004c; public static final int collapseIcon = 0x7f02004d; public static final int color = 0x7f02004e; public static final int colorAccent = 0x7f02004f; public static final int colorBackgroundFloating = 0x7f020050; public static final int colorButtonNormal = 0x7f020051; public static final int colorControlActivated = 0x7f020052; public static final int colorControlHighlight = 0x7f020053; public static final int colorControlNormal = 0x7f020054; public static final int colorError = 0x7f020055; public static final int colorPrimary = 0x7f020056; public static final int colorPrimaryDark = 0x7f020057; public static final int colorSwitchThumbNormal = 0x7f020058; public static final int commitIcon = 0x7f020059; public static final int contentDescription = 0x7f02005d; public static final int contentInsetEnd = 0x7f02005e; public static final int contentInsetEndWithActions = 0x7f02005f; public static final int contentInsetLeft = 0x7f020060; public static final int contentInsetRight = 0x7f020061; public static final int contentInsetStart = 0x7f020062; public static final int contentInsetStartWithNavigation = 0x7f020063; public static final int controlBackground = 0x7f020064; public static final int customNavigationLayout = 0x7f020065; public static final int defaultQueryHint = 0x7f020066; public static final int dialogCornerRadius = 0x7f020067; public static final int dialogPreferredPadding = 0x7f020068; public static final int dialogTheme = 0x7f020069; public static final int displayOptions = 0x7f02006a; public static final int divider = 0x7f02006b; public static final int dividerHorizontal = 0x7f02006c; public static final int dividerPadding = 0x7f02006d; public static final int dividerVertical = 0x7f02006e; public static final int drawableBottomCompat = 0x7f02006f; public static final int drawableEndCompat = 0x7f020070; public static final int drawableLeftCompat = 0x7f020071; public static final int drawableRightCompat = 0x7f020072; public static final int drawableSize = 0x7f020073; public static final int drawableStartCompat = 0x7f020074; public static final int drawableTint = 0x7f020075; public static final int drawableTintMode = 0x7f020076; public static final int drawableTopCompat = 0x7f020077; public static final int drawerArrowStyle = 0x7f020078; public static final int dropDownListViewStyle = 0x7f020079; public static final int dropdownListPreferredItemHeight = 0x7f02007a; public static final int editTextBackground = 0x7f02007b; public static final int editTextColor = 0x7f02007c; public static final int editTextStyle = 0x7f02007d; public static final int elevation = 0x7f02007e; public static final int expandActivityOverflowButtonDrawable = 0x7f020080; public static final int firstBaselineToTopHeight = 0x7f020081; public static final int font = 0x7f020082; public static final int fontFamily = 0x7f020083; public static final int fontProviderAuthority = 0x7f020084; public static final int fontProviderCerts = 0x7f020085; public static final int fontProviderFetchStrategy = 0x7f020086; public static final int fontProviderFetchTimeout = 0x7f020087; public static final int fontProviderPackage = 0x7f020088; public static final int fontProviderQuery = 0x7f020089; public static final int fontStyle = 0x7f02008a; public static final int fontVariationSettings = 0x7f02008b; public static final int fontWeight = 0x7f02008c; public static final int gapBetweenBars = 0x7f02008d; public static final int goIcon = 0x7f02008e; public static final int height = 0x7f02008f; public static final int hideOnContentScroll = 0x7f020090; public static final int homeAsUpIndicator = 0x7f020091; public static final int homeLayout = 0x7f020092; public static final int icon = 0x7f020093; public static final int iconTint = 0x7f020094; public static final int iconTintMode = 0x7f020095; public static final int iconifiedByDefault = 0x7f020096; public static final int imageButtonStyle = 0x7f020097; public static final int indeterminateProgressStyle = 0x7f020098; public static final int initialActivityCount = 0x7f020099; public static final int isLightTheme = 0x7f02009a; public static final int itemPadding = 0x7f02009b; public static final int lastBaselineToBottomHeight = 0x7f02009c; public static final int layout = 0x7f02009d; public static final int lineHeight = 0x7f0200d0; public static final int listChoiceBackgroundIndicator = 0x7f0200d1; public static final int listChoiceIndicatorMultipleAnimated = 0x7f0200d2; public static final int listChoiceIndicatorSingleAnimated = 0x7f0200d3; public static final int listDividerAlertDialog = 0x7f0200d4; public static final int listItemLayout = 0x7f0200d5; public static final int listLayout = 0x7f0200d6; public static final int listMenuViewStyle = 0x7f0200d7; public static final int listPopupWindowStyle = 0x7f0200d8; public static final int listPreferredItemHeight = 0x7f0200d9; public static final int listPreferredItemHeightLarge = 0x7f0200da; public static final int listPreferredItemHeightSmall = 0x7f0200db; public static final int listPreferredItemPaddingEnd = 0x7f0200dc; public static final int listPreferredItemPaddingLeft = 0x7f0200dd; public static final int listPreferredItemPaddingRight = 0x7f0200de; public static final int listPreferredItemPaddingStart = 0x7f0200df; public static final int logo = 0x7f0200e0; public static final int logoDescription = 0x7f0200e1; public static final int maxButtonHeight = 0x7f0200e2; public static final int measureWithLargestChild = 0x7f0200e3; public static final int menu = 0x7f0200e4; public static final int multiChoiceItemLayout = 0x7f0200e5; public static final int navigationContentDescription = 0x7f0200e6; public static final int navigationIcon = 0x7f0200e7; public static final int navigationMode = 0x7f0200e8; public static final int numericModifiers = 0x7f0200e9; public static final int overlapAnchor = 0x7f0200ea; public static final int paddingBottomNoButtons = 0x7f0200eb; public static final int paddingEnd = 0x7f0200ec; public static final int paddingStart = 0x7f0200ed; public static final int paddingTopNoTitle = 0x7f0200ee; public static final int panelBackground = 0x7f0200ef; public static final int panelMenuListTheme = 0x7f0200f0; public static final int panelMenuListWidth = 0x7f0200f1; public static final int popupMenuStyle = 0x7f0200f2; public static final int popupTheme = 0x7f0200f3; public static final int popupWindowStyle = 0x7f0200f4; public static final int preserveIconSpacing = 0x7f0200f5; public static final int progressBarPadding = 0x7f0200f6; public static final int progressBarStyle = 0x7f0200f7; public static final int queryBackground = 0x7f0200f8; public static final int queryHint = 0x7f0200f9; public static final int radioButtonStyle = 0x7f0200fa; public static final int ratingBarStyle = 0x7f0200fb; public static final int ratingBarStyleIndicator = 0x7f0200fc; public static final int ratingBarStyleSmall = 0x7f0200fd; public static final int searchHintIcon = 0x7f0200fe; public static final int searchIcon = 0x7f0200ff; public static final int searchViewStyle = 0x7f020100; public static final int seekBarStyle = 0x7f020101; public static final int selectableItemBackground = 0x7f020102; public static final int selectableItemBackgroundBorderless = 0x7f020103; public static final int showAsAction = 0x7f020104; public static final int showDividers = 0x7f020105; public static final int showText = 0x7f020106; public static final int showTitle = 0x7f020107; public static final int singleChoiceItemLayout = 0x7f020108; public static final int spinBars = 0x7f020109; public static final int spinnerDropDownItemStyle = 0x7f02010a; public static final int spinnerStyle = 0x7f02010b; public static final int splitTrack = 0x7f02010c; public static final int srcCompat = 0x7f02010d; public static final int state_above_anchor = 0x7f02010e; public static final int subMenuArrow = 0x7f02010f; public static final int submitBackground = 0x7f020110; public static final int subtitle = 0x7f020111; public static final int subtitleTextAppearance = 0x7f020112; public static final int subtitleTextColor = 0x7f020113; public static final int subtitleTextStyle = 0x7f020114; public static final int suggestionRowLayout = 0x7f020115; public static final int switchMinWidth = 0x7f020116; public static final int switchPadding = 0x7f020117; public static final int switchStyle = 0x7f020118; public static final int switchTextAppearance = 0x7f020119; public static final int textAllCaps = 0x7f02011a; public static final int textAppearanceLargePopupMenu = 0x7f02011b; public static final int textAppearanceListItem = 0x7f02011c; public static final int textAppearanceListItemSecondary = 0x7f02011d; public static final int textAppearanceListItemSmall = 0x7f02011e; public static final int textAppearancePopupMenuHeader = 0x7f02011f; public static final int textAppearanceSearchResultSubtitle = 0x7f020120; public static final int textAppearanceSearchResultTitle = 0x7f020121; public static final int textAppearanceSmallPopupMenu = 0x7f020122; public static final int textColorAlertDialogListItem = 0x7f020123; public static final int textColorSearchUrl = 0x7f020124; public static final int textLocale = 0x7f020125; public static final int theme = 0x7f020126; public static final int thickness = 0x7f020127; public static final int thumbTextPadding = 0x7f020128; public static final int thumbTint = 0x7f020129; public static final int thumbTintMode = 0x7f02012a; public static final int tickMark = 0x7f02012b; public static final int tickMarkTint = 0x7f02012c; public static final int tickMarkTintMode = 0x7f02012d; public static final int tint = 0x7f02012e; public static final int tintMode = 0x7f02012f; public static final int title = 0x7f020130; public static final int titleMargin = 0x7f020131; public static final int titleMarginBottom = 0x7f020132; public static final int titleMarginEnd = 0x7f020133; public static final int titleMarginStart = 0x7f020134; public static final int titleMarginTop = 0x7f020135; public static final int titleMargins = 0x7f020136; public static final int titleTextAppearance = 0x7f020137; public static final int titleTextColor = 0x7f020138; public static final int titleTextStyle = 0x7f020139; public static final int toolbarNavigationButtonStyle = 0x7f02013a; public static final int toolbarStyle = 0x7f02013b; public static final int tooltipForegroundColor = 0x7f02013c; public static final int tooltipFrameBackground = 0x7f02013d; public static final int tooltipText = 0x7f02013e; public static final int track = 0x7f02013f; public static final int trackTint = 0x7f020140; public static final int trackTintMode = 0x7f020141; public static final int ttcIndex = 0x7f020142; public static final int viewInflaterClass = 0x7f020143; public static final int voiceIcon = 0x7f020144; public static final int windowActionBar = 0x7f020145; public static final int windowActionBarOverlay = 0x7f020146; public static final int windowActionModeOverlay = 0x7f020147; public static final int windowFixedHeightMajor = 0x7f020148; public static final int windowFixedHeightMinor = 0x7f020149; public static final int windowFixedWidthMajor = 0x7f02014a; public static final int windowFixedWidthMinor = 0x7f02014b; public static final int windowMinWidthMajor = 0x7f02014c; public static final int windowMinWidthMinor = 0x7f02014d; public static final int windowNoTitle = 0x7f02014e; } public static final class bool { private bool() {} public static final int abc_action_bar_embed_tabs = 0x7f030000; public static final int abc_allow_stacked_button_bar = 0x7f030001; public static final int abc_config_actionMenuItemAllCaps = 0x7f030002; } public static final class color { private color() {} public static final int abc_background_cache_hint_selector_material_dark = 0x7f040000; public static final int abc_background_cache_hint_selector_material_light = 0x7f040001; public static final int abc_btn_colored_borderless_text_material = 0x7f040002; public static final int abc_btn_colored_text_material = 0x7f040003; public static final int abc_color_highlight_material = 0x7f040004; public static final int abc_hint_foreground_material_dark = 0x7f040005; public static final int abc_hint_foreground_material_light = 0x7f040006; public static final int abc_input_method_navigation_guard = 0x7f040007; public static final int abc_primary_text_disable_only_material_dark = 0x7f040008; public static final int abc_primary_text_disable_only_material_light = 0x7f040009; public static final int abc_primary_text_material_dark = 0x7f04000a; public static final int abc_primary_text_material_light = 0x7f04000b; public static final int abc_search_url_text = 0x7f04000c; public static final int abc_search_url_text_normal = 0x7f04000d; public static final int abc_search_url_text_pressed = 0x7f04000e; public static final int abc_search_url_text_selected = 0x7f04000f; public static final int abc_secondary_text_material_dark = 0x7f040010; public static final int abc_secondary_text_material_light = 0x7f040011; public static final int abc_tint_btn_checkable = 0x7f040012; public static final int abc_tint_default = 0x7f040013; public static final int abc_tint_edittext = 0x7f040014; public static final int abc_tint_seek_thumb = 0x7f040015; public static final int abc_tint_spinner = 0x7f040016; public static final int abc_tint_switch_track = 0x7f040017; public static final int accent_material_dark = 0x7f040018; public static final int accent_material_light = 0x7f040019; public static final int background_floating_material_dark = 0x7f04001a; public static final int background_floating_material_light = 0x7f04001b; public static final int background_material_dark = 0x7f04001c; public static final int background_material_light = 0x7f04001d; public static final int bright_foreground_disabled_material_dark = 0x7f04001e; public static final int bright_foreground_disabled_material_light = 0x7f04001f; public static final int bright_foreground_inverse_material_dark = 0x7f040020; public static final int bright_foreground_inverse_material_light = 0x7f040021; public static final int bright_foreground_material_dark = 0x7f040022; public static final int bright_foreground_material_light = 0x7f040023; public static final int button_material_dark = 0x7f040024; public static final int button_material_light = 0x7f040025; public static final int dim_foreground_disabled_material_dark = 0x7f040029; public static final int dim_foreground_disabled_material_light = 0x7f04002a; public static final int dim_foreground_material_dark = 0x7f04002b; public static final int dim_foreground_material_light = 0x7f04002c; public static final int error_color_material_dark = 0x7f04002d; public static final int error_color_material_light = 0x7f04002e; public static final int foreground_material_dark = 0x7f04002f; public static final int foreground_material_light = 0x7f040030; public static final int highlighted_text_material_dark = 0x7f040031; public static final int highlighted_text_material_light = 0x7f040032; public static final int material_blue_grey_800 = 0x7f040033; public static final int material_blue_grey_900 = 0x7f040034; public static final int material_blue_grey_950 = 0x7f040035; public static final int material_deep_teal_200 = 0x7f040036; public static final int material_deep_teal_500 = 0x7f040037; public static final int material_grey_100 = 0x7f040038; public static final int material_grey_300 = 0x7f040039; public static final int material_grey_50 = 0x7f04003a; public static final int material_grey_600 = 0x7f04003b; public static final int material_grey_800 = 0x7f04003c; public static final int material_grey_850 = 0x7f04003d; public static final int material_grey_900 = 0x7f04003e; public static final int notification_action_color_filter = 0x7f04003f; public static final int notification_icon_bg_color = 0x7f040040; public static final int primary_dark_material_dark = 0x7f040041; public static final int primary_dark_material_light = 0x7f040042; public static final int primary_material_dark = 0x7f040043; public static final int primary_material_light = 0x7f040044; public static final int primary_text_default_material_dark = 0x7f040045; public static final int primary_text_default_material_light = 0x7f040046; public static final int primary_text_disabled_material_dark = 0x7f040047; public static final int primary_text_disabled_material_light = 0x7f040048; public static final int ripple_material_dark = 0x7f040049; public static final int ripple_material_light = 0x7f04004a; public static final int secondary_text_default_material_dark = 0x7f04004b; public static final int secondary_text_default_material_light = 0x7f04004c; public static final int secondary_text_disabled_material_dark = 0x7f04004d; public static final int secondary_text_disabled_material_light = 0x7f04004e; public static final int switch_thumb_disabled_material_dark = 0x7f04004f; public static final int switch_thumb_disabled_material_light = 0x7f040050; public static final int switch_thumb_material_dark = 0x7f040051; public static final int switch_thumb_material_light = 0x7f040052; public static final int switch_thumb_normal_material_dark = 0x7f040053; public static final int switch_thumb_normal_material_light = 0x7f040054; public static final int tooltip_background_dark = 0x7f040055; public static final int tooltip_background_light = 0x7f040056; } public static final class dimen { private dimen() {} public static final int abc_action_bar_content_inset_material = 0x7f050000; public static final int abc_action_bar_content_inset_with_nav = 0x7f050001; public static final int abc_action_bar_default_height_material = 0x7f050002; public static final int abc_action_bar_default_padding_end_material = 0x7f050003; public static final int abc_action_bar_default_padding_start_material = 0x7f050004; public static final int abc_action_bar_elevation_material = 0x7f050005; public static final int abc_action_bar_icon_vertical_padding_material = 0x7f050006; public static final int abc_action_bar_overflow_padding_end_material = 0x7f050007; public static final int abc_action_bar_overflow_padding_start_material = 0x7f050008; public static final int abc_action_bar_stacked_max_height = 0x7f050009; public static final int abc_action_bar_stacked_tab_max_width = 0x7f05000a; public static final int abc_action_bar_subtitle_bottom_margin_material = 0x7f05000b; public static final int abc_action_bar_subtitle_top_margin_material = 0x7f05000c; public static final int abc_action_button_min_height_material = 0x7f05000d; public static final int abc_action_button_min_width_material = 0x7f05000e; public static final int abc_action_button_min_width_overflow_material = 0x7f05000f; public static final int abc_alert_dialog_button_bar_height = 0x7f050010; public static final int abc_alert_dialog_button_dimen = 0x7f050011; public static final int abc_button_inset_horizontal_material = 0x7f050012; public static final int abc_button_inset_vertical_material = 0x7f050013; public static final int abc_button_padding_horizontal_material = 0x7f050014; public static final int abc_button_padding_vertical_material = 0x7f050015; public static final int abc_cascading_menus_min_smallest_width = 0x7f050016; public static final int abc_config_prefDialogWidth = 0x7f050017; public static final int abc_control_corner_material = 0x7f050018; public static final int abc_control_inset_material = 0x7f050019; public static final int abc_control_padding_material = 0x7f05001a; public static final int abc_dialog_corner_radius_material = 0x7f05001b; public static final int abc_dialog_fixed_height_major = 0x7f05001c; public static final int abc_dialog_fixed_height_minor = 0x7f05001d; public static final int abc_dialog_fixed_width_major = 0x7f05001e; public static final int abc_dialog_fixed_width_minor = 0x7f05001f; public static final int abc_dialog_list_padding_bottom_no_buttons = 0x7f050020; public static final int abc_dialog_list_padding_top_no_title = 0x7f050021; public static final int abc_dialog_min_width_major = 0x7f050022; public static final int abc_dialog_min_width_minor = 0x7f050023; public static final int abc_dialog_padding_material = 0x7f050024; public static final int abc_dialog_padding_top_material = 0x7f050025; public static final int abc_dialog_title_divider_material = 0x7f050026; public static final int abc_disabled_alpha_material_dark = 0x7f050027; public static final int abc_disabled_alpha_material_light = 0x7f050028; public static final int abc_dropdownitem_icon_width = 0x7f050029; public static final int abc_dropdownitem_text_padding_left = 0x7f05002a; public static final int abc_dropdownitem_text_padding_right = 0x7f05002b; public static final int abc_edit_text_inset_bottom_material = 0x7f05002c; public static final int abc_edit_text_inset_horizontal_material = 0x7f05002d; public static final int abc_edit_text_inset_top_material = 0x7f05002e; public static final int abc_floating_window_z = 0x7f05002f; public static final int abc_list_item_height_large_material = 0x7f050030; public static final int abc_list_item_height_material = 0x7f050031; public static final int abc_list_item_height_small_material = 0x7f050032; public static final int abc_list_item_padding_horizontal_material = 0x7f050033; public static final int abc_panel_menu_list_width = 0x7f050034; public static final int abc_progress_bar_height_material = 0x7f050035; public static final int abc_search_view_preferred_height = 0x7f050036; public static final int abc_search_view_preferred_width = 0x7f050037; public static final int abc_seekbar_track_background_height_material = 0x7f050038; public static final int abc_seekbar_track_progress_height_material = 0x7f050039; public static final int abc_select_dialog_padding_start_material = 0x7f05003a; public static final int abc_switch_padding = 0x7f05003b; public static final int abc_text_size_body_1_material = 0x7f05003c; public static final int abc_text_size_body_2_material = 0x7f05003d; public static final int abc_text_size_button_material = 0x7f05003e; public static final int abc_text_size_caption_material = 0x7f05003f; public static final int abc_text_size_display_1_material = 0x7f050040; public static final int abc_text_size_display_2_material = 0x7f050041; public static final int abc_text_size_display_3_material = 0x7f050042; public static final int abc_text_size_display_4_material = 0x7f050043; public static final int abc_text_size_headline_material = 0x7f050044; public static final int abc_text_size_large_material = 0x7f050045; public static final int abc_text_size_medium_material = 0x7f050046; public static final int abc_text_size_menu_header_material = 0x7f050047; public static final int abc_text_size_menu_material = 0x7f050048; public static final int abc_text_size_small_material = 0x7f050049; public static final int abc_text_size_subhead_material = 0x7f05004a; public static final int abc_text_size_subtitle_material_toolbar = 0x7f05004b; public static final int abc_text_size_title_material = 0x7f05004c; public static final int abc_text_size_title_material_toolbar = 0x7f05004d; public static final int compat_button_inset_horizontal_material = 0x7f05004e; public static final int compat_button_inset_vertical_material = 0x7f05004f; public static final int compat_button_padding_horizontal_material = 0x7f050050; public static final int compat_button_padding_vertical_material = 0x7f050051; public static final int compat_control_corner_material = 0x7f050052; public static final int compat_notification_large_icon_max_height = 0x7f050053; public static final int compat_notification_large_icon_max_width = 0x7f050054; public static final int disabled_alpha_material_dark = 0x7f050055; public static final int disabled_alpha_material_light = 0x7f050056; public static final int highlight_alpha_material_colored = 0x7f050057; public static final int highlight_alpha_material_dark = 0x7f050058; public static final int highlight_alpha_material_light = 0x7f050059; public static final int hint_alpha_material_dark = 0x7f05005a; public static final int hint_alpha_material_light = 0x7f05005b; public static final int hint_pressed_alpha_material_dark = 0x7f05005c; public static final int hint_pressed_alpha_material_light = 0x7f05005d; public static final int notification_action_icon_size = 0x7f05005e; public static final int notification_action_text_size = 0x7f05005f; public static final int notification_big_circle_margin = 0x7f050060; public static final int notification_content_margin_start = 0x7f050061; public static final int notification_large_icon_height = 0x7f050062; public static final int notification_large_icon_width = 0x7f050063; public static final int notification_main_column_padding_top = 0x7f050064; public static final int notification_media_narrow_margin = 0x7f050065; public static final int notification_right_icon_size = 0x7f050066; public static final int notification_right_side_padding_top = 0x7f050067; public static final int notification_small_icon_background_padding = 0x7f050068; public static final int notification_small_icon_size_as_large = 0x7f050069; public static final int notification_subtext_size = 0x7f05006a; public static final int notification_top_pad = 0x7f05006b; public static final int notification_top_pad_large_text = 0x7f05006c; public static final int tooltip_corner_radius = 0x7f05006d; public static final int tooltip_horizontal_padding = 0x7f05006e; public static final int tooltip_margin = 0x7f05006f; public static final int tooltip_precise_anchor_extra_offset = 0x7f050070; public static final int tooltip_precise_anchor_threshold = 0x7f050071; public static final int tooltip_vertical_padding = 0x7f050072; public static final int tooltip_y_offset_non_touch = 0x7f050073; public static final int tooltip_y_offset_touch = 0x7f050074; } public static final class drawable { private drawable() {} public static final int abc_ab_share_pack_mtrl_alpha = 0x7f060001; public static final int abc_action_bar_item_background_material = 0x7f060002; public static final int abc_btn_borderless_material = 0x7f060003; public static final int abc_btn_check_material = 0x7f060004; public static final int abc_btn_check_material_anim = 0x7f060005; public static final int abc_btn_check_to_on_mtrl_000 = 0x7f060006; public static final int abc_btn_check_to_on_mtrl_015 = 0x7f060007; public static final int abc_btn_colored_material = 0x7f060008; public static final int abc_btn_default_mtrl_shape = 0x7f060009; public static final int abc_btn_radio_material = 0x7f06000a; public static final int abc_btn_radio_material_anim = 0x7f06000b; public static final int abc_btn_radio_to_on_mtrl_000 = 0x7f06000c; public static final int abc_btn_radio_to_on_mtrl_015 = 0x7f06000d; public static final int abc_btn_switch_to_on_mtrl_00001 = 0x7f06000e; public static final int abc_btn_switch_to_on_mtrl_00012 = 0x7f06000f; public static final int abc_cab_background_internal_bg = 0x7f060010; public static final int abc_cab_background_top_material = 0x7f060011; public static final int abc_cab_background_top_mtrl_alpha = 0x7f060012; public static final int abc_control_background_material = 0x7f060013; public static final int abc_dialog_material_background = 0x7f060014; public static final int abc_edit_text_material = 0x7f060015; public static final int abc_ic_ab_back_material = 0x7f060016; public static final int abc_ic_arrow_drop_right_black_24dp = 0x7f060017; public static final int abc_ic_clear_material = 0x7f060018; public static final int abc_ic_commit_search_api_mtrl_alpha = 0x7f060019; public static final int abc_ic_go_search_api_material = 0x7f06001a; public static final int abc_ic_menu_copy_mtrl_am_alpha = 0x7f06001b; public static final int abc_ic_menu_cut_mtrl_alpha = 0x7f06001c; public static final int abc_ic_menu_overflow_material = 0x7f06001d; public static final int abc_ic_menu_paste_mtrl_am_alpha = 0x7f06001e; public static final int abc_ic_menu_selectall_mtrl_alpha = 0x7f06001f; public static final int abc_ic_menu_share_mtrl_alpha = 0x7f060020; public static final int abc_ic_search_api_material = 0x7f060021; public static final int abc_ic_star_black_16dp = 0x7f060022; public static final int abc_ic_star_black_36dp = 0x7f060023; public static final int abc_ic_star_black_48dp = 0x7f060024; public static final int abc_ic_star_half_black_16dp = 0x7f060025; public static final int abc_ic_star_half_black_36dp = 0x7f060026; public static final int abc_ic_star_half_black_48dp = 0x7f060027; public static final int abc_ic_voice_search_api_material = 0x7f060028; public static final int abc_item_background_holo_dark = 0x7f060029; public static final int abc_item_background_holo_light = 0x7f06002a; public static final int abc_list_divider_material = 0x7f06002b; public static final int abc_list_divider_mtrl_alpha = 0x7f06002c; public static final int abc_list_focused_holo = 0x7f06002d; public static final int abc_list_longpressed_holo = 0x7f06002e; public static final int abc_list_pressed_holo_dark = 0x7f06002f; public static final int abc_list_pressed_holo_light = 0x7f060030; public static final int abc_list_selector_background_transition_holo_dark = 0x7f060031; public static final int abc_list_selector_background_transition_holo_light = 0x7f060032; public static final int abc_list_selector_disabled_holo_dark = 0x7f060033; public static final int abc_list_selector_disabled_holo_light = 0x7f060034; public static final int abc_list_selector_holo_dark = 0x7f060035; public static final int abc_list_selector_holo_light = 0x7f060036; public static final int abc_menu_hardkey_panel_mtrl_mult = 0x7f060037; public static final int abc_popup_background_mtrl_mult = 0x7f060038; public static final int abc_ratingbar_indicator_material = 0x7f060039; public static final int abc_ratingbar_material = 0x7f06003a; public static final int abc_ratingbar_small_material = 0x7f06003b; public static final int abc_scrubber_control_off_mtrl_alpha = 0x7f06003c; public static final int abc_scrubber_control_to_pressed_mtrl_000 = 0x7f06003d; public static final int abc_scrubber_control_to_pressed_mtrl_005 = 0x7f06003e; public static final int abc_scrubber_primary_mtrl_alpha = 0x7f06003f; public static final int abc_scrubber_track_mtrl_alpha = 0x7f060040; public static final int abc_seekbar_thumb_material = 0x7f060041; public static final int abc_seekbar_tick_mark_material = 0x7f060042; public static final int abc_seekbar_track_material = 0x7f060043; public static final int abc_spinner_mtrl_am_alpha = 0x7f060044; public static final int abc_spinner_textfield_background_material = 0x7f060045; public static final int abc_switch_thumb_material = 0x7f060046; public static final int abc_switch_track_mtrl_alpha = 0x7f060047; public static final int abc_tab_indicator_material = 0x7f060048; public static final int abc_tab_indicator_mtrl_alpha = 0x7f060049; public static final int abc_text_cursor_material = 0x7f06004a; public static final int abc_text_select_handle_left_mtrl_dark = 0x7f06004b; public static final int abc_text_select_handle_left_mtrl_light = 0x7f06004c; public static final int abc_text_select_handle_middle_mtrl_dark = 0x7f06004d; public static final int abc_text_select_handle_middle_mtrl_light = 0x7f06004e; public static final int abc_text_select_handle_right_mtrl_dark = 0x7f06004f; public static final int abc_text_select_handle_right_mtrl_light = 0x7f060050; public static final int abc_textfield_activated_mtrl_alpha = 0x7f060051; public static final int abc_textfield_default_mtrl_alpha = 0x7f060052; public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f060053; public static final int abc_textfield_search_default_mtrl_alpha = 0x7f060054; public static final int abc_textfield_search_material = 0x7f060055; public static final int abc_vector_test = 0x7f060056; public static final int btn_checkbox_checked_mtrl = 0x7f060057; public static final int btn_checkbox_checked_to_unchecked_mtrl_animation = 0x7f060058; public static final int btn_checkbox_unchecked_mtrl = 0x7f060059; public static final int btn_checkbox_unchecked_to_checked_mtrl_animation = 0x7f06005a; public static final int btn_radio_off_mtrl = 0x7f06005b; public static final int btn_radio_off_to_on_mtrl_animation = 0x7f06005c; public static final int btn_radio_on_mtrl = 0x7f06005d; public static final int btn_radio_on_to_off_mtrl_animation = 0x7f06005e; public static final int notification_action_background = 0x7f060065; public static final int notification_bg = 0x7f060066; public static final int notification_bg_low = 0x7f060067; public static final int notification_bg_low_normal = 0x7f060068; public static final int notification_bg_low_pressed = 0x7f060069; public static final int notification_bg_normal = 0x7f06006a; public static final int notification_bg_normal_pressed = 0x7f06006b; public static final int notification_icon_background = 0x7f06006c; public static final int notification_template_icon_bg = 0x7f06006d; public static final int notification_template_icon_low_bg = 0x7f06006e; public static final int notification_tile_bg = 0x7f06006f; public static final int notify_panel_notification_icon_bg = 0x7f060070; public static final int tooltip_frame_dark = 0x7f060074; public static final int tooltip_frame_light = 0x7f060075; } public static final class id { private id() {} public static final int accessibility_action_clickable_span = 0x7f070006; public static final int accessibility_custom_action_0 = 0x7f070007; public static final int accessibility_custom_action_1 = 0x7f070008; public static final int accessibility_custom_action_10 = 0x7f070009; public static final int accessibility_custom_action_11 = 0x7f07000a; public static final int accessibility_custom_action_12 = 0x7f07000b; public static final int accessibility_custom_action_13 = 0x7f07000c; public static final int accessibility_custom_action_14 = 0x7f07000d; public static final int accessibility_custom_action_15 = 0x7f07000e; public static final int accessibility_custom_action_16 = 0x7f07000f; public static final int accessibility_custom_action_17 = 0x7f070010; public static final int accessibility_custom_action_18 = 0x7f070011; public static final int accessibility_custom_action_19 = 0x7f070012; public static final int accessibility_custom_action_2 = 0x7f070013; public static final int accessibility_custom_action_20 = 0x7f070014; public static final int accessibility_custom_action_21 = 0x7f070015; public static final int accessibility_custom_action_22 = 0x7f070016; public static final int accessibility_custom_action_23 = 0x7f070017; public static final int accessibility_custom_action_24 = 0x7f070018; public static final int accessibility_custom_action_25 = 0x7f070019; public static final int accessibility_custom_action_26 = 0x7f07001a; public static final int accessibility_custom_action_27 = 0x7f07001b; public static final int accessibility_custom_action_28 = 0x7f07001c; public static final int accessibility_custom_action_29 = 0x7f07001d; public static final int accessibility_custom_action_3 = 0x7f07001e; public static final int accessibility_custom_action_30 = 0x7f07001f; public static final int accessibility_custom_action_31 = 0x7f070020; public static final int accessibility_custom_action_4 = 0x7f070021; public static final int accessibility_custom_action_5 = 0x7f070022; public static final int accessibility_custom_action_6 = 0x7f070023; public static final int accessibility_custom_action_7 = 0x7f070024; public static final int accessibility_custom_action_8 = 0x7f070025; public static final int accessibility_custom_action_9 = 0x7f070026; public static final int action_bar = 0x7f070027; public static final int action_bar_activity_content = 0x7f070028; public static final int action_bar_container = 0x7f070029; public static final int action_bar_root = 0x7f07002a; public static final int action_bar_spinner = 0x7f07002b; public static final int action_bar_subtitle = 0x7f07002c; public static final int action_bar_title = 0x7f07002d; public static final int action_container = 0x7f07002e; public static final int action_context_bar = 0x7f07002f; public static final int action_divider = 0x7f070030; public static final int action_image = 0x7f070031; public static final int action_menu_divider = 0x7f070032; public static final int action_menu_presenter = 0x7f070033; public static final int action_mode_bar = 0x7f070034; public static final int action_mode_bar_stub = 0x7f070035; public static final int action_mode_close_button = 0x7f070036; public static final int action_text = 0x7f070037; public static final int actions = 0x7f070038; public static final int activity_chooser_view_content = 0x7f070039; public static final int add = 0x7f07003a; public static final int alertTitle = 0x7f07003b; public static final int async = 0x7f07003d; public static final int blocking = 0x7f070040; public static final int buttonPanel = 0x7f070042; public static final int checkbox = 0x7f070045; public static final int checked = 0x7f070046; public static final int chronometer = 0x7f070047; public static final int content = 0x7f070049; public static final int contentPanel = 0x7f07004a; public static final int custom = 0x7f07004b; public static final int customPanel = 0x7f07004c; public static final int decor_content_parent = 0x7f07004d; public static final int default_activity_button = 0x7f07004e; public static final int dialog_button = 0x7f070050; public static final int edit_query = 0x7f070054; public static final int expand_activities_button = 0x7f070056; public static final int expanded_menu = 0x7f070057; public static final int forever = 0x7f070058; public static final int group_divider = 0x7f07005a; public static final int home = 0x7f07005c; public static final int icon = 0x7f07005e; public static final int icon_group = 0x7f070060; public static final int image = 0x7f070062; public static final int info = 0x7f070063; public static final int italic = 0x7f070065; public static final int line1 = 0x7f070067; public static final int line3 = 0x7f070068; public static final int listMode = 0x7f070069; public static final int list_item = 0x7f07006b; public static final int message = 0x7f07006c; public static final int multiply = 0x7f07006e; public static final int none = 0x7f070070; public static final int normal = 0x7f070071; public static final int notification_background = 0x7f070072; public static final int notification_main_column = 0x7f070073; public static final int notification_main_column_container = 0x7f070074; public static final int off = 0x7f070075; public static final int on = 0x7f070076; public static final int parentPanel = 0x7f070079; public static final int progress_circular = 0x7f07007b; public static final int progress_horizontal = 0x7f07007c; public static final int radio = 0x7f07007d; public static final int right_icon = 0x7f07007f; public static final int right_side = 0x7f070080; public static final int screen = 0x7f070081; public static final int scrollIndicatorDown = 0x7f070082; public static final int scrollIndicatorUp = 0x7f070083; public static final int scrollView = 0x7f070084; public static final int search_badge = 0x7f070085; public static final int search_bar = 0x7f070086; public static final int search_button = 0x7f070087; public static final int search_close_btn = 0x7f070088; public static final int search_edit_frame = 0x7f070089; public static final int search_go_btn = 0x7f07008a; public static final int search_mag_icon = 0x7f07008b; public static final int search_plate = 0x7f07008c; public static final int search_src_text = 0x7f07008d; public static final int search_voice_btn = 0x7f07008e; public static final int select_dialog_listview = 0x7f07008f; public static final int shortcut = 0x7f070090; public static final int spacer = 0x7f070094; public static final int split_action_bar = 0x7f070095; public static final int src_atop = 0x7f070098; public static final int src_in = 0x7f070099; public static final int src_over = 0x7f07009a; public static final int submenuarrow = 0x7f07009d; public static final int submit_area = 0x7f07009e; public static final int tabMode = 0x7f07009f; public static final int tag_accessibility_actions = 0x7f0700a0; public static final int tag_accessibility_clickable_spans = 0x7f0700a1; public static final int tag_accessibility_heading = 0x7f0700a2; public static final int tag_accessibility_pane_title = 0x7f0700a3; public static final int tag_screen_reader_focusable = 0x7f0700a4; public static final int tag_transition_group = 0x7f0700a5; public static final int tag_unhandled_key_event_manager = 0x7f0700a6; public static final int tag_unhandled_key_listeners = 0x7f0700a7; public static final int text = 0x7f0700a8; public static final int text2 = 0x7f0700a9; public static final int textSpacerNoButtons = 0x7f0700aa; public static final int textSpacerNoTitle = 0x7f0700ab; public static final int time = 0x7f0700ac; public static final int title = 0x7f0700ad; public static final int titleDividerNoCustom = 0x7f0700ae; public static final int title_template = 0x7f0700b0; public static final int topPanel = 0x7f0700b2; public static final int unchecked = 0x7f0700b3; public static final int uniform = 0x7f0700b4; public static final int up = 0x7f0700b5; public static final int wrap_content = 0x7f0700b9; } public static final class integer { private integer() {} public static final int abc_config_activityDefaultDur = 0x7f080000; public static final int abc_config_activityShortDur = 0x7f080001; public static final int cancel_button_image_alpha = 0x7f080002; public static final int config_tooltipAnimTime = 0x7f080003; public static final int status_bar_notification_info_maxnum = 0x7f080004; } public static final class interpolator { private interpolator() {} public static final int btn_checkbox_checked_mtrl_animation_interpolator_0 = 0x7f090000; public static final int btn_checkbox_checked_mtrl_animation_interpolator_1 = 0x7f090001; public static final int btn_checkbox_unchecked_mtrl_animation_interpolator_0 = 0x7f090002; public static final int btn_checkbox_unchecked_mtrl_animation_interpolator_1 = 0x7f090003; public static final int btn_radio_to_off_mtrl_animation_interpolator_0 = 0x7f090004; public static final int btn_radio_to_on_mtrl_animation_interpolator_0 = 0x7f090005; public static final int fast_out_slow_in = 0x7f090006; } public static final class layout { private layout() {} public static final int abc_action_bar_title_item = 0x7f0a0000; public static final int abc_action_bar_up_container = 0x7f0a0001; public static final int abc_action_menu_item_layout = 0x7f0a0002; public static final int abc_action_menu_layout = 0x7f0a0003; public static final int abc_action_mode_bar = 0x7f0a0004; public static final int abc_action_mode_close_item_material = 0x7f0a0005; public static final int abc_activity_chooser_view = 0x7f0a0006; public static final int abc_activity_chooser_view_list_item = 0x7f0a0007; public static final int abc_alert_dialog_button_bar_material = 0x7f0a0008; public static final int abc_alert_dialog_material = 0x7f0a0009; public static final int abc_alert_dialog_title_material = 0x7f0a000a; public static final int abc_cascading_menu_item_layout = 0x7f0a000b; public static final int abc_dialog_title_material = 0x7f0a000c; public static final int abc_expanded_menu_layout = 0x7f0a000d; public static final int abc_list_menu_item_checkbox = 0x7f0a000e; public static final int abc_list_menu_item_icon = 0x7f0a000f; public static final int abc_list_menu_item_layout = 0x7f0a0010; public static final int abc_list_menu_item_radio = 0x7f0a0011; public static final int abc_popup_menu_header_item_layout = 0x7f0a0012; public static final int abc_popup_menu_item_layout = 0x7f0a0013; public static final int abc_screen_content_include = 0x7f0a0014; public static final int abc_screen_simple = 0x7f0a0015; public static final int abc_screen_simple_overlay_action_mode = 0x7f0a0016; public static final int abc_screen_toolbar = 0x7f0a0017; public static final int abc_search_dropdown_item_icons_2line = 0x7f0a0018; public static final int abc_search_view = 0x7f0a0019; public static final int abc_select_dialog_material = 0x7f0a001a; public static final int abc_tooltip = 0x7f0a001b; public static final int custom_dialog = 0x7f0a001d; public static final int notification_action = 0x7f0a001e; public static final int notification_action_tombstone = 0x7f0a001f; public static final int notification_template_custom_big = 0x7f0a0020; public static final int notification_template_icon_group = 0x7f0a0021; public static final int notification_template_part_chronometer = 0x7f0a0022; public static final int notification_template_part_time = 0x7f0a0023; public static final int select_dialog_item_material = 0x7f0a0025; public static final int select_dialog_multichoice_material = 0x7f0a0026; public static final int select_dialog_singlechoice_material = 0x7f0a0027; public static final int support_simple_spinner_dropdown_item = 0x7f0a0028; } public static final class string { private string() {} public static final int abc_action_bar_home_description = 0x7f0c0000; public static final int abc_action_bar_up_description = 0x7f0c0001; public static final int abc_action_menu_overflow_description = 0x7f0c0002; public static final int abc_action_mode_done = 0x7f0c0003; public static final int abc_activity_chooser_view_see_all = 0x7f0c0004; public static final int abc_activitychooserview_choose_application = 0x7f0c0005; public static final int abc_capital_off = 0x7f0c0006; public static final int abc_capital_on = 0x7f0c0007; public static final int abc_menu_alt_shortcut_label = 0x7f0c0008; public static final int abc_menu_ctrl_shortcut_label = 0x7f0c0009; public static final int abc_menu_delete_shortcut_label = 0x7f0c000a; public static final int abc_menu_enter_shortcut_label = 0x7f0c000b; public static final int abc_menu_function_shortcut_label = 0x7f0c000c; public static final int abc_menu_meta_shortcut_label = 0x7f0c000d; public static final int abc_menu_shift_shortcut_label = 0x7f0c000e; public static final int abc_menu_space_shortcut_label = 0x7f0c000f; public static final int abc_menu_sym_shortcut_label = 0x7f0c0010; public static final int abc_prepend_shortcut_label = 0x7f0c0011; public static final int abc_search_hint = 0x7f0c0012; public static final int abc_searchview_description_clear = 0x7f0c0013; public static final int abc_searchview_description_query = 0x7f0c0014; public static final int abc_searchview_description_search = 0x7f0c0015; public static final int abc_searchview_description_submit = 0x7f0c0016; public static final int abc_searchview_description_voice = 0x7f0c0017; public static final int abc_shareactionprovider_share_with = 0x7f0c0018; public static final int abc_shareactionprovider_share_with_application = 0x7f0c0019; public static final int abc_toolbar_collapse_description = 0x7f0c001a; public static final int search_menu_title = 0x7f0c001c; public static final int status_bar_notification_info_overflow = 0x7f0c001d; } public static final class style { private style() {} public static final int AlertDialog_AppCompat = 0x7f0d0000; public static final int AlertDialog_AppCompat_Light = 0x7f0d0001; public static final int Animation_AppCompat_Dialog = 0x7f0d0002; public static final int Animation_AppCompat_DropDownUp = 0x7f0d0003; public static final int Animation_AppCompat_Tooltip = 0x7f0d0004; public static final int Base_AlertDialog_AppCompat = 0x7f0d0006; public static final int Base_AlertDialog_AppCompat_Light = 0x7f0d0007; public static final int Base_Animation_AppCompat_Dialog = 0x7f0d0008; public static final int Base_Animation_AppCompat_DropDownUp = 0x7f0d0009; public static final int Base_Animation_AppCompat_Tooltip = 0x7f0d000a; public static final int Base_DialogWindowTitleBackground_AppCompat = 0x7f0d000c; public static final int Base_DialogWindowTitle_AppCompat = 0x7f0d000b; public static final int Base_TextAppearance_AppCompat = 0x7f0d000d; public static final int Base_TextAppearance_AppCompat_Body1 = 0x7f0d000e; public static final int Base_TextAppearance_AppCompat_Body2 = 0x7f0d000f; public static final int Base_TextAppearance_AppCompat_Button = 0x7f0d0010; public static final int Base_TextAppearance_AppCompat_Caption = 0x7f0d0011; public static final int Base_TextAppearance_AppCompat_Display1 = 0x7f0d0012; public static final int Base_TextAppearance_AppCompat_Display2 = 0x7f0d0013; public static final int Base_TextAppearance_AppCompat_Display3 = 0x7f0d0014; public static final int Base_TextAppearance_AppCompat_Display4 = 0x7f0d0015; public static final int Base_TextAppearance_AppCompat_Headline = 0x7f0d0016; public static final int Base_TextAppearance_AppCompat_Inverse = 0x7f0d0017; public static final int Base_TextAppearance_AppCompat_Large = 0x7f0d0018; public static final int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f0d0019; public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0d001a; public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0d001b; public static final int Base_TextAppearance_AppCompat_Medium = 0x7f0d001c; public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f0d001d; public static final int Base_TextAppearance_AppCompat_Menu = 0x7f0d001e; public static final int Base_TextAppearance_AppCompat_SearchResult = 0x7f0d001f; public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0d0020; public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f0d0021; public static final int Base_TextAppearance_AppCompat_Small = 0x7f0d0022; public static final int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f0d0023; public static final int Base_TextAppearance_AppCompat_Subhead = 0x7f0d0024; public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f0d0025; public static final int Base_TextAppearance_AppCompat_Title = 0x7f0d0026; public static final int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f0d0027; public static final int Base_TextAppearance_AppCompat_Tooltip = 0x7f0d0028; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0d0029; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0d002a; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0d002b; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0d002c; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0d002d; public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0d002e; public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0d002f; public static final int Base_TextAppearance_AppCompat_Widget_Button = 0x7f0d0030; public static final int Base_TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f0d0031; public static final int Base_TextAppearance_AppCompat_Widget_Button_Colored = 0x7f0d0032; public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0d0033; public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0d0034; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f0d0035; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0d0036; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0d0037; public static final int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f0d0038; public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0d0039; public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0d003a; public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0d003b; public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0d003c; public static final int Base_ThemeOverlay_AppCompat = 0x7f0d004b; public static final int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f0d004c; public static final int Base_ThemeOverlay_AppCompat_Dark = 0x7f0d004d; public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0d004e; public static final int Base_ThemeOverlay_AppCompat_Dialog = 0x7f0d004f; public static final int Base_ThemeOverlay_AppCompat_Dialog_Alert = 0x7f0d0050; public static final int Base_ThemeOverlay_AppCompat_Light = 0x7f0d0051; public static final int Base_Theme_AppCompat = 0x7f0d003d; public static final int Base_Theme_AppCompat_CompactMenu = 0x7f0d003e; public static final int Base_Theme_AppCompat_Dialog = 0x7f0d003f; public static final int Base_Theme_AppCompat_DialogWhenLarge = 0x7f0d0043; public static final int Base_Theme_AppCompat_Dialog_Alert = 0x7f0d0040; public static final int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f0d0041; public static final int Base_Theme_AppCompat_Dialog_MinWidth = 0x7f0d0042; public static final int Base_Theme_AppCompat_Light = 0x7f0d0044; public static final int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f0d0045; public static final int Base_Theme_AppCompat_Light_Dialog = 0x7f0d0046; public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f0d004a; public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 0x7f0d0047; public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f0d0048; public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0d0049; public static final int Base_V21_ThemeOverlay_AppCompat_Dialog = 0x7f0d0056; public static final int Base_V21_Theme_AppCompat = 0x7f0d0052; public static final int Base_V21_Theme_AppCompat_Dialog = 0x7f0d0053; public static final int Base_V21_Theme_AppCompat_Light = 0x7f0d0054; public static final int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f0d0055; public static final int Base_V22_Theme_AppCompat = 0x7f0d0057; public static final int Base_V22_Theme_AppCompat_Light = 0x7f0d0058; public static final int Base_V23_Theme_AppCompat = 0x7f0d0059; public static final int Base_V23_Theme_AppCompat_Light = 0x7f0d005a; public static final int Base_V26_Theme_AppCompat = 0x7f0d005b; public static final int Base_V26_Theme_AppCompat_Light = 0x7f0d005c; public static final int Base_V26_Widget_AppCompat_Toolbar = 0x7f0d005d; public static final int Base_V28_Theme_AppCompat = 0x7f0d005e; public static final int Base_V28_Theme_AppCompat_Light = 0x7f0d005f; public static final int Base_V7_ThemeOverlay_AppCompat_Dialog = 0x7f0d0064; public static final int Base_V7_Theme_AppCompat = 0x7f0d0060; public static final int Base_V7_Theme_AppCompat_Dialog = 0x7f0d0061; public static final int Base_V7_Theme_AppCompat_Light = 0x7f0d0062; public static final int Base_V7_Theme_AppCompat_Light_Dialog = 0x7f0d0063; public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 0x7f0d0065; public static final int Base_V7_Widget_AppCompat_EditText = 0x7f0d0066; public static final int Base_V7_Widget_AppCompat_Toolbar = 0x7f0d0067; public static final int Base_Widget_AppCompat_ActionBar = 0x7f0d0068; public static final int Base_Widget_AppCompat_ActionBar_Solid = 0x7f0d0069; public static final int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f0d006a; public static final int Base_Widget_AppCompat_ActionBar_TabText = 0x7f0d006b; public static final int Base_Widget_AppCompat_ActionBar_TabView = 0x7f0d006c; public static final int Base_Widget_AppCompat_ActionButton = 0x7f0d006d; public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f0d006e; public static final int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f0d006f; public static final int Base_Widget_AppCompat_ActionMode = 0x7f0d0070; public static final int Base_Widget_AppCompat_ActivityChooserView = 0x7f0d0071; public static final int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f0d0072; public static final int Base_Widget_AppCompat_Button = 0x7f0d0073; public static final int Base_Widget_AppCompat_ButtonBar = 0x7f0d0079; public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0d007a; public static final int Base_Widget_AppCompat_Button_Borderless = 0x7f0d0074; public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 0x7f0d0075; public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0d0076; public static final int Base_Widget_AppCompat_Button_Colored = 0x7f0d0077; public static final int Base_Widget_AppCompat_Button_Small = 0x7f0d0078; public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 0x7f0d007b; public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 0x7f0d007c; public static final int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f0d007d; public static final int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f0d007e; public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f0d007f; public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f0d0080; public static final int Base_Widget_AppCompat_EditText = 0x7f0d0081; public static final int Base_Widget_AppCompat_ImageButton = 0x7f0d0082; public static final int Base_Widget_AppCompat_Light_ActionBar = 0x7f0d0083; public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f0d0084; public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0d0085; public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f0d0086; public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0d0087; public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f0d0088; public static final int Base_Widget_AppCompat_Light_PopupMenu = 0x7f0d0089; public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0d008a; public static final int Base_Widget_AppCompat_ListMenuView = 0x7f0d008b; public static final int Base_Widget_AppCompat_ListPopupWindow = 0x7f0d008c; public static final int Base_Widget_AppCompat_ListView = 0x7f0d008d; public static final int Base_Widget_AppCompat_ListView_DropDown = 0x7f0d008e; public static final int Base_Widget_AppCompat_ListView_Menu = 0x7f0d008f; public static final int Base_Widget_AppCompat_PopupMenu = 0x7f0d0090; public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f0d0091; public static final int Base_Widget_AppCompat_PopupWindow = 0x7f0d0092; public static final int Base_Widget_AppCompat_ProgressBar = 0x7f0d0093; public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f0d0094; public static final int Base_Widget_AppCompat_RatingBar = 0x7f0d0095; public static final int Base_Widget_AppCompat_RatingBar_Indicator = 0x7f0d0096; public static final int Base_Widget_AppCompat_RatingBar_Small = 0x7f0d0097; public static final int Base_Widget_AppCompat_SearchView = 0x7f0d0098; public static final int Base_Widget_AppCompat_SearchView_ActionBar = 0x7f0d0099; public static final int Base_Widget_AppCompat_SeekBar = 0x7f0d009a; public static final int Base_Widget_AppCompat_SeekBar_Discrete = 0x7f0d009b; public static final int Base_Widget_AppCompat_Spinner = 0x7f0d009c; public static final int Base_Widget_AppCompat_Spinner_Underlined = 0x7f0d009d; public static final int Base_Widget_AppCompat_TextView = 0x7f0d009e; public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f0d009f; public static final int Base_Widget_AppCompat_Toolbar = 0x7f0d00a0; public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0d00a1; public static final int Platform_AppCompat = 0x7f0d00a2; public static final int Platform_AppCompat_Light = 0x7f0d00a3; public static final int Platform_ThemeOverlay_AppCompat = 0x7f0d00a4; public static final int Platform_ThemeOverlay_AppCompat_Dark = 0x7f0d00a5; public static final int Platform_ThemeOverlay_AppCompat_Light = 0x7f0d00a6; public static final int Platform_V21_AppCompat = 0x7f0d00a7; public static final int Platform_V21_AppCompat_Light = 0x7f0d00a8; public static final int Platform_V25_AppCompat = 0x7f0d00a9; public static final int Platform_V25_AppCompat_Light = 0x7f0d00aa; public static final int Platform_Widget_AppCompat_Spinner = 0x7f0d00ab; public static final int RtlOverlay_DialogWindowTitle_AppCompat = 0x7f0d00ac; public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f0d00ad; public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 0x7f0d00ae; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f0d00af; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f0d00b0; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Shortcut = 0x7f0d00b1; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_SubmenuArrow = 0x7f0d00b2; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f0d00b3; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Title = 0x7f0d00b4; public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f0d00ba; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f0d00b5; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f0d00b6; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f0d00b7; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f0d00b8; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f0d00b9; public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 0x7f0d00bb; public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 0x7f0d00bc; public static final int TextAppearance_AppCompat = 0x7f0d00bd; public static final int TextAppearance_AppCompat_Body1 = 0x7f0d00be; public static final int TextAppearance_AppCompat_Body2 = 0x7f0d00bf; public static final int TextAppearance_AppCompat_Button = 0x7f0d00c0; public static final int TextAppearance_AppCompat_Caption = 0x7f0d00c1; public static final int TextAppearance_AppCompat_Display1 = 0x7f0d00c2; public static final int TextAppearance_AppCompat_Display2 = 0x7f0d00c3; public static final int TextAppearance_AppCompat_Display3 = 0x7f0d00c4; public static final int TextAppearance_AppCompat_Display4 = 0x7f0d00c5; public static final int TextAppearance_AppCompat_Headline = 0x7f0d00c6; public static final int TextAppearance_AppCompat_Inverse = 0x7f0d00c7; public static final int TextAppearance_AppCompat_Large = 0x7f0d00c8; public static final int TextAppearance_AppCompat_Large_Inverse = 0x7f0d00c9; public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f0d00ca; public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f0d00cb; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0d00cc; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0d00cd; public static final int TextAppearance_AppCompat_Medium = 0x7f0d00ce; public static final int TextAppearance_AppCompat_Medium_Inverse = 0x7f0d00cf; public static final int TextAppearance_AppCompat_Menu = 0x7f0d00d0; public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0d00d1; public static final int TextAppearance_AppCompat_SearchResult_Title = 0x7f0d00d2; public static final int TextAppearance_AppCompat_Small = 0x7f0d00d3; public static final int TextAppearance_AppCompat_Small_Inverse = 0x7f0d00d4; public static final int TextAppearance_AppCompat_Subhead = 0x7f0d00d5; public static final int TextAppearance_AppCompat_Subhead_Inverse = 0x7f0d00d6; public static final int TextAppearance_AppCompat_Title = 0x7f0d00d7; public static final int TextAppearance_AppCompat_Title_Inverse = 0x7f0d00d8; public static final int TextAppearance_AppCompat_Tooltip = 0x7f0d00d9; public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0d00da; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0d00db; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0d00dc; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0d00dd; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0d00de; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0d00df; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f0d00e0; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0d00e1; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f0d00e2; public static final int TextAppearance_AppCompat_Widget_Button = 0x7f0d00e3; public static final int TextAppearance_AppCompat_Widget_Button_Borderless_Colored = 0x7f0d00e4; public static final int TextAppearance_AppCompat_Widget_Button_Colored = 0x7f0d00e5; public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0d00e6; public static final int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0d00e7; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Header = 0x7f0d00e8; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0d00e9; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0d00ea; public static final int TextAppearance_AppCompat_Widget_Switch = 0x7f0d00eb; public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0d00ec; public static final int TextAppearance_Compat_Notification = 0x7f0d00ed; public static final int TextAppearance_Compat_Notification_Info = 0x7f0d00ee; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0d00ef; public static final int TextAppearance_Compat_Notification_Time = 0x7f0d00f0; public static final int TextAppearance_Compat_Notification_Title = 0x7f0d00f1; public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0d00f2; public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0d00f3; public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0d00f4; public static final int ThemeOverlay_AppCompat = 0x7f0d010a; public static final int ThemeOverlay_AppCompat_ActionBar = 0x7f0d010b; public static final int ThemeOverlay_AppCompat_Dark = 0x7f0d010c; public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0d010d; public static final int ThemeOverlay_AppCompat_DayNight = 0x7f0d010e; public static final int ThemeOverlay_AppCompat_DayNight_ActionBar = 0x7f0d010f; public static final int ThemeOverlay_AppCompat_Dialog = 0x7f0d0110; public static final int ThemeOverlay_AppCompat_Dialog_Alert = 0x7f0d0111; public static final int ThemeOverlay_AppCompat_Light = 0x7f0d0112; public static final int Theme_AppCompat = 0x7f0d00f5; public static final int Theme_AppCompat_CompactMenu = 0x7f0d00f6; public static final int Theme_AppCompat_DayNight = 0x7f0d00f7; public static final int Theme_AppCompat_DayNight_DarkActionBar = 0x7f0d00f8; public static final int Theme_AppCompat_DayNight_Dialog = 0x7f0d00f9; public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 0x7f0d00fc; public static final int Theme_AppCompat_DayNight_Dialog_Alert = 0x7f0d00fa; public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 0x7f0d00fb; public static final int Theme_AppCompat_DayNight_NoActionBar = 0x7f0d00fd; public static final int Theme_AppCompat_Dialog = 0x7f0d00fe; public static final int Theme_AppCompat_DialogWhenLarge = 0x7f0d0101; public static final int Theme_AppCompat_Dialog_Alert = 0x7f0d00ff; public static final int Theme_AppCompat_Dialog_MinWidth = 0x7f0d0100; public static final int Theme_AppCompat_Light = 0x7f0d0102; public static final int Theme_AppCompat_Light_DarkActionBar = 0x7f0d0103; public static final int Theme_AppCompat_Light_Dialog = 0x7f0d0104; public static final int Theme_AppCompat_Light_DialogWhenLarge = 0x7f0d0107; public static final int Theme_AppCompat_Light_Dialog_Alert = 0x7f0d0105; public static final int Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0d0106; public static final int Theme_AppCompat_Light_NoActionBar = 0x7f0d0108; public static final int Theme_AppCompat_NoActionBar = 0x7f0d0109; public static final int Widget_AppCompat_ActionBar = 0x7f0d0113; public static final int Widget_AppCompat_ActionBar_Solid = 0x7f0d0114; public static final int Widget_AppCompat_ActionBar_TabBar = 0x7f0d0115; public static final int Widget_AppCompat_ActionBar_TabText = 0x7f0d0116; public static final int Widget_AppCompat_ActionBar_TabView = 0x7f0d0117; public static final int Widget_AppCompat_ActionButton = 0x7f0d0118; public static final int Widget_AppCompat_ActionButton_CloseMode = 0x7f0d0119; public static final int Widget_AppCompat_ActionButton_Overflow = 0x7f0d011a; public static final int Widget_AppCompat_ActionMode = 0x7f0d011b; public static final int Widget_AppCompat_ActivityChooserView = 0x7f0d011c; public static final int Widget_AppCompat_AutoCompleteTextView = 0x7f0d011d; public static final int Widget_AppCompat_Button = 0x7f0d011e; public static final int Widget_AppCompat_ButtonBar = 0x7f0d0124; public static final int Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0d0125; public static final int Widget_AppCompat_Button_Borderless = 0x7f0d011f; public static final int Widget_AppCompat_Button_Borderless_Colored = 0x7f0d0120; public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0d0121; public static final int Widget_AppCompat_Button_Colored = 0x7f0d0122; public static final int Widget_AppCompat_Button_Small = 0x7f0d0123; public static final int Widget_AppCompat_CompoundButton_CheckBox = 0x7f0d0126; public static final int Widget_AppCompat_CompoundButton_RadioButton = 0x7f0d0127; public static final int Widget_AppCompat_CompoundButton_Switch = 0x7f0d0128; public static final int Widget_AppCompat_DrawerArrowToggle = 0x7f0d0129; public static final int Widget_AppCompat_DropDownItem_Spinner = 0x7f0d012a; public static final int Widget_AppCompat_EditText = 0x7f0d012b; public static final int Widget_AppCompat_ImageButton = 0x7f0d012c; public static final int Widget_AppCompat_Light_ActionBar = 0x7f0d012d; public static final int Widget_AppCompat_Light_ActionBar_Solid = 0x7f0d012e; public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f0d012f; public static final int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0d0130; public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f0d0131; public static final int Widget_AppCompat_Light_ActionBar_TabText = 0x7f0d0132; public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0d0133; public static final int Widget_AppCompat_Light_ActionBar_TabView = 0x7f0d0134; public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f0d0135; public static final int Widget_AppCompat_Light_ActionButton = 0x7f0d0136; public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f0d0137; public static final int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f0d0138; public static final int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f0d0139; public static final int Widget_AppCompat_Light_ActivityChooserView = 0x7f0d013a; public static final int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f0d013b; public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f0d013c; public static final int Widget_AppCompat_Light_ListPopupWindow = 0x7f0d013d; public static final int Widget_AppCompat_Light_ListView_DropDown = 0x7f0d013e; public static final int Widget_AppCompat_Light_PopupMenu = 0x7f0d013f; public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0d0140; public static final int Widget_AppCompat_Light_SearchView = 0x7f0d0141; public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f0d0142; public static final int Widget_AppCompat_ListMenuView = 0x7f0d0143; public static final int Widget_AppCompat_ListPopupWindow = 0x7f0d0144; public static final int Widget_AppCompat_ListView = 0x7f0d0145; public static final int Widget_AppCompat_ListView_DropDown = 0x7f0d0146; public static final int Widget_AppCompat_ListView_Menu = 0x7f0d0147; public static final int Widget_AppCompat_PopupMenu = 0x7f0d0148; public static final int Widget_AppCompat_PopupMenu_Overflow = 0x7f0d0149; public static final int Widget_AppCompat_PopupWindow = 0x7f0d014a; public static final int Widget_AppCompat_ProgressBar = 0x7f0d014b; public static final int Widget_AppCompat_ProgressBar_Horizontal = 0x7f0d014c; public static final int Widget_AppCompat_RatingBar = 0x7f0d014d; public static final int Widget_AppCompat_RatingBar_Indicator = 0x7f0d014e; public static final int Widget_AppCompat_RatingBar_Small = 0x7f0d014f; public static final int Widget_AppCompat_SearchView = 0x7f0d0150; public static final int Widget_AppCompat_SearchView_ActionBar = 0x7f0d0151; public static final int Widget_AppCompat_SeekBar = 0x7f0d0152; public static final int Widget_AppCompat_SeekBar_Discrete = 0x7f0d0153; public static final int Widget_AppCompat_Spinner = 0x7f0d0154; public static final int Widget_AppCompat_Spinner_DropDown = 0x7f0d0155; public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f0d0156; public static final int Widget_AppCompat_Spinner_Underlined = 0x7f0d0157; public static final int Widget_AppCompat_TextView = 0x7f0d0158; public static final int Widget_AppCompat_TextView_SpinnerItem = 0x7f0d0159; public static final int Widget_AppCompat_Toolbar = 0x7f0d015a; public static final int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0d015b; public static final int Widget_Compat_NotificationActionContainer = 0x7f0d015c; public static final int Widget_Compat_NotificationActionText = 0x7f0d015d; } public static final class styleable { private styleable() {} public static final int[] ActionBar = { 0x7f020031, 0x7f020032, 0x7f020033, 0x7f02005e, 0x7f02005f, 0x7f020060, 0x7f020061, 0x7f020062, 0x7f020063, 0x7f020065, 0x7f02006a, 0x7f02006b, 0x7f02007e, 0x7f02008f, 0x7f020090, 0x7f020091, 0x7f020092, 0x7f020093, 0x7f020098, 0x7f02009b, 0x7f0200e0, 0x7f0200e8, 0x7f0200f3, 0x7f0200f6, 0x7f0200f7, 0x7f020111, 0x7f020114, 0x7f020130, 0x7f020139 }; public static final int ActionBar_background = 0; public static final int ActionBar_backgroundSplit = 1; public static final int ActionBar_backgroundStacked = 2; public static final int ActionBar_contentInsetEnd = 3; public static final int ActionBar_contentInsetEndWithActions = 4; public static final int ActionBar_contentInsetLeft = 5; public static final int ActionBar_contentInsetRight = 6; public static final int ActionBar_contentInsetStart = 7; public static final int ActionBar_contentInsetStartWithNavigation = 8; public static final int ActionBar_customNavigationLayout = 9; public static final int ActionBar_displayOptions = 10; public static final int ActionBar_divider = 11; public static final int ActionBar_elevation = 12; public static final int ActionBar_height = 13; public static final int ActionBar_hideOnContentScroll = 14; public static final int ActionBar_homeAsUpIndicator = 15; public static final int ActionBar_homeLayout = 16; public static final int ActionBar_icon = 17; public static final int ActionBar_indeterminateProgressStyle = 18; public static final int ActionBar_itemPadding = 19; public static final int ActionBar_logo = 20; public static final int ActionBar_navigationMode = 21; public static final int ActionBar_popupTheme = 22; public static final int ActionBar_progressBarPadding = 23; public static final int ActionBar_progressBarStyle = 24; public static final int ActionBar_subtitle = 25; public static final int ActionBar_subtitleTextStyle = 26; public static final int ActionBar_title = 27; public static final int ActionBar_titleTextStyle = 28; public static final int[] ActionBarLayout = { 0x10100b3 }; public static final int ActionBarLayout_android_layout_gravity = 0; public static final int[] ActionMenuItemView = { 0x101013f }; public static final int ActionMenuItemView_android_minWidth = 0; public static final int[] ActionMenuView = { }; public static final int[] ActionMode = { 0x7f020031, 0x7f020032, 0x7f02004b, 0x7f02008f, 0x7f020114, 0x7f020139 }; public static final int ActionMode_background = 0; public static final int ActionMode_backgroundSplit = 1; public static final int ActionMode_closeItemLayout = 2; public static final int ActionMode_height = 3; public static final int ActionMode_subtitleTextStyle = 4; public static final int ActionMode_titleTextStyle = 5; public static final int[] ActivityChooserView = { 0x7f020080, 0x7f020099 }; public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 0; public static final int ActivityChooserView_initialActivityCount = 1; public static final int[] AlertDialog = { 0x10100f2, 0x7f020041, 0x7f020042, 0x7f0200d5, 0x7f0200d6, 0x7f0200e5, 0x7f020107, 0x7f020108 }; public static final int AlertDialog_android_layout = 0; public static final int AlertDialog_buttonIconDimen = 1; public static final int AlertDialog_buttonPanelSideLayout = 2; public static final int AlertDialog_listItemLayout = 3; public static final int AlertDialog_listLayout = 4; public static final int AlertDialog_multiChoiceItemLayout = 5; public static final int AlertDialog_showTitle = 6; public static final int AlertDialog_singleChoiceItemLayout = 7; public static final int[] AnimatedStateListDrawableCompat = { 0x101011c, 0x1010194, 0x1010195, 0x1010196, 0x101030c, 0x101030d }; public static final int AnimatedStateListDrawableCompat_android_dither = 0; public static final int AnimatedStateListDrawableCompat_android_visible = 1; public static final int AnimatedStateListDrawableCompat_android_variablePadding = 2; public static final int AnimatedStateListDrawableCompat_android_constantSize = 3; public static final int AnimatedStateListDrawableCompat_android_enterFadeDuration = 4; public static final int AnimatedStateListDrawableCompat_android_exitFadeDuration = 5; public static final int[] AnimatedStateListDrawableItem = { 0x10100d0, 0x1010199 }; public static final int AnimatedStateListDrawableItem_android_id = 0; public static final int AnimatedStateListDrawableItem_android_drawable = 1; public static final int[] AnimatedStateListDrawableTransition = { 0x1010199, 0x1010449, 0x101044a, 0x101044b }; public static final int AnimatedStateListDrawableTransition_android_drawable = 0; public static final int AnimatedStateListDrawableTransition_android_toId = 1; public static final int AnimatedStateListDrawableTransition_android_fromId = 2; public static final int AnimatedStateListDrawableTransition_android_reversible = 3; public static final int[] AppCompatImageView = { 0x1010119, 0x7f02010d, 0x7f02012e, 0x7f02012f }; public static final int AppCompatImageView_android_src = 0; public static final int AppCompatImageView_srcCompat = 1; public static final int AppCompatImageView_tint = 2; public static final int AppCompatImageView_tintMode = 3; public static final int[] AppCompatSeekBar = { 0x1010142, 0x7f02012b, 0x7f02012c, 0x7f02012d }; public static final int AppCompatSeekBar_android_thumb = 0; public static final int AppCompatSeekBar_tickMark = 1; public static final int AppCompatSeekBar_tickMarkTint = 2; public static final int AppCompatSeekBar_tickMarkTintMode = 3; public static final int[] AppCompatTextHelper = { 0x1010034, 0x101016d, 0x101016e, 0x101016f, 0x1010170, 0x1010392, 0x1010393 }; public static final int AppCompatTextHelper_android_textAppearance = 0; public static final int AppCompatTextHelper_android_drawableTop = 1; public static final int AppCompatTextHelper_android_drawableBottom = 2; public static final int AppCompatTextHelper_android_drawableLeft = 3; public static final int AppCompatTextHelper_android_drawableRight = 4; public static final int AppCompatTextHelper_android_drawableStart = 5; public static final int AppCompatTextHelper_android_drawableEnd = 6; public static final int[] AppCompatTextView = { 0x1010034, 0x7f02002c, 0x7f02002d, 0x7f02002e, 0x7f02002f, 0x7f020030, 0x7f02006f, 0x7f020070, 0x7f020071, 0x7f020072, 0x7f020074, 0x7f020075, 0x7f020076, 0x7f020077, 0x7f020081, 0x7f020083, 0x7f02008b, 0x7f02009c, 0x7f0200d0, 0x7f02011a, 0x7f020125 }; public static final int AppCompatTextView_android_textAppearance = 0; public static final int AppCompatTextView_autoSizeMaxTextSize = 1; public static final int AppCompatTextView_autoSizeMinTextSize = 2; public static final int AppCompatTextView_autoSizePresetSizes = 3; public static final int AppCompatTextView_autoSizeStepGranularity = 4; public static final int AppCompatTextView_autoSizeTextType = 5; public static final int AppCompatTextView_drawableBottomCompat = 6; public static final int AppCompatTextView_drawableEndCompat = 7; public static final int AppCompatTextView_drawableLeftCompat = 8; public static final int AppCompatTextView_drawableRightCompat = 9; public static final int AppCompatTextView_drawableStartCompat = 10; public static final int AppCompatTextView_drawableTint = 11; public static final int AppCompatTextView_drawableTintMode = 12; public static final int AppCompatTextView_drawableTopCompat = 13; public static final int AppCompatTextView_firstBaselineToTopHeight = 14; public static final int AppCompatTextView_fontFamily = 15; public static final int AppCompatTextView_fontVariationSettings = 16; public static final int AppCompatTextView_lastBaselineToBottomHeight = 17; public static final int AppCompatTextView_lineHeight = 18; public static final int AppCompatTextView_textAllCaps = 19; public static final int AppCompatTextView_textLocale = 20; public static final int[] AppCompatTheme = { 0x1010057, 0x10100ae, 0x7f020000, 0x7f020001, 0x7f020002, 0x7f020003, 0x7f020004, 0x7f020005, 0x7f020006, 0x7f020007, 0x7f020008, 0x7f020009, 0x7f02000a, 0x7f02000b, 0x7f02000c, 0x7f02000e, 0x7f02000f, 0x7f020010, 0x7f020011, 0x7f020012, 0x7f020013, 0x7f020014, 0x7f020015, 0x7f020016, 0x7f020017, 0x7f020018, 0x7f020019, 0x7f02001a, 0x7f02001b, 0x7f02001c, 0x7f02001d, 0x7f02001e, 0x7f020021, 0x7f020022, 0x7f020023, 0x7f020024, 0x7f020025, 0x7f02002b, 0x7f020039, 0x7f02003a, 0x7f02003b, 0x7f02003c, 0x7f02003d, 0x7f02003e, 0x7f020043, 0x7f020044, 0x7f020048, 0x7f020049, 0x7f02004f, 0x7f020050, 0x7f020051, 0x7f020052, 0x7f020053, 0x7f020054, 0x7f020055, 0x7f020056, 0x7f020057, 0x7f020058, 0x7f020064, 0x7f020067, 0x7f020068, 0x7f020069, 0x7f02006c, 0x7f02006e, 0x7f020079, 0x7f02007a, 0x7f02007b, 0x7f02007c, 0x7f02007d, 0x7f020091, 0x7f020097, 0x7f0200d1, 0x7f0200d2, 0x7f0200d3, 0x7f0200d4, 0x7f0200d7, 0x7f0200d8, 0x7f0200d9, 0x7f0200da, 0x7f0200db, 0x7f0200dc, 0x7f0200dd, 0x7f0200de, 0x7f0200df, 0x7f0200ef, 0x7f0200f0, 0x7f0200f1, 0x7f0200f2, 0x7f0200f4, 0x7f0200fa, 0x7f0200fb, 0x7f0200fc, 0x7f0200fd, 0x7f020100, 0x7f020101, 0x7f020102, 0x7f020103, 0x7f02010a, 0x7f02010b, 0x7f020118, 0x7f02011b, 0x7f02011c, 0x7f02011d, 0x7f02011e, 0x7f02011f, 0x7f020120, 0x7f020121, 0x7f020122, 0x7f020123, 0x7f020124, 0x7f02013a, 0x7f02013b, 0x7f02013c, 0x7f02013d, 0x7f020143, 0x7f020145, 0x7f020146, 0x7f020147, 0x7f020148, 0x7f020149, 0x7f02014a, 0x7f02014b, 0x7f02014c, 0x7f02014d, 0x7f02014e }; public static final int AppCompatTheme_android_windowIsFloating = 0; public static final int AppCompatTheme_android_windowAnimationStyle = 1; public static final int AppCompatTheme_actionBarDivider = 2; public static final int AppCompatTheme_actionBarItemBackground = 3; public static final int AppCompatTheme_actionBarPopupTheme = 4; public static final int AppCompatTheme_actionBarSize = 5; public static final int AppCompatTheme_actionBarSplitStyle = 6; public static final int AppCompatTheme_actionBarStyle = 7; public static final int AppCompatTheme_actionBarTabBarStyle = 8; public static final int AppCompatTheme_actionBarTabStyle = 9; public static final int AppCompatTheme_actionBarTabTextStyle = 10; public static final int AppCompatTheme_actionBarTheme = 11; public static final int AppCompatTheme_actionBarWidgetTheme = 12; public static final int AppCompatTheme_actionButtonStyle = 13; public static final int AppCompatTheme_actionDropDownStyle = 14; public static final int AppCompatTheme_actionMenuTextAppearance = 15; public static final int AppCompatTheme_actionMenuTextColor = 16; public static final int AppCompatTheme_actionModeBackground = 17; public static final int AppCompatTheme_actionModeCloseButtonStyle = 18; public static final int AppCompatTheme_actionModeCloseDrawable = 19; public static final int AppCompatTheme_actionModeCopyDrawable = 20; public static final int AppCompatTheme_actionModeCutDrawable = 21; public static final int AppCompatTheme_actionModeFindDrawable = 22; public static final int AppCompatTheme_actionModePasteDrawable = 23; public static final int AppCompatTheme_actionModePopupWindowStyle = 24; public static final int AppCompatTheme_actionModeSelectAllDrawable = 25; public static final int AppCompatTheme_actionModeShareDrawable = 26; public static final int AppCompatTheme_actionModeSplitBackground = 27; public static final int AppCompatTheme_actionModeStyle = 28; public static final int AppCompatTheme_actionModeWebSearchDrawable = 29; public static final int AppCompatTheme_actionOverflowButtonStyle = 30; public static final int AppCompatTheme_actionOverflowMenuStyle = 31; public static final int AppCompatTheme_activityChooserViewStyle = 32; public static final int AppCompatTheme_alertDialogButtonGroupStyle = 33; public static final int AppCompatTheme_alertDialogCenterButtons = 34; public static final int AppCompatTheme_alertDialogStyle = 35; public static final int AppCompatTheme_alertDialogTheme = 36; public static final int AppCompatTheme_autoCompleteTextViewStyle = 37; public static final int AppCompatTheme_borderlessButtonStyle = 38; public static final int AppCompatTheme_buttonBarButtonStyle = 39; public static final int AppCompatTheme_buttonBarNegativeButtonStyle = 40; public static final int AppCompatTheme_buttonBarNeutralButtonStyle = 41; public static final int AppCompatTheme_buttonBarPositiveButtonStyle = 42; public static final int AppCompatTheme_buttonBarStyle = 43; public static final int AppCompatTheme_buttonStyle = 44; public static final int AppCompatTheme_buttonStyleSmall = 45; public static final int AppCompatTheme_checkboxStyle = 46; public static final int AppCompatTheme_checkedTextViewStyle = 47; public static final int AppCompatTheme_colorAccent = 48; public static final int AppCompatTheme_colorBackgroundFloating = 49; public static final int AppCompatTheme_colorButtonNormal = 50; public static final int AppCompatTheme_colorControlActivated = 51; public static final int AppCompatTheme_colorControlHighlight = 52; public static final int AppCompatTheme_colorControlNormal = 53; public static final int AppCompatTheme_colorError = 54; public static final int AppCompatTheme_colorPrimary = 55; public static final int AppCompatTheme_colorPrimaryDark = 56; public static final int AppCompatTheme_colorSwitchThumbNormal = 57; public static final int AppCompatTheme_controlBackground = 58; public static final int AppCompatTheme_dialogCornerRadius = 59; public static final int AppCompatTheme_dialogPreferredPadding = 60; public static final int AppCompatTheme_dialogTheme = 61; public static final int AppCompatTheme_dividerHorizontal = 62; public static final int AppCompatTheme_dividerVertical = 63; public static final int AppCompatTheme_dropDownListViewStyle = 64; public static final int AppCompatTheme_dropdownListPreferredItemHeight = 65; public static final int AppCompatTheme_editTextBackground = 66; public static final int AppCompatTheme_editTextColor = 67; public static final int AppCompatTheme_editTextStyle = 68; public static final int AppCompatTheme_homeAsUpIndicator = 69; public static final int AppCompatTheme_imageButtonStyle = 70; public static final int AppCompatTheme_listChoiceBackgroundIndicator = 71; public static final int AppCompatTheme_listChoiceIndicatorMultipleAnimated = 72; public static final int AppCompatTheme_listChoiceIndicatorSingleAnimated = 73; public static final int AppCompatTheme_listDividerAlertDialog = 74; public static final int AppCompatTheme_listMenuViewStyle = 75; public static final int AppCompatTheme_listPopupWindowStyle = 76; public static final int AppCompatTheme_listPreferredItemHeight = 77; public static final int AppCompatTheme_listPreferredItemHeightLarge = 78; public static final int AppCompatTheme_listPreferredItemHeightSmall = 79; public static final int AppCompatTheme_listPreferredItemPaddingEnd = 80; public static final int AppCompatTheme_listPreferredItemPaddingLeft = 81; public static final int AppCompatTheme_listPreferredItemPaddingRight = 82; public static final int AppCompatTheme_listPreferredItemPaddingStart = 83; public static final int AppCompatTheme_panelBackground = 84; public static final int AppCompatTheme_panelMenuListTheme = 85; public static final int AppCompatTheme_panelMenuListWidth = 86; public static final int AppCompatTheme_popupMenuStyle = 87; public static final int AppCompatTheme_popupWindowStyle = 88; public static final int AppCompatTheme_radioButtonStyle = 89; public static final int AppCompatTheme_ratingBarStyle = 90; public static final int AppCompatTheme_ratingBarStyleIndicator = 91; public static final int AppCompatTheme_ratingBarStyleSmall = 92; public static final int AppCompatTheme_searchViewStyle = 93; public static final int AppCompatTheme_seekBarStyle = 94; public static final int AppCompatTheme_selectableItemBackground = 95; public static final int AppCompatTheme_selectableItemBackgroundBorderless = 96; public static final int AppCompatTheme_spinnerDropDownItemStyle = 97; public static final int AppCompatTheme_spinnerStyle = 98; public static final int AppCompatTheme_switchStyle = 99; public static final int AppCompatTheme_textAppearanceLargePopupMenu = 100; public static final int AppCompatTheme_textAppearanceListItem = 101; public static final int AppCompatTheme_textAppearanceListItemSecondary = 102; public static final int AppCompatTheme_textAppearanceListItemSmall = 103; public static final int AppCompatTheme_textAppearancePopupMenuHeader = 104; public static final int AppCompatTheme_textAppearanceSearchResultSubtitle = 105; public static final int AppCompatTheme_textAppearanceSearchResultTitle = 106; public static final int AppCompatTheme_textAppearanceSmallPopupMenu = 107; public static final int AppCompatTheme_textColorAlertDialogListItem = 108; public static final int AppCompatTheme_textColorSearchUrl = 109; public static final int AppCompatTheme_toolbarNavigationButtonStyle = 110; public static final int AppCompatTheme_toolbarStyle = 111; public static final int AppCompatTheme_tooltipForegroundColor = 112; public static final int AppCompatTheme_tooltipFrameBackground = 113; public static final int AppCompatTheme_viewInflaterClass = 114; public static final int AppCompatTheme_windowActionBar = 115; public static final int AppCompatTheme_windowActionBarOverlay = 116; public static final int AppCompatTheme_windowActionModeOverlay = 117; public static final int AppCompatTheme_windowFixedHeightMajor = 118; public static final int AppCompatTheme_windowFixedHeightMinor = 119; public static final int AppCompatTheme_windowFixedWidthMajor = 120; public static final int AppCompatTheme_windowFixedWidthMinor = 121; public static final int AppCompatTheme_windowMinWidthMajor = 122; public static final int AppCompatTheme_windowMinWidthMinor = 123; public static final int AppCompatTheme_windowNoTitle = 124; public static final int[] ButtonBarLayout = { 0x7f020026 }; public static final int ButtonBarLayout_allowStacking = 0; public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] CompoundButton = { 0x1010107, 0x7f02003f, 0x7f020045, 0x7f020046 }; public static final int CompoundButton_android_button = 0; public static final int CompoundButton_buttonCompat = 1; public static final int CompoundButton_buttonTint = 2; public static final int CompoundButton_buttonTintMode = 3; public static final int[] DrawerArrowToggle = { 0x7f020029, 0x7f02002a, 0x7f020036, 0x7f02004e, 0x7f020073, 0x7f02008d, 0x7f020109, 0x7f020127 }; public static final int DrawerArrowToggle_arrowHeadLength = 0; public static final int DrawerArrowToggle_arrowShaftLength = 1; public static final int DrawerArrowToggle_barLength = 2; public static final int DrawerArrowToggle_color = 3; public static final int DrawerArrowToggle_drawableSize = 4; public static final int DrawerArrowToggle_gapBetweenBars = 5; public static final int DrawerArrowToggle_spinBars = 6; public static final int DrawerArrowToggle_thickness = 7; public static final int[] FontFamily = { 0x7f020084, 0x7f020085, 0x7f020086, 0x7f020087, 0x7f020088, 0x7f020089 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f020082, 0x7f02008a, 0x7f02008b, 0x7f02008c, 0x7f020142 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; public static final int[] LinearLayoutCompat = { 0x10100af, 0x10100c4, 0x1010126, 0x1010127, 0x1010128, 0x7f02006b, 0x7f02006d, 0x7f0200e3, 0x7f020105 }; public static final int LinearLayoutCompat_android_gravity = 0; public static final int LinearLayoutCompat_android_orientation = 1; public static final int LinearLayoutCompat_android_baselineAligned = 2; public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3; public static final int LinearLayoutCompat_android_weightSum = 4; public static final int LinearLayoutCompat_divider = 5; public static final int LinearLayoutCompat_dividerPadding = 6; public static final int LinearLayoutCompat_measureWithLargestChild = 7; public static final int LinearLayoutCompat_showDividers = 8; public static final int[] LinearLayoutCompat_Layout = { 0x10100b3, 0x10100f4, 0x10100f5, 0x1010181 }; public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0; public static final int LinearLayoutCompat_Layout_android_layout_width = 1; public static final int LinearLayoutCompat_Layout_android_layout_height = 2; public static final int LinearLayoutCompat_Layout_android_layout_weight = 3; public static final int[] ListPopupWindow = { 0x10102ac, 0x10102ad }; public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0; public static final int ListPopupWindow_android_dropDownVerticalOffset = 1; public static final int[] MenuGroup = { 0x101000e, 0x10100d0, 0x1010194, 0x10101de, 0x10101df, 0x10101e0 }; public static final int MenuGroup_android_enabled = 0; public static final int MenuGroup_android_id = 1; public static final int MenuGroup_android_visible = 2; public static final int MenuGroup_android_menuCategory = 3; public static final int MenuGroup_android_orderInCategory = 4; public static final int MenuGroup_android_checkableBehavior = 5; public static final int[] MenuItem = { 0x1010002, 0x101000e, 0x10100d0, 0x1010106, 0x1010194, 0x10101de, 0x10101df, 0x10101e1, 0x10101e2, 0x10101e3, 0x10101e4, 0x10101e5, 0x101026f, 0x7f02000d, 0x7f02001f, 0x7f020020, 0x7f020028, 0x7f02005d, 0x7f020094, 0x7f020095, 0x7f0200e9, 0x7f020104, 0x7f02013e }; public static final int MenuItem_android_icon = 0; public static final int MenuItem_android_enabled = 1; public static final int MenuItem_android_id = 2; public static final int MenuItem_android_checked = 3; public static final int MenuItem_android_visible = 4; public static final int MenuItem_android_menuCategory = 5; public static final int MenuItem_android_orderInCategory = 6; public static final int MenuItem_android_title = 7; public static final int MenuItem_android_titleCondensed = 8; public static final int MenuItem_android_alphabeticShortcut = 9; public static final int MenuItem_android_numericShortcut = 10; public static final int MenuItem_android_checkable = 11; public static final int MenuItem_android_onClick = 12; public static final int MenuItem_actionLayout = 13; public static final int MenuItem_actionProviderClass = 14; public static final int MenuItem_actionViewClass = 15; public static final int MenuItem_alphabeticModifiers = 16; public static final int MenuItem_contentDescription = 17; public static final int MenuItem_iconTint = 18; public static final int MenuItem_iconTintMode = 19; public static final int MenuItem_numericModifiers = 20; public static final int MenuItem_showAsAction = 21; public static final int MenuItem_tooltipText = 22; public static final int[] MenuView = { 0x10100ae, 0x101012c, 0x101012d, 0x101012e, 0x101012f, 0x1010130, 0x1010131, 0x7f0200f5, 0x7f02010f }; public static final int MenuView_android_windowAnimationStyle = 0; public static final int MenuView_android_itemTextAppearance = 1; public static final int MenuView_android_horizontalDivider = 2; public static final int MenuView_android_verticalDivider = 3; public static final int MenuView_android_headerBackground = 4; public static final int MenuView_android_itemBackground = 5; public static final int MenuView_android_itemIconDisabledAlpha = 6; public static final int MenuView_preserveIconSpacing = 7; public static final int MenuView_subMenuArrow = 8; public static final int[] PopupWindow = { 0x1010176, 0x10102c9, 0x7f0200ea }; public static final int PopupWindow_android_popupBackground = 0; public static final int PopupWindow_android_popupAnimationStyle = 1; public static final int PopupWindow_overlapAnchor = 2; public static final int[] PopupWindowBackgroundState = { 0x7f02010e }; public static final int PopupWindowBackgroundState_state_above_anchor = 0; public static final int[] RecycleListView = { 0x7f0200eb, 0x7f0200ee }; public static final int RecycleListView_paddingBottomNoButtons = 0; public static final int RecycleListView_paddingTopNoTitle = 1; public static final int[] SearchView = { 0x10100da, 0x101011f, 0x1010220, 0x1010264, 0x7f02004a, 0x7f020059, 0x7f020066, 0x7f02008e, 0x7f020096, 0x7f02009d, 0x7f0200f8, 0x7f0200f9, 0x7f0200fe, 0x7f0200ff, 0x7f020110, 0x7f020115, 0x7f020144 }; public static final int SearchView_android_focusable = 0; public static final int SearchView_android_maxWidth = 1; public static final int SearchView_android_inputType = 2; public static final int SearchView_android_imeOptions = 3; public static final int SearchView_closeIcon = 4; public static final int SearchView_commitIcon = 5; public static final int SearchView_defaultQueryHint = 6; public static final int SearchView_goIcon = 7; public static final int SearchView_iconifiedByDefault = 8; public static final int SearchView_layout = 9; public static final int SearchView_queryBackground = 10; public static final int SearchView_queryHint = 11; public static final int SearchView_searchHintIcon = 12; public static final int SearchView_searchIcon = 13; public static final int SearchView_submitBackground = 14; public static final int SearchView_suggestionRowLayout = 15; public static final int SearchView_voiceIcon = 16; public static final int[] Spinner = { 0x10100b2, 0x1010176, 0x101017b, 0x1010262, 0x7f0200f3 }; public static final int Spinner_android_entries = 0; public static final int Spinner_android_popupBackground = 1; public static final int Spinner_android_prompt = 2; public static final int Spinner_android_dropDownWidth = 3; public static final int Spinner_popupTheme = 4; public static final int[] StateListDrawable = { 0x101011c, 0x1010194, 0x1010195, 0x1010196, 0x101030c, 0x101030d }; public static final int StateListDrawable_android_dither = 0; public static final int StateListDrawable_android_visible = 1; public static final int StateListDrawable_android_variablePadding = 2; public static final int StateListDrawable_android_constantSize = 3; public static final int StateListDrawable_android_enterFadeDuration = 4; public static final int StateListDrawable_android_exitFadeDuration = 5; public static final int[] StateListDrawableItem = { 0x1010199 }; public static final int StateListDrawableItem_android_drawable = 0; public static final int[] SwitchCompat = { 0x1010124, 0x1010125, 0x1010142, 0x7f020106, 0x7f02010c, 0x7f020116, 0x7f020117, 0x7f020119, 0x7f020128, 0x7f020129, 0x7f02012a, 0x7f02013f, 0x7f020140, 0x7f020141 }; public static final int SwitchCompat_android_textOn = 0; public static final int SwitchCompat_android_textOff = 1; public static final int SwitchCompat_android_thumb = 2; public static final int SwitchCompat_showText = 3; public static final int SwitchCompat_splitTrack = 4; public static final int SwitchCompat_switchMinWidth = 5; public static final int SwitchCompat_switchPadding = 6; public static final int SwitchCompat_switchTextAppearance = 7; public static final int SwitchCompat_thumbTextPadding = 8; public static final int SwitchCompat_thumbTint = 9; public static final int SwitchCompat_thumbTintMode = 10; public static final int SwitchCompat_track = 11; public static final int SwitchCompat_trackTint = 12; public static final int SwitchCompat_trackTintMode = 13; public static final int[] TextAppearance = { 0x1010095, 0x1010096, 0x1010097, 0x1010098, 0x101009a, 0x101009b, 0x1010161, 0x1010162, 0x1010163, 0x1010164, 0x10103ac, 0x1010585, 0x7f020083, 0x7f02008b, 0x7f02011a, 0x7f020125 }; public static final int TextAppearance_android_textSize = 0; public static final int TextAppearance_android_typeface = 1; public static final int TextAppearance_android_textStyle = 2; public static final int TextAppearance_android_textColor = 3; public static final int TextAppearance_android_textColorHint = 4; public static final int TextAppearance_android_textColorLink = 5; public static final int TextAppearance_android_shadowColor = 6; public static final int TextAppearance_android_shadowDx = 7; public static final int TextAppearance_android_shadowDy = 8; public static final int TextAppearance_android_shadowRadius = 9; public static final int TextAppearance_android_fontFamily = 10; public static final int TextAppearance_android_textFontWeight = 11; public static final int TextAppearance_fontFamily = 12; public static final int TextAppearance_fontVariationSettings = 13; public static final int TextAppearance_textAllCaps = 14; public static final int TextAppearance_textLocale = 15; public static final int[] Toolbar = { 0x10100af, 0x1010140, 0x7f020040, 0x7f02004c, 0x7f02004d, 0x7f02005e, 0x7f02005f, 0x7f020060, 0x7f020061, 0x7f020062, 0x7f020063, 0x7f0200e0, 0x7f0200e1, 0x7f0200e2, 0x7f0200e4, 0x7f0200e6, 0x7f0200e7, 0x7f0200f3, 0x7f020111, 0x7f020112, 0x7f020113, 0x7f020130, 0x7f020131, 0x7f020132, 0x7f020133, 0x7f020134, 0x7f020135, 0x7f020136, 0x7f020137, 0x7f020138 }; public static final int Toolbar_android_gravity = 0; public static final int Toolbar_android_minHeight = 1; public static final int Toolbar_buttonGravity = 2; public static final int Toolbar_collapseContentDescription = 3; public static final int Toolbar_collapseIcon = 4; public static final int Toolbar_contentInsetEnd = 5; public static final int Toolbar_contentInsetEndWithActions = 6; public static final int Toolbar_contentInsetLeft = 7; public static final int Toolbar_contentInsetRight = 8; public static final int Toolbar_contentInsetStart = 9; public static final int Toolbar_contentInsetStartWithNavigation = 10; public static final int Toolbar_logo = 11; public static final int Toolbar_logoDescription = 12; public static final int Toolbar_maxButtonHeight = 13; public static final int Toolbar_menu = 14; public static final int Toolbar_navigationContentDescription = 15; public static final int Toolbar_navigationIcon = 16; public static final int Toolbar_popupTheme = 17; public static final int Toolbar_subtitle = 18; public static final int Toolbar_subtitleTextAppearance = 19; public static final int Toolbar_subtitleTextColor = 20; public static final int Toolbar_title = 21; public static final int Toolbar_titleMargin = 22; public static final int Toolbar_titleMarginBottom = 23; public static final int Toolbar_titleMarginEnd = 24; public static final int Toolbar_titleMarginStart = 25; public static final int Toolbar_titleMarginTop = 26; public static final int Toolbar_titleMargins = 27; public static final int Toolbar_titleTextAppearance = 28; public static final int Toolbar_titleTextColor = 29; public static final int[] View = { 0x1010000, 0x10100da, 0x7f0200ec, 0x7f0200ed, 0x7f020126 }; public static final int View_android_theme = 0; public static final int View_android_focusable = 1; public static final int View_paddingEnd = 2; public static final int View_paddingStart = 3; public static final int View_theme = 4; public static final int[] ViewBackgroundHelper = { 0x10100d4, 0x7f020034, 0x7f020035 }; public static final int ViewBackgroundHelper_android_background = 0; public static final int ViewBackgroundHelper_backgroundTint = 1; public static final int ViewBackgroundHelper_backgroundTintMode = 2; public static final int[] ViewStubCompat = { 0x10100d0, 0x10100f2, 0x10100f3 }; public static final int ViewStubCompat_android_id = 0; public static final int ViewStubCompat_android_layout = 1; public static final int ViewStubCompat_android_inflatedId = 2; } }
1cc97e3bde3d349140d738e700c7646c285ae676
2ae0165e5f32fa51318f674f94912d977261aec4
/src/Utilities/StopWatch.java
6094b3607fa638ab8fe3973e305ff44c6f1e308d
[]
no_license
ray2000ray/MineSweeperHex
70cbdfc4007bd3712295845dcdce08335fc50f02
bc4403a84bc0e3b8ddeed097a654df8e301f9f36
refs/heads/master
2021-07-02T15:02:35.295476
2017-09-17T14:09:21
2017-09-17T14:09:21
103,832,788
0
0
null
null
null
null
UTF-8
Java
false
false
1,108
java
package Utilities; public class StopWatch { private long startTime; private long stopTime; private boolean isStarted; public StopWatch() { startTime = 0; stopTime = 0; isStarted = false; } public void start() { startTime = System.currentTimeMillis(); stopTime = 0; isStarted = true; } public void stop() { stopTime = System.currentTimeMillis(); isStarted = false; } public long getInMilliseconds() { long res = stopTime - startTime; if(res>0) return res; else if(isStarted) return (System.currentTimeMillis() - startTime); else return 0; } public double getInSeconds() { long res = stopTime - startTime; if(res>0) return res*0.001; else if(isStarted) return (System.currentTimeMillis() - startTime)*0.001; else return 0; } public void reset() { startTime = 0; stopTime = 0; isStarted = false; } }
763b0211c88cb39916ee3621662e529045349fcd
59f50d396f1dc02349ee701ac132af02128fde4e
/src/test/java/com/cos/book/web/BookControllerIntegreTest.java
fd4dede52f22cd6958254c84f93c322590b293bc
[]
no_license
qwq140/junit-test
f5e856bbc142462dc12de11807b93e6f68a046fe
588b24025aa4e1190e50e5c7b3c28683c0b57364
refs/heads/master
2023-03-03T12:01:17.425221
2021-02-10T03:38:59
2021-02-10T03:38:59
337,597,897
0
0
null
null
null
null
UTF-8
Java
false
false
5,154
java
package com.cos.book.web; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.util.ArrayList; import java.util.List; import javax.persistence.EntityManager; import org.hamcrest.Matchers; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.result.MockMvcResultHandlers; import org.springframework.transaction.annotation.Transactional; import com.cos.book.domain.Book; import com.cos.book.domain.BookRepository; import com.fasterxml.jackson.databind.ObjectMapper; @Transactional @AutoConfigureMockMvc @SpringBootTest(webEnvironment = WebEnvironment.MOCK) public class BookControllerIntegreTest { @Autowired private MockMvc mockMvc; @Autowired private BookRepository bookRepository; @Autowired private EntityManager entityManager; @BeforeEach public void init() { entityManager.createNativeQuery("ALTER TABLE book ALTER COLUMN id RESTART WITH 1").executeUpdate(); } @Test public void save_테스트() throws Exception{ //given Book book = new Book(1, "스프링", 4.8, 20000); String content = new ObjectMapper().writeValueAsString(book); // json 데이터 //when ResultActions resultAction = mockMvc.perform(post("/book") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(content) .accept(MediaType.APPLICATION_JSON_UTF8)); //then resultAction .andExpect(status().isCreated()) .andExpect(jsonPath("$.title").value("스프링")) .andDo(MockMvcResultHandlers.print()); } @Test public void findAll_테스트() throws Exception{ // given List<Book> books = new ArrayList<>(); books.add(new Book(1,"스프링부트", 4.8, 20000)); books.add(new Book(2,"리액트", 4.3, 15000)); books.add(new Book(3,"JUnit", 4.6, 12000)); bookRepository.saveAll(books); // when ResultActions resultAction = mockMvc.perform(get("/book") .accept(MediaType.APPLICATION_JSON_UTF8)); // then resultAction .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.hasSize(3))) .andExpect(jsonPath("$.[0].title").value("스프링부트")) .andDo(MockMvcResultHandlers.print()); } @Test public void findById_테스트() throws Exception { // given List<Book> books = new ArrayList<>(); books.add(new Book(1,"스프링부트", 4.8, 20000)); books.add(new Book(2,"리액트", 4.3, 15000)); books.add(new Book(3,"JUnit", 4.6, 12000)); bookRepository.saveAll(books); int id = 2; // when ResultActions resultAction = mockMvc.perform(get("/book/{id}", id) .accept(MediaType.APPLICATION_JSON_UTF8)); // then resultAction .andExpect(status().isOk()) .andExpect(jsonPath("$.title").value("리액트")) .andDo(MockMvcResultHandlers.print()); } @Test public void updateById_테스트() throws Exception { // given List<Book> books = new ArrayList<>(); books.add(new Book(1,"스프링부트", 4.8, 20000)); books.add(new Book(2,"리액트", 4.3, 15000)); books.add(new Book(3,"JUnit", 4.6, 12000)); bookRepository.saveAll(books); int id = 1; Book book = new Book(1,"안드로이드", 4.1, 14000); String content = new ObjectMapper().writeValueAsString(book); // when ResultActions resultAction = mockMvc.perform(put("/book/{id}",id) .contentType(MediaType.APPLICATION_JSON_UTF8) .content(content) .accept(MediaType.APPLICATION_JSON_UTF8)); // then resultAction .andExpect(status().isOk()) .andExpect(jsonPath("$.id").value(1)) .andExpect(jsonPath("$.title").value("안드로이드")) .andDo(MockMvcResultHandlers.print()); } @Test public void deleteById_테스트() throws Exception { // given int id=1; List<Book> books = new ArrayList<>(); books.add(new Book(1,"스프링부트", 4.8, 20000)); books.add(new Book(2,"리액트", 4.3, 15000)); books.add(new Book(3,"JUnit", 4.6, 12000)); bookRepository.saveAll(books); // when ResultActions resultAction = mockMvc.perform(delete("/book/{id}",id) .accept(MediaType.APPLICATION_JSON_UTF8)); // then resultAction .andExpect(status().isOk()) .andExpect(jsonPath("$.data").value("ok")) .andDo(MockMvcResultHandlers.print()); } }
cbdba01a2436d2dba35c0adae0341d10145978c8
6c4224c0c787400fb2d89cea7507201d4cff7937
/gsn/src/org/tempuri/GetSensorByPublisherAndName.java
a4a9bc3132180a91408c0bd66dbe1a5c6ab13ec5
[]
no_license
LSIR/smartd
c0f234bc571435e05867f7a1d789874c16a1dada
8d1665b8e2228c7e85a468c6a3fe964ec19e9528
refs/heads/master
2021-03-13T00:11:44.269999
2014-06-14T11:08:31
2014-06-14T11:08:31
16,531,343
3
2
null
null
null
null
UTF-8
Java
false
false
27,522
java
/** * GetSensorByPublisherAndName.java * * This file was auto-generated from WSDL * by the Apache Axis2 version: 1.4.1 Built on : Aug 13, 2008 (05:03:41 LKT) */ package org.tempuri; /** * GetSensorByPublisherAndName bean class */ public class GetSensorByPublisherAndName implements org.apache.axis2.databinding.ADBBean{ public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( "http://tempuri.org/", "GetSensorByPublisherAndName", "ns1"); private static java.lang.String generatePrefix(java.lang.String namespace) { if(namespace.equals("http://tempuri.org/")){ return "ns1"; } return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } /** * field for PublisherName */ protected java.lang.String localPublisherName ; /* This tracker boolean wil be used to detect whether the user called the set method * for this attribute. It will be used to determine whether to include this field * in the serialized XML */ protected boolean localPublisherNameTracker = false ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getPublisherName(){ return localPublisherName; } /** * Auto generated setter method * @param param PublisherName */ public void setPublisherName(java.lang.String param){ if (param != null){ //update the setting tracker localPublisherNameTracker = true; } else { localPublisherNameTracker = false; } this.localPublisherName=param; } /** * field for SensorName */ protected java.lang.String localSensorName ; /* This tracker boolean wil be used to detect whether the user called the set method * for this attribute. It will be used to determine whether to include this field * in the serialized XML */ protected boolean localSensorNameTracker = false ; /** * Auto generated getter method * @return java.lang.String */ public java.lang.String getSensorName(){ return localSensorName; } /** * Auto generated setter method * @param param SensorName */ public void setSensorName(java.lang.String param){ if (param != null){ //update the setting tracker localSensorNameTracker = true; } else { localSensorNameTracker = false; } this.localSensorName=param; } /** * isReaderMTOMAware * @return true if the reader supports MTOM */ public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { boolean isReaderMTOMAware = false; try{ isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); }catch(java.lang.IllegalArgumentException e){ isReaderMTOMAware = false; } return isReaderMTOMAware; } /** * * @param parentQName * @param factory * @return org.apache.axiom.om.OMElement */ public org.apache.axiom.om.OMElement getOMElement ( final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { GetSensorByPublisherAndName.this.serialize(MY_QNAME,factory,xmlWriter); } }; return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( MY_QNAME,factory,dataSource); } public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ serialize(parentQName,factory,xmlWriter,false); } public void serialize(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory, org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ java.lang.String prefix = null; java.lang.String namespace = null; prefix = parentQName.getPrefix(); namespace = parentQName.getNamespaceURI(); if ((namespace != null) && (namespace.trim().length() > 0)) { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); } else { if (prefix == null) { prefix = generatePrefix(namespace); } xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } } else { xmlWriter.writeStartElement(parentQName.getLocalPart()); } if (serializeType){ java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://tempuri.org/"); if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", namespacePrefix+":GetSensorByPublisherAndName", xmlWriter); } else { writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", "GetSensorByPublisherAndName", xmlWriter); } } if (localPublisherNameTracker){ namespace = "http://tempuri.org/"; if (! namespace.equals("")) { prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { prefix = generatePrefix(namespace); xmlWriter.writeStartElement(prefix,"publisherName", namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } else { xmlWriter.writeStartElement(namespace,"publisherName"); } } else { xmlWriter.writeStartElement("publisherName"); } if (localPublisherName==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("publisherName cannot be null!!"); }else{ xmlWriter.writeCharacters(localPublisherName); } xmlWriter.writeEndElement(); } if (localSensorNameTracker){ namespace = "http://tempuri.org/"; if (! namespace.equals("")) { prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { prefix = generatePrefix(namespace); xmlWriter.writeStartElement(prefix,"sensorName", namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } else { xmlWriter.writeStartElement(namespace,"sensorName"); } } else { xmlWriter.writeStartElement("sensorName"); } if (localSensorName==null){ // write the nil attribute throw new org.apache.axis2.databinding.ADBException("sensorName cannot be null!!"); }else{ xmlWriter.writeCharacters(localSensorName); } xmlWriter.writeEndElement(); } xmlWriter.writeEndElement(); } /** * Util method to write an attribute with the ns prefix */ private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } xmlWriter.writeAttribute(namespace,attName,attValue); } /** * Util method to write an attribute without the ns prefix */ private void writeAttribute(java.lang.String namespace,java.lang.String attName, java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ if (namespace.equals("")) { xmlWriter.writeAttribute(attName,attValue); } else { registerPrefix(xmlWriter, namespace); xmlWriter.writeAttribute(namespace,attName,attValue); } } /** * Util method to write an attribute without the ns prefix */ private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { attributePrefix = registerPrefix(xmlWriter, attributeNamespace); } java.lang.String attributeValue; if (attributePrefix.trim().length() > 0) { attributeValue = attributePrefix + ":" + qname.getLocalPart(); } else { attributeValue = qname.getLocalPart(); } if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { registerPrefix(xmlWriter, namespace); xmlWriter.writeAttribute(namespace, attName, attributeValue); } } /** * method to handle Qnames */ private void writeQName(javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI = qname.getNamespaceURI(); if (namespaceURI != null) { java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); if (prefix == null) { prefix = generatePrefix(namespaceURI); xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix,namespaceURI); } if (prefix.trim().length() > 0){ xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } else { // i.e this is the default namespace xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } else { xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } private void writeQNames(javax.xml.namespace.QName[] qnames, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); java.lang.String namespaceURI = null; java.lang.String prefix = null; for (int i = 0; i < qnames.length; i++) { if (i > 0) { stringToWrite.append(" "); } namespaceURI = qnames[i].getNamespaceURI(); if (namespaceURI != null) { prefix = xmlWriter.getPrefix(namespaceURI); if ((prefix == null) || (prefix.length() == 0)) { prefix = generatePrefix(namespaceURI); xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix,namespaceURI); } if (prefix.trim().length() > 0){ stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } else { stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } } else { stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } } xmlWriter.writeCharacters(stringToWrite.toString()); } } /** * Register a namespace prefix */ private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { prefix = generatePrefix(namespace); while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } return prefix; } /** * databinding method to get an XML representation of this object * */ public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException{ java.util.ArrayList elementList = new java.util.ArrayList(); java.util.ArrayList attribList = new java.util.ArrayList(); if (localPublisherNameTracker){ elementList.add(new javax.xml.namespace.QName("http://tempuri.org/", "publisherName")); if (localPublisherName != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localPublisherName)); } else { throw new org.apache.axis2.databinding.ADBException("publisherName cannot be null!!"); } } if (localSensorNameTracker){ elementList.add(new javax.xml.namespace.QName("http://tempuri.org/", "sensorName")); if (localSensorName != null){ elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localSensorName)); } else { throw new org.apache.axis2.databinding.ADBException("sensorName cannot be null!!"); } } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); } /** * Factory class that keeps the parse method */ public static class Factory{ /** * static method to create the object * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element * Postcondition: If this object is an element, the reader is positioned at its end element * If this object is a complex type, the reader is positioned at the end element of its outer element */ public static GetSensorByPublisherAndName parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ GetSensorByPublisherAndName object = new GetSensorByPublisherAndName(); int event; java.lang.String nillableValue = null; java.lang.String prefix =""; java.lang.String namespaceuri =""; try { while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName!=null){ java.lang.String nsPrefix = null; if (fullTypeName.indexOf(":") > -1){ nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); } nsPrefix = nsPrefix==null?"":nsPrefix; java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); if (!"GetSensorByPublisherAndName".equals(type)){ //find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (GetSensorByPublisherAndName)org.tempuri.ExtensionMapper.getTypeObject( nsUri,type,reader); } } } // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); reader.next(); while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://tempuri.org/","publisherName").equals(reader.getName())){ java.lang.String content = reader.getElementText(); object.setPublisherName( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); reader.next(); } // End of if for expected property start element else { } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement() && new javax.xml.namespace.QName("http://tempuri.org/","sensorName").equals(reader.getName())){ java.lang.String content = reader.getElementText(); object.setSensorName( org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); reader.next(); } // End of if for expected property start element else { } while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); if (reader.isStartElement()) // A start element we are not expecting indicates a trailing invalid property throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } return object; } }//end of factory class }
1342903900cf86869ae36f27fdeb7fb7ece896ae
10048a9f869261fc568f94a050be453b9770b83d
/resources/src/main/java/com/infra/resources/core/usecase/secret/CreateSecret.java
179d5aa2e6c7865209e7c7f4456eb7b2111cc069
[]
no_license
hmalatini/microservices-infrastructure
be765a313c8c9ba687d4099a72d7f2b670c608e3
2e4a36478db9965186264c7e9fb8e3f393ab5107
refs/heads/main
2023-06-15T11:32:20.101064
2021-07-09T14:36:34
2021-07-09T14:36:34
371,738,292
1
1
null
null
null
null
UTF-8
Java
false
false
2,022
java
package com.infra.resources.core.usecase.secret; import com.infra.resources.adapter.controller.secret.SecretCreation; import com.infra.resources.adapter.gateway.deployment.DeploymentGateway; import com.infra.resources.adapter.repository.SecretRepository; import com.infra.resources.core.domain.Microservice; import com.infra.resources.core.domain.Secret; import com.infra.resources.core.exceptions.SecretAlreadyExistsException; import com.infra.resources.core.usecase.microservice.GetMicroservice; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor public class CreateSecret { private final GetMicroservice getMicroservice; private final GetSecret getSecret; private final SecretRepository repository; private final DeploymentGateway deploymentGateway; public Secret execute(SecretCreation creation, String microserviceName) { Microservice microservice = getMicroservice.execute(microserviceName); checkIfExists(microserviceName, creation); Secret secret = getSecretFromCreation(creation, microservice); repository.save(secret); return secret; } private void checkIfExists(String microserviceName, SecretCreation creation) { getSecret.safeExecute(microserviceName, creation.getName()) .ifPresent(secret -> { throw new SecretAlreadyExistsException("secret " + secret.getName() + " already exists"); } ); } private Secret getSecretFromCreation(SecretCreation creation, Microservice microservice) { Secret secret = new Secret(); secret.setName(creation.getName()); secret.setValue(creation.getValue()); secret.setDescription(creation.getDescription()); secret.setSensitive(creation.isSensitive()); secret.setCreatedBy(creation.getCreatedBy()); secret.setMicroserviceName(microservice.getName()); return secret; } }
9309e3354a2ca414282266cef5ba52d929b27f5a
45a7ea4d9df0d8f0f6e6d7dbd489bb75378bd1ac
/src/jungsoo/프로그래머스_예상대진표_이정수.java
120a8e5da75ffe8068e0b7929ade5927cf444195
[]
no_license
EumYoungHyun/algorithm
ab7d276c3e3a1faaa291920c2b4ee9c0b0938438
806fbdf80569ed451910f8c6801a29f720cf149c
refs/heads/master
2020-09-25T21:12:17.152462
2020-03-26T09:56:34
2020-03-26T09:56:34
226,089,555
3
3
null
null
null
null
UTF-8
Java
false
false
594
java
package jungsoo; public class 프로그래머스_예상대진표_이정수 { public int solution(int n, int a, int b) { int answer = 1; while(true){ if(a%2==0 && b%2==1){ if(a-1==b) break; } if(b%2==0 && a%2==1){ if(b-1==a) break; } if(a%2 ==1) a=a+1; if(b%2 ==1) b=b+1; a/=2; b/=2; answer++; } return answer; } }
[ "jsoo9@DESKTOP-L835QCP" ]
jsoo9@DESKTOP-L835QCP
7439dbef35ba9bdbb50d5364fa5d078a87700f5d
02f2d194842343d350013e17645234ebb43f33fa
/src/com/danielkueffer/filehosting/desktop/controller/SetupHomeFolderController.java
a94bc789310f20f16e2ae88c256be82d0aa39c55
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
danielkueffer/filehosting-tool-desktop-client
dfa817ac33bb1d218faf2ce6be5435e4517ce765
d34726f986c0384e1852ac10f0df39211d805791
refs/heads/master
2016-08-11T13:41:33.241300
2015-07-30T06:26:58
2015-07-30T06:26:58
36,792,321
0
0
null
null
null
null
UTF-8
Java
false
false
3,608
java
package com.danielkueffer.filehosting.desktop.controller; import java.io.File; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.AnchorPane; import javafx.stage.DirectoryChooser; import com.danielkueffer.filehosting.desktop.Main; import com.danielkueffer.filehosting.desktop.enums.PropertiesKeys; import com.danielkueffer.filehosting.desktop.enums.TabKeys; import com.danielkueffer.filehosting.desktop.service.PropertyService; /** * The controller to set the URL of the file hosting server * * @author dkueffer * */ public class SetupHomeFolderController extends AnchorPane implements Initializable { @FXML private Label homeFolderTitle; @FXML private Label localFolderLabel; @FXML private Label homeFolderErrorLabel; @FXML private Button connectButton; @FXML private Button backButton; @FXML private Button chooseFolderButton; private ResourceBundle bundle; private Main application; private PropertyService propertyService; /** * Initialize the controller */ @Override public void initialize(URL location, ResourceBundle resources) { this.bundle = resources; this.homeFolderTitle.setText(this.bundle .getString("setupHomeFolderTitle")); this.connectButton.setText(this.bundle.getString("setupConnect")); this.backButton.setText(this.bundle.getString("setupBack")); this.localFolderLabel .setText(this.bundle.getString("setupLocalFolder")); this.chooseFolderButton.setText(this.bundle .getString("setupChooseFolder")); } /** * Set the application * * @param application */ public void setApp(Main application) { this.application = application; } /** * Set the property service * * @param propertyService */ public void setPropertyService(PropertyService propertyService) { this.propertyService = propertyService; String homeFolder = this.propertyService .getProperty(PropertiesKeys.HOME_FOLDER.getValue()); if (homeFolder != null) { this.chooseFolderButton.setText(homeFolder); } if (this.propertyService.getProperty(PropertiesKeys.HOME_FOLDER .getValue()) != null) { this.connectButton.setDisable(false); } } /** * Next button event * * @param evt */ public void connect(ActionEvent evt) { if (this.application == null) { return; } if (this.propertyService.getProperty(PropertiesKeys.HOME_FOLDER .getValue()) != null) { this.application.setSync(true); this.application.goToSettings(TabKeys.USER); } else { this.homeFolderErrorLabel.setText(this.bundle .getString("setupChooseFolderError")); this.homeFolderErrorLabel.setVisible(true); } } /** * Back button event * * @param evt */ public void goToBack(ActionEvent evt) { if (this.application == null) { return; } this.application.goToSetupAccount(); } /** * Choose a directory event * * @param evt */ public void chooseDirectory(ActionEvent evt) { if (this.application == null) { return; } DirectoryChooser dc = new DirectoryChooser(); dc.setTitle(this.bundle.getString("setupChooseFolder")); File dir = dc.showDialog(this.application.getPrimaryStage()); if (dir != null) { String path = dir.getPath(); this.chooseFolderButton.setText(path); this.propertyService.saveProperty( PropertiesKeys.HOME_FOLDER.getValue(), path); this.homeFolderErrorLabel.setVisible(false); this.connectButton.setDisable(false); } } }
e6eaed3f07daffa99595c0a813472ff65527cd1d
184a17f018807aae77d6ab78f8a6d22ea831069a
/com/arenz/spriteeditor/ui/menu/MenuView.java
2c0cbcd1d45dda6ff4b498330db3dbb020fc18aa
[]
no_license
cambouquet/ArenzSpriteEditor
c3c2bde22e4c02fb53660e08b559a742864dde05
92feca9cef75324c2307d1851d7caf201ae1880a
refs/heads/master
2016-09-06T10:22:54.911546
2013-04-28T20:04:48
2013-04-28T20:04:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
/** * */ package com.arenz.spriteeditor.ui.menu; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.io.File; import java.io.IOException; import javax.swing.JFileChooser; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import com.arenz.spriteeditor.controller.menu.MenuController; import com.arenz.spriteeditor.model.Project; import com.arenz.spriteeditor.ui.dialogs.DialogHelper; /** * @author Camille * */ public class MenuView { private JMenuBar menuBar = new JMenuBar(); private JMenu menuProject = new JMenu("Project"); private JMenuItem menuNew = new JMenuItem("New"); private JMenuItem menuSave = new JMenuItem("Save"); private JMenuItem menuOpen = new JMenuItem("Open"); private JMenuItem menuQuit = new JMenuItem("Quit"); public MenuView() { createsMenuItems(); createsMenu(); } private void createsMenu() { menuProject.add(menuNew); menuProject.add(menuSave); menuProject.add(menuOpen); menuProject.add(menuQuit); menuBar.add(menuProject); } private void createsMenuItems() { menuProject.setMnemonic(KeyEvent.VK_P); menuNew.setMnemonic(KeyEvent.VK_N); menuSave.setMnemonic(KeyEvent.VK_S); menuOpen.setMnemonic(KeyEvent.VK_O); menuQuit.setMnemonic(KeyEvent.VK_Q); MenuHelper.setAccelerator(menuNew, KeyEvent.VK_N, KeyEvent.CTRL_MASK); MenuHelper.setAccelerator(menuSave, KeyEvent.VK_S, KeyEvent.CTRL_MASK); MenuHelper.setAccelerator(menuOpen, KeyEvent.VK_O, KeyEvent.CTRL_MASK); MenuHelper.setAccelerator(menuQuit, KeyEvent.VK_Q, KeyEvent.CTRL_MASK); } public JMenuBar getMenuBar() { return this.menuBar; } public void addNewProjectListener(ActionListener newProjectListener) { menuNew.addActionListener(newProjectListener); } public void addSaveProjectListener(ActionListener saveProjectListener) { menuSave.addActionListener(saveProjectListener); } public void addOpenProjectListener(ActionListener loadProjectListener) { menuOpen.addActionListener(loadProjectListener); } public void addQuitProjectListener(ActionListener quitProjectListener) { menuQuit.addActionListener(quitProjectListener); } }
4f2b0df0a32bccc5abe5e71aa6de6fbd4d45d555
3b3cf6ce68e5e0a50a1da4ebdf971fba13147eee
/src/main/java/com/zcy/spring/cloud/initializrstart/vo/Forecast.java
5bd8134e4fd44fa19738b4490e3bed391d10fe9b
[]
no_license
ZCCy/SpringCloud
126f2ca71e6b14514cf85adcd1a41f6eb10909e9
fc745284e27a47574b876a6a8d3d382c4077253c
refs/heads/master
2021-01-02T04:12:13.097483
2020-02-14T07:47:32
2020-02-14T07:47:32
239,484,533
0
0
null
null
null
null
UTF-8
Java
false
false
1,444
java
package com.zcy.spring.cloud.initializrstart.vo; import java.io.Serializable; /** * 未来天气 * @author zcy */ public class Forecast implements Serializable { //private static final long serialVersionUID = 1l ; private String date; private String high; private String fengli; private String low; private String fengxiang; private String type; public String getDate() { return date; } public Forecast setDate(String date) { this.date = date; return this; } public String getHigh() { return high; } public Forecast setHigh(String high) { this.high = high; return this; } public String getFengli() { String num = fengli.substring(9); String str1=num.substring(0, num.indexOf("]")); return str1; } public Forecast setFengli(String fengli) { this.fengli = fengli; return this; } public String getLow() { return low; } public Forecast setLow(String low) { this.low = low; return this; } public String getFengxiang() { return fengxiang; } public Forecast setFengxiang(String fengxiang) { this.fengxiang = fengxiang; return this; } public String getType() { return type; } public Forecast setType(String type) { this.type = type; return this; } }
087d306b9519053c7328cfa2c8e5937955338d18
18070ea8034555c1df888cc63481eb859deba964
/artemis-entity-tracker/src/main/java/net/namekdev/entity_tracker/model/FieldInfo.java
717ab27f16eedc76696fe9409445011a5a6c6770
[]
no_license
Shingayi-Bamhare/artemis-odb-entity-tracker
50c7cdf5bd8ec3bfd3438031934d77c91fbbf4ae
06a348c0a1c9810093a288308ddb77279947e6e7
refs/heads/master
2021-01-13T14:29:43.061981
2016-10-27T08:46:10
2016-10-27T08:46:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
802
java
package net.namekdev.entity_tracker.model; import net.namekdev.entity_tracker.utils.serialization.NetworkSerialization; import com.artemis.utils.reflect.Field; public class FieldInfo { /** Only available on server side. */ public Field field; public boolean isAccessible; public String fieldName; public String classType; public boolean isArray; public int valueType; public static FieldInfo reflectField(Field field) { FieldInfo info = new FieldInfo(); Class<?> type = field.getType(); info.field = field; info.isAccessible = field.isAccessible(); info.fieldName = field.getName(); info.classType = type.getSimpleName(); info.isArray = type.isArray(); info.valueType = NetworkSerialization.determineNetworkType(type); return info; } }
ed856a67dd705789a5ddda893b1f20a22c770f65
a2537cb7cd54b97cdaa890e76065ae006b53765a
/google-api-grpc/proto-google-cloud-dlp-v2beta1/src/main/java/com/google/privacy/dlp/v2beta1/InspectContentResponse.java
0c8b20d4157517b7341837bd4d2cea46ac5dde7d
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
adirastogi/google-cloud-java
bf4872b64d12e82ee2cb75cb613ab50eaa9dcfc5
a8ccbf65412777f99bab110294fb058d9d6fbc5f
refs/heads/master
2020-03-13T23:03:31.597893
2018-05-17T21:54:02
2018-05-17T21:54:02
131,328,327
0
0
null
2018-04-27T17:52:07
2018-04-27T17:52:06
null
UTF-8
Java
false
true
30,557
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/privacy/dlp/v2beta1/dlp.proto package com.google.privacy.dlp.v2beta1; /** * <pre> * Results of inspecting a list of items. * </pre> * * Protobuf type {@code google.privacy.dlp.v2beta1.InspectContentResponse} */ public final class InspectContentResponse extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2beta1.InspectContentResponse) InspectContentResponseOrBuilder { private static final long serialVersionUID = 0L; // Use InspectContentResponse.newBuilder() to construct. private InspectContentResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private InspectContentResponse() { results_ = java.util.Collections.emptyList(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private InspectContentResponse( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 10: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { results_ = new java.util.ArrayList<com.google.privacy.dlp.v2beta1.InspectResult>(); mutable_bitField0_ |= 0x00000001; } results_.add( input.readMessage(com.google.privacy.dlp.v2beta1.InspectResult.parser(), extensionRegistry)); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { results_ = java.util.Collections.unmodifiableList(results_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_InspectContentResponse_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_InspectContentResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.privacy.dlp.v2beta1.InspectContentResponse.class, com.google.privacy.dlp.v2beta1.InspectContentResponse.Builder.class); } public static final int RESULTS_FIELD_NUMBER = 1; private java.util.List<com.google.privacy.dlp.v2beta1.InspectResult> results_; /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public java.util.List<com.google.privacy.dlp.v2beta1.InspectResult> getResultsList() { return results_; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public java.util.List<? extends com.google.privacy.dlp.v2beta1.InspectResultOrBuilder> getResultsOrBuilderList() { return results_; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public int getResultsCount() { return results_.size(); } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public com.google.privacy.dlp.v2beta1.InspectResult getResults(int index) { return results_.get(index); } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public com.google.privacy.dlp.v2beta1.InspectResultOrBuilder getResultsOrBuilder( int index) { return results_.get(index); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < results_.size(); i++) { output.writeMessage(1, results_.get(i)); } unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < results_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, results_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.privacy.dlp.v2beta1.InspectContentResponse)) { return super.equals(obj); } com.google.privacy.dlp.v2beta1.InspectContentResponse other = (com.google.privacy.dlp.v2beta1.InspectContentResponse) obj; boolean result = true; result = result && getResultsList() .equals(other.getResultsList()); result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getResultsCount() > 0) { hash = (37 * hash) + RESULTS_FIELD_NUMBER; hash = (53 * hash) + getResultsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.privacy.dlp.v2beta1.InspectContentResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * Results of inspecting a list of items. * </pre> * * Protobuf type {@code google.privacy.dlp.v2beta1.InspectContentResponse} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2beta1.InspectContentResponse) com.google.privacy.dlp.v2beta1.InspectContentResponseOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_InspectContentResponse_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_InspectContentResponse_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.privacy.dlp.v2beta1.InspectContentResponse.class, com.google.privacy.dlp.v2beta1.InspectContentResponse.Builder.class); } // Construct using com.google.privacy.dlp.v2beta1.InspectContentResponse.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getResultsFieldBuilder(); } } public Builder clear() { super.clear(); if (resultsBuilder_ == null) { results_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { resultsBuilder_.clear(); } return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.privacy.dlp.v2beta1.DlpProto.internal_static_google_privacy_dlp_v2beta1_InspectContentResponse_descriptor; } public com.google.privacy.dlp.v2beta1.InspectContentResponse getDefaultInstanceForType() { return com.google.privacy.dlp.v2beta1.InspectContentResponse.getDefaultInstance(); } public com.google.privacy.dlp.v2beta1.InspectContentResponse build() { com.google.privacy.dlp.v2beta1.InspectContentResponse result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.google.privacy.dlp.v2beta1.InspectContentResponse buildPartial() { com.google.privacy.dlp.v2beta1.InspectContentResponse result = new com.google.privacy.dlp.v2beta1.InspectContentResponse(this); int from_bitField0_ = bitField0_; if (resultsBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { results_ = java.util.Collections.unmodifiableList(results_); bitField0_ = (bitField0_ & ~0x00000001); } result.results_ = results_; } else { result.results_ = resultsBuilder_.build(); } onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.privacy.dlp.v2beta1.InspectContentResponse) { return mergeFrom((com.google.privacy.dlp.v2beta1.InspectContentResponse)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.privacy.dlp.v2beta1.InspectContentResponse other) { if (other == com.google.privacy.dlp.v2beta1.InspectContentResponse.getDefaultInstance()) return this; if (resultsBuilder_ == null) { if (!other.results_.isEmpty()) { if (results_.isEmpty()) { results_ = other.results_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureResultsIsMutable(); results_.addAll(other.results_); } onChanged(); } } else { if (!other.results_.isEmpty()) { if (resultsBuilder_.isEmpty()) { resultsBuilder_.dispose(); resultsBuilder_ = null; results_ = other.results_; bitField0_ = (bitField0_ & ~0x00000001); resultsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getResultsFieldBuilder() : null; } else { resultsBuilder_.addAllMessages(other.results_); } } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.privacy.dlp.v2beta1.InspectContentResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.privacy.dlp.v2beta1.InspectContentResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private java.util.List<com.google.privacy.dlp.v2beta1.InspectResult> results_ = java.util.Collections.emptyList(); private void ensureResultsIsMutable() { if (!((bitField0_ & 0x00000001) == 0x00000001)) { results_ = new java.util.ArrayList<com.google.privacy.dlp.v2beta1.InspectResult>(results_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.privacy.dlp.v2beta1.InspectResult, com.google.privacy.dlp.v2beta1.InspectResult.Builder, com.google.privacy.dlp.v2beta1.InspectResultOrBuilder> resultsBuilder_; /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public java.util.List<com.google.privacy.dlp.v2beta1.InspectResult> getResultsList() { if (resultsBuilder_ == null) { return java.util.Collections.unmodifiableList(results_); } else { return resultsBuilder_.getMessageList(); } } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public int getResultsCount() { if (resultsBuilder_ == null) { return results_.size(); } else { return resultsBuilder_.getCount(); } } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public com.google.privacy.dlp.v2beta1.InspectResult getResults(int index) { if (resultsBuilder_ == null) { return results_.get(index); } else { return resultsBuilder_.getMessage(index); } } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder setResults( int index, com.google.privacy.dlp.v2beta1.InspectResult value) { if (resultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureResultsIsMutable(); results_.set(index, value); onChanged(); } else { resultsBuilder_.setMessage(index, value); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder setResults( int index, com.google.privacy.dlp.v2beta1.InspectResult.Builder builderForValue) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); results_.set(index, builderForValue.build()); onChanged(); } else { resultsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder addResults(com.google.privacy.dlp.v2beta1.InspectResult value) { if (resultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureResultsIsMutable(); results_.add(value); onChanged(); } else { resultsBuilder_.addMessage(value); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder addResults( int index, com.google.privacy.dlp.v2beta1.InspectResult value) { if (resultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureResultsIsMutable(); results_.add(index, value); onChanged(); } else { resultsBuilder_.addMessage(index, value); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder addResults( com.google.privacy.dlp.v2beta1.InspectResult.Builder builderForValue) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); results_.add(builderForValue.build()); onChanged(); } else { resultsBuilder_.addMessage(builderForValue.build()); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder addResults( int index, com.google.privacy.dlp.v2beta1.InspectResult.Builder builderForValue) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); results_.add(index, builderForValue.build()); onChanged(); } else { resultsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder addAllResults( java.lang.Iterable<? extends com.google.privacy.dlp.v2beta1.InspectResult> values) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, results_); onChanged(); } else { resultsBuilder_.addAllMessages(values); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder clearResults() { if (resultsBuilder_ == null) { results_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { resultsBuilder_.clear(); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public Builder removeResults(int index) { if (resultsBuilder_ == null) { ensureResultsIsMutable(); results_.remove(index); onChanged(); } else { resultsBuilder_.remove(index); } return this; } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public com.google.privacy.dlp.v2beta1.InspectResult.Builder getResultsBuilder( int index) { return getResultsFieldBuilder().getBuilder(index); } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public com.google.privacy.dlp.v2beta1.InspectResultOrBuilder getResultsOrBuilder( int index) { if (resultsBuilder_ == null) { return results_.get(index); } else { return resultsBuilder_.getMessageOrBuilder(index); } } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public java.util.List<? extends com.google.privacy.dlp.v2beta1.InspectResultOrBuilder> getResultsOrBuilderList() { if (resultsBuilder_ != null) { return resultsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(results_); } } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public com.google.privacy.dlp.v2beta1.InspectResult.Builder addResultsBuilder() { return getResultsFieldBuilder().addBuilder( com.google.privacy.dlp.v2beta1.InspectResult.getDefaultInstance()); } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public com.google.privacy.dlp.v2beta1.InspectResult.Builder addResultsBuilder( int index) { return getResultsFieldBuilder().addBuilder( index, com.google.privacy.dlp.v2beta1.InspectResult.getDefaultInstance()); } /** * <pre> * Each content_item from the request has a result in this list, in the * same order as the request. * </pre> * * <code>repeated .google.privacy.dlp.v2beta1.InspectResult results = 1;</code> */ public java.util.List<com.google.privacy.dlp.v2beta1.InspectResult.Builder> getResultsBuilderList() { return getResultsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.privacy.dlp.v2beta1.InspectResult, com.google.privacy.dlp.v2beta1.InspectResult.Builder, com.google.privacy.dlp.v2beta1.InspectResultOrBuilder> getResultsFieldBuilder() { if (resultsBuilder_ == null) { resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.privacy.dlp.v2beta1.InspectResult, com.google.privacy.dlp.v2beta1.InspectResult.Builder, com.google.privacy.dlp.v2beta1.InspectResultOrBuilder>( results_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), isClean()); results_ = null; } return resultsBuilder_; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2beta1.InspectContentResponse) } // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2beta1.InspectContentResponse) private static final com.google.privacy.dlp.v2beta1.InspectContentResponse DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.privacy.dlp.v2beta1.InspectContentResponse(); } public static com.google.privacy.dlp.v2beta1.InspectContentResponse getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<InspectContentResponse> PARSER = new com.google.protobuf.AbstractParser<InspectContentResponse>() { public InspectContentResponse parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new InspectContentResponse(input, extensionRegistry); } }; public static com.google.protobuf.Parser<InspectContentResponse> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<InspectContentResponse> getParserForType() { return PARSER; } public com.google.privacy.dlp.v2beta1.InspectContentResponse getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
015e8c87dc9478e843d298147d7fe28722ef4d4e
8e937ad964b0f8f8621be7eb55c663174cbb95f0
/InterestCalc2.java
15a40c8d1880a8dfac48a8568f507e478fda93ca
[]
no_license
komara4577/Full-Interest-Calculator
870a205fa351e1fcb4fccb5d8b711b84eac8ddcd
66cd9e5eff3e962483a60959b0a132716a3dfe39
refs/heads/master
2020-08-23T19:56:41.978815
2019-10-22T01:31:29
2019-10-22T01:31:29
216,697,146
0
0
null
null
null
null
UTF-8
Java
false
false
3,271
java
//By Kevin O'Mara import java.util.Scanner; import java.lang.Math; public class InterestCalc2{ public static void main(String []args){ Scanner input = new Scanner(System.in); double p = 0; double t = 0; double n = 0; double r = 0; double amount = 0; double interestamt = 0; String select; System.out.println("What are you trying to solve for? \nEnter v for value with interest. \nEnter p for principal. \nEnter t for time. \nEnter r for interest rate. "); select = input.next(); if(select.equals("v")){ System.out.print("Enter principal: "); p = input.nextDouble(); System.out.print("Enter number of years: "); t = input.nextDouble(); System.out.print("Enter number of times compounded: "); n = input.nextDouble(); System.out.print("Enter interest rate: "); r = input.nextDouble(); amount = p * Math.pow(1 + (r / n), n * t); interestamt = amount - p; System.out.println("Amount of interest accrued is: " + interestamt); System.out.print("Total amount after " + t + " years is: " + amount); } else if(select.equals("p")){ System.out.print("Enter total amount(principal + acrued interest): "); amount = input.nextInt(); System.out.print("Enter number of years: "); t = input.nextInt(); System.out.print("Enter number of times compounded: "); n = input.nextInt(); System.out.print("Enter interest rate: "); r = input.nextDouble(); p = amount / Math.pow(1 + (r / n), n * t); System.out.print("Principal amount: " + p); } else if(select.equals("t")){ System.out.print("Enter principal amount:"); p = input.nextDouble(); System.out.print("Enter total amount(principal + acrued interest): "); amount = input.nextInt(); System.out.print("Enter number of times compounded: "); n = input.nextInt(); System.out.print("Enter interest rate: "); r = input.nextDouble(); t = Math.log((amount / p)/ (n * (Math.log(1 +(r / n))))); System.out.print("Number of years interest accumulated:" + t); } else if(select.equals("r")){ System.out.print("Enter principal amount:"); p = input.nextDouble(); System.out.print("Enter total amount(principal + acrued interest): "); amount = input.nextInt(); System.out.print("Enter number of years: "); t = input.nextInt(); System.out.print("Enter number of times compounded: "); n = input.nextInt(); r = n * (Math.pow(amount / p, 1 /( n * t))- 1); r = r * 100; System.out.print("The interest rate is: " + r); } else{ System.out.print("Please select an option shown above."); } } }
20f3ee4d0c57edf1f75c7d0749e8a39b20ef9513
456d09c39b2b7ef6b3b7252a1b57396cd839a6e0
/iBase4J-common/src/main/java/top/ibase4j/core/util/AlipayUtil.java
e0966a7b5e3e65e5c0053e46c659c983213edc4b
[ "ICU", "Apache-2.0" ]
permissive
lvjunjie33/iBase4J
f85260166ca8996a25142e9de78aecfc47a8bf78
b1b768b6714dbb4502ae0e961eae7df7fc66e0fa
refs/heads/master
2022-12-22T20:07:10.258142
2019-08-06T03:26:34
2019-08-06T03:26:34
200,769,106
1
0
Apache-2.0
2022-12-15T23:41:40
2019-08-06T03:25:17
JavaScript
UTF-8
Java
false
false
9,605
java
package top.ibase4j.core.util; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alipay.api.AlipayApiException; import com.alipay.api.AlipayClient; import com.alipay.api.domain.AlipayTradeAppPayModel; import com.alipay.api.domain.AlipayTradePayModel; import com.alipay.api.domain.AlipayTradePrecreateModel; import com.alipay.api.domain.AlipayTradeQueryModel; import com.alipay.api.domain.AlipayTradeRefundModel; import com.alipay.api.request.AlipayTradeAppPayRequest; import com.alipay.api.request.AlipayTradePayRequest; import com.alipay.api.request.AlipayTradePrecreateRequest; import com.alipay.api.request.AlipayTradeQueryRequest; import com.alipay.api.request.AlipayTradeRefundRequest; import com.alipay.api.response.AlipayTradeAppPayResponse; import com.alipay.api.response.AlipayTradePayResponse; import com.alipay.api.response.AlipayTradePrecreateResponse; import com.alipay.api.response.AlipayTradeQueryResponse; import com.alipay.api.response.AlipayTradeRefundResponse; import java.math.BigDecimal; import java.util.Date; import java.util.Map; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import top.ibase4j.core.exception.BusinessException; import top.ibase4j.core.support.pay.AliPay; import top.ibase4j.core.support.pay.AliPayConfig; import top.ibase4j.core.support.pay.vo.PayResult; import top.ibase4j.core.support.pay.vo.RefundResult; public final class AlipayUtil { private static final Logger logger = LogManager.getLogger(AlipayUtil.class); public static String precreate(String out_trade_no, String subject, String body, BigDecimal amount, String ip, String timeout, String callBack) { AlipayClient alipayClient = AliPayConfig.build().getAlipayClient(); return precreate(alipayClient, out_trade_no, subject, body, amount, ip, timeout, callBack); } public static String precreate(AlipayClient alipayClient, String out_trade_no, String subject, String body, BigDecimal amount, String ip, String timeout, String callBack) { AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest(); AlipayTradePrecreateModel model = new AlipayTradePrecreateModel(); model.setSubject(subject); model.setBody(body); model.setOutTradeNo(out_trade_no); model.setTimeoutExpress(timeout); model.setTotalAmount(amount.toString()); model.setQrCodeTimeoutExpress(timeout); request.setBizModel(model); request.setNotifyUrl(callBack); try { AlipayTradePrecreateResponse response = (AlipayTradePrecreateResponse)alipayClient.sdkExecute(request); logger.info(response.getBody()); if (!response.isSuccess()) { throw new RuntimeException(response.getSubMsg()); } return response.getQrCode(); } catch (AlipayApiException e) { throw new RuntimeException(e); } } public static String getSign(String out_trade_no, String subject, String body, BigDecimal amount, String ip, String timeout, String callBack) { AlipayClient alipayClient = AliPayConfig.build().getAlipayClient(); return getSign(alipayClient, out_trade_no, subject, body, amount, ip, timeout, callBack); } public static String getSign(AlipayClient alipayClient, String out_trade_no, String subject, String body, BigDecimal amount, String ip, String timeout, String callBack) { AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); AlipayTradeAppPayModel model = new AlipayTradeAppPayModel(); model.setSubject(subject); model.setBody(body); model.setOutTradeNo(out_trade_no); model.setTimeoutExpress(timeout); model.setTotalAmount(amount.toString()); model.setProductCode("QUICK_MSECURITY_PAY"); request.setBizModel(model); request.setNotifyUrl(callBack); try { AlipayTradeAppPayResponse response = (AlipayTradeAppPayResponse)alipayClient.sdkExecute(request); logger.info(response.getBody()); if (!response.isSuccess()) { throw new RuntimeException(response.getSubMsg()); } return response.getBody(); } catch (AlipayApiException e) { throw new RuntimeException(e); } } public static Map<?, ?> searchTreade(String outTradeNo, String tradeNo) { AlipayClient alipayClient = AliPayConfig.build().getAlipayClient(); return searchTreade(alipayClient, outTradeNo, tradeNo); } public static Map<?, ?> searchTreade(AlipayClient alipayClient, String outTradeNo, String tradeNo) { AlipayTradeQueryRequest request = new AlipayTradeQueryRequest(); AlipayTradeQueryModel model = new AlipayTradeQueryModel(); model.setOutTradeNo(outTradeNo); model.setTradeNo(tradeNo); request.setBizModel(model); Map<String, Object> result = InstanceUtil.newHashMap(); try { AlipayTradeQueryResponse response = (AlipayTradeQueryResponse)alipayClient.execute(request); if (!response.isSuccess()) { result.put("trade_state_desc", response.getSubMsg()); result.put("trade_state", "0"); } else { Map<?, ?> body = (Map)JSON.parseObject(response.getBody(), Map.class); JSONObject jSONObject = JSON.parseObject(body.get("alipay_trade_query_response").toString()); Object trade_status = jSONObject.get("trade_status"); if ("TRADE_SUCCESS".equals(trade_status) || "TRADE_FINISHED".equals(trade_status)) { Date date = DateUtil.stringToDate((String)jSONObject.get("send_pay_date")); result.put("time_end", date); result.put("trade_no", jSONObject.get("trade_no")); result.put("trade_state", "1"); } else { result.put("trade_state_desc", jSONObject.get("msg")); result.put("trade_state", "2"); } } } catch (AlipayApiException e) { logger.error("", e); result.put("trade_state_desc", e.getMessage()); result.put("trade_state", "0"); } return result; } public static RefundResult refund(String outTradeNo, String tradeNo, String outRequestNo, BigDecimal refundAmount, String refundReason) { AlipayClient alipayClient = AliPayConfig.build().getAlipayClient(); return refund(alipayClient, outTradeNo, tradeNo, outRequestNo, refundAmount, refundReason); } public static RefundResult refund(AlipayClient alipayClient, String outTradeNo, String tradeNo, String outRequestNo, BigDecimal refundAmount, String refundReason) { AlipayTradeRefundRequest request = new AlipayTradeRefundRequest(); AlipayTradeRefundModel model = new AlipayTradeRefundModel(); model.setOutTradeNo(outTradeNo); model.setTradeNo(tradeNo); model.setRefundAmount(refundAmount.toString()); model.setRefundReason(refundReason); model.setOutRequestNo(outRequestNo); request.setBizModel(model); try { AlipayTradeRefundResponse response = (AlipayTradeRefundResponse)alipayClient.execute(request); logger.info(response.getBody()); if (!response.isSuccess()) { throw new RuntimeException(response.getSubMsg()); } Map<?, ?> body = (Map)JSON.parseObject(response.getBody(), Map.class); JSONObject jSONObject = JSON.parseObject(body.get("alipay_trade_refund_response").toString()); return new RefundResult((String)jSONObject.get("trade_no"), outTradeNo, refundAmount.toString(), DateUtil.stringToDate((String)jSONObject.get("gmt_refund_pay")), "Y".equals(jSONObject.get("fund_change")) ? "1" : "2"); } catch (AlipayApiException e) { throw new RuntimeException(e); } } public static PayResult micropay(String authCode, String subject, String outTradeNo, BigDecimal totalAmount, String callBack) { return micropay(AliPayConfig.build().getAlipayClient(), authCode, subject, outTradeNo, totalAmount, callBack); } public static PayResult micropay(AlipayClient alipayClient, String authCode, String subject, String outTradeNo, BigDecimal totalAmount, String callBack) { AlipayTradePayRequest request = new AlipayTradePayRequest(); AlipayTradePayModel model = new AlipayTradePayModel(); model.setScene("bar_code"); model.setAuthCode(authCode); model.setSubject(subject); model.setOutTradeNo(outTradeNo); model.setTimeoutExpress("3m"); model.setTotalAmount(totalAmount.toString()); request.setBizModel(model); request.setNotifyUrl(callBack); try { AlipayTradePayResponse response = (AlipayTradePayResponse)alipayClient.execute(request); logger.info(response.getBody()); if (!response.isSuccess()) { throw new BusinessException(response.getSubMsg()); } String result = AliPay.tradePay(model, callBack); Map<?, ?> body = (Map)JSON.parseObject(result, Map.class); JSONObject jSONObject = JSON.parseObject(body.get("alipay_trade_query_response").toString()); Object trade_status = jSONObject.get("trade_status"); if ("TRADE_SUCCESS".equals(trade_status) || "TRADE_FINISHED".equals(trade_status)) { String tradeNo = (String)jSONObject.get("trade_no"); String gmtCreate = (String)jSONObject.get("gmt_create"); return new PayResult(tradeNo, DateUtil.stringToDate(gmtCreate), (String)jSONObject .get("buyer_logon_id"), "TRADE_SUCCESS".equals(trade_status) ? "1" : "2"); } throw new RuntimeException((String)jSONObject.get("sub_msg")); } catch (AlipayApiException e) { throw new BusinessException("付款失败", e); } } }
2fcf2c5dd324bddddb1e9668d69ea614f916887e
ff754d6288d3caa5d1a65299c19469c8c009ad1a
/ArrayMethod.java
8d011b9d7676c3fe3713986b4728a06ab98b7948
[]
no_license
Mzheldin/java2
40bb6d89d3c4770c486e81e98d3e614cff85d1b5
7c699b2d4e47febee3b8bc08d4a434eb5a949a54
refs/heads/master
2020-03-27T07:25:10.637743
2018-09-15T16:13:31
2018-09-15T16:13:31
146,189,709
0
0
null
null
null
null
UTF-8
Java
false
false
3,082
java
package hw2; import java.util.Scanner; public class ArrayMethod { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = 1; //индикатор текущего вводимого элемента int ii; // размерности вводимого массива int jj; System.out.println("Введите размерность двумерного массива :"); ii = sc.nextInt(); System.out.println("Введите размерность двумерного массива :"); jj = sc.nextInt(); String[][] strarr = new String[ii][jj]; System.out.println("Задайте элементы строкового массива"); //заполенине массива for (int i = 0; i < strarr.length; i++){ for (int j = 0; j < strarr[i].length; j++){ System.out.println("Введите " + k + "й элемент массива :"); strarr[i][j] = sc.next(); k++; } } // перехват исключений и вывод сообщения try { System.out.println("Сумма элементов массива " + summ(strarr)); } catch (MyArraySizeException e) { e.printmsg(); } catch (MyArrayDataException e){ e.printmsg(); } System.out.println("The end"); } private static int summ (String[][] arr) throws MyArraySizeException, MyArrayDataException{ // проверка и проброс своего исключения если размерности массива не соответствуют 4 if (arr.length != 4) throw new MyArraySizeException("Некорректный размер массива"); else { for (int i = 0; i < 4; i++){ if (arr[i].length != 4) throw new MyArraySizeException("Некорректный размер массива"); } } int sum = 0; String err = null; // переменная запоминающая индексы последней обработаной ячейки // проверка наличия исключения ошибки преобразования строки в число, его перехват и проброс своего исключения с try { //номерами последней ячейки for (int i = 0; i < arr.length; i++) { for (int j = 0; j < arr[i].length; j++) { err = " " + i + " " + j; sum += Integer.parseInt(arr[i][j]); } } } catch (NumberFormatException e) { throw new MyArrayDataException("Неверный формат данных в ячейке" + err) ; } return sum; } }
93df222cbe1f3b41ecd94861fe8116031df8b88e
1e5834ecedaed7173c36ff7b11ed395cd4bd0a65
/app/src/main/java/com/tony/android/fortnitestore/ItemAdapter.java
c801da943267bf48475b14766ac02acfff7a81af
[]
no_license
acarlos21/FortniteStore
0fc4c70ab9ccf62dac0157270ed10d11b4db5747
63bdfcb042ceae042c8410bc79ae5340c008cfdc
refs/heads/master
2020-05-16T21:59:54.321000
2019-04-24T23:57:44
2019-04-24T23:57:44
183,323,180
0
0
null
null
null
null
UTF-8
Java
false
false
1,130
java
package com.tony.android.fortnitestore; import android.content.Context; import android.content.Intent; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; public class ItemAdapter extends ArrayAdapter<FortniteBundle> { Context context; public ItemAdapter(Context context, ArrayList<FortniteBundle> list) { super(context, 0, list); this.context=context; } @Override public View getView(int position, View convertView, ViewGroup parent) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.fortnite_item, parent, false); final FortniteBundle currentItem = getItem(position); ImageView fortniteImage = convertView.findViewById(R.id.fortniteImage); //fortniteImage.setImageResource(currentItem.getImage()); TextView fortniteName = convertView.findViewById(R.id.fortniteName); fortniteName.setText(currentItem.getName()); return convertView; } }
96738092432222da83ae63ce1265a33ff62f2b1e
46ef04782c58b3ed1d5565f8ac0007732cddacde
/app/edition.notes/src/org/modelio/edition/notes/handlers/CutAnnotationHandler.java
e9a6a238569abb321d18083235e49ab7a543a457
[]
no_license
daravi/modelio
844917412abc21e567ff1e9dd8b50250515d6f4b
1787c8a836f7e708a5734d8bb5b8a4f1a6008691
refs/heads/master
2020-05-26T17:14:03.996764
2019-05-23T21:30:10
2019-05-23T21:30:45
188,309,762
0
1
null
null
null
null
UTF-8
Java
false
false
3,103
java
/* * Copyright 2013-2018 Modeliosoft * * This file is part of Modelio. * * Modelio is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Modelio 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 Modelio. If not, see <http://www.gnu.org/licenses/>. * */ package org.modelio.edition.notes.handlers; import javax.inject.Inject; import com.modeliosoft.modelio.javadesigner.annotations.objid; import org.eclipse.e4.core.di.annotations.CanExecute; import org.eclipse.e4.core.di.annotations.Execute; import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.swt.widgets.Display; import org.modelio.app.project.core.services.IProjectService; import org.modelio.edition.notes.panelprovider.NotesPanelController; import org.modelio.edition.notes.panelprovider.NotesPanelProvider; import org.modelio.edition.notes.view.NotesView; /** * Cuts selected annotation(s) into the clipboard. */ @objid ("65c0aea4-4ece-408b-bbb4-1cd600ead190") public class CutAnnotationHandler { @objid ("05ac3c5d-b435-4a6c-8db1-981e7adf2451") boolean ctrlFlag; @objid ("4842c180-e06a-450c-8aef-bc1d47b5145e") @Inject protected IProjectService projectService; /** * Available only when the selected elements are modifiable. * @param part the current active part. * @return true if the handler can be executed. */ @objid ("7ffd9d53-937d-4303-ac08-25ca37564575") @CanExecute public final boolean canExecute(final MPart part) { if (part == null || !(part.getObject() instanceof NotesView)) { return false; } // Sanity checks if (this.projectService.getSession() == null) { return false; } NotesPanelProvider notesPanel = ((NotesView) part.getObject()).getNotesPanel(); if (notesPanel == null) { return false; } // Check focus if (!notesPanel.getTreeViewer().getControl().isFocusControl()) { return false; } NotesPanelController controller = notesPanel.getController(); return controller.canCut(); } /** * Cut the currently selected elements. * @param part the current active part. * @param currentDisplay the display Modelio runs into. */ @objid ("daaeef67-3284-4439-9d48-77bc3f51add8") @Execute public final void execute(final MPart part, Display currentDisplay) { NotesPanelProvider notesPanel = ((NotesView) part.getObject()).getNotesPanel(); NotesPanelController controller = notesPanel.getController(); controller.onCut(); } }
c02af33ac5ae5f4d34a67661bf58aae24fe24cad
537c52549d356618673d026a8989d47ba55f1333
/DI/src/main/java/ex02/construct/Chef.java
c7362f0bef9bb6bb4a44824868e34c838e500c11
[]
no_license
JaeHyun-Ban/GB_Spring
1bf0360746f301c7156c9f931081521ce7a5715c
d24c8b86ca9efe9858928a1e1faca0be5b34dba2
refs/heads/master
2023-02-12T23:11:33.011073
2020-12-30T17:54:27
2020-12-30T17:54:27
319,648,918
0
0
null
null
null
null
UTF-8
Java
false
false
125
java
package ex02.construct; public class Chef { public void cooking() { System.out.println("요리 하는중..."); } }
5236f025f47576fff5d24603d4dda0efce9412b8
d33741feb9199a1c7d9ebd946e24430e1b239e61
/JAVA/src/Assignment/week5_practice.java
cd6d79be649605fd0122163c05a6fef230511a9e
[]
no_license
George-Polya/junior_1semester
3de4c77cc52bb8fae73708cee782b684a44a6e07
e589f4eab4923324930e82f90d1097fb9113a0de
refs/heads/master
2022-10-08T12:05:50.959440
2020-06-15T13:23:07
2020-06-15T13:23:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,585
java
package Assignment; class ArrayUtil { public static int[] concat(int[] a, int[] b) { // 배열 a,b의 원소를 저장할 임시 배열 temp. // a,b의 모든원소가 들어가야하므로 temp.length는 a.length+b.length이다. int temp[] = new int[a.length+b.length]; // 배열 a의 원소 저장. for(int i = 0; i < a.length;i++) temp[i] = a[i]; // a의 원소가 저장된 후부터 배열 b의 원소 저장 for (int i = a.length; i<a.length+b.length;i++) temp[i] = b[i-a.length]; return temp; } // 스왑 public static void swap(int[] array, int i1, int i2) { int temp = array[i1]; array[i1] = array[i2]; array[i2] = temp; } // bubble sort public static void bubbleSort(int arr[], int size) { if(size == 1) return; for(int i = 0; i< size-1;i++) // 0부터 (arr.length-1)까지에 반복 if(arr[i] > arr[i+1]) // 앞의 원소가 뒤의 원소보다 작으면 swap(arr, i, i+1); // 서로 스왑한다. bubbleSort(arr,size-1); // 재귀적으로 } // array 출력 public static void print(int[] a) { System.out.print("[ "); for(int i = 0; i < a.length;i++) { System.out.print(a[i]+" "); } System.out.println("]"); } } public class week5_practice { public static void main(String[] args) { int[] array1 = {1,5,7,9}; int[] array2 = {3,6,-1,100,77}; int[] array3 = ArrayUtil.concat(array1, array2); System.out.print("Original Array: "); ArrayUtil.print(array3); System.out.print("Sorted Array: "); ArrayUtil.bubbleSort(array3,array3.length); ArrayUtil.print(array3); } }
5e8c4e28713de1cd81c5fbc675d6eb09232469a3
c313dd9016e99105779ed919e1b8bb9f6dce48c2
/order/src/main/java/com/imooc/order/client/ProductClient.java
b6f623810a42c125a5562ed14c0c1f09b7b9dee1
[]
no_license
fugf123/SpringCloud
81353d5cf9267396e2b606eee6ac1c81028f73db
978f666f4a464a27914d4ad89a2d5d8c0b0f1968
refs/heads/master
2020-03-27T22:08:44.459304
2018-11-22T12:14:28
2018-11-22T12:14:28
147,208,194
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.imooc.order.client; import com.imooc.order.config.FeignConfiguration; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.GetMapping; @FeignClient(name = "product",configuration = FeignConfiguration.class) @Component public interface ProductClient { @GetMapping("msg") String productMsg(); }
1a208224059973e99f657cc4cf86a4301e4a0b0b
97c9d3935681b314a29899a9c894de365f709690
/src/Empresa/Limpiadores.java
ce3a7ba8f2e6f83a781f2f22816fa84b85c71467
[]
no_license
Albercharlei/IPC1A_Tarea_especial
fe8bbaa2d1a721dbf05a4c6f4a902aa38d5b8b34
efe0546db78a878df9d91b74ec55fb881dbd1655
refs/heads/master
2016-09-05T14:07:51.118881
2015-03-29T01:41:05
2015-03-29T01:41:05
33,057,453
0
0
null
null
null
null
MacCentralEurope
Java
false
false
1,361
java
package Empresa; public class Limpiadores { private String nombre;//nombre del empleado private String direccion;//direccion del empleado private String telefono;//telefono del empleado private String fecha;//fecha de ingreso del empleado private double sueldo;//sueldo del empleado private double extras;//número de horas extra del empleado //definir ingreso e ingresoN en main para agregar los datos public void agregarNombre(String ingreso){ this.nombre=ingreso;//ingreso del nombre del empleado en esta clase } public void agregarDireccion(String ingreso){ this.direccion=ingreso;//ingreso de la direccion en esta clase } public void agregarTelefono(String ingreso){ this.telefono=ingreso;//ingreso del número de telefono en esta clase } public void agregarFecha(String ingreso){ this.fecha=ingreso;//ingreso de la fecha de ingreso en esta clase } public void agregarExtras(double ingresoN){ this.extras=ingresoN;//ingreso del número de horas extras ene sta clase } public void agregarSueldo(double ingresoN){ this.sueldo=ingresoN*(1+0.005*extras);//ingreso del sueldo en esta clase } public boolean agregarContratación(String ingreso){//contratación o despido del empleado if(ingreso.equals("contratado")){ return true; } else{ if(ingreso.equals("despedido")){ } } return false; } }
b67efeb9a44956d237540846c419ed4afc11baf8
0b47c44e9f860cb820e1db22420b9359ddf885fc
/Week_02/G20200343030364/LeetCode_590_364.java
64711ea7eb197432a6a4f294f138f1ce4123a254
[]
no_license
maxminute/algorithm006-class02
f71f9e8d2f59b1f7bbde434182a29c09792795d2
320d978f3a18751ebbac0c2c9a45462cdcc4cbc6
refs/heads/master
2021-01-02T03:17:20.549719
2020-04-05T14:54:22
2020-04-05T14:54:22
239,468,160
0
2
null
2020-04-05T14:54:23
2020-02-10T09:01:46
Java
UTF-8
Java
false
false
655
java
import java.util.LinkedList; import java.util.List; /** * Created by HuGuodong on 2/22/20. */ public class LeetCode_590_364 { class Solution { public List<Integer> postorder(Node root) { LinkedList<Node> stack = new LinkedList<>(); LinkedList<Integer> output = new LinkedList<>(); if (root == null) { return output; } stack.add(root); while (!stack.isEmpty()) { Node node = stack.pollLast(); output.addFirst(node.val); for (Node item : node.children) { if (item != null) { stack.add(item); } } } return output; } } }
e672c85a8d98cacccbf815dbb1f8c63f06141705
a04053fc31bb6786f45b6337df1bf0708acd926a
/module-three-review-site-gamereview/src/main/java/org/wecancodeit/reviews/controllers/GameReviewController.java
d682d284a7bae8c33bc82b4cd068ff1330f1b608
[]
no_license
JorgeHerreraJr/GameReviewSite
757368754bd700554498db73bf60ed671f6d1116
36b4d3a9018c47875ae4d1673b51f2d089cdb106
refs/heads/main
2023-07-16T18:09:07.763878
2021-08-25T23:18:05
2021-08-25T23:18:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,811
java
package org.wecancodeit.reviews.controllers; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.wecancodeit.reviews.repos.GuestReviewRepository; import org.wecancodeit.reviews.repos.GameReviewRepository; import org.wecancodeit.reviews.pojos.Hashtag; import org.wecancodeit.reviews.repos.HashtagRepository; import org.wecancodeit.reviews.pojos.GuestReview; import org.wecancodeit.reviews.pojos.GameReview; import javax.annotation.Resource; import java.util.Optional; @Controller public class GameReviewController { @Resource private GameReviewRepository gameReviewRepo; @Resource private HashtagRepository hashtagRepo; @Resource private GuestReviewRepository guestReviewRepo; @RequestMapping("/categories/category/game-review") public String displayCategoryGameReview(@RequestParam("id") long id, Model model) { GameReview selectedReview = gameReviewRepo.findById(id).get(); model.addAttribute("individualReview", selectedReview); model.addAttribute("individualHashtag", hashtagRepo.findAllByGameReviews(selectedReview)); return "individual-game-review"; } @PostMapping("/categories/category/add-hashtag") public String addHashtagToReview(@RequestParam("hashtag") String hashtag, @RequestParam("gamereviewid") long id, Model model) { Hashtag userHashtag = new Hashtag(hashtag); GameReview gameReview = gameReviewRepo.findById(id).get(); Optional<Hashtag> optionalHashtag = hashtagRepo.findByHashtagName(hashtag); if (!optionalHashtag.isEmpty()) { userHashtag = optionalHashtag.get(); } else { hashtagRepo.save(userHashtag); } if (gameReview.addHashtag(userHashtag)) { gameReviewRepo.save(gameReview); } return "redirect:/categories/category/game-review?id=" + gameReview.getId(); } @PostMapping("/categories/category/add-review") public String addGameGuestReviews(@RequestParam("gamereviewid") long id, @RequestParam("guestReviewerName") String guestReviewerName, @RequestParam("guestReviewTitle") String guestReviewTitle, @RequestParam("guestReviewContent") String guestReviewContent) { GameReview currentReview = gameReviewRepo.findById(id).get(); guestReviewRepo.save(new GuestReview(currentReview, guestReviewerName, guestReviewTitle, guestReviewContent)); return "redirect:/categories/category/game-review?id=" + currentReview.getId(); } }
d48b385ab4a2be85040990f1b896baa2a058f923
d055a0b658cc7cdf85ec358ba4a3e74acee11bea
/app/src/main/java/example/com/bazaar/bean/ExchangeInfo.java
f4116fd89696d7b7831e71854b994bbb39c4878b
[]
no_license
suman1shrestha/University_Bazaar_System
aae3fee1bb20fea685af9b93d21a99a89a1ad262
4f0be8ee1067715afcfbb3240e62591741e3e2c5
refs/heads/master
2020-06-29T07:11:15.344630
2016-12-06T23:18:24
2016-12-06T23:18:24
74,440,041
0
0
null
null
null
null
UTF-8
Java
false
false
1,254
java
package example.com.bazaar.bean; /** * Created by TheRealShrey on 11/30/16. */ public class ExchangeInfo { private String itemDescription; private String itemQuantity; private String exchange_ItemURL; private String senderUserName; private String receiveUserName; public String getItemDescription() { return itemDescription; } public void setItemDescription(String itemDescription) { this.itemDescription = itemDescription; } public String getItemQuantity() { return itemQuantity; } public void setItemQuantity(String itemQuantity) { this.itemQuantity = itemQuantity; } public String getExchange_ItemURL() { return exchange_ItemURL; } public void setExchange_ItemURL(String Exchange_ItemURL) { this.exchange_ItemURL = Exchange_ItemURL; } public String getSenderUserName() { return senderUserName; } public void setSenderUserName(String senderUserName) { this.senderUserName = senderUserName; } public String getReceiveUserName() { return receiveUserName; } public void setReceiveUserName(String receiveUserName) { this.receiveUserName = receiveUserName; } }
4f9a814898046cf63910826783e0ec99d7f9bb79
759c2f4381b5dff481f0f8c5a1e4338911648aa1
/SeleniumProject/src/seleniumVerification/VerifyErrorMessage.java
0c2c196352fb4c4a091ee60769dbaeb9ca065513
[]
no_license
MuskanD22/Selenium
a90dfcb642dbd5f9d322dc893ee9934bd5104e44
407f5906a53e35ff0b143485e880b607c15b1dae
refs/heads/master
2023-03-19T23:47:45.389172
2021-03-08T09:14:02
2021-03-08T09:14:02
344,373,510
0
0
null
null
null
null
UTF-8
Java
false
false
846
java
package seleniumVerification; import org.junit.Assert; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class VerifyErrorMessage { public static void main(String[]args) { System.setProperty("webdriver.chrome.driver","D:\\Selenium\\chromedriver32\\chromedriver.exe"); WebDriver driver=new ChromeDriver(); driver.get("http://gmail.com"); driver.findElement(By.xpath("//*[@id=\"identifierNext\"]/div/button")).click(); String actual=driver.findElement(By.className("o6cuMc")).getText(); String Expected_error="Enter an email or phone number"; // type1 Assert.assertEquals(actual, Expected_error); // type2 Assert.assertTrue(actual.contains("Enter an email or phone number")); System.out.println("Test Completed"); } }
8661b1a218cf63d818c2a9acf3cedd552a07e129
fd231de194de44c6e8b647482c71187307d76ff4
/scdemo-common-util/src/main/java/com/scdemo/common/util/model/PageData.java
a71e624d23233002cfab7785b9fddcf9538b9270
[]
no_license
zhangjing520720/scdemo
ea5fbdc32ad9c40f30a722c3bae6d7719ea4e1f9
5fdf847c76203a04de55e26b6c7acf5143561de9
refs/heads/master
2020-03-19T20:06:52.088873
2018-06-22T03:03:25
2018-06-22T03:03:25
136,888,685
5
0
null
null
null
null
UTF-8
Java
false
false
3,004
java
package com.scdemo.common.util.model; import java.io.Serializable; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.servlet.http.HttpServletRequest; import com.wsp.utils.WSPWeb; /** * 二次封装的hashmap对象 * @author rex * */ public class PageData extends HashMap implements Map,Serializable{ private static final long serialVersionUID = 1L; Map map = null; HttpServletRequest request; public PageData(HttpServletRequest request){ this.request = request; Map properties = request.getParameterMap(); Map returnMap = new HashMap(); Iterator entries = properties.entrySet().iterator(); Map.Entry entry; String name = ""; String value = ""; while (entries.hasNext()) { entry = (Map.Entry) entries.next(); name = (String) entry.getKey(); Object valueObj = entry.getValue(); if(null == valueObj){ value = ""; }else if(valueObj instanceof String[]){ String[] values = (String[])valueObj; for(int i=0;i<values.length;i++){ value = values[i] + ","; } value = value.substring(0, value.length()-1); }else{ value = valueObj.toString(); } returnMap.put(name, value); } returnMap.put("addIP", WSPWeb.getRemoteIp(request)); returnMap.put("addAgent", request.getHeader("user-agent")); map = returnMap; } public PageData() { map = new HashMap(); } @Override public Object get(Object key) { Object obj = null; if(map.get(key) instanceof Object[]) { Object[] arr = (Object[])map.get(key); obj = request == null ? arr:(request.getParameter((String)key) == null ? arr:arr[0]); } else { obj = map.get(key); } return obj; } public String getString(Object key) { return (String)get(key); } @SuppressWarnings("unchecked") @Override public Object put(Object key, Object value) { return map.put(key, value); } @Override public Object remove(Object key) { return map.remove(key); } public void clear() { map.clear(); } public boolean containsKey(Object key) { // TODO Auto-generated method stub return map.containsKey(key); } public boolean containsValue(Object value) { // TODO Auto-generated method stub return map.containsValue(value); } public Set entrySet() { // TODO Auto-generated method stub return map.entrySet(); } public boolean isEmpty() { // TODO Auto-generated method stub return map.isEmpty(); } public Set keySet() { // TODO Auto-generated method stub return map.keySet(); } @SuppressWarnings("unchecked") public void putAll(Map t) { // TODO Auto-generated method stub map.putAll(t); } public int size() { // TODO Auto-generated method stub return map.size(); } public Collection values() { // TODO Auto-generated method stub return map.values(); } }
a133e9aad1e6159e7a5a9c17453cdcd03b9989bb
fdec7afd41db4b3f9377a31c7e76c4d924ecde58
/CALSALARY/src/main/java/edu/sjsu/cs185C/Salary.java
14bba8669c448bdf2a326699af398b89453fa96b
[]
no_license
spartan-vishan/CALSALARY
8f2678bcb83f26a08a3054efaf6c45c47652a41a
ad6f908dd5f4ea9160aaf3fb228fd9bc0e9b45fa
refs/heads/master
2020-04-24T16:43:18.107686
2019-02-24T04:17:34
2019-02-24T04:17:34
172,118,971
0
0
null
null
null
null
UTF-8
Java
false
false
8,072
java
package edu.sjsu.cs185C; import java.util.Arrays; import java.io.File; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Encoder; import org.apache.spark.sql.Encoders; import org.apache.spark.sql.SparkSession; import org.apache.spark.sql.Row; import org.apache.spark.sql.types.DataTypes; import org.apache.spark.sql.types.StructField; import org.apache.spark.sql.types.StructType; import static org.apache.spark.sql.functions.col; import static org.apache.spark.sql.functions.asc; import static org.apache.spark.sql.functions.desc; public class Salary { //input arguements follow this order: //san-jose-2016.csv san-jose-2017.csv san-francisco-2017.small.csv public static void main(String[] args) throws Exception { //Input files String fileSJ16= args[0]; String fileSJ17= args[1]; String fileSF17= args[2]; //Create a Java Spark Context. SparkSession spark = SparkSession .builder() .appName("CaliforniaSalary") .getOrCreate(); List<StructField> fields = Arrays.asList( DataTypes.createStructField("employeeName", DataTypes.StringType, true), DataTypes.createStructField("jobTitle", DataTypes.StringType, true), DataTypes.createStructField("basePay", DataTypes.FloatType, true), DataTypes.createStructField("overtimePay", DataTypes.FloatType, true), DataTypes.createStructField("otherPay", DataTypes.FloatType, true), DataTypes.createStructField("benefits", DataTypes.FloatType, true), DataTypes.createStructField("totalPay", DataTypes.FloatType, true), DataTypes.createStructField("totalPayAndBenefits", DataTypes.FloatType, true), DataTypes.createStructField("year", DataTypes.IntegerType, true), DataTypes.createStructField("notes", DataTypes.StringType, true), DataTypes.createStructField("agency", DataTypes.StringType, true), DataTypes.createStructField("status", DataTypes.StringType, true)); StructType salarySchema = DataTypes.createStructType(fields); //Load input data and create 3 Dataset<Row>: salary for SJ 2016, SJ 2017 and SF 2017 Dataset<Row> salaryDFSJ16 = spark.read().option("header", true).schema(salarySchema).csv(fileSJ16); Dataset<Row> salaryDFSJ17 = spark.read().option("header", true).schema(salarySchema).csv(fileSJ17); Dataset<Row> salaryDFSF17 = spark.read().option("header", true).schema(salarySchema).csv(fileSF17); //Using salaryEncoder to create typed Dataset<SalaryRecord> for above inputs //Encoder<SalaryRecord> salaryEncoder = Encoders.bean(SalaryRecord.class); Encoder<SalaryRecord> salaryEncoder = Encoders.bean(SalaryRecord.class); Dataset<SalaryRecord> salaryDSSJ16 = salaryDFSJ16.as(salaryEncoder); Dataset<SalaryRecord> salaryDSSJ17 = salaryDFSJ17.as(salaryEncoder); Dataset<SalaryRecord> salaryDSSF17 = salaryDFSF17.as(salaryEncoder); long totalRecordCount = salaryDSSJ17.select("employeeName").count(); long totalJobTitleCount = salaryDSSJ16.select("jobTitle").distinct().count(); //TODO: count the distinct jobTitles in 2017 San Jose data set System.out.println("---2017 San Jose: Total Record Count : " + totalRecordCount + ", Total JobTile Count: " + totalJobTitleCount); System.out.println("---2017 San Jose: 3 records with lowest totalPayAndBenefits"); //TODO: find and print the top 3 records with lowest totalPayAndBenefits in 2017 San Jose data set salaryDFSF17.sort("totalPayAndBenefits").show(3); System.out.println("---2017 San Jose: 3 record with highest totalPayAndBenefits"); //TODO: find and print the top 3 records with highest totalPayAndBenefits in 2017 San Jose data set salaryDFSF17.orderBy(desc("totalPayAndBenefits")).show(3); System.out.println("---2017 San Jose: record with highest overtime pay"); //TODO: find and print the records with highest overtimePay in 2017 San Jose data set salaryDFSJ17.orderBy(desc("overtimePay")).show(1); System.out.println("---2017 San Jose: record with highest benefit pay"); //TODO: find and print the highest benefit records in 2017 San Jose data set salaryDFSJ17.orderBy(desc("benefits")).show(1); System.out.println("---2017 San Francisco: 3 records with lowest totalPayAndBenefits"); //TODO: find and print the lowest totalPayAndBenefit records in 2017 San Francisco data set salaryDFSF17.sort("totalPayAndBenefits").show(3); System.out.println("---2017 San Francisco 3 records with highest totalPayAndBenefits"); //TODO: find and print the highest totalPayAndBenefit records in 2017 San Francisco data set salaryDFSF17.orderBy(desc("totalPayAndBenefits")).show(3); String jobTitlePO = "Police Officer"; System.out.println("---2017 San Jose: highest totalPayAndBenefits for job " + jobTitlePO); //TODO: In San Jose 2017 data set, find the highest totalPayAndBenefits for the jobTitle "Police Officer" salaryDFSJ17.filter("jobTitle = 'Police Officer' ").sort(desc("totalPayAndBenefits")).show(1); System.out.println("---2017 San Francisco: highest totalPayAndBenefits for job " + jobTitlePO); //TODO: In 2017 San Francisco data set, find the highest totalPayAndBenefits for the jobTitle "Police Officer" salaryDFSF17.filter("jobTitle = 'Police Officer' ").sort(desc("totalPayAndBenefits")).show(1); System.out.println("---2017 San Jose: the job with highest average TotalPayAndBenefits"); //TODO: print the jobTitle with best average totalPayAndBenefits in 2017 San Jose data set salaryDFSJ17.groupBy("jobTitle").avg("totalPayAndBenefits").toDF("jobTitle", "avgTotalPayAndBenefitsSJ17").orderBy(desc("avgTotalPayAndBenefitsSJ17")).show(1); System.out.println("---2017 San Jose: the 2 jobs with biggest difference between max and min TotalPayAndBenefits"); //TODO: print the jobTitle with biggest difference between max and min totalPayAndBenefits in 2017 San Jose data set, and the difference Dataset<Row> maxSalary = salaryDFSJ17.groupBy("jobTitle").max("totalPayAndBenefits").toDF("jobTitle", "maxTotalPayAndBenefitsSJ17"); Dataset<Row> minSalary = salaryDFSJ17.groupBy("jobTitle").min("totalPayAndBenefits").toDF("jobTitle", "minTotalPayAndBenefitsSJ17"); Dataset<Row> compareMaxMin = maxSalary.join(minSalary, "jobTitle"); //compare max/min cols Dataset<Row> finalDataSet = compareMaxMin.withColumn( "diffMaxMinTotalPayAndBenefits", col("maxTotalPayAndBenefitsSJ17").minus( col("minTotalPayAndBenefitsSJ17") )); //sort and output finalDataSet.sort(desc("diffMaxMinTotalPayAndBenefits")).show(2); System.out.println("---2016-2017 San Jose: the 2 jobs with biggest increase of avg TotalPayAndBenefits"); //TODO: In 2017 San Jose data set, find the jobTitle with highest average totalPayAndBenefits increase from 2016 Dataset<Row> avgSJ16DS = salaryDFSJ16.groupBy("jobTitle"). avg("totalPayAndBenefits"). toDF("jobTitle", "avgTotalPayAndBenefitsSJ16"); Dataset<Row> avgSJ17DS = salaryDFSJ17.groupBy("jobTitle"). avg("totalPayAndBenefits"). toDF("jobTitle", "avgTotalPayAndBenefitsSJ17"); Dataset<Row> joinedSJ1617DS = avgSJ16DS.join(avgSJ17DS,"jobTitle"); Dataset<Row> resultSJ1617DS = joinedSJ1617DS.withColumn("diff1617TotalPayAndBenefits", col("avgTotalPayAndBenefitsSJ17").minus(col("avgTotalPayAndBenefitsSJ16"))); resultSJ1617DS.sort(desc("diff1617TotalPayAndBenefits")). show(2); spark.stop(); } }
6f05b3488317ed15391212ceb96741243eefefe0
7e43e0d0499d20a7deb2715479660e80fb4b35c2
/back/core/src/main/java/fr/jhagai/todoLockDemo/core/dao/TodoRepository.java
18b8f1a906030f4456751c0bdf057a6145cf7a51
[]
no_license
jhagai/todoLockDemo
925004c2429a55620079a1e9764f4546fd8cf96a
c2f26c850e64fe08895090952a0b5a9a5923f991
refs/heads/master
2023-03-06T06:48:26.884487
2021-04-19T14:46:55
2021-04-19T14:46:55
212,579,631
0
0
null
2023-03-03T08:35:15
2019-10-03T12:53:39
Java
UTF-8
Java
false
false
287
java
package fr.jhagai.todoLockDemo.core.dao; import fr.jhagai.todoLockDemo.core.entities.Todo; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface TodoRepository extends JpaRepository<Todo, Long> { }
7b0582b5daf7480d16efdc7177bb80f4ab25b664
970bee5739e135c1c8463b09eb650b807388d823
/src/TP3/TaskDFSGraph.java
65d6f7082c51f050edc3c2a40bf1003151cfafbb
[]
no_license
Ezefalcon/prog3
76007984bd9bbcdf6e50be434b8b8c27656f98e0
04325a34bb8fdb777ecc6c0f5eef9e8f99c09ce4
refs/heads/master
2022-11-07T10:48:26.514373
2020-06-25T22:38:50
2020-06-25T22:38:50
254,950,822
0
0
null
null
null
null
UTF-8
Java
false
false
3,252
java
package TP3; import java.util.*; import java.util.stream.Collectors; /** * Created by efalcon */ public class TaskDFSGraph extends DirectedGraph<Tarea, Integer> { public List<Integer> dfs() { List<List<Pair<Integer, List<Integer>>>> pairs = new ArrayList<>(); for (Vertex<Tarea, Integer> vertex : vertices) { pairs.add(dfsVisit(vertex, new ArrayList<>())); } // Recorre la lista de listas de pares, y busca de cada 1 de los pares, el maximo List<Pair<Integer, List<Integer>>> collect = pairs.stream() .map(x -> x.stream() .max(Comparator.comparing(Pair::getKey)) .orElse(new Pair<>(0, Collections.emptyList()))) .collect(Collectors.toList()); // Recorremos nuevamente la lista buscando el maximo Optional<Pair<Integer, List<Integer>>> max = collect.stream() .max(Comparator.comparing(Pair::getKey)); if(max.isPresent()) { return max.get().getValue(); } else { return Collections.emptyList(); } } /** * * @return un pair, donde la key va a ser el tiempo total y el value la lista de vertices recorridoxs */ private List<Pair<Integer, List<Integer>>> dfsVisit(Vertex<Tarea, Integer> vertex, List<Pair<Integer, List<Integer>>> verticesRecorridos) { boolean multiBranch = false; // Si no tiene ningun vertice agregado signfica que es el primer vertice y agregamos el vertexId if(verticesRecorridos.isEmpty()) { List<Integer> list = new ArrayList<>(); list.add(vertex.getId()); Pair<Integer, List<Integer>> e = new Pair<>(vertex.getValue().getDuración(), list); verticesRecorridos.add(e); } else { // Sino buscamos la ultima lista de vertices agregada, y se lo agregamos a la lista Pair<Integer, List<Integer>> integerListPair = verticesRecorridos.get(verticesRecorridos.size() - 1); integerListPair.setKey(integerListPair.getKey() + vertex.getValue().getDuración()); integerListPair.getValue().add(vertex.getId()); } Pair<Integer, List<Integer>> lastPair = verticesRecorridos.get(verticesRecorridos.size() - 1); List<Integer> aux = new ArrayList<>(); int timeAux = 0; for (Iterator<Arc<Integer>> it = vertex.getArcs(); it.hasNext(); ) { Arc<Integer> next = it.next(); Vertex<Tarea, Integer> adjacentVertex = findVertex(next.getVerticeDestino()); // Si tiene mas de un adyacente agregamos el mismo elemento a la lista if(multiBranch) { Pair e = new Pair(timeAux, aux); lastPair = e; verticesRecorridos.add(e); } else { multiBranch = true; Pair<Integer, List<Integer>> integerListPair = lastPair; aux.addAll(integerListPair.getValue()); timeAux = integerListPair.getKey(); } lastPair.setKey(lastPair.getKey() + next.getEtiqueta()); dfsVisit(adjacentVertex, verticesRecorridos); } return verticesRecorridos; } }
32a9a767f5802cc2b92f01fdbb3c20fa906f5739
074a5a1738426fec093f1d7346d40f4056a7a9ce
/bigpolis-parent/tserd14Browser/src/main/java/br/net/neuromancer/bigpolis/tserd14/repository/search/PolCandidacySearchRepository.java
7fd1d238bcb74915767a47690e312923b19f1a8b
[ "MIT" ]
permissive
luiz158/BigPolis
edd15b5634ed0b6c1707c0cc55430285451dcc4b
065efa2a0024c9194644f506a11a8c74872a4c41
refs/heads/master
2020-12-25T02:24:22.468995
2016-01-19T15:35:56
2016-01-19T15:35:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
390
java
package br.net.neuromancer.bigpolis.tserd14.repository.search; import br.net.neuromancer.bigpolis.tserd14.domain.PolCandidacy; import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; /** * Spring Data ElasticSearch repository for the PolCandidacy entity. */ public interface PolCandidacySearchRepository extends ElasticsearchRepository<PolCandidacy, Long> { }
23c5df396de377d493de007d204f383d8691cc9d
e0326c4e6139bf6e24765da5412be53169d3dee8
/src/com/twu28/biblioteca/DisplayMovie.java
d27c26cc17f36cfb878fbcd0cae1db1ebf0427d8
[]
no_license
arathyjan/biblioteca
a130da9fdf18d4edc2fd2781f1961ef48e18e3ee
4b3069ff33559babed276a8f6960dc3664a0cdb4
refs/heads/master
2021-01-18T10:41:48.255424
2012-10-06T19:49:24
2012-10-06T19:49:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
274
java
package com.twu28.biblioteca; public class DisplayMovie implements Command { Movie[] objMovie; public DisplayMovie(Movie[] objMovie) { this.objMovie=objMovie; } @Override public void execute(){ Movie.DisplayMovie(objMovie); } }
05f69d66110ca5094ec2745a1bb64d322e5c0495
6e24c7efb8b59ff0c4e0f9e89ebd034e5d177604
/shiningstarbase/src/main/java/aloha/shiningstarbase/base/BasePresenter.java
3be871db0a5a649e6318e74ec3402132afe7aead
[]
no_license
ShiningStarWorld/ShiningStarLibrary
053a6da13d0d23c67b27e1ee9ea83c0f4b6cddb8
5c3449ddff57bab5184e7958b2165533944c2341
refs/heads/master
2020-04-05T11:22:16.288760
2017-07-29T06:25:51
2017-07-29T06:25:51
81,404,520
2
0
null
null
null
null
UTF-8
Java
false
false
1,694
java
package aloha.shiningstarbase.base; import java.lang.ref.WeakReference; import java.util.Map; import aloha.shiningstarbase.logger.LogUtil; /** * Created by Aloha <br> * -explain 父类Presenter * @Date 2016/9/26 17:10 * @version 1.0.0 */ public abstract class BasePresenter<V extends IBaseView> implements IBasePresenter { //传递view private WeakReference<V> mView; /** * Created by Aloha <br> * @Date 2016/9/29 14:15 * @explain 绑定view */ @Override public void lockContentView(IBaseView view) { this.mView = new WeakReference<V>((V) view); LogUtil.biu(getClass().toString()); } /** * Created by Aloha <br> * @Date 2016/9/29 14:16 * @explain 解绑view */ @Override public void unlockContentView() { if (mView!=null){ mView.clear(); mView = null; } } /** * Created by Aloha <br> * -explain 获取 presenter绑定的view * @Date 2016/10/10 10:42 */ @Override public V getContentView() { if (mView!=null){ return mView.get(); } return null; } protected void addRequestAsyncTask() { } /** * Created by Aloha <br> * @Date 2016/9/29 15:28 * @explain 数据回调,由子类实现并自行处理response * @param status * @param status * @param status * @date **/ protected abstract void onResponseAsyncDeal(final int status, final String message, final String result, final String requestID); protected void onResponseAsyncDeal(int status, String message, Map<String, Object> resultMap, String requestID){} }
6c13775319cd50ecbd7bdbb73d65d0f1021912f6
08bdd164c174d24e69be25bf952322b84573f216
/opencores/client/foundation classes/j2sdk-1_4_2-src-scsl/hotspot/src/share/vm/agent/sun/jvm/hotspot/utilities/BitMapClosure.java
d7e630f6b7d858cb8bb7a5591953a50faf231c4f
[]
no_license
hagyhang/myforthprocessor
1861dcabcf2aeccf0ab49791f510863d97d89a77
210083fe71c39fa5d92f1f1acb62392a7f77aa9e
refs/heads/master
2021-05-28T01:42:50.538428
2014-07-17T14:14:33
2014-07-17T14:14:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
342
java
/* * @(#)BitMapClosure.java 1.3 03/01/23 11:51:10 * * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package sun.jvm.hotspot.utilities; public interface BitMapClosure { /** Called when specified bit in map is set */ public void doBit(int offset); }
d8a1de9c7fdbe7795453da14b511c349fa13c2b4
8e1e1531f9a4d06409f6582b9f4fc20da38bdb85
/registracia-konferencia/src/main/java/sk/upjs/registracia_konferencia/CompanionCategory.java
2d10294cb7352eac1d6f5bfd1704e4d04418784b
[]
no_license
jsiladi/registracia_konferencia
66fef3dcfdf6d7e05fce07e78018ca703c4d77d9
efd7e22cf2d1fd8fd8b75976915f34519d8fd07a
refs/heads/master
2020-03-30T15:31:27.956403
2018-10-03T05:48:29
2018-10-03T05:48:29
151,366,994
0
0
null
null
null
null
UTF-8
Java
false
false
124
java
package sk.upjs.registracia_konferencia; public enum CompanionCategory { CHILD_UNDER_6, CHILD_UNDER_12, ADULT; }
2b33b7c19cff7e0d70df8b577a89ce25e10bb619
de6f99703933a3e1d5b015c411d3ba304a1b3f57
/StringMatcher.java
a9594bf3a2a7b85aeca4e27ac45079847547ab49
[]
no_license
draco-malfoy/javapractice
b0dff55b467dee10d815d2ffd3b4e76fb13e02eb
62d3968a130f39f017252a3348de55a8567a3d0e
refs/heads/master
2020-07-08T21:51:24.458702
2020-04-07T13:13:51
2020-04-07T13:13:51
203,788,392
1
0
null
null
null
null
UTF-8
Java
false
false
785
java
import java.util.regex.Pattern; import java.util.regex.Matcher; import java.util.*; public class StringMatcher { public static String str = "1"; public static void main(String []args){ boolean boo = str.matches("[^0-9]* [12]? [0-9]{1,2} [^0-9]*"); System.out.println(boo); } } 0*(?:[1-9][0-9]?|100) (?: # Match the regular expression below # Match either the regular expression below (attempting the next alternative only if this one fails) [1-9] # Match a single character in the range between “1” and “9” [0-9] # Match a single character in the range between “0” and “9” ? # Between zero and one times, as many times as possible, giving back as needed (greedy)
0ec26c8ce27e72fbe85878ccc858f3141f6e4434
d3e3e23402aa4cf47e9467aa92dedb5e940f3c05
/HelloWorld/src/test/java/de/schapoehler/FirstApplication/FirstApplicationTests.java
36c5cc8340056cf2edd40145277de0b8f4eaf137
[]
no_license
Etone/hse-distibuted-systems
9ce3b106e4624e4a278e27f75d1eb64f3d393f2b
f476a05a6baf505684f9257159dcdec521e85f22
refs/heads/master
2021-08-11T07:54:48.560004
2017-11-13T11:06:53
2017-11-13T11:06:53
107,146,388
0
0
null
null
null
null
UTF-8
Java
false
false
347
java
package de.schapoehler.FirstApplication; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class FirstApplicationTests { @Test public void contextLoads() { } }
2f19bfd7c8df2828b5baab26114d6e3eb7f650ff
447520f40e82a060368a0802a391697bc00be96f
/apks/apks_from_phone/data_app_com_monefy_app_lite-2/source/com/google/analytics/tracking/android/ServiceManager.java
fe230054bb4fa25491c97bb8c5d83410cfab6593
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
288
java
package com.google.analytics.tracking.android; public abstract class ServiceManager { public ServiceManager() {} @Deprecated public abstract void a(int paramInt); abstract void a(boolean paramBoolean); @Deprecated public abstract void c(); abstract void e(); }
80fda5f5d2c9bd9a8ee8f6a2866ee59f3ce44151
a673c447fbfcc38ede71e6a3459fbd90784ff959
/order/server/src/main/java/com/csy/order/message/MqReceiver.java
d77165290fd794e3f76d95b0098c118319a2d214
[]
no_license
pyy55open/microService
98f1b8b2c7cd138893c23f25774639cc6f846f76
7b03cd9a3e75625286c94a32bdbeea242d71faaa
refs/heads/master
2020-03-31T12:36:54.300892
2018-10-29T03:35:06
2018-10-29T03:35:06
152,223,482
0
0
null
null
null
null
UTF-8
Java
false
false
1,292
java
package com.csy.order.message; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.rabbit.annotation.Exchange; import org.springframework.amqp.rabbit.annotation.Queue; import org.springframework.amqp.rabbit.annotation.QueueBinding; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.stereotype.Component; @Slf4j @Component public class MqReceiver { //1.@RabbitListener(queues = "myQueue") 需要先新建myQueue //2.@RabbitListener(queuesToDeclare = @Queue("myQueue")) 自动创建队列 //3.@RabbitListener(bindings = @QueueBinding(value = @Queue("myQueue"),exchange = @Exchange("myExchange"))) @RabbitListener(bindings = @QueueBinding(value = @Queue("myQueue"),exchange = @Exchange("myExchange"))) public void getQueue(String msg){ log.info("mqReceiver:{}",msg); } @RabbitListener(bindings = @QueueBinding(value = @Queue("fashionOrder"),exchange = @Exchange("myExchange"),key = "fashion")) public void getFashionOrder(String msg){ log.info("mqReceiver:{}",msg); } @RabbitListener(bindings = @QueueBinding(value = @Queue("foodOrder"),exchange = @Exchange("myExchange"),key = "food")) public void getFoodOrder(String msg){ log.info("mqReceiver:{}",msg); } }
6b97cfe38ae5aa6e2fba5005235121875ad8ca42
3884dbdef57e4a2df818f8ba3a63bec90a59f8b2
/Source Code/Mystic/src/Testing.java
cc03a6385cc1560bfa2441695e8793b716734b48
[]
no_license
katiehrenchir/EECS448-Project4
1719cd690c7024f68494d7b8ca42dda87ec7fc3a
6ab429a9e1fa4fcc3d94fa900b1c2efdaf665889
refs/heads/master
2021-06-08T16:00:24.474996
2016-12-17T18:20:21
2016-12-17T18:20:21
72,139,793
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
public class Testing { public Testing(){ testMysticDriver(); testMystic(); testMysticFileInput(); testRunPythonScript(); testMysticFileOutput(); } private void testMysticDriver(){ MysticDriver mysticdriver = new MysticDriver(); //test if } private void testMystic(){ //test if given no query (note: accounted for in MysticDriver class) //test if given no topic (note: topic defaults to "relationships") } //test if the query is submitted with no button selected private void testMysticFileInput(){ //if the query and topic are both submitted empty MysticFileInput test = new MysticFileInput("", ""); } private void testRunPythonScript(){ } private void testMysticFileOutput(){ } //test if the query is submitted empty //test if the input file for the script is empty //test if the output file for the script turns up empty //test }
5017dcb0bd9a9968c660eca087c9ec011c2197a6
bfac9c3a78cd99a2b45199f007c0f07806841f9f
/hibernate-inheritance-one-class/src/main/java/jesg/to/Employee.java
f9e27158bbeadda9f162172c0c3565922eeb6286
[ "Apache-2.0" ]
permissive
jesg/hibernate-demo
64d035fe9a887e6beeb5ef4898896bf82a0401c4
9d78a3073e1942eb1370f2d3dfded088847fc12f
refs/heads/master
2016-09-06T12:58:43.958276
2013-12-02T23:46:53
2013-12-02T23:46:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package jesg.to; import java.util.Date; import java.util.HashSet; import java.util.Set; public class Employee extends Person { private Date joinDate; private String cellPhone; public Employee(){} public Employee(String firstName, String lastName, Date joinDate, String cellPhone) { super(firstName, lastName); this.joinDate = joinDate; this.cellPhone = cellPhone; } public Date getJoinDate() { return joinDate; } public void setJoinDate(Date joinDate) { this.joinDate = joinDate; } public String getCellPhone() { return cellPhone; } public void setCellPhone(String cellPhone) { this.cellPhone = cellPhone; } @Override public String toString() { return "Employee [joinDate=" + joinDate + ", cellPhone=" + cellPhone + "]"; } }
0ea18e71535a4fb845daa939ff478cc30805911b
6227c888c90b95fac6f61feed0c919cc1ef7a041
/src/com/conadesign/darkchessUI/mainform.java
81e7f23f95f8dad4dd243781d588f0aa0691967a
[]
no_license
terrylao/darkChessUI
dfd36a07f885333718c810d084fb39c07194e5cd
868515481a52a8becf30977069eaedccbcc4b837
refs/heads/master
2021-01-13T01:25:25.505440
2014-07-31T11:00:18
2014-07-31T11:00:18
22,463,855
1
1
null
null
null
null
UTF-8
Java
false
false
56,034
java
package com.conadesign.darkchessUI; /** * Protocol: * Board describe: * 1. horizontal * 2. so has 8 columns, from A~H * 3. has 4 rows,from 1~4 * Chess describe: * Empty place '-', * Red King 'K', 帥 * Red Guard 'G', 仕 * Red 'M', 相 * Red Rook 'R', 俥 * Red Knight 'N', 傌 * Red Cannon 'C', 炮 * Red 'P', 兵 * Black part 'k', 'g', 'm', 'r', 'n', 'c', 'p', * not flip 'X'. * * Server Client <----------(J)oin------------ ---(F)irst/(S)econd/(R)eject---> //Reject will close session <---------(G)rant[Name max 20 char, left shift right padding]--------------- ------(N)ame[Name max 20 char, left shift right padding]--------------->//opposite player name, and then waiting for server to call for Move ----------(C)all-------------> //Call for Move <-------(O)pen[A-H][1-4]/(M)ove[A-H][1-4][A-H][1-4]--- --------(O)pen[A-H][1-4][CHESS]/(M)ove[A-H][1-4][CHESS][A-H][1-4][CHESS]---/(I)nvalid------> //O/M will broadcast, "I" only return to calli, after I, will send "C" again --------Yo(U)[(R)ed/(B)lack]----------> // to tell client which color they are ---------Yo(U)[(W)in/(L)ose/(D)raw]--------> //when one of player send U or has no more chess in board -----------Next Game(X)------------------------->Next Game <-----------Next Game(X) accept-------------------------Next Game ready <---------(D)isconnect--------> //after receive D, just close session suddenly disconnect and reconnect: <----------Jo(I)n------------ --------Transfer Last (B)oard State---------->//傳送現在的盤面,32byte board, 16bytes dead black, 16 bytes dead red ----(T)ransfer--->//Transfer for transfer the step action from start to last, it follow the command ----------(C)all-------------> //Call for Move if waiting for this client send move */ import java.awt.Color; import java.awt.EventQueue; import java.awt.Graphics; import java.awt.Image; import javax.swing.DefaultListModel; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JTabbedPane; import javax.swing.JTextField; import javax.swing.JList; import javax.swing.ListModel; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Calendar; import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.Random; import javax.swing.JScrollPane; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class mainform extends JFrame implements Runnable{ /** * */ private final static int smallchessWidth=30; private final static int smallchessHeight=30; private final static int chessWidth=60; private final static int chessHeight=60; private static final long serialVersionUID = 1L; private JComponent canvas; private BufferedImage offScreen; Graphics graphics,backgraphics; JList<String> listContent; JList<String> listFile; JLabel lblPlayer1; JLabel lblPlayer2; private JTextField edtWinMatches; private JTextField edtTotalMatches; private JTextField edtListen; private JTextField edtTimeout; private JTextField edtFreestep; JButton btnStart,btnExport; private String CurrentFileName; String path = new java.io.File(".").getCanonicalPath(); //0=空, 1=卒, 2=包, 3=馬, 4=車, 5=象, 6=士, 7=將. // 8=兵, 9=炮, 10=傌, 11=俥, 12=相, 13=仕, 14=帥, 15=未翻 public int [][] board=new int[4][8]; public int [][] darkboard=new int [4][8]; public int [][] logdarkboard=new int [4][8]; public int freestepCount,freestepMax,logMaxLines; //每次選到頻色後, 就要將SOCKET 指到ACOLOR 中 Socket [] socket=new Socket[2]; String [] Names={"",""}; public int [][] score=new int[2][3];//[0][]=黑的/win/lose/draw public int matchMax,matchWin,curMatch;//最多幾盤, 幾盤勝, 現在為第幾盤 public int [] atimer=new int[2];//0 = BLACK 所對應的TIMER, 1=RED 所對應的TIMER public int [] acolor=new int[2];//SOCKET 所對應的 COLOR //public int curPlayer;//0=black, 1=red, 2=no played -->由這去acolor 查到要往哪個SOCKET 去send request, 也可以查到對應的atimer //[0][] = 存黑子, [1][]=存紅子, 由acolor 的值,可以查到紅/黑是畫在上或下方 public int [][] deadChess={{0,1,1,1,1,1,2,2,3,3,4,4,5,5,6,6,7},{0,8,8,8,8,8,9,9,10,10,11,11,12,12,13,13,14}}; public int [] deadcount={16,16}; int darkCount; byte [] charmapper={'-','p','c','n','r','m','g','k','P','C','N','R','M','G','K','X'}; String [] scharmapper={"-","p","c","n","r","m","g","k","P","C","N","R","M","G","K","X"}; HashMap<String,Integer> invertcharmapper= new HashMap<String,Integer>(); int fx=-1,fy,tx=-1,ty; public int currentplayer=2,logfirstPlayer;//0 = socket 0, 1= socket 1, 2 = not in playing int firstMove; int logindex; int isTimeout; private Image [] imgChess = new Image[16]; private Image imgboard,lhand,rhand,redIcon,blackIcon ; private boolean isServerStart=false; private boolean OutServer = false; private ServerSocket server; String curPath; private int[] curTimer=new int[3]; private timerThread tt; public JLabel lblTimer2; public JLabel lblTimer1; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { mainform window = new mainform(); window.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. * @throws IOException */ public mainform() throws IOException { addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent arg0) { OutServer=true; try{ if(socket[0]!=null) socket[0].close(); if(socket[1]!=null) socket[1].close(); }catch (Exception e){ } } }); loadImg(); initialize(); socket[0]=null; socket[1]=null; curMatch=0; } public void startGame(){ suffle(); System.out.println("Dark Board:"); for (int i=0;i<4;i++){ String q=""; for (int j=0;j<8;j++){ q+=String.format("%02d", darkboard[i][j])+","; } System.out.println(q); } System.out.println("Log Dark Board:"); for (int i=0;i<4;i++){ String q=""; for (int j=0;j<8;j++){ q+=String.format("%02d", logdarkboard[i][j])+","; } System.out.println(q); } String s=""; for (int i=0;i<16;i++){ s+=scharmapper[deadChess[0][i]]; } System.out.println("Black chess:"+s); s=""; for (int i=0;i<16;i++){ s+=scharmapper[deadChess[1][i]]; } System.out.println("Red chess:"+s); fx=-1; tx=-1; curMatch++; currentplayer=1-(curMatch%2); firstMove=1; if (isServerStart==false){ Thread t=new Thread (this); t. start(); isServerStart=true; } canvas.repaint(); curTimer[0]=atimer[0]*1000; curTimer[1]=atimer[1]*1000; isTimeout=-1; } public void clearBoard(){ for (int i=0;i<4;i++){ for (int j=0;j<8;j++){ if (board[i][j]>0&&board[i][j]<15){ capedChess(board[i][j]); }else if (darkboard[i][j]>0){ capedChess(darkboard[i][j]); } } } } public void suffle(){ int i,j,k; int bx=0,by=0; Random rnd2=new Random(System.currentTimeMillis()); Random rnd=new Random(rnd2.nextLong()); clearBoard(); i=0; do{ int color; int chess; color=rnd.nextInt(2); chess=rnd.nextInt(16)+1; j=0; if (deadChess[color][chess]>0){ darkboard[by][bx]=deadChess[color][chess]; logdarkboard[by][bx]=deadChess[color][chess]; board[by][bx]=15; deadChess[color][chess]=0; bx++; if (bx==8){ bx=0; by++; } }else{ for (k=chess+1;k<17;k++){ if (deadChess[color][k]>0){ darkboard[by][bx]=deadChess[color][k]; logdarkboard[by][bx]=deadChess[color][k]; board[by][bx]=15; deadChess[color][k]=0; bx++; if (bx==8){ bx=0; by++; } j=1; break; } } if (j==0){ for (k=1;k<17;k++){ if (deadChess[1-color][k]>0){ darkboard[by][bx]=deadChess[1-color][k]; logdarkboard[by][bx]=deadChess[1-color][k]; board[by][bx]=15; deadChess[1-color][k]=0; bx++; if (bx==8){ bx=0; by++; } j=1; break; } } } if (j==0){ for (k=1;k<chess;k++){ if (deadChess[color][k]>0){ darkboard[by][bx]=deadChess[color][k]; logdarkboard[by][bx]=deadChess[color][k]; board[by][bx]=15; deadChess[color][k]=0; bx++; if (bx==8){ bx=0; by++; } j=1; break; } } } if (j==0){ //WHAT'S HAPPEN? } } i++; }while(i<32); deadcount[0]=0; deadcount[1]=0; darkCount=32; } public void capedChess(int c){ if (c>7){ deadcount[1]++; if (deadcount[1]==17){ dumpboard(); } deadChess[1][deadcount[1]]=c; }else if (c>0){ deadcount[0]++; if (deadcount[0]==17){ dumpboard(); } deadChess[0][deadcount[0]]=c; } } // 1= currentplayer win, 2 =draw game, 0 = nothing happen, 3 = currentplay lose //** this function must be call before change side ** public int checkState(){ int opponent=1-currentplayer; System.out.println("Check current color:"+acolor[currentplayer]+",op color:"+acolor[opponent]); if (deadcount[acolor[opponent]]==16){ System.out.println("all dead of color:"+opponent); dumpboard(); return 1; } System.out.println("darkCount:"+darkCount); if (darkCount==0&&hasMove(acolor[opponent])==0){ System.out.println("color:"+acolor[opponent]+" has no moves" ); return 1; } System.out.println("still has move of side:"+acolor[opponent]); if (curTimer[currentplayer]<=0){ return 3; } if (freestepCount>freestepMax){ return 2; } return 0; } private void dumpboard() { System.out.println("start dump board..."); for (int i=0;i<4;i++){ String q=""; for (int j=0;j<8;j++){ q+=String.format("%02d", board[i][j])+","; } System.out.println(q); } System.out.println("start dump darkboard..."); for (int i=0;i<4;i++){ String q=""; for (int j=0;j<8;j++){ q+=String.format("%02d", darkboard[i][j])+","; } System.out.println(q); } System.out.println("start dump logdarkboard..."); for (int i=0;i<4;i++){ String q=""; for (int j=0;j<8;j++){ q+=String.format("%02d", logdarkboard[i][j])+","; } System.out.println(q); } System.out.println("start dump deadChess..."); for (int i=0;i<2;i++){ String q=""; for (int j=1;j<17;j++){ q+=String.format("%02d", deadChess[i][j])+","; } System.out.println(q); } } int checkCannonCap(int x,int y,int oppolower, int oppoupper){ int i,j,result=0;; /* X axis positive direction */ j=8; for (i=x+1;i<7;i++) if (board[y][i]!=0){ j=i; break; } for (i=j+1;i<8;i++) if (board[y][i]>oppolower&&board[y][i]<oppoupper){ result++; break; }else if (board[y][i]!=0) break; /* X axis negative direction */ j=-1; for (i=x-1;i>0;i--) if (board[y][i]!=0){ j=i; break; } for (i=j-1;i>-1;i--) if (board[y][i]>oppolower&&board[y][i]<oppoupper){ result++; break; }else if (board[y][i]!=0) break; /* Y axis positive direction */ j=4; for (i=y+1;i<3;i++) if (board[i][x]!=0){ j=i; break; } for (i=j+1;i<4;i++) if (board[i][x]>oppolower&&board[i][x]<oppoupper){ result++; break; }else if (board[i][x]!=0) break; /* Y axis negative direction */ j=-1; for (i=y-1;i>0;i--) if (board[i][x]!=0){ j=i; break; } for (i=j-1;i>-1;i--) if (board[i][x]>oppolower&&board[i][x]<oppoupper){ result++; break; }else if (board[i][x]!=0) break; return result; } private int hasMove(int icolor) { System.out.println("checking color hasMove of :"+icolor); for (int i=0;i<4;i++){ for (int j=0;j<8;j++){ if (icolor==0){ if (board[i][j]>0&&board[i][j]<8){ System.out.println("black chess at i="+i+",j="+j+" is :"+board[i][j]); if (board[i][j]==2){ if (checkCannonCap(j,i,7,15)>0){ System.out.println("checkCannonCap 7-15 at i="+i+",j="+j); return 1; } if (hasWay(i,j)>0){ System.out.println("hasway at i="+i+",j="+j); return 1; } }else{ if (hasWay(i,j)>0){ System.out.println("hasway at i="+i+",j="+j); return 1; } if (hasCap(i,j)>0){ System.out.println("hasCap at i="+i+",j="+j); return 1; } } } }else{ if (board[i][j]>7&&board[i][j]<15){ System.out.println("red chess at i="+i+",j="+j+" is :"+board[i][j]); if (board[i][j]==9){ if (checkCannonCap(j,i,0,8)>0){ System.out.println("checkCannonCap 0-8 at i="+i+",j="+j); return 1; } if (hasWay(i,j)>0){ System.out.println("hasway at i="+i+",j="+j); return 1; } }else{ if (hasWay(i,j)>0){ System.out.println("hasway at i="+i+",j="+j); return 1; } if (hasCap(i,j)>0){ System.out.println("hasCap at i="+i+",j="+j); return 1; } } } } } } return 0; } private int hasCap(int y, int x) { if (x==0&&y==0){ if (canCap(board[y][x],board[y+1][x])>0){ return 1; } if (canCap(board[y][x],board[y][x+1])>0){ return 1; } return 0; } if (x==0&&y==3){ if (canCap(board[y][x],board[y-1][x])>0){ return 1; } if (canCap(board[y][x],board[y][x+1])>0){ return 1; } return 0; } if (x==7&&y==0){ if (canCap(board[y][x],board[y+1][x])>0){ return 1; } if (canCap(board[y][x],board[y][x-1])>0){ return 1; } return 0; } if (x==7&&y==3){ if (canCap(board[y][x],board[y-1][x])>0){ return 1; } if (canCap(board[y][x],board[y][x-1])>0){ return 1; } return 0; } if (x==0){ if (canCap(board[y][x],board[y+1][x])>0){ return 1; } if (canCap(board[y][x],board[y-1][x])>0){ return 1; } if (canCap(board[y][x],board[y][x+1])>0){ return 1; } return 0; } if (x==7){ if (canCap(board[y][x],board[y-1][x])>0){ return 1; } if (canCap(board[y][x],board[y+2][x])>0){ return 1; } if (canCap(board[y][x],board[y][x-1])>0){ return 1; } return 0; } if (y==0){ if (canCap(board[y][x],board[y][x-1])>0){ return 1; } if (canCap(board[y][x],board[y][x+1])>0){ return 1; } if (canCap(board[y][x],board[y+1][x])>0){ return 1; } return 0; } if (y==3){ if (canCap(board[y][x],board[y][x+1])>0){ return 1; } if (canCap(board[y][x],board[y][x-1])>0){ return 1; } if (canCap(board[y][x],board[y-1][x])>0){ return 1; } return 0; } if (canCap(board[y][x],board[y+1][x])>0){ return 1; } if (canCap(board[y][x],board[y-1][x])>0){ return 1; } if (canCap(board[y][x],board[y][x+1])>0){ return 1; } if (canCap(board[y][x],board[y][x-1])>0){ return 1; } return 0; } private int hasWay(int y, int x) { if (x==0&&y==0){ if (board[y+1][x]==0){ return 1; } if (board[y][x+1]==0){ return 1; } return 0; } if (x==0&&y==3){ if (board[y-1][x]==0){ return 1; } if (board[y][x+1]==0){ return 1; } return 0; } if (x==7&&y==0){ if (board[y+1][x]==0){ return 1; } if (board[y][x-1]==0){ return 1; } return 0; } if (x==7&&y==3){ if (board[y-1][x]==0){ return 1; } if (board[y][x-1]==0){ return 1; } return 0; } if (x==0){ if (board[y+1][x]==0){ return 1; } if (board[y][x+1]==0){ return 1; } if (board[y-1][x]==0){ return 1; } return 0; } if (x==7){ if (board[y-1][x]==0){ return 1; } if (board[y+1][x]==0){ return 1; } if (board[y][x-1]==0){ return 1; } return 0; } if (y==0){ if (board[y+1][x]==0){ return 1; } if (board[y][x-1]==0){ return 1; } if (board[y][x+1]==0){ return 1; } return 0; } if (y==3){ if (board[y-1][x]==0){ return 1; } if (board[y][x+1]==0){ return 1; } if (board[y][x-1]==0){ return 1; } return 0; } if (board[y+1][x]==0){ return 1; } if (board[y-1][x]==0){ return 1; } if (board[y][x+1]==0){ return 1; } if (board[y][x-1]==0){ return 1; } return 0; } public int canCap(int i,int j){ if (i==15||j==15) return 0; if (i==0||j==0) return 0; if (i>7&&j>7){ return 0; } if (i<8&&j<8){ return 0; } if (i==2||i==9) return 1; if (i==1&&j==14){ return 1; } if (i==8&&j==7){ return 1; } if (i==14&&j==1){ return 0; } if (i==7&&j==8){ return 0; } if (i<8){ if (i+7>=j) return 1; }else{ if (i>=j+7) return 1; } return 0; } private void drawboard(Graphics g){ int i,j,k=1,l; backgraphics.drawImage(imgboard, 0, 0, canvas.getWidth(), canvas.getHeight(), canvas); for (i=0;i<2;i++){ l=30; for (j=1;j<17;j++){ if (deadChess[i][j]>0){ backgraphics.drawImage(imgChess[deadChess[i][j]], l, k,smallchessWidth,smallchessHeight,canvas); }else{ break; } l+=smallchessWidth+1; } k+=smallchessHeight-1; } k=72; for (i=0;i<4;i++){ l=52; for (j=0;j<8;j++){ if (board[i][j]>0){ backgraphics.drawImage(imgChess[board[i][j]], l, k,chessWidth,chessHeight, canvas); } l+=chessWidth-3; } k+=chessHeight+12; } if (acolor[0]==0){ backgraphics.drawImage(blackIcon, 0, 4,30,40, canvas); backgraphics.drawImage(redIcon, canvas.getWidth()-34, 4,30,40, canvas); }else{ backgraphics.drawImage(redIcon, 0, 4,30,40, canvas); backgraphics.drawImage(blackIcon, canvas.getWidth()-34, 4,30,40, canvas); } System.out.println("currentplayer="+currentplayer); if (currentplayer<2){ if (currentplayer==1){ backgraphics.drawImage(rhand, canvas.getWidth()-100, 20,60,80, canvas); }else{ backgraphics.drawImage(lhand, 34, 20,60,80, canvas); } } if (fx==-1){ if (tx>-1){ backgraphics.setColor(Color.RED); backgraphics.drawRect(52+tx*(chessWidth-3), 72+ty*(chessHeight+12), chessWidth, chessHeight+4); } }else{ backgraphics.setColor(Color.YELLOW); backgraphics.drawRect(52+fx*(chessWidth-3), 72+fy*(chessHeight+12), chessWidth, chessHeight+4); backgraphics.setColor(Color.RED); backgraphics.drawRect(52+tx*(chessWidth-3), 72+ty*(chessHeight+12), chessWidth, chessHeight+4); } backgraphics.drawString(""+score[1][0], canvas.getWidth()-34, 54); backgraphics.drawString(""+score[1][1], canvas.getWidth()-34, 74); backgraphics.drawString(""+score[1][2], canvas.getWidth()-34, 94); backgraphics.drawString(lblPlayer2.getText().trim(), canvas.getWidth()-34, 114); backgraphics.drawString(""+score[0][0], 4, 54); backgraphics.drawString(""+score[0][1], 4, 74); backgraphics.drawString(""+score[0][2], 4, 94); backgraphics.drawString(lblPlayer1.getText().trim(), 4, 114); backgraphics.drawString(curMatch+"/"+matchMax, 4, 300); backgraphics.drawString(freestepCount+"/"+freestepMax, canvas.getWidth()-34, 300); g.drawImage(offScreen, 0, 0,null); } private void loadImg(){ ClassLoader cl = this.getClass().getClassLoader(); for (int i=1;i<16;i++){ imgChess[i]=new ImageIcon(cl.getResource("images/"+i+".png")).getImage(); } imgboard = new ImageIcon(cl.getResource("images/"+"board.png")).getImage(); redIcon = new ImageIcon(cl.getResource("images/"+"redOne.png")).getImage(); blackIcon = new ImageIcon(cl.getResource("images/"+"blackOne.png")).getImage(); rhand=new ImageIcon(cl.getResource("images/"+"righArrow.png")).getImage(); lhand=new ImageIcon(cl.getResource("images/"+"leftArrow.png")).getImage(); } /* private void loadImg(){ for (int i=1;i<16;i++){ imgChess[i]=new ImageIcon(path+"/images/"+i+".png").getImage(); } imgboard = new ImageIcon(path+"/images/board.png").getImage(); redIcon = new ImageIcon(path+"/images/redOne.png").getImage(); blackIcon = new ImageIcon(path+"/images/blackOne.png").getImage(); rhand=new ImageIcon(path+"/images/righArrow.png").getImage(); lhand=new ImageIcon(path+"/images/leftArrow.png").getImage(); } */ /** * Initialize the contents of the frame. * @throws IOException */ public String getBoardInfo(){ String s=""; int i,j; for (i=0;i<4;i++) for (j=0;j<8;j++){ if (board[i][j]>0&&board[i][j]<15) s+=scharmapper[board[i][j]]; else if (board[i][j]==0) s+="-"; else s+="X"; } for (i=1;i<17;i++){ s+=scharmapper[deadChess[0][i]]; } for (i=1;i<17;i++){ s+=scharmapper[deadChess[1][i]]; } s+=currentplayer+""; return s; } private void initialize() throws IOException { currentplayer=2; System.out.println(path); setBounds(100, 100, 870, 402); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().setLayout(null); canvas = new JComponent() { /** * */ private static final long serialVersionUID = 1L; @Override // check this is a real method public void paintComponent(Graphics g) { super.paintComponent(g); drawboard(g); } }; // layout mana canvas.setBounds(0, 0, 557, 364); getContentPane().add(canvas); setVisible(true); offScreen = (BufferedImage)createImage(canvas.getWidth(), canvas.getHeight()); backgraphics = offScreen.createGraphics(); JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); tabbedPane.setBounds(554, 0, 300, 364); getContentPane().add(tabbedPane); JPanel tabPanel1 = new JPanel(); tabbedPane.addTab("Setting", null, tabPanel1, null); tabPanel1.setLayout(null); lblPlayer1 = new JLabel("Player 1"); lblPlayer1.setBounds(10, 10, 130, 15); tabPanel1.add(lblPlayer1); lblPlayer2 = new JLabel("Player 2"); lblPlayer2.setBounds(10, 35, 130, 15); tabPanel1.add(lblPlayer2); JLabel lblMatches = new JLabel("Matches:"); lblMatches.setBounds(10, 80, 53, 15); tabPanel1.add(lblMatches); edtWinMatches = new JTextField(); edtWinMatches.setText("6"); edtWinMatches.setBounds(63, 77, 30, 21); tabPanel1.add(edtWinMatches); edtWinMatches.setColumns(10); edtTotalMatches = new JTextField(); edtTotalMatches.setText("10"); edtTotalMatches.setBounds(121, 77, 30, 21); tabPanel1.add(edtTotalMatches); edtTotalMatches.setColumns(10); JLabel label = new JLabel("/"); label.setBounds(103, 80, 46, 15); tabPanel1.add(label); btnStart = new JButton("Start New Game"); btnStart.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { freestepMax=Integer.parseInt(edtFreestep.getText()); matchMax=Integer.parseInt(edtTotalMatches.getText()); matchWin=Integer.parseInt(edtWinMatches.getText()); curMatch=0; deadChess[0][0 ]=0; deadChess[0][1 ]=1; deadChess[0][2 ]=1; deadChess[0][3 ]=1; deadChess[0][4 ]=1; deadChess[0][5 ]=1; deadChess[0][6 ]=2; deadChess[0][7 ]=2; deadChess[0][8 ]=3; deadChess[0][9 ]=3; deadChess[0][10]=4; deadChess[0][11]=4; deadChess[0][12]=5; deadChess[0][13]=5; deadChess[0][14]=6; deadChess[0][15]=6; deadChess[0][16]=7; deadChess[1][0 ]=0; deadChess[1][1 ]=8; deadChess[1][2 ]=8; deadChess[1][3 ]=8; deadChess[1][4 ]=8; deadChess[1][5 ]=8; deadChess[1][6 ]=9; deadChess[1][7 ]=9; deadChess[1][8 ]=10; deadChess[1][9 ]=10; deadChess[1][10]=11; deadChess[1][11]=11; deadChess[1][12]=12; deadChess[1][13]=12; deadChess[1][14]=13; deadChess[1][15]=13; deadChess[1][16]=14; deadcount[0]=16; deadcount[1]=16; atimer[0]=Integer.parseInt(edtTimeout.getText()); atimer[1]=atimer[0]; startGame(); btnStart.setEnabled(false); } }); btnStart.setBounds(6, 302, 87, 23); tabPanel1.add(btnStart); JLabel lblListen = new JLabel("Listen:"); lblListen.setBounds(10, 110, 46, 15); tabPanel1.add(lblListen); edtListen = new JTextField(); edtListen.setText("29888"); edtListen.setBounds(90, 108, 61, 21); tabPanel1.add(edtListen); edtListen.setColumns(10); JLabel lblTimeout = new JLabel("TimeOut:"); lblTimeout.setBounds(10, 142, 68, 15); tabPanel1.add(lblTimeout); edtTimeout = new JTextField(); edtTimeout.setText("1200"); edtTimeout.setBounds(88, 139, 61, 21); tabPanel1.add(edtTimeout); edtTimeout.setColumns(10); JLabel lblSeconds = new JLabel("Seconds"); lblSeconds.setBounds(153, 142, 66, 15); tabPanel1.add(lblSeconds); JLabel lblFreeStep = new JLabel("Free Step:"); lblFreeStep.setBounds(8, 169, 61, 15); tabPanel1.add(lblFreeStep); edtFreestep = new JTextField(); edtFreestep.setText("40"); edtFreestep.setBounds(113, 166, 38, 21); tabPanel1.add(edtFreestep); edtFreestep.setColumns(10); JLabel lblDrawGme = new JLabel("draw game"); lblDrawGme.setBounds(155, 170, 64, 15); tabPanel1.add(lblDrawGme); lblTimer1 = new JLabel("00:00"); lblTimer1.setBounds(150, 10, 69, 15); tabPanel1.add(lblTimer1); lblTimer2 = new JLabel("00:00"); lblTimer2.setBounds(150, 35, 69, 15); tabPanel1.add(lblTimer2); JPanel tabPanel2 = new JPanel(); tabbedPane.addTab("Logging", null, tabPanel2, null); tabPanel2.setLayout(null); DefaultListModel<String> model1 = new DefaultListModel<String>(); DefaultListModel<String> model2 = new DefaultListModel<String>(); listContent = new JList<String>(model1); listContent.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { logindex = listContent.locationToIndex(e.getPoint()); listContent.ensureIndexIsVisible(logindex); forwardTO(logindex); canvas.repaint(); } }); listContent.addKeyListener(new KeyListener(){ @Override public void keyPressed(KeyEvent arg0) { if (arg0.getKeyCode()==KeyEvent.VK_UP){ logindex--; if (logindex<0){ logindex=0; } forwardTO(logindex); canvas.repaint(); }else if (arg0.getKeyCode()==KeyEvent.VK_DOWN){ logindex++; if (logMaxLines<logindex){ logindex=logMaxLines; } forwardTO(logindex); canvas.repaint(); } } @Override public void keyReleased(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void keyTyped(KeyEvent arg0) { // TODO Auto-generated method stub } }); JScrollPane scrollPane1 = new JScrollPane(listContent); scrollPane1.setBounds(4, 25, 280, 190); tabPanel2.add(scrollPane1); JLabel lblFile = new JLabel("File:"); lblFile.setBounds(8, 224, 46, 15); tabPanel2.add(lblFile); btnExport = new JButton("to Clipboard"); btnExport.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); StringSelection strSel = new StringSelection(getBoardInfo()); clipboard.setContents(strSel, null); } }); btnExport.setBounds(140, 217, 127, 20); tabPanel2.add(btnExport); JButton btnFirst = new JButton("|<<"); btnFirst.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { cleanToBack(); logindex=0; currentplayer=logfirstPlayer; listContent.setSelectedIndex(0); listContent.ensureIndexIsVisible(listContent.getSelectedIndex()); canvas.repaint(); } }); btnFirst.setBounds(0, 0, 55, 23); tabPanel2.add(btnFirst); JButton btnBack = new JButton("<"); btnBack.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { listContent.setSelectedIndex(logindex); listContent.ensureIndexIsVisible(listContent.getSelectedIndex()); logindex--; if (logindex<0){ logindex=0; } forwardTO(logindex); canvas.repaint(); } }); btnBack.setBounds(56, 0, 55, 23); tabPanel2.add(btnBack); JButton btnForward = new JButton(">"); btnForward.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { logindex++; if (logMaxLines<logindex){ logindex=logMaxLines; } listContent.setSelectedIndex(logindex); listContent.ensureIndexIsVisible(listContent.getSelectedIndex()); forwardTO(logindex); canvas.repaint(); } }); btnForward.setBounds(112, 0, 55, 23); tabPanel2.add(btnForward); JButton btnLast = new JButton(">>|"); btnLast.setBounds(168, 0, 55, 23); btnLast.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { forwardTO(logMaxLines); logindex=logMaxLines; listContent.setSelectedIndex(logindex-1); listContent.ensureIndexIsVisible(listContent.getSelectedIndex()); canvas.repaint(); } }); tabPanel2.add(btnLast); JButton btnSave = new JButton("Save"); btnSave.setBounds(224, 0, 60, 23); btnSave.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { exportList( (DefaultListModel<String>) listContent.getModel(),199); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }); tabPanel2.add(btnSave); curPath=new java.io.File(".").getCanonicalPath(); listFile = new JList<String>(model2); listFile.addMouseListener(new ActionJListFile(listFile)); JScrollPane scrollPane = new JScrollPane(listFile); scrollPane.setBounds(4, 237, 280, 94); tabPanel2.add(scrollPane); File folder = new File(curPath); File[] listOfFiles = folder.listFiles(); Arrays.sort(listOfFiles, new Comparator<File>(){ public int compare(File f1, File f2) { return Long.valueOf(f1.lastModified()).compareTo(f2.lastModified()); } }); for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) { if (listOfFiles[i].getName().indexOf(".txt")>-1||listOfFiles[i].getName().indexOf(".TXT")>-1){ ( (DefaultListModel<String>) listFile.getModel() ).addElement(listOfFiles[i].getName()); } }/* else if (listOfFiles[i].isDirectory()) { ( (DefaultListModel<String>) listFile.getModel() ).addElement(listOfFiles[i].getName()+"/"); }*/ } invertcharmapper.put("-", 0); invertcharmapper.put("p", 1); invertcharmapper.put("c", 2); invertcharmapper.put("n", 3); invertcharmapper.put("r", 4); invertcharmapper.put("m", 5); invertcharmapper.put("g", 6); invertcharmapper.put("k", 7); invertcharmapper.put("P", 8); invertcharmapper.put("C", 9); invertcharmapper.put("N", 10); invertcharmapper.put("R", 11); invertcharmapper.put("M", 12); invertcharmapper.put("G", 13); invertcharmapper.put("K", 14); invertcharmapper.put("X", 15); } private void cleanToBack() { for (int i=0;i<2;i++){ for (int j=0;j<17;j++){ deadChess[i][j]=0; } } for (int i=0;i<4;i++){ for (int j=0;j<8;j++){ board[i][j]=15; } } deadcount[0]=0; deadcount[1]=0; copyboard(); } public class ActionJListFile extends MouseAdapter{ protected JList<String> list; public ActionJListFile(JList<String> l){ list = l; } public void mouseClicked(MouseEvent e){ if(curMatch==0&&e.getClickCount() == 2){ int index = list.locationToIndex(e.getPoint()); ListModel<String> dlm = list.getModel(); String item = dlm.getElementAt(index); list.ensureIndexIsVisible(index); System.out.println("Double clicked on " + item); try { cleanToBack(); CurrentFileName=item; importList(item); canvas.repaint(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } } } @Override public void run() {//main loop try { server = new ServerSocket(Integer.parseInt(edtListen.getText())); } catch (java.io.IOException e) { System.out.println("Socket啟動有問題 !"); System.out.println("IOException :" + e.toString()); } DataInputStream [] in=new DataInputStream[2]; DataOutputStream [] out=new DataOutputStream[2]; byte [] buf = new byte[4096]; byte [] outbuf = new byte[4096]; int hands=0; int gameState=0; long stime,etime; OutServer=false; System.out.println("伺服器已啟動 !"); try { while (!OutServer) { if (hands<2){ System.out.println("waiting for login...."+hands); socket[hands] = server.accept(); in[hands] = new DataInputStream (socket[hands].getInputStream()); out[hands] = new DataOutputStream (socket[hands].getOutputStream()); // Get input from the client in[hands].read(buf,0,1); if (buf[0]=='J'){ if (hands==0){ outbuf[0]='F'; }else{ outbuf[0]='S'; } out[hands].write(outbuf,0,1); in[hands].read(buf,0,1); if (buf[0]=='G'){ in[hands].read(buf,0,20); if (hands==0){ Names[0]=new String(buf); lblPlayer1.setText(Names[0]); }else{ Names[1]=new String(buf); lblPlayer2.setText(Names[1]); out[hands].write(('N'+Names[0]).getBytes()); out[hands].flush(); out[hands-1].write(('N'+Names[1]).getBytes()); out[hands-1].flush(); currentplayer=0; } }else{ outbuf[0]='R'; out[hands].write(outbuf,0,1); out[hands].flush(); } }else{ outbuf[0]='R'; out[hands].write(outbuf,0,1); out[hands].flush(); } hands++; } if (hands==2){//after two player login if (tt==null){ tt=new timerThread(); tt.start(); } do{ String s=null; System.out.println("send request...."); for (int i=0;i<40;i++) buf[i]=0; do{ stime=System.currentTimeMillis(); outbuf[0]='C'; out[currentplayer].write(outbuf,0,1); out[currentplayer].flush(); in[currentplayer].read(buf,0,1); if (buf[0]=='O'){ in[currentplayer].read(buf,1,2); }else if (buf[0]=='M'){ in[currentplayer].read(buf,1,4); } System.out.println("get "+new String(buf).trim()+" from client:"+currentplayer+" its color is "+acolor[currentplayer]); s=doClientRequest(buf); if (s!=null){ if (firstMove==2){ if (s.charAt(3)>'a'){ acolor[currentplayer]=0; acolor[1-currentplayer]=1; System.out.println(currentplayer+":get BLACK"); }else{ acolor[currentplayer]=1; acolor[1-currentplayer]=0; System.out.println(currentplayer+":get RED"); } if (acolor[currentplayer]==1){ out[currentplayer].write("UR".getBytes()); out[1-currentplayer].write("UB".getBytes()); }else{ out[currentplayer].write("UB".getBytes()); out[1-currentplayer].write("UR".getBytes()); } firstMove=0; } ( (DefaultListModel<String>) listContent.getModel() ).addElement(s); out[0].write(s.getBytes()); out[1].write(s.getBytes()); out[0].flush(); out[1].flush(); System.out.println("write "+s+" to clients"); }else{ ( (DefaultListModel<String>) listContent.getModel() ).addElement(Names[currentplayer]+" send wrong Move request:"+new String(buf)); dumpboard(); outbuf[0]='I'; out[currentplayer].write(outbuf,0,1); out[currentplayer].flush(); } if (isTimeout>-1){ break; } }while (s==null); if ((gameState=checkState())>0){ System.out.println("Game:"+curMatch+" finish."); int nextGame=0; if (gameState==1){//current player win outbuf[0]='U'; outbuf[1]='W'; out[currentplayer].write(outbuf,0,2); out[currentplayer].flush(); outbuf[0]='U'; outbuf[1]='L'; out[1-currentplayer].write(outbuf,0,2); out[1-currentplayer].flush(); score[currentplayer][0]++; score[1-currentplayer][1]++; }else if (gameState==2){//draw game System.out.println("draw game:"+currentplayer+" color is "+acolor[currentplayer]); outbuf[0]='U'; outbuf[1]='D'; out[currentplayer].write(outbuf,0,2); out[currentplayer].flush(); out[1-currentplayer].write(outbuf,0,2); out[1-currentplayer].flush(); score[currentplayer][2]++; score[1-currentplayer][2]++; }else if (gameState==3){//lose game System.out.println("lose game:"+currentplayer+" color is "+acolor[currentplayer]); outbuf[0]='U'; outbuf[1]='L'; out[currentplayer].write(outbuf,0,2); out[currentplayer].flush(); outbuf[0]='U'; outbuf[1]='W'; out[1-currentplayer].write(outbuf,0,2); out[1-currentplayer].flush(); score[currentplayer][1]++; score[1-currentplayer][0]++; } exportList( (DefaultListModel<String>) listContent.getModel(),gameState); if (score[currentplayer][0]==matchWin){ curMatch=matchMax+1; } if (curMatch+1<=matchMax){ outbuf[0]='X'; out[0].write(outbuf,0,1); in[0].read(buf, 0, 1); if (buf[0]=='X'){ out[1].write(outbuf,0,1); in[1].read(buf, 0, 1); if (buf[0]=='X'){ nextGame=1; } } if (nextGame==0) break; startGame(); }else{ curMatch++; } }else{ etime=System.currentTimeMillis(); stime=etime-stime; long r=(stime%1000); if (r>0){ curTimer[currentplayer]-=r; curTimer[1-currentplayer]+=r; } currentplayer=1-currentplayer;//change request side } canvas.repaint(); }while (curMatch<=matchMax); OutServer=true; outbuf[0]='D'; out[0].write(outbuf,0,1); out[1].write(outbuf,0,1); } }//end while } catch (Exception e) { System.out.println("Socket連線有問題 !"); System.out.println("Exception :" + e.toString()); e.printStackTrace(); }finally{ currentplayer=2; btnStart.setEnabled(true); try { socket[0].close(); socket[1].close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } public void exportList(ListModel<String> model,int rtype) throws IOException{ File f=null; String filename; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); Date today = Calendar.getInstance().getTime(); String datestr = dateFormat.format(today); if (rtype==1){ if (currentplayer==0){ filename="R"+curMatch+"_"+Names[0].trim()+"(WIN)_vs_"+Names[1].trim()+"_"+datestr+".txt"; }else{ filename="R"+curMatch+"_"+Names[0].trim()+"_vs_"+Names[1].trim()+"(WIN)_"+datestr+".txt"; } }else if (rtype==3){ if (currentplayer==0){ filename="R"+curMatch+"_"+Names[1].trim()+"(WIN)_vs_"+Names[0].trim()+"_"+datestr+".txt"; }else{ filename="R"+curMatch+"_"+Names[1].trim()+"_vs_"+Names[0].trim()+"(WIN)_"+datestr+".txt"; } }else if (rtype!=199){ filename="R"+curMatch+"(Draw)_"+Names[0].trim()+"_vs_"+Names[1].trim()+"_"+datestr+".txt"; }else{ filename="R"+curMatch+"(Save)_"+Names[0].trim()+"_vs_"+Names[1].trim()+"_"+datestr+".txt"; } f=new File(path+"/"+filename); System.out.println("export to "+filename); //f=new File("D:\\image\\"+filename); PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream(f), "UTF-8")); try { for (int i=0;i<4;i++){ String q=""; for (int j=0;j<8;j++){ q+=String.format("%02d", logdarkboard[i][j])+","; } pw.println(q ); } String q=score[0][0]+"/"+score[0][1]+"/"+score[0][2]+","+lblTimer1.getText()+";"+lblTimer2.getText(); pw.println(q ); int len = model.getSize(); for(int i = 0; i < len; i++) { pw.println(((DefaultListModel<String>) model).get(i).toString()); } if (rtype!=199) ( (DefaultListModel<String>) listContent.getModel() ).clear(); }finally { pw.close(); } } public void copyboard(){ for (int i=0;i<4;i++){ for (int j=0;j<8;j++){ darkboard[i][j]=logdarkboard[i][j]; } } } public void importList(String aFile) throws IOException{ BufferedReader input = new BufferedReader(new FileReader(curPath+"/"+aFile)); byte [] b=aFile.getBytes(); String [] fnames= aFile.split("_"); System.out.println("fnames:"+fnames.length); String p1Name=fnames[1]; String p2Name=fnames[3]; lblPlayer1.setText(p1Name); lblPlayer2.setText(p2Name); ( (DefaultListModel<String>) listContent.getModel() ).clear(); String line = null; int lineCount=0; darkCount=32; while (( line = input.readLine()) != null){ if (lineCount<4){ String [] p=line.split(","); for (int i=0;i<8;i++){ logdarkboard[lineCount][i]=Integer.parseInt(p[i]); darkboard[lineCount][i]=logdarkboard[lineCount][i]; } for (int i=0;i<2;i++){ for (int j=0;j<17;j++){ deadChess[i][j]=0; } } deadcount[0]=0; deadcount[1]=0; }else if (lineCount>4){ ( (DefaultListModel<String>) listContent.getModel() ).addElement(String.format("%03d", (lineCount-4))+". "+line); //doLogActionForward(line); if (lineCount==5){ for (int z=0;z<b.length;z++){ System.out.println("b[z]="+(char)b[z]); if (b[z]=='_'||b[z]=='('){ String ss=new String(b,1,z-1); System.out.println("SS="+ss); System.out.println("lineCount="+lineCount); int iround=Integer.parseInt(ss); byte [] bb=line.getBytes(); if (iround%2==1){ currentplayer=1; if (bb[3]>'a'){ acolor[1]=1; acolor[0]=0; }else{ acolor[1]=0; acolor[0]=1; } }else{ currentplayer=1; if (bb[3]>'a'){ acolor[1]=0; acolor[0]=1; }else{ acolor[1]=1; acolor[0]=0; } } logfirstPlayer=currentplayer; break; } } } currentplayer=1-currentplayer; }else{ String [] p1=line.split(","); String [] p=p1[0].split("/"); score[0][0]=Integer.parseInt(p[0]); score[0][1]=Integer.parseInt(p[1]); score[0][2]=Integer.parseInt(p[2]); score[1][0]=score[0][1]; score[1][1]=score[0][0]; score[1][2]=score[0][2]; if (p1.length>1){ if (!p1[1].equals("")){ String [] p2=p1[1].split(";"); lblTimer1.setText(p2[0]); lblTimer2.setText(p2[1]); } } } lineCount++; } logindex=lineCount-5; logMaxLines=logindex; forwardTO(logMaxLines); System.out.println("import currentplayer="+currentplayer); System.out.println("import logMaxLines="+logMaxLines); System.out.println("1 - currentplayer has move:"+hasMove(1-currentplayer)); System.out.println("currentplayer has move:"+hasMove(currentplayer)); input.close(); } private void doLogActionForward(String s){ byte [] buf=s.getBytes(); if (buf[0]=='O'){ int x = buf[1]-'A'; int y = buf[2]-'1'; board[y][x]=invertcharmapper.get(new String(buf,3,1)); darkboard[y][x]=0; fx=-1; tx=x; ty=y; }else if (buf[0]=='M'){ int x1=buf[1]-'A'; int y1=buf[2]-'1'; int x2=buf[4]-'A'; int y2=buf[5]-'1'; board[y1][x1]=invertcharmapper.get(new String(buf,3,1)); board[y2][x2]=invertcharmapper.get(new String(buf,6,1)); if (board[y2][x2]>0){ capedChess(board[y2][x2]); } board[y2][x2]=board[y1][x1]; board[y1][x1]=0; fx=x1; fy=y1; tx=x2; ty=y2; } } private void forwardTO(int index){ cleanToBack(); for(int i = 0; i < index; i++) { String line=((DefaultListModel<String>) listContent.getModel()).get(i).toString(); if (line.indexOf(".")>-1){ //System.out.println(line); line=line.substring(line.indexOf(".")+2,line.length()); //System.out.println(line); } doLogActionForward(line); if (i==0){ byte b[]=CurrentFileName.getBytes(); for (int z=0;z<b.length;z++){ if (b[z]=='_'||b[z]=='('){ String ss=new String(b,1,z-1); System.out.println("SS="+ss); System.out.println("lineCount="+i); int iround=Integer.parseInt(ss); byte [] bb=line.getBytes(); if (iround%2==1){ currentplayer=1; if (bb[3]>'a'){ acolor[1]=1; acolor[0]=0; }else{ acolor[1]=0; acolor[0]=1; } }else{ currentplayer=1; if (bb[3]>'a'){ acolor[1]=0; acolor[0]=1; }else{ acolor[1]=1; acolor[0]=0; } } break; } } } System.out.print(i); checkState(); currentplayer=1-currentplayer; } } private String doClientRequest(byte[] buf) { if (buf[0]=='O'){ int x = buf[1]-'A'; int y = buf[2]-'1'; if (x>-1&&x<8){ if (y>-1&&y<4){ if (darkboard[y][x]>0){ board[y][x]=darkboard[y][x]; fx=-1; tx=x; ty=y; darkboard[y][x]=0; buf[3]=charmapper[board[y][x]]; if (firstMove==1){ if (buf[3]>7){ acolor[currentplayer]=1; acolor[1-currentplayer]=0; }else{ acolor[currentplayer]=0; acolor[1-currentplayer]=1; } firstMove=2; } freestepCount=0; darkCount--; return new String(buf).trim(); } } } }else if (buf[0]=='M'){ int x1=buf[1]-'A'; int y1=buf[2]-'1'; int x2=buf[3]-'A'; int y2=buf[4]-'1'; int blocker=0,capture=0; if ((x1>-1&&x1<8)&&(y1>-1&&y1<4)&&(x2>-1&&x2<8)&&(y2>-1&&y2<4)){ if (board[y1][x1]==2||board[y1][x1]==9){//do cannon action if (x1==x2){ if (Math.abs(y2-y1)==1){ if (board[y2][x2]==0){ buf[5]=buf[4]; buf[4]=buf[3]; buf[3]=charmapper[board[y1][x1]]; buf[6]=charmapper[board[y2][x2]]; board[y2][x2]=board[y1][x1]; board[y1][x1]=0; freestepCount++; fx=x1; fy=y1; tx=x2; ty=y2; return new String(buf).trim(); } }else if (Math.abs(y2-y1)<4){//Y axis checking if (y2>y1){//to down side for (int i=y1+1;i<3;i++){ if (board[i][x1]>0){ blocker=i; break; } } if (blocker>0){ for (int i=blocker+1;i<4;i++){ if (board[i][x1]>0){ if (canCap(board[y1][x1],board[i][x1])>0){ capture=i; } break; } } } }else{ for (int i=y1-1;i>1;i--){ if (board[i][x1]>0){ blocker=i; break; } } if (blocker>0){ for (int i=blocker-1;i>0;i--){ if (board[i][x1]>0){ if (canCap(board[y1][x1],board[i][x1])>0){ capture=i; } break; } } } } if (capture==y2){ buf[5]=buf[4]; buf[4]=buf[3]; buf[3]=charmapper[board[y1][x1]]; buf[6]=charmapper[board[capture][x2]]; capedChess(board[y2][x2]); board[y2][x2]=board[y1][x1]; board[y1][x1]=0; freestepCount=0; fx=x1; fy=y1; tx=x2; ty=y2; return new String(buf).trim(); } } }else if (y1==y2){ if (Math.abs(x2-x1)==1){ if (board[y2][x2]==0){ buf[5]=buf[4]; buf[4]=buf[3]; buf[3]=charmapper[board[y1][x1]]; buf[6]=charmapper[board[y2][x2]]; board[y2][x2]=board[y1][x1]; board[y1][x1]=0; freestepCount++; fx=x1; fy=y1; tx=x2; ty=y2; return new String(buf).trim(); } }else if (Math.abs(x2-x1)<8){//X axis checking if (x2>x1){//to right side for (int i=x1+1;i<7;i++){ if (board[y1][i]>0){ blocker=i; break; } } if (blocker>0){ for (int i=blocker+1;i<8;i++){ if (board[y1][i]>0){ if (canCap(board[y1][x1],board[y1][i])>0){ capture=i; } break; } } } }else{ for (int i=x1-1;i>1;i--){ if (board[y1][i]>0){ blocker=i; break; } } if (blocker>0){ for (int i=blocker-1;i>0;i--){ if (board[y1][i]>0){ if (canCap(board[y1][x1],board[y1][i])>0){ capture=i; } break; } } } } if (capture==x2){ buf[5]=buf[4]; buf[4]=buf[3]; buf[3]=charmapper[board[y1][x1]]; buf[6]=charmapper[board[y1][capture]]; capedChess(board[y2][x2]); board[y2][x2]=board[y1][x1]; board[y1][x1]=0; freestepCount=0; fx=x1; fy=y1; tx=x2; ty=y2; return new String(buf).trim(); } } } }else//do others chess action if ((Math.abs(x2-x1)==1&&Math.abs(y2-y1)==0)||(Math.abs(x2-x1)==0&&Math.abs(y2-y1)==1)){ if (board[y2][x2]==0){ buf[5]=buf[4]; buf[4]=buf[3]; buf[3]=charmapper[board[y1][x1]]; buf[6]=charmapper[board[y2][x2]]; board[y2][x2]=board[y1][x1]; board[y1][x1]=0; freestepCount++; fx=x1; fy=y1; tx=x2; ty=y2; return new String(buf).trim(); }else if (canCap(board[y1][x1],board[y2][x2])>0){ buf[5]=buf[4]; buf[4]=buf[3]; buf[3]=charmapper[board[y1][x1]]; buf[6]=charmapper[board[y2][x2]]; capedChess(board[y2][x2]); board[y2][x2]=board[y1][x1]; board[y1][x1]=0; freestepCount=0; fx=x1; fy=y1; tx=x2; ty=y2; return new String(buf).trim(); } } } } return null; } public class timerThread extends Thread{ public timerThread(){ } public void run(){ String s=""; int [] stimer=new int[2]; try { while(!OutServer){ sleep(1000); curTimer[currentplayer]-=1000; stimer[0]= curTimer[0]/1000; stimer[1]= curTimer[1]/1000; s=String.format("%02d", stimer[0]/60)+":"+String.format("%02d", stimer[0]%60); lblTimer1.setText(s); s=String.format("%02d", stimer[1]/60)+":"+String.format("%02d", stimer[1]%60); lblTimer2.setText(s); if (curTimer[currentplayer]<=0){ isTimeout=currentplayer; } } } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
15d09e6610a7837bce682f0f88d76ad398258058
7e03988bf5309f335689f94f3a123bd6c9b70c7f
/src/main/java/hello/Hello.java
8d43f9d07fcb2d5a8ec47b7e89778d63e7523055
[]
no_license
FredThomachot/warriorgame
865b80407b9afeb0dc8b3cc566730b0dce77ea55
a7928ab4f36de801232bf7fe2141187a19364c46
refs/heads/master
2021-04-09T13:55:58.023784
2018-03-23T16:01:14
2018-03-23T16:01:14
125,539,097
0
0
null
null
null
null
UTF-8
Java
false
false
6,753
java
package hello; import java.util.ArrayList; import java.util.Scanner; public class Hello { private static ArrayList<Personnages> player = new ArrayList<Personnages>(); private static ArrayList<Weapon> weaponList = new ArrayList<Weapon>(); private static ArrayList<Sortilege> sortList = new ArrayList<Sortilege>(); private static Scanner userChoice = new Scanner(System.in); private static Boolean playgame = true; public static void main(String[] args) { System.out.println(" \nBienvenue dans le game\nWWWWWWAAAAAAARRRRRRIIIIIIIIOOOOOOORRRRRRRSSSSSSSS"); //////////////////////////////////////////////////////////////////// CREATION DE 2 PERSONNAGES PAR DEFAULT /*Weapon arme = new Weapon("Arbagun", 10); player.add(new Guerrier("Froud", 123, 456, arme)); Sortilege sort = new Sortilege("Molassonne", 20); player.add(new Magicien("Azer", 456, 789, sort));*/ //////////////////////////////////////////////////////////////////////////////////////////////////////////// while (playgame) { System.out.println("\nQue voulez vous faire ?\n1-Creer un personnage\n2-Afficher les personnages\n3-Modifier un personnage\n4-Quitter le jeu "); String menu = userChoice.nextLine(); if (menu.equals("1")) { System.out.println(" \nChoisissez un personnage : \n1-guerrier\n2-magicien"); String choix = userChoice.nextLine(); if (choix.equals("1") || choix.equals("guerrier")) { creerGuerrier(); } else if (choix.equals("2") || choix.equals("magicien")) { creerMagicien(); } } else if (menu.equals("2")) { afficherPerso(); } else if (menu.equals("3")) { modifierPerso(); } else if (menu.equals("4")) { quitGame(); } } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// FONCTIONS public static void creerGuerrier() { /////////////////////////////////////////////////////////// CREER UN NOUVEAU GUERRIER System.out.println(" \nVous etes un guerrier ! \nChoisissez un nom de guerrier !\n "); String nomGuerrier = userChoice.nextLine(); Personnages guerrierTest = new Guerrier(); guerrierTest.setName(nomGuerrier); System.out.print(" \nNiveau de vie : "); Integer number = userChoice.nextInt(); guerrierTest.setLife(number); System.out.print("Niveau de force : "); Integer numberForce = userChoice.nextInt(); guerrierTest.setForce(numberForce); userChoice.nextLine(); System.out.print(" \nChoisissez une arme : "); String nomArme = userChoice.nextLine(); System.out.print("Puissance de l'arme : "); Integer armePower = userChoice.nextInt(); Weapon armePouvoir = new Weapon(nomArme, armePower) ; weaponList.add(armePouvoir); System.out.print(" \nFelicitations, vous venez de creer un guerrier !\n"); if (guerrierTest instanceof Guerrier) { ((Guerrier)guerrierTest).setMonArme(armePouvoir); } player.add(guerrierTest); userChoice.nextLine(); } public static void creerMagicien() { /////////////////////////////////////////////////////////// CREER UN NOUVEAU MAGICIEN System.out.println(" \nVous etes un magicien ! \nChoisissez un nom de magicien !\n "); String nomMagicien = userChoice.nextLine(); Personnages magicienTest = new Magicien(); magicienTest.setName(nomMagicien); System.out.print(" \nNiveau de vie : "); Integer number = userChoice.nextInt(); magicienTest.setLife(number); System.out.print("Niveau de force : "); Integer numberForce = userChoice.nextInt(); magicienTest.setForce(numberForce); userChoice.nextLine(); System.out.print(" \nChoisissez un sort : "); String nomSort = userChoice.nextLine(); System.out.print("Puissance du sort : "); Integer sortPower = userChoice.nextInt(); Sortilege sortPouvoir = new Sortilege(nomSort, sortPower) ; sortList.add(sortPouvoir); System.out.print(" \nFelicitations, vous venez de creer un magicien !\n"); if (magicienTest instanceof Magicien) { ((Magicien)magicienTest).setMonSort(sortPouvoir); } player.add(magicienTest); userChoice.nextLine(); } public static void afficherPerso() { /////////////////////////////////////////////////////////// AFFICHER LES PERSONNAGES CREES for (int i = 0; i < player.size(); i++) { System.out.println(" \n*************************************************"); System.out.println((player.get(i)).toString()); } } public static void afficherArme() { /////////////////////////////////////////////////////////// AFFICHER LES ARMES CREES for (int i = 0; i < weaponList.size(); i++) { System.out.println(" \n*************************************************"); System.out.println((weaponList.get(i)).toString()); } } public static void afficherSort() { /////////////////////////////////////////////////////////// AFFICHER LES ARMES CREES for (int i = 0; i < sortList.size(); i++) { System.out.println(" \n*************************************************"); System.out.println((sortList.get(i)).toString()); } } public static void modifierPerso() { /////////////////////////////////////////////////////////// MODIFIER LE NOM D'UN PERSONNAGE EXISTANT System.out.println("Quel personnage voulez vous modifier ?"); int id = userChoice.nextInt(); userChoice.nextLine(); System.out.println("Entrez le nouveau nom : "); String nom =userChoice.nextLine(); player.get(id).setName(nom); } public static void quitGame() { /////////////////////////////////////////////////////////// ARRETER LE JEU System.out.println(" \nyou just quit the game you pathetic loser ! "); playgame = false ; } }
99c04eb4c78d27512f0cbba2fc0becf30f962ede
060f028dc1c2992d55350f70c0b11cabdae0d179
/src/summary/mboxUtil/MboxReader.java
dfea5b0e096180414af614517b10289ec9365d4f
[]
no_license
shufengh/EmailTheadSummarizer
afea35a50129a792dbc6378f7a2931009a3e963e
d51857c5a30ac0377ac56fa378628e42bd48b113
refs/heads/master
2020-05-22T13:37:39.798015
2013-12-16T23:42:57
2013-12-16T23:42:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,005
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 summary.mboxUtil; import org.apache.james.mime4j.MimeException; import org.apache.james.mime4j.dom.Body; import org.apache.james.mime4j.dom.Entity; import org.apache.james.mime4j.dom.Message; import org.apache.james.mime4j.dom.MessageBuilder; import org.apache.james.mime4j.dom.Multipart; import org.apache.james.mime4j.dom.SingleBody; import org.apache.james.mime4j.dom.TextBody; import org.apache.james.mime4j.dom.address.Address; import org.apache.james.mime4j.mboxiterator.CharBufferWrapper; import org.apache.james.mime4j.mboxiterator.MboxIterator; import org.apache.james.mime4j.message.AbstractEntity; import org.apache.james.mime4j.message.BodyPart; import org.apache.james.mime4j.message.DefaultMessageBuilder; import org.apache.james.mime4j.stream.MimeConfig; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.channels.FileChannel; import java.nio.charset.Charset; import java.nio.charset.CharsetEncoder; import java.util.ArrayList; import java.util.HashMap; import summary.structure.*; import summary.structure.Thread; /** * Simple example of how to use Apache Mime4j Mbox Iterator. We split one mbox file file into * individual email messages. */ public class MboxReader { private final static CharsetEncoder ENCODER = Charset.forName("UTF-8").newEncoder(); private final static int MAXLINELEN = 10000; public final static boolean DEBUG = true; private static class EmailWrapper { private String subject; private Email email; public EmailWrapper(String sub, Email em){ subject = sub; email = em; } public String getSubject() { return subject; } public void setSubject(String subject) { this.subject = subject; } public Email getEmail() { return email; } public void setEmail(Email email) { this.email = email; } } // simple example of how to split an mbox into individual files /** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { if (args.length < 1) { System.out.println("Please supply a path to a mbox file to parse"); return; } for (Thread th : parseThreads(args)) { System.out.println(th.getEmailNumber() + "\t" + th.getHeader()); // System.out.println(th.toString()); for (Email em : th.getEmails()) { // System.out.println(em.getSendBy() + "-->" + em.getSendTo()); for (Sentence s : em.getSentences()) { System.out.println(s.getQuotationTimes() + ", " + s.getText()); } } if(DEBUG) break; } } public static ArrayList<Thread> parseThreads(String[] mboxes) throws FileNotFoundException, IOException, MimeException{ // long start = System.currentTimeMillis(); int count = 0; ArrayList<Thread> threads = new ArrayList<Thread>(); HashMap<String, Thread> threadMap = new HashMap<String, Thread>(); Thread thread = null; for (String mb : mboxes) { final File mbox = new File(mb); for (CharBufferWrapper message : MboxIterator.fromFile(mbox) .charset(ENCODER.charset()).build()) { EmailWrapper emp = messageSummary(message.asInputStream(ENCODER.charset())); if(emp == null) continue; if(thread == null) thread = new Thread(emp.getSubject(), 0); // handle new threads // covers only the simple situation where replier adds info to the subject if(!emp.getSubject().contains(thread.getHeader()) && !thread.getHeader().contains(emp.getSubject())){ // merge interrupted threads //threads.add(thread); if(threadMap.containsKey(thread.getHeader())){ Thread oldThread = threadMap.get(thread.getHeader()); for(Email em : thread.getEmails()) oldThread.addEmail(em); } else threadMap.put(thread.getHeader(), thread); thread = new Thread(emp.getSubject(), 0); thread.addEmail(emp.getEmail()); } else{ thread.addEmail(emp.getEmail()); } count++; } } // System.out.println("Found " + count + " messages"); // long end = System.currentTimeMillis(); // System.out.println("Done in: " + (end - start) + " milis"); if(thread != null){ if(threadMap.containsKey(thread.getHeader())){ Thread oldThread = threadMap.get(thread.getHeader()); for(Email em : thread.getEmails()) oldThread.addEmail(em); } else threadMap.put(thread.getHeader(), thread); } threads.addAll(threadMap.values()); return threads; } /** * Parse a message and return a simple {@link String} representation of some important fields. * * @param messageBytes the message as {@link java.io.InputStream} * @return String * @throws IOException * @throws MimeException */ private static EmailWrapper messageSummary(InputStream messageBytes) throws IOException, MimeException { try { DefaultMessageBuilder builder = new DefaultMessageBuilder(); MimeConfig.Builder b = MimeConfig.custom(); b.setMaxLineLen(MAXLINELEN); builder.setMimeEntityConfig(b.build()); Message message = builder.parseMessage(messageBytes); // Here assume there's only one sender Email email = new Email(message.getFrom().get(0).getAddress(), message.getDate().toString()); for (Address addr : message.getTo()) { email.addSendTo(addr.toString()); } if (message.getCc() != null) { for (Address addr : message.getCc()) { email.addSendTo(addr.toString()); } } if (message.getBcc() != null) { for (Address addr : message.getBcc()) { email.addSendTo(addr.toString()); } } ArrayList<Sentence> ss = parsePhrases( parseBodyParts((Multipart) message.getBody())); for (Sentence s : ss) email.addSentence(s); String subject = message.getSubject(); if(subject.startsWith("Re:")) subject = subject.replace("Re:", "").trim(); return new EmailWrapper(subject, email); } catch (IOException ex) { ex.printStackTrace(); return null; } } public static ArrayList<Sentence> parsePhrases(String embody) { // split by empty lines and >+ only in the line ArrayList<Sentence> sentences = new ArrayList<Sentence>(); String[] lines = embody.split("\n"); int quoteLevel = 0; StringBuilder phrase = new StringBuilder(); for(String line : lines){ int angles = countAngles(line); line = line.substring(angles).trim(); if(line.isEmpty()) continue; line += " "; // add a whitespace to the end because we trimmed it before if(line.matches("(.*On[ \\w,]+at[ \\w,:]+[AP]M.*)|.*wrote:.*") ) { continue; } // System.out.println(angles + "--||" +line ); // System.out.println(line); //TODO: should remove all "On Wed, Sep 25, 2013 at 10:37 AM, Christopher Connors < // [email protected]> wrote:" if(angles == quoteLevel && !line.isEmpty()){ phrase.append(line); } else if(angles >= quoteLevel){ if(phrase.length() > 0){ // System.out.println(quoteLevel + ", " + phrase); sentences.addAll(parseSentences(phrase.toString(), quoteLevel)); phrase = new StringBuilder(); quoteLevel = angles; } // +1 to skip the space between >>>[_]Let's do it. phrase.append(line); } } if(phrase.length() > 0){ // System.out.println(quoteLevel + ", " + phrase); sentences.addAll(parseSentences(phrase.toString(), quoteLevel)); } return sentences; } public static ArrayList<Sentence> parseSentences(String phrase, int quote){ ArrayList<Sentence> listSen = new ArrayList<Sentence>(); if(phrase == null) return listSen; // split phrases into sentences // String[] sentences = phrase.split("[.?!]"); // for(String s : sentences) System.out.println(s); // for(String s : sentences){ // listSen.add(new Sentence(quote, s)); // } listSen.add(new Sentence(quote, phrase.replaceAll("^\\s*\\n", " "))); return listSen; } public static int countAngles(String str){ int count = 0; boolean prev = false; for(int i = 0; i < str.length(); i++){ if(i == 0){ if(str.charAt(i) == '>') count++; else break; } else if(str.charAt(i-1) == '>' && str.charAt(i) == '>') count++; else break; } return count; } /** * * @author Denis Lunev <[email protected]> */ private static String getTxtPart(Entity part) throws IOException { //Get content from body TextBody tb = (TextBody) part.getBody(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tb.writeTo(baos); return new String(baos.toByteArray()); } /** * * @author Denis Lunev <[email protected]> */ private static String parseBodyParts(Multipart multipart) throws IOException { StringBuffer txtBodies = new StringBuffer(); for (Entity part : multipart.getBodyParts()) { if (((AbstractEntity) part).isMimeType("text/plain")) { String txt = getTxtPart(part); txtBodies.append(txt); } //If current part contains other, parse it again by recursion if (part.isMultipart()) { parseBodyParts((Multipart) part.getBody()); } } return txtBodies.toString(); } private static void saveMessageToFile(int count, CharBuffer buf) throws IOException { FileOutputStream fout = new FileOutputStream(new File("messages/msg-" + count)); FileChannel fileChannel = fout.getChannel(); ByteBuffer buf2 = ENCODER.encode(buf); fileChannel.write(buf2); fileChannel.close(); fout.close(); } }
96041919b5bca859164f4e74d55a62768defba64
5c0a5d1e3685720e5fa387a26a60dd06bb7c6e4a
/scheduled-job/src/main/java/com/spark/bitrade/service/ILockDetailService.java
3dd6d071aa66e0484ab3901b94033e2174854836
[]
no_license
im8s/silk-v1
5d88ccd1b5ed2370f8fba4a70298d1d14d9a175d
ff9f689443af30c815a8932899a333dfc87f6f12
refs/heads/master
2022-06-20T13:08:01.519634
2020-04-28T02:56:50
2020-04-28T02:56:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,698
java
package com.spark.bitrade.service; import com.baomidou.mybatisplus.service.IService; import com.spark.bitrade.entity.LockCoinDetail; import com.spark.bitrade.entity.PartnerArea; import java.util.List; /**  * 解锁service  * @author tansitao  * @time 2018/7/20 17:57   */ public interface ILockDetailService extends IService<LockCoinDetail> { /**  * 批量解锁锁仓活动  * @author tansitao  * @time 2018/7/31 10:58   */ void unlockActivityLock(int unlockNum); /**  * 批量解锁投资活动  * @author tansitao  * @time 2018/7/31 10:58   */ void unlockFinanActivity(int unlockNum); /**  * 批量解锁内部锁仓活动  * @author tansitao  * @time 2018/8/7 10:38   */ void unlockInternalActivity(int unlockNum); /**  * 批量解锁STO锁仓  * @author tansitao  * @time 2018/11/7 18:05   */ void unlockSTOActivityLock(int unlockNum); /**  * 批量解锁节点产品活动  * @author tansitao  * @time 2018/7/31 10:58   */ void unlockQuantifyActivity(int unlockNum); /**  * 批量解锁CNYT推荐人分期收益  * @author tansitao  * @time 2018/7/31 10:58   */ void unlockCnytRewardIncome(int unlockNum); /**  * 批量解锁BTTC锁仓分期  * @author dengdy  * @time 2019/4/17 10:58   */ void unlockBTTCRestitutionIncome(int unlockNum); /**  * 批量解锁IEO锁仓分期  * @author fatKarin  * @time 2019/6/6 15:58   */ void unlockIeoRestitutionIncome(int unlockNum); /**  * 批量解锁BCC 赋能锁仓分期  * @author fatKarin  * @time 2019/7/1 15:58   */ void unlockBccEnergize(int unlockNum); /**  * 批量解锁金钥匙活动锁仓  * @author dengdy  * @time 2019/4/17 10:58   */ void unlockGoldenKeyPrincipal(int unlockNum); /** 解锁CNYT锁仓收益(自己锁仓的) * @author Zhang Yanjun * @time 2018.12.11 15:37 */ void unlockCNYTActivityLock(); /** * 解锁CNYT锁仓本金(自己锁仓的) * @author Zhang Yanjun * @time 2018.12.11 15:37 */ void unlockCNYTActivityCorLock(); /** * 根据锁仓记录ID查询 * @param lockCoinDetailId * @return */ LockCoinDetail getMissRewardLock(Long lockCoinDetailId); /** * 根据锁仓Id查询是否存在锁仓记录 * @param lockCoinDetailId * @return */ boolean isExistRewardRecord(Long lockCoinDetailId); }
[ "huihui123" ]
huihui123
968a2cc0f7f75f40ef1d9a1541e0a67a7c29c131
0882081d9fe42a0031706ad00b086c16131f14b6
/mtsa-code/.svn/pristine/96/968a2cc0f7f75f40ef1d9a1541e0a67a7c29c131.svn-base
da64f6a3da53d9297be124ee21e5adda7c427387
[]
no_license
SucreRouge/ICSE-2013-ControllerSynthesis
791522c0c65c8b7acbc0d4de80395dd59bf08940
b7b00aa8d4419c6badbebbe4c51731d10c2b7fa5
refs/heads/master
2020-03-31T02:48:09.671303
2016-06-24T19:46:12
2016-06-24T19:46:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
756
package lts.chart.util; import ac.ic.doc.mtstools.model.MTS; import ar.dc.uba.model.language.Symbol; import ar.dc.uba.model.lsc.TriggeredScenario; import ar.dc.uba.model.structure.SynthesizedState; import ar.dc.uba.synthesis.SynthesisVisitor; /** * Encapsulates the call to the synthesis algorithm. * * @author gsibay * */ public class MTSSynthesiserFacade { static private MTSSynthesiserFacade instance = new MTSSynthesiserFacade(); static public MTSSynthesiserFacade getInstance() { return instance; } private MTSSynthesiserFacade() {} public MTS<SynthesizedState, Symbol> synthesise(TriggeredScenario triggeredScenario) { return triggeredScenario.acceptSynthesisVisitor(SynthesisVisitor.getInstance()); } }
2040c69fd5aef338b4bdc802a1deb1d77d68c389
51b8715a5d283c951e5c24168957d1a2d3f77223
/Esame/src/entity/TipoProva.java
422d34ebbe06f65a1cc8d5bc53714e8d48c88a53
[]
no_license
AlessioEvangelista/EsameIS
ea8e35ba4943a88bc4b5850dbea6404eaf80e502
ccc9e7dfecad017b0cde4f7f9e6f3c92f9e52d27
refs/heads/master
2020-11-25T20:49:35.623176
2019-12-18T14:26:46
2019-12-18T14:26:46
228,839,314
0
0
null
null
null
null
UTF-8
Java
false
false
84
java
package entity; public enum TipoProva { SCRITTA, ORALE, AL_CALCOLATORE }
[ "User@LAPTOP-GQ32OGHV" ]
User@LAPTOP-GQ32OGHV
a445f88ef81e71c7b7445be40ce3c389b6ac9e7f
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/elastic--elasticsearch/36991192729d244f211f8c29e810c8437967c449/before/IpFieldMapper.java
217c862c574992971afd3cf0a4a7022728e80903
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
12,711
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.index.mapper.ip; import com.google.common.net.InetAddresses; import org.apache.lucene.analysis.NumericTokenStream; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexOptions; import org.apache.lucene.search.NumericRangeQuery; import org.apache.lucene.search.Query; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.NumericUtils; import org.elasticsearch.common.Explicit; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Numbers; import org.elasticsearch.common.Strings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.analysis.NamedAnalyzer; import org.elasticsearch.index.analysis.NumericAnalyzer; import org.elasticsearch.index.analysis.NumericTokenizer; import org.elasticsearch.index.fielddata.FieldDataType; import org.elasticsearch.index.mapper.MappedFieldType; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MapperParsingException; import org.elasticsearch.index.mapper.ParseContext; import org.elasticsearch.index.mapper.core.LongFieldMapper; import org.elasticsearch.index.mapper.core.LongFieldMapper.CustomLongNumericField; import org.elasticsearch.index.mapper.core.NumberFieldMapper; import org.elasticsearch.index.query.QueryParseContext; import java.io.IOException; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.regex.Pattern; import static org.elasticsearch.index.mapper.MapperBuilders.ipField; import static org.elasticsearch.index.mapper.core.TypeParsers.parseNumberField; /** * */ public class IpFieldMapper extends NumberFieldMapper { public static final String CONTENT_TYPE = "ip"; public static String longToIp(long longIp) { int octet3 = (int) ((longIp >> 24) % 256); int octet2 = (int) ((longIp >> 16) % 256); int octet1 = (int) ((longIp >> 8) % 256); int octet0 = (int) ((longIp) % 256); return octet3 + "." + octet2 + "." + octet1 + "." + octet0; } private static final Pattern pattern = Pattern.compile("\\."); public static long ipToLong(String ip) { try { if (!InetAddresses.isInetAddress(ip)) { throw new IllegalArgumentException("failed to parse ip [" + ip + "], not a valid ip address"); } String[] octets = pattern.split(ip); if (octets.length != 4) { throw new IllegalArgumentException("failed to parse ip [" + ip + "], not a valid ipv4 address (4 dots)"); } return (Long.parseLong(octets[0]) << 24) + (Integer.parseInt(octets[1]) << 16) + (Integer.parseInt(octets[2]) << 8) + Integer.parseInt(octets[3]); } catch (Exception e) { if (e instanceof IllegalArgumentException) { throw (IllegalArgumentException) e; } throw new IllegalArgumentException("failed to parse ip [" + ip + "]", e); } } public static class Defaults extends NumberFieldMapper.Defaults { public static final String NULL_VALUE = null; public static final MappedFieldType FIELD_TYPE = new IpFieldType(); static { FIELD_TYPE.freeze(); } } public static class Builder extends NumberFieldMapper.Builder<Builder, IpFieldMapper> { protected String nullValue = Defaults.NULL_VALUE; public Builder(String name) { super(name, Defaults.FIELD_TYPE, Defaults.PRECISION_STEP_64_BIT); builder = this; } @Override public IpFieldMapper build(BuilderContext context) { setupFieldType(context); IpFieldMapper fieldMapper = new IpFieldMapper(name, fieldType, defaultFieldType, ignoreMalformed(context), coerce(context), context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); fieldMapper.includeInAll(includeInAll); return fieldMapper; } @Override protected NamedAnalyzer makeNumberAnalyzer(int precisionStep) { String name = precisionStep == Integer.MAX_VALUE ? "_ip/max" : ("_ip/" + precisionStep); return new NamedAnalyzer(name, new NumericIpAnalyzer(precisionStep)); } @Override protected int maxPrecisionStep() { return 64; } } public static class TypeParser implements Mapper.TypeParser { @Override public Mapper.Builder parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException { IpFieldMapper.Builder builder = ipField(name); parseNumberField(builder, name, node, parserContext); for (Iterator<Map.Entry<String, Object>> iterator = node.entrySet().iterator(); iterator.hasNext();) { Map.Entry<String, Object> entry = iterator.next(); String propName = Strings.toUnderscoreCase(entry.getKey()); Object propNode = entry.getValue(); if (propName.equals("null_value")) { if (propNode == null) { throw new MapperParsingException("Property [null_value] cannot be null."); } builder.nullValue(propNode.toString()); iterator.remove(); } } return builder; } } public static final class IpFieldType extends LongFieldMapper.LongFieldType { public IpFieldType() { setFieldDataType(new FieldDataType("long")); } protected IpFieldType(IpFieldType ref) { super(ref); } @Override public NumberFieldType clone() { return new IpFieldType(this); } @Override public String typeName() { return CONTENT_TYPE; } @Override public Long value(Object value) { if (value == null) { return null; } if (value instanceof Number) { return ((Number) value).longValue(); } if (value instanceof BytesRef) { return Numbers.bytesToLong((BytesRef) value); } return ipToLong(value.toString()); } /** * IPs should return as a string. */ @Override public Object valueForSearch(Object value) { Long val = value(value); if (val == null) { return null; } return longToIp(val); } @Override public BytesRef indexedValueForSearch(Object value) { BytesRefBuilder bytesRef = new BytesRefBuilder(); NumericUtils.longToPrefixCoded(parseValue(value), 0, bytesRef); // 0 because of exact match return bytesRef.get(); } @Override public Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, @Nullable QueryParseContext context) { return NumericRangeQuery.newLongRange(names().indexName(), numericPrecisionStep(), lowerTerm == null ? null : parseValue(lowerTerm), upperTerm == null ? null : parseValue(upperTerm), includeLower, includeUpper); } @Override public Query fuzzyQuery(Object value, Fuzziness fuzziness, int prefixLength, int maxExpansions, boolean transpositions) { long iValue = parseValue(value); long iSim; try { iSim = ipToLong(fuzziness.asString()); } catch (IllegalArgumentException e) { iSim = fuzziness.asLong(); } return NumericRangeQuery.newLongRange(names().indexName(), numericPrecisionStep(), iValue - iSim, iValue + iSim, true, true); } } protected IpFieldMapper(String simpleName, MappedFieldType fieldType, MappedFieldType defaultFieldType, Explicit<Boolean> ignoreMalformed, Explicit<Boolean> coerce, Settings indexSettings, MultiFields multiFields, CopyTo copyTo) { super(simpleName, fieldType, defaultFieldType, ignoreMalformed, coerce, indexSettings, multiFields, copyTo); } private static long parseValue(Object value) { if (value instanceof Number) { return ((Number) value).longValue(); } if (value instanceof BytesRef) { return ipToLong(((BytesRef) value).utf8ToString()); } return ipToLong(value.toString()); } @Override protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String ipAsString; if (context.externalValueSet()) { ipAsString = (String) context.externalValue(); if (ipAsString == null) { ipAsString = fieldType().nullValueAsString(); } } else { if (context.parser().currentToken() == XContentParser.Token.VALUE_NULL) { ipAsString = fieldType().nullValueAsString(); } else { ipAsString = context.parser().text(); } } if (ipAsString == null) { return; } if (context.includeInAll(includeInAll, this)) { context.allEntries().addText(fieldType().names().fullName(), ipAsString, fieldType().boost()); } final long value = ipToLong(ipAsString); if (fieldType().indexOptions() != IndexOptions.NONE || fieldType().stored()) { CustomLongNumericField field = new CustomLongNumericField(value, fieldType()); field.setBoost(fieldType().boost()); fields.add(field); } if (fieldType().hasDocValues()) { addDocValue(context, fields, value); } } @Override protected String contentType() { return CONTENT_TYPE; } @Override protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException { super.doXContentBody(builder, includeDefaults, params); if (includeDefaults || fieldType().numericPrecisionStep() != Defaults.PRECISION_STEP_64_BIT) { builder.field("precision_step", fieldType().numericPrecisionStep()); } if (includeDefaults || fieldType().nullValueAsString() != null) { builder.field("null_value", fieldType().nullValueAsString()); } if (includeInAll != null) { builder.field("include_in_all", includeInAll); } else if (includeDefaults) { builder.field("include_in_all", false); } } public static class NumericIpAnalyzer extends NumericAnalyzer<NumericIpTokenizer> { private final int precisionStep; public NumericIpAnalyzer(int precisionStep) { this.precisionStep = precisionStep; } @Override protected NumericIpTokenizer createNumericTokenizer(char[] buffer) throws IOException { return new NumericIpTokenizer(precisionStep, buffer); } } public static class NumericIpTokenizer extends NumericTokenizer { public NumericIpTokenizer(int precisionStep, char[] buffer) throws IOException { super(new NumericTokenStream(precisionStep), buffer, null); } @Override protected void setValue(NumericTokenStream tokenStream, String value) { tokenStream.setLongValue(ipToLong(value)); } } }
66e0373152eec361e4cdac7e0a0782af3d3d5737
9af02b4a295574be10cf14bf736d74cdcdd74c6e
/src/main/java/fr/univbrest/dosi/spi/bean/Evaluation.java
70835539afdcc626d9a9a092e0734c209118a8b2
[]
no_license
hanafianasse/Yugen-Technologies
0f68531197d92ab4d4cc4de075e95f52a3683f74
8e4682fd80022a1ebe41870c523b41e42df6b0fa
refs/heads/master
2021-01-17T22:01:59.658217
2017-03-31T09:25:05
2017-03-31T09:25:05
84,183,411
5
0
null
null
null
null
UTF-8
Java
false
false
3,109
java
package fr.univbrest.dosi.spi.bean; import java.io.Serializable; import javax.persistence.*; import com.fasterxml.jackson.annotation.JsonIgnore; import java.math.BigDecimal; import java.util.Date; /** * The persistent class for the EVALUATION database table. * */ @Entity @NamedQuery(name="Evaluation.findAll", query="SELECT e FROM Evaluation e") public class Evaluation implements Serializable { private static final long serialVersionUID = 1L; @GeneratedValue(generator="EVE_SEQ",strategy=GenerationType.AUTO) @SequenceGenerator(name="EVE_SEQ",sequenceName="EVE_SEQ", allocationSize=1) @Id @Column(name="ID_EVALUATION") private long idEvaluation; @Column(name="ANNEE_UNIVERSITAIRE") private String anneeUniversitaire; @Column(name="CODE_EC") private String codeEc; @Column(name="CODE_FORMATION") private String codeFormation; @Column(name="CODE_UE") private String codeUe; @Temporal(TemporalType.DATE) @Column(name="DEBUT_REPONSE") private Date debutReponse; private String designation; private String etat; @Temporal(TemporalType.DATE) @Column(name="FIN_REPONSE") private Date finReponse; @Column(name="NO_ENSEIGNANT") private BigDecimal noEnseignant; @Column(name="NO_EVALUATION") private BigDecimal noEvaluation; private String periode; public Evaluation() { } public long getIdEvaluation() { return this.idEvaluation; } public void setIdEvaluation(long idEvaluation) { this.idEvaluation = idEvaluation; } public String getAnneeUniversitaire() { return this.anneeUniversitaire; } public void setAnneeUniversitaire(String anneeUniversitaire) { this.anneeUniversitaire = anneeUniversitaire; } public String getCodeEc() { return this.codeEc; } public void setCodeEc(String codeEc) { this.codeEc = codeEc; } public String getCodeFormation() { return this.codeFormation; } public void setCodeFormation(String codeFormation) { this.codeFormation = codeFormation; } public String getCodeUe() { return this.codeUe; } public void setCodeUe(String codeUe) { this.codeUe = codeUe; } public Date getDebutReponse() { return this.debutReponse; } public void setDebutReponse(Date debutReponse) { this.debutReponse = debutReponse; } public String getDesignation() { return this.designation; } public void setDesignation(String designation) { this.designation = designation; } public String getEtat() { return this.etat; } public void setEtat(String etat) { this.etat = etat; } public Date getFinReponse() { return this.finReponse; } public void setFinReponse(Date finReponse) { this.finReponse = finReponse; } public BigDecimal getNoEnseignant() { return this.noEnseignant; } public void setNoEnseignant(BigDecimal noEnseignant) { this.noEnseignant = noEnseignant; } public BigDecimal getNoEvaluation() { return this.noEvaluation; } public void setNoEvaluation(BigDecimal noEvaluation) { this.noEvaluation = noEvaluation; } public String getPeriode() { return this.periode; } public void setPeriode(String periode) { this.periode = periode; } }
2b93f8f0056df9a0901b0c79b21f3b12a5dd923e
4b8a2e8808e7bb8cefc98a4cb3c389aeaf360ef3
/LocationSMS/app/src/main/java/com/locationsms/sms/fragments/AlertProfileDialogFragment.java
fccd2081413dcdece717dd197d61c8e991c33e9e
[]
no_license
jdsalat/LocationSMS
b429d9ec0b7ee1da504aa29c051031dda2734fe0
da318dca6e2266079e2898ebdf5deb8497274849
refs/heads/master
2021-07-08T18:57:05.677833
2017-10-07T05:44:11
2017-10-07T05:44:11
106,073,893
0
0
null
null
null
null
UTF-8
Java
false
false
2,791
java
package com.locationsms.sms.fragments; import android.app.Activity; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; import android.widget.LinearLayout; import com.locationsms.sms.R; /** * Created by Javed.Salat on 5/29/2016. */ public class AlertProfileDialogFragment extends DialogFragment { public AlertProfileDialogFragment() { } public static AlertProfileDialogFragment newInstance() { return new AlertProfileDialogFragment(); } @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.profile_alert_layout, new LinearLayout(getActivity()), false); final EditText editText = (EditText) view.findViewById(R.id.username); builder.setView(view) .setTitle(R.string.save_title).setPositiveButton(R.string.settings, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { String msg = editText.getText().toString(); dismiss(); mListener.onDialogPositiveClick(msg); } }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dismiss(); mListener.onDialogNegativeClick(); } }).setCancelable(false); return builder.create(); } public interface NoticeDialogListener { public void onDialogPositiveClick(String userName); public void onDialogNegativeClick(); } // Use this instance of the interface to deliver action events NoticeDialogListener mListener; // Override the Fragment.onAttach() method to instantiate the NoticeDialogListener @Override public void onAttach(Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try { // Instantiate the NoticeDialogListener so we can send events to the host mListener = (NoticeDialogListener) activity; } catch (ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener"); } } }
a1ed285790b152fa72dffb4b36b24fff533d3932
5965119b3d56ba2bf2d65bf442ad8d212b25857f
/src/com/cirs/jsf/controller/NavBean.java
1428398712414f24feb79c3afad9d9ae9ee6afa3
[]
no_license
rohankamat94/reportit-web
823be0d5bbd4e4c06403e6501f3db0fde9adb923
acf89dd68ac5bc9665cd41463b34429398ea078f
refs/heads/master
2021-01-10T04:23:40.580059
2016-03-19T18:27:19
2016-03-19T18:27:19
49,878,947
0
0
null
null
null
null
UTF-8
Java
false
false
793
java
package com.cirs.jsf.controller; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import com.cirs.jsf.util.JsfUtils; @SessionScoped @ManagedBean(name = "navBean") public class NavBean { public String getNavUrl(String string) { StringBuilder base = new StringBuilder(JsfUtils.getExternalContext().getRequestContextPath() + "/faces/pages/"); switch (string) { case "users": base.append("users"); break; case "complaints": base.append("complaints"); break; case "categories": base.append("categories"); break; case "stats": base.append("stats"); break; default: throw new IllegalArgumentException(string + " is not a valid argument"); } return base.append("/index.xhtml").toString(); } }
0f11300f056d137ff0d7234c201d8862190b6d7b
acffefea9df71e28426dd25df2749424b6be5886
/src/main/java/com/epam/spring/core/htask/cinema/models/User.java
4dd7935f284a767c52140dd7a583c5b968ef5d31
[]
no_license
aplakuschiy/spring-epam-task-cinema-jdbc
a9d7d4fd8f04953e705f4664d06495f2d284d67f
1045b43e91433411d8efcab39baef3c154a6486f
refs/heads/master
2016-08-12T04:24:18.513859
2015-11-11T12:20:52
2015-11-11T12:20:52
45,260,293
0
0
null
null
null
null
UTF-8
Java
false
false
728
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.epam.spring.core.htask.cinema.models; import java.util.Date; /** * * @author Oleksandr_Plakushchy */ public class User extends BaseModel{ private Date dateBirth; public User(int id, String name, Date dateBirth, int state) { super.id = id; super.name = name; this.dateBirth = dateBirth; } public int getId() { return id; } public Date getDateBirth() { return dateBirth; } public String getName() { return name; } }
be603e5ab15411a5e73ace24fab907c8f7c844f4
48abaa3636916f9323668f981a4b6c8985f1d092
/AD2015C2_Server/src/srv/BusinessService.java
04114c2173de05fd32647d21ebd5b3955f3f1884
[]
no_license
szapasil/AD2015C2
3f8a44a753775af3c581f01fd6a0c7bccd9f2ade
713e1ca39d39823e800bc69da104f31a132b4186
refs/heads/master
2020-12-24T14:53:07.895273
2015-12-14T18:11:28
2015-12-14T18:11:28
40,509,236
0
1
null
2015-12-14T18:11:29
2015-08-10T22:30:06
Java
UTF-8
Java
false
false
1,571
java
package srv; import interfaz.ICC; import interfaz.IOV; import java.net.InetAddress; import java.rmi.*; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import app.CC; import app.OV; public class BusinessService { public void publicarServicioOV() { try { IOV stubOV = new OV(); LocateRegistry.createRegistry(Registry.REGISTRY_PORT); Naming.rebind("//localhost/ControladorOV", stubOV); System.out.println("Servicio ControladorOV publicado"); } catch (Exception e) { e.printStackTrace(); } } public void publicarServicioCC() { try { ICC stubCC = CC.getInstancia(); LocateRegistry.createRegistry(Registry.REGISTRY_PORT); Naming.rebind("//localhost/ControladorCC", stubCC); System.out.println("Servicio ControladorCC publicado"); } catch (Exception e) { e.printStackTrace(); } } public void verVinculos() { try { String[] vinculos = Naming.list( "" ); System.out.print(InetAddress.getLocalHost().getHostAddress()); for ( int i = 0; i < vinculos.length; i++ ){ System.out.println( vinculos[i] ); } System.out.print( ">>> Servicio publicado"); } catch (Exception e) { e.printStackTrace(); } } public void cerrar() { try { Naming.unbind("Controlador"); } catch (Exception e) { } finally { System.exit(0); } } }
4baa6f1b6abfdccd3223be420cbc973113e68676
8454536c354a502bd662d4fa6a234d52bc9124ea
/src/main/java/entity/Admin.java
bbd6d8c0ef6bb9e1db24026f24178477651144ae
[]
no_license
Andidas/ITForum_admin
baefdcda1ab933a1609076abbf317a503ca2814a
e316928edd41b8c9f50dcb121547193fdaf72f4f
refs/heads/master
2021-09-03T00:17:02.818167
2018-01-04T08:15:53
2018-01-04T08:15:53
112,335,151
0
0
null
null
null
null
UTF-8
Java
false
false
907
java
package entity; public class Admin { public Admin(String aname, String apassword) { super(); this.aname = aname; this.apassword = apassword; } public Admin() { super(); } public Admin(int aid, String aname, String apassword) { super(); this.aid = aid; this.aname = aname; this.apassword = apassword; } private int aid; private String aname; private String apassword; @Override public String toString() { return "Admin [aid=" + aid + ", aname=" + aname + ", apassword=" + apassword + "]"; } public int getAid() { return aid; } public void setAid(int aid) { this.aid = aid; } public String getAname() { return aname; } public void setAname(String aname) { this.aname = aname; } public String getApassword() { return apassword; } public void setApassword(String apassword) { this.apassword = apassword; } }
f1dac2fe5596ab63fec67fc482daaf0e4ab52f9f
5d73f2ba050098047d212f1f5b45dafc9978f32e
/src/util/Util.java
ab99d6fb580370564bb42022e1800242375949af
[ "MIT" ]
permissive
CiroMdeFreitas/ProgramacaoPararela8Periodo
05ad18789be96f604d77f612a6e773fa836f631a
2f4c49fb25a4c269f70883de2b253088e93f1475
refs/heads/main
2023-01-28T00:19:49.786872
2020-12-08T13:59:24
2020-12-08T13:59:24
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
641
java
package util; import java.util.Random; import javax.swing.JOptionPane; import org.apache.commons.lang3.StringUtils; public class Util { public static String getNumber() { String number; do { number = (String)JOptionPane.showInputDialog("Insira um número:"); if (!StringUtils.isNumeric(number)) JOptionPane.showMessageDialog(null, "Caracter inserido não é um número!", null, JOptionPane.WARNING_MESSAGE); }while(!StringUtils.isNumeric(number)); return number; } public static int generateNumber(int min, int max) { Random numberGenrator = new Random(); return numberGenrator.nextInt(max)+min; } }
8372b79b693978bbbdf12c036cd1547ff0f13ae4
fc99c3dfb3eee825b6ad859106c9fa05940fbe5e
/src/Test.java
a4cf864e27605b6df2ef228a719119708399300f
[]
no_license
deepoosandy/interviewquestions
901afdad7da39802da8a1ea27aed342e787cf27e
6cb0b40c1c51b9f7121fe5d8d2e76be6fe59a842
refs/heads/master
2020-12-28T02:43:29.541612
2020-02-04T08:14:18
2020-02-04T08:14:18
238,155,911
0
0
null
null
null
null
UTF-8
Java
false
false
1,305
java
// Java program to find maximum amount of water that can // be trapped within given set of bars. class Test { static int arr[] = new int[] {3, 0, 0, 2, 0, 4}; // Method for maximum amount of water static int findWater(int n) { // left[i] contains height of tallest bar to the // left of i'th bar including itself int left[] = new int[n]; // Right [i] contains height of tallest bar to // the right of ith bar including itself int right[] = new int[n]; // Initialize result int water = 0; // Fill left array left[0] = arr[0]; for (int i = 1; i < n; i++) left[i] = Math.max(left[i - 1], arr[i]); // Fill right array right[n - 1] = arr[n - 1]; for (int i = n - 2; i >= 0; i--) right[i] = Math.max(right[i + 1], arr[i]); // Calculate the accumulated water element by element // consider the amount of water on i'th bar, the // amount of water accumulated on this particular // bar will be equal to min(left[i], right[i]) - arr[i] . for (int i = 0; i < n; i++) water += Math.min(left[i], right[i]) - arr[i]; return water; } // Driver method to test the above function public static void main(String[] args) { System.out.println("Maximum water that can be accumulated is " + findWater(arr.length)); } }
f70aed6bd4f0d2e6813b56e19e53fedcb57aff2c
50266918173e3b96f171dced0f4361bdb4564c25
/Chapter04/app/src/test/java/com/zz/chapter04/ExampleUnitTest.java
fa58a07b4111ea3129bc9c8fd019636b66916454
[]
no_license
zznjobs/LoveAndroid
9c3f75a57a1923cadbd5686fbcc3cffe0c342447
9cb8db66af9b30d159645e182331b0b67d019096
refs/heads/master
2021-09-14T01:34:52.229739
2018-05-07T07:18:13
2018-05-07T07:18:13
115,400,542
0
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.zz.chapter04; import org.junit.Test; import static org.junit.Assert.*; /** Example local unit test, which will execute on the development machine (host). @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
94b7209377da11bb4149a5461ced03974d04ff61
a2267c1db4a479efffd4f94fd549b1c509db1dff
/my_first_system/src/interfacepack/mainmenu.java
6608c47c8953f6b2524087b7abea4442dc3796fd
[]
no_license
BROjohnny/Student-Registration-System
f8624e50308509f3f0924a2555de2167013e20b7
d234ca84a1c62045180cccb1c0ef7f34ae2bfe22
refs/heads/master
2020-03-27T10:12:02.507982
2018-08-29T13:39:59
2018-08-29T13:39:59
146,402,616
1
0
null
null
null
null
UTF-8
Java
false
false
6,417
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package interfacepack; /** * * @author dell */ public class mainmenu extends javax.swing.JFrame { /** * Creates new form mainmenu */ public mainmenu() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jDesktopPane1 = new javax.swing.JDesktopPane(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jButton3.setText("Text Button 1"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton4.setText("Text Button 2"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); javax.swing.GroupLayout jDesktopPane1Layout = new javax.swing.GroupLayout(jDesktopPane1); jDesktopPane1.setLayout(jDesktopPane1Layout); jDesktopPane1Layout.setHorizontalGroup( jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); jDesktopPane1Layout.setVerticalGroup( jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 337, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jDesktopPane1) .addGroup(layout.createSequentialGroup() .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 387, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jDesktopPane1) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed jDesktopPane1.removeAll(); page1 objt = new page1(); jDesktopPane1.add(objt).setVisible(true); }//GEN-LAST:event_jButton3ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed jDesktopPane1.removeAll(); page2 objt1 = new page2(); jDesktopPane1.add(objt1).setVisible(true); }//GEN-LAST:event_jButton4ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(mainmenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(mainmenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(mainmenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(mainmenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new mainmenu().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JDesktopPane jDesktopPane1; // End of variables declaration//GEN-END:variables }
38e92be393ff9d98ed473b1707524fb28583fc84
be77694123e12f92f222b66cb7d7ec8249cc7d13
/src/classes/OrderDetails.java
70b57ddcb535438bd4d7cfcac2d82b06079c94d1
[]
no_license
JohnnyB87/OOPProject
f40e70db724d29c0bd7b73614f1c79c55a3faba5
1751b30d77435ed1dc9938c1f7ce63c9b433eb46
refs/heads/master
2020-03-16T16:41:45.664621
2018-05-11T09:10:44
2018-05-11T09:10:44
132,799,649
0
0
null
null
null
null
UTF-8
Java
false
false
1,344
java
package classes; public class OrderDetails { private Product product; private int quantity; private String oNo; //----------------------------- // CONSTRUCTORS //----------------------------- public OrderDetails(){} public OrderDetails(Product p, int q, String oNo){ this.product = p; this.quantity = q; this.oNo = oNo; } //----------------------------- // GETTERS //----------------------------- public int getQuantity() { return quantity; } public Product getProduct(){ return this.product; } //----------------------------- // SETTERS //----------------------------- public void setProduct(Product p){ this.product = p; } public void setQuantity(int quantity) { this.quantity = quantity; } public void setONo(String oNo) { this.oNo = oNo; } //----------------------------- // METHODS //----------------------------- public String toString(){ String str = this.product == null ? "" : String.format("Product: %s %s, Quantity: %d%n", this.product.getName(),this.product.getDescription(), this.quantity); return str; } public void print(){ System.out.println(this.toString()); } }
65593392b33689dd7fce799565f96793b232b01e
e0832932bbb5fc716b034d1c51a654cefce88716
/src/DynamicConnectivity/QuickUnionTest.java
251984f36ec3e88caa72b00601238ba6f38ea1f4
[]
no_license
Leon23333/princeton-algs4
04256bd5809b8f01db18260002e5ca5d54e9f06b
82ca3e8220c7ee7f234ce7f64e6a404c277ceccc
refs/heads/master
2020-04-11T01:45:37.534214
2018-12-12T08:13:19
2018-12-12T08:13:19
161,425,525
2
0
null
null
null
null
UTF-8
Java
false
false
495
java
package DynamicConnectivity; public class QuickUnionTest { public static void main(String[] args) { QuickUnion qu = new QuickUnion(10); System.err.println(qu.connected(1, 2)); System.err.println(qu.connected(1, 4)); qu.union(1, 2); qu.union(1, 9); qu.union(9, 4); System.err.println(qu.connected(1, 2)); System.err.println(qu.connected(1, 4)); System.err.println(qu.connected(2, 4)); System.err.println(qu.connected(2, 9)); System.err.println(qu.connected(2, 8)); } }
43a748acb5cb484b9cfe0b8f44524697012b8c35
466e03e3ed48ed3cc8fdd34ecf91e9889f017daa
/micro-weather-redis/src/main/java/cn/edu/microweatherredis/vo/Yeaterday.java
ac7facb065d374f890e42da1dc7ee976a2435a8b
[]
no_license
666wg/gradle_weather
58b835c6e6128cea19b1472d57eb4dd18b83fb90
36d1815eca4bc10f873305f0b17e42612eabafae
refs/heads/master
2020-03-17T23:21:53.183075
2018-05-21T13:51:06
2018-05-21T13:51:41
134,041,511
0
0
null
null
null
null
UTF-8
Java
false
false
1,006
java
package cn.edu.microweatherredis.vo; import java.io.Serializable; /** * 昨日天气. * * @since 1.0.0 2017年11月21日 * @author <a href="https://waylau.com">Way Lau</a> */ public class Yeaterday implements Serializable { private static final long serialVersionUID = 1L; private String date; private String high; private String fx; private String low; private String fl; private String type; public String getDate() { return date; } public void setDate(String date) { this.date = date; } public String getHigh() { return high; } public void setHigh(String high) { this.high = high; } public String getFx() { return fx; } public void setFx(String fx) { this.fx = fx; } public String getLow() { return low; } public void setLow(String low) { this.low = low; } public String getFl() { return fl; } public void setFl(String fl) { this.fl = fl; } public String getType() { return type; } public void setType(String type) { this.type = type; } }
bf7a63b366d5c81c1c4252c35751cf9e64abc536
96e85eb9ef8ff416580e31a8896098ba34bbecf1
/app/src/main/java/com/example/tejas/weather/WeatherFragment.java
32cd5ebaa5230dee96579c4d3636a5a4dd1bf90f
[]
no_license
nency-shah-knoxpo/weatherjsonparsing
fab8cbd0b4bbc81c9299732be059fe019b78a1fe
601691de17523439d4588594c29951078c2c34b1
refs/heads/master
2020-03-19T07:31:13.660169
2018-06-05T04:48:31
2018-06-05T04:48:31
136,121,072
0
0
null
null
null
null
UTF-8
Java
false
false
5,169
java
package com.example.tejas.weather; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.ArrayList; import java.util.List; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; import retrofit2.Retrofit; public class WeatherFragment extends Fragment { private RecyclerView mWeatherRV; private List<Weather> mWeather; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_weather, container, false); init(v); mWeatherRV.setLayoutManager(new LinearLayoutManager(getActivity())); setupAdapter(); return v; } public void setupAdapter() { WeatherAdapter adapter = new WeatherAdapter(mWeather); mWeatherRV.setAdapter(adapter); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); startFetching(); } public void init(View v) { mWeather = new ArrayList<>(); mWeatherRV = v.findViewById(R.id.recycler_view); } public void startFetching() { String api_key = "75f7635dba3a7ad7dd2a7462e1da4c99"; Retrofit retrofit = ReturnRetroFit.getRetrofitInstance(); WeatherInterface weatherInterface = retrofit.create(WeatherInterface.class); Call<WeatherResponse> call = weatherInterface.getWeatherJSON("524901", api_key); call.enqueue(new Callback<WeatherResponse>() { @Override public void onResponse(Call<WeatherResponse> call, Response<WeatherResponse> response) { for (int i = 0; i < response.body().mWeathers.size(); i++) { Weather weather = new Weather(); String description; String min_temp = response.body().mWeathers.get(i).mMainDetails.getMinimumTemperature(); String max_temp = response.body().mWeathers.get(i).mMainDetails.getMaximumTemperature(); String humidity = response.body().mWeathers.get(i).mMainDetails.getHumidity(); for (int j = 0; j < response.body().mWeathers.get(j).details.size(); j++) { description = response.body().mWeathers.get(i).details.get(j).getDescription(); weather.setDescription(description); } weather.setMinimumTemperature(min_temp); weather.setMaximumTemperature(max_temp); weather.setHumidity(humidity); mWeather.add(weather); } setupAdapter(); } @Override public void onFailure(Call<WeatherResponse> call, Throwable t) { } }); } public class WeatherHolder extends RecyclerView.ViewHolder { private Weather mWeather; private TextView mMinTempTV, mMaxTempTV, mHumidityTV, mDescTV; public WeatherHolder(View itemView) { super(itemView); mMinTempTV = itemView.findViewById(R.id.min_temp); mMaxTempTV = itemView.findViewById(R.id.max_temp); mHumidityTV = itemView.findViewById(R.id.humidity); mDescTV = itemView.findViewById(R.id.desc); } public void bindWeather(Weather weather) { mWeather = weather; mMinTempTV.setText("Minimum Temprature:" + mWeather.getMinimumTemperature()); mMaxTempTV.setText("Maximum Temprature:" + mWeather.getMaximumTemperature()); mDescTV.setText("Description:" + mWeather.getDescription()); mHumidityTV.setText("Humidity:" + mWeather.getHumidity()); } } private class WeatherAdapter extends RecyclerView.Adapter<WeatherHolder> { public WeatherAdapter(List<Weather> weathers) { mWeather = weathers; } @NonNull @Override public WeatherHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { LayoutInflater layoutInflater = LayoutInflater.from(getActivity()); View view = layoutInflater .inflate(R.layout.list_weather, parent, false); return new WeatherHolder(view); } @Override public void onBindViewHolder(@NonNull WeatherHolder holder, int position) { Weather weather = mWeather.get(position); holder.bindWeather(weather); } @Override public int getItemCount() { return mWeather.size(); } } }
85f221d67e9126b1670b3b1e99dcebcf59454e81
665aa2fa6bc99a3cfcdf585aa773c31c8c2bd24d
/NewDevelop/src/com/wkey/develop/datacache/core/decode/ImageDecodingInfo.java
2e9e02382a6a41565023b0505466fcd594f4ac75
[]
no_license
engru/Android
88efaff680dfa2eee99ed114a8bd647569ee15e9
0a6f45f1f2fb65862cf0787ed818a051de91c4d2
refs/heads/master
2020-05-27T12:01:20.264803
2013-06-28T11:37:19
2013-06-28T11:37:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,898
java
/******************************************************************************* * Copyright 2013 Sergey Tarasevich * * 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.wkey.develop.datacache.core.decode; import android.annotation.TargetApi; import android.graphics.BitmapFactory.Options; import android.os.Build; import com.wkey.develop.datacache.core.DisplayImageOptions; import com.wkey.develop.datacache.core.assist.ImageScaleType; import com.wkey.develop.datacache.core.assist.ImageSize; import com.wkey.develop.datacache.core.assist.MemoryCacheUtil; import com.wkey.develop.datacache.core.assist.ViewScaleType; import com.wkey.develop.datacache.core.download.ImageDownloader; /** * Contains needed information for decoding image to Bitmap * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @since 1.8.3 */ public class ImageDecodingInfo { private final String imageKey; private final String imageUri; private final ImageSize targetSize; private final ImageScaleType imageScaleType; private final ViewScaleType viewScaleType; private final ImageDownloader downloader; private final Object extraForDownloader; private final Options decodingOptions; public ImageDecodingInfo(String imageKey, String imageUri, ImageSize targetSize, ViewScaleType viewScaleType, ImageDownloader downloader, DisplayImageOptions displayOptions) { this.imageKey = imageKey; this.imageUri = imageUri; this.targetSize = targetSize; this.imageScaleType = displayOptions.getImageScaleType(); this.viewScaleType = viewScaleType; this.downloader = downloader; this.extraForDownloader = displayOptions.getExtraForDownloader(); decodingOptions = new Options(); copyOptions(displayOptions.getDecodingOptions(), decodingOptions); } private void copyOptions(Options srcOptions, Options destOptions) { destOptions.inDensity = srcOptions.inDensity; destOptions.inDither = srcOptions.inDither; destOptions.inInputShareable = srcOptions.inInputShareable; destOptions.inJustDecodeBounds = srcOptions.inJustDecodeBounds; destOptions.inPreferredConfig = srcOptions.inPreferredConfig; destOptions.inPurgeable = srcOptions.inPurgeable; destOptions.inSampleSize = srcOptions.inSampleSize; destOptions.inScaled = srcOptions.inScaled; destOptions.inScreenDensity = srcOptions.inScreenDensity; destOptions.inTargetDensity = srcOptions.inTargetDensity; destOptions.inTempStorage = srcOptions.inTempStorage; if (Build.VERSION.SDK_INT >= 10) copyOptions10(srcOptions, destOptions); if (Build.VERSION.SDK_INT >= 11) copyOptions11(srcOptions, destOptions); } @TargetApi(10) private void copyOptions10(Options srcOptions, Options destOptions) { destOptions.inPreferQualityOverSpeed = srcOptions.inPreferQualityOverSpeed; } @TargetApi(11) private void copyOptions11(Options srcOptions, Options destOptions) { destOptions.inBitmap = srcOptions.inBitmap; destOptions.inMutable = srcOptions.inMutable; } /** * @return Original {@linkplain MemoryCacheUtil#generateKey(String, ImageSize) image key} (used in memory cache). */ public String getImageKey() { return imageKey; } /** * @return Image URI for decoding (usually image from disc cache) */ public String getImageUri() { return imageUri; } /** * @return Target size for image. Decoded bitmap should close to this size according to {@linkplain ImageScaleType * image scale type} and {@linkplain ViewScaleType view scale type}. */ public ImageSize getTargetSize() { return targetSize; } /** * @return {@linkplain ImageScaleType Scale type for image sampling and scaling}. This parameter affects result size * of decoded bitmap. */ public ImageScaleType getImageScaleType() { return imageScaleType; } /** * @return {@linkplain ViewScaleType View scale type}. This parameter affects result size of decoded bitmap. */ public ViewScaleType getViewScaleType() { return viewScaleType; } /** * @return Downloader for image loading */ public ImageDownloader getDownloader() { return downloader; } /** * @return Auxiliary object for downloader */ public Object getExtraForDownloader() { return extraForDownloader; } /** * @return Decoding options */ public Options getDecodingOptions() { return decodingOptions; } }
d849aebcf3abc15980ce9b9de45916b2b1fe5689
9f7a6628cde87d5b3bbcfaead502feba960a837d
/kodilla-hibernate/src/main/java/com/kodilla/hibernate/task/Task.java
9fb26391e6ca4f4561f47a417b8640f5f24140c2
[]
no_license
pawelski85/kodilla-spring-web
cf4eff81567409ade0422a30a3b8d02aa7676594
89d1ec34e66eb146498ffb68cfdb5ea523ea9a95
refs/heads/master
2023-04-06T17:57:21.771128
2021-04-24T10:02:50
2021-04-24T10:02:50
327,423,227
1
0
null
null
null
null
UTF-8
Java
false
false
2,646
java
package com.kodilla.hibernate.task; import com.kodilla.hibernate.tasklist.TaskList; import com.sun.istack.NotNull; import javax.persistence.*; import java.util.Date; @NamedQueries({ @NamedQuery( name = "Task.retrieveLongTasks", query = "FROM Task WHERE duration > 10" ), @NamedQuery( name = "Task.retrieveShortTasks", query = "FROM Task WHERE duration <= 10" ), @NamedQuery( name = "Task.retrieveTasksWithDurationLongerThan", query = "FROM Task WHERE duration > :DURATION" ) }) @NamedNativeQuery( name = "Task.retrieveTasksWithEnoughTime", query = "SELECT * FROM TASKS" + " WHERE DATEDIFF(DATE_ADD(CREATED, INTERVAL DURATION DAY), NOW()) > 5", resultClass = Task.class ) @Entity @Table(name = "TASKS") public final class Task { private int id; private String description; private int duration; private Date created; private TaskFinancialDetails taskFinancialDetails; private TaskList taskList; public Task() { } public Task(String description, int duration) { this.description = description; this.created = new Date(); this.duration = duration; } @Id @GeneratedValue @NotNull @Column(name = "ID", unique = true) public int getId() { return id; } @Column(name = "DESCRIPTION") public String getDescription() { return description; } @NotNull @Column(name="CREATED") public Date getCreated() { return created; } @Column(name="DURATION") public int getDuration() { return duration; } private void setId(int id) { this.id = id; } private void setDescription(String description) { this.description = description; } private void setCreated(Date created) { this.created = created; } private void setDuration(int duration) { this.duration = duration; } @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinColumn(name = "TASKS_FINANCIALS_ID") public TaskFinancialDetails getTaskFinancialDetails() { return taskFinancialDetails; } public void setTaskFinancialDetails(TaskFinancialDetails taskFinancialDetails) { this.taskFinancialDetails = taskFinancialDetails; } @ManyToOne @JoinColumn(name = "TASKLIST_ID") public TaskList getTaskList() { return taskList; } public void setTaskList(TaskList taskList) { this.taskList = taskList; } }
c5e12e15d63c176b06b30249c64668281b81b3b0
d56c64ca19b2569b177e43c57fb7fa2d146e8c42
/doit/src/test/java/com/airhacks/doit/business/reminders/entity/ToDoTest.java
a34dc504036a7cfb3c73cff0e730f2facede6f74
[]
no_license
nebrass/doit
23b896be466c0cf5435b20fe492509a1183f5bfe
48031c7be7762438489abeb695b235ccd2ae9a16
refs/heads/master
2020-12-25T00:09:42.210430
2015-08-18T19:18:44
2015-08-18T19:18:44
41,645,528
1
0
null
2015-08-30T22:48:22
2015-08-30T22:48:22
Java
UTF-8
Java
false
false
647
java
package com.airhacks.doit.business.reminders.entity; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import org.junit.Test; /** * * @author airhacks.com */ public class ToDoTest { @Test public void validTodo() { ToDo valid = new ToDo("", "available", 11); assertTrue(valid.isValid()); } @Test public void invalidTodo() { ToDo valid = new ToDo("", null, 11); assertFalse(valid.isValid()); } @Test public void todoWithoutDescription() { ToDo valid = new ToDo("implement", null, 10); assertTrue(valid.isValid()); } }
fe9441866d846c094fdae6096327b69016d2b3f3
c1b75e450665a32c13d830556d14541f549940ee
/common/src/main/java/com/base/common/result/Result.java
41d3107ef7b9209e9c3416338e1e794f6d6a2366
[]
no_license
zhougz9527/java-scaffold
0a5ab4bf1b88172a406b56d39e463fe2f8a156f9
988fc9486eb3c382526c16aaabcb5d273b26e356
refs/heads/master
2022-11-22T00:52:19.702901
2020-07-29T18:30:33
2020-07-29T18:30:33
283,422,407
0
0
null
null
null
null
UTF-8
Java
false
false
1,456
java
package com.base.common.result; import java.io.Serializable; import java.util.HashMap; import java.util.Map; public class Result implements Serializable { private int code; private String msg; private Map<String, Object> result; public Result(int code, String msg, Map<String, Object> result) { this.code = code; this.msg = msg; this.result = null != result ? result : new HashMap<>(); } public Result(ResultEnum resultEnum) { this.code = resultEnum.code; this.msg = resultEnum.msg; result = new HashMap<>(); } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public Result setMsg(String msg) { this.msg = msg; return this; } public Object getResult() { return result; } public Result setResult(Map<String, Object> result) { this.result = result; return this; } public Result put(String key, Object value) { result.put(key, value); return this; } public static Result getEmptySuccess() { return new Result(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMsg(), new HashMap<>()); } public static Result getEmptyFail() { return new Result(ResultEnum.FAIL.getCode(), ResultEnum.FAIL.getMsg(), new HashMap<>()); } }