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
1fc40bad8526dbbd3723044a5e2b7fea6e7ce689
7bdd4bb72bd0523c266eeb38666068026436ffc4
/spark/src/main/java/com/nicstrong/spark/route/RouteMatch.java
6af43bb05d0a8be5690027fe01257e294a0bb347
[]
no_license
nicstrong/android-dds
10cd5a6e4f02382449e7dcedc400f095a437d83c
5da1bb0a66c2bbec48c282c4a1fc84fdf535e6ee
refs/heads/master
2020-03-30T09:28:35.925720
2014-03-25T04:56:09
2014-03-25T04:56:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,185
java
package com.nicstrong.spark.route; import com.nicstrong.spark.HttpMethod; public class RouteMatch { private HttpMethod httpMethod; private Object target; private String matchUri; private String requestURI; private String acceptType; public RouteMatch(HttpMethod httpMethod, Object target, String matchUri, String requestUri, String acceptType) { super(); this.httpMethod = httpMethod; this.target = target; this.matchUri = matchUri; this.requestURI = requestUri; this.acceptType = acceptType; } /** * * @return the accept type */ public String getAcceptType() { return acceptType; } /** * @return the httpMethod */ public HttpMethod getHttpMethod() { return httpMethod; } /** * @return the target */ public Object getTarget() { return target; } /** * @return the matchUri */ public String getMatchUri() { return matchUri; } /** * @return the requestUri */ public String getRequestURI() { return requestURI; } }
b7a03b338d58834cd7f6f2d58ccbd37a3e976d6e
db8eb10b6e9c0a275209325a6a36f23d9c13f383
/lib-common/src/main/java/coder/lib/common/redis/RedisManager.java
4b716c050182e5f75d0e1a20dc8aaed3ed5afb8c
[ "MIT" ]
permissive
penglongli/CoderBlog
32e4d89bee5c21b3064955ed708b80bfa0f5780d
fe46bb3c9a04874bb718c2de65b7942d7c9802fd
refs/heads/master
2021-01-13T09:51:34.964315
2017-03-01T14:49:24
2017-03-01T14:49:24
72,647,448
0
1
null
null
null
null
UTF-8
Java
false
false
287
java
package coder.lib.common.redis; import redis.clients.jedis.JedisPool; /** * Created by Pelin on 17/2/13. */ public interface RedisManager { JedisPool getPool(); String set(String key, String value); String set(byte[] key, byte[] value); String get(String key); }
f86a62f915642f1a335c55e921127862c265f07d
477d147a12bd0418a2124960ed8e14859b04668c
/util/http-client/src/test/java/net/lizhaoweb/common/util/http/common/util/TestOCR.java
e4f6776c54c2da0bedf076f1e0fe9ed7838dca48
[ "Apache-2.0" ]
permissive
JohnLee-Organization/common
90312aa0edee382ba96973e7f99c2743a28833d2
eec94dcd810142346020caca4a33ca30aa4dfd38
refs/heads/devp
2023-07-27T05:01:56.187981
2022-02-08T03:14:57
2022-02-08T03:14:57
98,837,125
0
0
Apache-2.0
2023-07-16T02:49:07
2017-07-31T01:47:33
Java
UTF-8
Java
false
false
1,537
java
/** * Copyright (c) 2018, Stupid Bird and/or its affiliates. All rights reserved. * STUPID BIRD PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * @Project : common * @Package : net.lizhaoweb.common.util.http.common.util * @author <a href="http://www.lizhaoweb.net">李召(John.Lee)</a> * @EMAIL [email protected] * @Time : 12:59 */ package net.lizhaoweb.common.util.http.common.util; import net.lizhaoweb.common.util.http.common.HttpConfig; /** * @author <a href="http://www.lizhaoweb.cn">李召(John.Lee)</a> * @version 1.0.0.0.1 * @EMAIL [email protected] * @notes Created on 2018年10月08日<br> * Revision of last commit:$Revision$<br> * Author of last commit:$Author$<br> * Date of last commit:$Date$<br> */ public class TestOCR { public static void main(String[] args) { String filePath = "C:\\Users/160049\\Desktop/ValidateCode.gif"; String url = "http://file1.ocrking.com/small/20160331/wobCjcOOw5nCsXl2w5vChMK3a23Cr8KJc8Kh/afb82f57-52c3-496f-9b70-2cfa83505258.gif?DxDjRSmjEBGmRLXo7l59QPHSCn4rJ3foys6nFTuT4hLj1+r8a5RstCJ9v3gyVM/A"; String url2 = "http://59.41.9.91/GZCX/WebUI/Content/Handler/ValidateCode.ashx?0.3271647585525703"; OCR.debug(); String code1 = OCR.ocrCode(filePath, 5); String code2 = OCR.ocrCode4Net(url, 5); String code3 = OCR.ocrCode4Net(HttpConfig.custom(), url2, 5); System.out.println(code1); System.out.println(code2); System.out.println(code3); System.out.println("----"); } }
ed550600262352b8d1433b8e2f5c9b79c82f6834
e147735a2c48a8357171a1fd1d48f5b999cfe976
/JAVA/jdbc02/test/ProductSelect.java
f955a7ee4756fbdb603f9bd4961675b23047a8db
[]
no_license
ssoheee/TIL
b1c36a3539aa895ed354d221329aa5ee88c87458
2fa36b94666e60e6dd41b09e2d106c4b045e2255
refs/heads/master
2022-12-22T11:05:32.379001
2019-09-06T04:51:24
2019-09-06T04:51:24
187,792,793
0
0
null
2022-12-16T07:47:40
2019-05-21T08:17:22
CSS
UTF-8
Java
false
false
342
java
package test; import com.ProductDao; import frame.Dao; import vo.Product; public class ProductSelect { public static void main(String[] args) { Dao<String, Product> dao = new ProductDao(); try { System.out.println(dao.select("P10")); System.out.println("Completed"); } catch (Exception e) { e.printStackTrace(); } } }
8e362fcabdcf3ed19cba40a9f96835a772f1d070
4431b27a9b3a47bf2c23128b9b4a4c33daee1daf
/KarmaPoint/src/main/com/mastek/servlet/yammerServlet.java
82170b0973ca53f9921bae3751e7f7f6a7dc285c
[]
no_license
ravimastek/CraftsManSquare
278a82af11f8d1f6c168965017941b6e2b6a19dd
640c1f60ae96231f78a0b3d95ec8256abdfe314d
refs/heads/master
2021-01-15T21:34:27.898605
2014-07-24T08:17:07
2014-07-24T08:17:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,215
java
package com.mastek.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.mastek.domain.YamAuth; /** * Servlet implementation class yammerServlet */ public class yammerServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public yammerServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("Inside Servlet"); YamAuth auth = new YamAuth(); auth.getAuthToken(); //auth.getURL(); } }
c0cabbe3f17025c0984215a4905e6aa9ed64f20c
b23d5fc4f347646d335eb6c24bf230b284b675eb
/designPattern/src/main/java/designPattern/Visitor/VisitorA.java
55d9e895faa424e1a08913dd3a1c8d230948b66d
[]
no_license
PlumpMath/designPattern-562
ba21646f560726bce655c010ad75e48414d69738
322b91ac2e5f588a4a98e455c6e1fda72256d4b3
refs/heads/master
2021-01-20T09:41:42.651112
2016-02-29T06:30:09
2016-02-29T06:30:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
306
java
package designPattern.Visitor; //具体访问者角色 public class VisitorA implements Visitor { public void visit(NodeA node) { // TODO Auto-generated method stub node.operationA(); } public void visit(NodeB node) { // TODO Auto-generated method stub node.operationB(); } }
a5a0576b03d4b38b5ef2d02911017c9eb0ae29a5
918e45b91a03e581910177f3ab8fe9f2d026047a
/ThirdDemo/ThirdLibrary/src/main/java/com/third/interfaces/SinaShareCallBack.java
da2144db5c817aa9e530dffbf4a40f5dc892f0eb
[ "Apache-2.0" ]
permissive
taomylife521/ThirdLogin_Share
44281782e51ae58999b393340a06b4a53b10b01e
994be6a22a25a9daa9358ebd02d467402928f0ed
refs/heads/master
2020-06-17T03:08:27.587713
2016-09-08T04:11:10
2016-09-08T04:11:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
263
java
package com.third.interfaces; /** * Author Ztiany <br/> * Email [email protected] <br/> * Date 2015-12-27 17:41 <br/> * Description: */ public interface SinaShareCallBack extends PlatformActionListener { void onComplete(); }
a6f8a14349811529448e07139543e7eaed2e284d
1e724d5459124ac25e9dfd886a7adcd413b0cf6d
/src/main/java/com/hjt/MyCRM/exception/ActivitySaveException.java
fd00547d1112ef1ddc229914ef68830d407ae6de
[]
no_license
Myhjt/MyCrm
7c95ff9a9f28d56b2e132aba7ec8f176806966db
b6146cb1fe32e4c08df6fe4692c8181daf319614
refs/heads/master
2023-04-19T19:40:22.855194
2021-05-30T01:57:21
2021-05-30T01:57:21
367,774,326
0
0
null
null
null
null
UTF-8
Java
false
false
221
java
package com.hjt.MyCRM.exception; public class ActivitySaveException extends Exception{ public ActivitySaveException(){ super(); } public ActivitySaveException(String msg){ super(msg); } }
ac6e12a0075f9b0c91c1ef55cdf21d27f910204d
adb408f34837d4d061d91dfc7d737e57cbf49fa1
/steerio/src/samples/java/com/gameprogblog/engine/GameScreen.java
d5857da295f608a5108c5e311543d4b402421862
[]
no_license
bacta/swg-server
3a045be60c05520dc7f1045e5499de04aacc2e17
71115eea1792960b4bbb448921f262f4fdd86ce2
refs/heads/develop
2023-01-09T16:51:37.334035
2019-10-30T00:48:24
2019-10-30T00:48:24
87,016,230
8
1
null
2023-01-04T12:33:23
2017-04-02T21:06:39
Java
UTF-8
Java
false
false
5,331
java
package com.gameprogblog.engine; import com.gameprogblog.engine.input.GameInput; import javax.swing.*; import java.awt.*; import java.awt.image.BufferedImage; /** * * @author Philip Diffenderfer * */ public class GameScreen extends JPanel { private static final long serialVersionUID = 1L; // The double buffer used to eliminate flickering. private BufferedImage buffer; // The flag to have antialiasing for drawing (smoother drawing). private boolean antialising; // The graphics object used for drawing. private Graphics2D graphics; // The loop that's executed in the game loop. private GameLoop loop; // The game that's being played. private Game game; // The state of the game. private GameState state; // The input of the game. private GameInput input; // The scene in the game. private Scene scene; /** * Instantiates a new screen to play a game. * * @param width * The width of the screen in pixels. * @param height * The height of the screen in pixels. * @param antialiasing * True if drawing should be smooth, otherwise false. * @param loop * The loop implementation to use. * @param game * The game to play. */ public GameScreen( int width, int height, boolean antialiasing, GameLoop loop, Game game ) { Dimension d = new Dimension( width, height ); this.setSize( d ); this.setPreferredSize( d ); this.setFocusable( true ); this.antialising = antialiasing; this.buffer = new BufferedImage( width, height, BufferedImage.TYPE_INT_ARGB ); this.loop = loop; this.game = game; this.state = new GameState(); this.input = new GameInput(); this.scene = new Scene( 0, 0, width, height ); } /** * Starts the game loop until the game is no longer being played. */ public void start() { input.mouseInside = getParent().contains( MouseInfo.getPointerInfo().getLocation() ); addKeyListener( input ); addMouseListener( input ); addMouseMotionListener( input ); resetGraphics(); game.start( scene ); loop.onStart( game, state ); while (game.isPlaying()) { // If the loop has called the draw method of the game, render the // graphics to the screen and then reset them for the next frame. if (loop.onLoop( game, state, input, graphics, scene )) { renderGraphics( getGraphics() ); resetGraphics(); } } game.destroy(); System.exit( 0 ); } @Override public final void paint( Graphics g ) { if (g == null || buffer == null) { return; } // Attempt to draw this frame. Occasionally there are random errors. try { resetGraphics(); renderGraphics( g ); } catch (Exception e) { e.printStackTrace(); } } private void renderGraphics( Graphics gr ) { gr.drawImage( buffer, 0, 0, this ); gr.dispose(); } /** * Resets the graphics which get drawn on to prepare for another frame. */ private void resetGraphics() { // Get the graphics of the buffer graphics = (Graphics2D)buffer.getGraphics(); // Clear the buffer with the background color graphics.setColor( getBackground() ); graphics.fillRect( 0, 0, getWidth(), getHeight() ); // If antialiasing is turned on enable it. if (antialising) { graphics.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); } } /** * Overrides the update method to enable double buffering. */ @Override public final void update( Graphics g ) { paint( g ); } public void setLoop( GameLoop gameLoop ) { if (loop != null) { gameLoop.onStart( game, state ); } loop = gameLoop; } public boolean isAntialising() { return antialising; } public void setAntialising( boolean antialising ) { this.antialising = antialising; } public BufferedImage getBuffer() { return buffer; } public GameLoop getLoop() { return loop; } public Game getGame() { return game; } public GameState getState() { return state; } public GameInput getInput() { return input; } public Scene getScene() { return scene; } /** * Shows the given GameScreen in a window with the given title. * * @param gameScreen * The GameScreen to add to the window. * @param title * The title of the window. */ public static void showWindow( GameScreen gameScreen, String title ) { showWindow( gameScreen, title, true ); } /** * Shows the given GameScreen in a window with the given title. * * @param gameScreen * The GameScreen to add to the window. * @param title * The title of the window. */ public static JFrame showWindow( GameScreen gameScreen, String title, boolean start ) { JFrame window = null; if (gameScreen != null) { window = new JFrame( title ); window.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); window.add( gameScreen ); window.pack(); window.setVisible( true ); if (start) { gameScreen.start(); } } return window; } }
317010af46da87aead16d9dd720f9b6968c93730
3e968856574b7ec495d7e38b9d919779571ea667
/src/Learn/DozyJava/src/com/dozy/learn/generics/UseList2.java
93d14412c07e7f317db10d88d1e3a9bfcb18d6a6
[ "WTFPL" ]
permissive
zpublic/dozy
b92f0043eb19764d9b2010bc9ca486b32a9dc4d3
c4d8d72bd58afb1ae3d2c6bef62c114795ed1e59
refs/heads/master
2021-01-18T15:08:30.653997
2015-04-28T13:48:38
2015-04-28T13:48:38
47,523,984
0
1
null
null
null
null
UTF-8
Java
false
false
184
java
//: generics/UseList2.java package com.dozy.learn.generics; import java.util.*; public class UseList2<W, T> { void f1(List<T> v) { } void f2(List<W> v) { } } // /:~
b4b4c1276d843a2e4757d03e12e1e3b32df171e7
94c5a05dde18315875a78d82d873648cda6e418a
/src/main/java/cn/haichang/comment/di/CommentDi.java
01864dc87d0df833b7e77da88fc03fc5865f4d1d
[]
no_license
linhaichang/lhc_comment
25dee058ce1b18d1a3eb4483815842a0d30fd1dc
5db28801ff57630b18ad55fcb274560103389689
refs/heads/main
2023-01-06T11:33:27.351446
2020-10-30T02:27:22
2020-10-30T02:27:22
307,124,793
0
0
null
null
null
null
UTF-8
Java
false
false
312
java
package cn.haichang.comment.di; import cn.weforward.common.ResultPage; import cn.weforward.data.UniteId; import cn.weforward.data.log.BusinessLog; import cn.weforward.data.persister.BusinessDi; /** * 评论di * @author HaiChang * @date 2020/10/25 **/ public interface CommentDi extends BusinessDi { }
7b1cc0e5d621c9ce642a91aa3c96d43287b18cc0
8acf4885eed41d87d665152c26e4c5fc852673ba
/src/main/java/com/bookstore/api/lambda/persistence/entity/AuthorRate.java
adac5fb6ef9bd42ad7e986cde82129a346d855a5
[]
no_license
gregoMartinez/bookstore-graphql-api-lambda
438ef3e28dae25085f34f898daa052c5f190f3cc
e2a5688ff982e314f568c74bc2ab4347fcb2690b
refs/heads/master
2021-08-19T18:48:08.138325
2017-11-27T05:29:13
2017-11-27T05:29:13
112,150,960
0
0
null
null
null
null
UTF-8
Java
false
false
455
java
package com.bookstore.api.lambda.persistence.entity; import org.mongodb.morphia.annotations.Entity; import org.mongodb.morphia.annotations.Indexed; /** * Created by Gregorio on 09/11/17. */ @Entity("author_rate") public class AuthorRate extends Rate{ @Indexed private String authorId; public String getAuthorId() { return authorId; } public void setAuthorId(String authorId) { this.authorId = authorId; } }
5c261251e856040dddfd9ecfda30ced8dad47da2
ee7c4b6ce1de3eae8235b62422b240689efd249b
/project/ResultSet.java
b90efadeba64320143321c8097ca7e2dcd125f5a
[]
no_license
avihirschx/Yeshiva-University-CS
c40194c0a3d2da71d2226623f9c78885854c0a2c
6f0a26f681b2dc2aa837726d0cf0b3060e4302fa
refs/heads/master
2021-05-12T05:19:22.683059
2019-01-03T04:21:19
2019-01-03T04:21:19
117,189,224
0
0
null
null
null
null
UTF-8
Java
false
false
883
java
import edu.yu.cs.dataStructures.fall2016.SimpleSQLParser.ColumnDescription; public class ResultSet { private Table table; public ResultSet(Table table) { this.table = table; } public ResultSet() { this.table = new Table(); } public void falseResult() { String[] data = new String[]{"false"}; Column column = new Column(null, false); column.add("false"); Column[] columns = new Column[]{column}; Row row = new Row(data, columns); this.table = new Table("table", column, columns); table.addRow(row); } public void trueResult() { String[] data = new String[]{"true"}; Column column = new Column(null, false); column.add("true"); Column[] columns = new Column[]{column}; Row row = new Row(data, columns); this.table = new Table("table", column, columns); table.addRow(row); } public Table getTable() { return this.table; } }
7ad3c2dae5975c4fae6afaa3bbd3a9df020abd5e
7fa0e2e3742f861bb64aabf283026882a1526869
/src/main/java/io/digitalbits/sdk/xdr/AssetCode.java
05263de6dc340cd2554cb3e833ad4fcef1bdd5d5
[ "Apache-2.0" ]
permissive
PinkDiamond1/java-digitalbits-sdk
3bd1133f1b17fcfdff89c49a440e028eeb5e96c3
8a2a4e6646042cddbef8f27650aeb46579fa914f
refs/heads/master
2023-06-30T15:56:47.552099
2021-08-04T07:56:22
2021-08-04T07:56:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,494
java
// Automatically generated by xdrgen // DO NOT EDIT or your changes may be overwritten package io.digitalbits.sdk.xdr; import java.io.IOException; import com.google.common.base.Objects; // === xdr source ============================================================ // union AssetCode switch (AssetType type) // { // case ASSET_TYPE_CREDIT_ALPHANUM4: // AssetCode4 assetCode4; // // case ASSET_TYPE_CREDIT_ALPHANUM12: // AssetCode12 assetCode12; // // // add other asset types here in the future // }; // =========================================================================== public class AssetCode implements XdrElement { public AssetCode () {} AssetType type; public AssetType getDiscriminant() { return this.type; } public void setDiscriminant(AssetType value) { this.type = value; } private AssetCode4 assetCode4; public AssetCode4 getAssetCode4() { return this.assetCode4; } public void setAssetCode4(AssetCode4 value) { this.assetCode4 = value; } private AssetCode12 assetCode12; public AssetCode12 getAssetCode12() { return this.assetCode12; } public void setAssetCode12(AssetCode12 value) { this.assetCode12 = value; } public static final class Builder { private AssetType discriminant; private AssetCode4 assetCode4; private AssetCode12 assetCode12; public Builder discriminant(AssetType discriminant) { this.discriminant = discriminant; return this; } public Builder assetCode4(AssetCode4 assetCode4) { this.assetCode4 = assetCode4; return this; } public Builder assetCode12(AssetCode12 assetCode12) { this.assetCode12 = assetCode12; return this; } public AssetCode build() { AssetCode val = new AssetCode(); val.setDiscriminant(discriminant); val.setAssetCode4(assetCode4); val.setAssetCode12(assetCode12); return val; } } public static void encode(XdrDataOutputStream stream, AssetCode encodedAssetCode) throws IOException { //Xdrgen::AST::Identifier //AssetType stream.writeInt(encodedAssetCode.getDiscriminant().getValue()); switch (encodedAssetCode.getDiscriminant()) { case ASSET_TYPE_CREDIT_ALPHANUM4: AssetCode4.encode(stream, encodedAssetCode.assetCode4); break; case ASSET_TYPE_CREDIT_ALPHANUM12: AssetCode12.encode(stream, encodedAssetCode.assetCode12); break; } } public void encode(XdrDataOutputStream stream) throws IOException { encode(stream, this); } public static AssetCode decode(XdrDataInputStream stream) throws IOException { AssetCode decodedAssetCode = new AssetCode(); AssetType discriminant = AssetType.decode(stream); decodedAssetCode.setDiscriminant(discriminant); switch (decodedAssetCode.getDiscriminant()) { case ASSET_TYPE_CREDIT_ALPHANUM4: decodedAssetCode.assetCode4 = AssetCode4.decode(stream); break; case ASSET_TYPE_CREDIT_ALPHANUM12: decodedAssetCode.assetCode12 = AssetCode12.decode(stream); break; } return decodedAssetCode; } @Override public int hashCode() { return Objects.hashCode(this.assetCode4, this.assetCode12, this.type); } @Override public boolean equals(Object object) { if (!(object instanceof AssetCode)) { return false; } AssetCode other = (AssetCode) object; return Objects.equal(this.assetCode4, other.assetCode4) && Objects.equal(this.assetCode12, other.assetCode12) && Objects.equal(this.type, other.type); } }
62eed6121bdf5403bbe52eaf0ab181a1e525c691
f65b2cdc1970308ab26a7cf36da52f470cb5238a
/app/src/main/java/com/homepaas/sls/ui/widget/tag/FlowLayout.java
b42843295c8278114cb313a91b7f2207c110c662
[]
no_license
Miotlink/MAndroidClient
5cac8a0eeff2289eb676a4ddd51a90926a6ff7ad
83cbd50c38662a7a3662221b52d6b71f157d9740
refs/heads/master
2020-04-18T11:24:18.926374
2019-01-25T06:44:13
2019-01-25T06:44:13
167,498,578
0
0
null
null
null
null
UTF-8
Java
false
false
10,725
java
package com.homepaas.sls.ui.widget.tag; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Paint; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import com.homepaas.sls.R; public class FlowLayout extends ViewGroup { public static final int HORIZONTAL = 0; public static final int VERTICAL = 1; private int horizontalSpacing = 0; private int verticalSpacing = 0; private int orientation = 0; private boolean debugDraw = false; public FlowLayout(Context context) { super(context); this.readStyleParameters(context, null); } public FlowLayout(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.readStyleParameters(context, attributeSet); } public FlowLayout(Context context, AttributeSet attributeSet, int defStyle) { super(context, attributeSet, defStyle); this.readStyleParameters(context, attributeSet); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int sizeWidth = MeasureSpec.getSize(widthMeasureSpec) - this.getPaddingRight() - this.getPaddingLeft(); int sizeHeight = MeasureSpec.getSize(heightMeasureSpec) - this.getPaddingTop() - this.getPaddingBottom(); int modeWidth = MeasureSpec.getMode(widthMeasureSpec); int modeHeight = MeasureSpec.getMode(heightMeasureSpec); int size; int mode; if (orientation == HORIZONTAL) { size = sizeWidth; mode = modeWidth; } else { size = sizeHeight; mode = modeHeight; } int lineThicknessWithSpacing = 0; int lineThickness = 0; int lineLengthWithSpacing = 0; int lineLength; int prevLinePosition = 0; int controlMaxLength = 0; int controlMaxThickness = 0; final int count = getChildCount(); for (int i = 0; i < count; i++) { final View child = getChildAt(i); if (child.getVisibility() == GONE) { continue; } LayoutParams lp = (LayoutParams) child.getLayoutParams(); child.measure( getChildMeasureSpec(widthMeasureSpec, this.getPaddingLeft() + this.getPaddingRight(), lp.width), getChildMeasureSpec(heightMeasureSpec, this.getPaddingTop() + this.getPaddingBottom(), lp.height)); int hSpacing = this.getHorizontalSpacing(lp); int vSpacing = this.getVerticalSpacing(lp); int childWidth = child.getMeasuredWidth(); int childHeight = child.getMeasuredHeight(); int childLength; int childThickness; int spacingLength; int spacingThickness; if (orientation == HORIZONTAL) { childLength = childWidth; childThickness = childHeight; spacingLength = hSpacing; spacingThickness = vSpacing; } else { childLength = childHeight; childThickness = childWidth; spacingLength = vSpacing; spacingThickness = hSpacing; } lineLength = lineLengthWithSpacing + childLength; lineLengthWithSpacing = lineLength + spacingLength; boolean newLine = lp.newLine || (mode != MeasureSpec.UNSPECIFIED && lineLength > size); if (newLine) { prevLinePosition = prevLinePosition + lineThicknessWithSpacing; lineThickness = childThickness; lineLength = childLength; lineThicknessWithSpacing = childThickness + spacingThickness; lineLengthWithSpacing = lineLength + spacingLength; } lineThicknessWithSpacing = Math.max(lineThicknessWithSpacing, childThickness + spacingThickness); lineThickness = Math.max(lineThickness, childThickness); int posX; int posY; if (orientation == HORIZONTAL) { posX = getPaddingLeft() + lineLength - childLength; posY = getPaddingTop() + prevLinePosition; } else { posX = getPaddingLeft() + prevLinePosition; posY = getPaddingTop() + lineLength - childHeight; } lp.setPosition(posX, posY); controlMaxLength = Math.max(controlMaxLength, lineLength); controlMaxThickness = prevLinePosition + lineThickness; } /* need to take paddings into account */ if (orientation == HORIZONTAL) { controlMaxLength += getPaddingLeft() + getPaddingRight(); controlMaxThickness += getPaddingBottom() + getPaddingTop(); } else { controlMaxLength += getPaddingBottom() + getPaddingTop(); controlMaxThickness += getPaddingLeft() + getPaddingRight(); } if (orientation == HORIZONTAL) { this.setMeasuredDimension( resolveSize(controlMaxLength, widthMeasureSpec), resolveSize(controlMaxThickness, heightMeasureSpec)); } else { this.setMeasuredDimension( resolveSize(controlMaxThickness, widthMeasureSpec), resolveSize(controlMaxLength, heightMeasureSpec)); } } private int getVerticalSpacing(LayoutParams lp) { int vSpacing; if (lp.verticalSpacingSpecified()) { vSpacing = lp.verticalSpacing; } else { vSpacing = this.verticalSpacing; } return vSpacing; } private int getHorizontalSpacing(LayoutParams lp) { int hSpacing; if (lp.horizontalSpacingSpecified()) { hSpacing = lp.horizontalSpacing; } else { hSpacing = this.horizontalSpacing; } return hSpacing; } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { final int count = getChildCount(); for (int i = 0; i < count; i++) { View child = getChildAt(i); LayoutParams lp = (LayoutParams) child.getLayoutParams(); child.layout(lp.x, lp.y, lp.x + child.getMeasuredWidth(), lp.y + child.getMeasuredHeight()); } } @Override protected boolean drawChild(Canvas canvas, View child, long drawingTime) { boolean more = super.drawChild(canvas, child, drawingTime); this.drawDebugInfo(canvas, child); return more; } @Override protected boolean checkLayoutParams(ViewGroup.LayoutParams p) { return p instanceof LayoutParams; } @Override protected LayoutParams generateDefaultLayoutParams() { return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); } @Override public LayoutParams generateLayoutParams(AttributeSet attributeSet) { return new LayoutParams(getContext(), attributeSet); } @Override protected LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) { return new LayoutParams(p); } private void readStyleParameters(Context context, AttributeSet attributeSet) { TypedArray a = context.obtainStyledAttributes(attributeSet, R.styleable.FlowLayout); try { horizontalSpacing = a.getDimensionPixelSize( R.styleable.FlowLayout_horizontalSpacing, 0); verticalSpacing = a.getDimensionPixelSize( R.styleable.FlowLayout_verticalSpacing, 0); orientation = a.getInteger(R.styleable.FlowLayout_orientation, HORIZONTAL); debugDraw = a.getBoolean(R.styleable.FlowLayout_debugDraw, false); } finally { a.recycle(); } } private void drawDebugInfo(Canvas canvas, View child) { if (!debugDraw) { return; } Paint childPaint = this.createPaint(0xffffff00); Paint layoutPaint = this.createPaint(0xff00ff00); Paint newLinePaint = this.createPaint(0xffff0000); LayoutParams lp = (LayoutParams) child.getLayoutParams(); if (lp.horizontalSpacing > 0) { float x = child.getRight(); float y = child.getTop() + child.getHeight() / 2.0f; canvas.drawLine(x, y, x + lp.horizontalSpacing, y, childPaint); canvas.drawLine(x + lp.horizontalSpacing - 4.0f, y - 4.0f, x + lp.horizontalSpacing, y, childPaint); canvas.drawLine(x + lp.horizontalSpacing - 4.0f, y + 4.0f, x + lp.horizontalSpacing, y, childPaint); } else if (this.horizontalSpacing > 0) { float x = child.getRight(); float y = child.getTop() + child.getHeight() / 2.0f; canvas.drawLine(x, y, x + this.horizontalSpacing, y, layoutPaint); canvas.drawLine(x + this.horizontalSpacing - 4.0f, y - 4.0f, x + this.horizontalSpacing, y, layoutPaint); canvas.drawLine(x + this.horizontalSpacing - 4.0f, y + 4.0f, x + this.horizontalSpacing, y, layoutPaint); } if (lp.verticalSpacing > 0) { float x = child.getLeft() + child.getWidth() / 2.0f; float y = child.getBottom(); canvas.drawLine(x, y, x, y + lp.verticalSpacing, childPaint); canvas.drawLine(x - 4.0f, y + lp.verticalSpacing - 4.0f, x, y + lp.verticalSpacing, childPaint); canvas.drawLine(x + 4.0f, y + lp.verticalSpacing - 4.0f, x, y + lp.verticalSpacing, childPaint); } else if (this.verticalSpacing > 0) { float x = child.getLeft() + child.getWidth() / 2.0f; float y = child.getBottom(); canvas.drawLine(x, y, x, y + this.verticalSpacing, layoutPaint); canvas.drawLine(x - 4.0f, y + this.verticalSpacing - 4.0f, x, y + this.verticalSpacing, layoutPaint); canvas.drawLine(x + 4.0f, y + this.verticalSpacing - 4.0f, x, y + this.verticalSpacing, layoutPaint); } if (lp.newLine) { if (orientation == HORIZONTAL) { float x = child.getLeft(); float y = child.getTop() + child.getHeight() / 2.0f; canvas.drawLine(x, y - 6.0f, x, y + 6.0f, newLinePaint); } else { float x = child.getLeft() + child.getWidth() / 2.0f; float y = child.getTop(); canvas.drawLine(x - 6.0f, y, x + 6.0f, y, newLinePaint); } } } private Paint createPaint(int color) { Paint paint = new Paint(); paint.setAntiAlias(true); paint.setColor(color); paint.setStrokeWidth(2.0f); return paint; } public static class LayoutParams extends ViewGroup.LayoutParams { private static int NO_SPACING = -1; private int x; private int y; private int horizontalSpacing = NO_SPACING; private int verticalSpacing = NO_SPACING; private boolean newLine = false; public LayoutParams(Context context, AttributeSet attributeSet) { super(context, attributeSet); this.readStyleParameters(context, attributeSet); } public LayoutParams(int width, int height) { super(width, height); } public LayoutParams(ViewGroup.LayoutParams layoutParams) { super(layoutParams); } public boolean horizontalSpacingSpecified() { return horizontalSpacing != NO_SPACING; } public boolean verticalSpacingSpecified() { return verticalSpacing != NO_SPACING; } public void setPosition(int x, int y) { this.x = x; this.y = y; } private void readStyleParameters(Context context, AttributeSet attributeSet) { TypedArray a = context.obtainStyledAttributes(attributeSet, R.styleable.FlowLayout_LayoutParams); try { horizontalSpacing = a .getDimensionPixelSize( R.styleable.FlowLayout_LayoutParams_layout_horizontalSpacing, NO_SPACING); verticalSpacing = a .getDimensionPixelSize( R.styleable.FlowLayout_LayoutParams_layout_verticalSpacing, NO_SPACING); newLine = a.getBoolean( R.styleable.FlowLayout_LayoutParams_layout_newLine, false); } finally { a.recycle(); } } } }
a63464069e70cf056cec2396469ef1411a54265e
9683f3f3c8d206f7de6698c577f13eaf3ee0e2a4
/LinkedList-PrintMiddle/src/LinkedList.java
2e684f2c82fef77f3af4cc6677d30a14f1f27593
[]
no_license
sahil-diwan/java-programming-2021
b6dcbee55a44c8142fd8a3460a5308ebfd45e8f5
703cc0c59f34e89840e42867eeb0928f39ef4983
refs/heads/master
2023-03-02T17:54:36.307220
2021-02-08T14:42:00
2021-02-08T14:42:00
323,325,236
0
0
null
null
null
null
UTF-8
Java
false
false
1,019
java
public class LinkedList { Node head; static class Node{ int data; Node next; Node(int data){ this.data=data; this.next=null; } } public void push(int new_data){ Node new_node = new Node(new_data); new_node.next = head; head = new_node; } public void printList(){ Node n = head; while(n!=null){ System.out.print(n.data+" "); n=n.next; } } public void printMiddle(){ Node main_ptr = head; Node ref_ptr = head; if(head!=null){ while(ref_ptr!=null && ref_ptr.next!=null){ main_ptr=main_ptr.next; ref_ptr=ref_ptr.next.next; } System.out.println(main_ptr.data); } } public static void main(String[] args) { LinkedList lList = new LinkedList(); lList.push(20); lList.push(4); lList.push(15); lList.push(35); lList.push(3); System.out.println("Linked list"); lList.printList(); System.out.println(); System.out.println("Middle element"); lList.printMiddle(); } }
13d1a80e1ad771b05d50ace824b78cd2dad16a6c
27657ec943514af2632a7d812bd5134de88db311
/src/webinarLesson2/ThrowBone.java
d96316f68cef186625b232b94c3a78f0ad9b1b4c
[]
no_license
Stormantonio/u-rise
c56d168cd11ce513b484f60b91aab6851dfdab1b
effabead63794936bbb512eaf0350923254d008a
refs/heads/master
2021-01-11T03:52:06.829027
2016-11-14T22:25:35
2016-11-14T22:25:35
71,280,101
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package webinarLesson2; import java.io.IOException; /** * Created by Anton on 24.10.2016. */ public class ThrowBone { public static void main(String[] args) throws IOException{ for (int i = 0; i < 100000; i++) { int bone1 = (int) (Math.random() * 6) + 1; int bone2 = (int) (Math.random() * 6) + 1; int bone3 = (int) (Math.random() * 6) + 1; System.out.println(bone1 + bone2 + bone3); } } }
10b08747cf329ccc7c7dddaf56c1578e76bf1d2b
cc66a11bfc637063bdd1cb703072ced8caf942e9
/mule/mule32/MuleJMSRollback/src/main/java/com/dhenton9000/jms/transactions/TransactionErrorTester.java
3a73d99728e8b350364640e2369dd478978e140d
[]
no_license
donhenton/code-attic
e905840a4d53181d8a6d7c8b983c7b2dc553074b
e8588bea7af3d3a168958ae96ea8a476fcb6969f
refs/heads/master
2016-09-05T14:47:39.348847
2015-07-20T17:37:38
2015-07-20T17:37:38
39,396,691
0
0
null
null
null
null
UTF-8
Java
false
false
1,080
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.dhenton9000.jms.transactions; import java.util.ArrayList; import org.mule.api.MuleEventContext; import org.mule.api.lifecycle.Callable; import org.mule.api.transaction.Transaction; import org.apache.log4j.*; /** * * @author dhenton */ public class TransactionErrorTester implements Callable { private static final Logger log = LogManager.getLogger(TransactionErrorTester.class); @Override public Object onCall(MuleEventContext eventContext) throws Exception { String payload = eventContext.getMessage().getPayloadAsString(); if (payload == null) { payload = "NULL"; } Transaction currentTransaction = eventContext.getCurrentTransaction(); payload = payload.trim().toUpperCase(); if (payload.indexOf("BOZO2") > -1) { throw new RuntimeException("you cannot be a BOZO2"); } log.info("transaction testing "+payload); return eventContext.getMessage(); } }
19a326735e193bfe889ad51f18b4d2e1aee2bf5c
cb8c337a790b62905ad3b30f7891a4dff0ae7b6d
/st-ericsson/tools/platform/RefMan/src/com/stericsson/RefMan/UmlExportFilter/Interface.java
1754d7101e728fb5a01fc085553a18bf29a9875f
[]
no_license
CustomROMs/android_vendor
67a2a096bfaa805d47e7d72b0c7a0d7e4830fa31
295e660547846f90ac7ebe42a952e613dbe1b2c3
refs/heads/master
2020-04-27T15:01:52.612258
2019-03-11T13:26:23
2019-03-12T11:23:02
174,429,381
1
0
null
null
null
null
UTF-8
Java
false
false
7,976
java
/** * Copyright ST-Ericsson 2010. All rights reserved. */ package com.stericsson.RefMan.UmlExportFilter; import java.security.InvalidParameterException; import java.util.Collection; import java.util.List; import java.util.Vector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * The <code>Interface</code> represents the the meta-data about an interface, * as exported from the UML model into the UML export XML file. * * @author Fredrik Lundström * */ public class Interface { /** The logger */ final static Logger logger = LoggerFactory.getLogger(Interface.class); /** Will be shown in the Reference Manual. */ private String name; /** Might be shown in the Reference Manual in the future. */ private String classification; /** Might be shown in the Reference Manual in the future. */ private String packageName; /** Stack - category name from UML model. */ private String stack; /** * The platforms using this Interface. */ private Vector<Platform> platforms; /** * The Guid of this Interface. * */ private String guid; /** * Constructor for the <code>Interface</code>. * */ public Interface() { this.guid = ""; this.name = ""; this.packageName = ""; this.platforms = new Vector<Platform>(); this.classification = ""; this.stack = ""; } /** * See return description. * * @return The <code>String</code> that will be shown as the name of the * interface in the Reference Manual . */ public String getName() { return name; } /** * See parameter description. * * @param name * The <code>String</code> that will be shown as the name of the * interface in the Reference Manual */ public void setName(String name) { if (name != null) { this.name = name; } else { throw new InvalidParameterException("name must not be null"); } } /** * See return description. * * @return The <code>String</code> that will be used as the classification * of the interface in the Reference Manual . */ public String getClassification() { return classification; } /** * See parameter description. * * @param classification * Must be one of [Proprietary, Standard, ProprietaryExtension]. */ public void setClassification(String classification) { if (classification != null && (classification.compareTo("Proprietary") == 0 || classification.compareTo("Standard") == 0 || classification .compareTo("ProprietaryExtension") == 0)) { this.classification = classification; } else { throw new InvalidParameterException( "classification must be one of [Proprietary, Standard, ProprietaryExtension]."); } } /** * See return description. * * @return True if the classification of this interface is Proprietary. */ public boolean isProprietary() { return (classification.compareTo("Proprietary") == 0); } /** * See return description. * * @return True if the classification of this interface is Standard. */ public boolean isStandard() { return (classification.compareTo("Standard") == 0); } /** * See return description. * * @return True if the classification of this interface is * ProprietaryExtension. */ public boolean isProprietaryExtension() { return (classification.compareTo("ProprietaryExtension") == 0); } /** * See return description. * * @return The <code>String</code> that will be used as the package name in * the Reference Manual. */ public String getPackage() { return packageName; } /** * See parameter description. * * @param packageName * The <code>String</code> that will be used as the package name * in the Reference Manual. */ public void setPackage(String packageName) { if (packageName != null) { this.packageName = packageName; } else { throw new InvalidParameterException("packageName must not be null"); } } /** * See return description. * * @return The <code>String</code> that will be used as the guid in the * Reference Manual. The guid is the one exported from the UML model * for the interface. */ public String getGuid() { return guid; } /** * See parameter description. * * @param guid * The <code>String</code> that will be used as the guid in the * Reference Manual. The guid is the one exported from the UML * model for the interface. */ public void setGuid(String guid) { if (guid != null) { this.guid = guid; } else { throw new InvalidParameterException("guid must not be null"); } } /** * See return description. * * @return A <code>List</code> containing the <code>Platform</code>'s * implementing this <code>Interface</code>. */ public List<Platform> getPlatforms() { return new Vector<Platform>(platforms); } /** * See parameter description. * * @param platforms * Sets the list of <code>Platform</code>'s implementing this * interface to the ones provided by the <code>Collection</code>. */ public void setPlatforms(Collection<Platform> platforms) { this.platforms = new Vector<Platform>(platforms); } /** * Adds a platform to this <code>Interface</code>'s set of platforms * implementing this interface. * * @param platform * <code>Platform</code> to be appended to this * <code>Interface</code>'s set of platforms. * @return {@code true} (as specified by {@link Collection#add}) */ public boolean addPlatform(Platform platform) { return platforms.add(platform); } /** * Adds platforms to the <code>Interface</code>'s set of platforms. * * @param platformset * <code>Platforms</code> to be appended to this * <code>Interface</code>'s set of platforms. * @return {@code true} (as specified by {@link Collection#addAll}) */ public boolean addPlatforms(Collection<Platform> platformset) { return this.platforms.addAll(platformset); } /** * Calculates the hashCode of this <code>Interface</code>. * * @return A hashCode value for this <code>Interface</code>. */ @Override public int hashCode() { return toString().hashCode(); } /** * See return description. * * @return A <code>String</code> containing information about the * <code>Interface</code>. */ @Override public String toString() { return "name: " + name + "; package: " + packageName + "; guid: " + guid + "; classification: " + classification + "platforms: " + platforms.size(); } /** * Returns the category name from the UML model. * * @return stack - category name from UML model. */ public String getStack() { return stack; } /** * Sets the category name from the UML model. * * @param stackName * The category name from the UML model. */ public void setStack(String stackName) { if (stack == null) { stack = ""; } else { stack = stackName; } } }
7abe09d38bd57213d6c3867d3bece6bdf93c8150
241e76b27d1325d0872d0e52b254c24d1aaf145e
/bms-demo-test/src/main/java/com/mouse/bms/demo/test/controller/HelloController.java
4467150261bcd5587ea7e7b8b3e331d90001f633
[ "MIT" ]
permissive
nidichaoge/bms-demo
fe00f97481e7a3ec7814e25a93160b1c8274f022
0c9a478835411e2e747f07b0f5be721195024ec6
refs/heads/master
2022-07-01T01:50:52.885518
2019-10-25T06:07:51
2019-10-25T06:07:51
195,651,006
1
0
MIT
2022-06-17T02:17:16
2019-07-07T12:54:55
Java
UTF-8
Java
false
false
1,431
java
package com.mouse.bms.demo.test.controller; import com.mouse.bms.demo.test.dto.UserDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; /** * @author mouse * @version 1.0 * @date 2019-07-07 15:42 * @description */ @RestController public class HelloController { private static final Logger LOGGER = LoggerFactory.getLogger(HelloController.class); @GetMapping("/hello") public String hello(HttpServletRequest request) { LOGGER.info("hello function,traceId:{},spanId:{}.", request.getHeader("X-B3-TraceId"), request.getHeader("X-B3-SpanId")); return "hello"; } @GetMapping("/get") public UserDTO get(@RequestParam Long id) { LOGGER.info("get function.id:{}.", id); return UserDTO.builder().id(id).name("mouse").age(23).build(); } @PostMapping(value = "/post") public Boolean post(@RequestBody UserDTO userDTO) { LOGGER.info("post function.userDTO:{}", userDTO); return Boolean.TRUE; } @PutMapping("/put") public Long put(@RequestBody UserDTO userDTO) { LOGGER.info("put function.userDTO:{}", userDTO); return userDTO.getId(); } @DeleteMapping("/delete") public Boolean delete(@RequestParam Long id) { LOGGER.info("delete function.id:{}.", id); return Boolean.TRUE; } }
edbafed386c2d5347b3142bf1a4d7a4ed3db6d02
98cac5e0c651efcb24558a6fb39c4df3913a79f1
/ForestRunner/src/com/ebrothers/forestrunner/SplashActivity.java
8ef4fca3372ae0f6eff79a8cecb60b2c50b8bcbb
[]
no_license
evilsquid888/cocos2d
75ef47da1ae3ec96d224eea4d0bee5c4a552310e
6d7ae87428c422b4b7e509ed38cd7f16eb504078
refs/heads/master
2021-05-27T03:49:16.952827
2012-02-01T13:00:45
2012-02-01T13:00:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,213
java
package com.ebrothers.forestrunner; import android.app.Activity; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import com.ebrothers.forestrunner.manager.SoundManager; public class SplashActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splash); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); new BackgroundWorker().execute(); } class BackgroundWorker extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... params) { try { Thread.sleep(2000); } catch (InterruptedException e) { } SoundManager.sharedSoundManager().preload(getApplicationContext()); Intent intent = new Intent(); intent.setClass(getApplicationContext(), ForestRunnerActivity.class); startActivity(intent); return null; } @Override protected void onPostExecute(Void result) { finish(); } } }
[ "fengch2010@437ed80d-4ce1-5219-a541-67be1617dbf0" ]
fengch2010@437ed80d-4ce1-5219-a541-67be1617dbf0
e5f02ac54fa275f02072e7505a7f1c9d29e22c26
46712a562af3878be4478ebf9c46f01defc9637d
/family_service_platform/src/main/java/org/zhen77/bean/TblEmailSend.java
c0da7b0681606da9baadf383ca00a3e6749c4be9
[]
no_license
Zhen7-7/Project
8460ba771be59331b4690d0ad883f44153e7a4a8
3358a4706da6bae447919ed7dd9a13a8c3c4ac10
refs/heads/master
2023-03-06T01:15:54.589286
2021-03-01T15:25:49
2021-03-01T15:25:49
342,460,283
0
0
null
null
null
null
UTF-8
Java
false
false
4,412
java
package org.zhen77.bean; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import java.io.Serializable; /** * <p> * 邮件发送 * </p> * * @author lian * @since 2021-02-26 */ public class TblEmailSend implements Serializable { private static final long serialVersionUID=1L; /** * 邮件id */ @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 接受人群编码 */ private String receivePersonCode; /** * 接受人群名称 */ private String receivePersonName; /** * 邮件标题 */ private String emailTitle; /** * 邮件内容 */ private String emailContent; /** * 重要级别 */ private String importantGrade; /** * 是否草稿 */ private String isDraft; /** * 删除标志 */ private String isDelete; /** * 密送标志 */ private String isSecretSend; /** * 邮件附件 */ private String emailAttach; /** * 发送类型 */ private String sendType; /** * 发送人id */ private String sendPerson; /** * 发送人姓名 */ private String sendName; /** * 发送时间 */ private LocalDateTime sendDate; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getReceivePersonCode() { return receivePersonCode; } public void setReceivePersonCode(String receivePersonCode) { this.receivePersonCode = receivePersonCode; } public String getReceivePersonName() { return receivePersonName; } public void setReceivePersonName(String receivePersonName) { this.receivePersonName = receivePersonName; } public String getEmailTitle() { return emailTitle; } public void setEmailTitle(String emailTitle) { this.emailTitle = emailTitle; } public String getEmailContent() { return emailContent; } public void setEmailContent(String emailContent) { this.emailContent = emailContent; } public String getImportantGrade() { return importantGrade; } public void setImportantGrade(String importantGrade) { this.importantGrade = importantGrade; } public String getIsDraft() { return isDraft; } public void setIsDraft(String isDraft) { this.isDraft = isDraft; } public String getIsDelete() { return isDelete; } public void setIsDelete(String isDelete) { this.isDelete = isDelete; } public String getIsSecretSend() { return isSecretSend; } public void setIsSecretSend(String isSecretSend) { this.isSecretSend = isSecretSend; } public String getEmailAttach() { return emailAttach; } public void setEmailAttach(String emailAttach) { this.emailAttach = emailAttach; } public String getSendType() { return sendType; } public void setSendType(String sendType) { this.sendType = sendType; } public String getSendPerson() { return sendPerson; } public void setSendPerson(String sendPerson) { this.sendPerson = sendPerson; } public String getSendName() { return sendName; } public void setSendName(String sendName) { this.sendName = sendName; } public LocalDateTime getSendDate() { return sendDate; } public void setSendDate(LocalDateTime sendDate) { this.sendDate = sendDate; } @Override public String toString() { return "TblEmailSend{" + "id=" + id + ", receivePersonCode=" + receivePersonCode + ", receivePersonName=" + receivePersonName + ", emailTitle=" + emailTitle + ", emailContent=" + emailContent + ", importantGrade=" + importantGrade + ", isDraft=" + isDraft + ", isDelete=" + isDelete + ", isSecretSend=" + isSecretSend + ", emailAttach=" + emailAttach + ", sendType=" + sendType + ", sendPerson=" + sendPerson + ", sendName=" + sendName + ", sendDate=" + sendDate + "}"; } }
0a0ce4e01be83a3328a1754c7e18bd6ff0f54cee
fab1a43ebd3e7738086bcac3bc6f85229afe2789
/src/main/java/com/jozsefpajor/flaretask/user/controller/graphql/Mutation.java
e89d41ad3807b4a9f7371da805c58c584ce1ec05
[]
no_license
pajafalcon/flaretask
31ebb8b946ee0e6e113f408d23bdf83bfcf9f46d
442df7937899c0be40a51b8f4c7f67c1ece88ccb
refs/heads/master
2020-11-25T01:17:38.137782
2020-03-12T09:44:53
2020-03-12T09:44:53
228,426,728
0
0
null
null
null
null
UTF-8
Java
false
false
244
java
package com.jozsefpajor.flaretask.user.controller.graphql; import com.coxautodev.graphql.tools.GraphQLMutationResolver; import org.springframework.stereotype.Component; @Component public class Mutation implements GraphQLMutationResolver { }
e12077c4d13fdba839dc8822f3d0beed7c705ccd
52190de20d961e54ef659914c5cc69f254994bf4
/src/main/java/com/github/liaochong/myexcel/core/AbstractExcelFactory.java
3b5e99e31d1805f8675b3d745972987ed6d0c049
[ "Apache-2.0" ]
permissive
jeesun/myexcel
3e20b1a80e304110cb0d0ff33a4706c26fff06c2
64cbd7e372a485f5087fce102fe931790e01452e
refs/heads/master
2020-05-31T23:52:43.165696
2019-06-14T08:11:42
2019-06-14T08:11:42
190,546,436
0
0
Apache-2.0
2019-06-14T08:13:05
2019-06-06T08:40:03
Java
UTF-8
Java
false
false
12,859
java
/* * Copyright 2017 the original author or authors. * * 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.github.liaochong.myexcel.core; import com.github.liaochong.myexcel.core.parser.HtmlTableParser; import com.github.liaochong.myexcel.core.parser.Td; import com.github.liaochong.myexcel.core.parser.Tr; import com.github.liaochong.myexcel.core.strategy.AutoWidthStrategy; import com.github.liaochong.myexcel.core.style.BackgroundStyle; import com.github.liaochong.myexcel.core.style.BorderStyle; import com.github.liaochong.myexcel.core.style.CustomColor; import com.github.liaochong.myexcel.core.style.FontStyle; import com.github.liaochong.myexcel.core.style.TdDefaultCellStyle; import com.github.liaochong.myexcel.core.style.TextAlignStyle; import com.github.liaochong.myexcel.core.style.ThDefaultCellStyle; import com.github.liaochong.myexcel.core.style.WordBreakStyle; import com.github.liaochong.myexcel.utils.TdUtil; import lombok.NonNull; import org.apache.poi.hssf.usermodel.HSSFPalette; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.util.Collections; import java.util.EnumMap; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; /** * @author liaochong * @version 1.0 */ public abstract class AbstractExcelFactory implements ExcelFactory { protected Workbook workbook; /** * 每行的单元格最大高度map */ private Map<Integer, Short> maxTdHeightMap = new HashMap<>(); /** * 是否使用默认样式 */ private boolean useDefaultStyle; /** * 自定义颜色 */ private CustomColor customColor; /** * 单元格样式映射 */ private Map<Map<String, String>, CellStyle> cellStyleMap = new HashMap<>(); /** * 样式容器 */ private Map<HtmlTableParser.TableTag, CellStyle> defaultCellStyleMap; /** * 字体map */ private Map<String, Font> fontMap = new HashMap<>(); /** * 冻结区域 */ private FreezePane[] freezePanes; /** * 内存数据保有量 */ private Integer rowAccessWindowSize = SXSSFWorkbook.DEFAULT_WINDOW_SIZE; /** * 自动宽度策略 */ protected AutoWidthStrategy autoWidthStrategy = AutoWidthStrategy.CUSTOM_WIDTH; @Override public ExcelFactory useDefaultStyle() { this.useDefaultStyle = true; return this; } @Override public ExcelFactory freezePanes(FreezePane... freezePanes) { this.freezePanes = freezePanes; return this; } @Override public ExcelFactory rowAccessWindowSize(int rowAccessWindowSize) { if (rowAccessWindowSize <= 0) { return this; } this.rowAccessWindowSize = rowAccessWindowSize; return this; } @Override public ExcelFactory workbookType(WorkbookType workbookType) { switch (workbookType) { case XLS: workbook = new HSSFWorkbook(); break; case XLSX: workbook = new XSSFWorkbook(); break; case SXLSX: workbook = new SXSSFWorkbook(rowAccessWindowSize); break; default: workbook = new XSSFWorkbook(); } return this; } @Override public ExcelFactory autoWidthStrategy(@NonNull AutoWidthStrategy autoWidthStrategy) { this.autoWidthStrategy = autoWidthStrategy; return this; } /** * 创建行-row * * @param tr tr * @param sheet sheet */ protected void createRow(Tr tr, Sheet sheet) { Row row = sheet.getRow(tr.getIndex()); if (Objects.isNull(row)) { row = sheet.createRow(tr.getIndex()); if (!tr.isVisibility()) { row.setZeroHeight(true); } } for (Td td : tr.getTdList()) { this.createCell(td, sheet, row); } // 设置行高,最小12 if (Objects.isNull(maxTdHeightMap.get(row.getRowNum()))) { row.setHeightInPoints(row.getHeightInPoints() + 5); } else { row.setHeightInPoints((short) (maxTdHeightMap.get(row.getRowNum()) + 5)); maxTdHeightMap.remove(row.getRowNum()); } } /** * 创建单元格 * * @param td td * @param sheet sheet * @param currentRow 当前行 */ protected void createCell(Td td, Sheet sheet, Row currentRow) { Cell cell = currentRow.getCell(td.getCol()); if (Objects.isNull(cell)) { cell = currentRow.createCell(td.getCol()); } if (td.isFormula()) { cell.setCellFormula(td.getContent()); } else { String content = td.getContent(); switch (td.getTdContentType()) { case STRING: cell.setCellValue(content); break; case DOUBLE: if (Objects.nonNull(content)) { cell.setCellValue(Double.parseDouble(content)); } break; case BOOLEAN: if (Objects.nonNull(content)) { cell.setCellValue(Boolean.parseBoolean(content)); } break; default: } } // 设置单元格样式 for (int i = td.getRow(), rowBound = td.getRowBound(); i <= rowBound; i++) { Row row = sheet.getRow(i); if (Objects.isNull(row)) { row = sheet.createRow(i); } for (int j = td.getCol(), colBound = td.getColBound(); j <= colBound; j++) { cell = row.getCell(j); if (Objects.isNull(cell)) { cell = row.createCell(j); } this.setCellStyle(row, cell, td); } } if (td.getColSpan() > 0 || td.getRowSpan() > 0) { sheet.addMergedRegion(new CellRangeAddress(td.getRow(), td.getRowBound(), td.getCol(), td.getColBound())); } } /** * 设置单元格样式 * * @param cell 单元格 * @param td td单元格 */ private void setCellStyle(Row row, Cell cell, Td td) { if (useDefaultStyle) { if (td.isTh()) { cell.setCellStyle(defaultCellStyleMap.get(HtmlTableParser.TableTag.th)); } else { cell.setCellStyle(defaultCellStyleMap.get(HtmlTableParser.TableTag.td)); } } else { if (td.getStyle().isEmpty()) { return; } String fs = td.getStyle().get("font-size"); if (Objects.nonNull(fs)) { fs = fs.replaceAll("\\D*", ""); short fontSize = Short.parseShort(fs); if (fontSize > maxTdHeightMap.getOrDefault(row.getRowNum(), FontStyle.DEFAULT_FONT_SIZE)) { maxTdHeightMap.put(row.getRowNum(), fontSize); } } if (cellStyleMap.containsKey(td.getStyle())) { cell.setCellStyle(cellStyleMap.get(td.getStyle())); return; } CellStyle cellStyle = workbook.createCellStyle(); // background-color BackgroundStyle.setBackgroundColor(cellStyle, td.getStyle(), customColor); // text-align TextAlignStyle.setTextAlign(cellStyle, td.getStyle()); // border BorderStyle.setBorder(cellStyle, td.getStyle()); // font FontStyle.setFont(() -> workbook.createFont(), cellStyle, td.getStyle(), fontMap, customColor); // word-break WordBreakStyle.setWordBreak(cellStyle, td.getStyle()); cell.setCellStyle(cellStyle); cellStyleMap.put(td.getStyle(), cellStyle); } } /** * 空工作簿 * * @return Workbook */ protected Workbook emptyWorkbook() { if (Objects.isNull(workbook)) { workbook = new XSSFWorkbook(); } workbook.createSheet(); return workbook; } /** * 初始化默认单元格样式 * * @param workbook workbook */ protected void initCellStyle(Workbook workbook) { if (useDefaultStyle) { defaultCellStyleMap = new EnumMap<>(HtmlTableParser.TableTag.class); defaultCellStyleMap.put(HtmlTableParser.TableTag.th, new ThDefaultCellStyle().supply(workbook)); defaultCellStyleMap.put(HtmlTableParser.TableTag.td, new TdDefaultCellStyle().supply(workbook)); } else { if (workbook instanceof HSSFWorkbook) { HSSFPalette palette = ((HSSFWorkbook) workbook).getCustomPalette(); customColor = new CustomColor(true, palette); } else { customColor = new CustomColor(); } } } /** * 窗口冻结 * * @param tableIndex table index * @param sheet sheet */ protected void freezePane(int tableIndex, Sheet sheet) { if (Objects.nonNull(freezePanes) && freezePanes.length > tableIndex) { FreezePane freezePane = freezePanes[tableIndex]; if (Objects.isNull(freezePane)) { throw new IllegalStateException("FreezePane is null"); } sheet.createFreezePane(freezePane.getColSplit(), freezePane.getRowSplit()); } } /** * 获取每列最大宽度 * * @param trList trList * @return colMaxWidthMap */ protected Map<Integer, Integer> getColMaxWidthMap(List<Tr> trList) { if (AutoWidthStrategy.isNoAuto(autoWidthStrategy) || AutoWidthStrategy.isAutoWidth(autoWidthStrategy)) { return Collections.emptyMap(); } if (useDefaultStyle) { // 使用默认样式,需要重新修正加粗的标题自适应宽度 trList.parallelStream().forEach(tr -> { tr.getTdList().stream().filter(Td::isTh).forEach(th -> { int tdWidth = TdUtil.getStringWidth(th.getContent(), 0.25); tr.getColWidthMap().put(th.getCol(), tdWidth); }); }); } int mapMaxSize = trList.stream().mapToInt(tr -> tr.getColWidthMap().size()).max().orElse(16); Map<Integer, Integer> colMaxWidthMap = new HashMap<>(mapMaxSize); trList.forEach(tr -> { tr.getColWidthMap().forEach((k, v) -> { Integer width = colMaxWidthMap.get(k); if (Objects.isNull(width) || v > width) { colMaxWidthMap.put(k, v); } }); tr.setColWidthMap(null); }); return colMaxWidthMap; } /** * 设置每列宽度 * * @param colMaxWidthMap 列最大宽度Map * @param sheet sheet */ protected void setColWidth(Map<Integer, Integer> colMaxWidthMap, Sheet sheet) { if (AutoWidthStrategy.isNoAuto(autoWidthStrategy)) { return; } if (AutoWidthStrategy.isAutoWidth(autoWidthStrategy)) { if (sheet instanceof SXSSFSheet) { throw new UnsupportedOperationException("SXSSF does not support automatic width at this time"); } for (int i = 0, size = sheet.getLastRowNum(); i < size; i++) { sheet.autoSizeColumn(i); } return; } colMaxWidthMap.forEach((key, value) -> { int contentLength = value << 1; if (contentLength > 255) { contentLength = 255; } sheet.setColumnWidth(key, contentLength << 8); }); } }
e983e0fa0fe488cacf125d342e7e5dbb9eabe7c5
8a175913f2e56565387ff6d8081f71de7f6484f5
/src/main/java/com/shedhack/trace/request/api/interceptor/TraceRequestInterceptor.java
3f496238710d1436906617ba6a285100d9beae13
[]
no_license
imamchishty/trace-request-api
c8df5ca823f0898595f23fd94c5e2bd843c30ae5
3bebedc7f9db670e9be8c438051f6af23e7db7c6
refs/heads/master
2020-12-27T12:04:51.882018
2017-06-19T11:49:23
2017-06-19T11:49:23
55,581,489
2
0
null
null
null
null
UTF-8
Java
false
false
565
java
package com.shedhack.trace.request.api.interceptor; import com.shedhack.trace.request.api.model.RequestModel; /** * <pre> * Interceptor allows custom behaviour. * </pre> * * @author imamchishty */ public interface TraceRequestInterceptor { /** * Method invoked when the request has been made. * @param request trace request model */ void onEntry(RequestModel request); /** * Method invoked when the request has been completed. * @param request trace request model */ void onExit(RequestModel request); }
a5d627bdabbdc102328738318d0183ff1d334046
a08e85337ff7e5d56ea8171dceabd56ade5a80a9
/EasyLogisticsBackend/src/main/java/com/example/easy/logistics/backend/services/implementation/MesaServiceImpl.java
85c1c0a3302ebb19805e9033aa9aeb61cb451d6d
[]
no_license
VictorKengoo/EasyLogistics
e3d0468cd97cc0e64d9925dbadb2d5a51c729d09
80e2c3e0eb374eb6b6d5067ddd2386a78d9b7569
refs/heads/main
2023-06-05T14:52:37.986751
2021-06-26T03:46:21
2021-06-26T03:46:21
309,873,635
1
0
null
null
null
null
UTF-8
Java
false
false
1,009
java
package com.example.easy.logistics.backend.services.implementation; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.example.easy.logistics.backend.models.Mesa; import com.example.easy.logistics.backend.repository.MesaRepository; import com.example.easy.logistics.backend.services.MesaService; @Service public class MesaServiceImpl implements MesaService { @Autowired private MesaRepository mesaRepository; @Override public List<Mesa> listAll() { return this.mesaRepository.findAll(); } @Override public Optional<Mesa> listById(String id) { return this.mesaRepository.findById(id); } @Override public Mesa insert(Mesa mesa) { this.mesaRepository.save(mesa); return null; } @Override public Mesa update(Mesa mesa) { this.mesaRepository.save(mesa); return null; } @Override public void remove(String id) { this.mesaRepository.deleteById(id); } }
3c1aaa15cfece88a8c04125e386ba3fefec036d3
a39d30b4e92022f357cbd6e005bf2c4818d6b040
/src/its/nugrohodimas/models/Location.java
396a8026d54d3903fa5310db5af921acbd7c5c6c
[]
no_license
NugrohoDimas/exam-metrodata
3f62ca5efd8c54d2280d9f6f8df2cc806f5aedcc
5ae696f1a289e449971e3d12b196c38a498855b4
refs/heads/main
2023-07-16T22:01:05.414929
2021-08-30T04:26:17
2021-08-30T04:26:17
400,338,369
0
0
null
null
null
null
UTF-8
Java
false
false
2,109
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 its.nugrohodimas.models; /** * * @author Dony Tri P */ public class Location { private String id; private String streetAddress; private String postalCode; private String city; private String stateProvince; private String countryId; public Location() { } public Location(String id, String streetAddress, String postalCode, String city, String stateProvince, String countryId) { this.id = id; this.streetAddress = streetAddress; this.postalCode = postalCode; this.city = city; this.stateProvince = stateProvince; this.countryId = countryId; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getStreetAddress() { return streetAddress; } public void setStreetAddress(String streetAddress) { this.streetAddress = streetAddress; } public String getPostalCode() { return postalCode; } public void setPostalCode(String postalCode) { this.postalCode = postalCode; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getStateProvince() { return stateProvince; } public void setStateProvince(String stateProvince) { this.stateProvince = stateProvince; } public String getCountryId() { return countryId; } public void setCountryId(String countryId) { this.countryId = countryId; } @Override public String toString() { return "Location{" + "id=" + id + ", streetAddress=" + streetAddress + ", postalCode=" + postalCode + ", city=" + city + ", stateProvince=" + stateProvince + ", countryId=" + countryId + '}'; } }
8e7813678b256cd95907eba72826cbcd3308366c
376ec804244845f52aaf7a0eff2b08de16a49698
/src/main/java/com/wack/model/authorization/Resource.java
d068076ac7d8a2a90dcf752f03edf98a8d5f068e
[]
no_license
ygbekou/wack
caa759bf2c9e826fd5fdf063f97e9ee12cf4bdd0
d0f13e8b3e0128e131c50d107cb4eea78fc74c06
refs/heads/master
2023-04-26T14:33:47.728273
2022-05-31T01:44:27
2022-05-31T01:44:27
167,660,946
0
0
null
2023-04-14T18:08:29
2019-01-26T07:11:59
Java
UTF-8
Java
false
false
1,324
java
package com.wack.model.authorization; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import com.wack.model.BaseEntity; @Entity @Table(name = "RESOURCE") public class Resource extends BaseEntity { @Id @Column(name = "RESOURCE_ID") @GeneratedValue private Long id; private String name; @Column(name = "URL_PATH") private String urlPath; private String description; private int status; public Resource() {} public Resource(Long id, String name, String urlPath) { this.id = id; this.name = name; this.urlPath = urlPath; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getUrlPath() { return urlPath; } public void setUrlPath(String urlPath) { this.urlPath = urlPath; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public String getStatusDesc() { return status == 0 ? "Active" : "Inactive"; } }
380402322a3f3862bde2ee15b40ca945e0926e01
c4f065243646a77eaa0fb443386d716395768c27
/gobang/src/main/java/com/evan/gobang/MainActivity.java
f8eb7a08493215195b1e2abb2607bf44dda32417
[]
no_license
tanxuewen/training
e339bdcdf25fa501b8fd817b54a93db050c171e6
eff76737c0b258c78bd567355b70de2426594a02
refs/heads/master
2021-01-21T14:20:06.648079
2016-10-30T04:40:59
2016-10-30T04:40:59
57,863,864
0
1
null
null
null
null
UTF-8
Java
false
false
1,064
java
package com.evan.gobang; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import com.evan.gobang.widget.GoBangView; public class MainActivity extends AppCompatActivity { GoBangView panel; Button reset_btn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); panel = (GoBangView) findViewById(R.id.wuzi); reset_btn = (Button) findViewById(R.id.reset_btn); reset_btn.setEnabled(false); panel.setListener(new GoBangView.WinListener() { @Override public void onWinListener(boolean whiteWin) { reset_btn.setEnabled(true); } }); reset_btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { panel.start(); reset_btn.setEnabled(false); } }); } }
950f955a73ed6a2599212290966db8b491228bed
19bc8b87141efc0ccf7c86df8908c1cc6dd8c2b4
/OOP3/src/mycls/MyClass.java
26580f07c706a8eeff5f0706df22104c27d4315d
[]
no_license
lovbsd/java
c99cb0d0c422d0b0b966a4392dbc6a552f5bc6ef
caa7d45ccee6489531f33c59fd1d9e55c479fb20
refs/heads/master
2022-11-02T07:00:21.478817
2020-06-19T10:41:05
2020-06-19T10:41:05
267,819,194
0
0
null
null
null
null
UTF-8
Java
false
false
797
java
package mycls; public class MyClass { // class member variable 99% -> private private int number; public String name; // class member method /* // setter public void setNumber(int newNumber) { number = newNumber; } // getter public int getNumber() { return number; } */ // 70% public public void func() { // 처리 this.method(); } public MyClass getThis() { return this; } public int getNumber() { // 매개변수 0번째 존재하고 있는 자기 자신의 참조(주소) return number; } public void setNumber(int number) { this.number = number; } public String getName() { return name; } public void setName(String name) { this.name = name; } public void method() { } }
0f280b34d8ffbabbd7fee671a464dd348ca27dc8
eb96b9189223b8592cf77dd0cb1f5add4f4f0520
/data_structure/src/Top100/No1035.java
573ab4a5f31a077522cd42de26611f6a76beb0d7
[]
no_license
forrest-qiu/leetcode
fb1d72d919830dd512fcf770f583277f7c39ec75
bd14d87e135e7903d6046aad59dc9c7383c615b2
refs/heads/master
2023-07-02T01:10:46.553129
2021-08-10T02:43:10
2021-08-10T02:43:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,790
java
package Top100; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * 在两条独立的水平线上按给定的顺序写下 nums1 和 nums2 中的整数。 * * 现在,可以绘制一些连接两个数字 nums1[i] 和 nums2[j] 的直线,这些直线需要同时满足满足: * *  nums1[i] == nums2[j] * 且绘制的直线不与任何其他连线(非水平线)相交。 * 请注意,连线即使在端点也不能相交:每个数字只能属于一条连线。 * * 以这种方法绘制线条,并返回可以绘制的最大连线数。 * */ public class No1035 { public int maxUncrossedLines(int[] nums1, int[] nums2) { List<int[]> list = new ArrayList<>(); int ans = Integer.MIN_VALUE; int len1 = nums1.length; int len2 = nums2.length; boolean[] f2 = new boolean[len2]; for (int i = 0; i < len1; i++) { Arrays.fill(f2,false); for (int j = i; j < len1; j++) { int index2 = findIndex(nums2,f2,nums1[j]); if(index2>=0&&!hasCross(list,new int[]{j,index2})){ list.add(new int[]{j,index2}); f2[index2] = true; } } ans = Math.max(list.size(),ans); list.clear(); if(len1-i<ans){ break; } } return ans; } //查找目标值 public int findIndex(int[] nums,boolean[] f,int target){ for (int i = 0; i < nums.length; i++) { if(nums[i]==target&&!f[i]){ return i; } } return -1; } //是否有交叉 public boolean hasCross(List<int[]> list,int[] target){ for (int[] ints : list) { if((target[0]-ints[0])*(target[1]-ints[1])<=0){ return true; } } return false; } public int maxUncrossedLines2(int[] nums1, int[] nums2) { int len1 = nums1.length; int len2 = nums2.length; int[][] dp = new int[len1+1][len2+1]; for (int i = 1; i <= len1; i++) { for (int j = 1; j <= len2; j++) { if(nums1[i-1]==nums2[j-1]){ dp[i][j] = dp[i-1][j-1] +1; }else{ dp[i][j] = Math.max(dp[i-1][j],dp[i][j-1]); } } } return dp[len1][len2]; } @Test public void test(){ // int[] nums1 = {2,5,1,2,5}; // int[] nums2 = {10,5,2,1,5,2}; // int[] nums1 = {1,3,7,1,7,5}; // int[] nums2 = {1,9,2,5,1}; int[] nums1 = {2,1}; int[] nums2 = {1,2,1,3,3,2}; System.out.println(maxUncrossedLines2(nums1,nums2)); } }
f8ad99f4739a7bed096bb9c6b74e33c2a35d5dfb
d5d7b3e6fd0f8ae7917501402d488b683169b452
/app/src/main/java/com/example/imageview/MyImageView.java
f2df290871ee8c7ab9ea2891aafc9e643d265578
[]
no_license
Shinjinwoo/ImageView
19e21393e28c6cbbd2ddf112e627e7ac69e71e86
e7ad3b30c368c25ccef499b2406026b06cfbc08d
refs/heads/master
2023-02-24T02:15:01.799904
2021-01-28T08:26:40
2021-01-28T08:26:40
329,566,265
0
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
package com.example.imageview; import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; public class MyImageView extends View { private Drawable image; private ScaleGestureDetector gestureDetector; private float scale = 1.0f; public MyImageView(Context context) { super(context); image = context.getResources().getDrawable(R.drawable.lion, null); setFocusable(true); image.setBounds(0,0,image.getIntrinsicWidth(), image.getIntrinsicHeight()); gestureDetector = new ScaleGestureDetector(context, new ScaleListener()); } @Override protected void onDraw(Canvas canvas){ super.onDraw(canvas); canvas.save(); canvas.scale(scale,scale); image.draw(canvas); canvas.restore(); } @Override public boolean onTouchEvent(MotionEvent event) { gestureDetector.onTouchEvent(event); invalidate(); return true; } private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener{ @Override public boolean onScale(ScaleGestureDetector detector) { scale *= detector.getScaleFactor(); if ( scale < 0.1f ) scale = 0.1f; if (scale > 10.0f) scale = 10.f; invalidate(); return true; } } }
adebe514eee9f539427b3ef3aa180df869052715
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-1.4.0/modules/management/src/main/java/org/mule/management/agents/JmxServerNotificationAgent.java
5a30d42f015afc96d83ed169d48365842da4a363
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
7,035
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the MuleSource MPL * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.management.agents; import org.mule.config.i18n.Message; import org.mule.config.i18n.Messages; import org.mule.impl.internal.admin.AbstractNotificationLoggerAgent; import org.mule.management.support.AutoDiscoveryJmxSupportFactory; import org.mule.management.support.JmxSupport; import org.mule.management.support.JmxSupportFactory; import org.mule.umo.lifecycle.InitialisationException; import org.mule.umo.manager.UMOServerNotification; import java.util.ArrayList; import java.util.List; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; import javax.management.Notification; import javax.management.NotificationBroadcasterSupport; import javax.management.NotificationEmitter; import javax.management.ObjectName; /** * An agent that propergates Mule Server notifications to Jmx. * */ public class JmxServerNotificationAgent extends AbstractNotificationLoggerAgent { public static final String LISTENER_JMX_OBJECT_NAME = "type=org.mule.Notification,name=MuleNotificationListener"; public static final String BROADCASTER_JMX_OBJECT_NAME = "type=org.mule.Notification,name=MuleNotificationBroadcaster"; public static final String DEFAULT_AGENT_NAME = "Jmx Notification Agent"; private MBeanServer mBeanServer; private BroadcastNotificationService broadcastNotificationMbean; private boolean registerListenerMbean = true; private ObjectName listenerObjectName; private ObjectName broadcasterObjectName; private JmxSupportFactory jmxSupportFactory = AutoDiscoveryJmxSupportFactory.getInstance(); private JmxSupport jmxSupport = jmxSupportFactory.getJmxSupport(); public JmxServerNotificationAgent() { // set default name, overridable by config setName(DEFAULT_AGENT_NAME); } /** * {@inheritDoc} */ protected void doInitialise() throws InitialisationException { try { mBeanServer = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0); broadcasterObjectName = jmxSupport.getObjectName(jmxSupport.getDomainName() + ":" + BROADCASTER_JMX_OBJECT_NAME); broadcastNotificationMbean = new BroadcastNotificationService(); mBeanServer.registerMBean(broadcastNotificationMbean, broadcasterObjectName); if (registerListenerMbean) { listenerObjectName = jmxSupport.getObjectName(jmxSupport.getDomainName() + ":" + LISTENER_JMX_OBJECT_NAME); NotificationListener mbean = new NotificationListener(); broadcastNotificationMbean.addNotificationListener(mbean, null, null); mBeanServer.registerMBean(mbean, listenerObjectName); } } catch (Exception e) { throw new InitialisationException(new Message(Messages.FAILED_TO_START_X, "JMX Server Notification Agent"), e, this); } } /** * {@inheritDoc} */ public void dispose() { if (mBeanServer == null) { return; } try { if (listenerObjectName != null) { mBeanServer.unregisterMBean(listenerObjectName); } } catch (Exception e) { logger.warn(e.getMessage(), e); } try { mBeanServer.unregisterMBean(broadcasterObjectName); } catch (Exception e) { logger.warn(e.getMessage(), e); } super.dispose(); } /** * {@inheritDoc} */ protected void logEvent(UMOServerNotification e) { broadcastNotificationMbean.sendNotification(new Notification(e.getClass().getName(), e, e.getTimestamp(), e.toString())); } /** * Should be a 1 line description of the agent. * * @return description */ public String getDescription() { return DEFAULT_AGENT_NAME + (registerListenerMbean ? " (Listener MBean registered)" : ""); } /** * Getter for property 'jmxSupportFactory'. * * @return Value for property 'jmxSupportFactory'. */ public JmxSupportFactory getJmxSupportFactory() { return jmxSupportFactory; } /** * Setter for property 'jmxSupportFactory'. * * @param jmxSupportFactory Value to set for property 'jmxSupportFactory'. */ public void setJmxSupportFactory(JmxSupportFactory jmxSupportFactory) { this.jmxSupportFactory = jmxSupportFactory; } public static interface BroadcastNotificationServiceMBean extends NotificationEmitter { // no methods } public static class BroadcastNotificationService extends NotificationBroadcasterSupport implements BroadcastNotificationServiceMBean { // no methods } public static interface NotificationListenerMBean { /** * Getter for property 'notificsationList'. * * @return Value for property 'notificsationList'. */ List getNotificationsList(); /** * Getter for property 'listSize'. * * @return Value for property 'listSize'. */ int getListSize(); /** * Setter for property 'listSize'. * * @param listSize Value to set for property 'listSize'. */ void setListSize(int listSize); } public static class NotificationListener implements NotificationListenerMBean, javax.management.NotificationListener { private int listSize = 100; private List notifs; /** * {@inheritDoc} */ public void handleNotification(Notification notification, Object o) { if (getList().size() == listSize) { getList().remove(listSize - 1); } getList().add(0, notification); } /** * {@inheritDoc} */ public List getNotificationsList() { return notifs; } /** * {@inheritDoc} */ public int getListSize() { return listSize; } /** * {@inheritDoc} */ public void setListSize(int listSize) { this.listSize = listSize; } /** * Getter for property 'list'. * * @return Value for property 'list'. */ protected List getList() { if (notifs == null) { notifs = new ArrayList(listSize); } return notifs; } } }
[ "dirk.olmes@bf997673-6b11-0410-b953-e057580c5b09" ]
dirk.olmes@bf997673-6b11-0410-b953-e057580c5b09
edcfad655bd7755a30e9da992fe5d581e1279a2a
bd16d0003b8cea2d83f28bdb682a572389f92004
/ch10-prj3-roshambo/src/business/Bart.java
1af48aa048be24269dfcdaa900054f2d3986e385
[]
no_license
bobcatpyrak/java-instruction
d940a926030915278b9189b00540b7de3911acc9
f2f81077f41fdba9349803648ab4eccb062b4e7c
refs/heads/master
2023-01-03T20:57:38.911511
2020-10-31T20:35:39
2020-10-31T20:35:39
298,074,192
0
0
null
null
null
null
UTF-8
Java
false
false
226
java
package business; public class Bart extends Player { public Bart() { super(); this.setName("Bart"); this.setRos(Roshambo.ROCK); ; } @Override public Roshambo generateRoshambo() { return Roshambo.ROCK; } }
246e27a495e6bcb20e72907dca305c30dd34b681
5db5f486537baa9974a41796016f62698dcba0e9
/Nexon-World GameServer/src/org/dementhium/content/skills/dungeoneering/DungTask.java
f32c610d6bfe76b76acdc50f56ec187a62e8133b
[]
no_license
mitch112/SmexyServer
215201921a6ac7aa4f171222c3875129b37a03fe
930b01f48af02ebb2060296f738d1780df264887
refs/heads/master
2021-01-15T23:07:48.596419
2012-12-10T19:41:20
2012-12-10T19:41:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,547
java
/*package org.dementhium.content.skills.dungtask; import org.dementhium.model.player.Player; import org.dementhium.model.player.Skills; import org.dementhium.util.Misc; /** * @author Wolfey * @author Mystic Flow */ /*public class DungTask { public enum Master { VANNAKA(1597, new Object[][]{ {"Bat", 1, 25, 50, 8.0}, {"Goblin", 1, 10, 45, 10.0}, {"Crawling Hand", 1, 10, 60, 10.0}, {"Cave crawler", 5, 35, 75, 22.0}, {"Cockatrice", 25, 50, 175, 37.0}, {"Green dragon", 35, 35, 200, 40.0}, {"Cave horror", 58, 50, 135, 55.0}, {"Fire giant", 62, 40, 120, 111.0}, {"Zombie hand", 70, 40, 60, 115.0}, {"Skeletal hand", 60, 50, 100, 90.0}, {"Werewolf", 65, 70, 120, 105.0}, {"Baby red dragon", 50, 60, 120, 50.0}, {"Moss giant", 35, 30, 100, 40.0}, {"Bronze dragon", 50, 30, 70, 125.0}, {"Iron dragon", 65, 30, 70, 173.2}, {"Steel dragon", 79, 30, 70, 220.4}, {"Black dragon", 1, 30, 100, 119.4}, {"Abyssal demon", 85, 60, 130, 150.0}, {"Tzhaar-Ket", 1, 30, 80, 140.0}, {"Tzhaar-Xil", 1, 30, 80, 125.0}, {"Bloodveld", 50, 60, 90, 120.0}, {"Gargoyle", 75, 70, 100, 105.0}, {"Hellhound", 1, 50, 100, 116.0}, {"Aquanite", 79, 50, 90, 125.0}, {"Turoth", 55, 30, 80, 79.0}, {"Kurask", 70, 40, 100, 97.0}, {"Jelly", 52, 30, 80, 75.0}, {"Pyrefiend", 45, 30, 100, 45.0}, {"Basilisk", 40, 50, 90, 75.0} }), KURADAL(9084, new Object[][]{ {"Bloodveld", 50, 60, 90, 120.0}, {"Gargoyle", 75, 70, 100, 105.9}, {"Dark beast", 70, 90, 130, 225.4}, {"Greater demon", 1, 50, 90, 87}, {"Hellhound", 1, 50, 100, 116.0}, {"Aquanites", 78, 50, 90, 125.0}, {"Turoth", 55, 30, 80, 79.0}, {"Kurask", 70, 40, 100, 97.0}, {"Jelly", 52, 30, 80, 75.0}, {"Pyrefiend", 45, 30, 100, 45.0}, {"Abyssal demons", 85, 60, 130, 150.0}, {"Basilisk", 40, 50, 90, 75.0}, {"Desert strykewyrm", 77, 50, 90, 120.0}, {"Jungle strykewyrm", 73, 40, 80, 110.0}, {"Ice strykewyrm", 93, 68, 120, 330.0}, {"Spiritual mage", 83, 60, 100, 88.0}, {"Skeletal wyvern", 72, 40, 80, 210.0} }), DURADEL(8466, new Object[][]{ {"Bloodveld", 50, 60, 90, 120.0}, {"Gargoyle", 75, 70, 100, 105.0}, {"Dark beast", 70, 90, 130, 225.4}, {"Greater demon", 1, 50, 90, 87.0}, {"Hellhound", 1, 50, 100, 116.0}, {"Aquanites", 78, 50, 90, 125.0}, {"Turoth", 55, 30, 80, 79.0}, {"Kurask", 70, 40, 100, 97.0}, {"Jelly", 52, 30, 80, 75.0}, {"Pyrefiend", 45, 30, 100, 45.0}, {"Basilisk", 40, 50, 90, 75.0}, {"Abyssal demons", 85, 60, 130, 150.0} //{"Desert strykewyrm", 77, 50, 90, 120}, //{"Jungle strykewyrm", 73, 40, 80, 110}, //{"Ice strykewyrm", 93, 68, 120, 330}, //{"Spiritual mage", 83, 60, 100, 88}, //{"Skeletal wyvern", 72, 40, 80, 210}, }), SUMONA(7780, new Object[][]{ {"Bat", 1, 25, 50, 8.0}, {"Goblin", 1, 10, 45, 10.0}, {"Crawling Hand", 1, 10, 60, 10.0}, {"Cave crawler", 5, 35, 75, 22.0}, {"Cockatrice", 25, 50, 175, 37.0}, {"Green dragon", 35, 35, 200, 40.0}, {"Cave horror", 58, 50, 135, 55.0}, {"Fire giant", 62, 40, 120, 111.0}, {"Zombie hand", 70, 40, 60, 115.0}, {"Skeletal hand", 60, 50, 100, 90.0}, {"Werewolf", 65, 70, 120, 105.0}, {"Baby red dragon", 50, 60, 120, 50.0}, {"Moss giant", 35, 30, 100, 40.0}, {"Bronze dragon", 50, 30, 70, 125.0}, {"Iron dragon", 65, 30, 70, 173.2}, {"Steel dragon", 79, 30, 70, 220.4}, {"Abyssal demons", 85, 60, 130, 150.0}, {"Nechryael", 80, 60, 120, 105.0}, {"Aberrant spectre", 60, 50, 100, 90.0}, {"Infernal mage", 45, 30, 80, 60.0}, {"Bloodveld", 50, 60, 90, 120.0}, {"Gargoyle", 75, 70, 100, 105.0}, {"Dark beast", 70, 90, 130, 225.4}, {"Greater demon", 1, 50, 90, 87.0}, {"Hellhound", 1, 50, 100, 116.0}, {"Aquanites", 78, 50, 90, 125.0}, {"Turoth", 55, 30, 80, 79.0}, {"Kurask", 70, 40, 100, 97.0}, {"Jelly", 52, 30, 80, 75.0}, {"Pyrefiend", 45, 30, 100, 45.0}, {"Basilisk", 40, 50, 90, 75.0} //{"Desert strykewyrm", 77, 50, 90, 120}, //{"Jungle strykewyrm", 73, 40, 80, 110}, //{"Ice strykewyrm", 93, 68, 120, 330}, //{"Spiritual mage", 83, 60, 100, 88}, //{"Skeletal wyvern", 72, 40, 80, 210}, }); private int id; private Object[][] data; private Master(int id, Object[][] data) { this.id = id; this.data = data; } public static Master forId(int id) { for (Master master : Master.values()) { if (master.id == id) { return master; } } return null; } public int getId() { return id; } } private Master master; /* private int taskId; private int taskAmount; public SlayerTask(Master master, int taskId, int taskAmount) { this.master = master; this.taskId = taskId; this.taskAmount = taskAmount; } public String getName() { return (String) master.data[taskId][0]; } public static SlayerTask random(Player player, Master master) { SlayerTask task = null; while (true) { int random = player.getRandom().nextInt(master.data.length); int requiredLevel = (Integer) master.data[random][1]; if (player.getSkills().getLevel(Skills.SLAYER) < requiredLevel) { continue; } if (random == 0 && !player.getRandom().nextBoolean()) { continue; } int minimum = (Integer) master.data[random][2]; int maximum = (Integer) master.data[random][3]; task = new SlayerTask(master, random, Misc.random(minimum, maximum)); break; } return task; } public int getTaskId() { return taskId; } public int getTaskAmount() { return taskAmount; } public void decreaseAmount() { taskAmount--; } public double getXPAmount() { return Double.parseDouble(master.data[taskId][4].toString()); } public Master getMaster() { return master; } } */
57c850483044e9bca6cfa9506350bfe31685a90f
18fe549009388b657aee88c5692219fac66ba850
/src/Day6/Student.java
da0590c9d12d1c019b590c365f41741d7d1cc9ff
[]
no_license
vkongovi/learnAutomation_Nov19
e42dbc61e7644d80556072f3d6a4d9164fc74d8c
7812de9fd42861c9b1d1dbb9563aed8192e31909
refs/heads/master
2020-09-13T01:16:16.896332
2020-01-26T21:51:58
2020-01-26T21:51:58
222,617,956
0
0
null
null
null
null
UTF-8
Java
false
false
717
java
package Day6; public class Student implements Comparable<Student> { String name; int roll_no; Student(String name,int num){ this.name=name; this.roll_no=num; } @Override public int compareTo(Student student) { //returns 0 means both are equal // -ve means this is bigger //+ve means input/argument passed is bigger // return this.roll_no - student.roll_no; sorts in asencding order of roll number // return student.roll_no - this.roll_no; --sorts in descending order of roll number System.out.println("Comparing "+this.name+" with "+student.name); return this.name.compareTo(student.name); //sorts on names; } }
4eb0a1f9ae3d1ad70d614fa65e376885894297c0
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.minihd.qq/assets/exlibs.2.jar/classes.jar/com/tencent/mobileqq/activity/contact/troop/NotificationAdapter.java
b9a2dd05873e41ddf1953e5db380a094b1ebdd19
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
7,619
java
package com.tencent.mobileqq.activity.contact.troop; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import com.tencent.mobileqq.activity.contact.newfriend.BaseSystemMsgInterface; import com.tencent.mobileqq.app.MessageHandler; import com.tencent.mobileqq.app.QQAppInterface; import com.tencent.mobileqq.app.message.SystemMessageProcessor; import com.tencent.mobileqq.data.MessageRecord; import com.tencent.mobileqq.pb.ByteStringMicro; import com.tencent.mobileqq.pb.PBBytesField; import com.tencent.mobileqq.pb.PBEnumField; import com.tencent.mobileqq.pb.PBUInt32Field; import com.tencent.mobileqq.pb.PBUInt64Field; import com.tencent.mobileqq.systemmsg.MessageForSystemMsg; import com.tencent.mobileqq.widget.ShaderAnimLayout; import com.tencent.mobileqq.widget.SlideDetectListView; import com.tencent.widget.XBaseAdapter; import gje; import java.util.ArrayList; import java.util.List; import tencent.mobileim.structmsg.structmsg.StructMsg; import tencent.mobileim.structmsg.structmsg.SystemMsg; import tencent.mobileim.structmsg.structmsg.SystemMsgActionInfo; public class NotificationAdapter extends XBaseAdapter { public int a; private Context jdField_a_of_type_AndroidContentContext; private LayoutInflater jdField_a_of_type_AndroidViewLayoutInflater; private View.OnClickListener jdField_a_of_type_AndroidViewView$OnClickListener = new gje(this); private BaseSystemMsgInterface jdField_a_of_type_ComTencentMobileqqActivityContactNewfriendBaseSystemMsgInterface; private QQAppInterface jdField_a_of_type_ComTencentMobileqqAppQQAppInterface; public SlideDetectListView a; public List a; private List b = new ArrayList(); public NotificationAdapter(Context paramContext, QQAppInterface paramQQAppInterface, BaseSystemMsgInterface paramBaseSystemMsgInterface, int paramInt, SlideDetectListView paramSlideDetectListView) { this.jdField_a_of_type_JavaUtilList = new ArrayList(); this.jdField_a_of_type_AndroidContentContext = paramContext; this.jdField_a_of_type_AndroidViewLayoutInflater = LayoutInflater.from(paramContext); this.jdField_a_of_type_ComTencentMobileqqAppQQAppInterface = paramQQAppInterface; this.jdField_a_of_type_ComTencentMobileqqActivityContactNewfriendBaseSystemMsgInterface = paramBaseSystemMsgInterface; this.jdField_a_of_type_Int = paramInt; this.jdField_a_of_type_ComTencentMobileqqWidgetSlideDetectListView = paramSlideDetectListView; } private boolean a(structmsg.StructMsg paramStructMsg) { boolean bool = false; if (paramStructMsg != null) { int i = paramStructMsg.msg_type.get(); long l1 = paramStructMsg.msg_seq.get(); long l2 = paramStructMsg.req_uin.get(); int j = paramStructMsg.msg.sub_type.get(); int k = paramStructMsg.msg.src_id.get(); int m = paramStructMsg.msg.sub_src_id.get(); int n = paramStructMsg.msg.group_msg_type.get(); structmsg.SystemMsgActionInfo localSystemMsgActionInfo = new structmsg.SystemMsgActionInfo(); localSystemMsgActionInfo.group_code.set(paramStructMsg.msg.group_code.get()); localSystemMsgActionInfo.sig.set(ByteStringMicro.EMPTY); localSystemMsgActionInfo.type.set(15); this.jdField_a_of_type_ComTencentMobileqqAppQQAppInterface.a().a().b(i, l1, l2, j, k, m, n, (structmsg.SystemMsgActionInfo)localSystemMsgActionInfo.get(), 3); bool = true; } return bool; } public void a() { if (this.b != null) { this.b.clear(); } } public void a(List paramList) { this.b = paramList; } public int getCount() { int i = 0; if (this.b != null) { i = this.b.size(); } return i; } public Object getItem(int paramInt) { if ((this.b == null) || (paramInt > this.b.size())) { return null; } return this.b.get(getCount() - paramInt - 1); } public long getItemId(int paramInt) { return paramInt; } public View getView(int paramInt, View paramView, ViewGroup paramViewGroup) { label190: MessageRecord localMessageRecord; if (paramView == null) { paramView = this.jdField_a_of_type_AndroidViewLayoutInflater.inflate(2130903554, paramViewGroup, false); paramViewGroup = new NotificationAdapter.ViewHolder(); paramViewGroup.jdField_a_of_type_AndroidWidgetRelativeLayout = ((RelativeLayout)paramView.findViewById(2131298757)); paramViewGroup.jdField_a_of_type_AndroidWidgetImageView = ((ImageView)paramView.findViewById(2131298758)); paramViewGroup.jdField_a_of_type_AndroidWidgetLinearLayout = ((LinearLayout)paramView.findViewById(2131298760)); paramViewGroup.jdField_b_of_type_AndroidWidgetImageView = ((ImageView)paramView.findViewById(2131298761)); paramViewGroup.jdField_a_of_type_AndroidWidgetTextView = ((TextView)paramView.findViewById(2131298762)); paramViewGroup.jdField_b_of_type_AndroidWidgetTextView = ((TextView)paramView.findViewById(2131298763)); paramViewGroup.jdField_c_of_type_AndroidWidgetTextView = ((TextView)paramView.findViewById(2131298764)); paramViewGroup.jdField_a_of_type_AndroidWidgetButton = ((Button)paramView.findViewById(2131298759)); paramViewGroup.jdField_a_of_type_ComTencentMobileqqWidgetShaderAnimLayout = ((ShaderAnimLayout)paramView.findViewById(2131298765)); ((Button)paramView.findViewById(2131298766)).setOnClickListener(this.jdField_a_of_type_AndroidViewView$OnClickListener); paramView.setTag(paramViewGroup); paramViewGroup.jdField_b_of_type_Int = paramInt; if (paramInt >= this.jdField_a_of_type_Int) { break label226; } paramView.setBackgroundResource(2130838125); paramViewGroup.jdField_a_of_type_AndroidWidgetRelativeLayout.setBackgroundResource(2130838125); localMessageRecord = (MessageRecord)getItem(paramInt); if ((localMessageRecord != null) && ((localMessageRecord instanceof MessageForSystemMsg))) { break label246; } } for (;;) { return paramView; paramViewGroup = (NotificationAdapter.ViewHolder)paramView.getTag(); break; label226: paramView.setBackgroundResource(2130838123); paramViewGroup.jdField_a_of_type_AndroidWidgetRelativeLayout.setBackgroundResource(2130838123); break label190; label246: paramViewGroup.jdField_a_of_type_TencentMobileimStructmsgStructmsg$StructMsg = ((MessageForSystemMsg)localMessageRecord).getSystemMsg(); paramViewGroup.jdField_c_of_type_Long = localMessageRecord.uniseq; if (localMessageRecord != null) {} for (int i = ((MessageForSystemMsg)localMessageRecord).getSystemMsg().msg_type.get(); i == 2; i = 2) { this.jdField_a_of_type_ComTencentMobileqqActivityContactNewfriendBaseSystemMsgInterface.a(paramViewGroup, paramInt); return paramView; } } } public void notifyDataSetChanged() { super.notifyDataSetChanged(); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.2.jar\classes.jar * Qualified Name: com.tencent.mobileqq.activity.contact.troop.NotificationAdapter * JD-Core Version: 0.7.0.1 */
62de3f87fadec5c1f15c42d5a9f0bf2c5ace72f1
ddc45369f3b5b5db44a0ea3b9d9709352b352537
/7_service/src/main/java/org/formacion/JpaBasicApplication.java
be76505403638c17c1aa401c14e47c87483b7eaa
[]
no_license
ocelot269/Spring
7ca61e5b824122c53ecb1153defc1b326c8545ae
123cbe280e5ec550ffae64440f1a647f86e145a7
refs/heads/master
2020-05-07T14:53:43.508094
2019-05-28T19:25:37
2019-05-28T19:25:37
180,613,048
1
0
null
null
null
null
UTF-8
Java
false
false
358
java
package org.formacion; import java.io.IOException; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class JpaBasicApplication { public static void main(String[] args) throws IOException { SpringApplication.run(JpaBasicApplication.class, args); } }
5aa39c979fda0abe6557f034eefedbd53a605308
90a79c5cd50105d5d0e364de5f342b5658782d37
/app/src/main/java/turma_android/com/br/appbanco/PessoaAdapter.java
404ad39a9232df92e8293abb0da980d576a96f1c
[]
no_license
ThedSantana/AppBanco
0d9360265db303a370d5517d63bf7c1a8aea772d
f2a7e7cffd3bb5b4645f35c5b135472ae496fb5e
refs/heads/master
2021-06-19T23:08:47.128299
2017-07-14T01:10:45
2017-07-14T01:10:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,258
java
package turma_android.com.br.appbanco; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.TextView; import java.util.List; public class PessoaAdapter extends BaseAdapter { private boolean visivelChecks; private List<Pessoa> pessoas; private Context context; public PessoaAdapter(Context context, List<Pessoa> pessoas) { this.context = context; this.pessoas = pessoas; } public List<Pessoa> getPessoas() { return pessoas; } public void setPessoas(List<Pessoa> pessoas) { this.pessoas = pessoas; notifyDataSetChanged(); } @Override public int getCount() { return pessoas.size(); } @Override public Object getItem(int i) { return pessoas.get(i); } @Override public long getItemId(int i) { Pessoa p = pessoas.get(i); return p.get_id(); } @Override public View getView(int i, View view, ViewGroup viewGroup) { Pessoa p = pessoas.get(i); if(view == null) { view = LayoutInflater.from(context).inflate(R.layout.pessoa_item_layout, viewGroup, false); view.setTag(new ViewHolder(view)); } ViewHolder holder = (ViewHolder) view.getTag(); holder.atualizarViews(p); return view; } public int getTotalSelecionados() { int total = 0; for(Pessoa p : pessoas) { if(p.isSelecionado()) { total++; } } return total; } private class ViewHolder { private TextView txtNome; private TextView txtEmail; private CheckBox chkSelecionado; public ViewHolder(View v) { txtNome = (TextView) v.findViewById(R.id.nomePessoa); txtEmail = (TextView) v.findViewById(R.id.emailPessoa); chkSelecionado = (CheckBox) v.findViewById(R.id.checkPessoa); chkSelecionado.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CheckBox c = (CheckBox)v; Pessoa p = (Pessoa)c.getTag(); p.setSelecionado(c.isChecked()); notifyDataSetChanged(); } }); } public void atualizarViews(Pessoa p) { txtNome.setText(p.getNome()); txtEmail.setText(p.getEmail()); chkSelecionado.setChecked(p.isSelecionado()); chkSelecionado.setTag(p); chkSelecionado.setVisibility(visivelChecks ? View.VISIBLE : View.INVISIBLE); } } public void setSelecionado(boolean b) { for(Pessoa p : pessoas) { p.setSelecionado(b); } //Notifica aos observadores deste adaptador que seus dados //foram alterados. O próprio ListView observa este objeto e //deve ser redesenhado notifyDataSetChanged(); } public void setVisivelChecks(boolean visivelChecks) { this.visivelChecks = visivelChecks; } }
4c3daf06dc81c0125118d8aaf260221f620c62b9
66e48eeae09b65f46d8ffc6be68383caaf941fd6
/Manny_Ec/src/main/java/com/zhaoman/manny_ec/sign/SignInDelegate.java
2935500e82ec4285cbfb013cd25a6b16a40e932d
[]
no_license
mannyzhao/FastEc
0943b66e0edade26673696efaac70378eee6c682
04a5e14401abc54cffe5c684750b2ca11178c264
refs/heads/master
2020-04-06T12:43:48.188090
2019-10-11T07:51:16
2019-10-11T07:51:16
157,468,049
0
1
null
null
null
null
UTF-8
Java
false
false
2,882
java
package com.zhaoman.manny_ec.sign; import android.app.Activity; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.TextInputEditText; import android.util.Log; import android.util.Patterns; import android.view.View; import com.zhaoman.manny_core.delegates.MannyDelegate; import com.zhaoman.manny_core.net.RestClient; import com.zhaoman.manny_core.net.callback.ISuccess; import com.zhaoman.manny_core.wechat.MannyWeChat; import com.zhaoman.manny_core.wechat.callbacks.IWXChatSignInCallback; import com.zhaoman.manny_ec.R; import com.zhaoman.manny_ec.R2; import butterknife.BindView; import butterknife.OnClick; /** * Author:zhaoman * Date:2018/11/12 * Description: */ public class SignInDelegate extends MannyDelegate { @BindView(R2.id.edit_sign_in_email) TextInputEditText mEmail = null; @BindView(R2.id.edit_sign_in_password) TextInputEditText mPassword = null; private ISignListener mISignListener=null; @Override public void onAttach(Activity activity) { super.onAttach(activity); if (activity instanceof ISignListener){ mISignListener=(ISignListener) activity; } } @Override public Object setLayout() { return R.layout.delegate_sign_in; } @Override public void onBindView(@Nullable Bundle savedInstanceState, View rootView) { } @OnClick(R2.id.btn_sign_in) void onClickSignIn() { if (checkForm()){ RestClient.builder() .url("http://192.168.3.170:8080/userprofile.json") .success(new ISuccess() { @Override public void onSuccess(String response) { Log.d("TAG",response); SignHandler.onSignIn(response,mISignListener); } }).build().post(); } } @OnClick(R2.id.icon_sign_in_wechat) void onClickLink(){ MannyWeChat.getInstance().onSignSuccess(new IWXChatSignInCallback() { @Override public void onSignInSuccess(String userInfo) { } }).signIn(); } private boolean checkForm() { final String email = mEmail.getText().toString(); final String password = mPassword.getText().toString(); boolean isPass = true; if (email.isEmpty() || !Patterns.EMAIL_ADDRESS.matcher(email).matches()) { mEmail.setError("错误的邮箱格式"); isPass = false; } else { mEmail.setError(null); } if (password.isEmpty() || password.length() < 6) { mPassword.setError("请填写至少6位数密码"); isPass = false; } else { mPassword.setError(null); } return isPass; } }
8dff52b85bfe511dc4344746561a7714c81116d2
d5593360df6b7301b1ab1afbf7c0290a4f09eba6
/spring-core/model/src/main/java/ecp/spring/model/FileUpload.java
89898a2b8db0973102d4bea703aacaaea2cfbf43
[]
no_license
ecpadolina/spring-exercise1
81a01e6f40588050b8e0fe3f572f862ec838048a
717bc97c39c47a6fe7bd2eabea0115be01c316ea
refs/heads/master
2021-01-10T12:28:41.794936
2015-12-03T05:51:34
2015-12-03T05:51:34
46,911,755
0
1
null
null
null
null
UTF-8
Java
false
false
294
java
package ecp.spring.model; import org.springframework.web.multipart.MultipartFile; public class FileUpload { private MultipartFile file; public void setFile(MultipartFile file) { this.file = file; } public MultipartFile getFile() { return file; } }
5d9437a36c28018f7dd29516557b329af7538360
f146808b3dc1654f9549940115280ee01a228ea4
/python/src/com/jetbrains/python/PythonUiServiceImpl.java
ecd2a1b0a676d9185822b91414c9239805d33679
[ "Apache-2.0" ]
permissive
bdukes/intellij-community
895968084e87e93cc23acb76fecc67b6f0decce4
158d841d8286c90bf25d2bb548e59f309e257819
refs/heads/master
2022-12-08T17:59:41.874234
2020-08-24T20:33:45
2020-08-24T20:33:45
290,051,087
0
0
Apache-2.0
2020-08-24T22:12:47
2020-08-24T22:12:46
null
UTF-8
Java
false
false
18,040
java
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python; import com.intellij.codeInsight.hint.HintManager; import com.intellij.codeInspection.InspectionProfileEntry; import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ui.ListEditForm; import com.intellij.codeInspection.ui.SingleCheckboxOptionsPanel; import com.intellij.ide.DataManager; import com.intellij.ide.util.EditSourceUtil; import com.intellij.ide.util.ElementsChooser; import com.intellij.lang.injection.InjectedLanguageManager; import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorLocation; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.OpenFileDescriptor; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.*; import com.intellij.openapi.ui.messages.MessagesService; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.util.JDOMExternalizableStringList; import com.intellij.openapi.util.NlsContexts; import com.intellij.openapi.util.NlsContexts.PopupContent; import com.intellij.openapi.util.Pair; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.pom.Navigatable; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.refactoring.rename.RenameProcessor; import com.intellij.ui.OnePixelSplitter; import com.intellij.usages.*; import com.intellij.usages.rules.PsiElementUsage; import com.intellij.util.Consumer; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.CheckBox; import com.jetbrains.python.codeInsight.intentions.PyAnnotateTypesIntention; import com.jetbrains.python.inspections.quickfix.PyChangeSignatureQuickFix; import com.jetbrains.python.inspections.quickfix.PyImplementMethodsQuickFix; import com.jetbrains.python.inspections.quickfix.PyRenameElementQuickFix; import com.jetbrains.python.psi.PyCallExpression; import com.jetbrains.python.psi.PyClass; import com.jetbrains.python.psi.PyFunction; import com.jetbrains.python.psi.impl.PyPsiUtils; import com.jetbrains.python.ui.PyUiUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; public final class PythonUiServiceImpl extends PythonUiService { @Override public void showBalloonInfo(Project project, @PopupContent String message) { PyUiUtil.showBalloon(project, message, MessageType.INFO); } @Override public void showBalloonWarning(Project project, @PopupContent String message) { PyUiUtil.showBalloon(project, message, MessageType.WARNING); } @Override public void showBalloonError(Project project, @PopupContent String message) { PyUiUtil.showBalloon(project, message, MessageType.ERROR); } @Override public FileEditor getSelectedEditor(@NotNull Project project, VirtualFile virtualFile) { return FileEditorManager.getInstance(project).getSelectedEditor(virtualFile); } @Override public Editor openTextEditor(@NotNull Project project, PsiElement anchor) { PsiFile file = InjectedLanguageManager.getInstance(project).getTopLevelFile(anchor); return openTextEditor(project, file.getVirtualFile()); } @Override public Editor openTextEditor(@NotNull Project project, @NotNull VirtualFile virtualFile) { return FileEditorManager.getInstance(project).openTextEditor( new OpenFileDescriptor(project, virtualFile), true); } @Override public Editor openTextEditor(@NotNull Project project, @NotNull VirtualFile virtualFile, int offset) { return FileEditorManager.getInstance(project).openTextEditor( new OpenFileDescriptor(project, virtualFile, offset), true); } @Override public boolean showYesDialog(Project project, String message, String title) { return MessageDialogBuilder.yesNo(title, message).ask(project); } @Override public @Nullable LocalQuickFix createPyRenameElementQuickFix(@NotNull PsiElement element) { return new PyRenameElementQuickFix(element); } //TODO: rewrite in dsl @Override public JComponent createCompatibilityInspectionOptionsPanel(@NotNull List<String> supportedInSettings, JDOMExternalizableStringList ourVersions) { final ElementsChooser<String> chooser = new ElementsChooser<>(true); chooser.setElements(supportedInSettings, false); chooser.markElements(ContainerUtil.filter(ourVersions, supportedInSettings::contains)); chooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<String>() { @Override public void elementMarkChanged(String element, boolean isMarked) { ourVersions.clear(); ourVersions.addAll(chooser.getMarkedElements()); } }); final JPanel versionPanel = new JPanel(new BorderLayout()); JLabel label = new JLabel(PyPsiBundle.message("INSP.compatibility.check.for.compatibility.with.python.versions")); label.setLabelFor(chooser); versionPanel.add(label, BorderLayout.PAGE_START); versionPanel.add(chooser); return versionPanel; } //TODO: find a better place or, even better, port it to analysis module @Override public void runRenameProcessor(Project project, PsiElement element, String newName, boolean searchInComments, boolean searchTextOccurrences) { new RenameProcessor(project, element, newName, searchInComments, searchTextOccurrences).run(); } @Override public LocalQuickFix createPyChangeSignatureQuickFixForMismatchingMethods(PyFunction function, PyFunction method) { return PyChangeSignatureQuickFix.forMismatchingMethods(function, method); } @Override public LocalQuickFix createPyChangeSignatureQuickFixForMismatchedCall(PyCallExpression.@NotNull PyArgumentsMapping mapping) { return PyChangeSignatureQuickFix.forMismatchedCall(mapping); } @Override public LocalQuickFix createPyImplementMethodsQuickFix(PyClass aClass, List<PyFunction> toImplement) { return new PyImplementMethodsQuickFix(aClass, toImplement); } @Override public JComponent createSingleCheckboxOptionsPanel(@NlsContexts.Checkbox String label, InspectionProfileEntry inspection, String property) { return new SingleCheckboxOptionsPanel(label, inspection, property); } @Override public void annotateTypesIntention(Editor editor, PyFunction function) { PyAnnotateTypesIntention.annotateTypes(editor, function); } @Override @NotNull public JComponent createEncodingsOptionsPanel(String[] possibleEncodings, final String defaultEncoding, String[] possibleFormats, final int formatIndex, Consumer<String> encodingChanged, Consumer<Integer> formatIndexChanged) { final JComboBox defaultEncodingCombo = new ComboBox(possibleEncodings); defaultEncodingCombo.setSelectedItem(defaultEncoding); defaultEncodingCombo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); encodingChanged.consume((String)cb.getSelectedItem()); } }); final ComboBox encodingFormatCombo = new ComboBox(possibleFormats); encodingFormatCombo.setSelectedIndex(formatIndex); encodingFormatCombo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); formatIndexChanged.consume(cb.getSelectedIndex()); } }); return createEncodingOptionsPanel(defaultEncodingCombo, encodingFormatCombo); } public static JComponent createEncodingOptionsPanel(JComboBox defaultEncoding, JComboBox encodingFormat) { final JPanel optionsPanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.anchor = GridBagConstraints.NORTH; c.gridx = 0; c.gridy = 0; final JLabel encodingLabel = new JLabel(PyBundle.message("code.insight.select.default.encoding")); final JPanel encodingPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); encodingPanel.add(encodingLabel); optionsPanel.add(encodingPanel, c); c.gridx = 1; c.gridy = 0; optionsPanel.add(defaultEncoding, c); c.gridx = 0; c.gridy = 1; c.weighty = 1; final JLabel formatLabel = new JLabel(PyBundle.message("code.insight.encoding.comment.format")); final JPanel formatPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); formatPanel.add(formatLabel); optionsPanel.add(formatPanel, c); c.gridx = 1; c.gridy = 1; optionsPanel.add(encodingFormat, c); return optionsPanel; } @Override public JCheckBox createInspectionCheckBox(@NlsContexts.Checkbox String message, InspectionProfileEntry inspection, String property) { return new CheckBox(message, inspection, property); } @Override public <E> JComboBox<E> createComboBox(E[] items) { return new ComboBox<E>(items); } @Override public <E> JComboBox<E> createComboBox(E[] items, int width) { return new ComboBox<E>(items, width); } @Override public JComponent createListEditForm(@NlsContexts.ColumnName String title, List<String> stringList) { final ListEditForm form = new ListEditForm(title, stringList); return form.getContentPanel(); } @Override @NotNull public JComponent createComboBoxWithLabel(@NotNull String label, String[] items, final String selectedItem, Consumer<Object> selectedItemChanged) { ComboBox comboBox = new ComboBox<>(items); comboBox.setSelectedItem(selectedItem); comboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox)e.getSource(); selectedItemChanged.consume(cb.getSelectedItem()); } }); JPanel option = new JPanel(new BorderLayout()); option.add(new JLabel(label), BorderLayout.WEST); option.add(comboBox, BorderLayout.EAST); final JPanel root = new JPanel(new BorderLayout()); root.add(option, BorderLayout.PAGE_START); return root; } @Override public JComponent onePixelSplitter(boolean vertical, JComponent first, JComponent second) { final OnePixelSplitter splitter = new OnePixelSplitter(vertical); splitter.setFirstComponent(first); splitter.setSecondComponent(second); return splitter; } @Override public void showPopup(Project project, List<String> items, String title, Consumer<String> callback) { DataManager.getInstance().getDataContextFromFocus().doWhenDone((Consumer<DataContext>)dataContext -> JBPopupFactory.getInstance().createPopupChooserBuilder(items) .setTitle(title) .setItemChosenCallback(callback) .setNamerForFiltering(o -> o) .createPopup() .showInBestPositionFor(dataContext)); } /** * Shows a panel with name redefinition conflicts, if needed. * * @param project * @param conflicts what {@link #findDefinitions} would return * @param obscured name or its topmost qualifier that is obscured, used at top of pane. * @param name full name (maybe qualified) to show as obscured and display as qualifier in "would be" chunks. * @return true iff conflicts is not empty and the panel is shown. */ @Override public boolean showConflicts(Project project, List<? extends Pair<PsiElement, PsiElement>> conflicts, String obscured, @Nullable String name) { if (conflicts.size() > 0) { Usage[] usages = new Usage[conflicts.size()]; int i = 0; for (Pair<PsiElement, PsiElement> pair : conflicts) { usages[i] = new NameUsage(pair.getFirst(), pair.getSecond(), name != null ? name : obscured, name != null); i += 1; } UsageViewPresentation prsnt = new UsageViewPresentation(); prsnt.setTabText(PyBundle.message("CONFLICT.name.$0.obscured", obscured)); prsnt.setCodeUsagesString(PyBundle.message("CONFLICT.name.$0.obscured.cannot.convert", obscured)); prsnt.setUsagesWord(PyBundle.message("CONFLICT.occurrence.sing")); prsnt.setUsagesString(PyBundle.message("CONFLICT.occurrence.pl")); UsageViewManager.getInstance(project).showUsages(UsageTarget.EMPTY_ARRAY, usages, prsnt); return true; } return false; } /** * Simplistic usage object for demonstration of name clashes, etc. * User: dcheryasov */ public static class NameUsage implements PsiElementUsage { private final PsiElement myElement; private final PsiElement myCulprit; private static final TextAttributes SLANTED; private final String myName; private final boolean myIsPrefix; static { SLANTED = TextAttributes.ERASE_MARKER.clone(); SLANTED.setFontType(Font.ITALIC); } /** * Creates a conflict search panel usage. * * @param element where conflict happens. * @param culprit where name is redefined; usages with the same culprit are grouped. * @param name redefinition of it is what the conflict is about. * @param prefix if true, show name as a prefix to element's name in "would be" part. */ public NameUsage(PsiElement element, PsiElement culprit, String name, boolean prefix) { myElement = element; myCulprit = culprit; myName = name; myIsPrefix = prefix; } @Override public FileEditorLocation getLocation() { return null; } @Override @NotNull public UsagePresentation getPresentation() { return new UsagePresentation() { @Override @Nullable public Icon getIcon() { PyPsiUtils.assertValid(myElement); return myElement.isValid() ? myElement.getIcon(0) : null; } @Override public TextChunk @NotNull [] getText() { PyPsiUtils.assertValid(myElement); if (myElement.isValid()) { PsiFile file = myElement.getContainingFile(); String line_id = "..."; final Document document = file.getViewProvider().getDocument(); if (document != null) { line_id = String.valueOf(document.getLineNumber(myElement.getTextOffset())); } TextChunk[] chunks = new TextChunk[3]; chunks[0] = new TextChunk(SLANTED, "(" + line_id + ") "); chunks[1] = new TextChunk(TextAttributes.ERASE_MARKER, myElement.getText()); StringBuilder sb = new StringBuilder(" would become ").append(myName); if (myIsPrefix) sb.append(".").append(myElement.getText()); chunks[2] = new TextChunk(SLANTED, sb.toString()); return chunks; } else { return new TextChunk[]{new TextChunk(SLANTED, "?")}; } } @Override @NotNull public String getPlainText() { return myElement.getText(); } @Override public String getTooltipText() { return myElement.getText(); } }; } @Override public boolean isValid() { return true; } @Override public boolean isReadOnly() { return false; } @Override public void selectInEditor() { } @Override public void highlightInEditor() { } @Override public void navigate(boolean requestFocus) { Navigatable descr = EditSourceUtil.getDescriptor(myElement); if (descr != null) descr.navigate(requestFocus); } @Override public boolean canNavigate() { return EditSourceUtil.canNavigate(myElement); } @Override public boolean canNavigateToSource() { return false; } @Override public PsiElement getElement() { return myCulprit; } @Override public boolean isNonCodeUsage() { return false; } } @Override public @Nullable String showInputDialog(@Nullable Project project, @NlsContexts.DialogMessage String message, @NlsContexts.DialogTitle String title, @Nullable String initialValue, @Nullable InputValidator validator) { return Messages.showInputDialog(project, message, title, Messages.getQuestionIcon(), "", validator); } @Override public void showErrorHint(Editor editor, String message) { HintManager.getInstance().showErrorHint(editor, message); } @Override public int showChooseDialog(@Nullable Project project, @Nullable Component parentComponent, String message, String title, String[] values, String initialValue, @Nullable Icon icon) { return MessagesService.getInstance().showChooseDialog(project, parentComponent, message, title, values, initialValue, icon); } }
a57fb1510d21440b5315b022e567831f266df377
eacfc7cf6b777649e8e017bf2805f6099cb9385d
/APK Source/src/com/adobe/flashruntime/shared/VideoView.java
8bdcd293581878c7084840e9084fccbdbfbaed25
[]
no_license
maartenpeels/WordonHD
8b171cfd085e1f23150162ea26ed6967945005e2
4d316eb33bc1286c4b8813c4afd478820040bf05
refs/heads/master
2021-03-27T16:51:40.569392
2017-06-12T13:32:51
2017-06-12T13:32:51
44,254,944
0
0
null
null
null
null
UTF-8
Java
false
false
4,217
java
// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.adobe.flashruntime.shared; import android.content.Context; import android.os.Handler; import android.util.Log; import android.view.Surface; import android.view.SurfaceHolder; import android.view.SurfaceView; public class VideoView extends SurfaceView { private static final String TAG = "VideoSurfaceView"; private boolean mAmCreated; private long mCPPInstance; private Context mContext; private boolean mPlanePositionSet; private Surface mSurface; private int mXmax; private int mXmin; private int mYmax; private int mYmin; public VideoView(Context context) { super(context); mXmin = 0; mYmin = 0; mXmax = 16; mYmax = 16; mAmCreated = false; mPlanePositionSet = false; mSurface = null; mContext = context; setLayoutParams(new android.view.ViewGroup.LayoutParams(-2, -2)); if (useOverlay()) { getHolder().setFormat(0x32315659); } getHolder().addCallback(new android.view.SurfaceHolder.Callback() { final VideoView this$0; public void surfaceChanged(SurfaceHolder surfaceholder, int i, int j, int k) { Log.v("VideoSurfaceView", (new StringBuilder()).append("surfaceChanged format=").append(i).append(", width=").append(j).append(", height=").append(k).toString()); if (useOverlay() && mPlanePositionSet && (j != mXmax - mXmin || k != mYmax - mYmin)) { setPlanePosition(mXmin, mYmin, mXmax, mYmax); } } public void surfaceCreated(SurfaceHolder surfaceholder) { Log.v("VideoSurfaceView", "surfaceCreated"); mSurface = surfaceholder.getSurface(); mAmCreated = true; notifyNativeReadyForVideo(); } public void surfaceDestroyed(SurfaceHolder surfaceholder) { Log.v("VideoSurfaceView", "surfaceDestroyed"); mSurface.release(); mAmCreated = false; notifyNativeReadyForVideo(); } { this$0 = VideoView.this; super(); } }); } private native void nativeSetJavaViewReady(long l, boolean flag); public void VideoPlaybackRestarted() { } public long getFPInstance() { return mCPPInstance; } public Surface getSurface() { if (mAmCreated && useOverlay()) { return mSurface; } else { return null; } } public void notifyNativeReadyForVideo() { if (mCPPInstance != 0L) { nativeSetJavaViewReady(mCPPInstance, mAmCreated); } } public void setFPInstance(long l) { Log.d("VideoSurfaceView", (new StringBuilder()).append("Changing FP Instance from ").append(mCPPInstance).append(" to ").append(l).toString()); mCPPInstance = l; notifyNativeReadyForVideo(); } public void setPlanePosition(int i, int j, int k, int l) { mXmin = i; mYmin = j; mXmax = k; mYmax = l; mPlanePositionSet = true; getHandler().post(new Runnable() { final VideoView this$0; public void run() { layout(mXmin, mYmin, mXmax, mYmax); } { this$0 = VideoView.this; super(); } }); } protected boolean useOverlay() { return android.os.Build.VERSION.SDK_INT >= 14; } /* static Surface access$502(VideoView videoview, Surface surface) { videoview.mSurface = surface; return surface; } */ /* static boolean access$602(VideoView videoview, boolean flag) { videoview.mAmCreated = flag; return flag; } */ }
295318270503640448fbe46a83e3ac790f8e5148
2c163a81e601426da917b70764b76a90a681f054
/ecom-model/src/main/java/com/dowhile/InventoryHealthCheckReport.java
80cf5fe693040cb959f3f1b9c06b525d56b49f50
[]
no_license
yameenbashir/svapple
a3f864e917d41394a5915fd076de8e31b453ae98
dff4860db85eb8103683a49da591308b8afd6316
refs/heads/master
2022-12-27T07:41:51.454969
2021-04-28T07:43:51
2021-04-28T07:43:51
205,891,660
0
0
null
2022-12-16T02:42:20
2019-09-02T16:01:44
JavaScript
UTF-8
Java
false
false
4,750
java
package com.dowhile; import java.math.BigDecimal; import java.math.BigInteger; public class InventoryHealthCheckReport { private String PRODUCT_NAME; private String VARIANT_ATTRIBUTE_NAME; private String OUTLET_NAME; private String SKU; private String SUPPLIER; private String PRODUCT_TYPE_NAME; private BigInteger AUDIT_QUANTITY; private BigDecimal STOCK_TRANSFERRED; private BigDecimal STOCK_RETURN_TO_WAREHOUSE; private BigDecimal SALE; private BigDecimal SALE_RETURN; private BigDecimal EXPECTED_CURRENT_INVENTORY; private BigInteger SYSTEM_CURRENT_INVENTORY; private BigDecimal CONFLICTED_QUANTITY; public InventoryHealthCheckReport() { } /** * @return the vARIANT_ATTRIBUTE_NAME */ public String getVARIANT_ATTRIBUTE_NAME() { return VARIANT_ATTRIBUTE_NAME; } /** * @param vARIANT_ATTRIBUTE_NAME the vARIANT_ATTRIBUTE_NAME to set */ public void setVARIANT_ATTRIBUTE_NAME(String vARIANT_ATTRIBUTE_NAME) { VARIANT_ATTRIBUTE_NAME = vARIANT_ATTRIBUTE_NAME; } /** * @return the oUTLET_NAME */ public String getOUTLET_NAME() { return OUTLET_NAME; } /** * @param oUTLET_NAME the oUTLET_NAME to set */ public void setOUTLET_NAME(String oUTLET_NAME) { OUTLET_NAME = oUTLET_NAME; } /** * @return the pRODUCT_NAME */ public String getPRODUCT_NAME() { return PRODUCT_NAME; } /** * @param pRODUCT_NAME the pRODUCT_NAME to set */ public void setPRODUCT_NAME(String pRODUCT_NAME) { PRODUCT_NAME = pRODUCT_NAME; } /** * @return the sKU */ public String getSKU() { return SKU; } /** * @param sKU the sKU to set */ public void setSKU(String sKU) { SKU = sKU; } /** * @return the sUPPLIER */ public String getSUPPLIER() { return SUPPLIER; } /** * @param sUPPLIER the sUPPLIER to set */ public void setSUPPLIER(String sUPPLIER) { SUPPLIER = sUPPLIER; } /** * @return the pRODUCT_TYPE_NAME */ public String getPRODUCT_TYPE_NAME() { return PRODUCT_TYPE_NAME; } /** * @param pRODUCT_TYPE_NAME the pRODUCT_TYPE_NAME to set */ public void setPRODUCT_TYPE_NAME(String pRODUCT_TYPE_NAME) { PRODUCT_TYPE_NAME = pRODUCT_TYPE_NAME; } /** * @return the aUDIT_QUANTITY */ public BigInteger getAUDIT_QUANTITY() { return AUDIT_QUANTITY; } /** * @param aUDIT_QUANTITY the aUDIT_QUANTITY to set */ public void setAUDIT_QUANTITY(BigInteger aUDIT_QUANTITY) { AUDIT_QUANTITY = aUDIT_QUANTITY; } /** * @return the sTOCK_RETURN_TO_WAREHOUSE */ public BigDecimal getSTOCK_RETURN_TO_WAREHOUSE() { return STOCK_RETURN_TO_WAREHOUSE; } /** * @param sTOCK_RETURN_TO_WAREHOUSE the sTOCK_RETURN_TO_WAREHOUSE to set */ public void setSTOCK_RETURN_TO_WAREHOUSE(BigDecimal sTOCK_RETURN_TO_WAREHOUSE) { STOCK_RETURN_TO_WAREHOUSE = sTOCK_RETURN_TO_WAREHOUSE; } /** * @return the sALE */ public BigDecimal getSALE() { return SALE; } /** * @param sALE the sALE to set */ public void setSALE(BigDecimal sALE) { SALE = sALE; } /** * @return the sALE_RETURN */ public BigDecimal getSALE_RETURN() { return SALE_RETURN; } /** * @param sALE_RETURN the sALE_RETURN to set */ public void setSALE_RETURN(BigDecimal sALE_RETURN) { SALE_RETURN = sALE_RETURN; } /** * @return the eXPECTED_CURRENT_INVENTORY */ public BigDecimal getEXPECTED_CURRENT_INVENTORY() { return EXPECTED_CURRENT_INVENTORY; } /** * @param eXPECTED_CURRENT_INVENTORY the eXPECTED_CURRENT_INVENTORY to set */ public void setEXPECTED_CURRENT_INVENTORY(BigDecimal eXPECTED_CURRENT_INVENTORY) { EXPECTED_CURRENT_INVENTORY = eXPECTED_CURRENT_INVENTORY; } /** * @return the sYSTEM_CURRENT_INVENTORY */ public BigInteger getSYSTEM_CURRENT_INVENTORY() { return SYSTEM_CURRENT_INVENTORY; } /** * @param sYSTEM_CURRENT_INVENTORY the sYSTEM_CURRENT_INVENTORY to set */ public void setSYSTEM_CURRENT_INVENTORY(BigInteger sYSTEM_CURRENT_INVENTORY) { SYSTEM_CURRENT_INVENTORY = sYSTEM_CURRENT_INVENTORY; } /** * @return the cONFLICTED_QUANTITY */ public BigDecimal getCONFLICTED_QUANTITY() { return CONFLICTED_QUANTITY; } /** * @param cONFLICTED_QUANTITY the cONFLICTED_QUANTITY to set */ public void setCONFLICTED_QUANTITY(BigDecimal cONFLICTED_QUANTITY) { CONFLICTED_QUANTITY = cONFLICTED_QUANTITY; } /** * @return the sTOCK_TRANSFERRED */ public BigDecimal getSTOCK_TRANSFERRED() { return STOCK_TRANSFERRED; } /** * @param sTOCK_TRANSFERRED the sTOCK_TRANSFERRED to set */ public void setSTOCK_TRANSFERRED(BigDecimal sTOCK_TRANSFERRED) { STOCK_TRANSFERRED = sTOCK_TRANSFERRED; } }
6d7e8efbf23080f54a1c5563c32310786ada48ee
0e448e7e8515270c7c612d3c721955e801686845
/Proximity_Suite_Project/Proximity/src/Proximity_Encryption_Suite/Device_Current.java
33202096a4ecb74c8bb4e4916758726f4b882799
[]
no_license
HopefulSplash/Final-Year-Project-C012952A
0a5f598928124fd1c14504da320cb418123cb8b4
2e9598a597ccda5eeb747872a31e0d76eaef8be5
refs/heads/master
2022-05-05T12:39:25.079833
2022-04-13T19:46:43
2022-04-13T19:46:43
34,008,776
1
0
null
null
null
null
UTF-8
Java
false
false
13,249
java
/** * Defines the package to class belongs to. */ package Proximity_Encryption_Suite; /** * Import all of the necessary libraries. */ import java.awt.Color; import java.awt.Frame; import java.awt.Image; import java.io.IOException; import java.net.URL; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; /** * The Device_Current.Java Class implements an application that allows a users * to view the device they currently have connected to the suite. * * @author Harry Clewlow (C012952A) * @version 1.0 * @since 18-01-2014 */ public class Device_Current extends javax.swing.JDialog { /** * Creates new form Device_Current * * @param parent * @param modal * @param deviceID * @param accountID */ public Device_Current(java.awt.Frame parent, boolean modal, int deviceID, int accountID) { this.getContentPane().setBackground(Color.WHITE); /** * Declares the icons used for the windows icon and the frames icon. */ URL icon16URL = getClass().getResource("/Proximity/graphic_Logos/Logo_Small.png"); URL icon32URL = getClass().getResource("/Proximity/graphic_Logos/Logo_Large.png"); /** * Image list to store the icons in. */ final List<Image> icons = new ArrayList<>(); /** * loads the icons into the image list. */ try { icons.add(ImageIO.read(icon16URL)); } catch (IOException ex) { Logger.getLogger(Suite_Window.class.getName()).log(Level.SEVERE, null, ex); } try { icons.add(ImageIO.read(icon32URL)); } catch (IOException ex) { Logger.getLogger(Suite_Window.class.getName()).log(Level.SEVERE, null, ex); } initComponents(); /** * sets the location of the application to the middle of the screen. */ this.setLocationRelativeTo(this.getParent()); /** * loads the appropriate icons. */ this.setIconImages(icons); //setup variables this.deviceID = deviceID; this.accountID = accountID; //gets the devices details setupDeviceDetails(); } private void setupDeviceDetails() { //define variables String name = null; String address = null; String created = null; /* * declares and new instance of the Suite_Database class and then checks if the * the database exists and if is does not then creates it for the system. */ Suite_Database d = new Suite_Database(); /* * declares the variables for use in connecting and checking the database. */ Connection conn = null; try { // Register JDBC driver Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection(d.getCONNECT_DB_URL(), d.getUSER(), d.getPASS()); String sql = "SELECT device_Name, device_Address, device_Created FROM device_Details WHERE device_Details_ID = ?;"; PreparedStatement pStmt = conn.prepareStatement(sql); pStmt.setInt(1, deviceID); ResultSet rs = pStmt.executeQuery(); while (rs.next()) { name = rs.getString("device_Name"); address = rs.getString("device_Address"); created = rs.getString("device_Created"); } } catch (SQLException | ClassNotFoundException se) { } finally { name_Field.setText(name); address_Field.setText(address); created_Field.setText(created); if (conn != null) { try { conn.close(); } catch (SQLException ex) { } } } } /** * This method is called from within the constructor to initialize the form. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { button_Panel = new javax.swing.JPanel(); cancel_Button = new javax.swing.JButton(); ok_Button = new javax.swing.JButton(); device_Details_Panel = new javax.swing.JPanel(); address_Label = new javax.swing.JLabel(); service_Label = new javax.swing.JLabel(); name_Label = new javax.swing.JLabel(); address_Field = new javax.swing.JTextField(); name_Field = new javax.swing.JTextField(); created_Field = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Proximity Suite | Current Device"); setMaximumSize(null); setMinimumSize(null); setModal(true); setResizable(false); button_Panel.setBackground(new java.awt.Color(255, 255, 255)); cancel_Button.setText("Cancel"); cancel_Button.setFocusPainted(false); cancel_Button.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cancel_ButtonActionPerformed(evt); } }); ok_Button.setText("OK"); ok_Button.setFocusPainted(false); ok_Button.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ok_ButtonActionPerformed(evt); } }); javax.swing.GroupLayout button_PanelLayout = new javax.swing.GroupLayout(button_Panel); button_Panel.setLayout(button_PanelLayout); button_PanelLayout.setHorizontalGroup( button_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, button_PanelLayout.createSequentialGroup() .addContainerGap(320, Short.MAX_VALUE) .addComponent(ok_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(6, 6, 6) .addComponent(cancel_Button, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(6, 6, 6)) ); button_PanelLayout.setVerticalGroup( button_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(button_PanelLayout.createSequentialGroup() .addGroup(button_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cancel_Button) .addComponent(ok_Button)) .addGap(0, 0, Short.MAX_VALUE)) ); device_Details_Panel.setBackground(new java.awt.Color(255, 255, 255)); device_Details_Panel.setBorder(javax.swing.BorderFactory.createTitledBorder("Device Details")); address_Label.setText("Bluetooth Device Address:"); service_Label.setText("Bluetooth Device Created:"); name_Label.setText("Bluetooth Device Name:"); address_Field.setEditable(false); address_Field.setBackground(new java.awt.Color(255, 255, 255)); address_Field.setFocusable(false); name_Field.setEditable(false); name_Field.setBackground(new java.awt.Color(255, 255, 255)); name_Field.setFocusable(false); created_Field.setEditable(false); created_Field.setBackground(new java.awt.Color(255, 255, 255)); created_Field.setFocusable(false); javax.swing.GroupLayout device_Details_PanelLayout = new javax.swing.GroupLayout(device_Details_Panel); device_Details_Panel.setLayout(device_Details_PanelLayout); device_Details_PanelLayout.setHorizontalGroup( device_Details_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(device_Details_PanelLayout.createSequentialGroup() .addGap(6, 6, 6) .addGroup(device_Details_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(address_Label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(service_Label) .addComponent(name_Label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(6, 6, 6) .addGroup(device_Details_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(name_Field, javax.swing.GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE) .addComponent(address_Field) .addComponent(created_Field)) .addGap(6, 6, 6)) ); device_Details_PanelLayout.setVerticalGroup( device_Details_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(device_Details_PanelLayout.createSequentialGroup() .addGap(0, 0, 0) .addGroup(device_Details_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(name_Label) .addComponent(name_Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(6, 6, 6) .addGroup(device_Details_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(address_Label) .addComponent(address_Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(6, 6, 6) .addGroup(device_Details_PanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(service_Label) .addComponent(created_Field, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(6, 6, 6)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(6, 6, 6) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(button_Panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(device_Details_Panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(6, 6, 6)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(6, 6, 6) .addComponent(device_Details_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(button_Panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(6, 6, 6)) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * a method that will close the form * * @param evt */ private void cancel_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancel_ButtonActionPerformed this.dispose(); }//GEN-LAST:event_cancel_ButtonActionPerformed /** * a method that will close the form * * @param evt */ private void ok_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ok_ButtonActionPerformed this.dispose(); }//GEN-LAST:event_ok_ButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField address_Field; private javax.swing.JLabel address_Label; private javax.swing.JPanel button_Panel; private javax.swing.JButton cancel_Button; private javax.swing.JTextField created_Field; private javax.swing.JPanel device_Details_Panel; private javax.swing.JTextField name_Field; private javax.swing.JLabel name_Label; private javax.swing.JButton ok_Button; private javax.swing.JLabel service_Label; // End of variables declaration//GEN-END:variables private final int deviceID; private final int accountID; }
f43189cc9973e2e2928b11cc43f0f5dc439f02f1
3515cffe3efb636e66b8542811c54d410c5224de
/src/main/java/com/milanuo/springboot2mybatisforum/core/PageResult/IndexPageResult.java
11f6d5389c2da41eec5b715db3a0db68fad6ce51
[]
no_license
Zhuuuulin/forum
3ff546067f7716d8bda2792be39a9afa7cbe05aa
1371f7a681c2047da947d6f691fe472a8992649b
refs/heads/master
2020-05-16T16:42:19.444250
2018-08-25T11:59:04
2018-08-25T11:59:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
791
java
package com.milanuo.springboot2mybatisforum.core.PageResult; import com.milanuo.springboot2mybatisforum.module.topic.pojo.Topic; import com.milanuo.springboot2mybatisforum.module.user.pojo.User; import java.io.Serializable; public class IndexPageResult implements Serializable{ private User user; private Topic topic; private Integer replyCount; public Integer getReplyCount() { return replyCount; } public void setReplyCount(Integer replyCount) { this.replyCount = replyCount; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public Topic getTopic() { return topic; } public void setTopic(Topic topic) { this.topic = topic; } }
b0402b65503bb0688f2c6872e5c7e51e6b234585
a5920d18d77e960182fc7a63a08d5840f682e726
/src/main/java/com/pisoms/olimpico/api/resource/CompeticaoResource.java
da8979db3bdba02909c1bcb7fe0aa8ac55f69c0d
[]
no_license
raphaellins/olimpico-api
aae51f679597b33b52180043cf81b1447fcdefcd
359ca530c6f4fb9e1116ca18d19355158bc2be18
refs/heads/master
2021-08-19T19:40:27.279648
2017-11-27T08:33:11
2017-11-27T08:33:11
112,022,043
1
0
null
null
null
null
UTF-8
Java
false
false
2,657
java
package com.pisoms.olimpico.api.resource; import java.util.List; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; import com.pisoms.olimpico.api.event.RecursoCriadoEvent; import com.pisoms.olimpico.api.model.Competicao; import com.pisoms.olimpico.api.service.CompeticaoService; @RestController @RequestMapping("/competicoes") public class CompeticaoResource { @Autowired CompeticaoService competicaoService; @Autowired private ApplicationEventPublisher publisher; @GetMapping public List<Competicao> listar() { return competicaoService.listarTodos(); } @GetMapping("/{codigo}") public ResponseEntity<Competicao> obter(@PathVariable Integer codigo) { Competicao competicao = competicaoService.obter(codigo); return competicao != null ? ResponseEntity.ok(competicao) : ResponseEntity.notFound().build(); } @GetMapping("/modalidade/{codigo}") public List<Competicao> listarPorModalidade(@PathVariable Integer codigo) { return competicaoService.listarPorModalidade(codigo); } @PostMapping @ResponseStatus(HttpStatus.CREATED) public ResponseEntity<Competicao> criar(@Valid @RequestBody Competicao competicao, HttpServletResponse response) { Competicao competicaoSalva = competicaoService.salvar(competicao); publisher.publishEvent(new RecursoCriadoEvent(this, response, competicaoSalva.getId())); return ResponseEntity.status(HttpStatus.CREATED).body(competicaoSalva); } @DeleteMapping("/{codigo}") @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@PathVariable Integer codigo) { competicaoService.delete(codigo); } @PutMapping("/{codigo}") public ResponseEntity<Competicao> atualizar(@PathVariable Integer codigo, @Valid @RequestBody Competicao competicao) { Competicao competicaoAtualizada = competicaoService.atualizar(codigo, competicao); return ResponseEntity.ok(competicaoAtualizada); } }
0ce6323d270664c7b8900001ca7b6c152ba2771b
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
/aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/transform/DescribeTaskSetsResultJsonUnmarshaller.java
e8e4b5570b27ed8b1124eb68583793f998259779
[ "Apache-2.0" ]
permissive
aws/aws-sdk-java
2c6199b12b47345b5d3c50e425dabba56e279190
bab987ab604575f41a76864f755f49386e3264b4
refs/heads/master
2023-08-29T10:49:07.379135
2023-08-28T21:05:55
2023-08-28T21:05:55
574,877
3,695
3,092
Apache-2.0
2023-09-13T23:35:28
2010-03-22T23:34:58
null
UTF-8
Java
false
false
3,181
java
/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.ecs.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.ecs.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * DescribeTaskSetsResult JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DescribeTaskSetsResultJsonUnmarshaller implements Unmarshaller<DescribeTaskSetsResult, JsonUnmarshallerContext> { public DescribeTaskSetsResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeTaskSetsResult describeTaskSetsResult = new DescribeTaskSetsResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return describeTaskSetsResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("taskSets", targetDepth)) { context.nextToken(); describeTaskSetsResult.setTaskSets(new ListUnmarshaller<TaskSet>(TaskSetJsonUnmarshaller.getInstance()) .unmarshall(context)); } if (context.testExpression("failures", targetDepth)) { context.nextToken(); describeTaskSetsResult.setFailures(new ListUnmarshaller<Failure>(FailureJsonUnmarshaller.getInstance()) .unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return describeTaskSetsResult; } private static DescribeTaskSetsResultJsonUnmarshaller instance; public static DescribeTaskSetsResultJsonUnmarshaller getInstance() { if (instance == null) instance = new DescribeTaskSetsResultJsonUnmarshaller(); return instance; } }
[ "" ]
ff112d41bcc174561591c568b1f4c82067662475
b4f3529e762451012383b8679265100d2fe9b199
/src/com/openxc/measurements/ClimateFanSpeed.java
fbf74ecc14f4a9bc5033681163ecc111ed4a61b5
[ "BSD-3-Clause" ]
permissive
jessesanford/nonstandard-android-measurements
458533e888260480a895f8a59d371c9ba332369d
5d95bda0c6c3d94cff8928d547f6c39e96d82f8c
refs/heads/master
2020-12-28T21:40:14.437377
2013-10-14T18:31:36
2013-10-14T18:31:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
832
java
package com.openxc.measurements; import com.openxc.units.Level; import com.openxc.util.Range; /** * The ClimateFanSpeed measurement is for setting the fan speed from 0 - 9 * 0 is min speed * 7 is max speed * 8 is auto * 9 is last user setting * This may be better handled with a State based signal but I wanted * to experiment a bit with this method. */ public class ClimateFanSpeed extends BaseMeasurement<Level> { private final static Range<Level> RANGE = new Range<Level>(new Level(0), new Level(9)); public final static String ID = "climate_fan_speed"; public ClimateFanSpeed(Number value) { super(new Level(value), RANGE); } public ClimateFanSpeed(Level value) { super(value, RANGE); } @Override public String getGenericName() { return ID; } }
3fb61210c2dca732aff9e4adae1969587f5b2444
d2ac2a6ada072d8a064cf8d4bc78033140c25a51
/app/src/main/java/com/able/android/presenter/LoginPresenter.java
c65eb5a96e67e55d2fa750f94ae453d55bdce500
[]
no_license
sengeiou/Android-1
898f519176761a5f55e63b72da3c20c6b1597446
6f6c4592abbe044d725cab5fd7b99ec17c9c6506
refs/heads/master
2020-09-20T18:16:58.657950
2018-03-03T10:48:19
2018-03-03T10:48:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,773
java
package com.able.android.presenter; import com.able.android.bean.response.UserLoginBean; import com.able.android.model.LoginModel; import com.able.android.model.base.AppNetResultCallback; import com.able.android.presenter.base.AppCommonPresenter; import com.able.android.presenter.view.ILoginView; import com.able.rx.bean.LoadingType; import com.able.rx.bean.TipType; import com.able.rx.view.ClickCallback; import com.able.utils.EmptyUtils; /** * Created by haoyaun on 2018/1/26. */ public class LoginPresenter extends AppCommonPresenter<ILoginView> implements AppNetResultCallback<UserLoginBean>, ClickCallback { private LoginModel loginModel; private String username; private String password; public LoginPresenter(ILoginView contentView) { super(contentView); String username = loginModel.getUsername(); String password = loginModel.getPassword(); contentView.setUsername(username); contentView.setPassword(password); } @Override public void onDestroy() { loginModel.onDestroy(); } @Override public String getTag() { return loginModel.getTag(); } @Override public void netPresenterCreated() { loginModel = new LoginModel(this); } @Override public void dismissLoading() { contentView.dismiss(getTag(), LoadingType.CONTENT); } public void login() { username = contentView.getUsername(); password = contentView.getPassword(); String deviceId = contentView.getDeviceId(); if (EmptyUtils.isEmpty(username)) { contentView.showMsg(TipType.INFO, "请输入用户名", null); return; } if (EmptyUtils.isEmpty(password)) { contentView.showMsg(TipType.INFO, "请输入密码", null); return; } contentView.showLoading(getTag(), LoadingType.CONTENT, "正在登录中,请稍候...", null); loginModel.login(username, password); } @Override public void netResultSuccess(UserLoginBean userLoginBean, String msg) { contentView.dismiss(getTag(), LoadingType.CONTENT); loginModel.saveLoginInfo(userLoginBean, username, password); contentView.showMsg(TipType.SUCCESS, "登录成功", null); contentView.loginSuccess(); } @Override public void netResultException(Throwable throwable, String titleMsg, String detailMsg) { dismissLoading(); contentView.showMsg(titleMsg, detailMsg, "重试", this); } @Override public void netResultFail(int code, String msg) { dismissLoading(); contentView.showMsg("登录失败", msg, "重试", this); } @Override public void clickCall() { login(); } }
[ "zJy7758521" ]
zJy7758521
4ee74c7204eb876935e1a97a6fab14743a336054
f786342f7ebcd3ea0d6189ae7100abc1d59050ec
/src/main/java/com/mmall/dao/SysDeptMapper.java
07f283b4018173e8a9d5e07d21f267a0d79c4e26
[]
no_license
MooTool/permission
66d34bb7b3b2f704975c11e03cc9ce95219f6c6b
b43281d2d9433c1ee607a913277d1bfeb2e7bee4
refs/heads/master
2020-05-25T15:34:28.066540
2019-05-22T08:39:04
2019-05-22T08:39:04
187,827,356
0
0
null
null
null
null
UTF-8
Java
false
false
794
java
package com.mmall.dao; import com.mmall.model.SysDept; import org.apache.ibatis.annotations.Param; import java.util.List; public interface SysDeptMapper { int deleteByPrimaryKey(@Param("id") Integer id); int insert(SysDept record); int insertSelective(SysDept record); SysDept selectByPrimaryKey(@Param("id") Integer id); int updateByPrimaryKeySelective(SysDept record); int updateByPrimaryKey(SysDept record); List<SysDept> getAllDept(); List<SysDept> getChildDeptListByLevel(@Param("level") String value); void batchUpdateLevel(@Param("sysDepts") List<SysDept> sysDepts); int countByNameAndParentId(@Param("parentId") Integer parentId,@Param("name") String name,@Param("id") Integer id); int countByParentId(@Param("id") Integer id); }
1b9a3c4551a77d81392a31e6ac98024f12eeb415
96d451663c77440e9d15a8dd75dcde2c1f1e2079
/src/com/thoughwork/Matirx.java
ac2dd99366890cfd74c4903f9d53e3f4e6b53fd9
[]
no_license
luweing/lifeGame
42d97bd6badbbd806502258806f7643b6eb40797
96f575d9f14a6f3b178b3ff2c9559b7e8e2004da
refs/heads/master
2020-03-19T16:02:50.423147
2018-06-10T01:42:32
2018-06-10T01:42:32
136,697,461
0
0
null
null
null
null
UTF-8
Java
false
false
1,215
java
package com.thoughwork; public class Matirx { private int maxRow; private int maxCol; private int[][]matrix; public Matirx(int maxRow,int maxCol) { this.maxRow=maxRow; this.maxCol=maxCol; matrix=new int[maxRow+2][maxCol+2]; for(int row=0;row<=maxRow+1;row++) { for(int col=0;col<=maxCol+1;col++) { matrix[row][col]=0; } } } public void update() { int[][]newMatrix=new int[maxRow+2][maxCol+2]; for(int row=1;row<=maxRow;row++) { for(int col=1;col<=maxCol;col++) { switch(getNeighborCount(row,col)) { case 2: newMatrix[row][col]=matrix[row][col]; break; case 3: newMatrix[row][col]=1; break; default: newMatrix[row][col]=0; } } } for(int row=1;row<=maxRow;row++) { for(int col=1;col<=maxCol;col++) { matrix[row][col]=newMatrix[row][col]; } } } private int getNeighborCount(int row, int col) { // TODO Auto-generated method stub int count=0; for(int i=row-1;i<=row+1;i++) { for(int j=col-1;j<=col+1;j++) { count+=matrix[i][j]; } } return count-matrix[row][col]; } public int[][] getMatrix() { return matrix; } public void setMatrix(int[][] matrix) { this.matrix = matrix; } }
5d624e0fd49f181ab1edaa7c3758dfdc646a5a42
51f7dc0864ca81bfa17882103a591c780a2c0ef6
/src/main/java/sn/cperf/form/SectionForm.java
c893788332676152bad1bc8f9afde8cae432d580
[]
no_license
sallsooto/cpref
d6b24e68e9a5c54c790360922454c0c2da36b61a
e7aa334d293a26222bb894014c3b720a47fb8804
refs/heads/master
2020-07-25T10:22:57.037114
2019-07-26T12:20:57
2019-07-26T12:20:57
208,255,195
0
0
null
null
null
null
UTF-8
Java
false
false
483
java
package sn.cperf.form; import java.util.List; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import sn.cperf.model.Task; import sn.cperf.model.User; @NoArgsConstructor @AllArgsConstructor @Getter @Setter public class SectionForm { private Long id; private String name; private Long processId; private Long groupId; private boolean withGroup = true; private List<User> intervenants; private List<Task> tasks; }
11dfab2cbccef58eb391538d4462c82e0ad7f760
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/openhab--openhab1-addons/b4016ec5658f4921e4326de37bff9f8154a0a5e4/after/MBrickletBarometer.java
1672b4b04b4027f31e8dbae5c01fff6a2ca0518f
[]
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
3,688
java
/** * Copyright (c) 2010-2014, openHAB.org and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.openhab.binding.tinkerforge.internal.model; import com.tinkerforge.BrickletBarometer; import java.math.BigDecimal; import org.openhab.binding.tinkerforge.internal.types.DecimalValue; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>MBricklet Barometer</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link org.openhab.binding.tinkerforge.internal.model.MBrickletBarometer#getDeviceType <em>Device Type</em>}</li> * <li>{@link org.openhab.binding.tinkerforge.internal.model.MBrickletBarometer#getThreshold <em>Threshold</em>}</li> * </ul> * </p> * * @see org.openhab.binding.tinkerforge.internal.model.ModelPackage#getMBrickletBarometer() * @model superTypes="org.openhab.binding.tinkerforge.internal.model.MDevice<org.openhab.binding.tinkerforge.internal.model.MTinkerBrickletBarometer> org.openhab.binding.tinkerforge.internal.model.MSensor<org.openhab.binding.tinkerforge.internal.model.MDecimalValue> org.openhab.binding.tinkerforge.internal.model.MTFConfigConsumer<org.openhab.binding.tinkerforge.internal.model.TFBaseConfiguration> org.openhab.binding.tinkerforge.internal.model.MSubDeviceHolder<org.openhab.binding.tinkerforge.internal.model.MBarometerTemperature> org.openhab.binding.tinkerforge.internal.model.CallbackListener" * @generated */ public interface MBrickletBarometer extends MDevice<BrickletBarometer>, MSensor<DecimalValue>, MTFConfigConsumer<TFBaseConfiguration>, MSubDeviceHolder<MBarometerTemperature>, CallbackListener { /** * Returns the value of the '<em><b>Device Type</b></em>' attribute. * The default value is <code>"bricklet_barometer"</code>. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Device Type</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Device Type</em>' attribute. * @see org.openhab.binding.tinkerforge.internal.model.ModelPackage#getMBrickletBarometer_DeviceType() * @model default="bricklet_barometer" unique="false" changeable="false" * @generated */ String getDeviceType(); /** * Returns the value of the '<em><b>Threshold</b></em>' attribute. * The default value is <code>"0.5"</code>. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Threshold</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Threshold</em>' attribute. * @see #setThreshold(BigDecimal) * @see org.openhab.binding.tinkerforge.internal.model.ModelPackage#getMBrickletBarometer_Threshold() * @model default="0.5" unique="false" * @generated */ BigDecimal getThreshold(); /** * Sets the value of the '{@link org.openhab.binding.tinkerforge.internal.model.MBrickletBarometer#getThreshold <em>Threshold</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Threshold</em>' attribute. * @see #getThreshold() * @generated */ void setThreshold(BigDecimal value); /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @model annotation="http://www.eclipse.org/emf/2002/GenModel body=''" * @generated */ void init(); } // MBrickletBarometer
258a380464528c2ff781563dfba1e2206148730d
70b2024f2b780847f35f77f7493a1589194529ca
/ApProject_Shared/src/main/java/events/commentPage/LoadCommentsEvent.java
6377cd2b0520855a1edb4de2fbf9b4722d19adc6
[]
no_license
mehradABS/ApProject_Spring2021
9388820d10af3ba5e08e216c7a8ff57764f40a6d
14bf33dcbdbd9c2ff3939c9b0bcffb4707f521b5
refs/heads/master
2023-08-07T12:13:59.716564
2021-10-10T17:29:44
2021-10-10T17:29:44
415,522,943
0
0
null
null
null
null
UTF-8
Java
false
false
557
java
package events.commentPage; import events.tweetHistory.TweetHistoryEvent; import events.visitors.EventVisitor; import events.visitors.commentPage.CommentPageEventVisitor; import responses.Response; public class LoadCommentsEvent extends TweetHistoryEvent { @Override public Response visit(EventVisitor eventVisitor) { return ((CommentPageEventVisitor)eventVisitor).loadComments(tweetId, messageType , responseVisitorType); } @Override public String getVisitorType() { return "CommentPageEventVisitor"; } }
0de8544daf5a8f1b6129f544e7fd2fb301cad437
7c32043f7b6bb113e36a1e515937935733bedce7
/StoneDetectorExample.java
9059f7b5127bbe9343a3d276d9f847b457ab9164
[]
no_license
Owais-Ibrahim/FTC-7006
e110eddd75b47d0f9af4fa80d0e087d08f3fb5d3
cfd89cad004cff90819eae6caee5bf84d33123b7
refs/heads/master
2020-09-10T20:48:34.669785
2020-03-28T01:05:15
2020-03-28T01:05:15
221,830,743
1
0
null
null
null
null
UTF-8
Java
false
false
5,586
java
package org.firstinspires.ftc.teamcode.TESTING; import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import org.openftc.easyopencv.OpenCvCamera; import org.openftc.easyopencv.OpenCvCameraRotation; import org.openftc.easyopencv.OpenCvInternalCamera; import java.util.Locale; /* * Thanks to EasyOpenCV for the great API (and most of the example) * * Original Work Copright(c) 2019 OpenFTC Team * Derived Work Copyright(c) 2019 DogeDevs */ @TeleOp(name = "Stone Detector ", group="DogeCV") @Disabled public class StoneDetectorExample extends LinearOpMode { private OpenCvCamera phoneCam; private StoneDetector stoneDetector; @Override public void runOpMode() { int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier("cameraMonitorViewId", "id", hardwareMap.appContext.getPackageName()); phoneCam = new OpenCvInternalCamera(OpenCvInternalCamera.CameraDirection.BACK, cameraMonitorViewId); phoneCam.openCameraDevice(); stoneDetector = new StoneDetector(); phoneCam.setPipeline(stoneDetector); phoneCam.startStreaming(320, 240, OpenCvCameraRotation.UPRIGHT); waitForStart(); while (opModeIsActive()) { /* * Send some stats to the telemetry */ if(stoneDetector.isDetected()){ try { for (int i = 0; i < stoneDetector.foundRectangles().size(); i++) { telemetry.addData("Stone X " + (i + 1), stoneDetector.foundRectangles().get(i).x); telemetry.addData("Stone Y" + (i + 1), stoneDetector.foundRectangles().get(i).y); } }catch (Exception e){ telemetry.addData("Stones", "Not Detected"); } } telemetry.addData("Frame Count", phoneCam.getFrameCount()); telemetry.addData("FPS", String.format(Locale.US, "%.2f", phoneCam.getFps())); telemetry.addData("Total frame time ms", phoneCam.getTotalFrameTimeMs()); telemetry.addData("Pipeline time ms", phoneCam.getPipelineTimeMs()); telemetry.addData("Overhead time ms", phoneCam.getOverheadTimeMs()); telemetry.addData("Theoretical max FPS", phoneCam.getCurrentPipelineMaxFps()); telemetry.update(); /* * NOTE: stopping the stream from the camera early (before the end of the OpMode * when it will be automatically stopped for you) *IS* supported. The "if" statement * below will stop streaming from the camera when the "A" button on gamepad 1 is pressed. */ if(gamepad1.a) { /* * IMPORTANT NOTE: calling stopStreaming() will indeed stop the stream of images * from the camera (and, by extension, stop calling your vision pipeline). HOWEVER, * if the reason you wish to stop the stream early is to switch use of the camera * over to, say, Vuforia or TFOD, you will also need to call closeCameraDevice() * (commented out below), because according to the Android Camera API documentation: * "Your application should only have one Camera object active at a time for * a particular hardware camera." * * NB: calling closeCameraDevice() will internally call stopStreaming() if applicable, * but it doesn't hurt to call it anyway, if for no other reason than clarity. * * NB2: if you are stopping the camera stream to simply save some processing power * (or battery power) for a short while when you do not need your vision pipeline, * it is recommended to NOT call closeCameraDevice() as you will then need to re-open * it the next time you wish to activate your vision pipeline, which can take a bit of * time. Of course, this comment is irrelevant in light of the use case described in * the above "important note". */ phoneCam.stopStreaming(); //webcam.closeCameraDevice(); } /* * The viewport (if one was specified in the constructor) can also be dynamically "paused" * and "resumed". The primary use case of this is to reduce CPU, memory, and power load * when you need your vision pipeline running, but do not require a live preview on the * robot controller screen. For instance, this could be useful if you wish to see the live * camera preview as you are initializing your robot, but you no longer require the live * preview after you have finished your initialization process; pausing the viewport does * not stop running your pipeline. * * The "if" statements below will pause the viewport if the "X" button on gamepad1 is pressed, * and resume the viewport if the "Y" button on gamepad1 is pressed. */ else if(gamepad1.x) { phoneCam.pauseViewport(); } else if(gamepad1.y) { phoneCam.resumeViewport(); } } } }
59ec8f2eab73ed79483b0b13ab475a8cf502b748
aa69de7ceb6991698f2b78d325446ffcee41dfcb
/src/main/java/guru/springframework/recipeapp/controllers/IndexController.java
05875d0b9618e0e83c158d9107d9370cc9d165a7
[]
no_license
abonitatibus3/recipe-app
e16a371b8ef841b1b1ce214168cc48b4fe7ff044
ff576079ce9a600459e517e21224511df53e99d5
refs/heads/master
2023-02-07T23:15:13.528363
2021-01-02T18:53:59
2021-01-02T18:53:59
320,997,322
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
package guru.springframework.recipeapp.controllers; import guru.springframework.recipeapp.services.RecipeService; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class IndexController { private final RecipeService recipeService; public IndexController(RecipeService recipeService) { this.recipeService = recipeService; } @RequestMapping({"/", "", "/index"}) public String getIndexPage(Model model) { model.addAttribute("recipes", recipeService.getRecipes()); return "index"; } }
0d87822c8fbd4e872257d7dbe5532dda28a8642f
0ef07f8060d247dbf32759d984f579c3ed825d46
/TodoApp Backend/src/main/java/com/example/rest/restfulwebservices/jwt/resource/JwtAuthenticationRestController.java
e7ce890a900224134ef415110f2be422734dc170
[]
no_license
nidhalBougatf/Todo-Management-Application
ef19d5d645249f33d0a3fff077ac329cf968d6db
4b333c057f1ab63d532b96b6aefa380b60d44a22
refs/heads/master
2023-01-12T13:17:19.377325
2020-04-06T15:24:37
2020-04-06T15:24:37
253,537,429
0
0
null
2023-01-07T16:50:07
2020-04-06T15:22:28
Java
UTF-8
Java
false
false
3,819
java
package com.example.rest.restfulwebservices.jwt.resource; import java.util.Objects; import javax.servlet.http.HttpServletRequest; import com.example.rest.restfulwebservices.jwt.JwtTokenUtil; import com.example.rest.restfulwebservices.jwt.JwtUserDetails; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.DisabledException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController @CrossOrigin(origins = "http://localhost:4200") public class JwtAuthenticationRestController { @Value("${jwt.http.request.header}") private String tokenHeader; @Autowired private AuthenticationManager authenticationManager; @Autowired private JwtTokenUtil jwtTokenUtil; @Autowired private UserDetailsService jwtInMemoryUserDetailsService; @RequestMapping(value = "${jwt.get.token.uri}", method = RequestMethod.POST) public ResponseEntity<?> createAuthenticationToken(@RequestBody JwtTokenRequest authenticationRequest) throws AuthenticationException { authenticate(authenticationRequest.getUsername(), authenticationRequest.getPassword()); final UserDetails userDetails = jwtInMemoryUserDetailsService .loadUserByUsername(authenticationRequest.getUsername()); final String token = jwtTokenUtil.generateToken(userDetails); return ResponseEntity.ok(new JwtTokenResponse(token)); } @RequestMapping(value = "${jwt.refresh.token.uri}", method = RequestMethod.GET) public ResponseEntity<?> refreshAndGetAuthenticationToken(HttpServletRequest request) { String authToken = request.getHeader(tokenHeader); final String token = authToken.substring(7); String username = jwtTokenUtil.getUsernameFromToken(token); JwtUserDetails user = (JwtUserDetails) jwtInMemoryUserDetailsService.loadUserByUsername(username); if (jwtTokenUtil.canTokenBeRefreshed(token)) { String refreshedToken = jwtTokenUtil.refreshToken(token); return ResponseEntity.ok(new JwtTokenResponse(refreshedToken)); } else { return ResponseEntity.badRequest().body(null); } } @ExceptionHandler({ AuthenticationException.class }) public ResponseEntity<String> handleAuthenticationException(AuthenticationException e) { return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(e.getMessage()); } private void authenticate(String username, String password) { Objects.requireNonNull(username); Objects.requireNonNull(password); try { authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(username, password)); } catch (DisabledException e) { throw new AuthenticationException("USER_DISABLED", e); } catch (BadCredentialsException e) { throw new AuthenticationException("INVALID_CREDENTIALS", e); } } }
27de152dddf1d246cf30a377caff803ef9d2dd06
eda28df5577a69d9caeafe85547e457d01911406
/src/sistema/controlador/ProductoC.java
584c2348acf94f642861008d75864320b852d172
[]
no_license
JQuispeLuyo/SistemaVentas
d2c5072775496c3f41620d127ebbb6a23fb41f76
9ce5a6be9a49fea95bfac451ffe6c7cde88966f5
refs/heads/master
2020-04-17T05:29:41.480104
2019-03-06T09:44:59
2019-03-06T09:44:59
166,281,838
0
0
null
null
null
null
UTF-8
Java
false
false
4,538
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 sistema.controlador; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JComboBox; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.util.JRLoader; import sistema.dao.ProductoD; import sistema.modelo.CategoriaM; import sistema.modelo.ProductoM; import sistema.modelo.UnidadM; import sistema.view.PnlAgregarProductoContainer; import sistema.view.PnlProductosContainer; import static sistema.view.PnlProductosContainer.jcCategoria; import static sistema.view.PnlProductosContainer.jcUnidadMedida; import static sistema.view.PnlProductosContainer.txtCodigoProducto; import static sistema.view.PnlProductosContainer.txtProducto; import static sistema.view.PnlProductosContainer.txtPrecioProducto; /** * * @author Jose Luis */ public class ProductoC { ProductoD productoD = new ProductoD(); ProductoM productoM = new ProductoM(); public void mostrarUnidad(JComboBox<UnidadM> jcUnidadMedida) { productoD.mostrarUnidad(jcUnidadMedida); } public void mostrarCategoria(JComboBox<CategoriaM> jcCategoria, JComboBox<CategoriaM> jcCategoriaFiltro) { productoD.mostrarCategoria(jcCategoria, jcCategoriaFiltro); } public void mostrarCategoriaFiltroAgregar(JComboBox<CategoriaM> jcCategoriaFiltro) { productoD.mostrarCategoriaFiltroAgregar(jcCategoriaFiltro); } public void guardarProducto() throws Exception { productoD.guardarProducto(productoM); } public void editarProducto() throws Exception { productoD.editarProducto(productoM); } public void eliminarProducto() throws Exception { productoD.eliminarProducto(productoM.getCODPRO()); } public void listarProductoTabla(DefaultTableModel modeloTablaProducto, int tipo, String dato) throws Exception { productoD.listarProductoTabla(modeloTablaProducto, tipo, dato); } public void CargarVariables() { if (!"".equals(PnlProductosContainer.txtCodigoProducto.getText().trim())) { productoM.setCODPRO(Integer.parseInt((PnlProductosContainer.txtCodigoProducto.getText()))); } productoM.setDESPRO(txtProducto.getText().trim()); productoM.setCODUNI(PnlProductosContainer.jcUnidadMedida.getItemAt(jcUnidadMedida.getSelectedIndex()).getCODUNI()); productoM.setPREPRO(Double.parseDouble(txtPrecioProducto.getText())); productoM.setCODCAT(PnlProductosContainer.jcCategoria.getItemAt(jcCategoria.getSelectedIndex()).getCODCAT()); } public boolean validar() { if (jcCategoria.getSelectedIndex() == 0) { JOptionPane.showMessageDialog(null, "Selecione una categoria"); return false; } if ("".equals(txtProducto.getText().trim())) { JOptionPane.showMessageDialog(null, "Ingrese producto"); return false; } if (jcUnidadMedida.getSelectedIndex() == 0) { JOptionPane.showMessageDialog(null, "Selecione una unidad de medida"); return false; } if ("".equals(txtPrecioProducto.getText().trim())) { JOptionPane.showMessageDialog(null, "Ingrese unn precio"); return false; } return true; } public void reporteProducto(){ productoD.reporteProducto(); } public void limpiarVariables() { txtCodigoProducto.setText(""); txtProducto.setText(""); jcUnidadMedida.setSelectedIndex(0); txtPrecioProducto.setText(""); jcCategoria.setSelectedIndex(0); } public void limpiarVariablesAgregar() { PnlAgregarProductoContainer.txtCodigoProducto.setText(""); PnlAgregarProductoContainer.txtProducto.setText(""); PnlAgregarProductoContainer.txtUnidadProducto.setText(""); PnlAgregarProductoContainer.txtPrecioProductoTotal.setText(""); PnlAgregarProductoContainer.jsCantidadProductoAgregar.setValue(0); PnlAgregarProductoContainer.jcCategoriaFiltro.setSelectedIndex(0); } }
cf5ce6e96c5ae1ffdc3ef1ea8e3e99777a091f0c
ebfbbcccf0659b3d88ade8bbeb5df1bebbf3f94d
/FONTS/CLUSTER/VISTAS/GTABLERO/VistaGestionTablero.java
257f8bd6938a80ca48f098068ddc2f4284730f27
[]
no_license
fvgumer/Hidato-PROP2015
cd93e9aa07e0feaf0401d60d9d264f1f8ffbafba
7b59cd1f704823189bb05b5595404f171179f1c3
refs/heads/master
2021-01-20T18:02:35.761982
2015-12-18T16:44:22
2015-12-18T16:44:22
62,557,075
0
0
null
null
null
null
UTF-8
Java
false
false
1,866
java
package CLUSTER.VISTAS.GTABLERO; import CLUSTER.VISTAS.BASES.Titulo; import CLUSTER.VISTAS.BASES.VistaPadreIniConBoton; import CLUSTER.VISTAS.BASES.Botones; import CLUSTER.VISTAS.CONTROLADORES.CtrlVista; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Esta es la vista inicial en referencia a la gestion de tableros. En ella el * usuario puede escojer si crear un tablero manualmente, importar uno en formato * .txt o bien eliminar un tablero guardado en persistencia. * @author Alex * */ public class VistaGestionTablero extends VistaPadreIniConBoton { private static final long serialVersionUID = 1L; public VistaGestionTablero(final CtrlVista CV) { //Config layer setTextLayer("Menu Gestion de Tableros"); contentPane.setLayout(null); Titulo t = new Titulo("Que quieres hacer?",110,53); t.setBounds(140, 51, 525, 82); getContentPane().add(t); Botones b2 = new Botones("Borrar",250,120); b2.setBounds(391, 168, 181, 82); getContentPane().add(b2); Botones b1 = new Botones("Crear",50,120); b1.setBounds(177, 168, 189, 82); getContentPane().add(b1); Botones b3 = new Botones("Importar",250,120); b3.setBounds(271, 289, 270, 82); getContentPane().add(b3); b3.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent arg0) { CV.entrarAElegirImportar(); Salir(); } }); b1.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent arg0) { CV.entrarAElegirCaracGT(); Salir(); } }); b2.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent arg0) { CV.entrarABorrarTablero(); Salir(); } }); //Declarar Boton "Salir" y su funcion super.JB.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent arg0) { CV.entrarAMenu(); Salir(); } }); } }
ece752899a802625b8641e9ddf48db7c02c4d6c1
e2c8c3c16e995ffd887421de0f4b95c1868ced6c
/com/yjs3509/model/MoreClassInTheCompilationUnit.java
6812a6c5f9ce2b6ad5427d2407f70bb5a19c9a20
[]
no_license
ramazan9182/AccessControl
7ce3aee246ffc82ffe50bc861c0cb2956a4e0e9a
eb8346e2adec77e5e44b36113a88fc99bf066a82
refs/heads/master
2023-03-25T23:05:10.166114
2021-03-26T15:06:18
2021-03-26T15:06:18
351,821,365
0
0
null
null
null
null
UTF-8
Java
false
false
260
java
package com.yjs3509.model; public class MoreClassInTheCompilationUnit { public int getCalculatedValue(int coefficient) { return new B().a * coefficient; } public B getB() { return new B(); } } class B{ int a; } class C{ } class D{ }
57a1aea5d3db01dc1378ebc5c81b9b2ca36e2e28
28f971943dd0e3aa8e56fc3804ba3ab3a181be92
/src/main/java/com.company.base.accenture.movies/objModelClass/User.java
b318b880f105ca78fdafdce050619e95e081387d
[]
no_license
Tasuketeu/-Pre-FinalMoviesProject
35e620007cef4293c493cc197f79dd6d7482a032
e6f31869df415a3e9a2bd3e2ebebc5a1cc34c83e
refs/heads/master
2021-07-19T07:40:16.551782
2019-11-16T16:25:08
2019-11-16T16:25:08
221,044,611
0
0
null
null
null
null
UTF-8
Java
false
false
985
java
package com.company.base.accenture.movies.ObjModelClass; import javax.persistence.*; import java.util.List; @Entity(name = "User") @Table(name = "users") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY, generator = "user") @Column(name = "id", updatable = false, nullable = false) private Long id; @Column(name="name") private String regName; @Column(name="login") private String regLogin; @Column(name="password") private String regPassword; @Column(name="admin") private String admin; @Transient private String userInfo; public User(String regName, String regLogin, String regPassword, String admin) { this.regName = regName; this.regLogin = regLogin; this.regPassword = regPassword; this.admin = admin; userInfo = String.format("%s %s %s %s", regName, regLogin, regPassword, admin); } public User() { } }
ca0b7277122dace2bbaf5c1c0881ad14e84327e1
67abeabe42aaeac92f4a3a9f75f8b0eb584f0bbd
/work_enter/project_code/Funcell_sdk_new/FuncellGameSdk-v3.1.3_permission/src/com/funcell/platform/android/game/proxy/FuncellChargerImpl.java
9c5c2d41342455133f70628a0bf50be089d87948
[]
no_license
JETYIN/work_result
7654090e0e94db35fdc5cf96efd7aa02bf6fa9dd
2374f609e19caf863b92eacb47448644ac5e8caa
refs/heads/master
2021-05-01T21:29:51.626557
2018-02-11T06:29:12
2018-02-11T06:29:12
120,978,524
0
0
null
null
null
null
GB18030
Java
false
false
5,943
java
package com.funcell.platform.android.game.proxy; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.funcell.platform.android.FuncellRUtils; import com.funcell.platform.android.game.proxy.pay.FuncellPayParams; import com.funcell.platform.android.game.proxy.pay.IFuncellChargerManager; import com.funcell.platform.android.game.proxy.pay.IFuncellPayCallBack; import com.funcell.platform.android.game.proxy.pay.PayCallBackType; import com.funcell.platform.android.game.proxy.pay.funcell.FunSdkUiActivity; import com.funcell.platform.android.game.proxy.util.FuncellTools; public class FuncellChargerImpl implements IFuncellChargerManager { private String TAG = getClass().getName().toString(); private FuncellPayParams mPayParams; private static FuncellChargerImpl mInstance; public static FuncellChargerImpl getInstance() { if (mInstance == null) { synchronized (FuncellChargerImpl.class) { if (mInstance == null) { mInstance = new FuncellChargerImpl(); } } } return mInstance; } @Deprecated @Override public void pay(Context ctx, FuncellPayParams paramFuncellPayParams) { // TODO Auto-generated method stub } @Override public void pay(final Activity ctx, final FuncellPayParams paramFuncellPayParams, final IFuncellPayCallBack callBack) { // TODO Auto-generated method stub ctx.runOnUiThread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub if (FuncellVar.user == null) { Toast.makeText(ctx, ctx.getResources().getString(FuncellRUtils.string(ctx, "FUNCELL_NOT_LOGIN_FLAG_TEST")), 0).show(); return; } Log.e(TAG, "支付的数据--------:"+paramFuncellPayParams.getmBundle().toString()); int fen = paramFuncellPayParams.getmItemAmount().valueOfMoney().intValue(); // if (fen < 1) { // Toast.makeText(ctx, "为兼容渠道,请传入大于1元的整数", 0).show(); // return; // } LinearLayout content = new LinearLayout(ctx); content.setLayoutParams(new LinearLayout.LayoutParams(-1, -2)); content.setOrientation(1); content.setBackgroundColor(Color.parseColor("#ffffff")); TextView tvTitle = new TextView(ctx); LinearLayout.LayoutParams tvTitleParams = new LinearLayout.LayoutParams( -1, -2); tvTitleParams.setMargins(0, FuncellTools.dip2px(ctx, 10.0F), 0, FuncellTools.dip2px(ctx, 10.0F)); tvTitle.setGravity(17); tvTitle.setText("收银台(注意商品描述!)"); tvTitle.setTextColor(-16777216); tvTitle.setTextSize(20.0F); content.addView(tvTitle, tvTitleParams); ImageView line1 = new ImageView(ctx); line1.setLayoutParams(new ViewGroup.LayoutParams(-1, 1)); line1.setBackgroundColor(Color.parseColor("#cccccc")); content.addView(line1); TextView tvNotice = new TextView(ctx); LinearLayout.LayoutParams tvNoticeParams = new LinearLayout.LayoutParams( -1, -2); tvNotice.setTextColor(-16777216); tvNotice.setTextSize(16.0F); tvNotice.setText("您将购买" + paramFuncellPayParams.getmItemCount() + paramFuncellPayParams.getmItemType() + "!(注意!)\n接入注意!:\n如点击购买100钻石,请输入数量为100,商品名为钻石,不要写数量1,商品名100钻石!请确保上方描述正确!如显示错误,请技术同学检查代码中传入的参数是否正确!"); content.addView(tvNotice, tvNoticeParams); ImageView line2 = new ImageView(ctx); line2.setLayoutParams(new ViewGroup.LayoutParams(-1, 1)); line2.setBackgroundColor(Color.parseColor("#cccccc")); content.addView(line2); LinearLayout llButtons = new LinearLayout(ctx); LinearLayout.LayoutParams llButtonsParams = new LinearLayout.LayoutParams( -1, -2); llButtons.setOrientation(0); Button btConfirm = new Button(ctx); btConfirm.setText("确定"); Button btCancel = new Button(ctx); btCancel.setText("取消"); LinearLayout.LayoutParams llConfirmParams = new LinearLayout.LayoutParams( FuncellTools.dip2px(ctx, 135.0F), -2); llConfirmParams.setMargins(18, 0, 0, 0); llButtons.addView(btConfirm, llConfirmParams); llButtons.addView(btCancel, new LinearLayout.LayoutParams(FuncellTools.dip2px(ctx, 135.0F), -2)); content.addView(llButtons, llButtonsParams); final Dialog dialog = new Dialog(ctx); dialog.requestWindowFeature(1); Window win = dialog.getWindow(); win.setFlags(1024, 1024); win.setContentView(content); dialog.show(); btConfirm.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { dialog.dismiss(); /** * 拿到平台返回的参数后,请求funcell渠道支付 */ funcellpay(ctx, paramFuncellPayParams, callBack); } }); btCancel.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { dialog.dismiss(); callBack.onCancel("pay onCancel"); // BaseFuncellGameSdkProxy.getInstance().BasePayCallBack(callBack, PayCallBackType.onCancel); } }); } }); } private void funcellpay(Activity ctx,FuncellPayParams paramFuncellPayParams,IFuncellPayCallBack callBack){ mPayParams = paramFuncellPayParams; FunSdkUiActivity.setRechargeCallBack(callBack); FunSdkUiActivity.setFuncellPayParams(paramFuncellPayParams); Intent intent = new Intent(ctx, FunSdkUiActivity.class); ctx.startActivity(intent); } @Override public FuncellPayParams GetPayParams() { // TODO Auto-generated method stub return mPayParams; } }
0c06ce98a04df4549d89d6adfefed37a53e5be65
4ac8502ce08de429b08a7432c6f0fda7db352e60
/android/cleanspace/src/com/clean/space/image/IImageCompare.java
feb64b4afe32e249a59b06fd23c3e7f81de7fdc6
[]
no_license
sxj84877171/clearspace
d4498fb1eee6e95a5f30c8a27c2d4e2fc0340460
01ac9ff1b8278ad40720c186dbea83a34c131a4e
refs/heads/master
2021-01-10T03:12:58.488213
2016-01-29T08:04:43
2016-01-29T08:04:43
50,648,043
0
0
null
null
null
null
UTF-8
Java
false
false
252
java
package com.clean.space.image; import com.clean.space.protocol.SimilarImageItem; public interface IImageCompare { public boolean compareImage(SimilarImageItem item, SimilarImageItem itemRight) ; public void calcHist(SimilarImageItem imageItem); }
486d0f8ace7310cc5168b34561bd98c639c9cc9d
475b21f2e4ccb900822330777a151c70f95ebc97
/Netbeans/R&D/src/LIRS_RDFILE_OBJECT/Main.java
2f64ca1a76fdc7a9dab4717e04a4f6cd6762d65b
[]
no_license
methanduck/JAVA
677fd03632b9eaf46b3e42459cd869dc676ad76e
49a42d4e74c203d319d3f62300f3a341558d1898
refs/heads/master
2020-03-28T08:18:01.552020
2019-05-25T12:46:46
2019-05-25T12:46:46
147,956,447
0
0
null
null
null
null
UTF-8
Java
false
false
2,371
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 LIRS_RDFILE_OBJECT; import LIRS_RDFILE_OBJECT.*; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Scanner; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author methanduck */ public class Main { public static Scanner Read_data; public static void main(String[] args) { //var int Block_Num =0; float count_access =0 ; long start =0 ; long end = 0; Simulation simulator = null; //construct System.out.printf("캐쉬 크기를 입력하세요(2이상) : "); Read_data = new Scanner(System.in); while(Block_Num<2) { Block_Num = Read_data.nextInt(); } simulator = new Simulation(Block_Num); //reader try { Read_data = new Scanner(System.in); System.out.print("File name :"); String file = Read_data.next(); BufferedReader br = new BufferedReader(new FileReader("./"+file+".txt")); file = null; start = System.currentTimeMillis(); while ((file = br.readLine())!= null) { count_access++; simulator.Data_Input(Integer.parseInt(file)); } end = System.currentTimeMillis(); } catch (FileNotFoundException e) { System.out.println(e.getMessage()); } catch (IOException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } System.out.println("LIR"+simulator.getCache().getBlock_LIR().size()); System.out.println("HIR"+simulator.getCache().getBlock_residentHIR().size()); System.out.println("프로그램 소요시간 : "+(end-start)/1000.0+"초"); System.out.println("전체 ACC횟수 : "+count_access); System.out.println("Miss count : "+ (count_access -simulator.getCache().getCount())); System.out.println("Hit Ratio : "+(simulator.getCache().getCount() / count_access)*100+"%"); } }
d10e8cce0ab30bc9e9826a04d648c25601bc1ed4
acdb4ef0c1890fc14b7607511065c9c9438093e3
/MavennetGallery/src/main/java/MavennetGallery/common/exception/AlbumNotFoundException.java
9199577b59d9d6070cc383560c38ec1674370ccb
[]
no_license
beesaycheese/tech-challenge
859588cab5e5e7121f0fe7323149465af4b2a9ec
e08689e151b9bbb2aba66282900be886efebf2a7
refs/heads/master
2020-09-10T07:51:38.243753
2019-11-15T12:38:28
2019-11-15T12:39:03
221,691,068
0
0
null
2019-11-14T12:20:18
2019-11-14T12:20:18
null
UTF-8
Java
false
false
204
java
package MavennetGallery.common.exception; public class AlbumNotFoundException extends RuntimeException{ public AlbumNotFoundException(long id) { super("Could not find album " + id); } }
625b0a6b1ee842512bc0bf80ac7e7d5e5e7c1f10
d5748010180364cf0e0f2f56984ffe5fe27bda8f
/chapter_2/src/epam/java/chapter2/arrays/Task5.java
02150a246b2350508b3875d6e79c4e8e5b713b5f
[]
no_license
VladislavKovalevich/JavaCourse
606aa118c938e068695c99de76d62fe87bee6341
8e80f775784aa119ac0b4fee26f20e52f7e2edd1
refs/heads/master
2023-09-05T03:02:07.747730
2021-11-21T16:53:55
2021-11-21T16:53:55
386,303,869
0
0
null
null
null
null
UTF-8
Java
false
false
675
java
package epam.java.chapter2.arrays; import java.util.Arrays; /** * Даны целые числа а1 ,а2 ,..., аn . Вывести на печать только те числа, для которых аi > i. */ public class Task5 { public static void main(String[] args) { int[] A; A= new int[]{-1, 36, 75, -4, 3, -76, 91, 0, 1}; System.out.println("Исходная последовательность:\n"+ Arrays.toString(A) +"\n"); System.out.print("Результат: "); for (int i = 0 ; i < A.length; i++){ if (A[i] > i){ System.out.print(A[i] + " "); } } } }
155c8496212a784845c9a796b9b071fba737388e
5eff723bf4566b003e4e02d82780e7d11be1680b
/SeatGridDemo/src/main/util/Log.java
e48451241f1f6e789cec6b6f11824f2993052624
[ "BSD-2-Clause" ]
permissive
p-kleczek/zpi-interface
443da990c04f0f1fdc806db2d3fc357729603e1c
a0d16bbfeba03afa8a528bd72c981604b8539501
refs/heads/master
2021-01-10T19:55:15.909771
2013-10-17T12:33:16
2013-10-17T12:33:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
238
java
package main.util; /** * Klasa pomocnicza do wypisywania danych w konsoli. Zeby nie pisac za kazdym * razem System.out.println() :P */ public class Log { public static void post(String message) { System.out.println(message); } }
6e4e72c97504803ec760ff8f829fca087ab6e5ea
68f2b262b9a07194d1b179d4ca400ea60aec2789
/app/src/main/java/com/example/gerffyxuuu/assignment1/VideosActivity.java
f4d7cd677ec9eebb95295467f269964f9a14c928
[]
no_license
GeffyXu/Android-for-Embedded-development
7a83c89147458e40fd7947018d8f6f477ad3fb55
ceb3874477c6bdaac6b468a59b5b62447aaa276b
refs/heads/master
2020-04-05T09:00:27.060705
2018-12-27T08:45:53
2018-12-27T08:45:53
156,738,517
0
0
null
null
null
null
UTF-8
Java
false
false
1,115
java
package com.example.gerffyxuuu.assignment1; import android.content.Context; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ListView; import java.util.LinkedList; import java.util.List; public class VideosActivity extends AppCompatActivity { private List<Video> mData = null; private Context mContext; private VideoAdapter mAdapter = null; private ListView list_video; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.videos); mContext = VideosActivity.this; list_video = (ListView) findViewById(R.id.list_videos); mData = new LinkedList<Video>(); mData.add(new Video(R.mipmap.articles1, "腹肌撕裂者", "腹肌撕裂者","观看人数:100")); mData.add(new Video(R.mipmap.articles1, "震惊!健身中居然发送这样的事。", "腹肌撕裂者!","观看人数:10")); mAdapter = new VideoAdapter((LinkedList<Video>) mData, mContext); list_video.setAdapter(mAdapter); } }
0feba2a4ce8842af36a8ba09294282df544f825a
84b8a41bf0aa8aabf206a67089652bc29890c2b5
/cloud-eureka-consumer-order80/src/main/java/com/lihewei/config/FeignConfig.java
a4d5f4fd1f6774b7b5c3d13c00da66fd4a017bd0
[]
no_license
ilihewei/cloudAction2020
8d66922c35df032c3e8cb88cdbb83c3104f8ada0
1173e9923a9f50f1f400b34f09fc7432a55c0c5c
refs/heads/main
2022-12-20T01:47:51.717409
2020-10-25T03:53:03
2020-10-25T03:53:03
302,376,476
1
0
null
null
null
null
UTF-8
Java
false
false
352
java
package com.lihewei.config; import feign.Logger; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** * @Author EiletXie * @Since 2020/3/11 15:50 */ @Configuration public class FeignConfig { @Bean Logger.Level feignLoggerLevel() { return Logger.Level.FULL; } }
26281fe9f8118026c55b9b40ae0c5712c84aa122
5c650edf8d9782f7556b45ac312992161d4729fa
/app/src/main/java/hr/etfos/josipvojak/bugsy/ArticleAdapter.java
3b8bd6d8d01db318cba7917570348a8ddce6b748
[]
no_license
spamserv/Bugsy
5cb3633c537b7f762d1f5a48f914b534462bb6cc
cc8adbb55342d1f290a456a99fb1e198bd47d512
refs/heads/master
2021-01-01T03:47:55.779238
2016-04-26T16:27:29
2016-04-26T16:27:29
57,143,949
0
0
null
null
null
null
UTF-8
Java
false
false
2,250
java
package hr.etfos.josipvojak.bugsy; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.TextView; import com.squareup.picasso.Picasso; import org.w3c.dom.Text; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; /** * Created by jvojak on 25.4.2016.. */ public class ArticleAdapter extends BaseAdapter{ Context ctx; ArrayList<Article> articleList; Bitmap image; boolean isReady = false; ProgressBar pbGetImagesProgress; ImageView ivArticlePictureURL; TextView tvArticleTitle, tvArticleDescription, tvArticleCategory; public ArticleAdapter(Context ctx, ArrayList<Article> articleList) { super(); this.ctx = ctx; this.articleList = articleList; } @Override public int getCount() { return this.articleList.size(); } @Override public Object getItem(int position) { return this.articleList.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if(convertView == null){ convertView = View.inflate(ctx, R.layout.list_item_article, null); } Article current = articleList.get(position); ivArticlePictureURL = (ImageView) convertView.findViewById(R.id.ivArticlePicture); tvArticleTitle = (TextView) convertView.findViewById(R.id.tvArticleTitle); tvArticleDescription = (TextView) convertView.findViewById(R.id.tvArticleDescription); tvArticleCategory = (TextView) convertView.findViewById(R.id.tvArticleCategory); tvArticleTitle.setText(current.getMTitle()); tvArticleDescription.setText(current.getMDescription()); tvArticleCategory.setText(current.getMCategory()); Picasso.with(ctx).load(current.getMPicture_URL()).into(ivArticlePictureURL); return convertView; } }
72c2da90a0fe33a0897c7f2d1c8e735ac86c043d
2c1522dc161ed4958805aaf1bfac37df141473a5
/src/main/java/servicenow/chaining_change/CreateChangeWithoutBody.java
fefeb83a6f42053ecd0cde89e32a862132360e5a
[]
no_license
veerreddykarri/RestAPITestLeafTraining
72b91229236e4c79516fd6908a7845e6a3ed2a49
70858f9fcd0cffaf2e1ec80444b5a6c56cc1850f
refs/heads/master
2023-06-23T13:40:53.472646
2021-07-17T19:10:41
2021-07-17T19:10:41
382,777,373
0
0
null
null
null
null
UTF-8
Java
false
false
1,214
java
package servicenow.chaining_change; import io.restassured.RestAssured; import io.restassured.http.ContentType; import io.restassured.path.json.JsonPath; import io.restassured.response.Response; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import static io.restassured.module.jsv.JsonSchemaValidator.*; import java.io.File; public class CreateChangeWithoutBody extends BaseClass { @Test public void createChangeWithoutBody() { Response response = RestAssured.given() .contentType(ContentType.JSON) .post() .then() .assertThat() .contentType(ContentType.JSON) .statusCode(201) //import static io.restassured.module.jsv.JsonSchemaValidator.*;(You have to import to use matchesJsonSchema class) //Also you should have json-schema-validator dependency in POM.xml .body(matchesJsonSchema(new File("./data/ChangeSchema.json"))) .extract().response(); JsonPath jsonPath = response.jsonPath(); sysID = jsonPath.get("result.sys_id"); System.out.println(response.statusCode()); } }
6409233d13f0bdad1a0b73865270eadb7da7f506
07bda3d645a77c5f6bc2e0f74eb1c99bae30bd18
/src/main/java/com/yao/util/DateUtil.java
3cb36559bbddb321d4fd16e116c8897975b9dedb
[]
no_license
naadp/Pay
c6c13f4d1b537402aa18d33b859333d8fa525b0b
d9d48b590a7642cee07a76e6a0f20500a5ebb9b4
refs/heads/master
2020-03-25T20:29:51.254400
2018-08-09T09:50:11
2018-08-09T09:50:11
144,133,588
2
0
null
null
null
null
UTF-8
Java
false
false
1,176
java
package com.yao.util; import java.text.SimpleDateFormat; import java.util.Date; /** * 日期工具类 * @author Administrator * */ public class DateUtil { /** * 日期对象转字符串 * @param date * @param format * @return */ public static String formatDate(Date date,String format){ String result=""; SimpleDateFormat sdf=new SimpleDateFormat(format); if(date!=null){ result=sdf.format(date); } return result; } /** * 字符串转日期对象 * @param str * @param format * @return * @throws Exception */ public static Date formatString(String str,String format) throws Exception{ if(StringUtil.isEmpty(str)){ return null; } SimpleDateFormat sdf=new SimpleDateFormat(format); return sdf.parse(str); } /** * 生成当前日期时间串 * @return * @throws Exception */ public static String getCurrentDateStr(){ Date date=new Date(); SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddhhmmssSSS"); return sdf.format(date); } public static void main(String[] args) throws Exception { System.out.println(getCurrentDateStr()); } }
8af90b9f52da2a3e6da008980fbd52c699110071
fcc758693b541c24089673ba5ec4a8faf7fdd5dc
/mpool-account/src/main/java/com/mpool/account/entity/MpoolUser.java
df549e55dd7489383e87d45c01e8732c68e65d14
[]
no_license
862775170/mpool
a803d728fd5c5f38560778d4e4dfaf26eab7ddcc
b168613b10b1c7031b3ce669f5aadeb394605ba8
refs/heads/master
2020-03-29T22:27:41.528499
2018-10-15T14:51:32
2018-10-15T14:51:32
150,422,014
0
0
null
null
null
null
UTF-8
Java
false
false
1,863
java
package com.mpool.account.entity; import java.io.Serializable; import java.util.Date; import javax.validation.constraints.Email; import javax.validation.constraints.NotEmpty; /** * <p> * * </p> * * @author cc * @since 2018-10-09 */ public class MpoolUser implements Serializable { private static final long serialVersionUID = 1L; private String userId; @NotEmpty private String userName; @NotEmpty private String password; @NotEmpty private String nickname; @Email private String mail; private Date updateAt; private String updateBy; private Date createAt; public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public String getMail() { return mail; } public void setMail(String mail) { this.mail = mail; } public Date getUpdateAt() { return updateAt; } public void setUpdateAt(Date updateAt) { this.updateAt = updateAt; } public String getUpdateBy() { return updateBy; } public void setUpdateBy(String updateBy) { this.updateBy = updateBy; } public Date getCreateAt() { return createAt; } public void setCreateAt(Date createAt) { this.createAt = createAt; } @Override public String toString() { return "mpoolUser{" + "userId=" + userId + ", userName=" + userName + ", password=" + password + ", nickname=" + nickname + ", mail=" + mail + ", updateAt=" + updateAt + ", updateBy=" + updateBy + ", createAt=" + createAt + "}"; } }
e1580a84ad13f4e35ff8c220c951ee9808428b57
9b5080996d1b5c2b4cf1eb83fc854c7042b3a363
/projectLists/project1/src/main/java/algorithm/To_QuickSort.java
2b07d0580b647eb3bc6024815a0326477462fcce
[]
no_license
xpf-demo/project
f1c5e646a56b81637f3f559d791eb95ecd41897c
87d71ed5a8df04a3a03abcbc2a0909ac09c5731d
refs/heads/master
2022-12-30T05:22:33.077594
2020-11-30T01:22:58
2020-11-30T01:22:58
154,803,453
0
0
null
2022-12-16T03:30:33
2018-10-26T08:38:32
Java
UTF-8
Java
false
false
1,856
java
package algorithm; public class To_QuickSort { private static int num = 0; public static void main(String[] args) { int[] a = { 51, 46, 20, 18, 65, 97, 82, 30, 77, 50 }; System.out.println("数组的初识数据:"); for (int i = 0; i < a.length; i++) { System.out.print(a[i]+" "); } System.out.println(); quick(a,0,a.length-1); System.out.println("数组最终排序结果:"); for (int i = 0; i < a.length; i++) { System.out.print(a[i]+" "); } } public static void quick(int[] list,int low,int high){ if (list.length>0 && low<high) { int middle = getMiddle(list, low, high); quick(list, low, middle-1); quick(list, middle+1, high); } } /** * @Title: getMiddle * @Description: 选取中间值 * @param list 数组 * @param low 最小坐标 * @param high 最高位坐标 * @return * @throws */ public static int getMiddle(int[] list,int low,int high){ // 计算执行次数 num++; //选择第一个数作为轴值,存放于临时变量中 int temp = list[low]; //保证一致正序选择 while (low<high) { //保证正序的前提下(从左到右),如果右侧大于轴值,则判断右侧数据的下一个 while (low<high && list[high]>temp) { high--; } //在右侧找到小于temp轴值的数,则进行交换 list[low]=list[high]; //保证正序的前提下(从左到右),如果左侧小于轴值,则判断左侧数据的下一个 while (low<high && list[low]<=temp) { low++; } //在左侧找到大于temp轴值的数,则进行交换 list[high]=list[low]; } list[low]=temp; System.out.println("执行了第"+num+"次"); for (int i = 0; i < list.length; i++) { System.out.print(list[i]+" "); } System.out.println(); return low; } }
78ba2960513e380312dd0922bec10982de8d4902
399d7216b86ba8c16d656797c0ee0db43c97021a
/SpringBootWithRestPoc/src/main/java/com/crmindz/MyApplication.java
57a0964fdbc6d030bc916e9fb08954a207ff7399
[]
no_license
sgantabcj/BCJMay2017
dfd9646df72be8d4ae18e20cf28fe1e45c676416
3377999858ee3ca57abb5033bf74d9891e184d57
refs/heads/master
2021-01-23T13:35:31.543616
2017-10-13T20:52:14
2017-10-13T20:52:14
102,670,544
0
0
null
null
null
null
UTF-8
Java
false
false
294
java
package com.crmindz; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class MyApplication { public static void main(String[] args) { SpringApplication.run(MyApplication.class, args); } }
c775947388c2195845193c296588c599eed556cf
3c6f6e0f24d17aa86e66083ddf2a447eaaddda9c
/shared_shop/src/main/java/jp/co/sss/shop/bean/CategoryBean.java
489a10187235fb7cbc37dd7c8065076ef2f212df
[]
no_license
TaikiOkada/TeamVariery
73675cc610998b1c369f8e91119814615de23346
436d94bc7df5b89d6697ee522dccc5267b022258
refs/heads/master
2023-06-12T21:52:47.976715
2021-06-28T02:36:13
2021-06-28T02:36:13
374,888,877
0
0
null
null
null
null
UTF-8
Java
false
false
1,070
java
package jp.co.sss.shop.bean; /** * カテゴリ情報クラス * * @author SystemShared */ public class CategoryBean { /** * カテゴリID */ private Integer id; /** * カテゴリ名 */ private String name; /** * カテゴリ説明 */ private String description; /** * 削除フラグ 0:未削除、1:削除済み */ private Integer deleteFlag; /** * 登録日付 */ private String insertDate; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Integer getDeleteFlag() { return deleteFlag; } public void setDeleteFlag(Integer deleteFlag) { this.deleteFlag = deleteFlag; } public String getInsertDate() { return insertDate; } public void setInsertDate(String insertDate) { this.insertDate = insertDate; } }
7df03a4bf15c7a7ff2fd00ab4f1ed9bdab2bc01a
40f0b24267ee728cbac17d8625b09ca8846adb54
/src/main/java/io/geobit/opreturn/MyServlet.java
0be6b10434ea5402972735ee06444352b8ecaae1
[ "MIT" ]
permissive
RCasatta/op_return
dfad39262c60c09102489b5c318d7b01bb029bcb
bb87a4ea9f5b8cac5660203619a8b999997069ea
refs/heads/master
2020-12-22T07:01:14.984267
2017-05-01T15:37:21
2017-05-01T15:37:21
37,457,867
16
7
null
2017-05-01T15:31:58
2015-06-15T10:09:18
Java
UTF-8
Java
false
false
1,009
java
/* For step-by-step instructions on connecting your Android application to this backend module, see "App Engine Java Servlet Module" template documentation at https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloWorld */ package io.geobit.opreturn; import java.io.IOException; import javax.servlet.http.*; public class MyServlet extends HttpServlet { @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/plain"); resp.getWriter().println("Please use the form to POST to this url"); } @Override public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { String name = req.getParameter("name"); resp.setContentType("text/plain"); if (name == null) { resp.getWriter().println("Please enter a name"); } resp.getWriter().println("Hello " + name); } }
9db97ea61e758110757df988601e76b860770704
b0ce8e64df396f8bfd184ffb40c179a8d540d0e9
/app/src/androidTest/java/com/example/administrator/threeuomengdemo/ExampleInstrumentedTest.java
a3f04ba78558cbd212378b106e56de4e3cb24a2e
[]
no_license
GaoYaNan0331/ThreeUomengdemo
ae5bd1cb852bee55c28df2071f968a2499d788c6
d5b1d6ee7ca18da577394ce97e7a5e90759b6389
refs/heads/master
2021-01-20T08:54:29.710111
2017-05-03T23:37:17
2017-05-03T23:37:17
90,202,370
0
0
null
null
null
null
UTF-8
Java
false
false
786
java
package com.example.administrator.threeuomengdemo; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.administrator.threeuomengdemo", appContext.getPackageName()); } }
e074f67274a3766b8249467a08010e1c2fc253b2
eaec4795e768f4631df4fae050fd95276cd3e01b
/src/cmps252/HW4_2/UnitTesting/record_374.java
ff117bab8f077ea8fb8da67f6ac9d76c698c9422
[ "MIT" ]
permissive
baraabilal/cmps252_hw4.2
debf5ae34ce6a7ff8d3bce21b0345874223093bc
c436f6ae764de35562cf103b049abd7fe8826b2b
refs/heads/main
2023-01-04T13:02:13.126271
2020-11-03T16:32:35
2020-11-03T16:32:35
307,839,669
1
0
MIT
2020-10-27T22:07:57
2020-10-27T22:07:56
null
UTF-8
Java
false
false
2,411
java
package cmps252.HW4_2.UnitTesting; import static org.junit.jupiter.api.Assertions.*; import java.io.FileNotFoundException; import java.util.List; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import cmps252.HW4_2.Customer; import cmps252.HW4_2.FileParser; @Tag("45") class Record_374 { private static List<Customer> customers; @BeforeAll public static void init() throws FileNotFoundException { customers = FileParser.getCustomers(Configuration.CSV_File); } @Test @DisplayName("Record 374: FirstName is Bertie") void FirstNameOfRecord374() { assertEquals("Bertie", customers.get(373).getFirstName()); } @Test @DisplayName("Record 374: LastName is Kilborne") void LastNameOfRecord374() { assertEquals("Kilborne", customers.get(373).getLastName()); } @Test @DisplayName("Record 374: Company is Barbaras Bakery") void CompanyOfRecord374() { assertEquals("Barbaras Bakery", customers.get(373).getCompany()); } @Test @DisplayName("Record 374: Address is 601 Lighthouse Ave") void AddressOfRecord374() { assertEquals("601 Lighthouse Ave", customers.get(373).getAddress()); } @Test @DisplayName("Record 374: City is Monterey") void CityOfRecord374() { assertEquals("Monterey", customers.get(373).getCity()); } @Test @DisplayName("Record 374: County is Monterey") void CountyOfRecord374() { assertEquals("Monterey", customers.get(373).getCounty()); } @Test @DisplayName("Record 374: State is CA") void StateOfRecord374() { assertEquals("CA", customers.get(373).getState()); } @Test @DisplayName("Record 374: ZIP is 93940") void ZIPOfRecord374() { assertEquals("93940", customers.get(373).getZIP()); } @Test @DisplayName("Record 374: Phone is 831-375-6712") void PhoneOfRecord374() { assertEquals("831-375-6712", customers.get(373).getPhone()); } @Test @DisplayName("Record 374: Fax is 831-375-0663") void FaxOfRecord374() { assertEquals("831-375-0663", customers.get(373).getFax()); } @Test @DisplayName("Record 374: Email is [email protected]") void EmailOfRecord374() { assertEquals("[email protected]", customers.get(373).getEmail()); } @Test @DisplayName("Record 374: Web is http://www.bertiekilborne.com") void WebOfRecord374() { assertEquals("http://www.bertiekilborne.com", customers.get(373).getWeb()); } }
3e37b92e506e49d3f871fef93becf50554f28e86
e51bcc4d4055c7eda9d74c03cf0e19940b112183
/src/main/java/com/minegusta/mgbosses/powers/abilities/effects/SelfSpeed.java
7e79b7b9076cdd04af13bb97f89170982b664ad0
[]
no_license
janie177/MGBosses
c8b54762f6655dc864ac3d8ad232dc12d29b5138
5ec8656cca9d80840dc48b4742c4f613e5d74efa
refs/heads/master
2021-01-21T12:26:19.585742
2015-07-23T18:12:31
2015-07-23T18:12:31
20,328,837
0
0
null
null
null
null
UTF-8
Java
false
false
642
java
package com.minegusta.mgbosses.powers.abilities.effects; import com.minegusta.mgbosses.powers.abilities.Ability; import org.bukkit.ChatColor; import org.bukkit.entity.LivingEntity; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; public class SelfSpeed implements Ability { @Override public void run(LivingEntity damager, LivingEntity entity, double damage) { entity.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 * 12, 1)); damager.sendMessage(ChatColor.RED + "[" + entity.getCustomName() + ChatColor.RED + "] " + ChatColor.RESET + "You can't run from me!"); } }
18cc5f55b45bda16d7e494d2977f84161babcbac
e018ce7487a221c0cc96bd21d554f6002bcb9626
/src/test/java/com/gildedrose/TexttestFixture.java
c6c3074766220981804128315c788e8b921b7f78
[]
no_license
delalama/Gilded-rose-kata
85c0327caa1b305dc5f53c7d1870f30930a90210
f59d7f85f175a2af9d5332e40327289eae990074
refs/heads/master
2023-01-23T20:17:00.331463
2020-12-06T23:20:40
2020-12-06T23:20:40
318,808,426
0
0
null
null
null
null
UTF-8
Java
false
false
1,800
java
package com.gildedrose; public class TexttestFixture { public static void main(String[] args) { System.out.println("OMGHAI!"); Item[] items = new Item[] { new ItemBuilder().setName("+5 Dexterity Vest").setSellIn(10).setQuality(20).createItem(), // new ItemBuilder().setName("Aged Brie").setSellIn(2).setQuality(0).createItem(), // new ItemBuilder().setName("Elixir of the Mongoose").setSellIn(5).setQuality(7).createItem(), // new ItemBuilder().setName("Sulfuras, Hand of Ragnaros").setSellIn(0).setQuality(80).createItem(), // new ItemBuilder().setName("Sulfuras, Hand of Ragnaros").setSellIn(-1).setQuality(80).createItem(), new ItemBuilder().setName("Backstage passes to a TAFKAL80ETC concert").setSellIn(15).setQuality(20).createItem(), new ItemBuilder().setName("Backstage passes to a TAFKAL80ETC concert").setSellIn(10).setQuality(49).createItem(), new ItemBuilder().setName("Backstage passes to a TAFKAL80ETC concert").setSellIn(5).setQuality(49).createItem(), // this conjured item does not work properly yet new ItemBuilder().setName("Conjured Mana Cake").setSellIn(3).setQuality(6).createItem()}; GildedRose app = new GildedRose(items); int days = 2; if (args.length > 0) { days = Integer.parseInt(args[0]) + 1; } for (int i = 0; i < days; i++) { System.out.println("-------- day " + i + " --------"); System.out.println("name, sellIn, quality"); for (Item item : items) { System.out.println(item); } System.out.println(); app.updateQuality(); } } }
8531a0f4f5a00eeeffff43881bb0788584a802a2
9972a93cdc2ae36d237479c1257e3d7d512f346a
/lesson12/src/by/pvt/iostream/Main.java
da885eba43748487588098ea3bc692c172559795
[]
no_license
DmitriyKrasovskiy/lesson12
a8d00eeaeeca15a70a467f95296816b820c48b1e
1d085f620907948c39d992dd15970a658d4d5116
refs/heads/master
2020-05-24T20:43:42.273388
2019-05-19T10:11:26
2019-05-19T10:11:26
187,460,984
0
0
null
null
null
null
UTF-8
Java
false
false
683
java
package by.pvt.iostream; import java.io.File; import java.util.Arrays; /** * */ public class Main { public static void main(String[] args) { byte[] bytes = {1,2,3,4,5}; Example fileExample = new Example(); fileExample.writeToFile(bytes, "readme.txt"); fileExample.writeToFile("test".getBytes(), "readme.txt"); byte[] inputBytes = fileExample.readFromFile("readme.txt"); System.out.println(new String(inputBytes)); System.out.println(Arrays.toString(inputBytes)); fileExample.readStringFromFile( "c:" + File.separator + "java" + File.separator + "coople.xml"); } }
997c911e9e2268fc75d5fd87899de187234df700
4670451af5d72fbdea1e34ba933cf71aa1d2c420
/smack-experimental/src/test/java/org/jivesoftware/smackx/carbons/CarbonTest.java
acf139c6e1a8d17e42febb6157eb5b5aa54ad25f
[ "Apache-2.0" ]
permissive
n8fr8/Smack
806f3d5e90082211aa37dde32e3869fda0071683
7ec5d0938de38c92ccf95e3274fcc63d5b2d0263
refs/heads/master
2021-01-18T08:21:48.869876
2017-07-05T14:16:39
2017-07-05T14:16:39
22,495,160
1
0
null
null
null
null
UTF-8
Java
false
false
3,671
java
/** * * Copyright the original author or authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jivesoftware.smackx.carbons; import static org.jivesoftware.smack.test.util.CharsequenceEquals.equalsCharSequence; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import java.util.Properties; import org.jivesoftware.smack.util.PacketParserUtils; import org.jivesoftware.smackx.ExperimentalInitializerTest; import org.jivesoftware.smackx.carbons.packet.CarbonExtension; import org.jivesoftware.smackx.carbons.provider.CarbonManagerProvider; import org.jivesoftware.smackx.forward.packet.Forwarded; import com.jamesmurty.utils.XMLBuilder; import org.junit.Test; import org.xmlpull.v1.XmlPullParser; public class CarbonTest extends ExperimentalInitializerTest { private static Properties outputProperties = new Properties(); static { outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes"); } @Test public void carbonSentTest() throws Exception { XmlPullParser parser; String control; CarbonExtension cc; Forwarded fwd; control = XMLBuilder.create("sent") .e("forwarded") .a("xmlns", "urn:xmpp:forwarded:0") .e("message") .a("from", "[email protected]") .asString(outputProperties); parser = PacketParserUtils.getParserFor(control); cc = new CarbonManagerProvider().parse(parser); fwd = cc.getForwarded(); // meta assertEquals(CarbonExtension.Direction.sent, cc.getDirection()); // no delay in packet assertEquals(null, fwd.getDelayInformation()); // check message assertThat("[email protected]", equalsCharSequence(fwd.getForwardedStanza().getFrom())); // check end of tag assertEquals(XmlPullParser.END_TAG, parser.getEventType()); assertEquals("sent", parser.getName()); } @Test public void carbonReceivedTest() throws Exception { XmlPullParser parser; String control; CarbonExtension cc; control = XMLBuilder.create("received") .e("forwarded") .a("xmlns", "urn:xmpp:forwarded:0") .e("message") .a("from", "[email protected]") .asString(outputProperties); parser = PacketParserUtils.getParserFor(control); cc = new CarbonManagerProvider().parse(parser); assertEquals(CarbonExtension.Direction.received, cc.getDirection()); // check end of tag assertEquals(XmlPullParser.END_TAG, parser.getEventType()); assertEquals("received", parser.getName()); } @Test(expected = Exception.class) public void carbonEmptyTest() throws Exception { XmlPullParser parser; String control; control = XMLBuilder.create("sent") .a("xmlns", "urn:xmpp:forwarded:0") .asString(outputProperties); parser = PacketParserUtils.getParserFor(control); new CarbonManagerProvider().parse(parser); } }
2903691fde5b8dd71412e5db4bc72c3cdd414914
4fa19c4b762f8669633a7d8a0ad61c57956624f6
/instatime/src/main/java/com/example/krngrvr09/instatime/i18n/Resources_ru.java
2a53113a3dd532bca69662962d88e33d021fa13a
[]
no_license
tinasherobert/InstaTimeAgo
a275762ffc7624cc9e3e1a9cd18d333285b1a969
97c77019ca0a53705ddcb2ac2edeeb8f74c3b44e
refs/heads/master
2021-01-18T15:34:23.324349
2015-01-02T20:08:32
2015-01-02T20:08:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,600
java
package com.example.krngrvr09.instatime.i18n; import com.example.krngrvr09.instatime.Duration; import com.example.krngrvr09.instatime.TimeFormat; import com.example.krngrvr09.instatime.TimeUnit; import com.example.krngrvr09.instatime.impl.TimeFormatProvider; import com.example.krngrvr09.instatime.units.Century; import com.example.krngrvr09.instatime.units.Day; import com.example.krngrvr09.instatime.units.Decade; import com.example.krngrvr09.instatime.units.Hour; import com.example.krngrvr09.instatime.units.JustNow; import com.example.krngrvr09.instatime.units.Millennium; import com.example.krngrvr09.instatime.units.Millisecond; import com.example.krngrvr09.instatime.units.Minute; import com.example.krngrvr09.instatime.units.Month; import com.example.krngrvr09.instatime.units.Second; import com.example.krngrvr09.instatime.units.Week; import com.example.krngrvr09.instatime.units.Year; import java.util.ListResourceBundle; /** * Created with IntelliJ IDEA. * User: Tumin Alexander * Date: 2012-12-13 * Time: 03:33 */ public class Resources_ru extends ListResourceBundle implements TimeFormatProvider { private static final Object[][] OBJECTS = new Object[0][0]; private static final int tolerance = 50; // see http://translate.sourceforge.net/wiki/l10n/pluralforms private static final int russianPluralForms = 3; private static class TimeFormatAided implements TimeFormat { private final String[] pluarls; public TimeFormatAided(String ... plurals) { if (plurals.length != russianPluralForms) { throw new IllegalArgumentException("Wrong plural forms number for russian language!"); } this.pluarls = plurals; } @Override public String format(Duration duration) { long quantity = duration.getQuantityRounded(tolerance); StringBuilder result = new StringBuilder(); result.append(quantity); return result.toString(); } @Override public String formatUnrounded(Duration duration) { long quantity = duration.getQuantity(); StringBuilder result = new StringBuilder(); result.append(quantity); return result.toString(); } @Override public String decorate(Duration duration, String time) { return performDecoration( duration.isInPast(), duration.isInFuture(), duration.getQuantityRounded(tolerance), time ); } @Override public String decorateUnrounded(Duration duration, String time) { return performDecoration( duration.isInPast(), duration.isInFuture(), duration.getQuantity(), time ); } private String performDecoration(boolean past, boolean future, long n, String time) { // a bit cryptic, yet well-tested // consider http://translate.sourceforge.net/wiki/l10n/pluralforms int pluralIdx = (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); if (pluralIdx > russianPluralForms) { // impossible happening throw new IllegalStateException("Wrong plural index was calculated somehow for russian language"); } StringBuilder result = new StringBuilder(); if (future) { result.append("через "); } result.append(time); result.append(' '); result.append(pluarls[pluralIdx]); if (past) { result.append(" назад"); } return result.toString(); } } @Override public Object[][] getContents() { return OBJECTS; } @Override public TimeFormat getFormatFor(TimeUnit t) { if (t instanceof JustNow) { return new TimeFormat() { @Override public String format(Duration duration) { return performFormat(duration); } @Override public String formatUnrounded(Duration duration) { return performFormat(duration); } private String performFormat(Duration duration) { if (duration.isInFuture()) { return "сейчас"; } if (duration.isInPast()) { return "только что"; } return null; } @Override public String decorate(Duration duration, String time) { return time; } @Override public String decorateUnrounded(Duration duration, String time) { return time; } }; } else if (t instanceof Century) { return new TimeFormatAided("век", "века", "веков"); } else if (t instanceof Day) { return new TimeFormatAided("день", "дня", "дней"); } else if (t instanceof Decade) { return new TimeFormatAided("десятилетие", "десятилетия", "десятилетий"); } else if (t instanceof Hour) { return new TimeFormatAided("час", "часа", "часов"); } else if (t instanceof Millennium) { return new TimeFormatAided("тысячелетие", "тысячелетия", "тысячелетий"); } else if (t instanceof Millisecond) { return new TimeFormatAided("миллисекунду", "миллисекунды", "миллисекунд"); } else if (t instanceof Minute) { return new TimeFormatAided("минуту", "минуты", "минут"); } else if (t instanceof Month) { return new TimeFormatAided("месяц", "месяца", "месяцев"); } else if (t instanceof Second) { return new TimeFormatAided("секунду", "секунды", "секунд"); } else if (t instanceof Week) { return new TimeFormatAided("неделю", "недели", "недель"); } else if (t instanceof Year) { return new TimeFormatAided("год", "года", "лет"); } return null; // error } }
459d0d0cd0705c535a55e567c1affb4d1fd7ee79
bc559542e0cc48e80d1b3f4da07dab1b1febcf18
/src/main/java/org/isf/examination/model/PatientExamination.java
526acccf7aaf4ce399bb35d65a0dffe035dca458
[]
no_license
kenhikaru7/Porting
b1623de29b258dfe9b27f7671e6fe3ee362997a9
fbde9294bcfbc85615a760064e85219da56115fb
refs/heads/master
2020-03-11T07:21:09.683039
2019-02-09T11:12:30
2019-02-09T11:12:30
129,854,811
0
0
null
null
null
null
UTF-8
Java
false
false
5,087
java
/** * */ package org.isf.examination.model; import java.io.Serializable; import java.sql.Timestamp; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.isf.patient.model.Patient; /** * @author Mwithi * * the model for Patient Examination * */ @Entity @Table(name="PATIENTEXAMINATION") public class PatientExamination implements Serializable, Comparable<PatientExamination> { /** * */ private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name="PEX_ID") private int pex_ID; @Column(name="PEX_DATE") private Timestamp pex_date; @ManyToOne @JoinColumn(name="PEX_PAT_ID") private Patient patient; @Column(name="PEX_HEIGHT") private int pex_height; @Column(name="PEX_WEIGHT") private double pex_weight; @Column(name="PEX_PA_MIN") private int pex_pa_min; @Column(name="PEX_PA_MAX") private int pex_pa_max; @Column(name="PEX_FC") private int pex_fc; @Column(name="PEX_TEMP") private double pex_temp; @Column(name="PEX_SAT") private double pex_sat; @Column(name="PEX_NOTE", length=300) private String pex_note; /** * */ public PatientExamination() { super(); } /** * @param pex_date * @param patient * @param pex_height * @param pex_weight * @param pex_pa_min * @param pex_pa_max * @param pex_fc * @param pex_temp * @param pex_sat * @param pex_note */ public PatientExamination(Timestamp pex_date, Patient patient, int pex_height, double pex_weight, int pex_pa_min, int pex_pa_max, int pex_fc, double pex_temp, double pex_sat, String pex_note) { super(); this.pex_date = pex_date; this.patient = patient; this.pex_height = pex_height; this.pex_weight = pex_weight; this.pex_pa_min = pex_pa_min; this.pex_pa_max = pex_pa_max; this.pex_fc = pex_fc; this.pex_temp = pex_temp; this.pex_sat = pex_sat; this.pex_note = pex_note; } /** * @return the pex_ID */ public int getPex_ID() { return pex_ID; } /** * @return the patient */ public Patient getPatient() { return patient; } /** * @param patient the patient to set */ public void setPatient(Patient patient) { this.patient = patient; } /** * @param pex_ID the pex_ID to set */ public void setPex_ID(int pex_ID) { this.pex_ID = pex_ID; } /** * @return the pex_date */ public Timestamp getPex_date() { return pex_date; } /** * @param pex_date the pex_date to set */ public void setPex_date(Timestamp pex_date) { this.pex_date = pex_date; } // /** // * @return the pex_pat_ID // */ // public int getPex_pat_ID() { // return pex_pat_ID; // } // // /** // * @param pex_pat_ID the pex_pat_ID to set // */ // public void setPex_pat_ID(int pex_pat_ID) { // this.pex_pat_ID = pex_pat_ID; // } /** * @return the pex_height */ public int getPex_height() { return pex_height; } /** * @param pex_height the pex_height to set */ public void setPex_height(int pex_height) { this.pex_height = pex_height; } /** * @return the pex_weight */ public double getPex_weight() { return pex_weight; } /** * @param weight the pex_weight to set */ public void setPex_weight(double weight) { this.pex_weight = weight; } /** * @return the pex_pa_min */ public int getPex_pa_min() { return pex_pa_min; } /** * @param pex_pa_min the pex_pa_min to set */ public void setPex_pa_min(int pex_pa_min) { this.pex_pa_min = pex_pa_min; } /** * @return the pex_pa_max */ public int getPex_pa_max() { return pex_pa_max; } /** * @param pex_pa_max the pex_pa_max to set */ public void setPex_pa_max(int pex_pa_max) { this.pex_pa_max = pex_pa_max; } /** * @return the pex_fc */ public int getPex_fc() { return pex_fc; } /** * @param pex_fc the pex_fc to set */ public void setPex_fc(int pex_fc) { this.pex_fc = pex_fc; } /** * @return the pex_temp */ public double getPex_temp() { return pex_temp; } /** * @param pex_temp the pex_temp to set */ public void setPex_temp(double pex_temp) { this.pex_temp = pex_temp; } /** * @return the pex_sat */ public double getPex_sat() { return pex_sat; } /** * @param pex_sat the pex_sat to set */ public void setPex_sat(double pex_sat) { this.pex_sat = pex_sat; } /** * @return the pex_note */ public String getPex_note() { return pex_note; } /** * @param pex_note the pex_note to set */ public void setPex_note(String pex_note) { this.pex_note = pex_note; } @Override public int compareTo(PatientExamination o) { return this.pex_date.compareTo(o.getPex_date()); } public double getBMI() { if (pex_height != 0) { double temp = Math.pow(10, 2); // 2 <-- decimal digits; return Math.round((pex_weight / Math.pow(new Double(pex_height) / 100, 2)) * temp) / temp ; } else return 0; } }
d4e70195b53d6cef9e47cfb1d921df58bc413f8a
db23ec1e50400ddd4daf09cefdd5cbba1b8cd137
/N2225.java
30530c1673a366567d661b7ef33ba7ec991f846c
[]
no_license
yjeom/Baekjoon_study
899387cd120046c91ac55cab0d1f59201b2ab284
bc6df127d5e15f045c53fb2c833cb89b18004d31
refs/heads/master
2022-09-16T13:07:38.961642
2022-09-15T13:39:45
2022-09-15T13:39:45
239,285,770
0
0
null
null
null
null
UTF-8
Java
false
false
561
java
import java.util.Scanner; public class N2225 { public static void main(String[]args){ Scanner scan=new Scanner(System.in); int n=scan.nextInt(); int k=scan.nextInt(); int dp[][]=new int[k+1][n+1]; for(int i=0;i<=k;i++){ dp[i][0]=1; } for(int i=0;i<=n;i++){ dp[1][i]=1; } for(int i=2;i<=k;i++){ for(int j=1;j<=n;j++){ dp[i][j]=(dp[i][j-1]+dp[i-1][j])%1000000000; } } System.out.println(dp[k][n]); } }
36bce01f8a3fabbd95f8e8662a435a0e1b128ae6
6b817f034d0e2205b83530dde7a81acf6e649669
/cst438-3-frontend/src/main/java/cst438assignment2/Cst438assignment2Application.java
a587be1951d5bd49127bc3a2a20191659118aac0
[]
no_license
RobertM394/cst438-3-frontend
616e44d0a9a4d64d63afdc8da11d08c1d900769a
5c040ee61f3cbc413a42b47da16457199b5a2482
refs/heads/master
2023-04-24T00:26:18.330428
2021-05-18T23:38:52
2021-05-18T23:38:52
367,676,630
0
0
null
2021-05-18T22:35:44
2021-05-15T16:14:03
Java
UTF-8
Java
false
false
332
java
package cst438assignment2; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Cst438assignment2Application { public static void main(String[] args) { SpringApplication.run(Cst438assignment2Application.class, args); } }
709e8cf05ce5ecb95fe81a1057fb908e82f4817f
62b5f0ff1ff1af44d0bcf953ebdd3cc9e1a07f0e
/xmlintelledit/classes/src/org_eclipse_smarthome_schemas_thing_description_v1__0Simplified/ChannelGroupType.java
517fef578a0302876ac605ba0947da02d67ec4c5
[ "MIT" ]
permissive
patrickneubauer/XMLIntellEdit
5014a2fa426116e42c7f4b318d636c3a48720059
5e4a0ad59b7e9446e7f79dcb32e09971c2193118
refs/heads/master
2021-01-12T01:56:56.595551
2018-11-10T00:35:14
2018-11-10T00:35:14
78,438,535
7
0
null
null
null
null
UTF-8
Java
false
false
7,369
java
/** */ package org_eclipse_smarthome_schemas_thing_description_v1__0Simplified; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Channel Group Type</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getLabel <em>Label</em>}</li> * <li>{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getDescription <em>Description</em>}</li> * <li>{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getCategory <em>Category</em>}</li> * <li>{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#isAdvanced <em>Advanced</em>}</li> * <li>{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getId <em>Id</em>}</li> * <li>{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getChannels <em>Channels</em>}</li> * </ul> * * @see org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.org_eclipse_smarthome_schemas_thing_description_v1__0SimplifiedPackage#getChannelGroupType() * @model annotation="http://www.eclipse.org/emf/2002/Ecore constraints='patternId'" * annotation="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot patternId='self.id.matches(\'[A-Za-z0-9\\\\-_]+\')'" * @generated */ public interface ChannelGroupType extends EObject { /** * Returns the value of the '<em><b>Label</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Label</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Label</em>' attribute. * @see #setLabel(String) * @see org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.org_eclipse_smarthome_schemas_thing_description_v1__0SimplifiedPackage#getChannelGroupType_Label() * @model required="true" * @generated */ String getLabel(); /** * Sets the value of the '{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getLabel <em>Label</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Label</em>' attribute. * @see #getLabel() * @generated */ void setLabel(String value); /** * Returns the value of the '<em><b>Description</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Description</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Description</em>' attribute. * @see #setDescription(String) * @see org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.org_eclipse_smarthome_schemas_thing_description_v1__0SimplifiedPackage#getChannelGroupType_Description() * @model * @generated */ String getDescription(); /** * Sets the value of the '{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getDescription <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Description</em>' attribute. * @see #getDescription() * @generated */ void setDescription(String value); /** * Returns the value of the '<em><b>Category</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Category</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Category</em>' attribute. * @see #setCategory(String) * @see org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.org_eclipse_smarthome_schemas_thing_description_v1__0SimplifiedPackage#getChannelGroupType_Category() * @model * @generated */ String getCategory(); /** * Sets the value of the '{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getCategory <em>Category</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Category</em>' attribute. * @see #getCategory() * @generated */ void setCategory(String value); /** * Returns the value of the '<em><b>Advanced</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Advanced</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Advanced</em>' attribute. * @see #setAdvanced(boolean) * @see org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.org_eclipse_smarthome_schemas_thing_description_v1__0SimplifiedPackage#getChannelGroupType_Advanced() * @model * @generated */ boolean isAdvanced(); /** * Sets the value of the '{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#isAdvanced <em>Advanced</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Advanced</em>' attribute. * @see #isAdvanced() * @generated */ void setAdvanced(boolean value); /** * Returns the value of the '<em><b>Id</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Id</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Id</em>' attribute. * @see #setId(String) * @see org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.org_eclipse_smarthome_schemas_thing_description_v1__0SimplifiedPackage#getChannelGroupType_Id() * @model required="true" * @generated */ String getId(); /** * Sets the value of the '{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getId <em>Id</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Id</em>' attribute. * @see #getId() * @generated */ void setId(String value); /** * Returns the value of the '<em><b>Channels</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Channels</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Channels</em>' containment reference. * @see #setChannels(Channels) * @see org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.org_eclipse_smarthome_schemas_thing_description_v1__0SimplifiedPackage#getChannelGroupType_Channels() * @model containment="true" required="true" * @generated */ Channels getChannels(); /** * Sets the value of the '{@link org_eclipse_smarthome_schemas_thing_description_v1__0Simplified.ChannelGroupType#getChannels <em>Channels</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Channels</em>' containment reference. * @see #getChannels() * @generated */ void setChannels(Channels value); } // ChannelGroupType
eab8de0aad840fad004913d377d268e3e5255e98
d43e81dbff6d4c0582fbbf676287d5a3914530c3
/src/main/java/com/epam/jwd/task_2/text/SentenceAfterParsing.java
043059ba1d9de181a7c3677519e4e6ac495b12fb
[]
no_license
AleksandrBohan/Task2_test
2b7ff5c4a3dda2676d9e6e6a3ec75d6aa59e1c54
0a00b3e09b04beb458721a57bd672527636726aa
refs/heads/main
2023-07-14T12:02:29.336666
2021-08-22T10:53:41
2021-08-22T10:53:41
398,774,725
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package com.epam.jwd.task_2.text; import com.epam.jwd.task_2.exceptions.WrongFileName; import java.io.IOException; public class SentenceAfterParsing { private String pathToFile; public SentenceAfterParsing(String pathToFile) throws IOException, WrongFileName { setPathToFile(pathToFile); //TODO new WordsPa().parseIt(pathToFile, WordsPa.getWordParser()); } public String getPathToFile() { return pathToFile; } public void setPathToFile(String pathToFile) { this.pathToFile = pathToFile; } }
090576473150adc302c12fc7a6cd44b24470e343
3c0844c81057d2ea743d7d42d22923e54b0f1619
/src/leetCode/stackRecursionAndQueue/minStack155/MinStack.java
d345e7463e257915ce2601fa1cecb7878044b7e1
[]
no_license
gcczuis/DataStructureAndAlgorithm
75ce455479e3cfc764f8dbe2ccbe2edbc83d3dbb
37270dc236f904228f74072ec947270e0bac292f
refs/heads/master
2020-03-28T15:28:57.747085
2019-07-12T12:49:47
2019-07-12T12:49:47
148,598,337
1
0
null
null
null
null
UTF-8
Java
false
false
865
java
package leetCode.stackRecursionAndQueue.minStack155; import java.util.Stack; /** * {@author: gcc} * {@Date: 2019/6/19 10:49} */ public class MinStack { int min = Integer.MAX_VALUE; Stack<Integer> stack = new Stack<Integer>(); public void push(int x) { // only push the old minimum value when the current // minimum value changes after pushing the new value x if(x <= min){ stack.push(min); min=x; } stack.push(x); } public void pop() { // if pop operation could result in the changing of the current minimum value, // pop twice and change the current minimum value to the last minimum value. if(stack.pop() == min) min=stack.pop(); } public int top() { return stack.peek(); } public int getMin() { return min; } }
781f8024f861efae9765052ff75d7ef4d0b15890
fd37da06db73f2704f9dcca93db71d99a583f8cc
/Java-Book-Practices/src/chapter13practices/Ex16.java
9aa0a7e50df6bd7c10715fd1b2efec201f519605
[]
no_license
SergiyEnsary/Thinking-In-Java-Exercises
9d0b30a884d385a9d45b78fa62328aa18b578efb
9dcd60bd5dd851ed7b97131615d835e0bfb45387
refs/heads/master
2020-05-31T19:12:17.033435
2019-11-26T02:14:33
2019-11-26T02:14:33
190,451,924
0
0
null
null
null
null
UTF-8
Java
false
false
171
java
package chapter13practices; public class Ex16 { public static void main(String[] args) { for(int i = 0; i < 15; i++) System.out.println(Coffee.createRandom()); } }
e4687abb42f3c67b4c3db82d791ca5a361425815
b0e0163d6a2d435e0e1e8be2db1812f0cf36b234
/lib/src/main/java/com/blanke/xsocket/tcp/client/helper/stickpackage/StaticLenStickPackageHelper.java
6bd9a97b25db0cb1b299fc44f87176739fb16c29
[ "Apache-2.0" ]
permissive
find-happiness/XAndroidSocket
a54be7a61ce0112bc38f9cd1db37eccef4f2a8ff
99e48f4be5fdf84bc6c2225ebd4d27b1a498c9d2
refs/heads/master
2020-03-31T19:50:14.471107
2018-10-11T11:12:01
2018-10-11T11:12:01
152,513,825
0
0
Apache-2.0
2018-10-11T01:40:55
2018-10-11T01:40:55
null
UTF-8
Java
false
false
963
java
package com.blanke.xsocket.tcp.client.helper.stickpackage; import java.io.IOException; import java.io.InputStream; /** * 定长的粘包处理 * 例:协议规定每次包的长度为 16 */ public class StaticLenStickPackageHelper implements AbsStickPackageHelper { private int stackLen = 32; public StaticLenStickPackageHelper(int stackLen) { this.stackLen = stackLen; } @Override public byte[] execute(InputStream is) { int count = 0; int len = -1; byte temp; byte[] result = new byte[stackLen]; try { while (count < stackLen && (len = is.read()) != -1) { temp = (byte) len; result[count] = temp; count++; } if (len == -1) { return null; } } catch (IOException e) { e.printStackTrace(); return null; } return result; } }
7fe6b06bceadd6406e6b568109d1d4a1795759f8
eef1297da46d45810e538badf753ed107e1402e8
/ParentModule/Web_Manager_Module/src/main/java/com/wpf/web/controller/cargo/ExportController.java
3fafbaace8216861067407d91be53fde58131019
[]
no_license
StevenFlyGit/MySaasExportProject
6df982368785953ca48aab1a552964b807e834c0
a896000df56c6228f4d83f88e70c0043cf8e7f65
refs/heads/master
2023-01-14T18:40:45.703130
2020-11-21T00:14:11
2020-11-21T00:14:11
309,135,800
0
0
null
null
null
null
UTF-8
Java
false
false
13,806
java
package com.wpf.web.controller.cargo; import com.alibaba.dubbo.config.annotation.Reference; import com.github.pagehelper.PageInfo; import com.wpf.domain.cargo.*; import com.wpf.domain.system.User; import com.wpf.service.cargo.ContractService; import com.wpf.service.cargo.ExportProductService; import com.wpf.service.cargo.ExportService; import com.wpf.service.cargo.FactoryService; import com.wpf.vo.ExportProductVo; import com.wpf.vo.ExportResult; import com.wpf.vo.ExportVo; import com.wpf.web.controller.BaseController; import com.wpf.web.util.BeanMapUtils; import net.sf.jasperreports.engine.*; import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; import org.apache.cxf.jaxrs.client.WebClient; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cglib.beans.BeanMap; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.ServletOutputStream; import javax.sql.DataSource; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.sql.SQLException; import java.util.*; /** * 创建时间:2020/11/16 * SassExport项目-Web层-Export控制器 * @author wpf */ @Controller @RequestMapping("/cargo/export") public class ExportController extends BaseController { @Reference ContractService contractService; @Reference ExportService exportService; @Reference ExportProductService exportProductService; @Reference FactoryService factoryService; /** * 分页查询已提交的Contract数据 * @param pageSize 一页显示的数据数量 * @param pageNum 前页码数 * @return page */ @RequestMapping("/contractList") public String surfAllSubmitContract(Model model, @RequestParam(defaultValue = "5") Integer pageSize, @RequestParam(defaultValue = "1") Integer pageNum) { //需要获取当用户所属的公司Id String companyId = getCompanyId(); //将查询条件设置为降序排序 ContractExample example = new ContractExample(); example.setOrderByClause("create_time desc"); //设置查询条件为companyId和state ContractExample.Criteria criteria = example.createCriteria(); criteria.andCompanyIdEqualTo(companyId); criteria.andStateEqualTo(1); PageInfo<Contract> pageInfo = contractService.findByPage(example, pageNum, pageSize); model.addAttribute("pageInfo", pageInfo); return "/cargo/export/export-contractList"; } @RequestMapping("/list") public String surfAllExport(Model model, @RequestParam(defaultValue = "5") Integer pageSize, @RequestParam(defaultValue = "1") Integer pageNum) { //需要获取当用户所属的公司Id String companyId = getCompanyId(); //将查询条件设置为降序排序 ExportExample example = new ExportExample(); example.setOrderByClause("create_time desc"); //设置查询条件为companyId和state ExportExample.Criteria criteria = example.createCriteria(); criteria.andCompanyIdEqualTo(companyId); PageInfo<Export> pageInfo = exportService.findByPage(example, pageNum, pageSize); model.addAttribute("pageInfo", pageInfo); return "cargo/export/export-list"; } /** * 跳转到确认报运的页面 * @param contractIds 需要报运的合同字符串 * @return */ @RequestMapping("toExport") public String jumpToExportPage(String contractIds) { request.setAttribute("contractIds", contractIds); return "cargo/export/export-toExport"; } @RequestMapping("/edit") public String submitToExport(Export export) { //设置合同的企业信息 export.setCompanyId(getCompanyId()); export.setCompanyName(getCompanyName()); User user = getLoginUser(); if (StringUtils.isEmpty(export.getId())) { //设置操作用户的相关信息 export.setCreateBy(user.getId()); export.setCreateDept(user.getDeptId()); exportService.save(export); } else { export.setUpdateBy(user.getId()); exportService.update(export); } return "redirect:/cargo/export/list"; } /** * 跳转到添加contract的页面,回显数据 * @param id 需要修改的合同的Id值 * @return page */ @RequestMapping("/toUpdate") public String jumpToUpdatePage(Model model, String id) { //查询到需要回显的数据 //查询报运单数据 Export export = exportService.findById(id); //查询报运商品数据 ExportProductExample exportProductExample = new ExportProductExample(); exportProductExample.createCriteria().andExportIdEqualTo(id); List<ExportProduct> exportProductList = exportProductService.findAll(exportProductExample); model.addAttribute("export", export); model.addAttribute("exportProductList", exportProductList); return "/cargo/export/export-update"; } /** * 提交合同,将合同的state属性修改为1 * @param id 需要提交的合同Id * @return page */ @RequestMapping("/submit") public String submitExport(String id) { //创建一个合同对象,并将其state属性值设为1 Export export = new Export(); export.setState(1); //设置Id值 export.setId(id); //直接使用动态sql的方法更新数据库,这样就不会影响到数据库中的其他字段 exportService.update(export); return "redirect:/cargo/export/list"; } /** * 取消合同,将合同的state属性修改为0 * @param id 需要提交的合同Id * @return page */ @RequestMapping("/cancel") public String cancelExport(String id) { //创建一个合同对象,并将其state属性值设为0 Export export = new Export(); export.setState(0); //设置Id值 export.setId(id); //直接使用动态sql的方法更新数据库,这样就不会影响到数据库中的其他字段 exportService.update(export); return "redirect:/cargo/export/list"; } @RequestMapping("/exportE") public String submitElectricExport(String id) { //根据id查询Export数据 Export export = exportService.findById(id); //封装ExportVo对象 ExportVo exportVo = new ExportVo(); BeanUtils.copyProperties(export, exportVo); //设置Id exportVo.setExportId(id); //获取结果商品集合,用于后面封装数据 List<ExportProductVo> productVoList = exportVo.getProducts(); //根据id查询报运单下的商品信息 ExportProductExample exportProductExample = new ExportProductExample(); exportProductExample.createCriteria().andExportIdEqualTo(id); List<ExportProduct> exportProductList = exportProductService.findAll(exportProductExample); if (exportProductList != null && exportProductList.size() > 0) { for (ExportProduct exportProduct : exportProductList) { ExportProductVo exportProductVo = new ExportProductVo(); BeanUtils.copyProperties(exportProduct, exportProductVo); //设置vo对象中的productId exportProductVo.setExportProductId(exportProduct.getId()); productVoList.add(exportProductVo); } } //通过webservice远程访问海关报运平台 WebClient.create("http://192.168.85.47:9001/ws/export/user").post(exportVo); //获取报运平台处理后的数据 ExportResult exportResult = WebClient. create("http://192.168.85.47:9001/ws/export/user/" + id).get(ExportResult.class); //调用dubbo的ExportService服务,修改本地数据库中的报运单数据 exportService.updateExportFromRemote(exportResult); return "redirect:/cargo/export/list"; } @RequestMapping("/exportPdf") @ResponseBody public void printPdf(@RequestParam("id") String exportId) throws JRException, IOException { //通过请求对象获取项目内的文件输入流 InputStream inputStream = request.getServletContext().getResourceAsStream("/jasper/export.jasper"); //通过Id查找需要打印的报运单数据 Export export = exportService.findById(exportId); //通过工具类,将export对象转换为map Map<String, Object> exportMap = new HashMap<>(); exportMap = BeanMapUtils.beanToMap(export); BeanMap beanMap = BeanMap.create(export); //查找出报运单下对应的商品数据 ExportProductExample exportProductExample = new ExportProductExample(); exportProductExample.createCriteria().andExportIdEqualTo(exportId); List<ExportProduct> exportProductList = exportProductService.findAll(exportProductExample); //根据厂家Id查询厂家名称 for (ExportProduct exportProduct : exportProductList) { Factory factory = factoryService.findById(exportProduct.getFactoryId()); exportProduct.setFactoryName(factory.getFactoryName()); } //将查询出来的List集合封装到狗仔jasperPrint对象的方法fillReport所需要的第三个DateSource参数中 JRDataSource jrDataSource = new JRBeanCollectionDataSource(exportProductList); //封装JasperPrint对象,将数据输出到pdf模板中 JasperPrint jasperPrint = JasperFillManager.fillReport(inputStream, exportMap, jrDataSource); //设置响应头并将文件以附件形式输出 response.setHeader("content-disposition", "attachment;fileName=exportPDF.pdf"); ServletOutputStream out = response.getOutputStream(); //以pdf的格式输出 JasperExportManager.exportReportToPdfStream(jasperPrint, out); //释放资源 out.close(); } //@RequestMapping("/exportPdf") @ResponseBody public void printTest1(@RequestParam("id") String exportId) throws JRException, IOException { InputStream input = request.getServletContext().getResourceAsStream("/jasper/export_test1.jasper"); Map<String, Object> map = new HashMap<>(); map.put("username", "小黑"); map.put("email", "black@"); map.put("companyName", "甲虫科技"); map.put("deptName", "市场部"); JRDataSource jrDataSource = new JREmptyDataSource(); JasperPrint jasperPrint = JasperFillManager.fillReport(input, map, jrDataSource); OutputStream out = response.getOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint, out); out.close(); } @Autowired DataSource dataSource; //用于获取数据库链接 //@RequestMapping("/exportPdf") @ResponseBody public void printTest2(@RequestParam("id") String exportId) throws JRException, IOException, SQLException { InputStream input = request.getServletContext().getResourceAsStream("/jasper/export_test2.jasper"); JasperPrint jasperPrint = JasperFillManager.fillReport(input, new HashMap<>(), dataSource.getConnection()); OutputStream out = response.getOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint, out); out.close(); } //@RequestMapping("/exportPdf") @ResponseBody public void printTest3(@RequestParam("id") String exportId) throws JRException, IOException, SQLException { InputStream input = request.getServletContext().getResourceAsStream("/jasper/export_test3.jasper"); List<User> list = new ArrayList<>(); for(int i=0;i<10;i++) { User user = new User(); user.setUserName("name"+i); user.setEmail(i+"@qq.com"); user.setCompanyName("企业"+i); user.setDeptName("部门"+i); list.add(user); } //将list封装到jrdatasource中 JRDataSource jrDataSource = new JRBeanCollectionDataSource(list); JasperPrint jasperPrint = JasperFillManager.fillReport(input, new HashMap<>(), jrDataSource); OutputStream out = response.getOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint, out); out.close(); } //@RequestMapping("/exportPdf") @ResponseBody public void printTest4(@RequestParam("id") String exportId) throws JRException, IOException, SQLException { InputStream input = request.getServletContext().getResourceAsStream("/jasper/export_test4.jasper"); Random random = new Random(); List<Map<String, Object>> list = new ArrayList<>(); for(int i=0;i<7;i++) { Map<String, Object> map = new HashMap<>(); map.put("title", "数据" + i); map.put("value", random.nextInt(100)); list.add(map); } //将list封装到jrdatasource中 JRDataSource jrDataSource = new JRBeanCollectionDataSource(list); JasperPrint jasperPrint = JasperFillManager.fillReport(input, new HashMap<>(), jrDataSource); OutputStream out = response.getOutputStream(); JasperExportManager.exportReportToPdfStream(jasperPrint, out); out.close(); } }
916fea16eafcc97f3f4969281df6cdf252315a80
4276fe5f1b91169ce510a4d74771dc5006e6668a
/Week_12/Biblioteca/src/cr/ac/ucenfotec/BL/MaterialOtro.java
3fb8f6230f97016a23c753c1c9c0e037e8082c85
[]
no_license
pablofonseca-dev/OOP
a58561a2afc34b821878626b7920656a09d45d6d
5e6d5d6de1f8aeb6c58901a02d8763f61e89eac1
refs/heads/master
2020-12-15T17:21:38.063360
2020-04-16T04:47:28
2020-04-16T04:47:28
235,191,633
0
0
null
null
null
null
UTF-8
Java
false
false
1,368
java
package cr.ac.ucenfotec.BL; public class MaterialOtro extends Material{ //CONSTRUCTOR POR DEFECTO public MaterialOtro(){ super(); } //CONSTRUCTOR COMPLETO public MaterialOtro(String signatura, String descripcion) { super.signatura = signatura; super.descripcion = descripcion; } //MÉTODO TO STRING @Override public String toString(){ StringBuilder builder = new StringBuilder(); builder.append("-MATERIAL OTRO-").append("\n"); builder.append("IDENTIFICACION").append("\t").append(":").append("\t").append(super.getSignatura()).append( "\n"); builder.append("DESCRIPCIÓN").append("\t").append(":").append("\t").append(super.getDescripcion()).append("\n"); return builder.toString(); } //MÉTODO TO CSV /** * Método que se encarga establecer los atributos en formato Comma-Separated-Values * * @return String en formato CSV */ @Override public String toCSV() { StringBuilder builder = new StringBuilder(); builder.append("Signatura").append(":").append(this.getSignatura()).append(","); builder.append("Descripcion").append(":").append(this.getDescripcion()).append(","); builder.append("TipoMaterial").append(":").append("Otro"); return builder.toString(); } }
d4fdf96cf014665851db10cbea02652a461eedfc
4d75f7a4774a0c2885d519c794050ff989b49cf6
/demo-service/src/main/java/com/han/knowledge/Synchronized/ThreadTest_02.java
32a38916f4dccd6252bcd31a5410a1f02d160fc3
[]
no_license
hyf456/demoTest
6b241bb0f0b99a739319e9c78b429935cff2e3dc
398cd2cb9c08d8b1357dd093d7ef22e2b7354c01
refs/heads/master
2023-04-11T04:40:56.212245
2023-03-19T04:55:01
2023-03-19T04:55:01
192,055,555
0
1
null
2022-12-10T05:53:00
2019-06-15T08:31:40
Java
UTF-8
Java
false
false
693
java
package com.han.knowledge.Synchronized; /** * Created by hp on 2017-05-24. */ public class ThreadTest_02 extends Thread { private String lock ; private String name; public ThreadTest_02(String name,String lock){ this.name = name; this.lock = lock; } @Override public void run() { synchronized (lock) { for(int i = 0 ; i < 3 ; i++){ System.out.println(name + " run......"); } } } public static void main(String[] args) { String lock = new String("test"); for(int i = 0 ; i < 5 ; i++){ new ThreadTest_02("ThreadTest_" + i,lock).start(); } } }
c06ffd9d2eed6b19bd4ac0ec42dbce571ba9218c
fdbf1c4bd021b75611f7a57febccb1a4a9ce4f86
/src/com/lu/Leet200.java
fb7600d13ff0e45459cec244a30031626c473836
[]
no_license
luyahui/LeetSolutions
ae97b498f48d80756684fd789162c53c44441102
a68473a679aaf1b9897c8b64918e6391cba1a830
refs/heads/master
2020-03-25T01:14:18.336740
2018-09-26T01:24:10
2018-09-26T01:24:10
143,227,192
0
0
null
null
null
null
UTF-8
Java
false
false
1,562
java
package com.lu; import java.util.LinkedList; import java.util.Queue; import java.util.Stack; public class Leet200 { private void search(int x, int y, char[][] grid, boolean[][] visited) { Stack<int[]> stack = new Stack<>(); stack.add(new int[]{x, y}); while (stack.size() > 0) { int[] arr = stack.pop(); visited[arr[0]][arr[1]] = true; if (arr[0] - 1 >= 0 && !visited[arr[0] - 1][arr[1]] && grid[arr[0] - 1][arr[1]] == '1') stack.add(new int[]{arr[0] - 1, arr[1]}); if (arr[0] + 1 < grid.length && !visited[arr[0] + 1][arr[1]] && grid[arr[0] + 1][arr[1]] == '1') stack.add(new int[]{arr[0] + 1, arr[1]}); if (arr[1] - 1 >= 0 && !visited[arr[0]][arr[1] - 1] && grid[arr[0]][arr[1] - 1] == '1') stack.add(new int[]{arr[0], arr[1] - 1}); if (arr[1] + 1 < grid[0].length && !visited[arr[0]][arr[1] + 1] && grid[arr[0]][arr[1] + 1] == '1') stack.add(new int[]{arr[0], arr[1] + 1}); } } public int numIslands(char[][] grid) { boolean[][] visited = new boolean[grid.length][grid[0].length]; int result = 0; for (int x = 0; x < grid.length; x++) { for (int y = 0; y < grid[0].length; y++) { if (visited[x][y]) continue; if (grid[x][y] == '0') continue; result++; search(x, y, grid, visited); } } return result; } }
f6d726e796bdb8d708e8e4e3d7a212aa86f2a446
01b6fc2cabc9ba66efc5fe2cc7b17e446f6be275
/src/main/java/org/ashish/ns/gateway/web/rest/vm/LoggerVM.java
1bcda961657e0cef05652f682c844d25b53e278b
[]
no_license
ashgupta1489/ns-gateway
4ddad328e05dee23cdbb768c503acc033a4385dc
a6e2b12160fa05f66777386ba3eefcc8e79f9865
refs/heads/master
2020-04-07T06:21:32.946995
2018-11-18T22:14:37
2018-11-18T22:14:37
158,131,783
0
0
null
2018-11-18T22:14:38
2018-11-18T22:09:43
Java
UTF-8
Java
false
false
889
java
package org.ashish.ns.gateway.web.rest.vm; import ch.qos.logback.classic.Logger; /** * View Model object for storing a Logback logger. */ public class LoggerVM { private String name; private String level; public LoggerVM(Logger logger) { this.name = logger.getName(); this.level = logger.getEffectiveLevel().toString(); } public LoggerVM() { // Empty public constructor used by Jackson. } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLevel() { return level; } public void setLevel(String level) { this.level = level; } @Override public String toString() { return "LoggerVM{" + "name='" + name + '\'' + ", level='" + level + '\'' + '}'; } }
fa7f50ce56a0fa82a3fc65250b72cfff4250cab9
8d86236fdae145e11fcf0cf863d707b53a0c4deb
/traffic-visualization/src/main/java/edu/utdallas/mavs/traffic/visualization/vis3D/vo/Skybox.java
f01a80665d251708d99a22627dc7aa6dd5d16f31
[]
no_license
pragati99/traffic
adfc37bbd910cb910793545b2ddd48fb5565675e
47a64eaed460114930dd99c159c3b6c4a879966b
refs/heads/master
2021-05-02T00:28:54.563462
2018-02-16T08:33:21
2018-02-16T08:33:21
120,945,216
0
0
null
null
null
null
UTF-8
Java
false
false
4,775
java
package edu.utdallas.mavs.traffic.visualization.vis3D.vo; import java.util.concurrent.Callable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jme3.app.Application; import com.jme3.asset.AssetManager; import com.jme3.math.Vector3f; import com.jme3.renderer.queue.RenderQueue.Bucket; import com.jme3.scene.Node; import com.jme3.scene.Spatial; import com.jme3.texture.Texture; import com.jme3.util.SkyFactory; import edu.utdallas.mavs.divas.core.config.VisConfig; import edu.utdallas.mavs.divas.visualization.vis3D.BaseApplication; import edu.utdallas.mavs.divas.visualization.vis3D.Visualizer3DApplication; import edu.utdallas.mavs.traffic.simulation.config.TrafficVisConfig; import edu.utdallas.mavs.traffic.simulation.config.SkyboxEnum; /** * This class describes the skybox of the 3D visualization. */ public class Skybox { private final static Logger logger = LoggerFactory.getLogger(Skybox.class); private static Spatial sky; private Skybox() {} /** * Unloads the skybox in the visualization */ public static void unloadSky() { try { Visualizer3DApplication.getInstance().getApp().enqueue(new Callable<Object>() { @Override public Object call() throws Exception { dettachSky(); return null; } }); } catch(Exception e) { e.printStackTrace(); } } private static void dettachSky() { Visualizer3DApplication.getInstance().getApp().getRootNode().detachChild(sky); } /** * Loads the skybox in the visualization */ public static void loadSky() { try { Visualizer3DApplication.getInstance().getApp().enqueue(new Callable<Object>() { @Override public Object call() throws Exception { updateSky(); return null; } }); } catch(Exception e) { e.printStackTrace(); } } private static void updateSky() { Application app = Visualizer3DApplication.getInstance().getApp(); AssetManager assetManager = app.getAssetManager(); SkyboxEnum skyboxName = VisConfig.getInstance().getCustomProperty(TrafficVisConfig.SKYBOX); String skyboxPath = String.format("skybox/%s/", skyboxName.toString()); try { if(skyboxName.equals(SkyboxEnum.Sunny) || skyboxName.equals(SkyboxEnum.Sunny_Nature) || skyboxName.equals(SkyboxEnum.Cloudy) || skyboxName.equals(SkyboxEnum.Dusk) || skyboxName.equals(SkyboxEnum.Night_Red) || skyboxName.equals(SkyboxEnum.Night_Stars) || skyboxName.equals(SkyboxEnum.Rise) || skyboxName.equals(SkyboxEnum.Sunny_Sea) || skyboxName.equals(SkyboxEnum.Sunset)) { Texture west = assetManager.loadTexture(String.format("%sW.jpg", skyboxPath)); Texture east = assetManager.loadTexture(String.format("%sE.jpg", skyboxPath)); Texture north = assetManager.loadTexture(String.format("%sN.jpg", skyboxPath)); Texture south = assetManager.loadTexture(String.format("%sS.jpg", skyboxPath)); Texture up = assetManager.loadTexture(String.format("%sU.jpg", skyboxPath)); Texture down = assetManager.loadTexture(String.format("%sD.jpg", skyboxPath)); sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down, Vector3f.UNIT_XYZ); } else { Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg"); Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg"); Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg"); Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg"); Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg"); Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg"); sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down, Vector3f.UNIT_XYZ); } if(sky != null) { sky.setQueueBucket(Bucket.Sky); Node node = ((BaseApplication<?,?>) app).getRootNode(); node.attachChild(sky); } } catch(Exception e) { logger.error("Error occured when loading the skybox."); } } }
caf462e6ef8167b0135777c2116ea2eb3481dc35
e9cfc8048abd0c2b64cd3600cfa14de1901cd61e
/Android/app/src/main/java/com/magicalrice/adolph/kmovie/data/entities/BaseMember.java
a612779028948faafa4e387f32f819f897c16a7e
[]
no_license
adolphJane/KMovie
cc5640e8adc008302f38ed1248a71e22a191991b
ff95d0156ae03f8a56b82b565042a7dca23add34
refs/heads/master
2020-03-30T04:31:02.862694
2020-02-26T03:22:55
2020-02-26T03:22:55
150,747,323
0
0
null
null
null
null
UTF-8
Java
false
false
779
java
package com.magicalrice.adolph.kmovie.data.entities; public abstract class BaseMember { private int id; private String credit_id; private String name; private String profile_path; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getCredit_id() { return credit_id; } public void setCredit_id(String credit_id) { this.credit_id = credit_id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getProfile_path() { return profile_path; } public void setProfile_path(String profile_path) { this.profile_path = profile_path; } }