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
1fff84f2783da2ea8396a672c18bae6d29a20de4
e596d8fb79d1888016239d0a77b67eadefa861c5
/app/src/main/java/com/example/ray/firebasepushnotifications/FirebaseMessagingService.java
c6b85db0d6ab3649759ee65002f16e5fd9fea94c
[]
no_license
HsuanChangHuang/FirebasePushNotifications
fab3d18d160c02fd18967ca0d84efeab61f092c2
c3fd27cdb73e067e721d475660762513058136b5
refs/heads/master
2021-04-26T23:55:41.871037
2018-03-05T07:27:45
2018-03-05T07:27:45
123,881,314
0
0
null
null
null
null
UTF-8
Java
false
false
1,983
java
package com.example.ray.firebasepushnotifications; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Intent; import android.support.v4.app.NotificationCompat; import com.google.firebase.messaging.RemoteMessage; /** * Created by Ray on 2018/3/5. */ public class FirebaseMessagingService extends com.google.firebase.messaging.FirebaseMessagingService { @Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); String messageTitle = remoteMessage.getNotification().getTitle(); String messageBody = remoteMessage.getNotification().getBody(); String click_action = remoteMessage.getNotification().getClickAction(); String dataMessage = remoteMessage.getData().get("message"); String dataFrom = remoteMessage.getData().get("from_user_id"); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this, getString(R.string.default_notification_channel_id)) .setSmallIcon(R.mipmap.ic_launcher_round) .setContentTitle(messageTitle) .setContentText(messageBody); //.setPriority(NotificationCompat.PRIORITY_DEFAULT); Intent resultIntent = new Intent(click_action); resultIntent.putExtra("message", dataMessage); resultIntent.putExtra("from_user_id", dataFrom); PendingIntent resultPendingIntent = PendingIntent.getActivity( this, 0, resultIntent, PendingIntent.FLAG_CANCEL_CURRENT ); mBuilder.setContentIntent(resultPendingIntent); int mNotificationId = (int)System.currentTimeMillis(); NotificationManager mNotifyMgr = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); mNotifyMgr.notify(mNotificationId, mBuilder.build()); } }
65cb5fe0f6cb181eca16ad6911f390a7a994e817
0ce855c42aa973ab6944a8ee45df54f44b9ccaae
/core/src/com/alejandro/game/Utils.java
43c26f5fdaeb5dc8c7ed71b0526f5f7333cf48d2
[]
no_license
apulido5/game
6a40f94349505fef7aeb22388685ea754761c59c
ebbc5c46a31a3aef59c76af9dd99bd3a3a83925d
refs/heads/master
2023-05-06T17:46:31.882387
2021-05-23T11:34:53
2021-05-23T11:34:53
370,035,935
0
0
null
null
null
null
UTF-8
Java
false
false
314
java
package com.alejandro.game; import java.util.Random; public class Utils { static Random random = new Random(); static boolean solapan(float x, float y, float w, float h, float x2, float y2, float w2, float h2) { return !(x > x2 + w2) && !(x + w < x2) && !(y > y2 + h2) && !(y + h < y2); } }
a549331de6709890e64bd772ed50fc37386e5c0f
0b15aa1b1933b4eae87c4c041604a45dd7e4d119
/src/main/java/com/ncTestService/converters/ECTFConverter.java
6f3888da1189296d99d209ec6044b2e70eae119d
[]
no_license
SemyontheSemyon/nc-test
690d0c2243f20a994e740aa2fc0c3454f20973d5
ade9cda6997295712ab8c04e0d0ef8dd1cea6deb
refs/heads/master
2022-10-03T16:15:57.196951
2019-09-24T09:30:51
2019-09-24T09:30:51
177,664,388
0
0
null
2022-09-08T00:59:45
2019-03-25T21:05:43
Java
UTF-8
Java
false
false
294
java
package com.ncTestService.converters; import com.ncTestService.DTO.ECTFDTO; import com.ncTestService.models.EnrollmentCityTestFormat; public interface ECTFConverter { ECTFDTO convertToDTO(EnrollmentCityTestFormat ectf); EnrollmentCityTestFormat convertFromDTO(ECTFDTO ectfdto); }
5965b15449d927a381aa270998dedd741cf510a3
62636dec929bd8f3f5d17abd64eb7a2b040def30
/app/src/main/java/gopdu/pdu/gopduversiondriver/modelresponse/MainActivityResponse.java
283ed272943e29a293cbbb4d9eea7b60d5fedaf6
[]
no_license
viking1998cp/GoPDUVersionDriver
bfc319d4c38c8ee071e04702e185511f3eaea55f
37005a55fa40e3fd453262197f7556b489567bd9
refs/heads/master
2021-03-25T21:21:48.726093
2020-05-05T01:53:56
2020-05-05T01:53:56
247,646,719
0
0
null
null
null
null
UTF-8
Java
false
false
316
java
package gopdu.pdu.gopduversiondriver.modelresponse; import java.util.Map; public interface MainActivityResponse { void nullPhoneNumber(); void notNullPhoneNumber(Map<String, String> param); void avalidAccount(); void notAvalidAccount(String message); void logged(); void unLogged(); }
11c7dbc79648339292c4884f6aebaed89b3c6c09
e77777b387a7c9908956ac398652ba1ca3bfbf92
/src/main/java/com/axisdesignsolution/gateway/config/DateTimeFormatConfiguration.java
0ee9b5c2cd450e3ec2987a63ede604978e1a7e73
[]
no_license
leorajesh/AxisDesignSolutionWebApp
cc2de4952ac0ab61eb57ac2d73682e8a2e011eff
33c272dcc53814e42461872d1c0deec89d911fd4
refs/heads/master
2022-10-29T23:30:34.574700
2018-11-19T15:32:30
2018-11-19T15:32:30
158,247,664
0
0
null
2022-10-05T19:15:33
2018-11-19T15:32:21
Java
UTF-8
Java
false
false
737
java
package com.axisdesignsolution.gateway.config; import org.springframework.context.annotation.Configuration; import org.springframework.format.FormatterRegistry; import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /** * Configure the converters to use the ISO format for dates by default. */ @Configuration public class DateTimeFormatConfiguration implements WebMvcConfigurer { @Override public void addFormatters(FormatterRegistry registry) { DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); registrar.setUseIsoFormat(true); registrar.registerFormatters(registry); } }
dfb10cf1b388b50c3a8de8eb1dddf8c41b482cbd
f89a8ba7fb95c7fdbe0fd0d320c6cbf17a4df8e3
/设计模式/DecoratorPattern/src/com/decorator/PepsiDecorator.java
8e34cc178e2bdf5ae8fbd0cabfc5d339ace953e4
[]
no_license
RabbitTea/JavaWeb-project
f0f2ad17bc1f328188aac3b2412d9173c0377f06
ce841261f8fd9f065d8d0df9e84ed663d8bf9cdc
refs/heads/master
2020-04-09T08:37:33.398417
2019-04-30T14:23:03
2019-04-30T14:23:03
160,201,573
1
1
null
null
null
null
WINDOWS-1252
Java
false
false
272
java
package com.decorator; public class PepsiDecorator extends Decorator{ public PepsiDecorator(Drink drink) { super(drink); } public double price() { return drink.price() + 5.00; } public String name() { return "°ÙÊÂ" + drink.name(); } }
b216be49a316aa8dcf972c1303691344060a04e2
b51930a6e42c64c6b1efb1aba4e80743983e0d45
/app/src/main/java/com/muyunfan/mytaxil/model/OrderManagerImpl.java
52915540b60c32976183f25a44becfd497909085
[]
no_license
xinyuCai/MyTaxiL
49f5f2a855567501db6d9d9103748cfd0743fae5
a007cd0eb2ebdfddbd14055fe85c8b8bfb1bf10c
refs/heads/master
2021-08-14T17:08:24.400364
2017-11-16T08:57:34
2017-11-16T08:57:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,491
java
package com.muyunfan.mytaxil.model; import com.google.gson.Gson; import com.muyunfan.mytaxil.common.databus.RxBus; import com.muyunfan.mytaxil.common.http.API; import com.muyunfan.mytaxil.common.http.CommonHandler; import com.muyunfan.mytaxil.common.http.CommonRequest; import com.muyunfan.mytaxil.common.http.CommonResponse; import com.muyunfan.mytaxil.common.http.HttpConfig; import com.muyunfan.mytaxil.common.http.IHttpClient; import com.muyunfan.mytaxil.common.repository.Repository; import com.muyunfan.mytaxil.model.bean.Order; import com.muyunfan.mytaxil.model.bean.OrderOptMsg; import rx.functions.Func1; /** * 类名称:OrderManagerImpl * 类描述: * 创建人:L.C.W * 创建时间:on 17/3/25 15:53 * 修改人: * 修改时间: * 修改备注: */ public class OrderManagerImpl implements IOrderManager { private static final String TAG = "OrderManagerImpl"; private IHttpClient httpClient; public OrderManagerImpl(IHttpClient httpClient) { this.httpClient = httpClient; } @Override public void cancelOrder(final String id) { RxBus.getInstance().chainProcess(new Func1() { @Override public Object call(Object o) { CommonRequest commonRequest = new CommonRequest(HttpConfig.getCurrentDomain() + API.CANCEL_ORDER); commonRequest.setBody("id", id ); CommonResponse response = httpClient.post(commonRequest, new CommonHandler()); OrderOptMsg msg = new OrderOptMsg(); if (response.getStateCode() == CommonResponse.STATE_OK) { msg.setCode(OrderOptMsg.STATE_CANCEL_SUC); } else { msg.setCode(OrderOptMsg.STATE_CANCEL_FAIL); } return msg; } }); } @Override public void getProcessingOrder() { RxBus.getInstance().chainProcess(new Func1() { @Override public Object call(Object o) { CommonRequest commonRequest = new CommonRequest(HttpConfig.getCurrentDomain() + API.GET_PROCESSING_ORDERS); commonRequest.setBody("uid", new Repository().getAccountUID()); CommonResponse response = httpClient.get(commonRequest, new CommonHandler()); if (response.getStateCode() == CommonResponse.STATE_OK) { Order order = new Gson().fromJson(response.getData(), Order.class); return order.getData(); } return null; } }); } @Override public void paySuc(final Order.Data order) { RxBus.getInstance().chainProcess(new Func1() { @Override public Object call(Object o) { CommonRequest commonRequest = new CommonRequest(HttpConfig.getCurrentDomain() + API.CANCEL_ORDER); commonRequest.setBody("id", order.getOrderId() ); commonRequest.setBody("state", new Integer(Order.HAS_PAYED ).toString()); CommonResponse response = httpClient.post(commonRequest, new CommonHandler()); OrderOptMsg msg = new OrderOptMsg(); if (response.getStateCode() == CommonResponse.STATE_OK) { msg.setCode(OrderOptMsg.PAY_SUC); } else { msg.setCode(OrderOptMsg.PAY_FAIL); } return msg; } }); } }
cb2f06043d898c4cd85a99a5eb309091f9d03c0e
06becb52e2bed3c36a77f16bb913ac90fc9e1fae
/idmFitnesse/src/main/java/com/novell/www/resource/service/GetResourcessInfoRequest.java
f047efd3829a668d591e376518c1709da9c3d0df
[]
no_license
tschroeder13/idmFitnesse
6978104d9cc91d3ed1912d2cd998907c0f5d8fd7
76f36d10f2c48bdf67472ec29e5ef4d55bc8be46
refs/heads/master
2021-01-19T12:39:02.209540
2015-09-30T11:05:27
2015-09-30T11:05:27
41,288,047
0
0
null
2015-09-30T11:05:27
2015-08-24T07:11:45
Java
UTF-8
Java
false
false
4,342
java
/** * GetResourcessInfoRequest.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.novell.www.resource.service; public class GetResourcessInfoRequest implements java.io.Serializable { private com.novell.www.resource.service.DNString[] resDns; public GetResourcessInfoRequest() { } public GetResourcessInfoRequest( com.novell.www.resource.service.DNString[] resDns) { this.resDns = resDns; } /** * Gets the resDns value for this GetResourcessInfoRequest. * * @return resDns */ public com.novell.www.resource.service.DNString[] getResDns() { return resDns; } /** * Sets the resDns value for this GetResourcessInfoRequest. * * @param resDns */ public void setResDns(com.novell.www.resource.service.DNString[] resDns) { this.resDns = resDns; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof GetResourcessInfoRequest)) return false; GetResourcessInfoRequest other = (GetResourcessInfoRequest) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.resDns==null && other.getResDns()==null) || (this.resDns!=null && java.util.Arrays.equals(this.resDns, other.getResDns()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getResDns() != null) { for (int i=0; i<java.lang.reflect.Array.getLength(getResDns()); i++) { java.lang.Object obj = java.lang.reflect.Array.get(getResDns(), i); if (obj != null && !obj.getClass().isArray()) { _hashCode += obj.hashCode(); } } } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(GetResourcessInfoRequest.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.novell.com/resource/service", "getResourcessInfoRequest")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("resDns"); elemField.setXmlName(new javax.xml.namespace.QName("http://www.novell.com/resource/service", "resDns")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.novell.com/resource/service", "DNString")); elemField.setMinOccurs(0); elemField.setNillable(true); elemField.setItemQName(new javax.xml.namespace.QName("http://www.novell.com/resource/service", "dnstring")); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
ef8d254bec5a1709fbbe0a6c551e518094ff42d2
4537dc55414909eb20522d8972dd535e7f15db7f
/src/com/painless/pc/tracker/RotationLockTracker.java
e4bd5b4391f60939bfb57329a6b4e2c1d912f0c6
[ "MIT" ]
permissive
ggets/PowerToggles
a69ac98c807ce8c0c9761cb5b565e17c4b534f71
782ed2811848c36870f16e13cde25eb56974ffaf
refs/heads/master
2021-06-06T14:57:09.948727
2016-10-15T23:26:52
2016-10-15T23:26:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,066
java
package com.painless.pc.tracker; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.provider.Settings; import android.view.Surface; import android.view.WindowManager; import com.painless.pc.R; import com.painless.pc.RLPicker; import com.painless.pc.RLService; import com.painless.pc.singleton.Globals; public class RotationLockTracker extends AbstractTracker { private boolean mShowPrompt; public RotationLockTracker(int trackerId, SharedPreferences pref) { super(trackerId, pref, new int[] { COLOR_DEFAULT, R.drawable.icon_rotation_port, COLOR_DEFAULT, R.drawable.icon_rotation_land, COLOR_ON, R.drawable.icon_toggle_autorotate }); } @Override public void init(SharedPreferences pref) { mShowPrompt = pref.getBoolean("rotation_lock_prompt", true); } @Override public int getActualState(Context context) { final ContentResolver cr = context.getContentResolver(); if (isAutoRotate(cr) && (RLService.LOCK_VIEW == null)) { return STATE_ENABLED; } else { boolean isLandScapeDefault = isLandScapeDefault(context); boolean isPortrait = isLandScapeDefault ^ RLService.LOCK_VIEW == null; return isPortrait ? STATE_DISABLED : STATE_INTERMEDIATE; } } @Override public void toggleState(Context context) { if (mShowPrompt) { Globals.startIntent(context, Globals.setIncognetoIntent(new Intent(context, RLPicker.class))); } else { Intent i = new Intent(context, RLService.class); if (isAutoRotate(context.getContentResolver())) { context.stopService(i); } else if (RLService.LOCK_VIEW == null) { context.startService(i); } else { context.stopService(i); } RLPicker.setAutoRotate(context, 0); } } @Override protected void requestStateChange(Context context, boolean desiredState) { // Never Called } @Override public boolean shouldProxy(Context context) { return true; } @Override public String getStateText(int state, String[] states, String[] labelArray) { return states[7 + mDisplayNumber]; } public static final boolean isLandScapeDefault(Context ctx) { WindowManager lWindowManager = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE); Configuration cfg = ctx.getResources().getConfiguration(); int lRotation = lWindowManager.getDefaultDisplay().getRotation(); return (((lRotation == Surface.ROTATION_0) || (lRotation == Surface.ROTATION_180)) && (cfg.orientation == Configuration.ORIENTATION_LANDSCAPE)) || (((lRotation == Surface.ROTATION_90) || (lRotation == Surface.ROTATION_270)) && (cfg.orientation == Configuration.ORIENTATION_PORTRAIT)); } private static boolean isAutoRotate(final ContentResolver resolver) { return Settings.System.getInt(resolver, Settings.System.ACCELEROMETER_ROTATION, 1) == 1; } }
9ee362b82c56bb48f8c4345647c45e0064c86fea
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
/ast_results/open-keychain_open-keychain/libkeychain/src/main/java/org/sufficientlysecure/keychain/LibConstants.java
e1f20a6db4fa77ebb3a3aacd4d2fc27ab61acc6e
[]
no_license
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
0564143d92f8024ff5fa6b659c2baebf827582b1
refs/heads/master
2020-07-13T13:53:40.297493
2019-01-11T11:51:18
2019-01-11T11:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
464
java
// isComment package org.sufficientlysecure.keychain; import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.sufficientlysecure.libkeychain.BuildConfig; public final class isClassOrIsInterface { public static final boolean isVariable = isNameExpr.isFieldAccessExpr; public static final String isVariable = isNameExpr ? "isStringConstant" : "isStringConstant"; public static final String isVariable = isNameExpr.isFieldAccessExpr; }
2edfa34fdb68122ec6ff089c112bd6d37782288b
f13b71874679ac9dcce7f3b5d276598403101e37
/src/MainP.java
4c4a67d6befa497de14689d8db2ed4e541fa2b81
[]
no_license
edward877/os2
10d6c31c32ba2ee643269d273dc8c82544b1b495
0459456b0fb7a95097f7e9c071d0d1e8482b415f
refs/heads/master
2021-01-23T17:08:32.762672
2017-09-07T16:59:38
2017-09-07T16:59:38
102,763,275
0
0
null
null
null
null
WINDOWS-1251
Java
false
false
8,639
java
import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.table.DefaultTableModel; import javax.swing.JButton; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Random; import java.awt.event.ActionEvent; import javax.swing.JScrollPane; import javax.swing.JTable; import java.awt.Color; import javax.swing.ListSelectionModel; import java.awt.Font; import javax.swing.JLabel; import javax.swing.JEditorPane; import javax.swing.*; import javax.swing.border.BevelBorder; public class MainP { private JFrame frame; private MMU mmu = new MMU(); final static int quantum = 20; Virtual virtual = new Virtual(); Swap swap = new Swap(); Random r; private DefaultTableModel tableModel = new DefaultTableModel(); JEditorPane editorPaneRight; JButton btnPause; JButton btnStart; JButton btnCreate; public MainP() { initialize(); frame.setVisible(true); JScrollPane scrollPane_2 = new JScrollPane(); scrollPane_2.setBounds(507, 46, 438, 471); frame.getContentPane().add(scrollPane_2); table = new JTable(); table.setEnabled(false); table.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null)); table.setFont(new Font("Tahoma", Font.PLAIN, 13)); table.setRowHeight(40); table.setModel(tableModel); table.setCellSelectionEnabled(true); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setFillsViewportHeight(true); table.setColumnSelectionAllowed(true); table.setBackground(Color.WHITE); table.setBounds(474, 22, 242, 140); tableModel.setRowCount(0); tableModel.setColumnCount(0); for(int i=0; i < MMU.PhysMemb; i++){ tableModel.addColumn((i+1) +""); } scrollPane_2.setViewportView(table); JLabel label = new JLabel("\u043F\u0440\u043E\u0446\u0435\u0441\u0441\u044B \u0438 \u043F\u043E\u0442\u043E\u043A\u0438"); label.setFont(new Font("Tahoma", Font.PLAIN, 18)); label.setBounds(45, 11, 168, 23); frame.getContentPane().add(label); JLabel label_1 = new JLabel("\u0445\u043E\u0434 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F"); label_1.setFont(new Font("Tahoma", Font.PLAIN, 18)); label_1.setBounds(270, 11, 150, 23); frame.getContentPane().add(label_1); JLabel label_2 = new JLabel("\u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u043F\u0430\u043C\u044F\u0442\u044C"); label_2.setFont(new Font("Tahoma", Font.PLAIN, 18)); label_2.setBounds(645, 14, 207, 23); frame.getContentPane().add(label_2); btnPause = new JButton("stop"); btnPause.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { btnPause.setEnabled(false); btnStart.setEnabled(true); timerAction.stop(); } }); btnPause.setEnabled(false); btnPause.setBounds(584, 528, 96, 23); frame.getContentPane().add(btnPause); btnStart = new JButton("start"); btnStart.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { btnPause.setEnabled(true); btnStart.setEnabled(false); timerAction.start(); } }); btnStart.setEnabled(false); btnStart.setBounds(679, 528, 96, 23); frame.getContentPane().add(btnStart); } /** * Initialize the contents of the frame. */ private void initialize() { frame = new JFrame(); frame.setBounds(100, 100, 1063, 601); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); JScrollPane scrollPane_1 = new JScrollPane(); scrollPane_1.setBounds(21, 45, 202, 472); frame.getContentPane().add(scrollPane_1); JTextArea textAreaLeft = new JTextArea(); scrollPane_1.setViewportView(textAreaLeft); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(233, 45, 251, 472); frame.getContentPane().add(scrollPane); editorPaneRight = new JEditorPane("text/html", ""); scrollPane.setViewportView(editorPaneRight); btnCreate = new JButton("\u043D\u0430\u0447\u0430\u0442\u044C"); btnCreate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { editorText = ""; editorPaneRight.setText(editorText); btnCreate.setEnabled(false); btnPause.setEnabled(true); table_process.clear(); tableModel.setRowCount(0); createProcesses(); textAreaLeft.setText( ShowProcess() ); online_process = table_process.size(); timerAction.start(); } }); btnCreate.setBounds(404, 528, 89, 23); frame.getContentPane().add(btnCreate); } String editorText; ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { ShowActing(); editorPaneRight.setText(editorText); } }; ArrayList<Process> table_process = new ArrayList<>(); private JTable table;; Timer timerAction = new Timer(500, listener); private void createProcesses() { r = new Random(); int n = r.nextInt(2) + 3; for(int i = 0; i < n ; i++) { table_process.add(new Process(r,quantum, virtual)); } } private String ShowProcess() { String text = ""; for(int i = 0; i < table_process.size(); i++) { Process p = table_process.get(i); text += "процесс " + (i+1); text += ". time = " + p.getTime_process() + " "; text += "priotity = " + p.getPriority() + "\n"; for(int j = 0; j < p.getTableStream().size(); j++) { Stream s = p.getTableStream().get(j); text += "\tПоток " + (j+1) + ". time = " +s.getTime_stream() + "\n"; } text += "\n"; } return text; } int online_process; private void ShowActing() { String text = ""; if(online_process <= 0) { timerAction.stop(); btnCreate.setEnabled(true); btnPause.setEnabled(false); return; } int maxP = 0; //первый процесс с оставшимся временем for(int l = 0; l < table_process.size(); l++) { if(table_process.get(l).getTime_process()!=0){ maxP = l; break; } } //ищем более приоритетный процесс for(int l = 0; l < table_process.size(); l++) { if(table_process.get(l).getTime_process()!=0){ if(table_process.get(l).getPriority() > table_process.get(maxP).getPriority()){ maxP = l; } } } Process p = table_process.get(maxP); if(p.getTime_process()!=0) { p.setQuantum(quantum); text += "процесс " + (maxP+1) + ". "; text += "priotity = " + p.getPriority() + "<br>"; for(int i =0; i < r.nextInt(3)+1; i++){ text +=mmu(p); } for(int j = 0; j < p.getTableStream().size(); j++) { Stream s = p.getTableStream().get(j); if(s.getTime_stream()!=0){ p.setTime_stream(j); text += " Поток " + (j+1) + ". "; int time_stream = s.getTime_stream(); if(time_stream==0){ text += "закончился<br>"; }else{ text += "time = " + time_stream + "<br>"; } } } p.setTime_process(); if(p.getTime_process()==0){ text += "ПРОЦЕСС закончился!<br>"; online_process--; } text += "_______________________________<br>"; } p.PriorityMinus(); editorText+= text; } private String mmu(Process process) { String text = ""; //получаем страницу процесса с случайным индексом ArrayList<Integer> array = process.getListPage(); int randIndex = r.nextInt(array.size()); Page page = virtual.getPageTables().get(array.get(randIndex)); text += "<b>Страница "+ page.getId() + " </b><br>"; // Если страницы еще нет в физ памяти, то if(!mmu.getPageBlocks().contains(page)){ int indexEmptyBlock = mmu.emptyBlock(); // Если в физ памяти есть место, то добавляем туда страницу if (indexEmptyBlock >=0) { mmu.addPage(indexEmptyBlock, page); }else{ //если страница в свапе, то выгружаем оттуда if(swap.getSwap().contains(page)){ swap.RemoveFromSwap(page); } //добавление в физ память на место старой выбранной страницы //и добавление старой страницы в свап swap.addPageSwap(mmu.ReplacePage(page)); } //таблица физ памяти ArrayList<String> pageBlocks = new ArrayList<>(); for (Page pageblock : mmu.getPageBlocks()) { if(pageblock!=null) pageBlocks.add(pageblock.getId() + " "); } tableModel.addRow(pageBlocks.toArray()); } //бит присутствия делаем единицей page.setR(true); return text; } }
43b6d688a5d87acda561a8dda85250b06e2bb3f6
e2828b3177b195a6fdf3515c5a8b3a8dd7a30f88
/iihtmaven/src/test/java/com/iiht/IihtMavenApplicationTests.java
68576b55acd65fb32c8fb2596b80e6b99387aa7d
[]
no_license
satyavinn/IIHT
5239627287d664040e7e4496bacc541db6cc9106
e52b936014a68284abc12930c3bc11d6bf018a6e
refs/heads/master
2020-06-02T14:40:43.788296
2019-06-10T15:48:24
2019-06-10T15:48:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
328
java
package com.iiht; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class IihtMavenApplicationTests { @Test public void contextLoads() { } }
76848af504d24351bac6348577d57cb835be07af
68374eb2631cb33ccd8d7924a16bfb79ad08040a
/core/src/test/java/com/gengoai/hermes/annotator/DocumentProvider.java
1df6c1f9cdf60413e5e665fe30a4ccaf33d445c8
[ "Apache-2.0" ]
permissive
gengoai/hermes
92f413788f2870b51369b440d8e479824bdd3ce0
78f48e9edee397907d7ac0bda32fb5ea24f6be4a
refs/heads/master
2021-06-02T06:27:26.783582
2020-07-31T16:47:23
2020-07-31T16:47:23
130,230,032
2
1
Apache-2.0
2020-05-03T15:02:55
2018-04-19T14:41:39
Java
UTF-8
Java
false
false
3,629
java
/* * (c) 2005 David B. Bracewell * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.gengoai.hermes.annotator; import com.gengoai.Language; import com.gengoai.hermes.Document; import com.gengoai.hermes.DocumentFactory; import com.gengoai.hermes.Types; /** * @author David B. Bracewell */ public interface DocumentProvider { static Document getAnnotatedDocument() { Document doc = getDocument(); doc.annotate(Types.TOKEN, Types.SENTENCE); return doc; } static Document getAnnotatedEmoticonDocument() { Document doc = DocumentFactory.getInstance().create("I had a great time at the party ;-). " + "See all the video at http://www.somevideo.com/video.html " + "I don't even mind being out $100.", Language.ENGLISH); doc.annotate(Types.TOKEN, Types.SENTENCE); doc.setCompleted(Types.PART_OF_SPEECH, "a"); return doc; } static Document getChineseDocument() { return DocumentFactory.getInstance().fromTokens(Language.CHINESE, "我", "爱", "你"); } static Document getDocument() { return DocumentFactory.getInstance().create( " Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or " + "twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, " + "'and what is the use of a book,' thought Alice 'without pictures or conversations?'\n" + "So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy " + "and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and " + "picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her.\n" + "There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear " + "the Rabbit say to itself, 'Oh dear! Oh dear! I shall be late!' (when she thought it over afterwards, it " + "occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but " + "when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, " + "Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either " + "a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after " + "it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge.\n" ); } }//END OF DocumentProvider
5addddd6bd1cd8052963100385f86095782dd5ce
a2a4f843b0d3ad1aa091e81cfe85b54731781b14
/src/main/java/us/sroysf/DedupAnalyzer.java
98a7a94fb5f4e4cbcfbddc6f9e87546904458a6c
[]
no_license
ryrynsb/photo-dedup
ad44821f492d2219365d3b12db7c8537d82db885
fe6a26296453c3e7e9385a501e0bb3ebdcff84b8
refs/heads/master
2020-03-21T14:03:21.392137
2017-06-03T18:05:08
2017-06-03T18:05:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,707
java
package us.sroysf; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; import java.util.stream.Stream; /** * Created by sroy on 2/24/17. */ public class DedupAnalyzer { private static final Logger log = LoggerFactory.getLogger(DedupAnalyzer.class); private Map<String, List<FileInfo>> fileDB; private List<FileInfo> tinyFiles; private boolean deleteDuplicates; private Path root; private Set<String> mutablePaths; public DedupAnalyzer(Path root, String... mutableDirs) throws IOException { this.root = root; this.fileDB = new HashMap<>(); this.tinyFiles = new ArrayList<>(); this.mutablePaths = new HashSet<>(); this.deleteDuplicates = deleteDuplicates; for (int i=0; i < mutableDirs.length; i++) { Path resolved = root.resolve(mutableDirs[i]); if (!Files.isDirectory(resolved)) { throw new IOException("Bad mutable dir: " + mutableDirs[i]); } mutablePaths.add(resolved.toAbsolutePath().toString()); } } public void setDeleteDuplicates(boolean deleteDuplicates) { this.deleteDuplicates = deleteDuplicates; } public void analyze() throws IOException { gatherFileData(root); printReport(); } private void printReport() { printTinyFiles(); printDuplicates(); } private void printTinyFiles() { System.out.println("================================"); System.out.println(" Tiny Files"); System.out.println("================================"); tinyFiles.forEach(fileInfo -> { Path filePath = fileInfo.getPath(); if (isMutablePath(filePath)) { if (filePath.getFileName().toString().startsWith(".")) { System.out.println(String.format("DELETING ===> %s [%d]", filePath, fileInfo.getSize())); try { if (Files.exists(filePath)) { Files.delete(filePath); } } catch (IOException e) { log.error("", e); } } else { System.out.println(String.format("%s [%d]", filePath, fileInfo.getSize())); } } }); } private void printDuplicates() { System.out.println("================================"); System.out.println(" Duplicates"); System.out.println("================================"); fileDB.forEach((key, dups) -> { if ((dups.size() > 1) && containsMutablePath(dups)) { System.out.println("========"); dups.forEach(fileInfo -> { System.out.println(String.format("%s [%d]", fileInfo.getPath(), fileInfo.getSize())); }); deleteDuplicates(dups); } }); } private void deleteDuplicates(List<FileInfo> dups) { Collections.sort(dups, Comparator.comparing(o -> o.getPath().toAbsolutePath().toString())); int numDeletes = 0; for (FileInfo dup : dups) { if (isMutablePath(dup.getPath())) { System.out.printf("\tSuggested delete: %s\n", dup.getPath()); if (this.deleteDuplicates) { try { if (Files.exists(dup.getPath())) { Files.delete(dup.getPath()); System.out.printf("\t\tFile deleted: %s\n", dup.getPath()); } } catch (IOException e) { log.error("", e); } } numDeletes++; if (numDeletes == (dups.size()-1)) { break; } } } } private boolean containsMutablePath(List<FileInfo> dups) { for (FileInfo fileInfo : dups) { if (isMutablePath(fileInfo.getPath())) { return true; } } return false; } private boolean isMutablePath(Path path) { for (String prefix : mutablePaths) { if (path.toAbsolutePath().toString().startsWith(prefix)) { return true; } } return false; } public void gatherFileData(Path dir) throws IOException { Stream<Path> list = Files.list(dir); list.forEach(entry -> { try { if (Files.isDirectory(entry)) { gatherFileData(entry); } else if (Files.isRegularFile(entry)) { addFile(entry); } } catch (Exception ex) { log.error("", ex); } }); } private void addFile(Path entry) throws IOException { if (isMutablePath(entry) && entry.getFileName().toString().startsWith(".DS_Store")) { System.out.println(String.format("DELETING ===> %s", entry)); //Files.delete(entry); } long size = Files.size(entry); FileInfo fileInfo = new FileInfo(entry, size); if (fileInfo.getSize() < 15000) { tinyFiles.add(fileInfo); return; } List<FileInfo> dups = fileDB.get(fileInfo.getKey()); if (dups == null) { dups = new ArrayList<>(); dups.add(fileInfo); fileDB.put(fileInfo.getKey(), dups); } else { dups.add(fileInfo); } } }
e54ab4544ca509899fd086582fa0ad8d50429cc3
f2b70e4c2f38ff4a814650df12ee9cecd877c65a
/src/main/java/osm5/ns/yang/ietf/network/rev180226/$YangModelBindingProvider.java
c9fb1b8494f64d16b7a86e9f66d5d5fbe23cb5d5
[ "Apache-2.0" ]
permissive
5GinFIRE/eu.5ginfire.nbi.osm5java
34f17f78930178bdf3b428db7a0e9b24982c7c2a
19b6a70cd39e5b0eddd1d0a63069532fa2a1cee0
refs/heads/master
2021-08-11T15:50:07.182421
2019-06-14T12:25:45
2019-06-14T12:25:45
182,989,539
0
0
Apache-2.0
2021-08-02T17:16:53
2019-04-23T10:15:57
Java
UTF-8
Java
false
false
335
java
package osm5.ns.yang.ietf.network.rev180226; public final class $YangModelBindingProvider implements org.opendaylight.yangtools.yang.binding.YangModelBindingProvider { @java.lang.Override public org.opendaylight.yangtools.yang.binding.YangModuleInfo getModuleInfo() { return $YangModuleInfoImpl.getInstance(); } }
8f065d288849a08b2fa144be714a3a7e65d34348
c4b0562856ee724a732632411e97ddf20748d6a0
/src/main/java/ex4/Main.java
4a9675e57ba6eec26ec53ac5fe14db5b399a051e
[]
no_license
LessonsVcs/lesson19
bd2bf055582b5084750ce9b766e7ef1f7e14ce37
6c807f194aef1d54cd0e563e8f0fe7415a087714
refs/heads/master
2021-04-09T11:29:40.132438
2018-03-16T18:23:29
2018-03-16T18:23:29
125,543,420
0
0
null
null
null
null
UTF-8
Java
false
false
842
java
package ex4; class Table{ synchronized void printTable(int n){//method not synchronized for(int i=1;i<=5;i++){ System.out.println(n*i); try{ Thread.sleep(400); }catch(Exception e){System.out.println(e);} } } } class MyThread1 extends Thread{ Table t; MyThread1(Table t){ this.t=t; } public void run(){ t.printTable(5); } } class MyThread2 extends Thread{ Table t; MyThread2(Table t){ this.t=t; } public void run(){ t.printTable(100); } } class TestSynchronization1{ public static void main(String args[]){ Table obj = new Table();//only one object MyThread1 t1=new MyThread1(obj); MyThread2 t2=new MyThread2(obj); t1.start(); t2.start(); } }
[ "Aurimas" ]
Aurimas
ab1fab4855c405f5cdabbbb1a2653dcbec03a005
28361145f030144fe1184bddea9933d0e9cf157f
/src/main/java/org/mcupdater/mojang/VersionManifest.java
0b81f23a83cca3d5885fe3bc947a47f96e65c737
[ "Apache-2.0" ]
permissive
MCUpdater/MCU-API
2121e6771a5d6f67afd74fd91aaa565055e4d292
1e898a37ae1bf9c2c58a3ee0ec51123c119308fc
refs/heads/master
2023-07-07T01:19:22.758639
2022-09-03T21:48:53
2022-09-03T21:48:53
15,918,707
2
7
Apache-2.0
2022-09-03T21:48:54
2014-01-14T23:08:36
Java
UTF-8
Java
false
false
1,916
java
package org.mcupdater.mojang; import com.google.gson.Gson; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.List; public class VersionManifest { private Latest latest; private List<VersionInfo> versions; private static VersionManifest current; public static VersionManifest getCurrent(boolean forceRefresh) throws IOException { Gson gson = new Gson(); if (current == null || forceRefresh) { URLConnection conn; conn = (new URL("https://launchermeta.mojang.com/mc/game/version_manifest.json")).openConnection(); current = gson.fromJson(new InputStreamReader(conn.getInputStream()),VersionManifest.class); } return current; } public Latest getLatest() { return latest; } public List<VersionInfo> getVersions() { return versions; } public VersionInfo getVersion(String versionNumber) throws VersionNotFoundException { for (VersionInfo version : versions) { if (version.getId().equals(versionNumber)) { return version; } } throw new VersionNotFoundException(); } public class Latest { private String snapshot; private String release; public String getSnapshot() { return snapshot; } public String getRelease() { return release; } } public class VersionInfo { private String id; private String type; private String time; private String releaseTime; private String url; public String getId() { return id; } public String getType() { return type; } public String getTime() { return time; } public String getReleaseTime() { return releaseTime; } public String getUrl() { return url; } @Override public String toString() { return type + ": " + id; } } public class VersionNotFoundException extends Exception { public VersionNotFoundException() { super("Requested version not found."); } } }
76d34c8d9d8171c71603772e33aa582c67976eda
bbec793c3255abd4d71e52d7bbbdaad5e9881f09
/MXA/src/de/tudresden/inf/rn/mobilis/mxa/xmpp/MXAIdentFilter.java
e9d673e9408cb5fc384a6e798ad66078ba594950
[]
no_license
benjaminsoellner/TUD_MobilisMiddleware
26174994ef0dfbbd9f7e3eb1262ce8cf72fbeda9
f2357363dc4bb592190a89c3606a477515405a22
refs/heads/master
2016-08-11T21:45:56.193208
2015-12-17T22:29:15
2015-12-17T22:29:15
48,201,450
0
0
null
null
null
null
MacCentralEurope
Java
false
false
1,815
java
/** * Copyright (C) 2009 Technische Universitšt Dresden * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.tudresden.inf.rn.mobilis.mxa.xmpp; import org.jivesoftware.smack.filter.PacketExtensionFilter; import org.jivesoftware.smack.packet.Packet; /** * A simple packet extension filter that checks for the correct namespace and * token of an mxa-ident packet extension. * * @author Istvan Koren * */ public class MXAIdentFilter extends PacketExtensionFilter { private String namespace; private String token; public MXAIdentFilter(String namespace, String token) { super(MXAIdentExtension.ELEMENT_NAME, MXAIdentExtension.NAMESPACE); this.namespace = namespace; this.token = token; } @Override public boolean accept(Packet packet) { if (super.accept(packet)) { MXAIdentExtension mie = (MXAIdentExtension) packet .getExtension(MXAIdentExtension.ELEMENT_NAME, MXAIdentExtension.NAMESPACE); return ((namespace.equals(mie.getConsumerNamespace())) && (token .equals(mie.getToken()))); } else { return false; } } @Override public boolean equals(Object o) { if (o instanceof MXAIdentFilter) { return ((((MXAIdentFilter) o).namespace.equals(namespace)) && (((MXAIdentFilter) o).token .equals(token))); } return false; } }
322d4572cf26337e7e9020e3e4bb342de6604658
6f7804dc229169562c9f140e537d7de5d7584e61
/onesAndZeros/src/main/java/BinaryArrayToNumber.java
62b097f3cfb8a9b91278578d7edfba14f3b29231
[]
no_license
asystentRoberta/codeWarsSolutions
c517b4e4573783ce1ea37ddcd303c659f9f40d82
91b86b4a11c897f3f8ac8e7466edf33676f3d65a
refs/heads/master
2020-06-21T21:48:31.324884
2020-05-29T14:35:43
2020-05-29T14:35:43
197,559,848
2
0
null
2020-05-29T07:43:19
2019-07-18T09:50:50
Java
UTF-8
Java
false
false
359
java
import java.util.List; public class BinaryArrayToNumber { public static int ConvertBinaryArrayToInt(List<Integer> binary) { StringBuilder binaryAsString = new StringBuilder(); for (Integer integer : binary) { binaryAsString.append(integer); } return Integer.parseInt(binaryAsString.toString(), 2); } }
780f04ebadc8c3713145df277583356564c7e23e
d81aa4a61dbd91e206cc2e71c4983cda6ede4bee
/src/test/java/fr/agenceAix/tdd/kata1/FizzBuzzTest.java
49323341dad75e128709daf03052094b88381259
[]
no_license
gfiAgenceAix/TDD_Kata1
d613f847ba2936a19b5482665b3368ee3ef68e9a
99f6e783cc4f9347859e8f696be07d46f1db51f8
refs/heads/master
2021-01-12T12:57:54.678393
2016-10-06T09:36:47
2016-10-07T16:03:07
70,130,977
1
0
null
null
null
null
UTF-8
Java
false
false
3,542
java
package fr.agenceAix.tdd.kata1; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runners.MethodSorters; import fr.gfi.agenceAix.tdd.kata1.model.BasicNumber; import fr.gfi.agenceAix.tdd.kata1.model.Countable; import fr.gfi.agenceAix.tdd.kata1.service.CountableService; import fr.gfi.agenceAix.tdd.kata1.service.CountableServiceImpl; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import java.util.Arrays; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class FizzBuzzTest { CountableService countableService; @Before public void initTest() { countableService = new CountableServiceImpl(); } @Test public void exercice_01() { Countable c = countableService.createCountable(1); assertNotNull(c); assertThat(c, instanceOf(BasicNumber.class)); assertEquals("1", c.count()); } @Test public void exercice_02() { Countable c = countableService.createCountable(2); assertThat(c, instanceOf(BasicNumber.class)); assertEquals("2", c.count()); c = countableService.createCountable(4); assertThat(c, instanceOf(BasicNumber.class)); assertEquals("4", c.count()); c = countableService.createCountable(7); assertThat(c, instanceOf(BasicNumber.class)); assertEquals("7", c.count()); } @Test public void exercice_03() { Countable c = countableService.createCountable(3); assertNotNull(c); assertEquals("Fizz", c.count()); assertThat(c, not(instanceOf(BasicNumber.class))); } @Test public void exercice_04() { Countable c = countableService.createCountable(6); assertEquals("Fizz", c.count()); c = countableService.createCountable(9); assertEquals("Fizz", c.count()); c = countableService.createCountable(5); assertEquals("Buzz", c.count()); c = countableService.createCountable(10); assertEquals("Buzz", c.count()); } @Test(expected = ArithmeticException.class) public void exercice_05() { countableService.createCountable(0); } @Test(expected = ArithmeticException.class) public void exercice_06() { countableService.createCountable(-1); } @Test public void exercice_07() { Countable[] range = countableService.createCountableRange(1, 10); assertNotNull(range); assertEquals(10, range.length); for (int i = 2; i < range.length; i+=3) { assertThat(String.format("There's a problem with range[%s]", i), range[i].count(), containsString("Fizz")); } for (int i = 4; i < range.length; i+=5) { assertThat(String.format("There's a problem with range[%s]", i), range[i].count(), containsString("Buzz")); } } @Test(expected = ArithmeticException.class) public void exercice_08() { countableService.createCountableRange(0, 10); } @Test(expected = ArithmeticException.class) public void exercice_09() { countableService.createCountableRange(10, 1); } @Test public void exercice_10() { Countable[] range = countableService.createCountableRange(1, 100); assertNotNull(range); assertEquals(100, range.length); for (int i = 2; i < range.length; i+=3) { assertThat(String.format("There's a problem with range[%s]", i), range[i].count(), containsString("Fizz")); } for (int i = 4; i < range.length; i+=5) { assertThat(String.format("There's a problem with range[%s]", i), range[i].count(), containsString("Buzz")); } for (int i = 0; i < range.length; i++) { if((i+1) %3 > 0 && (i+1) % 5 > 0) { assertThat(String.format("There's a problem with range[%s]", i), range[i].count(), equalTo(String.valueOf(i +1))); } } } }
170351fb1e6b0641731b9b4773cb2bda985ae255
dfb4e35ea388df5685a5a99e57419ba51f56087a
/src/main/java/com/guildwars2api/service/TraitService.java
34815888355fb0b3a6ca8fee83acbdfa18c61d4a
[]
no_license
cdpsystem/CDP-guil-wars-2-api-2
4de7f75be8ec4bf47a8fd2d5209a9f01462a0690
87a52d6583f411f967031f3af219bed572c5b0d8
refs/heads/master
2020-04-10T06:13:55.571074
2018-12-07T16:34:07
2018-12-07T16:34:07
160,849,256
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package com.guildwars2api.service; import com.guildwars2api.config.APIOptions; import com.guildwars2api.connector.ApiConnector; import java.io.IOException; public class TraitService { private ApiConnector apc; public TraitService(ApiConnector apc) { this.apc = apc; } public String getTraitList() throws IOException { return apc.getResponseV2(APIOptions.TRAITS); } }
[ "cdp.officesystem.com" ]
cdp.officesystem.com
66e932b66961ca6bd163de7d5885cf5c58157908
1c1cd94b5048126de8c61daff5c2987346254d2a
/app/src/androidTest/java/com/example/finaltest/ExampleInstrumentedTest.java
af0e569231b36306f54160ebbebfe4ac313ce7a2
[]
no_license
AdrianYu-811/FinalTest
caf51a4031e671c5263fdf36e877bfa815ba5d86
149cf88f40bc17efa5b15169d839d9ba65e8472f
refs/heads/master
2022-12-02T19:30:29.234676
2020-08-16T01:48:46
2020-08-16T01:48:46
287,853,658
0
0
null
null
null
null
UTF-8
Java
false
false
713
java
package com.example.finaltest; import android.content.Context; import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.finaltest", appContext.getPackageName()); } }
e4ca01da4fcd793bf7ba27a2aebb91d7bf0554a7
1b4bc1f947df2c916139649ea9c9559180d3fdff
/src/com/demo/bean/impl/OrderServiceBean.java
fcb68d492ad3dcc3bab6c1d259913d9a897edd75
[]
no_license
zhaoxiaohu/webservice-demo
e73d3635ac40061663646fee8c31132d85b9986c
4e0389f0ae8e5eaf86b43f1e1d941520b3ccd2a0
refs/heads/master
2021-01-12T06:27:06.351516
2012-12-21T02:52:43
2012-12-21T02:52:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
958
java
package com.demo.bean.impl; import java.util.ArrayList; import java.util.List; import javax.ejb.Remote; import javax.ejb.Stateless; import javax.jws.WebMethod; import com.demo.bean.Order; import com.demo.service.OrderService; @Stateless @Remote(OrderService.class) public class OrderServiceBean implements OrderService { // @WebMethod public String getUserName(String name) { // TODO Auto-generated method stub return null; } public Order getOrder(String orderid) { Order order = new Order(); order.setOrderid(orderid); order.setName("little birds"); return order; } public List<Order> getOrders() { List<Order> persons = new ArrayList<Order>(); Order order1 = new Order(); order1.setName("one"); order1.setOrderid("001"); Order order2 = new Order(); order2.setName("two"); order2.setOrderid("002"); persons.add(order2); persons.add(order1); return persons; } }
bbcd613e9da99cf8c25896c4bf018d1bd8252266
575045b65050153540e08c5dcc94bc95d5610c75
/coreJava/src/sortMethods/BinarySearch2.java
7ab944f5faf63d241e28656bab40ac4d6bb6fe50
[]
no_license
sangsporer/bnybackup
4ed15a1335ae3438a59180f7c4f216bb6f9988d4
6a359c5d463965ffe4bea626dda1486e917dfbef
refs/heads/master
2020-05-09T10:08:56.386175
2019-04-12T15:06:32
2019-04-12T15:06:32
181,030,226
0
0
null
null
null
null
UTF-8
Java
false
false
1,389
java
package sortMethods; import java.awt.ItemSelectable; import java.util.Scanner; public class BinarySearch2 { // binary search then do linear if not using recursive // public static int biSearch (int key, int[] ordArr){ // //declare and initialize middle index point // int midI=ordArr.length/2; // int lastI=ordArr.length-1; // int firstI=0; // //if key equals middle of list just return index // if(key==ordArr[midI]) { // return ordArr[midI]; // } // // //if key is less than middle, ignore top half and set index as such // if(key<ordArr[midI]) { // lastI=midI; // midI=lastI/2; // } // // //if key is greater than the middle, ignore bottom half and set index as such // // // // } // // // return -1; // } public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); System.out.println("Please enter ordered list of numbers"); String numbers = input.next(); String delimiter = ","; numbers = numbers.replaceAll("\\s+", ""); String[] numArr = numbers.split(delimiter); // int key = 5; // int[] ordArr = {1, 3, 5, 7, 9, 10}; // // if(key>ordArr[ordArr.length/2]) { // if (key>ordArr[]) // } // firstI=midI; // lastI=ordArr.length-midI; // midI=lastI/2; } }
a5b211e3cf62e0b86d6f2bf0d387e52452d08165
e1bb0260c13930410ee80f603c7caf0db6b278c8
/instrumentation/jedis/jedis-1.4/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v1_4/JedisClientTracer.java
ebb09bac2278f3cb1bf71d6c93100940b95570cc
[ "Apache-2.0" ]
permissive
system-designer/opentelemetry-java-instrumentation
7cfd1f2b2d10a43db16f9304098c6bdc9b64ff98
2b73f9f3b693503b61136ac06634b13d992d9e10
refs/heads/master
2023-02-17T20:50:46.750257
2021-01-12T05:33:35
2021-01-12T05:33:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,370
java
/* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.javaagent.instrumentation.jedis.v1_4; import io.opentelemetry.api.trace.attributes.SemanticAttributes.DbSystemValues; import io.opentelemetry.instrumentation.api.tracer.DatabaseClientTracer; import io.opentelemetry.javaagent.instrumentation.api.db.RedisCommandNormalizer; import io.opentelemetry.javaagent.instrumentation.jedis.v1_4.JedisClientTracer.CommandWithArgs; import java.net.InetSocketAddress; import java.util.Arrays; import java.util.List; import redis.clients.jedis.Connection; import redis.clients.jedis.Protocol.Command; public class JedisClientTracer extends DatabaseClientTracer<Connection, CommandWithArgs> { private static final JedisClientTracer TRACER = new JedisClientTracer(); public static JedisClientTracer tracer() { return TRACER; } private final RedisCommandNormalizer commandNormalizer = new RedisCommandNormalizer("jedis", "jedis-1.4"); @Override protected String spanName(Connection connection, CommandWithArgs query, String normalizedQuery) { return query.getStringCommand(); } @Override protected String normalizeQuery(CommandWithArgs command) { return commandNormalizer.normalize(command.getStringCommand(), command.getArgs()); } @Override protected String dbSystem(Connection connection) { return DbSystemValues.REDIS; } @Override protected String dbConnectionString(Connection connection) { return connection.getHost() + ":" + connection.getPort(); } @Override protected InetSocketAddress peerAddress(Connection connection) { return new InetSocketAddress(connection.getHost(), connection.getPort()); } @Override protected String getInstrumentationName() { return "io.opentelemetry.javaagent.jedis"; } public static final class CommandWithArgs { private static final byte[][] NO_ARGS = new byte[0][]; private final Command command; private final byte[][] args; public CommandWithArgs(Command command, byte[][] args) { this.command = command; this.args = args; } public CommandWithArgs(Command command) { this(command, NO_ARGS); } private String getStringCommand() { return command.name(); } private List<?> getArgs() { return Arrays.asList(args); } } }
c8adb743ba36c436a46ab81834e87fda44528195
bcfb8f96fa730f00075edd005cade4bfc82c3010
/services-elasticsearch/src/main/java/com/meorient/mebuyerdiscovery/elasticsearch/utils/SnowFlake.java
db87bd4116206ac5791b95d61316937b9fd816c7
[]
no_license
allen0224/springcloud-zjt
ec6c48b02cc6183c86c93c07190446b8906f064f
3dce161f7683f45773f699b83e56f92e41ec792c
refs/heads/master
2022-12-23T06:36:29.842051
2020-07-09T01:46:07
2020-07-09T01:46:07
183,213,377
0
0
null
2022-12-12T21:42:46
2019-04-24T11:18:10
Java
UTF-8
Java
false
false
4,437
java
package com.meorient.mebuyerdiscovery.elasticsearch.utils; import java.util.concurrent.ConcurrentHashMap; /** * 描述: Twitter的分布式自增ID雪花算法snowflake (Java版) */ public class SnowFlake { private static Object LOCK = new Object(); /** * 起始的时间戳 */ private final static long START_STMP = 1480166465631L; /** * 每一部分占用的位数 */ private final static long SEQUENCE_BIT = 12; //序列号占用的位数 private final static long MACHINE_BIT = 5; //机器标识占用的位数 private final static long DATACENTER_BIT = 5;//数据中心占用的位数 /** * 每一部分的最大值 */ private final static long MAX_DATACENTER_NUM = -1L ^ (-1L << DATACENTER_BIT); private final static long MAX_MACHINE_NUM = -1L ^ (-1L << MACHINE_BIT); private final static long MAX_SEQUENCE = -1L ^ (-1L << SEQUENCE_BIT); /** * 每一部分向左的位移 */ private final static long MACHINE_LEFT = SEQUENCE_BIT; private final static long DATACENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT; private final static long TIMESTMP_LEFT = DATACENTER_LEFT + DATACENTER_BIT; private long datacenterId; //数据中心 private long machineId; //机器标识 private long sequence = 0L; //序列号 private long lastStmp = -1L;//上一次时间戳 private SnowFlake() {} private static ConcurrentHashMap<String, SnowFlake> instanceMap = new ConcurrentHashMap<>(); public static SnowFlake getInstance(long datacenterId, long machineId) { String key = datacenterId + "-" + machineId; if (instanceMap.containsKey(key)) return instanceMap.get(key); else { synchronized(LOCK) { instanceMap.putIfAbsent(key, new SnowFlake(datacenterId, machineId)); return instanceMap.get(key); } } } /** * * @param datacenterId, 对应一个分布式系统 * @param machineId 对应分布式系统里的虚拟机节点 - 一台机子 * machineId,对应每个node角色,这个id应该由数据库维护唯一性 * 简单版本,使用参数0,0 * SnowFlake.getInstance(0,0).nextId(); */ private SnowFlake(long datacenterId, long machineId) { if (datacenterId > MAX_DATACENTER_NUM || datacenterId < 0) { throw new IllegalArgumentException("datacenterId can't be greater than MAX_DATACENTER_NUM or less than 0"); } if (machineId > MAX_MACHINE_NUM || machineId < 0) { throw new IllegalArgumentException("machineId can't be greater than MAX_MACHINE_NUM or less than 0"); } this.datacenterId = datacenterId; this.machineId = machineId; } /** * 产生下一个ID * * @return */ public synchronized long nextId() { long currStmp = getNewstmp(); if (currStmp < lastStmp) { throw new RuntimeException("Clock moved backwards. Refusing to generate id"); } if (currStmp == lastStmp) { //相同毫秒内,序列号自增 sequence = (sequence + 1) & MAX_SEQUENCE; //同一毫秒的序列数已经达到最大 if (sequence == 0L) { currStmp = getNextMill(); } } else { //不同毫秒内,序列号置为0 sequence = 0L; } lastStmp = currStmp; return (currStmp - START_STMP) << TIMESTMP_LEFT //时间戳部分 | datacenterId << DATACENTER_LEFT //数据中心部分 | machineId << MACHINE_LEFT //机器标识部分 | sequence; //序列号部分 } private long getNextMill() { long mill = getNewstmp(); while (mill <= lastStmp) { mill = getNewstmp(); } return mill; } private long getNewstmp() { return System.currentTimeMillis(); } public static void main(String[] args) { SnowFlake snowFlake = new SnowFlake(2, 3); long start = System.currentTimeMillis(); for (int i = 0; i < 5; i++) { System.out.println(snowFlake.nextId()); } System.out.println(System.currentTimeMillis() - start); } }
48a4d10ed58e018963015d06536f700a33fc2dc4
436581fcc6f3785a22f6f627d3af2067671456bf
/src/main/com/bsuir/autoservice/command/account/PersonalAccountUpdateGeneralInformationCommand.java
983e8d93b44eb9265b2a84774216821a0f165a4b
[]
no_license
alexey3nemckovich/JavaMagicBandProject
c1ad5e3681513ae1bd6e2611043e8dba16220a19
9742cbf5539fe037fe30bdc6539519fca678f819
refs/heads/master
2020-12-31T05:57:33.832438
2017-05-24T16:17:43
2017-05-24T16:17:43
86,386,152
1
3
null
2017-05-24T15:45:40
2017-03-27T21:35:04
Java
UTF-8
Java
false
false
1,347
java
package main.com.bsuir.autoservice.command.account; import com.google.inject.Inject; import main.com.bsuir.autoservice.command.AbstractSessionCommand; import main.com.bsuir.autoservice.command.param.PersonalAccountUpdateGeneralInformationInfo; import main.com.bsuir.autoservice.command.ret.PersonalAccountUpdateGeneralInformationRet; import main.com.bsuir.autoservice.dto.UserUpdateInformationDTO; import main.com.bsuir.autoservice.infrastructure.session.IUserSession; import main.com.bsuir.autoservice.service.unitofwork.IServiceUnitOfWork; public class PersonalAccountUpdateGeneralInformationCommand extends AbstractSessionCommand<PersonalAccountUpdateGeneralInformationInfo, PersonalAccountUpdateGeneralInformationRet>{ @Inject public PersonalAccountUpdateGeneralInformationCommand(IServiceUnitOfWork serviceUnitOfWork, IUserSession session) { super(serviceUnitOfWork, session); } @Override protected PersonalAccountUpdateGeneralInformationRet executeImpl(PersonalAccountUpdateGeneralInformationInfo param) throws Exception { return new PersonalAccountUpdateGeneralInformationRet(serviceUnitOfWork.getUserService(). updateUserInformation(session.getUserId(), new UserUpdateInformationDTO(param.getName(), param.getLastName(), param.getPhone()))); } }
eed7850869ce1bae30f34ab87d9cb7835a137a63
01993ce8cfce657279aeb2cd0e33579c4da32c48
/src/main/java/com/hyd/salto/IndexController.java
57f32cf5866fb986cd84528127f465c97cb03a53
[ "Apache-2.0" ]
permissive
yiding-he/salto
8a1ab27a3a303c159b501e16cc80173f4a21216a
3c6b43d9eedc31e45270aa59c6e2f99d0466e9e3
refs/heads/master
2021-01-01T06:36:42.645012
2017-07-18T12:16:21
2017-07-18T12:16:21
97,468,876
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package com.hyd.salto; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; @Controller public class IndexController { @GetMapping("/") public String index() { return "index"; } }
26238adae2eb4f76adabaebd8cde68a0322c107a
10cba34c5ef8792a918780bd4b3d0e2b8decdaca
/src/main/java/dev/gigaherz/elementsofpower/client/package-info.java
60704bebfae0114ca073397938e5ca6420bae823
[]
no_license
gigaherz/ElementsOfPower
0536a177ca01587baa138f226c84c30272a6cde3
2a4b531f6d8523db0bc5ec6e7567cf066dcb259b
refs/heads/master
2023-07-07T04:14:54.015613
2023-07-02T22:25:07
2023-07-02T22:25:07
7,384,096
13
10
null
2015-11-25T01:51:24
2012-12-31T05:48:49
Java
UTF-8
Java
false
false
215
java
@MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault package dev.gigaherz.elementsofpower.client; import net.minecraft.MethodsReturnNonnullByDefault; import javax.annotation.ParametersAreNonnullByDefault;
d39b448644aa4983b5d0ac9aaa735ae4efa32bd9
d91b7cfcd90d579e0042b22116cd74c80af0aac1
/src/main/java/fr/craft/Crafting.java
20fc74f8cd6c454e348a559781c6fb397ed5e8ff
[]
no_license
bphilibert/Mousecraft
31c8843337e618c3c2fac6da62043d8ce2089d30
20c6f8cef535e0f3e630b4f92e560fc22fb359e5
refs/heads/master
2021-01-10T14:21:35.491264
2015-12-27T13:57:31
2015-12-27T13:57:31
47,976,959
0
0
null
null
null
null
UTF-8
Java
false
false
865
java
package main.java.fr.craft; import java.util.ArrayList; /** * Created by bphilibert on 2015/12/15. */ public class Crafting { protected Design m_design; protected ArrayList<Supply> m_supplies; protected int m_step; public Crafting () { this.m_design = null; this.m_supplies = new ArrayList<>(); this.m_step = 0; } public void add(Design design) { this.m_design = design; } public void add(Supply supply) { if (m_design != null) { if (m_design.getProtocol().get(m_step).contains(supply)) { if (m_design.getProtocol().get(m_step).) { m_supplies.add(supply); m_step++; } } } } public void validate() { null; } }
39b6d9b39760ececc1ef5d06290446d023d21477
78f8252d1c9b0e699a8b4f8692a50bc296bbcb1e
/app/src/androidTest/java/com/example/customlistadapter/ExampleInstrumentedTest.java
1bdae52f9a0806cac02c367017b68b45fe477806
[]
no_license
kkubli3246/Activity6_CustomAdapter
7ae850f63492a7378444f189a245021e2ac10900
b45d5e39aad47f08d21be38ce03578ff4f349498
refs/heads/master
2020-12-14T16:35:57.076780
2020-01-18T22:58:58
2020-01-18T22:58:58
234,809,213
0
0
null
null
null
null
UTF-8
Java
false
false
774
java
package com.example.customlistadapter; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.customlistadapter", appContext.getPackageName()); } }
c2df7fb8fe0e5899e83679ebc5551d91a1eb9829
482528f554ba0929f7e701b44b493163935c82b8
/domain/src/main/java/domain/foundation/Repository.java
6d9f8005a157d9448c558a360f0efcc4e2957f43
[ "Apache-2.0" ]
permissive
danangkimhoa/espresso_BaseAppAndroid
a0e385c750f1a518767f18ee87f8845803c7ca66
47e586e66fedf572ee97956ab3885ba9f0a2755c
refs/heads/master
2022-12-10T17:55:54.320458
2016-04-05T19:38:15
2016-04-05T19:38:15
291,883,263
0
0
null
null
null
null
UTF-8
Java
false
false
762
java
/* * Copyright 2015 RefineriaWeb * * 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 domain.foundation; /** * Base interface for any repository. * These interfaces will be implemented in the data layer. */ public interface Repository { }
c6073abe9b65d5ed3db7029aac1a143c6bde5709
78a217e39f766b0595f0f339c479a86adcb754e1
/src/com/javarush/test/level15/lesson02/task03/Solution.java
3f95833c30dc704f59143fdafd8f50f0b563de2f
[]
no_license
Olegusplatypus/JavaRushHomeWork
af9785d88209291ba95bbf9ccc6a1d97f1b7bcb5
5b9b17d94be85d820a4b07b964dad51d293454a0
refs/heads/master
2020-12-25T14:22:55.066156
2016-08-02T11:27:42
2016-08-02T11:27:42
64,745,213
0
0
null
null
null
null
UTF-8
Java
false
false
2,968
java
package com.javarush.test.level15.lesson02.task03; /* ООП - машинки 1. Для вывода использовать можно только переменные из класса Constants. 2. В классе Ferrari реализуйте метод printlnDesire, чтобы он выводил на экран "Я хочу ездить на Феррари". 3. В классе Lanos реализуйте метод printlnDesire, чтобы он выводил на экран "Я хочу ездить на Ланосе". 4. Создайте public static класс LuxuriousCar(РоскошнаяМашина). 5. Создайте public static класс CheapCar(ДешеваяМашина). 6. Унаследуйте Ferrari и Lanos от CheapCar и LuxuriousCar, подумайте, какой класс для кого. 7. В классе LuxuriousCar реализуйте метод printlnDesire, чтобы он выводил на экран "Я хочу ездить на роскошной машине". 8. В классе CheapCar реализуйте метод printlnDesire, чтобы он выводил на экран "Я хочу ездить на дешевой машине". 9. В класах LuxuriousCar и CheapCar для метода printlnDesire расставьте различными способами модификаторы доступа так, чтобы в классах Ferrari и Lanos выполнялось расширение видимости. */ public class Solution { public static void main(String[] args) { new Solution.LuxuriousCar().printlnDesire(); new Solution.CheapCar().printlnDesire(); new Solution.Ferrari().printlnDesire(); new Solution.Lanos().printlnDesire(); } public static class Ferrari extends LuxuriousCar { public void printlnDesire() { System.out.println(Constants.WANT_STRING+Constants.FERRARY_NAME); //add your code here } } public static class Lanos extends CheapCar{ public void printlnDesire() { System.out.println(Constants.WANT_STRING+Constants.LANOS_NAME); //add your code here } } public static class LuxuriousCar { void printlnDesire() { System.out.println(Constants.WANT_STRING+Constants.LUXURIOUS_CAR); //add your code here } } public static class CheapCar { protected void printlnDesire() { System.out.println(Constants.WANT_STRING+Constants.CHEAP_CAR); //add your code here } } public static class Constants { public static String WANT_STRING = "Я хочу ездить на "; public static String LUXURIOUS_CAR = "роскошной машине"; public static String CHEAP_CAR = "дешевой машине"; public static String FERRARY_NAME = "Феррари"; public static String LANOS_NAME = "Ланосе"; } }
cbd301bd80dfbb5dd5d11909c0d769675ac02f72
c16e60a1f07a822588086f494e471bc3306fb10e
/old/Tree/Vertical-order-traversal-of-a-binary-tree.java
397874b9e2fb227b59c8ad67f280827c0602e2d0
[]
no_license
frankzengjj/leetcode-algorithm
693b168ee14b0b1e1bdabda62a25693116bd909e
342cde4331ff200aff8a0e21ce165e6ae437e839
refs/heads/master
2022-01-15T18:36:18.935663
2022-01-05T07:27:07
2022-01-05T07:27:07
188,773,778
0
1
null
null
null
null
UTF-8
Java
false
false
1,972
java
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { class Pair{ TreeNode node; int x; //horizontal int y; //depth Pair(TreeNode n, int x, int y) { node = n; this.x = x; this.y = y; } } public List<List<Integer>> verticalTraversal(TreeNode root) { List<List<Integer>> lists = new ArrayList<>(); Map<Integer, List<Pair>> map = new HashMap<>(); //x -> list (some nodes might have same y in the list) Queue<Pair> q = new LinkedList<>(); q.add(new Pair(root, 0, 0)); int min = 0, max = 0; while(!q.isEmpty()) { Pair p = q.remove(); min = Math.min(min, p.x); max = Math.max(max, p.x); if(!map.containsKey(p.x)) map.put(p.x, new ArrayList<>()); map.get(p.x).add(p); if(p.node.left!=null) q.add(new Pair(p.node.left, p.x-1, p.y+1)); if(p.node.right!=null) q.add(new Pair(p.node.right, p.x+1, p.y+1)); } for(int i=min; i<=max; i++) { Collections.sort(map.get(i), new Comparator<Pair>(){ public int compare(Pair a, Pair b) { if(a.y==b.y) //when y is equal, sort it by value return a.node.val - b.node.val; return 0; //otherwise don't change the order as BFS ganrantees that top nodes are visited first } }); List<Integer> list = new ArrayList<>(); for(int j=0; j<map.get(i).size(); j++) { list.add(map.get(i).get(j).node.val); } lists.add(list); } return lists; } }
8ee15589214eb0d72809625f37a3da2b3b9b8814
7908299834b5dea6b82330c96b2c06052c9f11b1
/src/_07_abstract_class_interface/baitap/Rectangle.java
331423f3c05e3402b0acd65524962008e852f827
[]
no_license
phucnguyen1995/phucnguyen1995-C0421G1__NguyenKhacPhuc_Module2
75875847e688fe998fb97a380f2c095392a104cd
2def78adbbe4eee5008a58988221f103463f1579
refs/heads/main
2023-07-19T20:00:51.643915
2021-09-04T14:22:41
2021-09-04T14:22:41
372,704,762
0
0
null
null
null
null
UTF-8
Java
false
false
1,381
java
package _07_abstract_class_interface.baitap; public class Rectangle extends Shape implements Resizeable { private double width = 1.0; private double length = 1.0; public Rectangle() { } public Rectangle(double width, double length) { this.width = width; this.length = length; } public Rectangle(double width, double length, String color, boolean filled) { super(color, filled); this.width = width; this.length = length; } public double getWidth() { return width; } public void setWidth(double width) { this.width = width; } public double getLength() { return length; } public void setLength(double length) { this.length = length; } public double getArea() { return width * this.length; } public double getPerimeter() { return 2 * (width + this.length); } @Override public String toString() { return "A Rectangle with width=" + getWidth() + " and length=" + getLength() + ", which is a subclass of " + super.toString(); } @Override public void resize(double percent) { this.length = this.length * ((percent + 100)/100); this.width = this.width * ((percent + 100)/100); } }
f2ef3f9e64e298fff6436179b948dc3bd3103748
309995c813a0700bb6b005aa9847962c5b6de2b8
/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/MultipleInputStreamTaskChainedSourcesCheckpointingTest.java
5f912ab0c6069949167e82cbc3cefc7cd64ba4a6
[ "MIT", "OFL-1.1", "ISC", "Apache-2.0", "BSD-3-Clause" ]
permissive
wangxiyuan/flink
5635a643bf6a96aa5abbdef3c9577ea89700bc9c
d126d94d3a0b9efc15ba60b976bff751c97cdd55
refs/heads/master
2021-06-27T21:47:27.188829
2020-12-09T09:33:03
2020-12-09T09:33:03
194,633,053
1
2
Apache-2.0
2023-08-15T07:25:52
2019-07-01T08:34:48
Java
UTF-8
Java
false
false
11,898
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.streaming.runtime.tasks; import org.apache.flink.api.common.eventtime.TimestampAssigner; import org.apache.flink.api.common.eventtime.WatermarkStrategy; import org.apache.flink.api.common.typeinfo.BasicTypeInfo; import org.apache.flink.api.connector.source.Boundedness; import org.apache.flink.api.connector.source.mocks.MockSource; import org.apache.flink.runtime.checkpoint.CheckpointMetaData; import org.apache.flink.runtime.checkpoint.CheckpointOptions; import org.apache.flink.runtime.checkpoint.CheckpointType; import org.apache.flink.runtime.io.network.api.CheckpointBarrier; import org.apache.flink.runtime.state.CheckpointStorageLocationReference; import org.apache.flink.streaming.api.graph.StreamConfig; import org.apache.flink.streaming.api.operators.SourceOperatorFactory; import org.apache.flink.streaming.runtime.streamrecord.StreamRecord; import org.apache.flink.streaming.runtime.tasks.MultipleInputStreamTaskTest.MapToStringMultipleInputOperatorFactory; import org.junit.Test; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.concurrent.Future; import java.util.function.Supplier; import static org.apache.flink.streaming.runtime.tasks.MultipleInputStreamTaskTest.addSourceRecords; import static org.apache.flink.streaming.runtime.tasks.MultipleInputStreamTaskTest.buildTestHarness; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; /** * Tests for {@link MultipleInputStreamTask} combined with {@link org.apache.flink.streaming.api.operators.SourceOperator} chaining. */ public class MultipleInputStreamTaskChainedSourcesCheckpointingTest { private static final int MAX_STEPS = 100; private final CheckpointMetaData metaData = new CheckpointMetaData(1L, System.currentTimeMillis()); /** * In this scenario: * 1. checkpoint is triggered via RPC and source is blocked * 2. network inputs are processed until CheckpointBarriers are processed * 3. aligned checkpoint is performed */ @Test public void testSourceCheckpointFirst() throws Exception { try (StreamTaskMailboxTestHarness<String> testHarness = buildTestHarness()) { testHarness.setAutoProcess(false); ArrayDeque<Object> expectedOutput = new ArrayDeque<>(); CheckpointBarrier barrier = createBarrier(testHarness); addRecordsAndBarriers(testHarness, barrier); Future<Boolean> checkpointFuture = testHarness.getStreamTask().triggerCheckpointAsync(metaData, barrier.getCheckpointOptions(), false); processSingleStepUntil(testHarness, checkpointFuture::isDone); expectedOutput.add(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("47.0", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("47.0", TimestampAssigner.NO_TIMESTAMP)); ArrayList<Object> actualOutput = new ArrayList<>(testHarness.getOutput()); assertThat(actualOutput.subList(0, expectedOutput.size()), containsInAnyOrder(expectedOutput.toArray())); assertThat(actualOutput.get(expectedOutput.size()), equalTo(barrier)); } } /** * In this scenario: * 1. checkpoint is triggered via RPC and source is blocked * 2. unaligned checkpoint is performed * 3. all data from network inputs are processed */ @Test public void testSourceCheckpointFirstUnaligned() throws Exception { try (StreamTaskMailboxTestHarness<String> testHarness = buildTestHarness(true)) { testHarness.setAutoProcess(false); ArrayDeque<Object> expectedOutput = new ArrayDeque<>(); addRecords(testHarness); CheckpointBarrier barrier = createBarrier(testHarness); Future<Boolean> checkpointFuture = testHarness.getStreamTask().triggerCheckpointAsync(metaData, barrier.getCheckpointOptions(), false); processSingleStepUntil(testHarness, checkpointFuture::isDone); assertThat(testHarness.getOutput(), contains(barrier)); testHarness.processAll(); expectedOutput.add(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("47.0", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("47.0", TimestampAssigner.NO_TIMESTAMP)); ArrayList<Object> actualOutput = new ArrayList<>(testHarness.getOutput()); assertThat(actualOutput.subList(1, expectedOutput.size() + 1), containsInAnyOrder(expectedOutput.toArray())); } } /** * In this scenario: * 1a. network inputs are processed until CheckpointBarriers are processed * 1b. source records are processed at the same time * 2. checkpoint is triggered via RPC * 3. aligned checkpoint is performed */ @Test public void testSourceCheckpointLast() throws Exception { try (StreamTaskMailboxTestHarness<String> testHarness = buildTestHarness()) { testHarness.setAutoProcess(false); ArrayDeque<Object> expectedOutput = new ArrayDeque<>(); CheckpointBarrier barrier = createBarrier(testHarness); addRecordsAndBarriers(testHarness, barrier); testHarness.processAll(); Future<Boolean> checkpointFuture = testHarness.getStreamTask().triggerCheckpointAsync(metaData, barrier.getCheckpointOptions(), false); processSingleStepUntil(testHarness, checkpointFuture::isDone); expectedOutput.add(new StreamRecord<>("42", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("42", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("42", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("47.0", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("47.0", TimestampAssigner.NO_TIMESTAMP)); ArrayList<Object> actualOutput = new ArrayList<>(testHarness.getOutput()); assertThat(actualOutput.subList(0, expectedOutput.size()), containsInAnyOrder(expectedOutput.toArray())); assertThat(actualOutput.get(expectedOutput.size()), equalTo(barrier)); } } /** * In this scenario: * 1. network inputs are processed until CheckpointBarriers are processed * 2. there are no source records to be processed * 3. checkpoint is triggered on first received CheckpointBarrier * 4. unaligned checkpoint is performed at some point of time blocking the source * 5. more source records are added, that shouldn't be processed */ @Test public void testSourceCheckpointLastUnaligned() throws Exception { boolean unaligned = true; try (StreamTaskMailboxTestHarness<String> testHarness = buildTestHarness(unaligned)) { testHarness.setAutoProcess(false); ArrayDeque<Object> expectedOutput = new ArrayDeque<>(); addNetworkRecords(testHarness); CheckpointBarrier barrier = createBarrier(testHarness); addBarriers(testHarness, barrier); testHarness.processAll(); addSourceRecords(testHarness, 1, 1337, 1337, 1337); testHarness.processAll(); expectedOutput.add(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("47.0", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(new StreamRecord<>("47.0", TimestampAssigner.NO_TIMESTAMP)); expectedOutput.add(barrier); assertThat(testHarness.getOutput(), containsInAnyOrder(expectedOutput.toArray())); } } @Test public void testOnlyOneSource() throws Exception { try (StreamTaskMailboxTestHarness<String> testHarness = new StreamTaskMailboxTestHarnessBuilder<>(MultipleInputStreamTask::new, BasicTypeInfo.STRING_TYPE_INFO) .modifyExecutionConfig(config -> config.enableObjectReuse()) .addSourceInput( new SourceOperatorFactory<>( new MockSource(Boundedness.BOUNDED, 1), WatermarkStrategy.noWatermarks())) .setupOutputForSingletonOperatorChain(new MapToStringMultipleInputOperatorFactory(1)) .build()) { testHarness.setAutoProcess(false); ArrayDeque<Object> expectedOutput = new ArrayDeque<>(); addSourceRecords(testHarness, 0, 42, 43, 44); processSingleStepUntil(testHarness, () -> !testHarness.getOutput().isEmpty()); expectedOutput.add(new StreamRecord<>("42", TimestampAssigner.NO_TIMESTAMP)); CheckpointBarrier barrier = createBarrier(testHarness); Future<Boolean> checkpointFuture = testHarness.getStreamTask().triggerCheckpointAsync(metaData, barrier.getCheckpointOptions(), false); processSingleStepUntil(testHarness, checkpointFuture::isDone); ArrayList<Object> actualOutput = new ArrayList<>(testHarness.getOutput()); assertThat(actualOutput.subList(0, expectedOutput.size()), containsInAnyOrder(expectedOutput.toArray())); assertThat(actualOutput.get(expectedOutput.size()), equalTo(barrier)); } } private void addRecordsAndBarriers(StreamTaskMailboxTestHarness<String> testHarness, CheckpointBarrier checkpointBarrier) throws Exception { addRecords(testHarness); addBarriers(testHarness, checkpointBarrier); } private CheckpointBarrier createBarrier(StreamTaskMailboxTestHarness<String> testHarness) { StreamConfig config = testHarness.getStreamTask().getConfiguration(); CheckpointOptions checkpointOptions = CheckpointOptions.create( CheckpointType.CHECKPOINT, CheckpointStorageLocationReference.getDefault(), config.isExactlyOnceCheckpointMode(), config.isUnalignedCheckpointsEnabled(), config.getAlignmentTimeout()); return new CheckpointBarrier(metaData.getCheckpointId(), metaData.getTimestamp(), checkpointOptions); } private void addBarriers(StreamTaskMailboxTestHarness<String> testHarness, CheckpointBarrier checkpointBarrier) throws Exception { testHarness.processEvent(checkpointBarrier, 0); testHarness.processEvent(checkpointBarrier, 1); } private void addRecords(StreamTaskMailboxTestHarness<String> testHarness) throws Exception { addSourceRecords(testHarness, 1, 42, 42, 42); addNetworkRecords(testHarness); } private void addNetworkRecords(StreamTaskMailboxTestHarness<String> testHarness) throws Exception { testHarness.processElement(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP), 0); testHarness.processElement(new StreamRecord<>("44", TimestampAssigner.NO_TIMESTAMP), 0); testHarness.processElement(new StreamRecord<>(47d, TimestampAssigner.NO_TIMESTAMP), 1); testHarness.processElement(new StreamRecord<>(47d, TimestampAssigner.NO_TIMESTAMP), 1); } private void processSingleStepUntil(StreamTaskMailboxTestHarness<String> testHarness, Supplier<Boolean> condition) throws Exception { assertFalse(condition.get()); for (int i = 0; i < MAX_STEPS && !condition.get(); i++) { testHarness.processSingleStep(); } assertTrue(condition.get()); } }
92c14f173ecb3619eeb3280d1065a4682e2709cc
71f6e38d00e3fca94e685a2c7d7360244bfe3a06
/8. UserDefinedPackage/PackageExample1/a/A.java
53b66ab348acb4224d9b4473f621da518e444b8b
[]
no_license
Dil-Mahmud-Khan/JAVA-
f065c3406266d0788a60e6fc8feff4d0a3b433c6
958cb2a4ff81491ba0592d06e6395743d771abe5
refs/heads/main
2023-08-28T05:50:54.461624
2021-10-16T06:19:29
2021-10-16T06:19:29
417,736,553
0
0
null
null
null
null
UTF-8
Java
false
false
33
java
package a; public class A{ }
e96164a5d91b122721e288b2bc26043406ea676c
ef79153e2af1e08ff9de883671b982ea4b31cf1a
/src/main/java/com/starr/java8/javascript/JSExample.java
e30dd0fc402aa6c64a0c5a9deacc9a5c457161b2
[]
no_license
TaniaKys/Java8Study
c6debe5170901e73ec8ee559364c319fc8f6fee5
29603a82165f880c2e6ca19f0a0b44862c7e2a5d
refs/heads/master
2021-01-19T10:01:17.118866
2017-05-24T14:41:41
2017-05-24T14:41:41
87,815,412
0
0
null
null
null
null
UTF-8
Java
false
false
678
java
package com.starr.java8.javascript; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; public class JSExample { public static void main(String[] args) { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("nashorn"); String script = "var welcome = 'Hello'; " + "welcome += ', Tania'; " + "welcome;"; try { String result = (String) engine.eval(script); System.out.println(result); } catch (ScriptException e) { e.printStackTrace(); } } }
ce2ad3b68902f4997e8585be3b0d6ff76de982b5
68959e58550aff897f193d32273fa44695758ce8
/app/src/main/java/com/lgq/fruitgrower/view/adapter/StatusAdapter.java
e6a04ee403d887da68bd979562f5d65f3923b964
[]
no_license
lgq895767507/FruitGrower
0e1b0e6989d95f9d69df21668acde88252d5f310
f70fd96d66e766a8f89b27ef90e5cf5d97eb136e
refs/heads/master
2021-01-21T04:46:55.847474
2018-02-27T14:30:45
2018-02-27T14:30:45
50,713,063
3
0
null
null
null
null
UTF-8
Java
false
false
8,771
java
package com.lgq.fruitgrower.view.adapter; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.bumptech.glide.DrawableRequestBuilder; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.lgq.fruitgrower.R; import com.lgq.fruitgrower.model.beans.Goods; import com.lgq.fruitgrower.model.beans.Pubilsh; import com.lgq.fruitgrower.model.constance.Constance; import com.lgq.fruitgrower.view.utils.ToastUtils; import com.lgq.fruitgrower.view.widget.WrapHeightGridView; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; /** * Created by lgq on 16-3-14. */ public class StatusAdapter extends RecyclerView.Adapter<StatusAdapter.MyViewHolder> { //获取上下文 private Context context; private ArrayList<Pubilsh> datas; //hashMap 保存 private static HashMap<Integer,Boolean> hashChange = new HashMap<>(); MyViewHolder.ItemClick itemClick; public ArrayList<Pubilsh> getDatas() { return datas; } public StatusAdapter(MyViewHolder.ItemClick itemClick) { this.itemClick = itemClick; datas = new ArrayList<>(); } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { context = parent.getContext(); MyViewHolder holder = new MyViewHolder(LayoutInflater.from(context).inflate(R.layout.item_card_view, parent, false), itemClick); return holder; } @Override public void onBindViewHolder(MyViewHolder holder, int position) { //设置头像 if (datas.get(position).getImg() != null) { Log.i("lgq", "position" + position); Glide.with(context) .load(datas.get(position).getPhoto().getFileUrl(context)) .into(holder.iv_avatar); } else { Bitmap defaultImg = BitmapFactory.decodeResource(this.context.getResources(), R.mipmap.logo); holder.iv_avatar.setImageBitmap(defaultImg); } //设置名字 if (datas.get(position).getName() != null){ holder.tv_subhead.setText(datas.get(position).getName()); }else{ holder.tv_subhead.setText(datas.get(position).getEmail()); } //设置发布时间 holder.tv_caption.setText(datas.get(position).getCreatedAt()); //设置内容 holder.tv_content.setText(datas.get(position).getContent()); //设置图片内容,并缓存图片和缩略图片,增强应用的性能增强。 if (datas.get(position).getPhoto() != null) { Log.i("lgq", "position" + position); Glide.with(context) .load(datas.get(position).getPhoto().getFileUrl(context)) .thumbnail(Constance.SizeHalf) .diskCacheStrategy(DiskCacheStrategy.ALL) .into(holder.iv_image); holder.include_status_image.setVisibility(View.VISIBLE); holder.iv_image.setVisibility(View.VISIBLE); } else { holder.include_status_image.setVisibility(View.GONE); holder.iv_image.setVisibility(View.GONE); } Log.i("lgq","hashMap:"+hashChange.get(position)); if (hashChange.get(position) == null) { holder.iv_like_bottom.setImageDrawable(context.getResources().getDrawable(R.mipmap.timeline_icon_like_disable)); } else if (hashChange.get(position)) { holder.iv_like_bottom.setImageDrawable(context.getResources().getDrawable(R.mipmap.timeline_icon_like)); }else{ holder.iv_like_bottom.setImageDrawable(context.getResources().getDrawable(R.mipmap.timeline_icon_like_disable)); } } @Override public int getItemCount() { return datas.size(); } public static class MyViewHolder extends RecyclerView.ViewHolder implements AdapterView.OnClickListener { public ImageView iv_avatar; public TextView tv_subhead; public TextView tv_caption; public TextView tv_content; public ImageView iv_like_bottom; public ImageView iv_image; public WrapHeightGridView gv_images; public TextView tv_retweeted_content; public LinearLayout ll_share_bottom; public LinearLayout ll_comment_bottom; public LinearLayout ll_like_bottom; public FrameLayout include_status_image; public LinearLayout ll_card_content; //设置点赞的改变值 private boolean isChanged = false; //region 回调接口 ItemClick itemClick; public interface ItemClick { void onBtnCommentClick(int position); void onBtnShareClick(int position); void onRootViewClick(int position); void onBtnLikeClick(int position); void onBtnUnLikeClick(int position); } //endregion public MyViewHolder(View itemView, ItemClick itemClick) { super(itemView); this.itemClick = itemClick; iv_avatar = (ImageView) itemView.findViewById(R.id.iv_avatar); tv_subhead = (TextView) itemView.findViewById(R.id.tv_subhead); tv_caption = (TextView) itemView.findViewById(R.id.tv_caption); tv_content = (TextView) itemView.findViewById(R.id.tv_content); iv_like_bottom = (ImageView) itemView.findViewById(R.id.iv_like_bottom); iv_image = (ImageView) itemView.findViewById(R.id.iv_image); gv_images = (WrapHeightGridView) itemView.findViewById(R.id.gv_images); tv_retweeted_content = (TextView) itemView.findViewById(R.id.tv_retweeted_content); ll_share_bottom = (LinearLayout) itemView.findViewById(R.id.ll_share_bottom); ll_comment_bottom = (LinearLayout) itemView.findViewById(R.id.ll_comment_bottom); ll_like_bottom = (LinearLayout) itemView.findViewById(R.id.ll_like_bottom); include_status_image = (FrameLayout) itemView.findViewById(R.id.include_status_image); ll_card_content = (LinearLayout) itemView.findViewById(R.id.ll_card_content); ll_card_content.setOnClickListener(this); ll_comment_bottom.setOnClickListener(this); ll_share_bottom.setOnClickListener(this); ll_like_bottom.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.ll_card_content: if (itemClick != null) { itemClick.onRootViewClick(getAdapterPosition()); } break; case R.id.ll_share_bottom: if (itemClick != null) { itemClick.onBtnShareClick(getAdapterPosition()); } break; case R.id.ll_comment_bottom: if (itemClick != null) { itemClick.onBtnCommentClick(getAdapterPosition()); } break; case R.id.ll_like_bottom: if (itemClick != null) { if (isChanged) { //设置点击背景 Drawable drawableLiled = v.getResources().getDrawable(R.mipmap.timeline_icon_like_disable); iv_like_bottom.setImageDrawable(drawableLiled); itemClick.onBtnUnLikeClick(getAdapterPosition()); }else { Drawable drawableLiled = v.getResources().getDrawable(R.mipmap.timeline_icon_like); iv_like_bottom.setImageDrawable(drawableLiled); itemClick.onBtnLikeClick(getAdapterPosition()); } isChanged = !isChanged; hashChange.put(getAdapterPosition(),isChanged); } break; } } } }
12435713ea2242a8eaeb8b65a62df66a487f507c
e54040da97a1ffce152ad95ba89dc7738b628b85
/PokeApp/app/src/main/java/lina/pokeapp/MainActivity.java
fcbaf7e141f4b44be12b910ce7dc7d56c63397fe
[]
no_license
LinaToquica/pokedex
7920445e82aee4bac20808c167835ec8328c2071
1dce3611e12f8337f8126706724c2bab134b0852
refs/heads/master
2021-01-19T09:53:19.404527
2017-04-10T12:46:34
2017-04-10T12:46:34
87,795,013
0
0
null
null
null
null
UTF-8
Java
false
false
9,336
java
package lina.pokeapp; import android.content.Context; import android.content.Intent; import android.content.res.AssetManager; import android.graphics.Color; import android.graphics.Typeface; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import com.firebase.ui.database.FirebaseRecyclerAdapter; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.squareup.picasso.Callback; import com.squareup.picasso.NetworkPolicy; import com.squareup.picasso.Picasso; import java.util.Locale; public class MainActivity extends AppCompatActivity { private RecyclerView mPokemonList; private DatabaseReference mdatabase; private FirebaseAuth mAuth; private FirebaseAuth.AuthStateListener mauthlistener; private boolean pokedex=false; private DatabaseReference mdatabaseuser; private DatabaseReference mdatabasepokedex; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mPokemonList = (RecyclerView)findViewById(R.id.pokemon_list); mPokemonList.setHasFixedSize(true); mPokemonList.setLayoutManager(new LinearLayoutManager(this)); mdatabase = FirebaseDatabase.getInstance().getReference().child("Pokemones"); mdatabaseuser = FirebaseDatabase.getInstance().getReference().child("Users"); mdatabasepokedex = FirebaseDatabase.getInstance().getReference().child("Atrapados"); mdatabase.keepSynced(true); mdatabaseuser.keepSynced(true); mdatabasepokedex.keepSynced(true); mAuth = FirebaseAuth.getInstance(); mauthlistener = new FirebaseAuth.AuthStateListener(){ @Override public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { if(firebaseAuth.getCurrentUser() == null){ Intent loginintent = new Intent(MainActivity.this,LoginActivity.class); loginintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(loginintent); } else { //checkexist(); } } }; } @Override protected void onStart() { super.onStart(); mAuth.addAuthStateListener(mauthlistener); FirebaseRecyclerAdapter<Pokemon,PokemonViewHolder> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<Pokemon, PokemonViewHolder>( Pokemon.class, R.layout.pokemon_row, PokemonViewHolder.class, mdatabase ) { @Override protected void populateViewHolder(PokemonViewHolder viewHolder, Pokemon model, int position) { final String postkey= getRef(position).getKey().toString(); viewHolder.setnombre(model.getNombre(),getApplicationContext()); viewHolder.setimage(getApplicationContext(),model.getImagen()); viewHolder.setatrapado(postkey); viewHolder.mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //Toast.makeText(MainActivity.this,postkey,Toast.LENGTH_LONG).show(); Intent singleblog = new Intent(MainActivity.this,PokemonSingle.class); singleblog.putExtra("blog_id", postkey); startActivity(singleblog); } }); viewHolder.pokebolaimg.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { pokedex=true; mdatabasepokedex.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if(pokedex){ if(dataSnapshot.child(postkey).hasChild(mAuth.getCurrentUser().getUid())){ mdatabasepokedex.child(postkey).child(mAuth.getCurrentUser().getUid()).removeValue(); pokedex = false; } else{ mdatabasepokedex.child(postkey).child(mAuth.getCurrentUser().getUid()).setValue("RandomValue"); pokedex= false; } } } @Override public void onCancelled(DatabaseError databaseError) { } }); } }); } }; mPokemonList.setAdapter(firebaseRecyclerAdapter); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu,menu); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(item.getItemId()==R.id.logout){ logout(); } return super.onOptionsItemSelected(item); } public static class PokemonViewHolder extends RecyclerView.ViewHolder{ View mView; ImageButton pokebolaimg; DatabaseReference databaseatrapado; FirebaseAuth mAuth; FirebaseAuth.AuthStateListener mauthlistener; public PokemonViewHolder(View itemView) { super(itemView); mView = itemView; pokebolaimg = (ImageButton)mView.findViewById(R.id.pokebola); databaseatrapado= FirebaseDatabase.getInstance().getReference().child("Atrapados"); mAuth = FirebaseAuth.getInstance(); databaseatrapado.keepSynced(true); } public void setnombre(String name,Context context){ TextView nombretxt = (TextView)mView.findViewById(R.id.nombrepokemon); AssetManager am = context.getApplicationContext().getAssets(); Typeface typeface = Typeface.createFromAsset(am, String.format(Locale.US, "fonts/%s", "Pokemon Solid.ttf")); nombretxt.setTypeface(typeface); nombretxt.setTextColor(Color.rgb(0,0,0)); nombretxt.setText(name); } public void setimage(final Context ctx,final String image){ final ImageView imagen_pok =(ImageView)mView.findViewById(R.id.imgpokemon); Picasso.with(ctx).load(image).networkPolicy(NetworkPolicy.OFFLINE).into(imagen_pok, new Callback() { @Override public void onSuccess() { } @Override public void onError() { Picasso.with(ctx).load(image).into(imagen_pok); } }); } public void setatrapado(final String postkey) { databaseatrapado.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if(mAuth.getCurrentUser() != null) { if (dataSnapshot.child(postkey).hasChild(mAuth.getCurrentUser().getUid())) { pokebolaimg.setImageResource(R.mipmap.pokebolaroja); } else { pokebolaimg.setImageResource(R.mipmap.pokebola); } } else { Intent intent = new Intent (mView.getContext(), LoginActivity.class); mView.getContext().startActivity(intent); } } /* else { Intent intent = new Intent (mView.getContext(), LoginActivity.class); mView.getContext().startActivity(intent); } }*/ @Override public void onCancelled(DatabaseError databaseError) { } }); } } private void logout() { mAuth.signOut(); } }
a2a5e090d1ab6138928aa2a09c78765184cec0b7
32364ab81af8bf4d7c0d4283ab3077bc70cba8b8
/src/test/java/spring_framework/head_01_test/becomejavasenior_com/MyApplicationTest.java
084d50e7d326c6b151babdbd05dc2d2d32a63e33
[]
no_license
dimaSkalora/Spring_Easyjava_ru
77fc115bd1996d4b2b2f7e7e91488f3d42eff208
bbf9ee244df81174aca28c4dc8efa7e0cbd1b9be
refs/heads/master
2021-05-08T03:11:16.405255
2017-11-08T17:26:10
2017-11-08T17:26:10
108,232,637
0
0
null
null
null
null
UTF-8
Java
false
false
1,557
java
package spring_framework.head_01_test.becomejavasenior_com; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import spring_framework.head_01.becomejavasenior_com.becomejavasenior.spring.di.consumer.MyApplication; import spring_framework.head_01.becomejavasenior_com.becomejavasenior.spring.di.services.MessageService; @Configuration @ComponentScan(value= "spring_framework.head_01.becomejavasenior_com.becomejavasenior.spring.di.consumer") public class MyApplicationTest { private AnnotationConfigApplicationContext context = null; @Bean public MessageService getMessageService() { return new MessageService(){ public boolean sendMessage(String msg, String rec) { System.out.println("Mock Service"); return true; } }; } @Before public void setUp() throws Exception { context = new AnnotationConfigApplicationContext(MyApplicationTest.class); } @After public void tearDown() throws Exception { context.close(); } @Test public void test() { MyApplication app = context.getBean(MyApplication.class); Assert.assertTrue(app.processMessage("Hi Dmytro", "dmytro@becomejavasenior_com.com")); } }
61c2aa9bfed14e758c6dd41054bd4bd854089a5c
a92ba375caa435e3999574c02edbb913f6eae901
/linq-common/src/main/java/com/linq/common/utils/spring/SpringUtils.java
14bf7e3dd5c279de92f06d9f747bf984522a9d27
[]
no_license
wusijava/jiewu
f4febee79da4b5931522c93efef37f01b8b52351
41ad92122e7c09c7618aa9a4a5f2118fdaff173d
refs/heads/master
2023-02-16T23:03:58.273783
2021-01-14T02:46:44
2021-01-14T02:46:44
329,489,086
0
0
null
null
null
null
UTF-8
Java
false
false
3,182
java
package com.linq.common.utils.spring; import org.springframework.aop.framework.AopContext; import org.springframework.beans.BeansException; import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.stereotype.Component; /** * spring工具类 方便在非spring管理环境中获取bean */ @Component public final class SpringUtils implements BeanFactoryPostProcessor { /** * Spring应用上下文环境 */ private static ConfigurableListableBeanFactory beanFactory; @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringUtils.beanFactory = beanFactory; } /** * 获取对象 * * @param name / * * @return Object 一个以所给名字注册的bean的实例 * * @throws BeansException */ @SuppressWarnings("unchecked") public static <T> T getBean(String name) throws BeansException { return (T) beanFactory.getBean(name); } /** * 获取类型为requiredType的对象 * * @param clz / * * @return / * * @throws BeansException / */ public static <T> T getBean(Class<T> clz) throws BeansException { return (T) beanFactory.getBean(clz); } /** * 如果BeanFactory包含一个与所给名称匹配的bean定义,则返回true * * @param name / * * @return boolean */ public static boolean containsBean(String name) { return beanFactory.containsBean(name); } /** * 判断以给定名字注册的bean定义是一个singleton还是一个prototype。 如果与给定名字相应的bean定义没有被找到,将会抛出一个异常(NoSuchBeanDefinitionException) * * @param name / * * @return boolean * * @throws NoSuchBeanDefinitionException / */ public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { return beanFactory.isSingleton(name); } /** * @param name / * * @return Class 注册对象的类型 * * @throws NoSuchBeanDefinitionException / */ public static Class<?> getType(String name) throws NoSuchBeanDefinitionException { return beanFactory.getType(name); } /** * 如果给定的bean名字在bean定义中有别名,则返回这些别名 * * @param name / * * @return / * * @throws NoSuchBeanDefinitionException */ public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { return beanFactory.getAliases(name); } /** * 获取aop代理对象 * * @param invoker / * * @return / */ @SuppressWarnings("unchecked") public static <T> T getAopProxy(T invoker) { return (T) AopContext.currentProxy(); } }
f1b5045a13d63d545953d6c55e83f698bbd190af
37362a66cc13c72c67da854c8462395566962849
/wlwgc-util/src/main/java/com/dao/util/comm/MyBeanFactory.java
b93fc010e545224127811ea9999084bc6e2fc353
[]
no_license
wanwujiedao/wlwgc
0f4289fee6b9aa76ebafe8beccbe28cb0c48a2ed
9fa6c75303639759c9ff05301465e548a5ec8925
refs/heads/master
2021-01-22T19:55:24.390959
2017-03-17T02:53:53
2017-03-17T02:53:53
85,264,253
0
1
null
null
null
null
UTF-8
Java
false
false
883
java
package com.dao.util.comm; /** * Created by back on 2016/1/18. */ import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; public class MyBeanFactory implements ApplicationContextAware { private static ApplicationContext context = null; public void setApplicationContext(ApplicationContext arg0) throws BeansException { context = arg0; System.out.println("MyBeanFactory is start"); } public static Object getBean(String name) { if(context==null) { return null; } return context.getBean(name); } public static <T> T getBean(Class<T> clname) { if(context==null) { return null; } return context.getBean(clname); } }
63fab18190e659cbf877da87b2c5157db0d9cd9d
49ef877c1401a226d68ffd3f2f0e0b3a9f48b35f
/src/main/java/com/oracle/casb/leetcode/LinkedList.java
8b4e314f18c0457de33dd9fc2e3c8d82d777c93f
[]
no_license
abhijeet-srivastava/DailyAlgorithms
17880aa421cbebdacc5951d412e53953b393effd
05a1a3dc3136027f955d9ae3246aea11cd7ff25b
refs/heads/master
2023-08-28T02:29:19.027714
2023-07-28T03:45:30
2023-07-28T03:45:30
196,544,940
0
0
null
2019-07-12T08:55:56
2019-07-12T08:55:56
null
UTF-8
Java
false
false
5,785
java
package com.oracle.casb.leetcode; import com.oracle.casb.common.ListNode; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; public class LinkedList { public static void main(String[] args) { LinkedList ll = new LinkedList(); //ll.testKReverse(); ll.testDutchSort(); } private Node flatten(Node root) { Node main = root; if (main == null) { return root; } while(main != null) { Node scndry = main.down; if (scndry != null) { merge(main, scndry); main.down = null; } main = main.right; } return root; } private void merge(Node main, Node scndry) { Node current = main; main = main.right; Node prev = main; while (scndry != null) { int mainData = (main != null) ? main.data : Integer.MAX_VALUE; int scndryData = (scndry != null) ? scndry.data : Integer.MAX_VALUE; if (mainData < scndryData) { prev = main; main = main.right; } else { scndry.right = main; prev.right = scndry; scndry = scndry.down; } } } public int[][] kClosest(int[][] points, int K) { List<int[]> arr = Arrays.stream(points) .sorted((a, b) -> (a[0]*a[0] + a[1]*a[1] - (b[0]*b[0] + b[1]*b[1]))) .limit(K) .collect(Collectors.toList()); int[][] ret = new int[K][]; final int[] i = {0}; arr.stream().forEach( a -> ret[i[0]++] = a ); return ret; } private void testDutchSort() { int[] arr = {0,2,1,0,0,2,1,3,3,3,2,2,1,1,3,2,1,0,0,1,0,2,0,2,3,3,2,1,2,3,1}; //dutchSort(arr); dutch4sort(arr); System.out.println(Arrays.stream(arr).boxed().map(String::valueOf).collect(Collectors.joining(","))); } private void testKReverse() { ListNode head = createList(); ListNode reverse = reverseKGroup(head, 3); } public void dutch4sort(int[] arr) { int lo = 0, mid = 0, hi = arr.length-1; while (mid <= hi) { if (arr[mid] == 0) { swap(arr, mid, lo); mid += 1; lo += 1; } else if (arr[mid] == 1) { mid += 1; } else { swap(arr, mid, hi); hi -= 1; } } lo = mid+1; hi = arr.length-1; while (lo <= hi) { if (arr[lo] == 2) { lo += 1; } else { swap(arr, lo, hi); hi -= 1; } } } public void dutchSort(int[] arr) { if(arr == null || arr.length ==0) { return; } int lo = 0, mid = 0, hi = arr.length - 1; while(mid <= hi) { if (arr[mid] == 0) { swap(arr, mid, lo); mid += 1; lo += 1; } else if (arr[mid] == 1) { mid += 1; } else if (arr[mid] == 2) { swap(arr, mid, hi); hi -= 1; } } } private void swap(int[] arr, int p1, int p2) { int tmp = arr[p1]; arr[p1] = arr[p2]; arr[p2] = tmp; } public ListNode reverseKGroup(ListNode head, int k) { ListNode curr = head; int count = 0; while (curr != null && count != k) { // find the k+1 node curr = curr.getNext(); count++; } if (count == k) { // if k+1 node is found curr = reverseKGroup(curr, k); // reverse list with k+1 node as head // head - head-pointer to direct part, // curr - head-pointer to reversed part; while (count-- > 0) { // reverse current k-group: ListNode tmp = head.getNext(); // tmp - next head in direct part head.setNext(curr); // preappending "direct" head to the reversed list curr = head; // move head of reversed part to a new node head = tmp; // move "direct" head to the next node in direct part } head = curr; } return head; } private ListNode reverseKGroup1(ListNode head, int k) { if (head == null) { return head; } int count = 1; ListNode last = head; while(count < k && last != null) { last = last.getNext(); count += 1; } if (count < k || last == null) { return head; } ListNode tmp = last.getNext(); reverseList(head, last); head.setNext(reverseKGroup(tmp, k)); head = last; return head; } private void reverseList(ListNode head, ListNode last) { ListNode start = head; ListNode prev = null; ListNode tmp = start.getNext(); start.setNext(null); while(prev != last && tmp != null) { ListNode next = tmp.getNext(); tmp.setNext(start); start = tmp; prev = tmp; tmp = next; } } private ListNode createList() { ListNode head = new ListNode(1); ListNode tmp = head; for (int i = 2; i <= 11; i++) { tmp.setNext(new ListNode(i)); tmp = tmp.getNext(); } return head; } private class Node { int data; Node right, down; Node(int data) { this.data = data; right = null; down = null; } } }
10f7470a2147c759098a2c7925da2d1fb1e7adf0
2388a977f81c0794ca5ddb8bb0dad0c11805f56b
/src/me/martin/main/Commands/ConfigReload.java
63866f8b5bc33dcf1dbfc95dfa2573cab88d5924
[]
no_license
yungmartin/theminingdeadrt
6d25b883ad2d0abd6fffd90670f0dc3bc9c00606
a0da23306a94d875052c6066e8fb0b02db268a6b
refs/heads/master
2023-07-06T10:57:04.593851
2021-08-11T19:36:55
2021-08-11T19:36:55
393,679,630
1
1
null
null
null
null
UTF-8
Java
false
false
1,130
java
package me.martin.main.Commands; import me.martin.main.Main; import me.martin.main.Utils.Utils; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class ConfigReload implements CommandExecutor { Main main; public ConfigReload(Main main){ this.main = main; } @Override public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) { if(commandSender instanceof Player){ Player player = (Player) commandSender; if(args.length > 0) { if(args[0].equalsIgnoreCase("reload")) { main.reloadConfig(); player.sendMessage(Utils.chatColor("&8[&a●&8] &7Config has been reloaded!")); } }else{ player.sendMessage(" "); player.sendMessage(Utils.chatColor("&c/config reload &7- &7&oReloads configuration file")); player.sendMessage(" "); } } return false; } }
60303ca5ba9a51b184468ae06b3787daf3e62b81
63b4a0d07290bf69bd2005013f8c3c15ba52d9b3
/src/rollManager/Student.java
f3e0fcd41a1195bd101fb0164b37b043ea31d4ea
[]
no_license
pieemperor/ClassRollManager
3faaa786f1e1e1cca65e43d0854b8256de755e0f
e50c059c1470f08ba6a37e82020d1f0fdadc8567
refs/heads/master
2021-09-01T01:26:24.946511
2017-12-24T04:42:43
2017-12-24T04:42:43
115,239,657
0
0
null
null
null
null
UTF-8
Java
false
false
8,182
java
package rollManager; /** * --------------------------------------------------------------------------- * File name: Student.java * Project name: Project1 * --------------------------------------------------------------------------- * Creator's name and email: Dakota Cowell, [email protected] * Course: CSCI 1260-002 * Creation Date: Feb 16, 2016 * --------------------------------------------------------------------------- */ /** * To be able to make Student objects to save their information * * <hr> * Date created: Feb 16, 2016 * <hr> * @author Dakota Cowell */ public class Student { private String lastName; //attribute to store a student's last name private String firstName; //attribute to store a student's first name private String major; //attribute to store a student's major private int hoursCompleted; //attribute to store hours completed private double gpa; //attribute to store gpa private String photoFile; //attribute to store a photo file private Classification classification; //enum attribute to store a classification /** * Constructor * * <hr> * Date created: Feb 16, 2016 * * */ public Student() { super ( ); setLastName("XXXXXX"); //setting last name to default setFirstName("XXXXXX"); //setting first name to default setMajor("XXXX"); //setting major to default setHoursCompleted(0); //setting hours completed to default setGpa(0.0); //setting gpa to default setPhotoFile("XXXX.XXX"); //setting photo file to default setClassification(Classification.OTHER); //setting classification to default } /** * Constructor * * <hr> * Date created: Feb 22, 2016 * * * @param firstName * @param lastName * @param major * @param hoursCompleted * @param gpa * @param photoFile * @param classification */ public Student (String firstName, String lastName, String major, int hoursCompleted, double gpa, String photoFile, Classification classification) { super ( ); setLastName(lastName); //setting last name to name passed in setFirstName(firstName); //setting first name to name passed in setMajor(major); //setting major to major passed in setHoursCompleted(hoursCompleted); //setting hoursCompleted to hours passed in setGpa(gpa); //setting gpa to number passed in setPhotoFile(photoFile); //setting photo file to name passed in setClassification(classification); //setting classification to classification passed in } /** * Constructor * * <hr> * Date created: Feb 22, 2016 * * * @param original */ public Student (Student original) { setFirstName(original.firstName); //set new students first name equal to original students first name setLastName(original.lastName);//set new students last name equal to original students last name setMajor(original.major); //set new students major equal to original students major setHoursCompleted(original.hoursCompleted); //set new students hours equal to original students hours setGpa(original.gpa); //set new students gpa equal to original students gpa setPhotoFile(original.photoFile); //set new students photo equal to original students photo setClassification(original.classification); //set new students classification equal to original students classification } /** * Method to get the students last name * * <hr> * Date created: Feb 22, 2016 * * <hr> * @return lastName returns a String of the Student's last name */ public String getLastName ( ) { return lastName; } /** * Method to set the students last name * * <hr> * Date created: Feb 22, 2016 * * <hr> * @param lastName */ public void setLastName (String lastName) { this.lastName = lastName; } /** * Method to get the students first name * * <hr> * Date created: Feb 22, 2016 * * <hr> * @return firstName returns a String of the Student's first name */ public String getFirstName ( ) { return firstName; } /** * Method to set the students first name * * <hr> * Date created: Feb 22, 2016 * * <hr> * @param firstName */ public void setFirstName (String firstName) { this.firstName = firstName; } /** * Method to get the students major * * <hr> * Date created: Feb 22, 2016 * * <hr> * @return major returns a String storing the Student's major */ public String getMajor ( ) { return major; } /** * Method to set the students major * * <hr> * Date created: Feb 22, 2016 * * <hr> * @param major */ public void setMajor (String major) { if(major.length() == 4) { this.major = major.toUpperCase(); } else { this.major = "XXXX"; } } /** * Method to get the students hours completed * * <hr> * Date created: Feb 22, 2016 * * <hr> * @return hoursCompleted returns an int of hours the student has completed */ public int getHoursCompleted ( ) { return hoursCompleted; } /** * Method to set the students hours completed * * <hr> * Date created: Feb 22, 2016 * * <hr> * @param hoursCompleted */ public void setHoursCompleted (int hoursCompleted) { if(hoursCompleted > 0) { this.hoursCompleted = hoursCompleted; } else { this.hoursCompleted = 0; } } /** * Method to get the students gpa * * <hr> * Date created: Feb 22, 2016 * * <hr> * @return gpa returns a double that stores the student's gpa */ public double getGpa ( ) { return gpa; } /** * Method to set the students gpa * * <hr> * Date created: Feb 22, 2016 * * <hr> * @param gpa */ public void setGpa (double gpa) { if(hoursCompleted > 0) { if(gpa > 0 && gpa <= 4.0) { this.gpa = gpa; } else { this.gpa = 0.0; } } else { this.gpa = 0.0; } } /** * Method to get the students photo file * * <hr> * Date created: Feb 22, 2016 * * <hr> * @return photoFile returns a String of the file for a Student's picture */ public String getPhotoFile ( ) { return photoFile; } /** * Method to set the students photo file * * <hr> * Date created: Feb 22, 2016 * * <hr> * @param photoFile */ public void setPhotoFile (String photoFile) { this.photoFile = photoFile; } /** * Method to return a string that displays all of the students' information * * <hr> * Date created: Feb 22, 2016 * * <hr> * @return classification returns a Classification object of * the student's classification * @see java.lang.Object#toString() */ public Classification getClassification() { return classification; } /** * Method to set the students classification * * <hr> * Date created: Feb 22, 2016 * * <hr> * @param classification */ public void setClassification(Classification classification) { this.classification = classification; } public void setClassification(String temp) { if(temp.equalsIgnoreCase("FRESHMAN")) { classification = (Classification.FRESHMAN); } else if(temp.equalsIgnoreCase("SOPHOMORE")) { classification = Classification.SOPHOMORE; } else if(temp.equalsIgnoreCase("JUNIOR")) { classification = Classification.JUNIOR; } else if(temp.equalsIgnoreCase("SENIOR")) { classification = Classification.SENIOR; } else if(temp.equalsIgnoreCase("GRADUATE")) { classification = Classification.GRADUATE; } else { classification = Classification.OTHER; } } /** * Method to convert the info to a string used to display * * <hr> * Date created: Feb 22, 2016 * * <hr> * @return str is a String object returning the Student's info */ public String toString() { String str = " First Name: " + firstName + "\n" + " Last Name: " + lastName + "\n" + " Major: " + major + "\n" + " Classification: " + classification + "\n" + "Hours Completed: " + hoursCompleted + "\n" + " GPA: " + gpa + "\n" + " JPG File Name: " + photoFile; return str; } }
b1dbc8777a9c19ea9c814d5c7f5ad104c7f672f0
6a25fb10efb20eb1152994122487f67735d1c77d
/XML-project/Admin module/src/test/java/ftn/xmlws/adminmodule/AdminModuleApplicationTests.java
b86630d5533a16167bb850a2e3e445f7fe53de19
[]
no_license
filipetrovic/XML-and-Web-Services-project
5e3b2868ad45b9d00bbe1fe466eb96143029fab9
e70b717b3ba8cc4d92a2703411aa2d0df6adafd6
refs/heads/master
2020-03-19T20:57:32.868458
2018-06-24T09:25:47
2018-06-24T09:25:47
136,924,082
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
package ftn.xmlws.adminmodule; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class AdminModuleApplicationTests { @Test public void contextLoads() { } }
b93a1d68a62004a03e44b9267601258478396971
6839e7abfa2e354becd034ea46f14db3cbcc7488
/src/cn/com/sinosoft/action/shop/BillSaveAction.java
d121f35a583de7c5998f41b67917112c74b6d47e
[]
no_license
trigrass2/wj
aa2d310baa876f9e32a65238bcd36e7a2440b8c6
0d4da9d033c6fa2edb014e3a80715c9751a93cd5
refs/heads/master
2021-04-19T11:03:25.609807
2018-01-12T09:26:11
2018-01-12T09:26:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
19,438
java
package cn.com.sinosoft.action.shop; import cn.com.sinosoft.entity.Member; import cn.com.sinosoft.entity.SDBillInfo; import cn.com.sinosoft.entity.SDBillTitle; import cn.com.sinosoft.entity.SDDeliverAddress; import cn.com.sinosoft.entity.SDOrder; import cn.com.sinosoft.service.AreaService; import cn.com.sinosoft.service.BindInfoForLoginService; import cn.com.sinosoft.service.SDBillTitleService; import cn.com.sinosoft.service.SDDeliverAddressService; import cn.com.sinosoft.service.SDOrderService; import com.sinosoft.framework.Config; import com.sinosoft.framework.data.DataTable; import com.sinosoft.framework.data.QueryBuilder; import com.sinosoft.framework.data.Transaction; import com.sinosoft.framework.utility.StringUtil; import com.sinosoft.lis.pubfun.PubFun; import com.sinosoft.platform.pub.NoUtil; import com.sinosoft.schema.SDRemarkSchema; import org.apache.commons.io.FileUtils; import org.json.JSONObject; import javax.annotation.Resource; import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 前台Action类 - 开具发票 */ public class BillSaveAction extends BaseShopAction { /** * */ private static final long serialVersionUID = 4681069613613697836L; @Resource private BindInfoForLoginService bindInfoForLoginService; @Resource private AreaService areaService; @Resource private SDDeliverAddressService mSDDeliverAddressService; @Resource private SDOrderService sDOrderService; @Resource private SDBillTitleService mSDBillTitleService; private String memberID = "";// 登录会员ID private String billType; private String billTypeName; private List<SDDeliverAddress> deliverAddressList = new ArrayList<SDDeliverAddress>();// 邮寄地址信息表 private int deliverAddressCount = 0;// 已有邮寄地址数量 private int leftdeliverAddressCount = 0;// 可添加邮寄地址数量 // 订单额 大于 200 标记 private boolean moreThan200Flag = false; // 抬头数量 private int billTitleCount = 0; // 可添加抬头数量 private int leftbillTitleCount = 0; private String billRequireFlag; private SDOrder order; private List<SDBillTitle> billTitles = new ArrayList<SDBillTitle>(); // 投保人名称 private String applicantName; private String deliverProvinceName; private String deliverCityName; private String deliverDetailAddr; private String deliverName; private String deliverTel; private String deliverZipCode; private String titleName; private File fileUpload;//上传文件 private String fileUploadContentType;//格式同上"fileName"+ContentType private String fileUploadFileName;//格式同上"fileName"+FileName private String orderSns; private String titleId; private String billReqUrl; public String getBillReqUrl() { return billReqUrl; } public void setBillReqUrl(String billReqUrl) { this.billReqUrl = billReqUrl; } public String getTitleId() { return titleId; } public void setTitleId(String titleId) { this.titleId = titleId; } public String getOrderSns() { return orderSns; } public void setOrderSns(String orderSns) { this.orderSns = orderSns; } public String getFileUploadContentType() { return fileUploadContentType; } public void setFileUploadContentType(String fileUploadContentType) { this.fileUploadContentType = fileUploadContentType; } public String getFileUploadFileName() { return fileUploadFileName; } public void setFileUploadFileName(String fileUploadFileName) { this.fileUploadFileName = fileUploadFileName; } public File getFileUpload() { return fileUpload; } public void setFileUpload(File fileUpload) { this.fileUpload = fileUpload; } public String getDeliverProvinceName() { return deliverProvinceName; } public void setDeliverProvinceName(String deliverProvinceName) { this.deliverProvinceName = deliverProvinceName; } public String getDeliverCityName() { return deliverCityName; } public void setDeliverCityName(String deliverCityName) { this.deliverCityName = deliverCityName; } public String getDeliverDetailAddr() { return deliverDetailAddr; } public void setDeliverDetailAddr(String deliverDetailAddr) { this.deliverDetailAddr = deliverDetailAddr; } public String getDeliverName() { return deliverName; } public void setDeliverName(String deliverName) { this.deliverName = deliverName; } public String getDeliverTel() { return deliverTel; } public void setDeliverTel(String deliverTel) { this.deliverTel = deliverTel; } public String getDeliverZipCode() { return deliverZipCode; } public void setDeliverZipCode(String deliverZipCode) { this.deliverZipCode = deliverZipCode; } public String getTitleName() { return titleName; } public void setTitleName(String titleName) { this.titleName = titleName; } public String enterBilling() { String billType = getParameter("billType"); String orderSn = getParameter("orderSn"); billRequireFlag = getParameter("billRequireFlag"); orderSns = orderSn; String view = "error"; Member mMember = this.getLoginMember(); memberID = mMember.getId(); this.setBillType(billType); Map<String, String> billTypeMap = getBillTypeMap(); this.setBillTypeName(billTypeMap.get(billType)); deliverAddressList= mSDDeliverAddressService.getSDDeliverAddressInfo(memberID); if (deliverAddressList != null && deliverAddressList.size() >= 1) { deliverAddressCount = deliverAddressList.size(); } leftdeliverAddressCount = 5 - deliverAddressCount; //发票申请表下载地址 billReqUrl = new QueryBuilder("SELECT VALUE FROM zdconfig WHERE TYPE ='BillRequireTemplatePath'").executeString(); String[] orderSnArray = orderSn.split(","); if(orderSnArray.length==1){ // 订单 SDOrder o = sDOrderService.getOrderByOrderSn(orderSn); this.setOrder(o); BigDecimal totalAmount = o.getTotalAmount(); if (null != totalAmount && totalAmount.compareTo(new BigDecimal("200")) >= 0) { this.setMoreThan200Flag(true); } // 投保人姓名 QueryBuilder queryOrder = new QueryBuilder( "select appnt.applicantName,info.insuranceCompany from sdinformation info,sdinformationappnt appnt, sdorders o where " + " info.informationSn = appnt.informationSn " + " and info.orderSn = o.orderSn " + " and o.orderSn = '" + orderSn + "'"); DataTable applicantDt = queryOrder.executeDataTable(); if(applicantDt != null && applicantDt.getRowCount()>0){ titleName = applicantDt.getString(0, 0); billReqUrl = billReqUrl + applicantDt.getString(0, 1) + ".pdf"; } }else { BigDecimal totalAmount = new BigDecimal(0); List<String> orderSnList = Arrays.asList(orderSnArray); for (String orderSnItem : orderSnList) { // 订单 SDOrder o = sDOrderService.getOrderByOrderSn(orderSnItem); this.setOrder(o); if (null != o.getTotalAmount()) { totalAmount = totalAmount.add(o.getTotalAmount()); } } if (totalAmount.compareTo(new BigDecimal("200")) >= 0) { this.setMoreThan200Flag(true); } // 投保人姓名 QueryBuilder queryOrder = new QueryBuilder( "select appnt.applicantName from sdinformation info,sdinformationappnt appnt, sdorders o where " + " info.informationSn = appnt.informationSn " + " and info.orderSn = o.orderSn " + " and o.orderSn in ('" + orderSn.replace(",", "','") + "')"); titleName = queryOrder.executeString(); } // 发票抬头 List<SDBillTitle> billTitleList = mSDBillTitleService.getSDBillTitle(memberID); if (null != billTitleList) { for(int i = 0; i < billTitleList.size(); i++){ billTitles.add(billTitleList.get(i)); } } if (billTitles != null && billTitles.size() >= 1) { billTitleCount = billTitles.size(); } leftbillTitleCount = 10 - billTitleCount; view = "billing"; return view; } /** * 获取发票类型名称 * * @return */ private Map<String, String> getBillTypeMap(){ DataTable dtBillType = new QueryBuilder("SELECT c.codeValue,c.codeName FROM zdcode c WHERE c.ParentCode = 'billType' ").executeDataTable(); Map<String, String> billTypeMap = new HashMap<String, String>(); if (dtBillType != null && dtBillType.getRowCount() > 0) { int len = dtBillType.getRowCount(); for (int i = 0; i < len; i++) { billTypeMap.put(dtBillType.get(i, 0).toString(), (String)dtBillType.get(i, 1)); } } return billTypeMap; } /** * 发票申请时数据保存处理 */ public String saveBillInfo(){ Map<String, Object> tData = new HashMap<String, Object>(); if (!checkLogin()) { tData.put("tFlag", "Err"); tData.put("Msg", "请登陆后,再进行此操作!"); JSONObject jsonObject = new JSONObject(tData); return ajax(jsonObject.toString(), "text/html"); } Member mMember = this.getLoginMember(); String destPath = getRequest().getSession().getServletContext().getRealPath("upload"); String dateStr = new SimpleDateFormat("yyyyMMddHHmmss").format(Calendar.getInstance().getTime()); String sitUrl = getRequest().getContextPath().replace("//", "/"); String basePath = Config.getFrontServerContextPath() + "/" +sitUrl; String savePath = "/" + mMember.getId() +"/" + dateStr + fileUploadFileName; try { SDBillInfo billInfo = new SDBillInfo(); StringBuffer sb = new StringBuffer(); String[] orderSnArr = orderSns.split(","); for (int i = 0; i < orderSnArr.length; i++) { sb.append("'"); sb.append(orderSnArr[i]); sb.append("'"); sb.append(","); } if(!orderSns.isEmpty()){ String totalAmount= new QueryBuilder("SELECT SUM(totalamount) FROM sdorders WHERE orderSn IN ( " + sb.deleteCharAt(sb.length() -1).toString() + ")").executeString(); if(!totalAmount.isEmpty()){ billInfo.setBillAmount(totalAmount); } } if("04".equals(billType)){ billInfo.setBillReqUrl(basePath + "/upload" +savePath); } if("01".equals(billType)){ titleName = "定额"; } billInfo.setBillTitle(titleName); billInfo.setBillType(billType); billInfo.setDeliverCity(deliverCityName); billInfo.setDeliverDate(dateStr); billInfo.setDeliverDetailAddr(deliverDetailAddr); billInfo.setDeliverName(deliverName); billInfo.setDeliverProvince(deliverProvinceName); billInfo.setDeliverTel(deliverTel); billInfo.setDeliverZipCode(deliverZipCode); billInfo.setMemberId(mMember.getId()); billInfo.setModifyUser(mMember.getUsername()); billInfo.setStatus("01"); billInfo.setOrderSns(orderSns); Map<String,String> result=saveBillInfo(billInfo); String flag=result.get("flag"); if("true".equals(flag)){ if(fileUpload != null && "04".equals(billType)){ FileUtils.copyFile(fileUpload, new File(destPath + savePath)); } tData.put("tFlag", "Suc"); tData.put("Msg", "申请成功!"); }else{ tData.put("tFlag", "Err"); String message=result.get("message"); if(StringUtil.isEmpty(message)){ tData.put("Msg", "申请失败!"); }else{ tData.put("Msg",message); } } } catch (IOException e) { logger.error(e.getMessage(), e); tData.put("tFlag", "Err"); tData.put("Msg", "申请失败!"); } JSONObject jsonObject = new JSONObject(tData); return ajax(jsonObject.toString(), "text/html"); } /** * 申请信息保存 */ private Map<String,String> saveBillInfo(SDBillInfo billInfo) { Map<String,String> result=new HashMap<String,String>(); result.put("flag", "true"); String orderSns = billInfo.getOrderSns(); String[] orderSnArr = orderSns.split(","); Transaction trans = new Transaction(); Date updateDateTime = new Date(); String billId = NoUtil.getMaxNo("sdbillinfo"); String insertBillInfoSql = "insert into sdbillinfo(id,billAmount,billReqUrl,billTitle,billType,deliverCity,deliverDate,deliverDetailAddr,deliverName,deliverProvince,deliverTel,deliverZipCode,memberId,status,modifyUser,updateDate,createUser,createDate) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; QueryBuilder qbBillInsert = new QueryBuilder(insertBillInfoSql); qbBillInsert.add(billId); qbBillInsert.add(billInfo.getBillAmount()); qbBillInsert.add(billInfo.getBillReqUrl()); qbBillInsert.add(billInfo.getBillTitle()); qbBillInsert.add(billInfo.getBillType()); qbBillInsert.add(billInfo.getDeliverCity()); qbBillInsert.add(billInfo.getDeliverDate()); qbBillInsert.add(billInfo.getDeliverDetailAddr()); qbBillInsert.add(billInfo.getDeliverName()); qbBillInsert.add(billInfo.getDeliverProvince()); qbBillInsert.add(billInfo.getDeliverTel()); qbBillInsert.add(billInfo.getDeliverZipCode()); qbBillInsert.add(billInfo.getMemberId()); qbBillInsert.add(billInfo.getStatus()); qbBillInsert.add(billInfo.getMemberId()); qbBillInsert.add(updateDateTime); qbBillInsert.add(billInfo.getMemberId()); qbBillInsert.add(updateDateTime); trans.add(qbBillInsert); String remark = "【发票索要】"; if (StringUtil.isNotEmpty(billInfo.getDeliverProvince())) { remark += billInfo.getDeliverProvince(); } if (StringUtil.isNotEmpty(billInfo.getDeliverCity())) { remark += billInfo.getDeliverCity(); } if (StringUtil.isNotEmpty(billInfo.getDeliverDetailAddr())) { remark += billInfo.getDeliverDetailAddr(); } remark += (","+billInfo.getDeliverName()); remark += (","+billInfo.getDeliverTel()+",自助申请"); for (int i = 0; i < orderSnArr.length; i++) { orderSns = orderSnArr[i]; String selectBillInfoSql = "select count(1) from sdbillinfo s1 , sdbillorderref s2 where s1.id=s2.billId and s1.status!='04' and s2.orderSn = ? "; QueryBuilder qbSelectBillInfo = new QueryBuilder(selectBillInfoSql); qbSelectBillInfo.add(orderSns); int row=qbSelectBillInfo.executeInt(); if (row> 0) { result.put("flag", "false"); result.put("message", "订单:"+orderSns+"已申请开具发票,不能重复申请!"); return result; // Map<String, Object> map = new HashMap<String, Object>(); // DataColumn[] col = dtBillInfo.getDataRow(0).getDataColumns(); // for (int j = 0; j < col.length; j++) { // map.put((String)col[j].getColumnName(), dtBillInfo.get(0, col[j].getColumnName())); // } // billId = (String)map.get("id"); // // String updateBillInfoSql = "update sdbillinfo set billAmount=?,billReqUrl=?,billTitle=?,billType=?,deliverCity=?,deliverDate=?,deliverDetailAddr=?,deliverName=?,deliverProvince=?,deliverTel=?,deliverZipCode=?,memberId=?,status=?,modifyUser=?,modifyDate=? where id=?"; // QueryBuilder qbBillUpdate = new QueryBuilder(updateBillInfoSql); // qbBillUpdate.add(billInfo.getBillAmount()); // qbBillUpdate.add(billInfo.getBillReqUrl()); // qbBillUpdate.add(billInfo.getBillTitle()); // qbBillUpdate.add(billInfo.getBillType()); // qbBillUpdate.add(billInfo.getDeliverCity()); // qbBillUpdate.add(billInfo.getDeliverDate()); // qbBillUpdate.add(billInfo.getDeliverDetailAddr()); // qbBillUpdate.add(billInfo.getDeliverName()); // qbBillUpdate.add(billInfo.getDeliverProvince()); // qbBillUpdate.add(billInfo.getDeliverTel()); // qbBillUpdate.add(billInfo.getDeliverZipCode()); // qbBillUpdate.add(billInfo.getMemberId()); // qbBillUpdate.add(billInfo.getStatus()); // qbBillUpdate.add(billInfo.getMemberId()); // qbBillUpdate.add(updateDateTime); // // qbBillUpdate.add(billId); // trans.add(qbBillUpdate); // // String deleteBillOrderRefSql = "delete from sdbillorderref where billId=?"; // QueryBuilder qbBillDelete = new QueryBuilder(deleteBillOrderRefSql); // qbBillDelete.add(billId); // trans.add(qbBillDelete); } String insertBillOrderRefSql = "insert into sdbillorderref(id,billId,memberId,orderSn,modifyUser,modifyDate,createUser,createDate) values(?,?,?,?,?,?,?,?)"; QueryBuilder qbBillOrderRefInsert = new QueryBuilder(insertBillOrderRefSql); String billOrderRefId = NoUtil.getMaxNo("sdbillorderref"); qbBillOrderRefInsert.add(billOrderRefId); qbBillOrderRefInsert.add(billId); qbBillOrderRefInsert.add(billInfo.getMemberId()); qbBillOrderRefInsert.add(orderSns); qbBillOrderRefInsert.add(billInfo.getMemberId()); qbBillOrderRefInsert.add(updateDateTime); qbBillOrderRefInsert.add(billInfo.getMemberId()); qbBillOrderRefInsert.add(updateDateTime); trans.add(qbBillOrderRefInsert); // 加保全记录 SDRemarkSchema schema = new SDRemarkSchema(); schema.setid(PubFun.GetNRemarkId()); schema.setremark(remark); schema.setorderSn(orderSns); schema.setOperateName(""); schema.setOperateTime(updateDateTime); schema.setOperateType("add"); schema.setprop1(""); schema.setprop2(""); schema.setupperId(""); trans.add(schema, Transaction.INSERT); } if(!trans.commit()){ result.put("flag", "false"); } return result; } /** * 检查当前用户是否登录成功 * * @return 判断是否登录 */ public boolean checkLogin() { Member member = getLoginMember(); if (member == null || "".equals(member)) { return false; } return true; } public String getBillType() { return billType; } public void setBillType(String billType) { this.billType = billType; } public String getBillTypeName() { return billTypeName; } public void setBillTypeName(String billTypeName) { this.billTypeName = billTypeName; } public String getMemberID() { return memberID; } public void setMemberID(String memberID) { this.memberID = memberID; } public List<SDDeliverAddress> getDeliverAddressList() { return deliverAddressList; } public void setDeliverAddressList(List<SDDeliverAddress> deliverAddressList) { this.deliverAddressList = deliverAddressList; } public int getDeliverAddressCount() { return deliverAddressCount; } public void setDeliverAddressCount(int deliverAddressCount) { this.deliverAddressCount = deliverAddressCount; } public int getLeftdeliverAddressCount() { return leftdeliverAddressCount; } public void setLeftdeliverAddressCount(int leftdeliverAddressCount) { this.leftdeliverAddressCount = leftdeliverAddressCount; } public SDOrder getOrder() { return order; } public void setOrder(SDOrder order) { this.order = order; } public boolean isMoreThan200Flag() { return moreThan200Flag; } public void setMoreThan200Flag(boolean moreThan200Flag) { this.moreThan200Flag = moreThan200Flag; } public int getBillTitleCount() { return billTitleCount; } public void setBillTitleCount(int billTitleCount) { this.billTitleCount = billTitleCount; } public int getLeftbillTitleCount() { return leftbillTitleCount; } public void setLeftbillTitleCount(int leftbillTitleCount) { this.leftbillTitleCount = leftbillTitleCount; } public String getApplicantName() { return applicantName; } public void setApplicantName(String applicantName) { this.applicantName = applicantName; } public String getBillRequireFlag() { return billRequireFlag; } public void setBillRequireFlag(String billRequireFlag) { this.billRequireFlag = billRequireFlag; } public List<SDBillTitle> getBillTitles() { return billTitles; } public void setBillTitles(List<SDBillTitle> billTitles) { this.billTitles = billTitles; } }
259ed03b15c97c36a1960335eb4581ab4c62b9c5
45a9161e35385b17827c1409e91dc8b3168ce1e1
/app/src/test/java/bd/com/text/ExampleUnitTest.java
349604b51d833d4efbc2e092f52e167923667d67
[]
no_license
rzhaolin/Test
4e74b00aac71753e84a3bf7aebf7e3af9397efe0
e7e0a4dad5fe78cce0c34c74448d3cc771b15c20
refs/heads/master
2021-01-10T03:54:29.271807
2016-03-25T05:43:50
2016-03-25T05:43:50
54,697,029
0
0
null
null
null
null
UTF-8
Java
false
false
304
java
package bd.com.text; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
7e2b8e9f6605a4abacd90075f8dd46c91321e5ea
7b34a5a10a7f1d905a9b3ac2f2f06d4bdde29b60
/app/src/main/java/com/solarexsoft/tableview/MatrixTableAdapter.java
fbc5e049332e5949bdbb8791b0b23f7e17f5234c
[ "Apache-2.0" ]
permissive
flyfire/TableView
ebf2b3a619af47a18d87281864488d53fae071cd
153bd706afb83a0f320cfa0d99f828df6b304141
refs/heads/master
2021-01-15T12:02:07.596296
2017-08-08T02:47:56
2017-08-08T02:47:56
99,641,751
0
0
null
null
null
null
UTF-8
Java
false
false
2,125
java
package com.solarexsoft.tableview; import android.content.Context; import android.content.res.Resources; import android.util.TypedValue; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.solarexsoft.solarextableview.adapter.BaseTableAdapter; /** * <pre> * Author: houruhou * Project: https://solarex.github.io/projects * CreatAt: 08/08/2017 * Desc: * </pre> */ public class MatrixTableAdapter<T> extends BaseTableAdapter { private static final int WIDTH = 110; private static final int HEIGHT = 32; private final Context mContext; private T[][] table; private final int width; private final int height; public MatrixTableAdapter(Context context) { this(context, null); } public MatrixTableAdapter(Context context, T[][] table) { mContext = context; Resources r = context.getResources(); width = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, WIDTH, r .getDisplayMetrics())); height = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, HEIGHT, r .getDisplayMetrics())); this.table = table; } @Override public int getRowCount() { return table.length - 1; } @Override public int getColumnCount() { return table[0].length - 1; } @Override public View getView(int row, int column, View convertView, ViewGroup parent) { if (convertView == null){ convertView = new TextView(mContext); ((TextView)convertView).setGravity(Gravity.CENTER); } ((TextView)convertView).setText(table[row+1][column+1].toString()); return convertView; } @Override public int getWidth(int column) { return width; } @Override public int getHeight(int row) { return height; } @Override public int getItemViewType(int row, int column) { return 0; } @Override public int getViewTypeCount() { return 1; } }
867da18a1a5907583d050726f49bfc65166ca26e
b93b1ab664d17d17712cec5171c219391097e5fc
/src/main/java/me/earth/phobos/features/modules/movement/StepOld.java
1b196d2648a872a409227bb597bd2728bb16252e
[]
no_license
3000IQPlay/phobos-1.6.9-src-leak
03a862779e94b22e8570e22c0329a2b08fa372b9
2793ec10779bca00df34d9da8dfa0f2125576307
refs/heads/main
2023-07-10T16:41:01.909458
2021-08-16T10:31:40
2021-08-16T10:31:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,610
java
package me.earth.phobos.features.modules.movement; import me.earth.phobos.features.modules.Module; import me.earth.phobos.features.setting.Setting; import net.minecraft.block.Block; import net.minecraft.block.BlockAir; import net.minecraft.block.material.Material; import net.minecraft.network.play.client.CPacketPlayer; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; public class StepOld extends Module { private static StepOld instance; final double[] twoFiveOffset = new double[]{0.425, 0.821, 0.699, 0.599, 1.022, 1.372, 1.652, 1.869, 2.019, 1.907}; private final double[] oneblockPositions = new double[]{0.42, 0.75}; private final double[] twoblockPositions = new double[]{0.4, 0.75, 0.5, 0.41, 0.83, 1.16, 1.41, 1.57, 1.58, 1.42}; private final double[] futurePositions = new double[]{0.42, 0.78, 0.63, 0.51, 0.9, 1.21, 1.45, 1.43}; private final double[] threeBlockPositions = new double[]{0.42, 0.78, 0.63, 0.51, 0.9, 1.21, 1.45, 1.43, 1.78, 1.63, 1.51, 1.9, 2.21, 2.45, 2.43}; private final double[] fourBlockPositions = new double[]{0.42, 0.78, 0.63, 0.51, 0.9, 1.21, 1.45, 1.43, 1.78, 1.63, 1.51, 1.9, 2.21, 2.45, 2.43, 2.78, 2.63, 2.51, 2.9, 3.21, 3.45, 3.43}; public Setting<Boolean> vanilla = this.register(new Setting<Boolean>("Vanilla", false)); public Setting<Float> stepHeightVanilla = this.register(new Setting<Object>("VHeight", Float.valueOf(2.0f), Float.valueOf(0.0f), Float.valueOf(4.0f), v -> this.vanilla.getValue())); public Setting<Integer> stepHeight = this.register(new Setting<Object>("Height", Integer.valueOf(2), Integer.valueOf(1), Integer.valueOf(4), v -> this.vanilla.getValue() == false)); public Setting<Boolean> spoof = this.register(new Setting<Object>("Spoof", Boolean.valueOf(true), v -> this.vanilla.getValue() == false)); public Setting<Integer> ticks = this.register(new Setting<Object>("Delay", Integer.valueOf(3), Integer.valueOf(0), Integer.valueOf(25), v -> this.spoof.getValue() != false && this.vanilla.getValue() == false)); public Setting<Boolean> turnOff = this.register(new Setting<Object>("Disable", Boolean.valueOf(false), v -> this.vanilla.getValue() == false)); public Setting<Boolean> check = this.register(new Setting<Object>("Check", Boolean.valueOf(true), v -> this.vanilla.getValue() == false)); public Setting<Boolean> small = this.register(new Setting<Object>("Offset", Boolean.valueOf(false), v -> this.stepHeight.getValue() > 1 && this.vanilla.getValue() == false)); private double[] selectedPositions = new double[0]; private int packets; public StepOld() { super("StepOld", "Allows you to step up blocks", Module.Category.MOVEMENT, true, false, false); instance = this; } public static StepOld getInstance() { if (instance == null) { instance = new StepOld(); } return instance; } @Override public void onToggle() { StepOld.mc.player.stepHeight = 0.6f; } @Override public void onUpdate() { if (this.vanilla.getValue().booleanValue()) { StepOld.mc.player.stepHeight = this.stepHeightVanilla.getValue().floatValue(); return; } switch (this.stepHeight.getValue()) { case 1: { this.selectedPositions = this.oneblockPositions; break; } case 2: { this.selectedPositions = this.small.getValue() != false ? this.twoblockPositions : this.futurePositions; break; } case 3: { this.selectedPositions = this.twoFiveOffset; } case 4: { this.selectedPositions = this.fourBlockPositions; } } if (StepOld.mc.player.collidedHorizontally && StepOld.mc.player.onGround) { ++this.packets; } AxisAlignedBB bb = StepOld.mc.player.getEntityBoundingBox(); if (this.check.getValue().booleanValue()) { for (int x = MathHelper.floor(bb.minX); x < MathHelper.floor(bb.maxX + 1.0); ++x) { for (int z = MathHelper.floor(bb.minZ); z < MathHelper.floor(bb.maxZ + 1.0); ++z) { Block block = StepOld.mc.world.getBlockState(new BlockPos(x, bb.maxY + 1.0, z)).getBlock(); if (block instanceof BlockAir) continue; return; } } } if (StepOld.mc.player.onGround && !StepOld.mc.player.isInsideOfMaterial(Material.WATER) && !StepOld.mc.player.isInsideOfMaterial(Material.LAVA) && StepOld.mc.player.collidedVertically && StepOld.mc.player.fallDistance == 0.0f && !StepOld.mc.gameSettings.keyBindJump.pressed && StepOld.mc.player.collidedHorizontally && !StepOld.mc.player.isOnLadder() && (this.packets > this.selectedPositions.length - 2 || this.spoof.getValue().booleanValue() && this.packets > this.ticks.getValue())) { for (double position : this.selectedPositions) { StepOld.mc.player.connection.sendPacket(new CPacketPlayer.Position(StepOld.mc.player.posX, StepOld.mc.player.posY + position, StepOld.mc.player.posZ, true)); } StepOld.mc.player.setPosition(StepOld.mc.player.posX, StepOld.mc.player.posY + this.selectedPositions[this.selectedPositions.length - 1], StepOld.mc.player.posZ); this.packets = 0; if (this.turnOff.getValue().booleanValue()) { this.disable(); } } } }
c3c77d7cc16332a3e88720c619b4fb1c5a6163db
663add9b2dbc56fac67cb417f9b40d3477dad927
/core/src/com/mygdx/screens/LoadingScreen.java
16a71c5256886e2aab94e83475c3dc7b9ce76e6a
[]
no_license
manugs92/ProyectTesting
e4eb9546f2176bb8f36e8f175abf171a4cbc9d13
bd969408dce37d9eb7b303c232ee6d269b035b16
refs/heads/master
2020-04-30T02:22:30.815631
2019-06-18T02:31:16
2019-06-18T02:31:16
176,557,630
0
0
null
null
null
null
UTF-8
Java
false
false
450
java
package com.mygdx.screens; import com.mygdx.game.MyGdxGameScreen; import com.mygdx.managers.MyGdxGameScreenManager; /* * Screen usada para pantallas de carga. * */ public class LoadingScreen extends MyGdxGameScreen { public LoadingScreen(MyGdxGameScreenManager myGdxGameScreenManagerR) { super(myGdxGameScreenManagerR); } @Override public void show() { } @Override public void render(float delta) { } }
afc33394dd174cc1567b9741d6573ddc326b54e6
3f66f6b50506f019f4421e58ee42c66947ec3bd6
/src/JavaSpring/JavaCollection.java
628ed3d3fb9943ddf00e33a010190561e817a4dd
[]
no_license
lyj183/JavaSpring
3f933e56385d8a9e3a5fdcd9d86e72ae4428db11
6cb94b8e94c6409526f4e2334bd3a9551ebe1c47
refs/heads/master
2020-03-14T21:02:57.973648
2018-05-02T02:33:31
2018-05-02T02:33:31
131,787,936
0
0
null
null
null
null
UTF-8
Java
false
false
1,189
java
package JavaSpring; import java.util.*; /** * @author: linyijin * @Date: Created in 2017/12/13 11:09 * @Description: 3.4、Spring 注入集合 **/ public class JavaCollection { List addressList; Set addressSet; Map addressMap; Properties addressProp; public void setAddressList(List addressList) { this.addressList = addressList; } public List getAddressList() { System.out.println("List Elements :" + addressList); return addressList; } public void setAddressSet(Set addressSet) { this.addressSet = addressSet; } public Set getAddressSet() { System.out.println("Set Elements :" + addressSet); return addressSet; } public void setAddressMap(Map addressMap) { this.addressMap = addressMap; } public Map getAddressMap() { System.out.println("Map Elements :" + addressMap); return addressMap; } public void setAddressProp(Properties addressProp) { this.addressProp = addressProp; } public Properties getAddressProp() { System.out.println("Property Elements :" + addressProp); return addressProp; } }
5f13ce8448a15e967e9d2df9b7df1d90ccbe82ef
49ddef8047497ac0e915b99fdfd039b4fafd31b1
/MegaMart/src/main/java/com/ihub/model/WishList.java
1fd04bd54ad2204c04ffff4438ad68eaba3c8f54
[]
no_license
VSKBhat/VSKProject
5665b784621e29fc3ae764547de2124a7b1d457f
9302ae3152272f6354021dc0694dfed3549e75b7
refs/heads/master
2021-07-12T07:15:56.770519
2019-07-30T05:39:03
2019-07-30T05:39:03
197,907,282
0
0
null
null
null
null
UTF-8
Java
false
false
856
java
package com.ihub.model; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="wishlist_tb") public class WishList { @Id private String wid; private String display_name; private String short_desc; private String category; public String getWid() { return wid; } public void setWid(String wid) { this.wid = wid; } public String getDisplay_name() { return display_name; } public void setDisplay_name(String display_name) { this.display_name = display_name; } public String getShort_desc() { return short_desc; } public void setShort_desc(String short_desc) { this.short_desc = short_desc; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } }
[ "User@User-LP" ]
User@User-LP
962bb4529206f82d377d05e626fd6d339a071981
b5b612a50b69ea8b7ad06b9bb08c555b7d160dd9
/file-demo/src/main/java/com/file/demo/service/MinioFileUploadService.java
b3297e7bccd05aa7eff4ca90955b2c6746038688
[]
no_license
GentleDevin/file-parent
49a62af5ff7bac3163781b7ac96e4c8600f0e96d
1bc26f4e0fa88c697d454a4fd376faa19d68e71e
refs/heads/master
2023-02-20T11:58:47.769579
2021-01-22T14:40:56
2021-01-22T14:40:56
330,931,560
0
0
null
null
null
null
UTF-8
Java
false
false
2,153
java
package com.file.demo.service; import com.file.commons.common.FileInfoResult; import com.file.commons.common.ResponseResult; import com.file.demo.dao.FileInfoDAO; import com.file.demo.entity.FileInfo; import com.file.demo.entity.FileType; import com.file.demo.entity.UserInfo; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; /** * @Title: 文件信息服务层 * @Description: 处理文件类型业务逻辑 * @Author: Devin * CreateDate: 2021/1/13 16:42 */ @Service public class MinioFileUploadService { @Resource private FileInfoDAO fileInfoDAO; /** * @param id: 主键id * @Description: 获取唯一对象 * @CreateDate: 2021/01/14 18:31:32 * @return: com.minio.entity.FileInfo **/ public FileInfo getOne(Long id) { return fileInfoDAO.getOne(id); } /** * @param ids: 主键id集合 * @Description: 根据id集合, 获取多个对象 * @CreateDate: 2021/01/14 18:31:32 * @return: com.minio.entity.FileInfo **/ public List<FileInfo> findAllById(List<Long> ids) { return fileInfoDAO.findAllById(ids); } /** * @param responseResult: * @Description: 保存文件信息 * @Author: Devin * @CreateDate: 2021/01/13 17:06:05 * @return: void **/ public void save(List<ResponseResult> responseResult) { for (ResponseResult result : responseResult) { if (null != result.get("data")) { FileInfoResult fileInfoResult = (FileInfoResult) result.get("data"); FileInfo fileInfo = new FileInfo(); fileInfo.setFileType(new FileType(1L)); fileInfo.setUser(new UserInfo(1L)); BeanUtils.copyProperties(fileInfoResult, fileInfo); fileInfoDAO.save(fileInfo); } } } /** * @Description: 删除对象 * param fileInfo: 文件信息 * @CreateDate: 2021/01/14 18:31:32 **/ public void delete(FileInfo fileInfo) { fileInfoDAO.delete(fileInfo); } }
a61acd50bc08108af6dd71e811f99ac26f9d1b27
f40ba0be10e056339daf3be94b80363ed46bc416
/src/main/java/codeWars/directionsReduction_20200427/DirReductionBestPractice.java
e03ddef97f9024e62816e7edbaed49fc2ab92157
[]
no_license
JinHoooooou/codeWarsChallenge
e94a3d078389bc35eb25928ddc6c963f5878eb3e
4f6cbc7351e6f027f2451b5237db05aa1dc5f857
refs/heads/master
2022-05-21T03:04:36.139987
2021-10-25T06:29:05
2021-10-25T06:29:05
253,538,045
1
1
null
null
null
null
UTF-8
Java
false
false
1,127
java
package codeWars.directionsReduction_20200427; import java.util.Stack; public class DirReductionBestPractice { public static String[] dirReduc(String[] arr) { final Stack<String> stack = new Stack<>(); for (final String direction : arr) { final String lastElement = stack.size() > 0 ? stack.lastElement() : null; switch (direction) { case "NORTH": if ("SOUTH".equals(lastElement)) { stack.pop(); } else { stack.push(direction); } break; case "SOUTH": if ("NORTH".equals(lastElement)) { stack.pop(); } else { stack.push(direction); } break; case "EAST": if ("WEST".equals(lastElement)) { stack.pop(); } else { stack.push(direction); } break; case "WEST": if ("EAST".equals(lastElement)) { stack.pop(); } else { stack.push(direction); } break; } } return stack.stream().toArray(String[]::new); } }
8eb432f9aaf1a4ea534ab9241781c2d8d7b224d3
ff7105c0b628206aca25691e0fffb90f6b8184dc
/app/src/main/java/com/example/xiaojun/linghejiedao/beans/TianQiBean.java
b8a34d46cbb15eb27895cabb11bfbe2694763609
[]
no_license
yoyo89757001/linhejiedaoXiaoTV
e5ff793e665b4db35a24867847f23dcb54093ae7
44a49126d7166005a5190992023453f06a8019f9
refs/heads/master
2021-01-19T06:02:39.926493
2017-08-17T10:03:39
2017-08-17T10:03:39
100,589,658
0
0
null
null
null
null
UTF-8
Java
false
false
7,060
java
package com.example.xiaojun.linghejiedao.beans; import java.util.List; /** * Created by chenjun on 2017/5/15. */ public class TianQiBean { /** * desc : OK * status : 1000 * data : {"wendu":"25","ganmao":"风较大,阴冷潮湿,较易发生感冒,体质较弱的朋友请注意适当防护。","forecast":[{"fengxiang":"南风","fengli":"3-4级","high":"高温 27℃","type":"暴雨","low":"低温 23℃","date":"15日星期一"},{"fengxiang":"北风","fengli":"3-4级","high":"高温 29℃","type":"多云","low":"低温 23℃","date":"16日星期二"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 30℃","type":"多云","low":"低温 24℃","date":"17日星期三"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 29℃","type":"多云","low":"低温 25℃","date":"18日星期四"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 29℃","type":"多云","low":"低温 23℃","date":"19日星期五"}],"yesterday":{"fl":"微风","fx":"无持续风向","high":"高温 29℃","type":"多云","low":"低温 23℃","date":"14日星期日"},"aqi":"27","city":"广州"} */ private String desc; private int status; private DataBean data; public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public DataBean getData() { return data; } public void setData(DataBean data) { this.data = data; } public static class DataBean { /** * wendu : 25 * ganmao : 风较大,阴冷潮湿,较易发生感冒,体质较弱的朋友请注意适当防护。 * forecast : [{"fengxiang":"南风","fengli":"3-4级","high":"高温 27℃","type":"暴雨","low":"低温 23℃","date":"15日星期一"},{"fengxiang":"北风","fengli":"3-4级","high":"高温 29℃","type":"多云","low":"低温 23℃","date":"16日星期二"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 30℃","type":"多云","low":"低温 24℃","date":"17日星期三"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 29℃","type":"多云","low":"低温 25℃","date":"18日星期四"},{"fengxiang":"无持续风向","fengli":"微风级","high":"高温 29℃","type":"多云","low":"低温 23℃","date":"19日星期五"}] * yesterday : {"fl":"微风","fx":"无持续风向","high":"高温 29℃","type":"多云","low":"低温 23℃","date":"14日星期日"} * aqi : 27 * city : 广州 */ private String wendu; private String ganmao; private YesterdayBean yesterday; private String aqi; private String city; private List<ForecastBean> forecast; public String getWendu() { return wendu; } public void setWendu(String wendu) { this.wendu = wendu; } public String getGanmao() { return ganmao; } public void setGanmao(String ganmao) { this.ganmao = ganmao; } public YesterdayBean getYesterday() { return yesterday; } public void setYesterday(YesterdayBean yesterday) { this.yesterday = yesterday; } public String getAqi() { return aqi; } public void setAqi(String aqi) { this.aqi = aqi; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public List<ForecastBean> getForecast() { return forecast; } public void setForecast(List<ForecastBean> forecast) { this.forecast = forecast; } public static class YesterdayBean { /** * fl : 微风 * fx : 无持续风向 * high : 高温 29℃ * type : 多云 * low : 低温 23℃ * date : 14日星期日 */ private String fl; private String fx; private String high; private String type; private String low; private String date; public String getFl() { return fl; } public void setFl(String fl) { this.fl = fl; } public String getFx() { return fx; } public void setFx(String fx) { this.fx = fx; } public String getHigh() { return high; } public void setHigh(String high) { this.high = high; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getLow() { return low; } public void setLow(String low) { this.low = low; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } } public static class ForecastBean { /** * fengxiang : 南风 * fengli : 3-4级 * high : 高温 27℃ * type : 暴雨 * low : 低温 23℃ * date : 15日星期一 */ private String fengxiang; private String fengli; private String high; private String type; private String low; private String date; public String getFengxiang() { return fengxiang; } public void setFengxiang(String fengxiang) { this.fengxiang = fengxiang; } public String getFengli() { return fengli; } public void setFengli(String fengli) { this.fengli = fengli; } public String getHigh() { return high; } public void setHigh(String high) { this.high = high; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getLow() { return low; } public void setLow(String low) { this.low = low; } public String getDate() { return date; } public void setDate(String date) { this.date = date; } } } }
43308ae89e7e62dbf967346f5e478138448e2b68
16d63be740eb24142745404d5055950d5c72df74
/src/contagionJVM/Event/Module_OnPlayerDying.java
76ad3bf90465c1d4b8540d2628ccfa92b5d6dea9
[ "MIT" ]
permissive
zunath/Contagion_JVM
8775969bee1ba3a0680c4c21c7095da0db81fcb6
7d25464ca8c4374f9de086f373c3a038c56327af
refs/heads/master
2021-07-03T03:37:31.293914
2016-12-28T15:23:36
2016-12-28T15:23:36
30,473,386
3
0
null
null
null
null
UTF-8
Java
false
false
1,956
java
package contagionJVM.Event; import contagionJVM.Constants; import contagionJVM.Helper.ColorToken; import contagionJVM.IScriptEventHandler; import org.nwnx.nwnx2.jvm.*; import org.nwnx.nwnx2.jvm.constants.*; @SuppressWarnings("unused") public class Module_OnPlayerDying implements IScriptEventHandler { @Override public void runScript(NWObject objSelf) { final NWObject oPC = NWScript.getLastPlayerDying(); Scheduler.assign(oPC, new Runnable() { @Override public void run() { NWScript.clearAllActions(false); DeathFunction(oPC, 8); } }); } private void DeathFunction(final NWObject oPC, int nDC) { int iHP = NWScript.getCurrentHitPoints(oPC); if (!NWScript.getIsObjectValid(oPC)) return; //Player Rolls a random number between 1 and 20+ConMod int iRoll = 20 + NWScript.getAbilityModifier(Ability.CONSTITUTION, oPC); iRoll = NWScript.random(iRoll) + 1; //Sanity Check if (nDC > 30) nDC = 30; else if (nDC < 4) nDC = 4; NWEffect eResult; if (iHP <= 0) { if (iRoll >= nDC) //Stabilize { nDC -= 2; eResult = NWScript.effectHeal(1); //PlayVoiceChat(VOICE_CHAT_LAUGH); } else //Failed! { if (NWScript.random(2) + 1 == 1) nDC++; eResult = NWScript.effectDamage(1, DamageType.MAGICAL, DamagePower.NORMAL); //Death! if (iHP <= -9) { NWScript.applyEffectToObject(DurationType.INSTANT, NWScript.effectVisualEffect(Vfx.IMP_DEATH, false), oPC, 0.0f); NWScript.applyEffectToObject(DurationType.INSTANT, NWScript.effectDeath(false, true), oPC, 0.0f); return; } else { NWScript.sendMessageToPC(oPC, ColorToken.Orange() + "You failed to stabilize this round." + ColorToken.End()); } NWScript.applyEffectToObject(DurationType.INSTANT, eResult, oPC, 0.0f); final int dcCopy = nDC; Scheduler.delay(oPC, 3000, new Runnable() { @Override public void run() { DeathFunction(oPC, dcCopy); } }); } } } }
6c2a3c4943e8451012c16e91f287cd41e321d588
b1d64a5ab8e263c2987f1522ed1ed27d211ec33f
/src/main/java/com/rsostream/tcp/models/SensorReading.java
4659821b2e0fa436b5d336bc81bbc4ba52d7a6d2
[]
no_license
rsoStream/rsostreamtcp
ff7a9ed8dcf86aae10a039df2332fb916e4902cb
2987c9d4904b5327333ada5c7a0c4c7cf25169b9
refs/heads/master
2021-09-04T08:52:14.487132
2018-01-17T13:04:04
2018-01-17T13:04:04
115,654,654
0
0
null
null
null
null
UTF-8
Java
false
false
1,831
java
package com.rsostream.tcp.models; import com.rsostream.tcp.util.InvalidMessageException; import javax.xml.bind.annotation.XmlRootElement; import java.util.Date; @XmlRootElement public class SensorReading { public final EnumType TYPE; private Date timeObtained; private String imei; private int signalQuality; private static int numberOfAttributes = 3; SensorReading(Date timeObtained, String imei, int signalQuality) { TYPE = EnumType.SUPER; this.timeObtained = timeObtained; this.imei = imei; this.signalQuality = signalQuality; } SensorReading(EnumType type, Date timeObtained, String imei, int signalQuality) { TYPE = type; this.timeObtained = timeObtained; this.imei = imei; this.signalQuality = signalQuality; } public Date getTimeObtained() { return timeObtained; } public void setTimeObtained(Date timeObtained) { this.timeObtained = timeObtained; } public int getNumberOfAttributes() { return numberOfAttributes; } public String getImei() { return imei; } public void setImei(String imei) { this.imei = imei; } public int getSignalQuality() { return signalQuality; } public void setSignalQuality(int signalQuality) { this.signalQuality = signalQuality; } public static SensorReading createReading(String[] data) throws InvalidMessageException { if (data.length != SensorReading.numberOfAttributes) { throw new InvalidMessageException(); } Date dateObtained = new Date(Long.parseLong(data[0])); String IMEI = data[1]; int signalQuality = Integer.parseInt(data[2]); return new SensorReading(dateObtained, IMEI, signalQuality); } }
2be888bfbc93674f3782c2dc43455d1373ea71a9
16c32b3d2e93b4897e685fa98615fadb2fe74251
/config-bus-server/src/test/java/com/glen/configbusserver/ConfigBusServerApplicationTests.java
7fcb5dd7f5499ae123b2c3e1f6c24a3981cb9fd7
[]
no_license
yingLeos/microservice-1
1aebe27e4a6882fbc13b4e4f26088833eb59356d
455c97dfb022f4fde4e2a45252f94e5543c16365
refs/heads/master
2020-07-11T06:30:18.563536
2019-08-01T05:14:29
2019-08-01T05:14:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
359
java
package com.glen.configbusserver; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class ConfigBusServerApplicationTests { @Test public void contextLoads() { } }
74e139742536644db03e1604f7ff8a564937ccb4
0ec02571dc0205e62373dcabb7d6bd68f4286dc7
/src/main/java/com/evgesha/config/MvcConfig.java
4a3a797d1e947937cfed2ad52955a8153ab846ce
[]
no_license
EvgeshQa/News
26efd55639cd9f66f93c57d4b385efe09ffdc830
2fbea69ecd938910771145ec95bfc37b7a525daa
refs/heads/master
2023-05-19T10:53:46.427601
2021-06-07T08:50:02
2021-06-07T08:50:02
374,429,207
0
0
null
null
null
null
UTF-8
Java
false
false
462
java
package com.evgesha.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration public class MvcConfig implements WebMvcConfigurer { public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/login").setViewName("login"); } }
15f6fcde33a79ab5a8a02062a936eaba10ec1022
908c9f95e52a4a5c265c690c73932aeb3f82dfe8
/gmall-oms/src/main/java/com/atguigu/gmall/oms/controller/OrderSettingController.java
d54cc4c21e600cf978ddbfca87e33d3ae230dbcc
[ "Apache-2.0" ]
permissive
ccyj1024/gmall
e8201cc2fea80e77d038f19aac2725755c0ed019
b13b504204ed411937fc60e9bc829c4cf50b8893
refs/heads/master
2022-12-15T21:38:39.858644
2019-09-29T01:03:12
2019-09-29T01:03:12
209,918,123
0
0
Apache-2.0
2022-12-10T06:26:58
2019-09-21T03:23:04
JavaScript
UTF-8
Java
false
false
2,561
java
package com.atguigu.gmall.oms.controller; import java.util.Arrays; import java.util.Map; import com.atguigu.core.bean.PageVo; import com.atguigu.core.bean.QueryCondition; import com.atguigu.core.bean.Resp; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import com.atguigu.gmall.oms.entity.OrderSettingEntity; import com.atguigu.gmall.oms.service.OrderSettingService; /** * 订单配置信息 * * @author ccyj * @email [email protected] * @date 2019-09-21 13:51:10 */ @Api(tags = "订单配置信息 管理") @RestController @RequestMapping("oms/ordersetting") public class OrderSettingController { @Autowired private OrderSettingService orderSettingService; /** * 列表 */ @ApiOperation("分页查询(排序)") @GetMapping("/list") @PreAuthorize("hasAuthority('oms:ordersetting:list')") public Resp<PageVo> list(QueryCondition queryCondition) { PageVo page = orderSettingService.queryPage(queryCondition); return Resp.ok(page); } /** * 信息 */ @ApiOperation("详情查询") @GetMapping("/info/{id}") @PreAuthorize("hasAuthority('oms:ordersetting:info')") public Resp<OrderSettingEntity> info(@PathVariable("id") Long id){ OrderSettingEntity orderSetting = orderSettingService.getById(id); return Resp.ok(orderSetting); } /** * 保存 */ @ApiOperation("保存") @PostMapping("/save") @PreAuthorize("hasAuthority('oms:ordersetting:save')") public Resp<Object> save(@RequestBody OrderSettingEntity orderSetting){ orderSettingService.save(orderSetting); return Resp.ok(null); } /** * 修改 */ @ApiOperation("修改") @PostMapping("/update") @PreAuthorize("hasAuthority('oms:ordersetting:update')") public Resp<Object> update(@RequestBody OrderSettingEntity orderSetting){ orderSettingService.updateById(orderSetting); return Resp.ok(null); } /** * 删除 */ @ApiOperation("删除") @PostMapping("/delete") @PreAuthorize("hasAuthority('oms:ordersetting:delete')") public Resp<Object> delete(@RequestBody Long[] ids){ orderSettingService.removeByIds(Arrays.asList(ids)); return Resp.ok(null); } }
f7c4b16108718e57e3551e684bdb4a8418af35e6
2758aef4c3a38075667c429ee7bb7b172b9aa5af
/JavaSE(API)_Demo/src/map/Key.java
afb954d255afc7e23b7c476ff6a01dda2b79debc
[ "MIT" ]
permissive
Paranoidzhou/Java
676c00ef17e5fddbbebe8eb566a879d9bf3bb7a2
92d0e3e83860085d5212d0b788cebc3ab920dac6
refs/heads/master
2020-03-17T04:52:52.306829
2018-07-22T15:05:56
2018-07-22T15:05:56
133,292,350
0
0
null
null
null
null
UTF-8
Java
false
false
1,916
java
package map; /* * HashMap内部由数组保存键值对,存储元素时根据Key的hascode值计算数组下标,并将键值对存入, *获取时也根据该值计算下标直接找到该元素,所以HashMap根据这个方式避免了查找元素时对数组的遍历 *操作,所以其不受元素的多少而影响查询性能。 * * 由于Key的hashcode决定着键值对在HashMap中数组下标位置,而equals方法决定着Key是否重复. *所以这两个方法要妥善重写,当遇到两个Key的hashcode值一样,但是equals比较不为true的情况时, *会出现链表、链表会降低查询性能,应当尽量避免。 * * hashcode与equals方法都是定义在Object中的,所有类都具有,java提供的类都妥善的重写了 * 这两个方法.当我们定义的类需要重写equals或hashcode时必须遵循以下原则: * 1:成对重写,当我们需要重写一个类的equals方法时就应当连同重写hashcode方法。 * 2:一致性,当两个对象equals比较为true时,hashcode值应当相等,反之虽然不是必须的,但是尽 * 量保证当两个对象Hashcode方法返回值相等时,equals方法比较为true,否则会在HashMap中出现 * 链表。 * 3:稳定性,当参与equals比较的属性没有发生变化的情况下,多次调用hashcode方法返回的数字不应 * 当有变化。 */ public class Key { private int x; private int y; @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + x; result = prime * result + y; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Key other = (Key) obj; if (x != other.x) return false; if (y != other.y) return false; return true; } }
345aa452caadefa9e62ed3880bd61cb6bd0b3db7
7fa49925ed7c8517c65d9f9543621d08309bc2cf
/sources\ca\albertahealthservices\contacttracing\services\BluetoothMonitoringService$isBluetoothEnabled$bluetoothAdapter$2.java
11a5e49382c851c6c403124939c42d1131850331
[]
no_license
abtt-decompiled/abtracetogether_1.0.0.apk_disassembled
c8717a47f384fb7e8da076e48abe1e4ef8500837
d81b0ee1490911104ab36056d220be7fe3a19e1c
refs/heads/master
2022-06-24T02:51:29.783727
2020-05-08T21:05:20
2020-05-08T21:05:20
262,426,826
2
1
null
null
null
null
UTF-8
Java
false
false
1,402
java
package ca.albertahealthservices.contacttracing.services; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothManager; import kotlin.Metadata; import kotlin.TypeCastException; import kotlin.jvm.functions.Function0; import kotlin.jvm.internal.Lambda; @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\n \u0002*\u0004\u0018\u00010\u00010\u0001H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "Landroid/bluetooth/BluetoothAdapter;", "kotlin.jvm.PlatformType", "invoke"}, k = 3, mv = {1, 1, 16}) /* compiled from: BluetoothMonitoringService.kt */ final class BluetoothMonitoringService$isBluetoothEnabled$bluetoothAdapter$2 extends Lambda implements Function0<BluetoothAdapter> { final /* synthetic */ BluetoothMonitoringService this$0; BluetoothMonitoringService$isBluetoothEnabled$bluetoothAdapter$2(BluetoothMonitoringService bluetoothMonitoringService) { this.this$0 = bluetoothMonitoringService; super(0); } public final BluetoothAdapter invoke() { Object systemService = this.this$0.getSystemService("bluetooth"); if (systemService != null) { return ((BluetoothManager) systemService).getAdapter(); } throw new TypeCastException("null cannot be cast to non-null type android.bluetooth.BluetoothManager"); } }
45972691ccb3e4aa0179a9ce193be414509f2e34
844a12ba2a66ea39283a1842fa0919b56593562c
/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ImportFeatureValuesOperationMetadata.java
a1b9f5c1369895ac5f275c39fa3af28a736a44d4
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
meltsufin/google-cloud-java
f941375e56657a2e20cda5351079e2d3d1d6aeb5
3869c18477cb8cd4e4c1560db90936b578845089
refs/heads/main
2022-05-04T11:43:50.284969
2022-05-03T20:44:17
2022-05-03T20:44:17
71,588,669
0
0
null
null
null
null
UTF-8
Java
false
false
35,054
java
/* * Copyright 2020 Google LLC * * 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 * * https://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. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/aiplatform/v1beta1/featurestore_service.proto package com.google.cloud.aiplatform.v1beta1; /** * * * <pre> * Details of operations that perform import Feature values. * </pre> * * Protobuf type {@code google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata} */ public final class ImportFeatureValuesOperationMetadata extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata) ImportFeatureValuesOperationMetadataOrBuilder { private static final long serialVersionUID = 0L; // Use ImportFeatureValuesOperationMetadata.newBuilder() to construct. private ImportFeatureValuesOperationMetadata( com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ImportFeatureValuesOperationMetadata() {} @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new ImportFeatureValuesOperationMetadata(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private ImportFeatureValuesOperationMetadata( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.Builder subBuilder = null; if (genericMetadata_ != null) { subBuilder = genericMetadata_.toBuilder(); } genericMetadata_ = input.readMessage( com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(genericMetadata_); genericMetadata_ = subBuilder.buildPartial(); } break; } case 16: { importedEntityCount_ = input.readInt64(); break; } case 24: { importedFeatureValueCount_ = input.readInt64(); break; } case 48: { invalidRowCount_ = input.readInt64(); break; } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.aiplatform.v1beta1.FeaturestoreServiceProto .internal_static_google_cloud_aiplatform_v1beta1_ImportFeatureValuesOperationMetadata_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.aiplatform.v1beta1.FeaturestoreServiceProto .internal_static_google_cloud_aiplatform_v1beta1_ImportFeatureValuesOperationMetadata_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata.class, com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata.Builder.class); } public static final int GENERIC_METADATA_FIELD_NUMBER = 1; private com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata genericMetadata_; /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> * * @return Whether the genericMetadata field is set. */ @java.lang.Override public boolean hasGenericMetadata() { return genericMetadata_ != null; } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> * * @return The genericMetadata. */ @java.lang.Override public com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata getGenericMetadata() { return genericMetadata_ == null ? com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.getDefaultInstance() : genericMetadata_; } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> */ @java.lang.Override public com.google.cloud.aiplatform.v1beta1.GenericOperationMetadataOrBuilder getGenericMetadataOrBuilder() { return getGenericMetadata(); } public static final int IMPORTED_ENTITY_COUNT_FIELD_NUMBER = 2; private long importedEntityCount_; /** * * * <pre> * Number of entities that have been imported by the operation. * </pre> * * <code>int64 imported_entity_count = 2;</code> * * @return The importedEntityCount. */ @java.lang.Override public long getImportedEntityCount() { return importedEntityCount_; } public static final int IMPORTED_FEATURE_VALUE_COUNT_FIELD_NUMBER = 3; private long importedFeatureValueCount_; /** * * * <pre> * Number of Feature values that have been imported by the operation. * </pre> * * <code>int64 imported_feature_value_count = 3;</code> * * @return The importedFeatureValueCount. */ @java.lang.Override public long getImportedFeatureValueCount() { return importedFeatureValueCount_; } public static final int INVALID_ROW_COUNT_FIELD_NUMBER = 6; private long invalidRowCount_; /** * * * <pre> * The number of rows in input source that weren't imported due to either * * Not having any featureValues. * * Having a null entityId. * * Having a null timestamp. * * Not being parsable (applicable for CSV sources). * </pre> * * <code>int64 invalid_row_count = 6;</code> * * @return The invalidRowCount. */ @java.lang.Override public long getInvalidRowCount() { return invalidRowCount_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (genericMetadata_ != null) { output.writeMessage(1, getGenericMetadata()); } if (importedEntityCount_ != 0L) { output.writeInt64(2, importedEntityCount_); } if (importedFeatureValueCount_ != 0L) { output.writeInt64(3, importedFeatureValueCount_); } if (invalidRowCount_ != 0L) { output.writeInt64(6, invalidRowCount_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (genericMetadata_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getGenericMetadata()); } if (importedEntityCount_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, importedEntityCount_); } if (importedFeatureValueCount_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, importedFeatureValueCount_); } if (invalidRowCount_ != 0L) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, invalidRowCount_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata)) { return super.equals(obj); } com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata other = (com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata) obj; if (hasGenericMetadata() != other.hasGenericMetadata()) return false; if (hasGenericMetadata()) { if (!getGenericMetadata().equals(other.getGenericMetadata())) return false; } if (getImportedEntityCount() != other.getImportedEntityCount()) return false; if (getImportedFeatureValueCount() != other.getImportedFeatureValueCount()) return false; if (getInvalidRowCount() != other.getInvalidRowCount()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasGenericMetadata()) { hash = (37 * hash) + GENERIC_METADATA_FIELD_NUMBER; hash = (53 * hash) + getGenericMetadata().hashCode(); } hash = (37 * hash) + IMPORTED_ENTITY_COUNT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getImportedEntityCount()); hash = (37 * hash) + IMPORTED_FEATURE_VALUE_COUNT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getImportedFeatureValueCount()); hash = (37 * hash) + INVALID_ROW_COUNT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getInvalidRowCount()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder( com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * * <pre> * Details of operations that perform import Feature values. * </pre> * * Protobuf type {@code google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata) com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadataOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.aiplatform.v1beta1.FeaturestoreServiceProto .internal_static_google_cloud_aiplatform_v1beta1_ImportFeatureValuesOperationMetadata_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.aiplatform.v1beta1.FeaturestoreServiceProto .internal_static_google_cloud_aiplatform_v1beta1_ImportFeatureValuesOperationMetadata_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata.class, com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata.Builder .class); } // Construct using // com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); if (genericMetadataBuilder_ == null) { genericMetadata_ = null; } else { genericMetadata_ = null; genericMetadataBuilder_ = null; } importedEntityCount_ = 0L; importedFeatureValueCount_ = 0L; invalidRowCount_ = 0L; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.aiplatform.v1beta1.FeaturestoreServiceProto .internal_static_google_cloud_aiplatform_v1beta1_ImportFeatureValuesOperationMetadata_descriptor; } @java.lang.Override public com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata getDefaultInstanceForType() { return com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata .getDefaultInstance(); } @java.lang.Override public com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata build() { com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata buildPartial() { com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata result = new com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata(this); if (genericMetadataBuilder_ == null) { result.genericMetadata_ = genericMetadata_; } else { result.genericMetadata_ = genericMetadataBuilder_.build(); } result.importedEntityCount_ = importedEntityCount_; result.importedFeatureValueCount_ = importedFeatureValueCount_; result.invalidRowCount_ = invalidRowCount_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata) { return mergeFrom( (com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata other) { if (other == com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata .getDefaultInstance()) return this; if (other.hasGenericMetadata()) { mergeGenericMetadata(other.getGenericMetadata()); } if (other.getImportedEntityCount() != 0L) { setImportedEntityCount(other.getImportedEntityCount()); } if (other.getImportedFeatureValueCount() != 0L) { setImportedFeatureValueCount(other.getImportedFeatureValueCount()); } if (other.getInvalidRowCount() != 0L) { setInvalidRowCount(other.getInvalidRowCount()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata genericMetadata_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata, com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.Builder, com.google.cloud.aiplatform.v1beta1.GenericOperationMetadataOrBuilder> genericMetadataBuilder_; /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> * * @return Whether the genericMetadata field is set. */ public boolean hasGenericMetadata() { return genericMetadataBuilder_ != null || genericMetadata_ != null; } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> * * @return The genericMetadata. */ public com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata getGenericMetadata() { if (genericMetadataBuilder_ == null) { return genericMetadata_ == null ? com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.getDefaultInstance() : genericMetadata_; } else { return genericMetadataBuilder_.getMessage(); } } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> */ public Builder setGenericMetadata( com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata value) { if (genericMetadataBuilder_ == null) { if (value == null) { throw new NullPointerException(); } genericMetadata_ = value; onChanged(); } else { genericMetadataBuilder_.setMessage(value); } return this; } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> */ public Builder setGenericMetadata( com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.Builder builderForValue) { if (genericMetadataBuilder_ == null) { genericMetadata_ = builderForValue.build(); onChanged(); } else { genericMetadataBuilder_.setMessage(builderForValue.build()); } return this; } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> */ public Builder mergeGenericMetadata( com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata value) { if (genericMetadataBuilder_ == null) { if (genericMetadata_ != null) { genericMetadata_ = com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.newBuilder( genericMetadata_) .mergeFrom(value) .buildPartial(); } else { genericMetadata_ = value; } onChanged(); } else { genericMetadataBuilder_.mergeFrom(value); } return this; } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> */ public Builder clearGenericMetadata() { if (genericMetadataBuilder_ == null) { genericMetadata_ = null; onChanged(); } else { genericMetadata_ = null; genericMetadataBuilder_ = null; } return this; } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> */ public com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.Builder getGenericMetadataBuilder() { onChanged(); return getGenericMetadataFieldBuilder().getBuilder(); } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> */ public com.google.cloud.aiplatform.v1beta1.GenericOperationMetadataOrBuilder getGenericMetadataOrBuilder() { if (genericMetadataBuilder_ != null) { return genericMetadataBuilder_.getMessageOrBuilder(); } else { return genericMetadata_ == null ? com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.getDefaultInstance() : genericMetadata_; } } /** * * * <pre> * Operation metadata for Featurestore import Feature values. * </pre> * * <code>.google.cloud.aiplatform.v1beta1.GenericOperationMetadata generic_metadata = 1;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata, com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.Builder, com.google.cloud.aiplatform.v1beta1.GenericOperationMetadataOrBuilder> getGenericMetadataFieldBuilder() { if (genericMetadataBuilder_ == null) { genericMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata, com.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.Builder, com.google.cloud.aiplatform.v1beta1.GenericOperationMetadataOrBuilder>( getGenericMetadata(), getParentForChildren(), isClean()); genericMetadata_ = null; } return genericMetadataBuilder_; } private long importedEntityCount_; /** * * * <pre> * Number of entities that have been imported by the operation. * </pre> * * <code>int64 imported_entity_count = 2;</code> * * @return The importedEntityCount. */ @java.lang.Override public long getImportedEntityCount() { return importedEntityCount_; } /** * * * <pre> * Number of entities that have been imported by the operation. * </pre> * * <code>int64 imported_entity_count = 2;</code> * * @param value The importedEntityCount to set. * @return This builder for chaining. */ public Builder setImportedEntityCount(long value) { importedEntityCount_ = value; onChanged(); return this; } /** * * * <pre> * Number of entities that have been imported by the operation. * </pre> * * <code>int64 imported_entity_count = 2;</code> * * @return This builder for chaining. */ public Builder clearImportedEntityCount() { importedEntityCount_ = 0L; onChanged(); return this; } private long importedFeatureValueCount_; /** * * * <pre> * Number of Feature values that have been imported by the operation. * </pre> * * <code>int64 imported_feature_value_count = 3;</code> * * @return The importedFeatureValueCount. */ @java.lang.Override public long getImportedFeatureValueCount() { return importedFeatureValueCount_; } /** * * * <pre> * Number of Feature values that have been imported by the operation. * </pre> * * <code>int64 imported_feature_value_count = 3;</code> * * @param value The importedFeatureValueCount to set. * @return This builder for chaining. */ public Builder setImportedFeatureValueCount(long value) { importedFeatureValueCount_ = value; onChanged(); return this; } /** * * * <pre> * Number of Feature values that have been imported by the operation. * </pre> * * <code>int64 imported_feature_value_count = 3;</code> * * @return This builder for chaining. */ public Builder clearImportedFeatureValueCount() { importedFeatureValueCount_ = 0L; onChanged(); return this; } private long invalidRowCount_; /** * * * <pre> * The number of rows in input source that weren't imported due to either * * Not having any featureValues. * * Having a null entityId. * * Having a null timestamp. * * Not being parsable (applicable for CSV sources). * </pre> * * <code>int64 invalid_row_count = 6;</code> * * @return The invalidRowCount. */ @java.lang.Override public long getInvalidRowCount() { return invalidRowCount_; } /** * * * <pre> * The number of rows in input source that weren't imported due to either * * Not having any featureValues. * * Having a null entityId. * * Having a null timestamp. * * Not being parsable (applicable for CSV sources). * </pre> * * <code>int64 invalid_row_count = 6;</code> * * @param value The invalidRowCount to set. * @return This builder for chaining. */ public Builder setInvalidRowCount(long value) { invalidRowCount_ = value; onChanged(); return this; } /** * * * <pre> * The number of rows in input source that weren't imported due to either * * Not having any featureValues. * * Having a null entityId. * * Having a null timestamp. * * Not being parsable (applicable for CSV sources). * </pre> * * <code>int64 invalid_row_count = 6;</code> * * @return This builder for chaining. */ public Builder clearInvalidRowCount() { invalidRowCount_ = 0L; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata) } // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata) private static final com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata(); } public static com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ImportFeatureValuesOperationMetadata> PARSER = new com.google.protobuf.AbstractParser<ImportFeatureValuesOperationMetadata>() { @java.lang.Override public ImportFeatureValuesOperationMetadata parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ImportFeatureValuesOperationMetadata(input, extensionRegistry); } }; public static com.google.protobuf.Parser<ImportFeatureValuesOperationMetadata> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ImportFeatureValuesOperationMetadata> getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.aiplatform.v1beta1.ImportFeatureValuesOperationMetadata getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
0462fd05c9b4e995b9d056144f5d86ea74016e6a
85cda57a1c3ffe47f8cd2342e159042b6e750a2d
/mssc-beer-services/src/main/java/com/bhatti/msscbeerservices/web/model/BeerDto.java
87f05673dadb7efdea508fef4a4cb2545795bcb7
[]
no_license
nabeeltariqbhatti/spring-DI
62af6e19efddba63645d03dabe360eb17263b4e5
6ff0537ba4c268abbce5263d01334b5967ab391e
refs/heads/master
2023-08-03T20:07:45.478339
2021-07-08T09:35:41
2021-07-08T09:35:41
369,276,307
0
0
null
2023-07-25T01:59:22
2021-05-20T16:45:12
Java
UTF-8
Java
false
false
867
java
package com.bhatti.msscbeerservices.web.model; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Null; import javax.validation.constraints.Positive; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.UUID; @Data @NoArgsConstructor @AllArgsConstructor @Builder public class BeerDto { @Null private UUID id; private Integer version; private OffsetDateTime createdDate; private OffsetDateTime lastModifiedDate; @NotBlank private String beerName; @NotBlank private BeerStyleEnum beerStyle; @Positive private Long upc; @Min(value = 1) private BigDecimal price; private Integer quantityOnHand; }
09ae881608252328d679c4f26097cd786f18ac9f
644c89b2c4d4e392e886c1e0c150e2b54a99d079
/Avançado/Projetos/exercicios basico java/horoscopo/src/app/App14.java
a1b789777aaab8d38b33ba4a462dbd89c911d8d0
[]
no_license
albertompaz/Residencia-em-Software
b972063f4a4727b98ab0c07788d263b4bc58d52d
49a896c7ffff17aafb72b37adf08acb50ec7f8d0
refs/heads/master
2023-05-12T12:42:04.405600
2020-01-24T01:29:33
2020-01-24T01:29:33
235,891,600
0
0
null
2023-05-07T20:18:22
2020-01-23T21:38:17
TypeScript
UTF-8
Java
false
false
5,055
java
/* Programa para determinar o signo e se a data é valida de uma pessoa * Programador: Alberto Paz * Data: 05/12/2019 */ package app; // Importando o pacote Scanner para ler dados de entrada do usuario import java.util.Scanner; public class App14 { public static void main(String[] args) throws Exception { // Instanciando e criando um objeto Scanner: Scanner ler = new Scanner(System.in); Integer dia, mes; String nomeMes = ""; System.out.println("Informe o dia do seu aniversario: "); //.nextInt pois recebra um valor inteiro dia = ler.nextInt(); System.out.println("informe o mes do seu aniversario: "); mes = ler.nextInt(); ler.close(); //Print so para separar entrada de saida dos dados System.out.println("////////////////////////////////////////////////////"); //Achando o nome correspondente ao numero do mes switch (mes) { case 1: nomeMes = "janeiro"; break; case 2: nomeMes = "fevereiro"; break; case 3: nomeMes = "março"; break; case 4: nomeMes = "abril"; break; case 5: nomeMes = "maio"; break; case 6: nomeMes = "junho"; break; case 7: nomeMes = "julho"; break; case 8: nomeMes = "agosto"; break; case 9: nomeMes = "setembro"; break; case 10: nomeMes = "outubro"; break; case 11: nomeMes = "novembro"; break; case 12: nomeMes = "dezembro"; break; default: System.out.println("Numero de mes informado não é valido"); } //verificando o mes if (nomeMes == "fevereiro") { //verificando dias que o mes contem if (dia <= 29 && mes == 2) { System.out.println("Data ok!"); System.out.println("O mes do seu aniversario e: "+nomeMes); } else { System.out.println("Quantidade de dias invalido para "+nomeMes); System.out.println("Dia de mes invalido para "+nomeMes); } } else { if (nomeMes == "abril" || nomeMes == "junho" || nomeMes == "setembro" || nomeMes == "novembro") { if (dia <= 30) { System.out.println("Data ok!"); System.out.println("O mes do seu aniversario e: "+nomeMes); } else { System.out.println("Quantidade de dias invalido para "+nomeMes); System.out.println("Dia de mes invalido para "+nomeMes); } } else { if (dia <=31) { System.out.println("Data ok!"); System.out.println("O mes do seu aniversario e: "+nomeMes); } else { System.out.println("Quantidade de dias invalido para "+nomeMes); System.out.println("Dia de mes invalido para "+nomeMes); } } } //Iniciando a verificação dos signos if ( (dia >= 21 && mes == 3) || (dia <= 19 && mes == 4) ) { System.out.println("Seu signo é Áries."); } if ( (dia >= 20 && mes == 4) || (dia <= 20 && mes == 5) ) { System.out.println("Seu signo é Touro."); } if ( (dia >= 21 && mes == 5) || (dia <= 21 && mes == 6) ) { System.out.println("Seu signo é Gêmeos."); } if ( (dia >= 22 && mes == 6) || (dia <= 22 && mes == 7) ) { System.out.println("Seu signo é Câncer."); } if ( (dia >= 23 && mes == 7) || (dia <= 22 && mes == 8) ) { System.out.println("Seu signo é Leão."); } if ( (dia >= 23 && mes == 8) || (dia <= 22 && mes == 9) ) { System.out.println("Seu signo é Virgem."); } if ( (dia >= 23 && mes == 9) || (dia <= 22 && mes == 10) ) { System.out.println("Seu signo é libra."); } if ( (dia >= 23 && mes == 10) || (dia <= 21 && mes == 11) ) { System.out.println("Seu signo é Escorpião."); } if ( (dia >= 22 && mes == 11) || (dia <= 21 && mes == 12) ) { System.out.println("Seu signo é Sagitário."); } if ( (dia >= 22 && mes == 12) || (dia <= 19 && mes == 1) ) { System.out.println("Seu signo é Capricórnio."); } if ( (dia >= 22 && mes == 1) || (dia <= 18 && mes == 2) ) { System.out.println("Seu signo é Aquário."); } if ( (dia >= 19 && mes == 2) || (dia <= 20 && mes == 3) ) { System.out.println("Seu signo é Peixes."); } } }
cab7a72e672ddb6ba0d7b66c5a5468c40e317bec
8c193c588f4bff632857614dd3de62e697e2c7ba
/src/dk/esmann/evecacheparser/CacheNoneNode.java
5dfe04538bc03338e86be0697b6659fe4e10b61d
[]
no_license
lazyrohan/EveCacheParser
1b55dace5b6600a848532c5dadc5cf17b1ef2892
71e18a68b9beb72c37999872b1c5330163c23b6e
refs/heads/master
2021-01-18T10:38:49.665408
2012-05-20T08:49:16
2012-05-20T08:49:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
package dk.esmann.evecacheparser; import dk.esmann.evecacheparser.enums.EveStreamCode; /** * Created with IntelliJ IDEA. * User: Alex Esmann * Date: 5/16/12 * Time: 9:10 PM * To change this template use File | Settings | File Templates. */ public class CacheNoneNode extends CacheNode { CacheNoneNode() { super(EveStreamCode.None); } }
669fdbd0c395aeea29f10bc6c00fcd40876d157f
76bfe8bd99ba1746d4511081ae8db2b44487b8b8
/src/pruebas/Rueda.java
cbf58ac5f25e1248b847acb82de169164b0cfa55
[]
no_license
dard0/PSPDardo
c5759700afb802b0ef00734d59cd838366e1ce77
c9d8913e1db12062bf408f91431c1a758bec4f22
refs/heads/master
2016-09-05T12:06:14.402362
2012-11-05T09:57:46
2012-11-05T09:57:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,913
java
package pruebas; import pruebas.RuedaPinchadaException; public class Rueda { private int diametroPulgadas; private int anchuraNominalMm; private int ratioAspectoPc; private static final int limiteKm = 60000; private int rodaduraKm = 0; private boolean pinchada = false; private boolean cambiar = false; private float presionPSI; Rueda(int diametroPulgadas, int anchuraNominalMm, int ratioAspectoPc, float presionPSI) { this.diametroPulgadas = diametroPulgadas; this.anchuraNominalMm = anchuraNominalMm; this.ratioAspectoPc = ratioAspectoPc; this.presionPSI = presionPSI; } // Rueda Estándar Rueda() { this(16,205,55,2.2f); } public void rodar(int km) throws RuedaPinchadaException { if (!pinchada) { this.rodaduraKm += km; if (rodaduraKm >= limiteKm) { cambiar = true; } } else throw new RuedaPinchadaException("Esta pinchada, no puedes rodar!", presionPSI, 60); } public void pinchar() { pinchada = true; } public void reparar() { pinchada = false; } public void print() { int difKm=limiteKm-rodaduraKm; System.out.println("Diámetro: "+diametroPulgadas+'"'); System.out.println("Anchura: "+anchuraNominalMm+" mm"); System.out.println("Relación de Aspecto: "+ratioAspectoPc+'%'); if ( (difKm) > 0) System.out.println("Km: "+rodaduraKm+" restan "+difKm); else System.out.println("Km: "+rodaduraKm+" excedidos "+ (-difKm)); System.out.println("Pinchada: "+pinchada); System.out.println("Cambiar: "+cambiar); System.out.println("Presio: " + presionPSI); } public void println() { this.print(); System.out.print('\n'); } public static void main(String[] args) { Rueda r1=new Rueda(), r2=new Rueda(165,14,175,2.2f); try { r1.rodar(75000); r1.pinchar(); r2.rodar(34500); r1.rodar(5); } catch (Exception e) { System.out.println(e.getMessage()); } r1.println(); r2.println(); } }
e6d51d6e8a2c46848319cca8144daf76bba675f0
a828119846088bba601a2aae274aa71ace65d9a4
/Tool/dex2jar/out/com/google/android/gms/ads/search/SearchAdView.java
3ee9fb34c376b438bb0be0f676c22c04fede7a4a
[]
no_license
PhuongThao09/ZingMP3
19112d400dc2c30719f03272c0de3b8101bfe3b9
a060ee305894c2d89e8636bd2700b16ecde6c421
refs/heads/master
2020-06-11T20:11:33.371267
2019-06-27T11:37:16
2019-06-27T11:37:16
194,065,503
1
0
null
null
null
null
UTF-8
Java
false
false
3,137
java
// // Decompiled by Procyon v0.5.30 // package com.google.android.gms.ads.search; import android.view.View; import com.google.android.gms.ads.AdSize; import com.google.android.gms.ads.AdListener; import android.util.AttributeSet; import android.content.Context; import com.google.android.gms.ads.internal.client.zzz; import android.view.ViewGroup; public final class SearchAdView extends ViewGroup { private final zzz a; public SearchAdView(final Context context) { super(context); this.a = new zzz(this); } public SearchAdView(final Context context, final AttributeSet set) { super(context, set); this.a = new zzz(this, set, false); } public SearchAdView(final Context context, final AttributeSet set, final int n) { super(context, set, n); this.a = new zzz(this, set, false); } public void destroy() { this.a.destroy(); } public AdListener getAdListener() { return this.a.getAdListener(); } public AdSize getAdSize() { return this.a.getAdSize(); } public String getAdUnitId() { return this.a.getAdUnitId(); } public void loadAd(final SearchAdRequest searchAdRequest) { this.a.zza(searchAdRequest.a()); } protected void onLayout(final boolean b, int n, int n2, final int n3, final int n4) { final View child = this.getChildAt(0); if (child != null && child.getVisibility() != 8) { final int measuredWidth = child.getMeasuredWidth(); final int measuredHeight = child.getMeasuredHeight(); n = (n3 - n - measuredWidth) / 2; n2 = (n4 - n2 - measuredHeight) / 2; child.layout(n, n2, measuredWidth + n, measuredHeight + n2); } } protected void onMeasure(final int n, final int n2) { int n3 = 0; final View child = this.getChildAt(0); int n4; if (child != null && child.getVisibility() != 8) { this.measureChild(child, n, n2); n4 = child.getMeasuredWidth(); n3 = child.getMeasuredHeight(); } else { final AdSize adSize = this.getAdSize(); if (adSize != null) { final Context context = this.getContext(); n4 = adSize.getWidthInPixels(context); n3 = adSize.getHeightInPixels(context); } else { n4 = 0; } } this.setMeasuredDimension(View.resolveSize(Math.max(n4, this.getSuggestedMinimumWidth()), n), View.resolveSize(Math.max(n3, this.getSuggestedMinimumHeight()), n2)); } public void pause() { this.a.pause(); } public void resume() { this.a.resume(); } public void setAdListener(final AdListener adListener) { this.a.setAdListener(adListener); } public void setAdSize(final AdSize adSize) { this.a.setAdSizes(adSize); } public void setAdUnitId(final String adUnitId) { this.a.setAdUnitId(adUnitId); } }
[ "̣" ]
̣
5f925c1d1b9eb39ab5e2404f93b0791f87aefa90
11fced7d40e3e46d85a2d5afea272dbc6ad8c3c2
/src/chapter15/PE1513_Client.java
37d0b3cf15853e284f7b0d0f3f03b9391a1ab961
[]
no_license
Lo1s/JavaIntroduction
152c94c45f99992df9e32fc5608eda617cd8b9d5
9aa4f37210706ec30f49a15ed339dfff3d175f47
refs/heads/master
2016-09-06T17:55:26.432493
2015-07-03T09:34:38
2015-07-03T09:34:38
37,971,996
0
0
null
null
null
null
UTF-8
Java
false
false
513
java
/** * */ package chapter15; /** * @author jslapnicka * @Date & @Time 8. 9. 2014 2014 8:24:07 */ public class PE1513_Client { /** * @param args */ public static void main(String[] args) throws CloneNotSupportedException { // TODO Auto-generated method stub PE1513_Octagon o1 = new PE1513_Octagon(6); PE1513_Octagon o2 = (PE1513_Octagon)o1.clone(); @SuppressWarnings("unused") PE1513_Octagon o3 = new PE1513_Octagon(5); System.out.println("o1.compareTo(o2): " + o1.compareTo(o2)); } }
07ab561e69660976c4c51f64546b631edde21e66
b779e4199fba7f74b4a3be88960746375ac9771b
/src/test/java/pl/napierala/cinemacodechallenge/builder/MovieShowingEntityBuilderTest.java
65f3514b3c4b98480af0bf84e0267e56a80ff798
[]
no_license
napierala/CinemaCodeChallenge
12b86551c222de7862bf2fbb5f11f6276e5e5e8f
6692f8492e4714dea18368597463d5d56abdce11
refs/heads/main
2023-09-05T07:41:12.153164
2021-11-15T08:52:46
2021-11-15T08:52:46
426,943,546
0
0
null
null
null
null
UTF-8
Java
false
false
2,263
java
package pl.napierala.cinemacodechallenge.builder; import org.junit.Test; import pl.napierala.cinemacodechallenge.entity.CinemaEntity; import pl.napierala.cinemacodechallenge.entity.MovieEntity; import pl.napierala.cinemacodechallenge.entity.MovieShowingEntity; import pl.napierala.cinemacodechallenge.extmodel.AddMovieShowingRequest; import java.time.LocalDateTime; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class MovieShowingEntityBuilderTest { @Test public void shouldBuildCorrectly() { // Given String code = "CODE"; String name = "NAME"; String address = "ADDRESS"; CinemaEntity cinemaEntity = CinemaEntity.builder() .code(code) .name(name) .address(address) .build(); String movieCode = "CODE"; String movieName = "NAME"; MovieEntity movieEntity = MovieEntity.builder() .code(movieCode) .name(movieName) .imdbId("ID") .build(); LocalDateTime dateTime1 = LocalDateTime.of(2004, 11, 26, 8, 0); String room1 = "1A"; AddMovieShowingRequest request = AddMovieShowingRequest.builder() .cinemaCode(cinemaEntity.getCode()) .movieCode(movieEntity.getCode()) .dateTime(dateTime1) .room(room1) .build(); // When MovieShowingEntity result = MovieShowingEntityBuilder.buildWith(cinemaEntity, movieEntity, request); // Then assertNotNull(result); assertNotNull(result.getCinema()); assertEquals(cinemaEntity.getCode(), result.getCinema().getCode()); assertEquals(cinemaEntity.getName(), result.getCinema().getName()); assertEquals(cinemaEntity.getAddress(), result.getCinema().getAddress()); assertNotNull(result.getMovie()); assertEquals(movieEntity.getCode(), result.getMovie().getCode()); assertEquals(movieEntity.getName(), result.getMovie().getName()); assertNotNull(result.getUuid()); assertEquals(dateTime1, result.getDateTime()); assertEquals(room1, result.getRoom()); } }
e596e8a50b9257c984fa391b583b9832eaec47cb
bd5d7bbffc14bfa340575c8dffed69f8175c1f8c
/netty_iot/src/main/java/com/example/netty_iot/IotApplication.java
856daa899b5534a38682f2827088b3e9bf1b09eb
[]
no_license
peiqingliu/springboot_netty_all
d1325c3068670e0cdcaadcd865854a171b4bef1f
8b71d5fb8666ccb90cf644765a4087a15eb7e4f2
refs/heads/master
2022-10-06T05:21:09.150253
2020-02-08T03:25:31
2020-02-08T03:25:31
237,787,233
0
0
null
2022-10-04T23:55:53
2020-02-02T14:56:18
Java
UTF-8
Java
false
false
387
java
package com.example.netty_iot; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @Author Liupeiqing * @Date 2020/2/3 19:31 * @Version 1.0 */ @SpringBootApplication public class IotApplication { public static void main(String[] args) { SpringApplication.run(IotApplication.class,args); } }
05b428e061a4e22f4f89ea8ad35f78912f38a7b0
4c04c7885ac05b248a7cc14a355a2c9f3f103ad4
/src/Drive.java
dfd7d396e002149b99b518546fd5aa0577221ff6
[]
no_license
milad-saadat/HW2-3
92813446e8670950f0f2b3312ffcad2c98b42e3c
73692ccec4ddc9792a64319cdba239a2f340a211
refs/heads/master
2021-05-21T23:11:01.702096
2020-04-15T07:03:47
2020-04-15T07:03:47
252,851,780
0
0
null
null
null
null
UTF-8
Java
false
false
2,734
java
import java.util.ArrayList; public class Drive extends Directory { public static ArrayList<Drive> allDrives = new ArrayList<>(); private int allSpace; public int getAllSpace() { return allSpace; } public Drive(int allSpace, String name) { this.allSpace = allSpace; this.name = name; this.parent = this; this.usedSpace = 0; this.root = this; allDrives.add(this); } public String getName() { return name; } public static void initialize(){ int hardSize; int hardNum; int sizeUntilNow=0; while (true){ String line = Main.input.nextLine(); line = line.trim(); if (line.matches("\\d+ \\d+")){ String[] command = line.split(" "); hardSize = Integer.parseInt(command[0]); hardNum = Integer.parseInt(command[1]); break; } else { System.out.println("invalid command"); } } for (int i = 0; i < hardNum; i++) { String name; int space; while (true){ String line = Main.input.nextLine(); line = line.trim(); if (line.matches("\\S+ \\d+")){ String[] command = line.split(" "); name = command[0]; space = Integer.parseInt(command[1]); if (!isValidName(name)){ System.out.println("invalid name"); } else if (sizeUntilNow + space > hardSize){ System.out.println("insufficient hard size"); } else { sizeUntilNow += space; new Drive(space , name); break; } } else { System.out.println("invalid command"); } } } } private static boolean isValidName(String name){ if (name.length() > 1) return false; if (name.charAt(0) < 'A' || name.charAt(0) > 'Z') return false; return getDriveByName(name) == null; } public static Drive getDriveByName(String name){ for (Drive drive : allDrives) { if (drive.getName().equals(name)) return drive; } return null; } public static void printDriveStatus(){ for (Drive drive : allDrives) { System.out.println(drive.name + " " + drive.allSpace + "MB " + drive.usedSpace + "MB"); } } }
f3bddd7db13b7085c55da417f596fb202230cb06
c897b075a1890c38100cf0e5726b8998b672a8ab
/AllCollections/src/test.java
b4290243ab4efb12bec83207227acdd443479bf5
[]
no_license
hemantjava/Spring_Framework_2016
91e173e8703c24a3a22c6bd1635eec2f920654e9
c440c9d0eadfc729dd7871c5dc816d7b207021c8
refs/heads/master
2023-07-18T00:23:49.763328
2021-08-13T06:37:55
2021-08-13T06:37:55
395,531,898
0
0
null
null
null
null
UTF-8
Java
false
false
165
java
public class test { static int j=f(); static int i=10; static int f(){ return i; } public static void main(String[] args) { System.out.println(i+" "+j); } }
9be17eda11841267aa3774e59538662c0bb394e1
b71164ba742970e98a9b734af0cecab88d371631
/src/main/java/com/links/exception/TeamException.java
2547ec5ac047285a738dbce76ae328b286adc788
[]
no_license
timmymy/maventest
4e57fd658497f86feb9aff71b3884f3ca6a338c7
9c4d719243fc82dc4625a0ebe4f24a99f3afe9a9
refs/heads/master
2020-03-30T00:49:56.105690
2018-10-22T06:39:40
2018-10-22T06:39:40
150,546,299
0
0
null
null
null
null
UTF-8
Java
false
false
415
java
package com.links.exception; public class TeamException extends Exception { /** * */ private static final long serialVersionUID = 1L; private String message; public TeamException(String message) { super(message); this.message = message; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
857d804fb6ca5c472e1b1256655614f8369e49c6
e00a0c7af9b02b819dba19fd2916e163868cfc3c
/src/main/java/com/mycompany/controller/shop/CmsPages.java
5e15b7647ca25b84c12f574be74c5c970afe8f1e
[]
no_license
silentcharacter/jooby-app
2d595ca3d76c8b8bb22a95e40d0e98defad1210e
f480a0cdd00b3d5bddb9b564077e95a7bf5071e5
refs/heads/master
2020-04-07T05:29:03.415236
2019-02-17T15:33:03
2019-02-17T15:33:03
48,643,970
3
1
null
null
null
null
UTF-8
Java
false
false
328
java
package com.mycompany.controller.shop; import com.mycompany.controller.AbstractResource; import com.mycompany.domain.shop.CmsPage; import com.mycompany.service.shop.CmsPageService; public class CmsPages extends AbstractResource<CmsPage> { public CmsPages() { super(CmsPage.class, CmsPageService.class); } }
efd9e9f35801440ce5f7dc5337e995cb93fcf28b
67c9e8f519b10e18318ac4591ba23b604f882ef1
/src/main/java/com/example/demo/entities/pk/OrderItemPk.java
0b953bcaa1caa58205453985e9b1918d6184a4f8
[]
no_license
joaoramos00/cursospringboot2java11
eab510de7d419058ab3dde7f800b7dea3f1cf564
a9a5ec9ac61bf8a20a255c64876d6cab3126f225
refs/heads/master
2022-07-18T05:11:00.814207
2020-05-14T11:57:23
2020-05-14T11:57:23
262,809,751
0
0
null
null
null
null
UTF-8
Java
false
false
1,497
java
package com.example.demo.entities.pk; import java.io.Serializable; import javax.persistence.Embeddable; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import com.example.demo.entities.Order; import com.example.demo.entities.Product; @Embeddable public class OrderItemPk implements Serializable { private static final long serialVersionUID = 1L; @ManyToOne @JoinColumn(name = "order_id") private Order order; @ManyToOne @JoinColumn(name = "product_id") private Product product; public Order getOrder() { return order; } public void setOrder(Order order) { this.order = order; } public Product getProduct() { return product; } public void setProduct(Product product) { this.product = product; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((order == null) ? 0 : order.hashCode()); result = prime * result + ((product == null) ? 0 : product.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OrderItemPk other = (OrderItemPk) obj; if (order == null) { if (other.order != null) return false; } else if (!order.equals(other.order)) return false; if (product == null) { if (other.product != null) return false; } else if (!product.equals(other.product)) return false; return true; } }
8bada3ef95e56c6de640921ba674bed1c53d9b80
840d06787d44056decb54c6da4a42c0f1adf958b
/src/main/java/pl/alkom/spring/repositories/TeamRepository.java
394a5479c73a9698ca2d12e366ba3b31eac1cb5b
[]
no_license
DanielMichalski/altkom-spring-mvc
893f066b159fec71b88bb21c10e5fe35cd5ab9cd
b58a5e7aa355bc4ee02dfba312f161e209501803
refs/heads/master
2021-01-01T19:46:41.917237
2014-08-31T11:23:50
2014-08-31T11:23:50
23,369,575
1
2
null
null
null
null
UTF-8
Java
false
false
231
java
package pl.alkom.spring.repositories; import org.springframework.data.repository.CrudRepository; import pl.alkom.spring.model.Team; /** * Author: Daniel */ public interface TeamRepository extends CrudRepository<Team, Long> { }
0bb57a893ac3acbc21aae245b72c85d85c0aebfe
4f0e455285a298335b1d9b7f02fd1cf98696367f
/app/src/main/java/com/example/battleship/data/DatabaseHelper.java
5beae8900967c03fda868c22624f3e2e8e1cbd76
[]
no_license
Nadezhda24/BattleShip2
c3631820bf37dab86bd5b49b4e2d5e2d632cb024
ca094ad730e4bc088db4736940953016a7723b5d
refs/heads/master
2020-12-22T09:59:45.288410
2020-05-29T11:49:11
2020-05-29T11:49:11
236,743,529
0
0
null
null
null
null
UTF-8
Java
false
false
4,534
java
package com.example.battleship.data; import android.content.ContentValues; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; import androidx.annotation.Nullable; import static com.example.battleship.data.Database.DatabasePlayer.TABLE_NAME; public class DatabaseHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "player.db"; //Версия базы данных. При изменении схемы увеличить на единицу private static final int DATABASE_VERSION = 4; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } // для создания бд @Override public void onCreate(SQLiteDatabase db) { String SQL_create_Player = "CREATE TABLE if not exists " + Database.DatabasePlayer.TABLE_NAME + " (" + Database.DatabasePlayer.id_Player + " INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " + Database.DatabasePlayer.name_Player + " TEXT NOT NULL, " + Database.DatabasePlayer.login_Player + " TEXT NOT NULL, " + Database.DatabasePlayer.password_Player + " TEXT NOT NULL, " + Database.DatabasePlayer.money_Player + " INTEGER NOT NULL DEFAULT 0, " + Database.DatabasePlayer.experiment_Player + " INTEGER NOT NULL DEFAULT 0, " + Database.DatabasePlayer.count_game_Player + " INTEGER NOT NULL DEFAULT 0, " + Database.DatabasePlayer. count_win_Player + " INTEGER NOT NULL DEFAULT 0, " + Database.DatabasePlayer.id_zvanie_Player + " INTEGER NOT NULL DEFAULT 0," + "FOREIGN KEY (" + Database.DatabasePlayer.id_zvanie_Player + ")REFERENCES " + Database.DatabaseZvanie.TABLE_NAME + "(" + Database.DatabaseZvanie.id_Zvanie + ") ON DELETE NO ACTION ON UPDATE NO ACTION);"; String SQL_create_Zvanie = "CREATE TABLE if not exists " + Database.DatabaseZvanie.TABLE_NAME + " (" + Database.DatabaseZvanie.id_Zvanie + " INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " + Database.DatabaseZvanie.name_Zvanie + " TEXT NOT NULL);"; String SQL_create_Feature = "CREATE TABLE if not exists " + Database.DatabaseFeature.TABLE_NAME + " (" + Database.DatabaseFeature.id_Feature + " INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, " + Database.DatabaseFeature.name_Feature + " TEXT NOT NULL);"; /* String SQL_create_Player_has_Feature = "CREATE TABLE " + Database.DatabasePlayer_has_Feature.TABLE_NAME + "(" + Database.DatabasePlayer_has_Feature.id_Player + " INTEGER NOT NULL PRIMARY KEY ," + Database.DatabasePlayer_has_Feature.id_Feature + " INTEGER NOT NULL PRIMARY KEY ," + Database.DatabasePlayer_has_Feature.count_Feature + " INTEGER NOT NULL," + "FOREIGN KEY (" + Database.DatabasePlayer_has_Feature.id_Player + ")REFERENCES " + Database.DatabasePlayer.TABLE_NAME + "(" + Database.DatabasePlayer.id_Player + ") ON DELETE NO ACTION ON UPDATE NO ACTION," + "FOREIGN KEY (" + Database.DatabasePlayer_has_Feature.id_Feature + ")REFERENCES " + Database.DatabaseFeature.TABLE_NAME + "(" + Database.DatabaseFeature.id_Feature + ") ON DELETE NO ACTION ON UPDATE NO ACTION);"; */ db.execSQL(SQL_create_Player); db.execSQL(SQL_create_Zvanie); db.execSQL(SQL_create_Feature); // db.execSQL(SQL_create_Player_has_Feature); } // при обновлении схемы бд @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // Запишем в журнал Log.w("SQLite", "Обновляемся с версии " + oldVersion + " на версию " + newVersion); // Удаляем старую таблицу и создаём новую db.execSQL("DROP TABLE " + Database.DatabasePlayer.TABLE_NAME); // Создаём новую таблицу onCreate(db); } }
8ac61c6330a523eb2c94fdafca11c3781e553c7d
709161625d5b80e42b308f36d9473b6ed314fb00
/app/build/generated/source/buildConfig/androidTest/debug/com/example/shashikant/bhuconnect/test/BuildConfig.java
d74feb0706eb08b6fffb347135e29b079026fb8a
[]
no_license
DwivediShashikant/CC-BHU
e32b6f36ad5f5c60160143f88edef4986182895c
a9ed99d977bd7aaa3a9f6e972fb15f3320c4802e
refs/heads/master
2021-01-21T16:45:17.994137
2017-06-26T05:08:41
2017-06-26T05:08:41
95,409,647
0
0
null
null
null
null
UTF-8
Java
false
false
483
java
/** * Automatically generated file. DO NOT MODIFY */ package com.example.shashikant.bhuconnect.test; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.example.shashikant.bhuconnect.test"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
06a1a3862ac47cb702e9bddbef0f7e335fa48763
7c16c7dc29b7ec913951dbcf2a44e9ccc1ee51af
/Durga-Projects/Hosptial/DurgaFileUpload/src/main/java/com/file/app/durgafileupload/repo/BookBedInformationRepo.java
39bcaa5f9bc4030c3c669856ab37fc0ec03d1b79
[]
no_license
Pavankumarnaidu2021/Pavankumarnaidu2021
4d52cf94914d835438e4606129b889894343b4a6
baf608bc73a8c3277e0e98c0e1b28b678cbc9a3e
refs/heads/master
2023-08-26T17:11:45.013816
2021-10-28T04:11:21
2021-10-28T04:11:21
417,180,103
0
0
null
null
null
null
UTF-8
Java
false
false
327
java
package com.file.app.durgafileupload.repo; import com.file.app.durgafileupload.entity.BookBedInformation; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository public interface BookBedInformationRepo extends JpaRepository<BookBedInformation, Integer> { }
c79e77398e1c1dd35f1d1209265ad35850bbb570
fbc34f6c3395ec55efc362a7dfc6ef921e432801
/RestServiceApp/src/main/java/nl/dennisvdwielen/enums/Orders.java
879818141f72be31e91d2a1d490da97fd5d303fc
[]
no_license
Denn93/EmergingTechnologiesProject-backend
9ee7546fbc1ce7d2865159765a15f75f465cd61f
d32041ca8f9d2c6c3d68a27755ae19ae54c638c2
refs/heads/master
2021-01-01T18:47:54.168265
2014-06-23T11:50:58
2014-06-23T11:50:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
582
java
package nl.dennisvdwielen.enums; /** * Created by Dennis on 20-5-2014 at 11:14) * <p/> * This code is part of the RestServiceApp project. * This class is within package nl.dennisvdwielen.enums */ /** * This enum class is used for organizing the order options within the backend. The create clear constant and value pairs */ public enum Orders { ASCENDING("ASC"), DESCENDING("DESC"); private String shortValue; private Orders(String shortValue) { this.shortValue = shortValue; } public String getValue() { return shortValue; } }
22c6361f624fb0d8d89302f61e65253940c19cb9
8ccd1c071b19388f1f2e92c5e5dbedc78fead327
/src/main/java/ohos/appexecfwk/utils/PerfProfile.java
e69e0855bd914b9e0e28ad70baa10dff54be4fa4
[]
no_license
yearsyan/Harmony-OS-Java-class-library
d6c135b6a672c4c9eebf9d3857016995edeb38c9
902adac4d7dca6fd82bb133c75c64f331b58b390
refs/heads/main
2023-06-11T21:41:32.097483
2021-06-24T05:35:32
2021-06-24T05:35:32
379,816,304
6
3
null
null
null
null
UTF-8
Java
false
false
918
java
package ohos.appexecfwk.utils; import ohos.hiviewdfx.HiLogLabel; public class PerfProfile { private static final HiLogLabel PERFPROFILE_LABEL = new HiLogLabel(3, 218108160, "AppPerfProfile"); private static final int TIME_UNIT = 1000; public static long getTimeStamp() { return System.nanoTime(); } public static void printDurationTime(long j, long j2, String str) { if (j2 < j) { AppLog.w(PERFPROFILE_LABEL, "PerfProfile::printDurationTime stop must greater or equal to start", new Object[0]); } else if (str == null || str.isEmpty()) { AppLog.w(PERFPROFILE_LABEL, "PerfProfile::printDurationTime message invalid", new Object[0]); } else { String valueOf = String.valueOf((j2 - j) / 1000); AppLog.i(PERFPROFILE_LABEL, "%{public}s spend time %{public}s us", str, valueOf); } } }
8e1e71b195ad5231bbd4962ef263c8ad4c25bbf6
6a97d5a1477c1a0665326222cb246c57213aa957
/app/src/test/java/com/dynamic_host/database/ExampleUnitTest.java
0bf37ea5cb71c2f84c41c20caf501739dac548e8
[]
no_license
Sarowal-1734/Database
e4aa9df519ab2e678f7a9509de686df0311f316e
5cecb1a99a0db3dc1b13b6a2a9bae0e6f61e2969
refs/heads/master
2023-01-04T11:25:57.275370
2020-11-01T17:25:44
2020-11-01T17:25:44
309,149,642
0
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.dynamic_host.database; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
5ca65141484c61638cf864d1e4476c3d687f2284
8b9190a8c5855d5753eb8ba7003e1db875f5d28f
/sources/androidx/transition/TransitionInflater.java
1efe9a3a9b0e6b5f8a8d0b8b2146afd636e4847b
[]
no_license
stevehav/iowa-caucus-app
6aeb7de7487bd800f69cb0b51cc901f79bd4666b
e3c7eb39de0be6bbfa8b6b063aaa85dcbcee9044
refs/heads/master
2020-12-29T10:25:28.354117
2020-02-05T23:15:52
2020-02-05T23:15:52
238,565,283
21
3
null
null
null
null
UTF-8
Java
false
false
15,859
java
package androidx.transition; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.util.AttributeSet; import android.util.Xml; import android.view.InflateException; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.collection.ArrayMap; import androidx.core.content.res.TypedArrayUtils; import com.facebook.react.uimanager.events.TouchesHelper; import java.io.IOException; import java.lang.reflect.Constructor; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; public class TransitionInflater { private static final ArrayMap<String, Constructor> CONSTRUCTORS = new ArrayMap<>(); private static final Class<?>[] CONSTRUCTOR_SIGNATURE = {Context.class, AttributeSet.class}; private final Context mContext; private TransitionInflater(@NonNull Context context) { this.mContext = context; } public static TransitionInflater from(Context context) { return new TransitionInflater(context); } public Transition inflateTransition(int i) { XmlResourceParser xml = this.mContext.getResources().getXml(i); try { Transition createTransitionFromXml = createTransitionFromXml(xml, Xml.asAttributeSet(xml), (Transition) null); xml.close(); return createTransitionFromXml; } catch (XmlPullParserException e) { throw new InflateException(e.getMessage(), e); } catch (IOException e2) { throw new InflateException(xml.getPositionDescription() + ": " + e2.getMessage(), e2); } catch (Throwable th) { xml.close(); throw th; } } public TransitionManager inflateTransitionManager(int i, ViewGroup viewGroup) { XmlResourceParser xml = this.mContext.getResources().getXml(i); try { TransitionManager createTransitionManagerFromXml = createTransitionManagerFromXml(xml, Xml.asAttributeSet(xml), viewGroup); xml.close(); return createTransitionManagerFromXml; } catch (XmlPullParserException e) { InflateException inflateException = new InflateException(e.getMessage()); inflateException.initCause(e); throw inflateException; } catch (IOException e2) { InflateException inflateException2 = new InflateException(xml.getPositionDescription() + ": " + e2.getMessage()); inflateException2.initCause(e2); throw inflateException2; } catch (Throwable th) { xml.close(); throw th; } } private Transition createTransitionFromXml(XmlPullParser xmlPullParser, AttributeSet attributeSet, Transition transition) throws XmlPullParserException, IOException { Transition transition2; int depth = xmlPullParser.getDepth(); TransitionSet transitionSet = transition instanceof TransitionSet ? (TransitionSet) transition : null; loop0: while (true) { transition2 = null; while (true) { int next = xmlPullParser.next(); if ((next != 3 || xmlPullParser.getDepth() > depth) && next != 1) { if (next == 2) { String name = xmlPullParser.getName(); if ("fade".equals(name)) { transition2 = new Fade(this.mContext, attributeSet); } else if ("changeBounds".equals(name)) { transition2 = new ChangeBounds(this.mContext, attributeSet); } else if ("slide".equals(name)) { transition2 = new Slide(this.mContext, attributeSet); } else if ("explode".equals(name)) { transition2 = new Explode(this.mContext, attributeSet); } else if ("changeImageTransform".equals(name)) { transition2 = new ChangeImageTransform(this.mContext, attributeSet); } else if ("changeTransform".equals(name)) { transition2 = new ChangeTransform(this.mContext, attributeSet); } else if ("changeClipBounds".equals(name)) { transition2 = new ChangeClipBounds(this.mContext, attributeSet); } else if ("autoTransition".equals(name)) { transition2 = new AutoTransition(this.mContext, attributeSet); } else if ("changeScroll".equals(name)) { transition2 = new ChangeScroll(this.mContext, attributeSet); } else if ("transitionSet".equals(name)) { transition2 = new TransitionSet(this.mContext, attributeSet); } else if ("transition".equals(name)) { transition2 = (Transition) createCustom(attributeSet, Transition.class, "transition"); } else if ("targets".equals(name)) { getTargetIds(xmlPullParser, attributeSet, transition); } else if ("arcMotion".equals(name)) { if (transition != null) { transition.setPathMotion(new ArcMotion(this.mContext, attributeSet)); } else { throw new RuntimeException("Invalid use of arcMotion element"); } } else if ("pathMotion".equals(name)) { if (transition != null) { transition.setPathMotion((PathMotion) createCustom(attributeSet, PathMotion.class, "pathMotion")); } else { throw new RuntimeException("Invalid use of pathMotion element"); } } else if (!"patternPathMotion".equals(name)) { throw new RuntimeException("Unknown scene name: " + xmlPullParser.getName()); } else if (transition != null) { transition.setPathMotion(new PatternPathMotion(this.mContext, attributeSet)); } else { throw new RuntimeException("Invalid use of patternPathMotion element"); } if (transition2 == null) { continue; } else { if (!xmlPullParser.isEmptyElementTag()) { createTransitionFromXml(xmlPullParser, attributeSet, transition2); } if (transitionSet != null) { break; } else if (transition != null) { throw new InflateException("Could not add transition to another transition."); } } } } } transitionSet.addTransition(transition2); } return transition2; } private Object createCustom(AttributeSet attributeSet, Class cls, String str) { Object newInstance; Class<? extends U> asSubclass; String attributeValue = attributeSet.getAttributeValue((String) null, "class"); if (attributeValue != null) { try { synchronized (CONSTRUCTORS) { Constructor<? extends U> constructor = CONSTRUCTORS.get(attributeValue); if (constructor == null && (asSubclass = Class.forName(attributeValue, false, this.mContext.getClassLoader()).asSubclass(cls)) != null) { constructor = asSubclass.getConstructor(CONSTRUCTOR_SIGNATURE); constructor.setAccessible(true); CONSTRUCTORS.put(attributeValue, constructor); } newInstance = constructor.newInstance(new Object[]{this.mContext, attributeSet}); } return newInstance; } catch (Exception e) { throw new InflateException("Could not instantiate " + cls + " class " + attributeValue, e); } } else { throw new InflateException(str + " tag must have a 'class' attribute"); } } @SuppressLint({"RestrictedApi"}) private void getTargetIds(XmlPullParser xmlPullParser, AttributeSet attributeSet, Transition transition) throws XmlPullParserException, IOException { int depth = xmlPullParser.getDepth(); while (true) { int next = xmlPullParser.next(); if ((next == 3 && xmlPullParser.getDepth() <= depth) || next == 1) { return; } if (next == 2) { if (xmlPullParser.getName().equals(TouchesHelper.TARGET_KEY)) { TypedArray obtainStyledAttributes = this.mContext.obtainStyledAttributes(attributeSet, Styleable.TRANSITION_TARGET); int namedResourceId = TypedArrayUtils.getNamedResourceId(obtainStyledAttributes, xmlPullParser, "targetId", 1, 0); if (namedResourceId != 0) { transition.addTarget(namedResourceId); } else { int namedResourceId2 = TypedArrayUtils.getNamedResourceId(obtainStyledAttributes, xmlPullParser, "excludeId", 2, 0); if (namedResourceId2 != 0) { transition.excludeTarget(namedResourceId2, true); } else { String namedString = TypedArrayUtils.getNamedString(obtainStyledAttributes, xmlPullParser, "targetName", 4); if (namedString != null) { transition.addTarget(namedString); } else { String namedString2 = TypedArrayUtils.getNamedString(obtainStyledAttributes, xmlPullParser, "excludeName", 5); if (namedString2 != null) { transition.excludeTarget(namedString2, true); } else { String namedString3 = TypedArrayUtils.getNamedString(obtainStyledAttributes, xmlPullParser, "excludeClass", 3); if (namedString3 != null) { try { transition.excludeTarget((Class) Class.forName(namedString3), true); } catch (ClassNotFoundException e) { obtainStyledAttributes.recycle(); throw new RuntimeException("Could not create " + namedString3, e); } } else { String namedString4 = TypedArrayUtils.getNamedString(obtainStyledAttributes, xmlPullParser, "targetClass", 0); if (namedString4 != null) { transition.addTarget((Class) Class.forName(namedString4)); } } } } } } obtainStyledAttributes.recycle(); } else { throw new RuntimeException("Unknown scene name: " + xmlPullParser.getName()); } } } } /* JADX WARNING: Code restructure failed: missing block: B:18:0x0054, code lost: return r1; */ /* Code decompiled incorrectly, please refer to instructions dump. */ private androidx.transition.TransitionManager createTransitionManagerFromXml(org.xmlpull.v1.XmlPullParser r5, android.util.AttributeSet r6, android.view.ViewGroup r7) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException { /* r4 = this; int r0 = r5.getDepth() r1 = 0 L_0x0005: int r2 = r5.next() r3 = 3 if (r2 != r3) goto L_0x0012 int r3 = r5.getDepth() if (r3 <= r0) goto L_0x0054 L_0x0012: r3 = 1 if (r2 == r3) goto L_0x0054 r3 = 2 if (r2 == r3) goto L_0x0019 goto L_0x0005 L_0x0019: java.lang.String r2 = r5.getName() java.lang.String r3 = "transitionManager" boolean r3 = r2.equals(r3) if (r3 == 0) goto L_0x002b androidx.transition.TransitionManager r1 = new androidx.transition.TransitionManager r1.<init>() goto L_0x0005 L_0x002b: java.lang.String r3 = "transition" boolean r2 = r2.equals(r3) if (r2 == 0) goto L_0x0039 if (r1 == 0) goto L_0x0039 r4.loadTransition(r6, r5, r7, r1) goto L_0x0005 L_0x0039: java.lang.RuntimeException r6 = new java.lang.RuntimeException java.lang.StringBuilder r7 = new java.lang.StringBuilder r7.<init>() java.lang.String r0 = "Unknown scene name: " r7.append(r0) java.lang.String r5 = r5.getName() r7.append(r5) java.lang.String r5 = r7.toString() r6.<init>(r5) throw r6 L_0x0054: return r1 */ throw new UnsupportedOperationException("Method not decompiled: androidx.transition.TransitionInflater.createTransitionManagerFromXml(org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.view.ViewGroup):androidx.transition.TransitionManager"); } @SuppressLint({"RestrictedApi"}) private void loadTransition(AttributeSet attributeSet, XmlPullParser xmlPullParser, ViewGroup viewGroup, TransitionManager transitionManager) throws Resources.NotFoundException { Scene scene; Transition inflateTransition; TypedArray obtainStyledAttributes = this.mContext.obtainStyledAttributes(attributeSet, Styleable.TRANSITION_MANAGER); int namedResourceId = TypedArrayUtils.getNamedResourceId(obtainStyledAttributes, xmlPullParser, "transition", 2, -1); int namedResourceId2 = TypedArrayUtils.getNamedResourceId(obtainStyledAttributes, xmlPullParser, "fromScene", 0, -1); Scene scene2 = null; if (namedResourceId2 < 0) { scene = null; } else { scene = Scene.getSceneForLayout(viewGroup, namedResourceId2, this.mContext); } int namedResourceId3 = TypedArrayUtils.getNamedResourceId(obtainStyledAttributes, xmlPullParser, "toScene", 1, -1); if (namedResourceId3 >= 0) { scene2 = Scene.getSceneForLayout(viewGroup, namedResourceId3, this.mContext); } if (namedResourceId >= 0 && (inflateTransition = inflateTransition(namedResourceId)) != null) { if (scene2 == null) { throw new RuntimeException("No toScene for transition ID " + namedResourceId); } else if (scene == null) { transitionManager.setTransition(scene2, inflateTransition); } else { transitionManager.setTransition(scene, scene2, inflateTransition); } } obtainStyledAttributes.recycle(); } }
53132b3f9bec9019ca42715242bdca697fb44181
6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386
/google/cloud/videointelligence/v1p1beta1/google-cloud-videointelligence-v1p1beta1-java/proto-google-cloud-videointelligence-v1p1beta1-java/src/main/java/com/google/cloud/videointelligence/v1p1beta1/ExplicitContentDetectionConfig.java
04d58311f2efe925d73a74a0500f78d9b94dea28
[ "Apache-2.0" ]
permissive
oltoco/googleapis-gen
bf40cfad61b4217aca07068bd4922a86e3bbd2d5
00ca50bdde80906d6f62314ef4f7630b8cdb6e15
refs/heads/master
2023-07-17T22:11:47.848185
2021-08-29T20:39:47
2021-08-29T20:39:47
null
0
0
null
null
null
null
UTF-8
Java
false
true
21,974
java
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/videointelligence/v1p1beta1/video_intelligence.proto package com.google.cloud.videointelligence.v1p1beta1; /** * <pre> * Config for EXPLICIT_CONTENT_DETECTION. * </pre> * * Protobuf type {@code google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig} */ public final class ExplicitContentDetectionConfig extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) ExplicitContentDetectionConfigOrBuilder { private static final long serialVersionUID = 0L; // Use ExplicitContentDetectionConfig.newBuilder() to construct. private ExplicitContentDetectionConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private ExplicitContentDetectionConfig() { model_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new ExplicitContentDetectionConfig(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private ExplicitContentDetectionConfig( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { java.lang.String s = input.readStringRequireUtf8(); model_ = s; break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p1beta1_ExplicitContentDetectionConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p1beta1_ExplicitContentDetectionConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.class, com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.Builder.class); } public static final int MODEL_FIELD_NUMBER = 1; private volatile java.lang.Object model_; /** * <pre> * Model to use for explicit content detection. * Supported values: "builtin/stable" (the default if unset) and * "builtin/latest". * </pre> * * <code>string model = 1;</code> * @return The model. */ @java.lang.Override public java.lang.String getModel() { java.lang.Object ref = model_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); model_ = s; return s; } } /** * <pre> * Model to use for explicit content detection. * Supported values: "builtin/stable" (the default if unset) and * "builtin/latest". * </pre> * * <code>string model = 1;</code> * @return The bytes for model. */ @java.lang.Override public com.google.protobuf.ByteString getModelBytes() { java.lang.Object ref = model_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); model_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getModelBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getModelBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig)) { return super.equals(obj); } com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig other = (com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) obj; if (!getModel() .equals(other.getModel())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + MODEL_FIELD_NUMBER; hash = (53 * hash) + getModel().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * <pre> * Config for EXPLICIT_CONTENT_DETECTION. * </pre> * * Protobuf type {@code google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfigOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p1beta1_ExplicitContentDetectionConfig_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p1beta1_ExplicitContentDetectionConfig_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.class, com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.Builder.class); } // Construct using com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { } } @java.lang.Override public Builder clear() { super.clear(); model_ = ""; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p1beta1_ExplicitContentDetectionConfig_descriptor; } @java.lang.Override public com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig getDefaultInstanceForType() { return com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.getDefaultInstance(); } @java.lang.Override public com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig build() { com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig buildPartial() { com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig result = new com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig(this); result.model_ = model_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) { return mergeFrom((com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig other) { if (other == com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.getDefaultInstance()) return this; if (!other.getModel().isEmpty()) { model_ = other.model_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private java.lang.Object model_ = ""; /** * <pre> * Model to use for explicit content detection. * Supported values: "builtin/stable" (the default if unset) and * "builtin/latest". * </pre> * * <code>string model = 1;</code> * @return The model. */ public java.lang.String getModel() { java.lang.Object ref = model_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); model_ = s; return s; } else { return (java.lang.String) ref; } } /** * <pre> * Model to use for explicit content detection. * Supported values: "builtin/stable" (the default if unset) and * "builtin/latest". * </pre> * * <code>string model = 1;</code> * @return The bytes for model. */ public com.google.protobuf.ByteString getModelBytes() { java.lang.Object ref = model_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); model_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * <pre> * Model to use for explicit content detection. * Supported values: "builtin/stable" (the default if unset) and * "builtin/latest". * </pre> * * <code>string model = 1;</code> * @param value The model to set. * @return This builder for chaining. */ public Builder setModel( java.lang.String value) { if (value == null) { throw new NullPointerException(); } model_ = value; onChanged(); return this; } /** * <pre> * Model to use for explicit content detection. * Supported values: "builtin/stable" (the default if unset) and * "builtin/latest". * </pre> * * <code>string model = 1;</code> * @return This builder for chaining. */ public Builder clearModel() { model_ = getDefaultInstance().getModel(); onChanged(); return this; } /** * <pre> * Model to use for explicit content detection. * Supported values: "builtin/stable" (the default if unset) and * "builtin/latest". * </pre> * * <code>string model = 1;</code> * @param value The bytes for model to set. * @return This builder for chaining. */ public Builder setModelBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); model_ = value; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) } // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) private static final com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig(); } public static com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<ExplicitContentDetectionConfig> PARSER = new com.google.protobuf.AbstractParser<ExplicitContentDetectionConfig>() { @java.lang.Override public ExplicitContentDetectionConfig parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new ExplicitContentDetectionConfig(input, extensionRegistry); } }; public static com.google.protobuf.Parser<ExplicitContentDetectionConfig> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<ExplicitContentDetectionConfig> getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
[ "bazel-bot-development[bot]@users.noreply.github.com" ]
bazel-bot-development[bot]@users.noreply.github.com
e0cc251dc9b4bc8adbc36eebfdd649e706ef674f
368f8f42431eba16f7341b824ae06299f78bf4bb
/paraga/paragaServices/src/main/java/gr/akis/paraga/db/UserDB.java
aaf48c5376720280e237851153f9ab58a44bd0be
[]
no_license
anagnosg/akis
54a96dad1c5ec8f8bdc86490c83acd7331984b99
4489ba96fb4dade7931e0dd1eb7828fb5bd5f4c1
refs/heads/master
2021-01-19T14:32:54.040008
2019-04-07T18:49:39
2019-04-07T18:49:39
87,891,831
0
0
null
null
null
null
UTF-8
Java
false
false
4,567
java
package gr.akis.paraga.db; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; import org.jboss.security.auth.spi.Users; import gr.akis.paraga.models.Team; import gr.akis.paraga.models.User; import gr.anagnosg.employeeservices.db.utils.ConnectionWrapper; @RequestScoped public class UserDB { @Inject ConnectionWrapper connWrapper; public UserDB() { } /** * Finds all persons * * @return * @throws SQLException */ public List<User> selectAll() throws SQLException { List<User> users = new ArrayList<User>(); String sql = "SELECT ID ,USERNAME,PASSWORD FROM Users "; try (PreparedStatement pstate = this.connWrapper.getConnection().prepareStatement(sql); ResultSet rs = pstate.executeQuery();) { while (rs.next()) { User u = new User(); u.setId(rs.getInt("ID")); u.setPassword(rs.getString("USERNAME")); u.setUsername(rs.getString("PASSWORD")); users.add(u); } } return users; } public List<User> selectUser(String username,String password) throws SQLException { List<User> users = new ArrayList<User>(); String sql = "SELECT ID ,USERNAME,PASSWORD FROM Users " + "where username=? and password=?"; try (PreparedStatement pstate = this.connWrapper.getConnection().prepareStatement(sql); ) { pstate.setString(1,username); pstate.setString(2,password); try(ResultSet rs = pstate.executeQuery();){ while (rs.next()) { User u = new User(); u.setId(rs.getInt("ID")); u.setPassword(rs.getString("USERNAME")); u.setUsername(rs.getString("PASSWORD")); users.add(u); } } } return users; } public User insert(User users) throws SQLException { String sql = "INSERT INTO USERS (USERNAME ,PASSWORD) VALUES (?,?)"; // orismoume // se // ena // string // thn // sql // pou // 8a // treksoume Connection conn = this.connWrapper.getConnection(); // Pernoume mia // sundesh // (connection) me // thn bash // apo to connection ekteloume thn methodo prepareStatement kai // proetoimazoume thn java // gia thn ektelesh ths entolhs sql. // Statement.RETURN_GENERATED_KEYS epistrefei ta identities . PreparedStatement pstate = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); // to try einai ena block kodika to opoio mporei n apetaksei kapoio // exception // kai me to try sthn periptosh pou petaksi kapoio exeception ekteloume // kapoies leitourgies. try { pstate.setString(1, users.getUsername()); // pername tis patametrous pstate.setString(2, users.getPassword()); pstate.executeUpdate(); // ekteloume to sql .Epeidh einai insert h // updat ekteloume to // execute update. // kaloume apo to pstate thn methodo getGeneratedKeys gia na paroume // ta identities. try (ResultSet generatedKeys = pstate.getGeneratedKeys()) { if (generatedKeys.next()) {// eprnouem to epomeno identity. users.setId(generatedKeys.getInt(1)); // badoume to id sto // antikeimeno mas. } } } // to finaly 8a ektelestei panta sto telos tou try oti kai na ginei sto // try. finally { if (pstate != null) { pstate.close(); } } return users; } public User update(User users) throws SQLException { String sql = "update Users set username=? ,password=? where id = ? "; try (PreparedStatement pstate = this.connWrapper.getConnection().prepareStatement(sql);) { pstate.setString(1, users.getUsername()); pstate.setString(2, users.getPassword()); pstate.setInt(3, users.getId()); int count = pstate.executeUpdate();// epistrefei to plh8os ton // grammon poy exei allaksei if (count != 0) { return users; } } catch (SQLException ex) { ex.printStackTrace(); } return null; } public User delete(User users) throws SQLException { int count = 0; String sql = " delete from Users where id = ? "; try (PreparedStatement pstate = this.connWrapper.getConnection().prepareStatement(sql);) { pstate.setInt(1, users.getId()); count = pstate.executeUpdate(); } return users; } }
0109912dfee7dd31ea21a29c4a320dd8897c90cb
43cf52b5d3e51ceace25883c3ca0d39ea018076c
/app/src/test/java/com/example/bluetoothenabler/ExampleUnitTest.java
e913161d16f685638386a6f841c68bfacd12cfeb
[]
no_license
sanki4489/Bluetooth-Enabler
3498908e5cdca6607184109cbda209625e2067dc
992c3018bf1573b93a8bebfee15f79a73f2b160b
refs/heads/master
2023-01-01T06:29:16.325299
2020-10-26T04:34:15
2020-10-26T04:34:15
302,251,704
1
0
null
null
null
null
UTF-8
Java
false
false
389
java
package com.example.bluetoothenabler; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
e20aa2f576e440e33e12ddf950374c38d3034b0b
866ce7474bbc4eff1d9f35fb205158dd42f27c5f
/service-zuul/src/main/java/com/dfz/service/zuul/ZuulApplication.java
57274d3f6f023e2ccd64746fc29cc2f0ee6bb497
[]
no_license
Hogantry/spring-cloud-demos
92bc28bb18858a12d28961dda418a388f2c46269
8ab389e47b78d94f9a5989360f8c1d04d5bfd988
refs/heads/master
2023-05-04T12:20:32.715032
2021-04-23T01:45:36
2021-04-23T01:45:36
371,975,886
0
0
null
null
null
null
UTF-8
Java
false
false
704
java
package com.dfz.service.zuul; import brave.sampler.Sampler; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.zuul.EnableZuulProxy; import org.springframework.context.annotation.Bean; /** * @ClassName ZuulApplication * @Description ZuulApplication * @Author dfz * @Date 2019-10-30 14:29 * @Version 1.0 **/ @SpringBootApplication @EnableZuulProxy public class ZuulApplication { public static void main(String[] args) { SpringApplication.run(ZuulApplication.class, args); } @Bean public Sampler defaultSampler() { return Sampler.ALWAYS_SAMPLE; } }
2aec83de6896b2af580e61d37fd7e49918b43b8d
1fe15b5073a0465d3021f134060afa1b5963137a
/backend/src/main/java/kr/co/printingworks/printdesk/service/impl/RegisterServiceImpl.java
b93bb862aed82df53ab1c7cc776b2de91a699ef7
[]
no_license
yskim621/printdesk_boot
67cd978b6f77d91821dac52fc80065566716999d
452054e2fc5f429bc0e2dc7909d64dced9fb5042
refs/heads/master
2023-08-27T18:16:21.263262
2021-09-30T02:37:30
2021-09-30T02:37:30
411,898,337
0
0
null
null
null
null
UTF-8
Java
false
false
3,255
java
package kr.co.printingworks.printdesk.service.impl; import kr.co.printingworks.printdesk.dto.RegisterDto; import kr.co.printingworks.printdesk.entity.sys.Company; import kr.co.printingworks.printdesk.entity.sys.User; import kr.co.printingworks.printdesk.enumerate.*; import kr.co.printingworks.printdesk.mapper.UserMapper; import kr.co.printingworks.printdesk.repo.CompanyRepository; import kr.co.printingworks.printdesk.repo.UserRepository; import kr.co.printingworks.printdesk.service.RegisterService; import kr.co.printingworks.printdesk.utils.DateTimeUtil; import kr.co.printingworks.printdesk.utils.UserUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Service; import javax.transaction.Transactional; import java.util.Date; import java.util.Optional; @Service @PropertySource("classpath:constants.yml") public class RegisterServiceImpl implements RegisterService { @Autowired UserRepository userRepository; @Autowired CompanyRepository companyRepository; @Value("${company-tryday-num}") Integer companyTrydayNum; @Override public void register(RegisterDto registerDto) { String plainPassword = registerDto.getPassword(); String password = UserUtils.encryptPassword(plainPassword); registerDto.setPassword(password); // TODO: 사업자 등록번호, 대표자명, 업태, 업종 컬럼 추가하면되는지 물어보기 Company company = new Company(); company.setId(Long.parseLong(UserUtils.createCompanyId())); company.setExpireTime(DateTimeUtil.addDate(new Date(), companyTrydayNum)); company.setCreateTime(new Date()); company.setState(CompanyState.ONSALING); // TODO: state에 업태 넣으면되는지 물어보고 맞으면 셀렉트박스로 바꿀지 물어보기 company.setIsFormal(BoolValue.NO); company.setStandardCurrency(CurrencyType.RMB); company.setType(CompanyType.NORMAL); company.setTel(registerDto.getTel()); company.setAddress(registerDto.getAddress()); company.setLinkName(registerDto.getManager()); company.setName(registerDto.getCompanyName()); company.setEmail(registerDto.getTaxBill()); companyRepository.save(company); User user = UserMapper.INSTANCE.toEntity(registerDto); user.setCompany(company); user.setLoginCount(0); user.setLoginErrorCount(0); user.setUserNo(UserUtils.createUserNo(company.getId() + "")); userRepository.save(user); company.setRegisterUser(user); company.setCreateName(user.getUserName()); companyRepository.save(company); } @Override public boolean checkUserName(String userName) { // User user = userRepository.findByUserName(userName); // return user == null; Optional<User> user = userRepository.findByUserName(userName); return !user.isPresent(); } @Override public boolean checkMobile(String mobile) { User user = userRepository.findByMobile(mobile); return user == null; } }
1ac3e931b91ea5c4409a006d058fb7f6e1583447
6dc27545eceaa0fe130139c62e36f2c4b17de8f3
/src/main/java/com/norconex/committer/core3/impl/MemoryCommitter.java
54597b6f063cebc3489e12c588467ed38cc5a259
[ "Apache-2.0" ]
permissive
Norconex/committer-core
30059fa960c21e03def13c71cef3bd60ca3f876b
0ed3718c6484b820c5dc2e81fa01a87288a589b7
refs/heads/master
2023-02-09T09:28:06.924160
2022-01-02T21:50:16
2022-01-02T21:50:16
12,910,531
6
11
Apache-2.0
2023-02-08T23:07:44
2013-09-18T00:47:26
Java
UTF-8
Java
false
false
7,337
java
/* Copyright 2019-2020 Norconex Inc. * * 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.norconex.committer.core3.impl; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; import java.util.stream.Collectors; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.norconex.committer.core3.AbstractCommitter; import com.norconex.committer.core3.CommitterException; import com.norconex.committer.core3.DeleteRequest; import com.norconex.committer.core3.ICommitterRequest; import com.norconex.committer.core3.UpsertRequest; import com.norconex.commons.lang.map.Properties; import com.norconex.commons.lang.text.TextMatcher; import com.norconex.commons.lang.xml.XML; /** * <p> * <b>WARNING: Not intended for production use.</b> * </p> * <p> * A Committer that stores every document received into memory. * This can be useful for testing or troubleshooting applications using * Committers. * Given this committer can eat up memory pretty quickly, its use is strongly * discouraged for regular production use. * </p> * * {@nx.xml.usage * <committer class="com.norconex.committer.core3.impl.MemoryCommitter"> * {@nx.include [email protected]} * </committer> * } * * @author Pascal Essiembre * @since 3.0.0 */ @SuppressWarnings("javadoc") public class MemoryCommitter extends AbstractCommitter { private static final Logger LOG = LoggerFactory.getLogger(MemoryCommitter.class); private final List<ICommitterRequest> requests = new ArrayList<>(); private int upsertCount = 0; private int deleteCount = 0; private boolean ignoreContent; private final TextMatcher fieldMatcher = new TextMatcher(); /** * Constructor. */ public MemoryCommitter() { super(); } public boolean isIgnoreContent() { return ignoreContent; } public void setIgnoreContent(boolean ignoreContent) { this.ignoreContent = ignoreContent; } public TextMatcher getFieldMatcher() { return fieldMatcher; } public void setFieldMatcher(TextMatcher fieldMatcher) { this.fieldMatcher.copyFrom(fieldMatcher); } @Override protected void doInit() { //NOOP } public boolean removeRequest(ICommitterRequest req) { return requests.remove(req); } public List<ICommitterRequest> getAllRequests() { return requests; } public List<UpsertRequest> getUpsertRequests() { return requests.stream() .filter(o -> o instanceof UpsertRequest) .map(o -> (UpsertRequest) o) .collect(Collectors.toList()); } public List<DeleteRequest> getDeleteRequests() { return requests.stream() .filter(o -> o instanceof DeleteRequest) .map(o -> (DeleteRequest) o) .collect(Collectors.toList()); } public int getUpsertCount() { return upsertCount; } public int getDeleteCount() { return deleteCount; } public int getRequestCount() { return requests.size(); } @Override protected void doUpsert(UpsertRequest upsertRequest) throws CommitterException { String memReference = upsertRequest.getReference(); LOG.debug("Committing upsert request for {}", memReference); InputStream memContent = null; InputStream reqContent = upsertRequest.getContent(); if (!ignoreContent && reqContent != null) { try { memContent = new ByteArrayInputStream( IOUtils.toByteArray(reqContent)); } catch (IOException e) { throw new CommitterException( "Could not do upsert for " + memReference); } } Properties memMetadata = filteredMetadata(upsertRequest.getMetadata()); requests.add(new UpsertRequest(memReference, memMetadata, memContent)); upsertCount++; } @Override protected void doDelete(DeleteRequest deleteRequest) { String memReference = deleteRequest.getReference(); LOG.debug("Committing delete request for {}", memReference); Properties memMetadata = filteredMetadata(deleteRequest.getMetadata()); requests.add(new DeleteRequest(memReference, memMetadata)); deleteCount++; } private Properties filteredMetadata(Properties reqMetadata) { Properties memMetadata = new Properties(); if (reqMetadata != null) { if (fieldMatcher.getPattern() == null) { memMetadata.loadFromMap(reqMetadata); } else { memMetadata.loadFromMap(reqMetadata.entrySet().stream() .filter(en -> fieldMatcher.matches(en.getKey())) .collect(Collectors.toMap( Entry::getKey, Entry::getValue))); } } return memMetadata; } @Override protected void doClose() throws com.norconex.committer.core3.CommitterException { LOG.info("{} upserts committed.", upsertCount); LOG.info("{} deletions committed.", deleteCount); } @Override protected void doClean() throws CommitterException { // NOOP } @Override public boolean equals(final Object other) { return EqualsBuilder.reflectionEquals(this, other); } @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); } @Override public String toString() { // Cannot use ReflectionToStringBuilder here to prevent // "An illegal reflective access operation has occurred" return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .appendSuper(super.toString()) .append("requests", requests, false) .append("upsertCount", upsertCount) .append("deleteCount", deleteCount) .build(); } @Override public void loadCommitterFromXML(XML xml) { //NOOP } @Override public void saveCommitterToXML(XML xml) { //NOOP } }
2e9ec588e755628189b047c5001e716d4ffbcf57
032cac7260fa6895b623412268febfaa27699388
/app/src/main/java/com/haleysoftware/popularmovies/objects/MovieItem.java
082c4e9f4638ea15242bb25460bd157cf6d2e3cc
[]
no_license
Haleysoftware/PopularMovies
9bf0691374b214f5626384feed4792f9ded5b469
3848c0b760787a7834a93d5510bea1fb38799f8d
refs/heads/master
2020-04-03T19:09:24.830630
2018-10-31T06:53:44
2018-10-31T06:53:44
155,510,646
0
0
null
null
null
null
UTF-8
Java
false
false
6,535
java
package com.haleysoftware.popularmovies.objects; import android.arch.persistence.room.Entity; import android.arch.persistence.room.PrimaryKey; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.drawable.BitmapDrawable; import android.os.Parcel; import android.os.Parcelable; import android.support.annotation.NonNull; /** * This object is used to hold data for each movie. * <p> * Created by haleysoft on 8/26/18. */ @Entity public class MovieItem implements Parcelable { public static final String SORT_ID = "grid_sorting"; public static final String ITEM = "movieItem"; public static final String POSTER_PATH = "https://image.tmdb.org/t/p/"; public static final String POSTER_SIZE = "w185/"; /** * Creates a new object from a parcel. */ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public MovieItem createFromParcel(Parcel in) { return new MovieItem(in); } /** * Creates a new array for movie items. * * @param size The size of the new array. * @return The new array that was created. */ public MovieItem[] newArray(int size) { return new MovieItem[size]; } }; @PrimaryKey @NonNull private int movieId; private String release; private String poster; private double voteAverage; private String overview; @NonNull private String title; /** * Creates a movie object. * * @param movieId The Movie's ID. * @param title The movie's title. * @param release The movie's release date. * @param poster The URL ID for the movie poster on TheMovieDB.org. * @param voteAverage The average votes for the movie. * @param overview The movie's overview. */ public MovieItem(@NonNull int movieId, @NonNull String title, String release, String poster, double voteAverage, String overview) { this.movieId = movieId; this.title = title; this.release = release; this.poster = poster; this.voteAverage = voteAverage; this.overview = overview; } /** * Fills the new movie item with data from a parcel. * * @param in The parcel that was passed. */ public MovieItem(Parcel in) { this.movieId = in.readInt(); this.title = in.readString(); this.release = in.readString(); this.poster = in.readString(); this.voteAverage = in.readDouble(); this.overview = in.readString(); } /** * This is used when there is no poster for the movie item. It will create a blank poster * and insert the title. * * @param context The context of the activity used to get resources. * @param title The movie's title to use for the blank poster. * @return returns the drawable for the poster. */ static public BitmapDrawable noMoviePoster(Context context, String title) { Bitmap.Config config = Bitmap.Config.ARGB_8888; int height = 277 * 3; int width = 185 * 3; Bitmap newPoster = Bitmap.createBitmap(width, height, config); Paint paint = new Paint(); paint.setStyle(Paint.Style.FILL); paint.setColor(Color.BLACK); paint.setTextSize(50); Canvas canvas = new Canvas(newPoster); canvas.drawText(title, 5, newPoster.getHeight() / 2, paint); return new BitmapDrawable(context.getResources(), newPoster); } /** * Not used. * * @return Zero is sent. */ @Override public int describeContents() { return 0; } /** * Moves data from the object to a parcel. * * @param dest * @param flags */ @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(this.movieId); dest.writeString(this.title); dest.writeString(this.release); dest.writeString(this.poster); dest.writeDouble(this.voteAverage); dest.writeString(this.overview); } /** * Returns the ID of the movie object. * * @return The Movie ID. */ @NonNull public int getMovieId() { return movieId; } /** * Sets the movie ID. Needed for Room. * * @param movieId The new movie ID. */ public void setMovieId(@NonNull int movieId) { this.movieId = movieId; } /** * Get the movie's title from this object. * * @return The movie's title. */ public String getTitle() { return title; } /** * Sets the movie's title. * * @param title The new title. */ public void setTitle(@NonNull String title) { this.title = title; } /** * Get the movie's release date from this object. * * @return The movie's release date. */ public String getRelease() { return release; } /** * Sets the movie's release date. * * @param release the new release date. */ public void setRelease(String release) { this.release = release; } /** * Get the path to the movie poster from this object. * The path will need to be appended to the end of the rest of the path and size. * * @return the movie path or null. */ public String getPoster() { return poster; } /** * Sets the movie's poster path. * * @param poster The new poster path. */ public void setPoster(String poster) { this.poster = poster; } /** * Get the vote average from this object. * * @return The average vote for this movie. */ public double getVoteAverage() { return voteAverage; } /** * Sets the movie's vote average. * * @param voteAverage The new vote average. */ public void setVoteAverage(double voteAverage) { this.voteAverage = voteAverage; } /** * Get the overview from this object. * * @return the overview for this movie. */ public String getOverview() { return overview; } /** * Sets the movie's overview. * * @param overview The new overview. */ public void setOverview(String overview) { this.overview = overview; } }
c6fdc8d1339eb51a8dd3c91876d83c96c7419830
d13fb02bb909606b9314bfbe67873deb00197fae
/app/src/main/java/com/xy/wk/BaseFragmentActivity.java
163c5ddc8924da9a54966403747b990a5a65ce3d
[]
no_license
chinafengqiang/wkPhone
1ff4e2e8feac47a97f193dc704b7c707a2b43e11
60d8e04fac5fd5c635f146aba4f33899091bd109
refs/heads/master
2020-12-13T03:35:41.420420
2016-08-02T10:41:11
2016-08-02T10:41:11
55,571,229
0
0
null
null
null
null
UTF-8
Java
false
false
1,692
java
package com.xy.wk; import android.content.Context; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.View; import com.xy.view.FProgrssDialog; /** * Created by FQ.CHINA on 2015/8/31. */ public abstract class BaseFragmentActivity extends FragmentActivity implements View.OnClickListener{ protected Context mContext; protected FProgrssDialog progressDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //mContext = getApplicationContext(); mContext = this; initView(); } private void initView() { loadViewLayout(); findViewById(); initSp(); initTitle(); setListener(); processLogic(); } protected void showProgressDialog() { closeProgressDialog(); if ((!isFinishing()) && (this.progressDialog == null)) { this.progressDialog = new FProgrssDialog(mContext); } this.progressDialog.show(); } protected void closeProgressDialog() { if (this.progressDialog != null){ this.progressDialog.dismiss(); this.progressDialog = null; } } @Override protected void onDestroy() { super.onDestroy(); closeProgressDialog(); mContext = null; } protected abstract void findViewById(); protected abstract void initTitle(); protected abstract void initSp(); /** * setContentView() * */ protected abstract void loadViewLayout(); protected abstract void processLogic(); protected abstract void setListener(); }
f21c3ad2b3b3e3c29ec1d90739705d174d8d2eb1
c97a2b5ab98555d6247c61d9b85d67604babdc4e
/epi/SearchForMinMaxInArray.java
b77f0f5de02903a9c5768b7e1b6d5d5dcb38187e
[]
no_license
codecarvaan/Epi-Solutions
daafb83baab20615ca4a95586deb2116848e5b53
011aedd19d88a6fcb7eeb18edb32078d0248e67a
refs/heads/master
2020-06-16T07:41:41.709228
2020-02-23T13:50:04
2020-02-23T13:50:04
195,514,524
0
0
null
null
null
null
UTF-8
Java
false
false
2,088
java
package epi; import epi.test_framework.EpiTest; import epi.test_framework.EpiUserType; import epi.test_framework.GenericTest; import java.util.List; public class SearchForMinMaxInArray { @EpiUserType(ctorParams = {Integer.class, Integer.class}) public static class MinMax { public Integer smallest; public Integer largest; public MinMax(Integer smallest, Integer largest) { this.smallest = smallest; this.largest = largest; } private static MinMax minMax(Integer a, Integer b) { return Integer.compare(b, a) < 0 ? new MinMax(b, a) : new MinMax(a, b); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MinMax minMax = (MinMax)o; if (!smallest.equals(minMax.smallest)) { return false; } return largest.equals(minMax.largest); } @Override public String toString() { return "min: " + smallest + ", max: " + largest; } } @EpiTest(testDataFile = "search_for_min_max_in_array.tsv") public static MinMax findMinMax(List<Integer> A) { if(A.size()==1){ return new MinMax(A.get(0),A.get(0)); } MinMax global=new MinMax(A.get(0),A.get(0)); for(int i=1;i<A.size();i+=2){ MinMax local=MinMax.minMax(A.get(i-1),A.get(i)); global=MinMax.minMax(MinMax.minMax(local.smallest,global.smallest).smallest,MinMax.minMax(local.largest,global.largest).largest); } if(A.size()%2!=0){ MinMax local=MinMax.minMax(A.get(A.size()-1),A.get(A.size()-1)); global=MinMax.minMax(MinMax.minMax(local.smallest,global.smallest).smallest,MinMax.minMax(local.largest,global.largest).largest); } return global; } public static void main(String[] args) { System.exit( GenericTest .runFromAnnotations(args, "SearchForMinMaxInArray.java", new Object() {}.getClass().getEnclosingClass()) .ordinal()); } }
f8d91c76b8b3e9a3e46887337b7b78c47326347f
6add2789a8dd742d2b11d1f0b5b58a21e2314828
/app/src/test/java/com/example/tao/mytestapp/ExampleUnitTest.java
1a522a523a1fadbcdf849f789a809c8bfe102d5f
[]
no_license
TaoX999/MyTestAPP
d28e380a937b61d89991708c70de4e2406951162
e662adb8be89b29e3da71bafb3baf5e8cdfb554d
refs/heads/master
2021-04-06T17:01:03.284345
2018-03-08T11:15:23
2018-03-08T11:15:23
124,380,136
0
0
null
null
null
null
UTF-8
Java
false
false
403
java
package com.example.tao.mytestapp; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
4b4cb83af26dfe8c49c9e97c2dc905357af9d300
085d8e9dac87dd862ee865f26bed5e3a90285ef6
/app/src/main/java/id/keyta/graphdemo/ui/gallery/GalleryFragment.java
d7aab88c1461802b76ca0b14aba7b4f7e924dfeb
[]
no_license
ainulhamdani/graph_demo
d751356893a29dcb09318b2ee3866b4b173b7916
c74bdf632aa53e49d1905d113350d1207b738234
refs/heads/master
2023-08-13T11:49:09.271898
2021-09-08T10:04:38
2021-09-08T10:04:38
404,297,966
0
0
null
null
null
null
UTF-8
Java
false
false
69,205
java
package id.keyta.graphdemo.ui.gallery; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProvider; import com.highsoft.highcharts.common.HIColor; import com.highsoft.highcharts.common.hichartsclasses.HIAnnotations; import com.highsoft.highcharts.common.hichartsclasses.HIArea; import com.highsoft.highcharts.common.hichartsclasses.HICSSObject; import com.highsoft.highcharts.common.hichartsclasses.HIChart; import com.highsoft.highcharts.common.hichartsclasses.HIColumn; import com.highsoft.highcharts.common.hichartsclasses.HICondition; import com.highsoft.highcharts.common.hichartsclasses.HILabel; import com.highsoft.highcharts.common.hichartsclasses.HILabelOptions; import com.highsoft.highcharts.common.hichartsclasses.HILabels; import com.highsoft.highcharts.common.hichartsclasses.HILegend; import com.highsoft.highcharts.common.hichartsclasses.HILine; import com.highsoft.highcharts.common.hichartsclasses.HIMarker; import com.highsoft.highcharts.common.hichartsclasses.HIOptions; import com.highsoft.highcharts.common.hichartsclasses.HIPanning; import com.highsoft.highcharts.common.hichartsclasses.HIPlotOptions; import com.highsoft.highcharts.common.hichartsclasses.HIPoint; import com.highsoft.highcharts.common.hichartsclasses.HIResponsive; import com.highsoft.highcharts.common.hichartsclasses.HIRules; import com.highsoft.highcharts.common.hichartsclasses.HISeries; import com.highsoft.highcharts.common.hichartsclasses.HIStyle; import com.highsoft.highcharts.common.hichartsclasses.HISubtitle; import com.highsoft.highcharts.common.hichartsclasses.HITitle; import com.highsoft.highcharts.common.hichartsclasses.HITooltip; import com.highsoft.highcharts.common.hichartsclasses.HIXAxis; import com.highsoft.highcharts.common.hichartsclasses.HIYAxis; import com.highsoft.highcharts.core.HIChartView; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import id.keyta.graphdemo.R; import id.keyta.graphdemo.databinding.FragmentGalleryBinding; public class GalleryFragment extends Fragment { private GalleryViewModel galleryViewModel; private FragmentGalleryBinding binding; public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { galleryViewModel = new ViewModelProvider(this).get(GalleryViewModel.class); binding = FragmentGalleryBinding.inflate(inflater, container, false); return binding.getRoot(); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); setLineChart(); setLineChart2(); setBarChart(); } private void setLineChart2() { binding.line2.plugins = new ArrayList<>(Arrays.asList("annotations")); HIOptions options = new HIOptions(); HIChart chart = new HIChart(); chart.setType("area"); chart.setZoomType("x"); chart.setPanning(new HIPanning()); chart.setPanKey("shift"); options.setChart(chart); HITitle title = new HITitle(); title.setText("2017 Tour de France Stage 8: Dole - Station des Rousses"); options.setTitle(title); HISubtitle subtitle = new HISubtitle(); subtitle.setText("An annotated chart in Highcharts"); options.setSubtitle(subtitle); HIAnnotations annotations1 = new HIAnnotations(); annotations1.setLabelOptions(new HILabelOptions()); annotations1.getLabelOptions().setBackgroundColor(HIColor.initWithRGBA(255, 255, 255, 5)); annotations1.getLabelOptions().setVerticalAlign("top"); annotations1.getLabelOptions().setY(15); HILabels labels1 = new HILabels(); labels1.setPoint(new HIPoint()); labels1.getPoint().setXAxis(0); labels1.getPoint().setYAxis(0); labels1.getPoint().setX(27.98); labels1.getPoint().setY(255); labels1.setText("Arbois"); HILabels labels2 = new HILabels(); labels2.setPoint(new HIPoint()); labels2.getPoint().setYAxis(0); labels2.getPoint().setXAxis(0); labels2.getPoint().setX(45.5); labels2.getPoint().setY(611); labels2.setText("Montrond"); HILabels labels3 = new HILabels(); labels3.setPoint(new HIPoint()); labels3.getPoint().setYAxis(0); labels3.getPoint().setXAxis(0); labels3.getPoint().setX(63); labels3.getPoint().setY(651); labels3.setText("Mont-sur-Monnet"); HILabels labels4 = new HILabels(); labels4.setPoint(new HIPoint()); labels4.getPoint().setYAxis(0); labels4.getPoint().setXAxis(0); labels4.getPoint().setX(84); labels4.getPoint().setY(789); labels4.setX(-10); labels4.setText("Bonlieu"); HILabels labels5 = new HILabels(); labels5.setPoint(new HIPoint()); labels5.getPoint().setYAxis(0); labels5.getPoint().setXAxis(0); labels5.getPoint().setX(129.5); labels5.getPoint().setY(382); labels5.setText("Chassal"); HILabels labels6 = new HILabels(); labels6.setPoint(new HIPoint()); labels6.getPoint().setYAxis(0); labels6.getPoint().setXAxis(0); labels6.getPoint().setX(159); labels6.getPoint().setY(443); labels6.setText("Saint-Claud"); annotations1.setLabels(new ArrayList<>(Arrays.asList(labels1, labels2, labels3, labels4, labels5, labels6))); HIAnnotations annotations2 = new HIAnnotations(); HILabels labels7 = new HILabels(); labels7.setPoint(new HIPoint()); labels7.getPoint().setYAxis(0); labels7.getPoint().setXAxis(0); labels7.getPoint().setX(101.44); labels7.getPoint().setY(1026); labels7.setX(-30); labels7.setText("Col de la Joux"); HILabels labels8 = new HILabels(); labels8.setPoint(new HIPoint()); labels8.getPoint().setYAxis(0); labels8.getPoint().setXAxis(0); labels8.getPoint().setX(138.5); labels8.getPoint().setY(748); labels8.setText("Côte de Viry"); HILabels labels9 = new HILabels(); labels9.setPoint(new HIPoint()); labels9.getPoint().setYAxis(0); labels9.getPoint().setXAxis(0); labels9.getPoint().setX(176.4); labels9.getPoint().setY(1202); labels9.setText("Montée de la Combe<br>de Laisia Les Molunes"); annotations2.setLabels(new ArrayList<>(Arrays.asList(labels7, labels8, labels9))); HIAnnotations annotations3 = new HIAnnotations(); annotations3.setLabelOptions(new HILabelOptions()); annotations3.getLabelOptions().setShape("connector"); annotations3.getLabelOptions().setAlign("right"); annotations3.getLabelOptions().setCrop(true); annotations3.getLabelOptions().setStyle(new HICSSObject()); annotations3.getLabelOptions().getStyle().setFontSize("0.8em"); HILabels labels10 = new HILabels(); labels10.setPoint(new HIPoint()); labels10.getPoint().setYAxis(0); labels10.getPoint().setXAxis(0); labels10.getPoint().setX(96.2); labels10.getPoint().setY(783); labels10.setText("6.1 km climb<br>4.6% on avg."); HILabels labels11 = new HILabels(); labels11.setPoint(new HIPoint()); labels11.getPoint().setYAxis(0); labels11.getPoint().setXAxis(0); labels11.getPoint().setX(134.5); labels11.getPoint().setY(540); labels11.setText("7.6 km climb<br>5.2% on avg."); HILabels labels12 = new HILabels(); labels12.setPoint(new HIPoint()); labels12.getPoint().setYAxis(0); labels12.getPoint().setXAxis(0); labels12.getPoint().setX(172.2); labels12.getPoint().setY(925); labels12.setText("11.7 km climb<br>6.4% on avg."); annotations3.setLabels(new ArrayList<>(Arrays.asList(labels10, labels11, labels12))); options.setAnnotations(new ArrayList<>(Arrays.asList(annotations1,annotations2, annotations3))); HIXAxis xaxis = new HIXAxis(); xaxis.setLabels(new HILabels()); xaxis.getLabels().setFormat("{value} km"); xaxis.setMinRange(5); xaxis.setTitle(new HITitle()); xaxis.getTitle().setText("Distance"); options.setXAxis(new ArrayList<>(Collections.singletonList(xaxis))); HIYAxis yaxis = new HIYAxis(); yaxis.setStartOnTick(true); yaxis.setEndOnTick(false); yaxis.setMaxPadding(0.35); yaxis.setTitle(new HITitle()); yaxis.setLabels(new HILabels()); yaxis.getLabels().setFormat("{value} m"); options.setYAxis(new ArrayList<>(Collections.singletonList(yaxis))); HITooltip tooltip = new HITooltip(); tooltip.setHeaderFormat("Distance: {point.x:.1f} km<br>"); tooltip.setPointFormat("{point.y} m a. s. l."); tooltip.setShared(false); options.setTooltip(tooltip); HILegend legend = new HILegend(); legend.setEnabled(false); options.setLegend(legend); HIArea area = new HIArea(); area.setData(this.elevationData()); area.setLineColor(HIColor.initWithHexValue("0d233a")); area.setColor(HIColor.initWithHexValue("8bbc21")); area.setFillOpacity(0.5); area.setName("Elevation"); area.setMarker(new HIMarker()); area.getMarker().setEnabled(false); options.setSeries(new ArrayList<>(Collections.singletonList(area))); binding.line2.setOptions(options); } private ArrayList elevationData(){ Number[][] data = new Number[][] { {0.0, 225}, {0.1, 226}, {0.2, 228}, {0.3, 228}, {0.4, 229}, {0.5, 229}, {0.6, 230}, {0.7, 234}, {0.8, 235}, {0.9, 236}, {1.0, 235}, {1.1, 232}, {1.2, 228}, {1.3, 223}, {1.4, 218}, {1.5, 214}, {1.6, 207}, {1.7, 202}, {1.8, 198}, {1.9, 196}, {2.0, 197}, {2.1, 200}, {2.2, 205}, {2.3, 206}, {2.4, 210}, {2.5, 210}, {2.6, 210}, {2.7, 209}, {2.8, 208}, {2.9, 207}, {3.0, 209}, {3.1, 208}, {3.2, 207}, {3.3, 207}, {3.4, 206}, {3.5, 206}, {3.6, 205}, {3.7, 201}, {3.8, 195}, {3.9, 191}, {4.0, 191}, {4.1, 195}, {4.2, 199}, {4.3, 203}, {4.4, 208}, {4.5, 208}, {4.6, 208}, {4.7, 208}, {4.8, 209}, {4.9, 207}, {5.0, 207}, {5.1, 208}, {5.2, 209}, {5.3, 208}, {5.4, 210}, {5.5, 209}, {5.6, 209}, {5.7, 206}, {5.8, 207}, {5.9, 209}, {6.0, 211}, {6.1, 206}, {6.2, 201}, {6.3, 199}, {6.4, 200}, {6.5, 202}, {6.6, 203}, {6.7, 202}, {6.8, 204}, {6.9, 206}, {7.0, 208}, {7.1, 205}, {7.2, 202}, {7.3, 198}, {7.4, 198}, {7.5, 198}, {7.6, 198}, {7.7, 198}, {7.8, 199}, {7.9, 197}, {8.0, 194}, {8.1, 194}, {8.2, 195}, {8.3, 195}, {8.4, 196}, {8.5, 192}, {8.6, 200}, {8.7, 197}, {8.8, 194}, {8.9, 194}, {9.0, 193}, {9.1, 192}, {9.2, 192}, {9.3, 193}, {9.4, 191}, {9.5, 191}, {9.6, 193}, {9.7, 193}, {9.8, 194}, {9.9, 192}, {10.0, 192}, {10.1, 192}, {10.2, 192}, {10.3, 192}, {10.4, 193}, {10.5, 193}, {10.6, 193}, {10.7, 193}, {10.8, 194}, {10.9, 194}, {11.0, 194}, {11.1, 195}, {11.2, 194}, {11.3, 194}, {11.4, 194}, {11.5, 194}, {11.6, 193}, {11.7, 194}, {11.8, 194}, {11.9, 194}, {12.0, 195}, {12.1, 195}, {12.2, 195}, {12.3, 197}, {12.4, 197}, {12.5, 197}, {12.6, 198}, {12.7, 201}, {12.8, 202}, {12.9, 203}, {13.0, 205}, {13.1, 205}, {13.2, 204}, {13.3, 210}, {13.4, 213}, {13.5, 212}, {13.6, 213}, {13.7, 213}, {13.8, 213}, {13.9, 214}, {14.0, 214}, {14.1, 212}, {14.2, 209}, {14.3, 207}, {14.4, 207}, {14.5, 208}, {14.6, 211}, {14.7, 215}, {14.8, 219}, {14.9, 219}, {15.0, 221}, {15.1, 224}, {15.2, 224}, {15.3, 225}, {15.4, 225}, {15.5, 225}, {15.6, 225}, {15.7, 225}, {15.8, 225}, {15.9, 226}, {16.0, 226}, {16.1, 227}, {16.2, 227}, {16.3, 230}, {16.4, 231}, {16.5, 231}, {16.6, 232}, {16.7, 230}, {16.8, 229}, {16.9, 228}, {17.0, 226}, {17.1, 226}, {17.2, 224}, {17.3, 223}, {17.4, 224}, {17.5, 223}, {17.6, 221}, {17.7, 220}, {17.8, 218}, {17.9, 217}, {18.0, 216}, {18.1, 216}, {18.2, 215}, {18.3, 214}, {18.4, 213}, {18.5, 212}, {18.6, 212}, {18.7, 213}, {18.8, 214}, {18.9, 215}, {19.0, 215}, {19.1, 216}, {19.2, 217}, {19.3, 216}, {19.4, 216}, {19.5, 217}, {19.6, 219}, {19.7, 218}, {19.8, 218}, {19.9, 220}, {20.0, 224}, {20.1, 224}, {20.2, 225}, {20.3, 224}, {20.4, 225}, {20.5, 228}, {20.6, 228}, {20.7, 227}, {20.8, 228}, {20.9, 228}, {21.0, 228}, {21.1, 229}, {21.2, 225}, {21.3, 223}, {21.4, 222}, {21.5, 222}, {21.6, 223}, {21.7, 224}, {21.8, 224}, {21.9, 226}, {22.0, 228}, {22.1, 233}, {22.2, 237}, {22.3, 237}, {22.4, 238}, {22.5, 236}, {22.6, 232}, {22.7, 232}, {22.8, 228}, {22.9, 227}, {23.0, 227}, {23.1, 227}, {23.2, 227}, {23.3, 226}, {23.4, 226}, {23.5, 226}, {23.6, 226}, {23.7, 226}, {23.8, 226}, {23.9, 226}, {24.0, 228}, {24.1, 228}, {24.2, 229}, {24.3, 230}, {24.4, 230}, {24.5, 233}, {24.6, 235}, {24.7, 234}, {24.8, 234}, {24.9, 233}, {25.0, 233}, {25.1, 232}, {25.2, 232}, {25.3, 232}, {25.4, 232}, {25.5, 234}, {25.6, 234}, {25.7, 234}, {25.8, 234}, {25.9, 237}, {26.0, 238}, {26.1, 238}, {26.2, 238}, {26.3, 240}, {26.4, 240}, {26.5, 244}, {26.6, 241}, {26.7, 241}, {26.8, 245}, {26.9, 254}, {27.0, 262}, {27.1, 255}, {27.2, 255}, {27.3, 251}, {27.4, 252}, {27.5, 253}, {27.6, 253}, {27.7, 251}, {27.8, 251}, {27.9, 254}, {28.0, 255}, {28.1, 257}, {28.2, 259}, {28.3, 259}, {28.4, 259}, {28.5, 260}, {28.6, 258}, {28.7, 258}, {28.8, 262}, {28.9, 260}, {29.0, 262}, {29.1, 266}, {29.2, 268}, {29.3, 270}, {29.4, 278}, {29.5, 276}, {29.6, 278}, {29.7, 282}, {29.8, 281}, {29.9, 284}, {30.0, 287}, {30.1, 292}, {30.2, 303}, {30.3, 309}, {30.4, 317}, {30.5, 324}, {30.6, 334}, {30.7, 334}, {30.8, 319}, {30.9, 321}, {31.0, 333}, {31.1, 337}, {31.2, 345}, {31.3, 352}, {31.4, 386}, {31.5, 398}, {31.6, 406}, {31.7, 416}, {31.8, 423}, {31.9, 425}, {32.0, 425}, {32.1, 424}, {32.2, 423}, {32.3, 421}, {32.4, 421}, {32.5, 422}, {32.6, 421}, {32.7, 421}, {32.8, 421}, {32.9, 421}, {33.0, 421}, {33.1, 423}, {33.2, 435}, {33.3, 450}, {33.4, 451}, {33.5, 452}, {33.6, 452}, {33.7, 452}, {33.8, 452}, {33.9, 455}, {34.0, 459}, {34.1, 465}, {34.2, 469}, {34.3, 473}, {34.4, 476}, {34.5, 480}, {34.6, 483}, {34.7, 487}, {34.8, 490}, {34.9, 494}, {35.0, 497}, {35.1, 502}, {35.2, 504}, {35.3, 507}, {35.4, 511}, {35.5, 514}, {35.6, 518}, {35.7, 521}, {35.8, 524}, {35.9, 527}, {36.0, 528}, {36.1, 525}, {36.2, 526}, {36.3, 528}, {36.4, 528}, {36.5, 528}, {36.6, 529}, {36.7, 528}, {36.8, 526}, {36.9, 525}, {37.0, 524}, {37.1, 524}, {37.2, 524}, {37.3, 525}, {37.4, 528}, {37.5, 528}, {37.6, 532}, {37.7, 534}, {37.8, 538}, {37.9, 540}, {38.0, 544}, {38.1, 546}, {38.2, 554}, {38.3, 555}, {38.4, 559}, {38.5, 566}, {38.6, 568}, {38.7, 571}, {38.8, 571}, {38.9, 570}, {39.0, 569}, {39.1, 567}, {39.2, 567}, {39.3, 566}, {39.4, 566}, {39.5, 566}, {39.6, 566}, {39.7, 566}, {39.8, 566}, {39.9, 565}, {40.0, 563}, {40.1, 562}, {40.2, 563}, {40.3, 563}, {40.4, 562}, {40.5, 562}, {40.6, 562}, {40.7, 561}, {40.8, 563}, {40.9, 561}, {41.0, 559}, {41.1, 559}, {41.2, 559}, {41.3, 558}, {41.4, 559}, {41.5, 560}, {41.6, 560}, {41.7, 560}, {41.8, 559}, {41.9, 557}, {42.0, 556}, {42.1, 555}, {42.2, 555}, {42.3, 556}, {42.4, 557}, {42.5, 557}, {42.6, 557}, {42.7, 557}, {42.8, 557}, {42.9, 557}, {43.0, 557}, {43.1, 557}, {43.2, 558}, {43.3, 559}, {43.4, 560}, {43.5, 563}, {43.6, 566}, {43.7, 570}, {43.8, 572}, {43.9, 575}, {44.0, 573}, {44.1, 576}, {44.2, 577}, {44.3, 579}, {44.4, 581}, {44.5, 584}, {44.6, 591}, {44.7, 593}, {44.8, 594}, {44.9, 596}, {45.0, 599}, {45.1, 601}, {45.2, 601}, {45.3, 604}, {45.4, 607}, {45.5, 607}, {45.6, 607}, {45.7, 607}, {45.8, 605}, {45.9, 607}, {46.0, 609}, {46.1, 612}, {46.2, 613}, {46.3, 614}, {46.4, 614}, {46.5, 614}, {46.6, 616}, {46.7, 616}, {46.8, 615}, {46.9, 615}, {47.0, 618}, {47.1, 617}, {47.2, 615}, {47.3, 614}, {47.4, 613}, {47.5, 613}, {47.6, 613}, {47.7, 613}, {47.8, 612}, {47.9, 612}, {48.0, 609}, {48.1, 610}, {48.2, 603}, {48.3, 598}, {48.4, 598}, {48.5, 596}, {48.6, 595}, {48.7, 593}, {48.8, 590}, {48.9, 587}, {49.0, 583}, {49.1, 580}, {49.2, 576}, {49.3, 569}, {49.4, 568}, {49.5, 566}, {49.6, 560}, {49.7, 559}, {49.8, 558}, {49.9, 562}, {50.0, 564}, {50.1, 563}, {50.2, 563}, {50.3, 567}, {50.4, 574}, {50.5, 577}, {50.6, 580}, {50.7, 581}, {50.8, 579}, {50.9, 579}, {51.0, 578}, {51.1, 574}, {51.2, 569}, {51.3, 564}, {51.4, 558}, {51.5, 554}, {51.6, 550}, {51.7, 543}, {51.8, 539}, {51.9, 536}, {52.0, 532}, {52.1, 530}, {52.2, 529}, {52.3, 528}, {52.4, 528}, {52.5, 528}, {52.6, 528}, {52.7, 527}, {52.8, 527}, {52.9, 528}, {53.0, 529}, {53.1, 528}, {53.2, 526}, {53.3, 526}, {53.4, 524}, {53.5, 519}, {53.6, 517}, {53.7, 517}, {53.8, 522}, {53.9, 521}, {54.0, 520}, {54.1, 518}, {54.2, 513}, {54.3, 518}, {54.4, 520}, {54.5, 523}, {54.6, 526}, {54.7, 522}, {54.8, 513}, {54.9, 512}, {55.0, 513}, {55.1, 513}, {55.2, 518}, {55.3, 522}, {55.4, 526}, {55.5, 526}, {55.6, 525}, {55.7, 522}, {55.8, 520}, {55.9, 519}, {56.0, 518}, {56.1, 518}, {56.2, 518}, {56.3, 517}, {56.4, 516}, {56.5, 517}, {56.6, 517}, {56.7, 517}, {56.8, 521}, {56.9, 522}, {57.0, 518}, {57.1, 517}, {57.2, 514}, {57.3, 515}, {57.4, 513}, {57.5, 511}, {57.6, 511}, {57.7, 511}, {57.8, 510}, {57.9, 510}, {58.0, 509}, {58.1, 509}, {58.2, 509}, {58.3, 509}, {58.4, 509}, {58.5, 509}, {58.6, 509}, {58.7, 509}, {58.8, 509}, {58.9, 510}, {59.0, 510}, {59.1, 521}, {59.2, 524}, {59.3, 528}, {59.4, 533}, {59.5, 539}, {59.6, 545}, {59.7, 551}, {59.8, 562}, {59.9, 572}, {60.0, 579}, {60.1, 585}, {60.2, 593}, {60.3, 596}, {60.4, 605}, {60.5, 617}, {60.6, 620}, {60.7, 627}, {60.8, 628}, {60.9, 627}, {61.0, 627}, {61.1, 628}, {61.2, 629}, {61.3, 632}, {61.4, 634}, {61.5, 638}, {61.6, 637}, {61.7, 638}, {61.8, 639}, {61.9, 640}, {62.0, 640}, {62.1, 639}, {62.2, 639}, {62.3, 637}, {62.4, 637}, {62.5, 636}, {62.6, 637}, {62.7, 636}, {62.8, 637}, {62.9, 635}, {63.0, 629}, {63.1, 626}, {63.2, 626}, {63.3, 623}, {63.4, 621}, {63.5, 621}, {63.6, 621}, {63.7, 622}, {63.8, 625}, {63.9, 626}, {64.0, 629}, {64.1, 631}, {64.2, 633}, {64.3, 631}, {64.4, 632}, {64.5, 634}, {64.6, 637}, {64.7, 637}, {64.8, 637}, {64.9, 637}, {65.0, 638}, {65.1, 641}, {65.2, 644}, {65.3, 646}, {65.4, 649}, {65.5, 648}, {65.6, 647}, {65.7, 647}, {65.8, 649}, {65.9, 650}, {66.0, 651}, {66.1, 654}, {66.2, 652}, {66.3, 651}, {66.4, 650}, {66.5, 650}, {66.6, 649}, {66.7, 648}, {66.8, 648}, {66.9, 648}, {67.0, 649}, {67.1, 650}, {67.2, 647}, {67.3, 642}, {67.4, 641}, {67.5, 638}, {67.6, 636}, {67.7, 635}, {67.8, 633}, {67.9, 636}, {68.0, 638}, {68.1, 639}, {68.2, 641}, {68.3, 643}, {68.4, 644}, {68.5, 645}, {68.6, 649}, {68.7, 651}, {68.8, 648}, {68.9, 645}, {69.0, 640}, {69.1, 637}, {69.2, 637}, {69.3, 637}, {69.4, 635}, {69.5, 630}, {69.6, 628}, {69.7, 625}, {69.8, 622}, {69.9, 620}, {70.0, 618}, {70.1, 613}, {70.2, 612}, {70.3, 608}, {70.4, 603}, {70.5, 599}, {70.6, 597}, {70.7, 591}, {70.8, 590}, {70.9, 587}, {71.0, 584}, {71.1, 584}, {71.2, 582}, {71.3, 574}, {71.4, 572}, {71.5, 570}, {71.6, 572}, {71.7, 573}, {71.8, 575}, {71.9, 578}, {72.0, 590}, {72.1, 595}, {72.2, 595}, {72.3, 579}, {72.4, 581}, {72.5, 583}, {72.6, 583}, {72.7, 583}, {72.8, 583}, {72.9, 580}, {73.0, 579}, {73.1, 584}, {73.2, 587}, {73.3, 594}, {73.4, 597}, {73.5, 597}, {73.6, 596}, {73.7, 593}, {73.8, 591}, {73.9, 596}, {74.0, 596}, {74.1, 598}, {74.2, 598}, {74.3, 595}, {74.4, 592}, {74.5, 592}, {74.6, 592}, {74.7, 594}, {74.8, 597}, {74.9, 600}, {75.0, 601}, {75.1, 605}, {75.2, 604}, {75.3, 604}, {75.4, 607}, {75.5, 607}, {75.6, 607}, {75.7, 604}, {75.8, 605}, {75.9, 608}, {76.0, 616}, {76.1, 618}, {76.2, 629}, {76.3, 633}, {76.4, 634}, {76.5, 637}, {76.6, 644}, {76.7, 650}, {76.8, 653}, {76.9, 653}, {77.0, 657}, {77.1, 664}, {77.2, 668}, {77.3, 668}, {77.4, 668}, {77.5, 672}, {77.6, 674}, {77.7, 679}, {77.8, 681}, {77.9, 689}, {78.0, 692}, {78.1, 704}, {78.2, 708}, {78.3, 714}, {78.4, 716}, {78.5, 719}, {78.6, 722}, {78.7, 729}, {78.8, 733}, {78.9, 735}, {79.0, 736}, {79.1, 737}, {79.2, 737}, {79.3, 737}, {79.4, 737}, {79.5, 736}, {79.6, 736}, {79.7, 736}, {79.8, 737}, {79.9, 737}, {80.0, 737}, {80.1, 737}, {80.2, 738}, {80.3, 739}, {80.4, 739}, {80.5, 739}, {80.6, 741}, {80.7, 741}, {80.8, 741}, {80.9, 741}, {81.0, 743}, {81.1, 744}, {81.2, 744}, {81.3, 744}, {81.4, 744}, {81.5, 746}, {81.6, 748}, {81.7, 757}, {81.8, 753}, {81.9, 752}, {82.0, 751}, {82.1, 748}, {82.2, 746}, {82.3, 756}, {82.4, 755}, {82.5, 748}, {82.6, 745}, {82.7, 749}, {82.8, 752}, {82.9, 753}, {83.0, 753}, {83.1, 755}, {83.2, 764}, {83.3, 766}, {83.4, 771}, {83.5, 774}, {83.6, 775}, {83.7, 777}, {83.8, 778}, {83.9, 778}, {84.0, 780}, {84.1, 780}, {84.2, 782}, {84.3, 783}, {84.4, 786}, {84.5, 791}, {84.6, 792}, {84.7, 787}, {84.8, 782}, {84.9, 780}, {85.0, 777}, {85.1, 777}, {85.2, 777}, {85.3, 777}, {85.4, 770}, {85.5, 768}, {85.6, 764}, {85.7, 763}, {85.8, 758}, {85.9, 757}, {86.0, 760}, {86.1, 759}, {86.2, 756}, {86.3, 751}, {86.4, 748}, {86.5, 748}, {86.6, 747}, {86.7, 746}, {86.8, 745}, {86.9, 746}, {87.0, 746}, {87.1, 747}, {87.2, 742}, {87.3, 738}, {87.4, 733}, {87.5, 730}, {87.6, 730}, {87.7, 727}, {87.8, 725}, {87.9, 722}, {88.0, 719}, {88.1, 718}, {88.2, 716}, {88.3, 712}, {88.4, 710}, {88.5, 708}, {88.6, 707}, {88.7, 705}, {88.8, 699}, {88.9, 695}, {89.0, 686}, {89.1, 674}, {89.2, 671}, {89.3, 670}, {89.4, 670}, {89.5, 669}, {89.6, 668}, {89.7, 669}, {89.8, 670}, {89.9, 672}, {90.0, 679}, {90.1, 681}, {90.2, 684}, {90.3, 689}, {90.4, 693}, {90.5, 697}, {90.6, 701}, {90.7, 705}, {90.8, 708}, {90.9, 709}, {91.0, 712}, {91.1, 714}, {91.2, 716}, {91.3, 706}, {91.4, 697}, {91.5, 689}, {91.6, 681}, {91.7, 677}, {91.8, 668}, {91.9, 663}, {92.0, 661}, {92.1, 653}, {92.2, 652}, {92.3, 650}, {92.4, 647}, {92.5, 646}, {92.6, 645}, {92.7, 642}, {92.8, 640}, {92.9, 640}, {93.0, 651}, {93.1, 648}, {93.2, 657}, {93.3, 660}, {93.4, 660}, {93.5, 662}, {93.6, 672}, {93.7, 675}, {93.8, 681}, {93.9, 685}, {94.0, 694}, {94.1, 700}, {94.2, 707}, {94.3, 716}, {94.4, 720}, {94.5, 723}, {94.6, 727}, {94.7, 727}, {94.8, 728}, {94.9, 727}, {95.0, 727}, {95.1, 727}, {95.2, 730}, {95.3, 735}, {95.4, 744}, {95.5, 749}, {95.6, 753}, {95.7, 759}, {95.8, 762}, {95.9, 767}, {96.0, 782}, {96.1, 781}, {96.2, 783}, {96.3, 785}, {96.4, 789}, {96.5, 796}, {96.6, 807}, {96.7, 813}, {96.8, 819}, {96.9, 822}, {97.0, 824}, {97.1, 826}, {97.2, 830}, {97.3, 832}, {97.4, 836}, {97.5, 838}, {97.6, 842}, {97.7, 847}, {97.8, 848}, {97.9, 854}, {98.0, 855}, {98.1, 858}, {98.2, 863}, {98.3, 870}, {98.4, 875}, {98.5, 883}, {98.6, 889}, {98.7, 896}, {98.8, 904}, {98.9, 910}, {99.0, 916}, {99.1, 922}, {99.2, 927}, {99.3, 931}, {99.4, 938}, {99.5, 941}, {99.6, 949}, {99.7, 954}, {99.8, 962}, {99.9, 967}, {100.0, 976}, {100.1, 983}, {100.2, 986}, {100.3, 992}, {100.4, 994}, {100.5, 999}, {100.6, 1004}, {100.7, 1006}, {100.8, 1007}, {100.9, 1009}, {101.0, 1012}, {101.1, 1016}, {101.2, 1019}, {101.3, 1021}, {101.4, 1025}, {101.5, 1025}, {101.6, 1020}, {101.7, 1017}, {101.8, 1009}, {101.9, 1003}, {102.0, 1000}, {102.1, 994}, {102.2, 989}, {102.3, 986}, {102.4, 979}, {102.5, 974}, {102.6, 972}, {102.7, 964}, {102.8, 961}, {102.9, 957}, {103.0, 952}, {103.1, 946}, {103.2, 944}, {103.3, 940}, {103.4, 936}, {103.5, 935}, {103.6, 934}, {103.7, 934}, {103.8, 934}, {103.9, 934}, {104.0, 933}, {104.1, 929}, {104.2, 922}, {104.3, 914}, {104.4, 906}, {104.5, 910}, {104.6, 906}, {104.7, 903}, {104.8, 895}, {104.9, 893}, {105.0, 891}, {105.1, 889}, {105.2, 889}, {105.3, 893}, {105.4, 899}, {105.5, 904}, {105.6, 906}, {105.7, 897}, {105.8, 883}, {105.9, 895}, {106.0, 898}, {106.1, 893}, {106.2, 895}, {106.3, 907}, {106.4, 916}, {106.5, 915}, {106.6, 920}, {106.7, 919}, {106.8, 917}, {106.9, 911}, {107.0, 904}, {107.1, 891}, {107.2, 894}, {107.3, 902}, {107.4, 900}, {107.5, 900}, {107.6, 898}, {107.7, 897}, {107.8, 897}, {107.9, 897}, {108.0, 909}, {108.1, 910}, {108.2, 906}, {108.3, 920}, {108.4, 901}, {108.5, 900}, {108.6, 895}, {108.7, 892}, {108.8, 887}, {108.9, 889}, {109.0, 904}, {109.1, 910}, {109.2, 910}, {109.3, 907}, {109.4, 906}, {109.5, 898}, {109.6, 908}, {109.7, 911}, {109.8, 920}, {109.9, 928}, {110.0, 939}, {110.1, 939}, {110.2, 935}, {110.3, 932}, {110.4, 926}, {110.5, 924}, {110.6, 919}, {110.7, 913}, {110.8, 909}, {110.9, 906}, {111.0, 901}, {111.1, 899}, {111.2, 899}, {111.3, 899}, {111.4, 898}, {111.5, 896}, {111.6, 895}, {111.7, 889}, {111.8, 887}, {111.9, 886}, {112.0, 881}, {112.1, 875}, {112.2, 872}, {112.3, 867}, {112.4, 856}, {112.5, 850}, {112.6, 842}, {112.7, 839}, {112.8, 836}, {112.9, 827}, {113.0, 822}, {113.1, 817}, {113.2, 809}, {113.3, 805}, {113.4, 802}, {113.5, 796}, {113.6, 793}, {113.7, 790}, {113.8, 786}, {113.9, 778}, {114.0, 770}, {114.1, 759}, {114.2, 754}, {114.3, 744}, {114.4, 744}, {114.5, 746}, {114.6, 741}, {114.7, 761}, {114.8, 759}, {114.9, 737}, {115.0, 722}, {115.1, 719}, {115.2, 720}, {115.3, 721}, {115.4, 722}, {115.5, 718}, {115.6, 713}, {115.7, 709}, {115.8, 706}, {115.9, 707}, {116.0, 699}, {116.1, 689}, {116.2, 685}, {116.3, 683}, {116.4, 669}, {116.5, 665}, {116.6, 661}, {116.7, 657}, {116.8, 653}, {116.9, 653}, {117.0, 647}, {117.1, 640}, {117.2, 638}, {117.3, 633}, {117.4, 628}, {117.5, 624}, {117.6, 618}, {117.7, 613}, {117.8, 607}, {117.9, 602}, {118.0, 598}, {118.1, 595}, {118.2, 595}, {118.3, 594}, {118.4, 602}, {118.5, 598}, {118.6, 598}, {118.7, 601}, {118.8, 605}, {118.9, 608}, {119.0, 612}, {119.1, 614}, {119.2, 611}, {119.3, 608}, {119.4, 611}, {119.5, 612}, {119.6, 614}, {119.7, 615}, {119.8, 613}, {119.9, 611}, {120.0, 602}, {120.1, 593}, {120.2, 588}, {120.3, 588}, {120.4, 586}, {120.5, 583}, {120.6, 579}, {120.7, 579}, {120.8, 578}, {120.9, 576}, {121.0, 575}, {121.1, 579}, {121.2, 574}, {121.3, 570}, {121.4, 565}, {121.5, 562}, {121.6, 560}, {121.7, 559}, {121.8, 556}, {121.9, 554}, {122.0, 546}, {122.1, 542}, {122.2, 536}, {122.3, 531}, {122.4, 529}, {122.5, 529}, {122.6, 518}, {122.7, 515}, {122.8, 515}, {122.9, 515}, {123.0, 514}, {123.1, 513}, {123.2, 506}, {123.3, 498}, {123.4, 496}, {123.5, 494}, {123.6, 483}, {123.7, 479}, {123.8, 476}, {123.9, 470}, {124.0, 466}, {124.1, 460}, {124.2, 457}, {124.3, 451}, {124.4, 445}, {124.5, 443}, {124.6, 435}, {124.7, 432}, {124.8, 426}, {124.9, 421}, {125.0, 418}, {125.1, 414}, {125.2, 408}, {125.3, 405}, {125.4, 403}, {125.5, 394}, {125.6, 386}, {125.7, 379}, {125.8, 361}, {125.9, 358}, {126.0, 366}, {126.1, 372}, {126.2, 372}, {126.3, 374}, {126.4, 379}, {126.5, 382}, {126.6, 385}, {126.7, 388}, {126.8, 390}, {126.9, 393}, {127.0, 394}, {127.1, 393}, {127.2, 391}, {127.3, 387}, {127.4, 382}, {127.5, 378}, {127.6, 374}, {127.7, 370}, {127.8, 367}, {127.9, 366}, {128.0, 364}, {128.1, 364}, {128.2, 362}, {128.3, 362}, {128.4, 360}, {128.5, 357}, {128.6, 354}, {128.7, 351}, {128.8, 350}, {128.9, 351}, {129.0, 350}, {129.1, 350}, {129.2, 351}, {129.3, 352}, {129.4, 352}, {129.5, 352}, {129.6, 351}, {129.7, 352}, {129.8, 352}, {129.9, 353}, {130.0, 348}, {130.1, 346}, {130.2, 344}, {130.3, 343}, {130.4, 343}, {130.5, 342}, {130.6, 342}, {130.7, 345}, {130.8, 349}, {130.9, 341}, {131.0, 345}, {131.1, 348}, {131.2, 364}, {131.3, 374}, {131.4, 388}, {131.5, 379}, {131.6, 380}, {131.7, 387}, {131.8, 394}, {131.9, 404}, {132.0, 411}, {132.1, 416}, {132.2, 426}, {132.3, 428}, {132.4, 430}, {132.5, 438}, {132.6, 447}, {132.7, 450}, {132.8, 454}, {132.9, 460}, {133.0, 468}, {133.1, 469}, {133.2, 474}, {133.3, 478}, {133.4, 485}, {133.5, 488}, {133.6, 494}, {133.7, 497}, {133.8, 502}, {133.9, 510}, {134.0, 513}, {134.1, 516}, {134.2, 523}, {134.3, 527}, {134.4, 531}, {134.5, 540}, {134.6, 544}, {134.7, 549}, {134.8, 554}, {134.9, 557}, {135.0, 564}, {135.1, 566}, {135.2, 571}, {135.3, 577}, {135.4, 581}, {135.5, 584}, {135.6, 591}, {135.7, 596}, {135.8, 600}, {135.9, 608}, {136.0, 610}, {136.1, 616}, {136.2, 621}, {136.3, 627}, {136.4, 632}, {136.5, 644}, {136.6, 649}, {136.7, 656}, {136.8, 660}, {136.9, 663}, {137.0, 668}, {137.1, 672}, {137.2, 674}, {137.3, 677}, {137.4, 680}, {137.5, 683}, {137.6, 689}, {137.7, 691}, {137.8, 697}, {137.9, 699}, {138.0, 702}, {138.1, 707}, {138.2, 712}, {138.3, 716}, {138.4, 720}, {138.5, 728}, {138.6, 731}, {138.7, 735}, {138.8, 740}, {138.9, 742}, {139.0, 746}, {139.1, 750}, {139.2, 752}, {139.3, 760}, {139.4, 760}, {139.5, 761}, {139.6, 757}, {139.7, 756}, {139.8, 755}, {139.9, 754}, {140.0, 755}, {140.1, 756}, {140.2, 753}, {140.3, 746}, {140.4, 743}, {140.5, 734}, {140.6, 740}, {140.7, 746}, {140.8, 748}, {140.9, 747}, {141.0, 743}, {141.1, 742}, {141.2, 742}, {141.3, 740}, {141.4, 739}, {141.5, 741}, {141.6, 757}, {141.7, 756}, {141.8, 751}, {141.9, 747}, {142.0, 743}, {142.1, 738}, {142.2, 739}, {142.3, 742}, {142.4, 749}, {142.5, 750}, {142.6, 756}, {142.7, 760}, {142.8, 762}, {142.9, 765}, {143.0, 771}, {143.1, 775}, {143.2, 786}, {143.3, 791}, {143.4, 797}, {143.5, 801}, {143.6, 801}, {143.7, 793}, {143.8, 786}, {143.9, 782}, {144.0, 780}, {144.1, 778}, {144.2, 776}, {144.3, 765}, {144.4, 757}, {144.5, 753}, {144.6, 750}, {144.7, 748}, {144.8, 745}, {144.9, 738}, {145.0, 735}, {145.1, 732}, {145.2, 726}, {145.3, 724}, {145.4, 720}, {145.5, 712}, {145.6, 710}, {145.7, 705}, {145.8, 697}, {145.9, 691}, {146.0, 686}, {146.1, 681}, {146.2, 679}, {146.3, 680}, {146.4, 678}, {146.5, 673}, {146.6, 665}, {146.7, 657}, {146.8, 655}, {146.9, 647}, {147.0, 640}, {147.1, 634}, {147.2, 621}, {147.3, 621}, {147.4, 613}, {147.5, 608}, {147.6, 598}, {147.7, 594}, {147.8, 588}, {147.9, 578}, {148.0, 565}, {148.1, 559}, {148.2, 558}, {148.3, 556}, {148.4, 556}, {148.5, 555}, {148.6, 556}, {148.7, 557}, {148.8, 557}, {148.9, 565}, {149.0, 570}, {149.1, 575}, {149.2, 583}, {149.3, 591}, {149.4, 599}, {149.5, 603}, {149.6, 609}, {149.7, 613}, {149.8, 618}, {149.9, 624}, {150.0, 630}, {150.1, 635}, {150.2, 643}, {150.3, 652}, {150.4, 658}, {150.5, 669}, {150.6, 680}, {150.7, 684}, {150.8, 692}, {150.9, 696}, {151.0, 698}, {151.1, 698}, {151.2, 696}, {151.3, 695}, {151.4, 696}, {151.5, 699}, {151.6, 701}, {151.7, 706}, {151.8, 707}, {151.9, 707}, {152.0, 703}, {152.1, 702}, {152.2, 700}, {152.3, 700}, {152.4, 705}, {152.5, 705}, {152.6, 715}, {152.7, 718}, {152.8, 721}, {152.9, 723}, {153.0, 725}, {153.1, 724}, {153.2, 722}, {153.3, 720}, {153.4, 716}, {153.5, 710}, {153.6, 700}, {153.7, 696}, {153.8, 691}, {153.9, 682}, {154.0, 676}, {154.1, 670}, {154.2, 664}, {154.3, 658}, {154.4, 648}, {154.5, 643}, {154.6, 645}, {154.7, 645}, {154.8, 646}, {154.9, 630}, {155.0, 625}, {155.1, 620}, {155.2, 614}, {155.3, 605}, {155.4, 600}, {155.5, 593}, {155.6, 587}, {155.7, 581}, {155.8, 576}, {155.9, 569}, {156.0, 566}, {156.1, 559}, {156.2, 557}, {156.3, 551}, {156.4, 548}, {156.5, 544}, {156.6, 542}, {156.7, 540}, {156.8, 537}, {156.9, 540}, {157.0, 542}, {157.1, 541}, {157.2, 540}, {157.3, 538}, {157.4, 536}, {157.5, 532}, {157.6, 523}, {157.7, 519}, {157.8, 515}, {157.9, 509}, {158.0, 503}, {158.1, 499}, {158.2, 491}, {158.3, 485}, {158.4, 478}, {158.5, 477}, {158.6, 474}, {158.7, 471}, {158.8, 469}, {158.9, 464}, {159.0, 462}, {159.1, 456}, {159.2, 454}, {159.3, 445}, {159.4, 424}, {159.5, 427}, {159.6, 425}, {159.7, 422}, {159.8, 419}, {159.9, 418}, {160.0, 417}, {160.1, 423}, {160.2, 436}, {160.3, 434}, {160.4, 426}, {160.5, 401}, {160.6, 417}, {160.7, 418}, {160.8, 419}, {160.9, 419}, {161.0, 412}, {161.1, 417}, {161.2, 425}, {161.3, 430}, {161.4, 432}, {161.5, 417}, {161.6, 423}, {161.7, 425}, {161.8, 409}, {161.9, 399}, {162.0, 427}, {162.1, 425}, {162.2, 414}, {162.3, 421}, {162.4, 424}, {162.5, 426}, {162.6, 417}, {162.7, 405}, {162.8, 411}, {162.9, 403}, {163.0, 405}, {163.1, 410}, {163.2, 412}, {163.3, 413}, {163.4, 415}, {163.5, 406}, {163.6, 407}, {163.7, 408}, {163.8, 412}, {163.9, 417}, {164.0, 426}, {164.1, 431}, {164.2, 482}, {164.3, 478}, {164.4, 471}, {164.5, 463}, {164.6, 457}, {164.7, 452}, {164.8, 456}, {164.9, 463}, {165.0, 471}, {165.1, 470}, {165.2, 471}, {165.3, 474}, {165.4, 494}, {165.5, 506}, {165.6, 515}, {165.7, 520}, {165.8, 534}, {165.9, 520}, {166.0, 536}, {166.1, 529}, {166.2, 524}, {166.3, 515}, {166.4, 520}, {166.5, 526}, {166.6, 531}, {166.7, 551}, {166.8, 553}, {166.9, 555}, {167.0, 559}, {167.1, 562}, {167.2, 564}, {167.3, 567}, {167.4, 571}, {167.5, 574}, {167.6, 576}, {167.7, 596}, {167.8, 607}, {167.9, 623}, {168.0, 645}, {168.1, 667}, {168.2, 685}, {168.3, 691}, {168.4, 709}, {168.5, 702}, {168.6, 692}, {168.7, 692}, {168.8, 696}, {168.9, 732}, {169.0, 746}, {169.1, 758}, {169.2, 761}, {169.3, 763}, {169.4, 765}, {169.5, 768}, {169.6, 783}, {169.7, 816}, {169.8, 815}, {169.9, 817}, {170.0, 821}, {170.1, 825}, {170.2, 827}, {170.3, 828}, {170.4, 830}, {170.5, 829}, {170.6, 827}, {170.7, 827}, {170.8, 828}, {170.9, 837}, {171.0, 845}, {171.1, 850}, {171.2, 856}, {171.3, 864}, {171.4, 867}, {171.5, 876}, {171.6, 880}, {171.7, 888}, {171.8, 900}, {171.9, 905}, {172.0, 910}, {172.1, 922}, {172.2, 925}, {172.3, 931}, {172.4, 939}, {172.5, 957}, {172.6, 966}, {172.7, 980}, {172.8, 991}, {172.9, 998}, {173.0, 1008}, {173.1, 1021}, {173.2, 1031}, {173.3, 1045}, {173.4, 1059}, {173.5, 1065}, {173.6, 1078}, {173.7, 1094}, {173.8, 1092}, {173.9, 1096}, {174.0, 1098}, {174.1, 1101}, {174.2, 1104}, {174.3, 1107}, {174.4, 1110}, {174.5, 1113}, {174.6, 1114}, {174.7, 1116}, {174.8, 1119}, {174.9, 1122}, {175.0, 1125}, {175.1, 1128}, {175.2, 1130}, {175.3, 1134}, {175.4, 1137}, {175.5, 1142}, {175.6, 1148}, {175.7, 1155}, {175.8, 1162}, {175.9, 1174}, {176.0, 1183}, {176.1, 1191}, {176.2, 1196}, {176.3, 1198}, {176.4, 1200}, {176.5, 1189}, {176.6, 1183}, {176.7, 1180}, {176.8, 1178}, {176.9, 1173}, {177.0, 1171}, {177.1, 1167}, {177.2, 1165}, {177.3, 1165}, {177.4, 1165}, {177.5, 1165}, {177.6, 1164}, {177.7, 1164}, {177.8, 1164}, {177.9, 1166}, {178.0, 1167}, {178.1, 1170}, {178.2, 1177}, {178.3, 1174}, {178.4, 1166}, {178.5, 1166}, {178.6, 1164}, {178.7, 1162}, {178.8, 1160}, {178.9, 1155}, {179.0, 1152}, {179.1, 1151}, {179.2, 1151}, {179.3, 1146}, {179.4, 1144}, {179.5, 1147}, {179.6, 1151}, {179.7, 1154}, {179.8, 1153}, {179.9, 1154}, {180.0, 1153}, {180.1, 1150}, {180.2, 1147}, {180.3, 1146}, {180.4, 1144}, {180.5, 1142}, {180.6, 1140}, {180.7, 1135}, {180.8, 1125}, {180.9, 1121}, {181.0, 1113}, {181.1, 1107}, {181.2, 1098}, {181.3, 1094}, {181.4, 1087}, {181.5, 1084}, {181.6, 1082}, {181.7, 1078}, {181.8, 1073}, {181.9, 1068}, {182.0, 1063}, {182.1, 1061}, {182.2, 1060}, {182.3, 1061}, {182.4, 1065}, {182.5, 1069}, {182.6, 1072}, {182.7, 1076}, {182.8, 1084}, {182.9, 1098}, {183.0, 1110}, {183.1, 1116}, {183.2, 1113}, {183.3, 1116}, {183.4, 1122}, {183.5, 1125}, {183.6, 1133}, {183.7, 1138}, {183.8, 1146}, {183.9, 1140}, {184.0, 1135}, {184.1, 1134}, {184.2, 1131}, {184.3, 1129}, {184.4, 1137}, {184.5, 1139}, {184.6, 1144}, {184.7, 1149}, {184.8, 1155}, {184.9, 1163}, {185.0, 1164}, {185.1, 1173}, {185.2, 1170}, {185.3, 1165}, {185.4, 1157}, {185.5, 1153}, {185.6, 1150}, {185.7, 1142}, {185.8, 1141}, {185.9, 1142}, {186.0, 1142}, {186.1, 1142}, {186.2, 1142}, {186.3, 1145}, {186.4, 1151}, {186.5, 1154}, {186.6, 1155}, {186.7, 1152}, {186.8, 1154}, {186.9, 1154}, {187.0, 1155}, {187.1, 1158}, {187.2, 1159}, {187.3, 1158}, {187.4, 1158}, {187.5, 1158}, {187.6, 1161}, {187.7, 1167}, {187.8, 1170} }; return new ArrayList<>(Arrays.asList(data)); } private void setLineChart() { HIOptions options = new HIOptions(); HITitle title = new HITitle(); title.setText("Solar Employment Growth by Sector, 2010-2016"); options.setTitle(title); HISubtitle subtitle = new HISubtitle(); subtitle.setText("Source: thesolarfoundation.com"); options.setSubtitle(subtitle); HIYAxis yaxis = new HIYAxis(); yaxis.setTitle(new HITitle()); yaxis.getTitle().setText("Number of Employees"); options.setYAxis(new ArrayList<>(Collections.singletonList(yaxis))); HILegend legend = new HILegend(); legend.setLayout("vertical"); legend.setAlign("right"); legend.setVerticalAlign("middle"); options.setLegend(legend); HIPlotOptions plotoptions = new HIPlotOptions(); plotoptions.setSeries(new HISeries()); plotoptions.getSeries().setLabel(new HILabel()); plotoptions.getSeries().getLabel().setConnectorAllowed(false); plotoptions.getSeries().setPointStart(2010); options.setPlotOptions(plotoptions); HILine line1 = new HILine(); line1.setName("Installation"); line1.setData(new ArrayList<>(Arrays.asList(43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175))); HILine line2 = new HILine(); line2.setName("Manufacturing"); line2.setData(new ArrayList<>(Arrays.asList(24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434))); HILine line3 = new HILine(); line3.setName("Sales & Distribution"); line3.setData(new ArrayList<>(Arrays.asList(11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387))); HILine line4 = new HILine(); line4.setName("Project Development"); line4.setData(new ArrayList<>(Arrays.asList(null, null, 7988, 12169, 15112, 22452, 34400, 34227))); HILine line5 = new HILine(); line5.setName("Other"); line5.setData(new ArrayList<>(Arrays.asList(12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111))); HIResponsive responsive = new HIResponsive(); HIRules rules1 = new HIRules(); rules1.setCondition(new HICondition()); rules1.getCondition().setMaxWidth(500); HashMap<String, HashMap> chartLegend = new HashMap<>(); HashMap<String, String> legendOptions = new HashMap<>(); legendOptions.put("layout", "horizontal"); legendOptions.put("align", "center"); legendOptions.put("verticalAlign", "bottom"); chartLegend.put("legend", legendOptions); rules1.setChartOptions(chartLegend); responsive.setRules(new ArrayList<>(Collections.singletonList(rules1))); options.setResponsive(responsive); options.setSeries(new ArrayList<>(Arrays.asList(line1, line2, line3, line4, line5))); binding.line.setOptions(options); } private void setBarChart() { HIOptions options = new HIOptions(); HIChart chart = new HIChart(); chart.setType("column"); options.setChart(chart); HITitle title = new HITitle(); title.setText("Demo chart"); options.setTitle(title); HIColumn series = new HIColumn(); series.setData(new ArrayList<>(Arrays.asList(49.9, 71.5, 106.4, 129.2, 144, 176, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4))); options.setSeries(new ArrayList<HISeries>(Collections.singletonList(series))); binding.bar.setOptions(options); } @Override public void onDestroyView() { super.onDestroyView(); binding = null; } }
35b510f5b8768efa01a305d4e119f8036e594ecc
41baa741f0e26e37e3f1068e25d123f11c5f7b90
/app/src/main/java/com/example/a41587805/tpfinal/model/letra.java
0a96006cfe04de8922afb93347401bb9e0a132b3
[]
no_license
calanity/TpFinal
57f4eb94f7c2863c42bec7da06e22ba3d98433a7
978afd1f086fc01eae2ab8d2e4dace14cb2c85ef
refs/heads/master
2021-01-10T23:20:31.113595
2016-12-02T13:33:41
2016-12-02T13:33:41
69,381,641
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
package com.example.a41587805.tpfinal.model; import org.cocos2d.nodes.Sprite; import org.cocos2d.opengl.Texture2D; /** * Created by 41587805 on 8/11/2016. */ public class letra { Sprite sprite; String letra; int id; public letra(String imagenPath, String letra) { this.sprite = Sprite.sprite(imagenPath); this.letra = letra; } public Sprite getSprite() { return sprite; } public String getLetra() { return letra; } public void setLetra(String letra) { this.letra = letra; } public boolean esIgual(letra l2) { return letra.equals(l2.getLetra()); } public int getId() { return id; } public void setId(int id) { this.id = id; } }
[ "calanity.gmail.com" ]
calanity.gmail.com
9393caa9cbcaa7833fa0775d64406381b5b2b1af
056c94129117d3e12e660356e3d6656a51383c59
/e-shop-shipment/src/main/java/com/solution/fromVC/shipment/web/ShippingBean.java
edc12be3e742deca2531aa3816975c4e3b53dfaf
[]
no_license
devSolutionsFromVC/e-Shop-JavaEE
c3e653a6abf1f6f675623b5c79a230c2772f808e
1e06d6803ec862fa978c812d37e9af549ddc48f5
refs/heads/master
2020-03-24T09:33:50.172862
2018-07-27T23:38:29
2018-07-27T23:38:29
142,632,102
0
0
null
null
null
null
UTF-8
Java
false
false
3,318
java
package com.solution.fromVC.shipment.web; import com.solution.fromVC.entities.CustomerOrder; import com.solution.fromVC.shipment.ejb.OrderBrowser; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.ejb.EJB; import javax.enterprise.context.RequestScoped; import javax.inject.Named; import javax.jms.JMSException; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; import javax.ws.rs.core.GenericType; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; @Named @RequestScoped public class ShippingBean implements Serializable{ private static final Logger logger = Logger.getLogger(ShippingBean.class.getCanonicalName()); private static final String SERVICE_ENDPOINT = "http://localhost:8080/e-Shop/services/order"; private static final String MEDIA_TYPE = MediaType.APPLICATION_JSON; private static final long serialVersionUID = -2526289536313985021L; protected Client client; @EJB private OrderBrowser orderBrowser; @PostConstruct private void init(){ client = ClientBuilder.newClient(); } @PreDestroy private void destroy(){ client.close(); } private Map<String, CustomerOrder> orders; public Map<String, CustomerOrder> getOrders(){ return orders; } public void setOrders(Map<String, CustomerOrder> orders){ this.orders = orders; } public enum Status{ PENDING_PAYMENT(2), READY_TO_SHIP(3), SHIPPED(4), CANCELLED_PAYMENT(5), CANCELLED_MANUAL(6); private int status; private Status(final int pStatus){ status = pStatus; } public int getStatus(){ return status; } } public String getEndpoint(){ return SERVICE_ENDPOINT; } public List<CustomerOrder> listByStatus(final Status status){ List<CustomerOrder> entity = (List<CustomerOrder>) client.target(SERVICE_ENDPOINT) .queryParam("status", String.valueOf(status.getStatus())) .request(MEDIA_TYPE) .get(new GenericType<List<CustomerOrder>>(){}); return entity; } public void updateOrderStatus(final String messageID, final Status status) throws JMSException { CustomerOrder order = orderBrowser.processOrder(messageID); Response response = client.target(SERVICE_ENDPOINT) .path("/" + order.getId()) .request(MEDIA_TYPE) .put(Entity.text(String.valueOf(status))); logger.log(Level.FINEST, "PUT Status response: {0}", response.getStatus()); } public List<String> getPendingOrders() throws JMSException { Map<String, CustomerOrder> pendingOrders = orderBrowser.getOrders(); if(pendingOrders == null){ return null; } else { setOrders(pendingOrders); return new ArrayList<String>(getOrders().keySet()); } } public List<CustomerOrder> getCompletedOrders(){ return listByStatus(Status.SHIPPED); } }
02151ce1b285dd6ce06eb206b9e5d2e82889137a
38c7aa1d3666bfc450a34911d6d566929440e5ae
/src/jAudioFeatureExtractor/actions/SynthesizeAction.java
efba0a2479813168ecf2022750250c9e06d6060d
[]
no_license
dmcennis/archivedj-git
0c566a20457ab659ef1182e99a1df68ad12431e4
2543b2ea04577df10c633b8010e11b4074e6dbe5
refs/heads/master
2016-09-01T18:27:59.861392
2014-06-12T18:35:32
2014-06-12T18:35:34
20,753,156
0
1
null
null
null
null
UTF-8
Java
false
false
976
java
package jAudioFeatureExtractor.actions; import jAudioFeatureExtractor.Controller; import jAudioFeatureExtractor.RecordingSelectorPanel; import jAudioFeatureExtractor.SynthesisFrame; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; /** * Action that shows the SynthesizeFrame * * @author Daniel McEnnis * */ public class SynthesizeAction extends AbstractAction { static final long serialVersionUID = 1; private SynthesisFrame synthesis_frame=null; private Controller controller; /** * Constructor that sets the menu text and stores a reference to the controller. * @param c near global controller. */ public SynthesizeAction(Controller c){ super("Synthesize Audio..."); controller = c; } /** * Creates and shows the SynthesizeFrame. */ public void actionPerformed(ActionEvent e) { if (synthesis_frame == null) synthesis_frame = new SynthesisFrame(controller); else synthesis_frame.setVisible(true); } }