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
a2da3aecae12e3fab8d58de8d501a8d40641e4e8
b852321ea62776a130e1359cd373d47c6163ff29
/git-mdstudio-core/src/java/com/md/studio/service/Refreshable.java
60af87ed2c6d4b1e0f3886eb1dfc1ee8b29b521e
[]
no_license
randhie/mds-prod-core
b20464a557e8735cece1a72d92e95744fc39e57a
6bd5235dbcdf6538a5a28ed0937d18f7fd9a08c1
refs/heads/master
2021-03-30T22:40:50.711110
2018-03-09T05:37:47
2018-03-09T05:37:47
124,492,568
0
0
null
null
null
null
UTF-8
Java
false
false
109
java
package com.md.studio.service; public interface Refreshable { public void refresh(String arg); }
b4fcec91dec71f0b13152ea7d727fc3a84667679
df7a2744b5548419a6d3316dcfdf1fbc66177cf7
/Min/MinFinderRunnable.java
3e21d43147d08328ad5ff367ba4c41b983453b1d
[]
no_license
JKhuu2/Java-Projects
a111e314c9f9935e2dc902dfa7b8cce261653bc6
9f5fc4ad915f080d8bb00e219acd98cee9a830b3
refs/heads/master
2022-12-11T19:30:09.383075
2020-09-11T06:02:09
2020-09-11T06:02:09
294,522,075
0
0
null
null
null
null
UTF-8
Java
false
false
1,579
java
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class MinFinderRunnable implements Runnable { /* These are the class variables in MinFinderRunnable. * The MinFinalRunnable class reads the value at min, so be sure to update it as you use the run() method. */ String filename; int min; /* This is the constructor for the MinFinderRunnable class. * It takes in a String for the filename so that the run() method can have its Scanner instance read that file. * It should also initialize min, to avoid NullPointerExceptions when the run() method is called. */ public MinFinderRunnable(String filename) { this.filename=filename; min=1000; } /* This is the run method for the MinFinderRunnable class. * It starts with a Scanner class, to read in the file with the String filename. * Then it should go through the file & set class variable min to the minimum value of the file. */ @Override public void run() { try { Scanner reader; reader = new Scanner(new File(filename)); // WRITE YOUR CODE HERE while(reader.hasNext()) { Integer i=Integer.parseInt(reader.next()); if(i<min) { min=i; System.out.println("Testing "+ i+" is less than "+ min +" on file "+filename); } } System.out.println("Global min value is "+ min+"."); reader.close(); } catch (FileNotFoundException e) { System.err.println("ERROR: File " + filename + " not found."); } } }
ef3edbfa4106fa040f474ea17acab4a9134d1d77
fec0e99cf50694827ee8155df16ce6c93c83c479
/src/main/java/org/excelsi/tower/Emerald.java
1f619ab4b4e2474c343aa7edc401d58811e03241
[]
no_license
jkwhite/sketch
e320dfcb5eda2b5b0ee06c0ad8ac4131e0441924
d75f973cdfc50b5d6ae77ca0eb4e02b82de63065
refs/heads/master
2020-04-06T06:51:36.800562
2019-09-27T07:59:17
2019-09-27T07:59:17
31,822,501
0
0
null
null
null
null
UTF-8
Java
false
false
1,160
java
/* Tower Copyright (C) 2007, John K White, All Rights Reserved */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package org.excelsi.tower; import org.excelsi.aether.Item; public class Emerald extends Gem implements Catalyst { public Item internalCatalyze() { return new ScrollOfReanimation(); } public String getColor() { return "green"; } public int score() { return 80; } public int getOccurrence() { return 2; } }
41442e957f46d9ae687584ef5ecae46d3577ba56
63daf67dc2a2f12ba3900b9ef15f89950ac5f4c5
/app/src/main/java/com/offcasoftware/shop2/model/Product.java
8dc19e0e8cbf69e218b657ea8f89a74a738a9cd3
[]
no_license
mgieysztor/Shop2_orm
f5ece35cdda2abd2a9408572c3275cb77bfae3d3
44203f33d66a43fb49221ba1dd46f5b7bb32597d
refs/heads/master
2020-05-18T13:07:31.493604
2017-03-07T19:59:37
2017-03-07T19:59:37
84,239,366
0
0
null
null
null
null
UTF-8
Java
false
false
1,177
java
package com.offcasoftware.shop2.model; import com.j256.ormlite.field.DatabaseField; /** * @author maciej.pachciarek on 2017-02-18. */ public class Product { static final String TABLE_NAME = "products"; @DatabaseField(columnName = "id", generatedId = true) private int mId; @DatabaseField (columnName = "name", canBeNull = false,unique = true) private String mName; @DatabaseField (columnName = "price", canBeNull = false) private int mPrice; @DatabaseField (columnName = "imageName", defaultValue = "dom2") private String mImage; public Product() { } // private final int mId; // private String mName; // private int mPrice; // private String mImage; //mImageResId; public Product(final int id, final String name, final int price, final String imageName) { mId = id; mName = name; mPrice = price; mImage = imageName; } public int getId() { return mId; } public String getName() { return mName; } public int getPrice() { return mPrice; } public String getImageResId() { return mImage; } }
a25f18270039827d08fa84a14bb945a43e8b031b
c2534889a9c4dd26728b1604b08c67ba84679693
/br.ufes.inf.nemo.ontol.parent/br.ufes.inf.nemo.ontol.model/src-gen/br/ufes/inf/nemo/ontol/model/impl/AttributeAssignmentImpl.java
9b1523c530309eeac4b08bd11c8e662d032a0496
[]
no_license
claudenirmf/old-tests-on-xtext
109335082e9445ad27ec13405f7259080d33c457
d8de5d035742840d488ed5467f435c95290742a4
refs/heads/master
2021-06-19T05:19:02.695301
2017-06-21T15:00:47
2017-06-21T15:00:47
71,890,847
0
0
null
null
null
null
UTF-8
Java
false
false
5,803
java
/** */ package br.ufes.inf.nemo.ontol.model.impl; import br.ufes.inf.nemo.ontol.model.Attribute; import br.ufes.inf.nemo.ontol.model.AttributeAssignment; import br.ufes.inf.nemo.ontol.model.DataValue; import br.ufes.inf.nemo.ontol.model.ModelPackage; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Attribute Assignment</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link br.ufes.inf.nemo.ontol.model.impl.AttributeAssignmentImpl#getAttribute <em>Attribute</em>}</li> * <li>{@link br.ufes.inf.nemo.ontol.model.impl.AttributeAssignmentImpl#getAssignments <em>Assignments</em>}</li> * </ul> * * @generated */ public class AttributeAssignmentImpl extends PropertyAssignmentImpl implements AttributeAssignment { /** * The cached value of the '{@link #getAttribute() <em>Attribute</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAttribute() * @generated * @ordered */ protected Attribute attribute; /** * The cached value of the '{@link #getAssignments() <em>Assignments</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAssignments() * @generated * @ordered */ protected EList<DataValue> assignments; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AttributeAssignmentImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ModelPackage.Literals.ATTRIBUTE_ASSIGNMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Attribute getAttribute() { if (attribute != null && attribute.eIsProxy()) { InternalEObject oldAttribute = (InternalEObject)attribute; attribute = (Attribute)eResolveProxy(oldAttribute); if (attribute != oldAttribute) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, ModelPackage.ATTRIBUTE_ASSIGNMENT__ATTRIBUTE, oldAttribute, attribute)); } } return attribute; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Attribute basicGetAttribute() { return attribute; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAttribute(Attribute newAttribute) { Attribute oldAttribute = attribute; attribute = newAttribute; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ATTRIBUTE_ASSIGNMENT__ATTRIBUTE, oldAttribute, attribute)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<DataValue> getAssignments() { if (assignments == null) { assignments = new EObjectContainmentEList<DataValue>(DataValue.class, this, ModelPackage.ATTRIBUTE_ASSIGNMENT__ASSIGNMENTS); } return assignments; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ModelPackage.ATTRIBUTE_ASSIGNMENT__ASSIGNMENTS: return ((InternalEList<?>)getAssignments()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ModelPackage.ATTRIBUTE_ASSIGNMENT__ATTRIBUTE: if (resolve) return getAttribute(); return basicGetAttribute(); case ModelPackage.ATTRIBUTE_ASSIGNMENT__ASSIGNMENTS: return getAssignments(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ModelPackage.ATTRIBUTE_ASSIGNMENT__ATTRIBUTE: setAttribute((Attribute)newValue); return; case ModelPackage.ATTRIBUTE_ASSIGNMENT__ASSIGNMENTS: getAssignments().clear(); getAssignments().addAll((Collection<? extends DataValue>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ModelPackage.ATTRIBUTE_ASSIGNMENT__ATTRIBUTE: setAttribute((Attribute)null); return; case ModelPackage.ATTRIBUTE_ASSIGNMENT__ASSIGNMENTS: getAssignments().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ModelPackage.ATTRIBUTE_ASSIGNMENT__ATTRIBUTE: return attribute != null; case ModelPackage.ATTRIBUTE_ASSIGNMENT__ASSIGNMENTS: return assignments != null && !assignments.isEmpty(); } return super.eIsSet(featureID); } } //AttributeAssignmentImpl
5979b1c45f22158ae9ec53c588c42ee064b01acc
f10ffc7f6f7fcbf03c0b5d3cdef0b58d2a294332
/201412377_exConstructorSpringDI/src/main/java/kr/ac/dit/ClassB.java
a5c060cd9796034a3655b26cce2887a49f800031
[]
no_license
qerwa/webproject
1abe6a81d13b2a80b5b3598a7afd925d3fb22d5b
927878fc06d6a231481de563d84e9269d3997d8d
refs/heads/master
2020-03-29T04:35:36.270099
2018-11-29T01:17:43
2018-11-29T01:17:43
149,538,550
0
0
null
null
null
null
UTF-8
Java
false
false
233
java
package kr.ac.dit; public class ClassB { ClassA classA; public void setClassA(ClassA classA) { this.classA = classA; } public void methodB() { System.out.println("ClassB depends on "+classA.methodA()); } }
[ "D7608@DESKTOP-PNB790R" ]
D7608@DESKTOP-PNB790R
939f9f867f9a3f27fc9d08f67b8c85f7ae3fdd1a
d1f0340b0355e59f2d154b27b22629379fd7f930
/src/main/java/com/princeli/pattern/strategy/pay/payport/Payment.java
5fcfc533559d1db13cce107bca6fc1c85ede9b98
[]
no_license
future1314/pattern-demo
4dd022bdd81c165acf635768b270a0ec547f2e77
ea90c6f7c4a65d492c8fc06cd5205e5419df4569
refs/heads/master
2020-06-04T20:36:20.127545
2019-05-10T03:42:28
2019-05-10T03:42:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
532
java
package com.princeli.pattern.strategy.pay.payport; import com.princeli.pattern.strategy.pay.PayState; /** * @program: pattern-demo * @description: ${description} * @author: ly * @create: 2018-07-16 11:30 **/ public interface Payment { public final static Payment ALI_PAY = new AliPay(); public final static Payment JD_PAY = new JDPay(); public final static Payment UNION_PAY = new UnionPay(); public final static Payment WECHAT_PAY = new WechatPay(); public PayState pay(String uid, double amount); }
8590c0e8bd9ef57f02839ea34032b8ca4931322e
5b3ccd03986b0c2c9e2426e31326e154a4aa1711
/Doorbell/app/src/main/gen/com/solutions/nimbus/doorbell/R.java
7caa2126bd6fb289e8c16e829e0a3a838537756f
[]
no_license
hacktm/Hardware-Nimbus-solutions
8eb6d9aaa68a08e04c6323342f3ad9b78f9d7d6e
a00d4675d1fd323be103ddbb90943895564ce0c8
refs/heads/master
2016-09-05T11:45:23.852641
2015-02-09T20:19:22
2015-02-09T20:19:22
25,373,572
0
1
null
null
null
null
UTF-8
Java
false
false
185
java
/*___Generated_by_IDEA___*/ package com.solutions.nimbus.doorbell; /* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ public final class R { }
c0de4b78c9dcb2e1366d34d76e2f48a876d26879
d175e7c1a5700479a7bb0ed864d463f588c1e61f
/Solution_剑指Offer20表示数值的字符串.java
accd8efe82d51968f4f183a5cd08120266ee3532
[]
no_license
1160300404/leetcodeSolution
5754b8fdd8d31ce7a7d0a0e95d4afd411396853b
eaab2c4924684e6f0dc7852612975e8aa1da8bac
refs/heads/master
2023-03-14T10:07:33.181694
2021-03-01T10:58:55
2021-03-01T10:58:55
309,036,780
0
0
null
null
null
null
UTF-8
Java
false
false
953
java
public class Solution_剑指Offer20表示数值的字符串 { public boolean isNumber(String s) { boolean ans=false; int index=getnum(s,0); if(index>0) ans=true; if(s.charAt(index)=='.'){ int oldindex=index; index=getnum(s,oldindex+1); ans=ans||(index>oldindex); } if(s.charAt(index)=='e'||s.charAt(index)=='E'){ int oldindex=index; index=getnum(s,oldindex+1); ans=ans&&(index>oldindex); } return ans&&index==s.length(); } public int getnum(String s,int index){ // int index=0; if(s.charAt(index)=='+'||s.charAt(index)=='-'){ index++; } return getunsignednum(s,index); } public int getunsignednum(String s,int index){ if(index<s.length()&&s.charAt(index)>='0'&&s.charAt(index)<='9'){ index++; } return index; } }
6a006ec609c6f702bd4c458f644ef57ec2f3b3f9
f4e83217c4b3fb830ccf273d9feb38d0c70aad10
/app/build/generated/source/r/debug/android/support/coreui/R.java
75ce0a8243af40106c97041a959e225d6535b7b8
[]
no_license
vantien1401/FoodOrder
acc55fb07124a6ccaf0b0ba4b2aa32b69e69ad62
392014a62988e8dc0868b7d34ca101128fbb68aa
refs/heads/master
2020-06-02T08:17:41.559806
2019-09-23T04:25:28
2019-09-23T04:25:28
191,094,158
0
0
null
null
null
null
UTF-8
Java
false
false
7,610
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.coreui; public final class R { public static final class attr { public static final int font = 0x7f030128; public static final int fontProviderAuthority = 0x7f03012a; public static final int fontProviderCerts = 0x7f03012b; public static final int fontProviderFetchStrategy = 0x7f03012c; public static final int fontProviderFetchTimeout = 0x7f03012d; public static final int fontProviderPackage = 0x7f03012e; public static final int fontProviderQuery = 0x7f03012f; public static final int fontStyle = 0x7f030130; public static final int fontWeight = 0x7f030131; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f040000; } public static final class color { public static final int notification_action_color_filter = 0x7f050065; public static final int notification_icon_bg_color = 0x7f050066; public static final int ripple_material_light = 0x7f050071; public static final int secondary_text_default_material_light = 0x7f050073; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f060051; public static final int compat_button_inset_vertical_material = 0x7f060052; public static final int compat_button_padding_horizontal_material = 0x7f060053; public static final int compat_button_padding_vertical_material = 0x7f060054; public static final int compat_control_corner_material = 0x7f060055; public static final int notification_action_icon_size = 0x7f0600a7; public static final int notification_action_text_size = 0x7f0600a8; public static final int notification_big_circle_margin = 0x7f0600a9; public static final int notification_content_margin_start = 0x7f0600aa; public static final int notification_large_icon_height = 0x7f0600ab; public static final int notification_large_icon_width = 0x7f0600ac; public static final int notification_main_column_padding_top = 0x7f0600ad; public static final int notification_media_narrow_margin = 0x7f0600ae; public static final int notification_right_icon_size = 0x7f0600af; public static final int notification_right_side_padding_top = 0x7f0600b0; public static final int notification_small_icon_background_padding = 0x7f0600b1; public static final int notification_small_icon_size_as_large = 0x7f0600b2; public static final int notification_subtext_size = 0x7f0600b3; public static final int notification_top_pad = 0x7f0600b4; public static final int notification_top_pad_large_text = 0x7f0600b5; } public static final class drawable { public static final int notification_action_background = 0x7f070083; public static final int notification_bg = 0x7f070084; public static final int notification_bg_low = 0x7f070085; public static final int notification_bg_low_normal = 0x7f070086; public static final int notification_bg_low_pressed = 0x7f070087; public static final int notification_bg_normal = 0x7f070088; public static final int notification_bg_normal_pressed = 0x7f070089; public static final int notification_icon_background = 0x7f07008a; public static final int notification_template_icon_bg = 0x7f07008b; public static final int notification_template_icon_low_bg = 0x7f07008c; public static final int notification_tile_bg = 0x7f07008d; public static final int notify_panel_notification_icon_bg = 0x7f07008e; } public static final class id { public static final int action_container = 0x7f08000e; public static final int action_divider = 0x7f080010; public static final int action_image = 0x7f080011; public static final int action_text = 0x7f080019; public static final int actions = 0x7f08001a; public static final int async = 0x7f080028; public static final int blocking = 0x7f08002d; public static final int chronometer = 0x7f080043; public static final int forever = 0x7f08006c; public static final int icon = 0x7f08007b; public static final int icon_group = 0x7f08007c; public static final int info = 0x7f080083; public static final int italic = 0x7f080085; public static final int line1 = 0x7f08008d; public static final int line3 = 0x7f08008e; public static final int normal = 0x7f0800b6; public static final int notification_background = 0x7f0800b7; public static final int notification_main_column = 0x7f0800b8; public static final int notification_main_column_container = 0x7f0800b9; public static final int right_icon = 0x7f0800d2; public static final int right_side = 0x7f0800d3; public static final int text = 0x7f080102; public static final int text2 = 0x7f080103; public static final int time = 0x7f080109; public static final int title = 0x7f08010a; } public static final class integer { public static final int status_bar_notification_info_maxnum = 0x7f09000a; } public static final class layout { public static final int notification_action = 0x7f0a003c; public static final int notification_action_tombstone = 0x7f0a003d; public static final int notification_template_custom_big = 0x7f0a0044; public static final int notification_template_icon_group = 0x7f0a0045; public static final int notification_template_part_chronometer = 0x7f0a0049; public static final int notification_template_part_time = 0x7f0a004a; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f0d003b; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f0e0155; public static final int TextAppearance_Compat_Notification_Info = 0x7f0e0156; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e0158; public static final int TextAppearance_Compat_Notification_Time = 0x7f0e015b; public static final int TextAppearance_Compat_Notification_Title = 0x7f0e015d; public static final int Widget_Compat_NotificationActionContainer = 0x7f0e01d3; public static final int Widget_Compat_NotificationActionText = 0x7f0e01d4; } public static final class styleable { public static final int[] FontFamily = { 0x7f03012a, 0x7f03012b, 0x7f03012c, 0x7f03012d, 0x7f03012e, 0x7f03012f }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x7f030128, 0x7f030130, 0x7f030131 }; public static final int FontFamilyFont_font = 0; public static final int FontFamilyFont_fontStyle = 1; public static final int FontFamilyFont_fontWeight = 2; } }
9b8cecf90fc1504125d20349211cb3f977a4f6db
c19d27a3c089b12400cdb93acc43dc977f42fffa
/app/src/main/java/com/hakber/dietgo/weight.java
2f988059df6631397a9931620c0cb51997354247
[]
no_license
qpelit/DietGo-Android-
7302f5a561319a706be97445e2cb627fc58f3c1a
f4cc0b1497a63e265f23c49923c27d96fb11df08
refs/heads/master
2021-01-11T01:45:36.745012
2017-01-24T23:13:34
2017-01-24T23:13:34
70,643,497
1
1
null
null
null
null
UTF-8
Java
false
false
4,826
java
package com.hakber.dietgo; import android.app.DatePickerDialog; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.DatePicker; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.w3c.dom.Text; import java.util.ArrayList; import java.util.Calendar; public class weight extends AppCompatActivity { ListView weightList; TextView lastWeightValueText; TextView currentWeightValueText; int user_id; private ProgressBar spinner; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_weight); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); spinner = (ProgressBar)findViewById(R.id.progressBar1); SharedPreferences preferences= getSharedPreferences("userInfos", 0); user_id = preferences.getInt("user_id", -1); weightList=(ListView) findViewById(R.id.weightListView); lastWeightValueText=(TextView) findViewById(R.id.lastWeightValueText) ; currentWeightValueText=(TextView) findViewById(R.id.currentWeightValueText) ; FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fabWeight); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent i = new Intent(weight.this, weightAdd.class); startActivity(i); } }); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getWeightData(); // to set Weight List by getting weight data from server } private void getWeightData() { // String id = editTextId.getText().toString().trim(); //if (id.equals("")) { // Toast.makeText(this, "Please enter an id", Toast.LENGTH_LONG).show(); // return; // } //loading = ProgressDialog.show(this,"Please wait...","Fetching...",false,false); spinner.setVisibility(View.VISIBLE); String url = Config.WEIGHT_DATA_URL+user_id; StringRequest stringRequest = new StringRequest(url, new Response.Listener<String>() { @Override public void onResponse(String response) { //loading.dismiss(); spinner.setVisibility(View.GONE); showJSON(response); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(weight.this, error.getMessage().toString(), Toast.LENGTH_LONG).show(); } }); RequestQueue requestQueue = Volley.newRequestQueue(this); requestQueue.add(stringRequest); } private void showJSON(String response){ int id; Float weight=0f; String date; JSONArray result; ArrayList<String> items = new ArrayList<String>(); JSONObject collegeData; try { JSONObject jsonObject = new JSONObject(response); result = jsonObject.getJSONArray(Config.JSON_ARRAY); for(int i=0; i < result.length() ; i++) { collegeData = (JSONObject) result.get(i); id= collegeData.getInt("id"); weight = (float) collegeData.getDouble("weight"); date = collegeData.getString("date"); items.add(String.valueOf(weight)); } if(result.length() - 2>=0) { lastWeightValueText.setText(items.get(result.length() - 2) + " kg"); currentWeightValueText.setText(items.get(result.length() - 1) + " kg"); } else{ lastWeightValueText.setText(items.get(result.length() - 1) + " kg"); currentWeightValueText.setText(items.get(result.length() - 1) + " kg"); } CustomWeightList cl = new CustomWeightList(this, result,items); weightList.setAdapter(cl); } catch (JSONException e) { e.printStackTrace(); } } }
802e38b9c31d9275b899ef9e3360975d39579a43
0885c2cf8960c646c4b887136ed3a80ce453fabd
/src/main/java/com/gow/beau/model/req/category/CategoryListPageReq.java
0b1a6996c2c8866e48bbcb91eb6e79e9ebe0abb9
[]
no_license
295647706/gow
2295f770c29a3bfb6990486352f7f5cf4fbb99aa
ead69a8dd65ca4e1d0b7697860d636d459d6b1ff
refs/heads/master
2022-06-24T20:55:26.662637
2020-03-23T00:03:02
2020-03-23T00:03:02
182,363,425
0
0
null
2022-06-21T01:04:36
2019-04-20T05:16:46
JavaScript
UTF-8
Java
false
false
306
java
package com.gow.beau.model.req.category; import com.gow.beau.model.data.PageInfo; import lombok.Data; /** * @ClassName CategoryListPageReq * @Author lzn * @DATE 2019/8/30 15:27 */ @Data public class CategoryListPageReq extends PageInfo { private String catName; private String catIsShow; }
8a6fafe8a378df6e4a3b5e0e41ed0fb9c2484c4c
c18ec8f6ed0b10dead92812f41242974a7c4773a
/app/src/main/java/me/arun/arunrxjavaexploring/utils/FragmentHelper/FrgamentViewSelectionHelper.java
1dceea1ab38b5b00a693584c568cf8326448d35e
[]
no_license
arunpandian22/RxJavaExploring
2b5c20a64cd2d3ee99f8761a4bd97090c0134ffe
b4431b2c9013d11843f60e1502a13caf1a3d5c4f
refs/heads/master
2020-04-16T06:36:49.992955
2019-01-28T03:41:45
2019-01-28T03:41:45
165,354,362
3
0
null
null
null
null
UTF-8
Java
false
false
2,048
java
package me.arun.arunrxjavaexploring.utils.FragmentHelper; /** * A Class created for the get the view id for the Fragment add * Created by Jaison. */ public class FrgamentViewSelectionHelper { public static final String TAG="ViewSelectionHelper"; public static final int LOCATION_COLLECTION_DETAILS=1; public static final int FAV_COLLECTION_DETAILS=2; public static final int COLLECTION_PLACE_LIST=3; /** * A method to get the View Id based on HomeSource enum type * * @param pageSource a param has the Enum type of HomeSource * @return it returns the id of the view */ // public static int getParentSourceId(HomeSource pageSource) { // switch (pageSource) { // case HOME: // return R.id.navigationHome; // case SEARCH: // return R.id.navigationSearch; // case SETTINGS: // return R.id.navigationSettings; // case FAVOURITE: // return R.id.navigationFavourites; // default: // return 0; // } // } /** * A method to get the View Id based on pageSource * @param pageSource a param has the value for which screen layout has to select * @return it returns the view id for the particular screen based on given pageSource value */ // public static int getCollectionViewId(int pageSource) { // Log.d(TAG, "getCollectionFrameId : "+pageSource); // // switch(pageSource) { // case LOCATION_COLLECTION_DETAILS: // return R.layout.fragment_home; // case FAV_COLLECTION_DETAILS: // return R.layout.fragment_place_details; // case COLLECTION_PLACE_LIST: // return R.layout.fragment_place_listing; // default: // return R.layout.fragment_home; // } // } /** * A enum Class created to Bottom Tabs type */ public enum HomeSource { HOME, SEARCH, FAVOURITE, SETTINGS } }
103179b6120dbf4c40809e24ea1a6aeef9542685
4691acca4e62da71a857385cffce2b6b4aef3bb3
/spring-security-modules/spring-security-core/src/test/java/com/baeldung/filterresponse/SpringSecurityJsonViewIntegrationTest.java
fc821b51756118d663827ce780c10c993ab31ed5
[ "MIT" ]
permissive
lor6/tutorials
800f2e48d7968c047407bbd8a61b47be7ec352f2
e993db2c23d559d503b8bf8bc27aab0847224593
refs/heads/master
2023-05-29T06:17:47.980938
2023-05-19T08:37:45
2023-05-19T08:37:45
145,218,314
7
11
MIT
2018-08-18T12:29:20
2018-08-18T12:29:19
null
UTF-8
Java
false
false
3,315
java
package com.baeldung.filterresponse; import com.baeldung.filterresponse.config.AppConfig; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.util.NestedServletException; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = AppConfig.class) @WebAppConfiguration public class SpringSecurityJsonViewIntegrationTest { @Autowired private WebApplicationContext context; private MockMvc mvc; @Rule public ExpectedException expectedException = ExpectedException.none(); @Before public void setup() { mvc = MockMvcBuilders .webAppContextSetup(context) .build(); } @Test @WithMockUser(username = "admin", password = "adminPass", roles = "ADMIN") public void whenAdminRequests_thenOwnerNameIsPresent() throws Exception { mvc.perform(get("/items")) .andExpect(status().isOk()) .andExpect(jsonPath("$[0].id").value(1)) .andExpect(jsonPath("$[0].name").value("Item 1")) .andExpect(jsonPath("$[0].ownerName").exists()); } @Test @WithMockUser(username = "user", password = "userPass", roles = "USER") public void whenUserRequests_thenOwnerNameIsAbsent() throws Exception { mvc.perform(get("/items")) .andExpect(status().isOk()) .andExpect(jsonPath("$[0].id").value(1)) .andExpect(jsonPath("$[0].name").value("Item 1")) .andExpect(jsonPath("$[0].ownerName").doesNotExist()); } @Test @WithMockUser(username = "user", password = "userPass", roles = {"ADMIN", "USER"}) public void whenMultipleRoles_thenExceptionIsThrown() throws Exception { expectedException.expect(new BaseMatcher<NestedServletException>() { @Override public boolean matches(Object o) { NestedServletException exception = (NestedServletException) o; return exception.getCause() instanceof IllegalArgumentException && exception.getCause().getMessage().equals("Ambiguous @JsonView declaration for roles ROLE_ADMIN,ROLE_USER"); } @Override public void describeTo(Description description) { } }); mvc.perform(get("/items")) .andExpect(status().isOk()); } }
2dd7bc88594539cc90a471c0532495a654045f94
275793cd7c5c9ba554bf0aef17e0899fb591ca88
/aliyun-java-sdk-openanalytics-open/src/main/java/com/aliyuncs/openanalytics_open/model/v20200928/AlterDatabaseRequest.java
f4d30795346f6ab294e3f012fcf2af3d35a34417
[ "Apache-2.0" ]
permissive
wosniuyeye/aliyun-openapi-java-sdk
4f8a0b5bf1a90ec917bf29bb71a5b231ac28b2f9
c30731a2d65b5156948120e1168f3ed6a4897d7a
refs/heads/master
2023-04-05T13:15:34.306642
2021-04-08T02:31:03
2021-04-08T02:31:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,664
java
/* * 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.aliyuncs.openanalytics_open.model.v20200928; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.openanalytics_open.Endpoint; /** * @author auto create * @version */ public class AlterDatabaseRequest extends RpcAcsRequest<AlterDatabaseResponse> { private String oldDbName; private String name; private String description; private String locationUri; private String parameters; public AlterDatabaseRequest() { super("openanalytics-open", "2020-09-28", "AlterDatabase", "openanalytics"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getOldDbName() { return this.oldDbName; } public void setOldDbName(String oldDbName) { this.oldDbName = oldDbName; if(oldDbName != null){ putQueryParameter("OldDbName", oldDbName); } } public String getName() { return this.name; } public void setName(String name) { this.name = name; if(name != null){ putQueryParameter("Name", name); } } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; if(description != null){ putQueryParameter("Description", description); } } public String getLocationUri() { return this.locationUri; } public void setLocationUri(String locationUri) { this.locationUri = locationUri; if(locationUri != null){ putQueryParameter("LocationUri", locationUri); } } public String getParameters() { return this.parameters; } public void setParameters(String parameters) { this.parameters = parameters; if(parameters != null){ putQueryParameter("Parameters", parameters); } } @Override public Class<AlterDatabaseResponse> getResponseClass() { return AlterDatabaseResponse.class; } }
a9e446189b72241d7338c0cc5d428844940f0a21
9821426ca32b707134eee8dbda9ef4ce64a97045
/MiuiSystemUI/raphael/systemui/statusbar/phone/HeadsUpTouchCallbackWrapper.java
a6be640f77683a0c2725cd7df4c218218910c77a
[]
no_license
mooseIre/arsc_compare
a28af8205cc75647b3f6e8c1b3310ca2b2140725
3df667d4e4d4924e11cbcfd9df29346a3c259e32
refs/heads/master
2023-06-21T13:30:23.511293
2021-08-12T15:13:08
2021-08-12T15:13:08
277,633,842
3
3
null
null
null
null
UTF-8
Java
false
false
2,135
java
package com.android.systemui.statusbar.phone; import android.content.Context; import com.android.systemui.statusbar.notification.row.ExpandableView; import com.android.systemui.statusbar.phone.HeadsUpTouchHelper; import kotlin.jvm.internal.Intrinsics; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /* compiled from: MiuiNotificationPanelViewController.kt */ final class HeadsUpTouchCallbackWrapper implements HeadsUpTouchHelper.Callback { private final HeadsUpTouchHelper.Callback base; private final HeadsUpManagerPhone headsUpManagerPhone; private final MiuiNotificationPanelViewController panelView; public HeadsUpTouchCallbackWrapper(@NotNull MiuiNotificationPanelViewController miuiNotificationPanelViewController, @NotNull HeadsUpManagerPhone headsUpManagerPhone2, @NotNull HeadsUpTouchHelper.Callback callback) { Intrinsics.checkParameterIsNotNull(miuiNotificationPanelViewController, "panelView"); Intrinsics.checkParameterIsNotNull(headsUpManagerPhone2, "headsUpManagerPhone"); Intrinsics.checkParameterIsNotNull(callback, "base"); this.panelView = miuiNotificationPanelViewController; this.headsUpManagerPhone = headsUpManagerPhone2; this.base = callback; } @Override // com.android.systemui.statusbar.phone.HeadsUpTouchHelper.Callback public boolean isExpanded() { return this.base.isExpanded() && !(this.headsUpManagerPhone.hasPinnedHeadsUp() && this.panelView.isExpectingSynthesizedDown$packages__apps__MiuiSystemUI__packages__SystemUI__android_common__MiuiSystemUI_core()); } @Override // com.android.systemui.statusbar.phone.HeadsUpTouchHelper.Callback @Nullable public ExpandableView getChildAtRawPosition(float f, float f2) { return this.base.getChildAtRawPosition(f, f2); } @Override // com.android.systemui.statusbar.phone.HeadsUpTouchHelper.Callback @NotNull public Context getContext() { Context context = this.base.getContext(); Intrinsics.checkExpressionValueIsNotNull(context, "base.context"); return context; } }
d9277a75b7059b76dbdc190dd0761681facea069
6d7f162d7512f860f955d28549c340f867c5c157
/DiayDunerProject/Api DiayDoner/Duner/src/main/java/apiControllers/AdminController.java
9290da060a068d51a490b25469b13786eb5db574
[]
no_license
taurus366/DiayDoner
4b8821e1b74b65dbbb84a5e867d0018c5b091af4
cbf3b1aec540c52398be377600b1b36930c40265
refs/heads/master
2022-12-25T08:31:45.054241
2019-12-14T17:34:46
2019-12-14T17:34:46
228,061,230
0
0
null
2022-12-09T22:16:29
2019-12-14T17:25:49
Java
WINDOWS-1251
Java
false
false
5,088
java
package apiControllers; import java.net.URISyntaxException; import java.sql.SQLException; import javax.ws.rs.CookieParam; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.core.NewCookie; import javax.ws.rs.core.Response; import booleanCheck.AdminCheck; import databases.AdminDB; import generators.MD5Generator; import generators.SessionGenerator; @Path("/") public class AdminController { static AdminCheck isAdmin = new AdminCheck(); static SessionGenerator sessionGenerator = new SessionGenerator(); static AdminDB adminDB = new AdminDB(); static MD5Generator genMD5 = new MD5Generator(); @Path("admin/login") @POST public Response adminLogin(@FormParam("name") String name, @FormParam("password") String password) throws URISyntaxException { try { if(isAdmin.checkAdminPassword(name, genMD5.GenerateMd5(password))) { String generatedSession = sessionGenerator.sessionGenerator(); // http://diaydunerservice-env.65m77q8cqk.eu-central-1.elasticbeanstalk.com/rest/admin/login java.net.URI url = new java.net.URI("http://diaydunerservice-env.65m77q8cqk.eu-central-1.elasticbeanstalk.com/admin.jsp"); NewCookie newSession = new NewCookie("myStrAdmin", generatedSession.toString(), "/", "","comment",86400, false); adminDB.putAdminSession(generatedSession); return Response.temporaryRedirect(url).cookie(newSession).build(); } } catch (Exception e) { // TODO: handle exception return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } //diaydoner.000webhostapp.com/login.html java.net.URI url = new java.net.URI("diaydoner.000webhostapp.com/login.html"); return Response.temporaryRedirect(url).build(); } @Path("admin/Adarticle") @POST public Response addArticle(@CookieParam(value = "myStrAdmin") String sessionId,@FormParam("title") String title,@FormParam("price") String price) throws ClassNotFoundException, SQLException, URISyntaxException { if(sessionId == null) { java.net.URI url = new java.net.URI("www.diaydoner.000webhostapp.com/login.html"); // admin panel ! return Response.temporaryRedirect(url).build(); } try { if(isAdmin.isAdminSessionId(sessionId)) { adminDB.addArticle(title, price); }else { String text = "Трябва да се логнете! www.diaydoner.000webhostapp.com/login.html"; return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(text).build(); } } catch (Exception e) { // TODO: handle exception return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } java.net.URI url = new java.net.URI("http://diaydunerservice-env.65m77q8cqk.eu-central-1.elasticbeanstalk.com/admin.jsp"); // admin panel ! return Response.temporaryRedirect(url).build(); } @Path("admin/article") @POST public Response removeArticle(@CookieParam(value = "myStrAdmin") String sessionId,@FormParam("id") String id) throws URISyntaxException { try { adminDB.deleteArticle(id); } catch (Exception e) { // TODO: handle exception return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } if(sessionId == null) { java.net.URI url = new java.net.URI("www.diaydoner.000webhostapp.com/login.html"); return Response.temporaryRedirect(url).build(); } try { if(isAdmin.isAdminSessionId(sessionId)) { adminDB.deleteArticle(id); } else { String text = "Трябва да се логнете! www.diaydoner.000webhostapp.com/login.html"; return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(text).build(); } } catch (Exception e) { // TODO: handle exception return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } java.net.URI url = new java.net.URI("http://diaydunerservice-env.65m77q8cqk.eu-central-1.elasticbeanstalk.com/admin.jsp"); // admin panel ! return Response.temporaryRedirect(url).build(); } @Path("admin/order_id") @POST public Response CompleteOrder(@CookieParam(value = "myStrAdmin") String sessionId,@FormParam("id")String id) throws URISyntaxException { if(sessionId == null) { java.net.URI url = new java.net.URI("www.diaydoner.000webhostapp.com/login.html"); return Response.temporaryRedirect(url).build(); } try { if(isAdmin.isAdminSessionId(sessionId)) { //Should Create DB to remove article-order or order-addres together order-articles! adminDB.deleteOrder(id); } else { String text = "Трябва да се логнете! www.diaydoner.000webhostapp.com/login.html"; return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(text).build(); } } catch (Exception e) { // TODO: handle exception } java.net.URI url = new java.net.URI("http://diaydunerservice-env.65m77q8cqk.eu-central-1.elasticbeanstalk.com/admin.jsp"); // admin panel ! return Response.temporaryRedirect(url).build(); } }
57d2d676c39ef5cbceb9d84030a9d9b9e389d4da
06ae23b23927437bde71a89bd51b05c24e485dbe
/niugraph/src/main/java/com/github/niugraph/model/Vertex.java
0155ab201625b2edeccb467c2514f99a39d38655
[]
no_license
jiangjianbo/niugraph
fb2299d3be2386834ae4447f2b6fbec33eb7b834
9c5a5563ca43b7e8f0b351b4aa32f794e69d9aed
refs/heads/master
2020-03-28T01:26:16.994087
2014-03-17T18:31:20
2014-03-17T18:31:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,414
java
package com.github.niugraph.model; import java.util.Collection; /** * vertex of graph * @author jjb * * @param <E> {@link Edge} type of graph */ public interface Vertex<E> { /** * get all outgoing {@link Edge}s of vertex * @return */ Collection<E> getOutgoingEdges(); /** * get all incoming {@link Edge}s of vertex * @return */ Collection<E> getIncomingEdges(); /** * check edge contains in outgoing or incoming * @param edge * @return */ boolean containsEdge(E edge); /** * check edge contains in outgoing * @param edge * @return */ boolean containsOutgoingEdge(E edge); /** * check edge contains in incoming * @param edge * @return */ boolean containsIncomingEdge(E edge); /** * check connection with vertex, ignore direction * @param peerVertex * @return true for connected and false for none */ boolean isConnect(Vertex<E> peerVertex); /** * check direction from this vertex to target * @param target * @return true for linked to and false for none */ boolean isConnectTo(Vertex<E> target); /** * check direction from source to this vertex * @param source * @return true for linked from and false for none */ boolean isConnectFrom(Vertex<E> source); }
05ac13a4d031f3ef1090f587fa10c4faf171edc1
99b3895cf8926f1549205f33e0a064f26e5662e4
/bioproject/.svn/pristine/05/05ac13a4d031f3ef1090f587fa10c4faf171edc1.svn-base
4fc2238ddaf55b415eaa27a62112086e06b5c468
[]
no_license
marais89/BioPoint
29ba23d99df0e5eed1f4d6bfffe713bb3021ff99
bbb6557f25fb7bbc93ec3b00ab76282c16e8fd02
refs/heads/master
2021-01-12T15:11:49.775834
2016-10-03T12:32:36
2016-10-03T14:19:08
69,874,250
0
0
null
null
null
null
UTF-8
Java
false
false
4,224
package org.bio.model; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Transient; @Entity @Table(name="exportOption") public class ExportOption implements Serializable{ private Map<String,String> listfield; private String selectedfield; private List<String> format; private boolean display; private boolean display2; private int size; private Integer id ; private Exporter exporter; private String selectedFormat; public ExportOption() { listfield = new HashMap<String, String>(); listfield.put("Matricule", "Matricule"); listfield.put("Nom", "Nom"); listfield.put("Prenom", "Prenom"); listfield.put("Jour", "Jour"); listfield.put("Retard Total", "Retard Total"); listfield.put("Retard 1", "Retard1"); listfield.put("Retard 2", "Retard2"); listfield.put("Présence", "Présence"); listfield.put("Pause", "Pause"); listfield.put("Entrée", "Entrée"); listfield.put("Entrée Planifié", "Entrée Planifié"); listfield.put("Sortie", "Sortie"); listfield.put("Sortie Planifié", "Sortie Planifié"); listfield.put("Congé", "Congé"); listfield.put("Autorisation", "Autorisation"); display = true; display2 = true; selectedfield="none"; format = new ArrayList<String>(); } public void findFormat() { } @Transient public List<String> getFormat() { if((selectedfield.equals("Retard Total"))||(selectedfield.equals("Retard1"))||(selectedfield.equals("Retard2"))||(selectedfield.equals("Présence"))||(selectedfield.equals("Pause")) |(selectedfield.equals("Entrée"))||(selectedfield.equals("Entrée Planifié"))|(selectedfield.equals("Sortie"))||(selectedfield.equals("Sortie Planifié"))) { format.clear(); format.add("HH:mm:ss"); format.add("HH-mm-ss"); format.add("HH/mm/ss"); format.add("HH,mm,ss"); format.add("En Minutes"); format.add("En Heures"); format.add("En Secondes"); } else if(selectedfield.equals("Jour")) { format.clear(); format.add("aaaa-mm-jj"); format.add("aaaa/mm/jj"); format.add("aa-mm-jj"); format.add("aa/mm/jj"); format.add("jj-mm-aaaa"); format.add("jj/mm/aaaa"); } else { format.clear(); format.add("En Majiscule"); format.add("En Miniscule"); format.add("En Capital lettre"); } return format; } public void setFormat(List<String> format) { this.format = format; } public void switchDisplay() { display=!display; } public void switchDisplay2() { display2=!display2; } @Transient public Map<String, String> getListfield() { return listfield; } public void setListfield(Map<String, String> listfield) { this.listfield = listfield; } @Column(name="fieldname",length=45) public String getSelectedfield() { return selectedfield; } public void setSelectedfield(String selectedfield) { this.selectedfield = selectedfield; } @Transient public boolean isDisplay() { return display; } public void setDisplay(boolean display) { this.display = display; } @Column(name="formatstyle",length=45) public String getSelectedFormat() { return selectedFormat; } public void setSelectedFormat(String selectedFormat) { this.selectedFormat = selectedFormat; } @Transient public int getSize() { if(format==null) return 0; else if(format.size()==0) return 0; else return format.size(); } public void setSize(int size) { this.size = size; } @Transient public boolean isDisplay2() { return display2; } public void setDisplay2(boolean display2) { this.display2 = display2; } @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "idoption", unique = true, nullable = false) public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "idexporter") public Exporter getExporter() { return exporter; } public void setExporter(Exporter exporter) { this.exporter = exporter; } }
6eeab44bb93ed7986542358a0934d13e10344e6e
40a3d5f4cd6aaa490489bb485f3efb01c72e9c0c
/src/main/database/dao/impl/SaverAccountDaoImpl.java
c299e3b959b92d98934365309a521062e7f46d59
[]
no_license
zolars/bank-system
df6594f57f5d8c0df81066887bd6a80e1b829773
d7fb0ff6f155963033c92ea78c313376f2d33f32
refs/heads/master
2021-11-23T08:35:08.795872
2021-10-27T07:22:14
2021-10-27T07:22:14
185,564,487
0
0
null
null
null
null
UTF-8
Java
false
false
6,008
java
package database.dao.impl; import database.BaseDao; import database.dao.SaverAccountDao; import database.entity.Account; import database.entity.Customer; import database.entity.SaverAccount; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; /** * SaverAccountDaoImpl */ public class SaverAccountDaoImpl extends AccountDaoImpl implements SaverAccountDao { private SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // search for the Credit Status private boolean confirmCreditStatus(String name) { // some process by name return true; } // 1 for success; 0 for existed account; -1 for unavailable credit; public int addAccount(Customer customer) throws IOException { SaverAccount account = new SaverAccount(customer); if (!confirmCreditStatus(account.getCustomer().getName())) { return -1; } else { account.setId(BaseDao.fileCount()); if (!BaseDao.addFile(account.toFileName(), account.toString())) { return 0; } else { BaseDao.addLine("accounts.txt", (BaseDao.fileCount() - 1) + "\t|\tsaver"); return account.getId(); } } } // 1 for success; 0 for no account; -2 for wrong pin; // -3 for suspended; -4 for no order; -5 for ordered notice; // -6 for ordered not due @Override public int addWithdral(int id, int pin, double num) throws IOException { Account account = findAccount(id); if (pin < 0) { return addOrder(id, account.getPin(), num); } if (account == null) { return 0; } if (pin != account.getPin()) { return -2; } if (account.isSuspended()) { BaseDao.addLine(account.toFileName(), BaseDao.dataCount(account.toFileName(), "", 0) + "\t|\t" + "withdral" + "\t|\t" + sf.format(Calendar.getInstance().getTime()) + "\t|\t" + String.format("%-4.2f", account.getAvailableAmount()) + "\t|\t" + String.format("%-4.2f", account.getBalance()) + "\t|\tfrozen"); return -3; } if (account.getAvailableAmount() == 0) { return -4; } try { List<String[]> resultStr = BaseDao.search(account.toFileName(), "order ", 1); String[] result = resultStr.get(resultStr.size() - 1); if (new Date().getTime() - sf.parse(result[2]).getTime() <= 24 * 60 * 60 * 1000) { return -6; } } catch (Exception e) { e.printStackTrace(); } if (num >= 0) { return -5; } num = account.getAvailableAmount(); account.setBalance(account.getBalance() - account.getAvailableAmount()); account.setAvailableAmount(0); if (!BaseDao.replace(account.toFileName(), account.toString())) { return 0; } if (BaseDao.addLine(account.toFileName(), BaseDao.dataCount(account.toFileName(), "", 0) + "\t|\t" + "withdral" + "\t|\t" + sf.format(Calendar.getInstance().getTime()) + "\t|\t" + String .format("%-4.2f", num) + "\t|\t" + String.format("%-4.2f", account.getBalance()) + "\t|\tsuccess")) { return 1; } else { return 0; } } // 1 for success; 0 for no account; -1 for overrun; -2 for wrong pin; // -3 for suspended; -4 for already order ; public int addOrder(int id, int pin, double num) throws IOException { Account account = findAccount(id); if (account == null) { return 0; } if (pin != account.getPin()) { return -2; } if (account.isSuspended()) { BaseDao.addLine(account.toFileName(), BaseDao.dataCount(account.toFileName(), "", 0) + "\t|\t" + "order " + "\t|\t" + sf.format(Calendar.getInstance().getTime()) + "\t|\t" + String .format("%-4.2f", num) + "\t|\t" + String.format("%-4.2f", account.getBalance()) + "\t|\tfrozen"); return -3; } if (account.getAvailableAmount() != 0) { return -4; } // Judge overrun if (account.getBalance() - num + account.getOverdraftLimit() < 0) { BaseDao.addLine(account.toFileName(), BaseDao.dataCount(account.toFileName(), "", 0) + "\t|\t" + "order " + "\t|\t" + sf.format(Calendar.getInstance().getTime()) + "\t|\t" + String .format("%-4.2f", num) + "\t|\t" + String.format("%-4.2f", account.getBalance()) + "\t|\toverrun"); return -1; } account.setAvailableAmount(num); if (!BaseDao.replace(account.toFileName(), account.toString())) { return 0; } if (BaseDao.addLine(account.toFileName(), BaseDao.dataCount(account.toFileName(), "", 0) + "\t|\t" + "order " + "\t|\t" + sf.format(Calendar.getInstance().getTime()) + "\t|\t" + String.format("%-4.2f", account.getAvailableAmount()) + "\t|\t" + String.format("%-4.2f", account.getBalance()) + "\t|\tsuccess")) { return 1; } else { return 0; } } public static void main(String[] args) { SaverAccountDao dao = new SaverAccountDaoImpl(); try { System.out.println(dao.addWithdral(5, 390149, 123)); } catch (IOException e) { e.printStackTrace(); } } }
d3592326c0a03605635f83c630bde68c966e35a8
eaf2920c4c1dbd0596358a277a90d50426430c3b
/src/main/java/com/qa/pages/SearchPage.java
6adca69f6fdc66f5c67528b362788c8bd22e93d6
[]
no_license
kichha123/Demo1Repo
7a618217176ba25537086fc4ba2b1568bb13d1a3
744282b37b1d8e3e01e2dd572cdaa78ab8e731dd
refs/heads/master
2022-06-04T22:14:30.447642
2019-07-02T07:57:28
2019-07-02T07:57:28
194,800,982
0
0
null
2022-05-20T21:01:19
2019-07-02T06:22:48
Java
UTF-8
Java
false
false
157
java
package com.qa.pages; public class SearchPage { public void searchPage() { System.out.println("this is search method of search page"); } }
ee02467c45726e1b543ba0a9690b8423c77de084
0b85c646f35243bb90ebad968fdde3e55dc958c4
/src/net/moppletop/gamemanager/eventhandler/EventHandler.java
07b9269a345386dabdc8e21a51aa8014da9ef340
[]
no_license
OldAI/Planetary-Plunder
a35be512fca95d87f5add8de0509a1067de6d02e
73f00b12cf26a376228075c8380b38a7e919d805
refs/heads/master
2021-01-18T05:27:36.035261
2015-01-12T21:37:38
2015-01-12T21:37:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package net.moppletop.gamemanager.eventhandler; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target({java.lang.annotation.ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface EventHandler { EventPriority priority() default EventPriority.NORMAL; boolean ignoreCancelled() default false; }
73c3b26533c2abda85d8e2429c33133112f2c856
79cd3695226ad33d988ba25eed49b92855990159
/src/com/program_in_chinese/定制监听器.java
4e42505755f19fb5b74b476eed19c7b2074cb185
[]
no_license
tangfengray/quan2
cb6b5441b31448d2383584b0a2a9cb9667c3f95c
f528061cad8267d886d908bdbb86b879ea8122c3
refs/heads/master
2020-06-17T13:22:25.022599
2017-12-29T20:38:23
2017-12-29T20:38:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,694
java
package com.program_in_chinese; import static com.program_in_chinese.圈2Parser.加Context; import static com.program_in_chinese.圈2Parser.赋值Context; import static com.program_in_chinese.圈2Parser.打印Context; import java.util.HashMap; import java.util.Map; public class 定制监听器 extends 圈2BaseListener { private Map<String, Integer> 变量表; public 定制监听器() { 变量表 = new HashMap<>(); } @Override public void exit赋值(赋值Context 上下文) { // 赋值语句分析结束时运行此方法 String 变量名 = 上下文.标识符(0).getText(); // 如果语句中有两个变量(标识符), 那么取第二个变量的值, 否则取数的值 int 值 = 上下文.标识符().size() > 1 ? 变量表.get(上下文.标识符(1).getText()) : Integer.parseInt(上下文.T数().getText()); // 更新变量值 变量表.put(变量名, 值); } @Override public void exit加(加Context 上下文) { // 加语句分析结束时运行此方法 String 变量名 = 上下文.标识符().size() > 1 ? 上下文.标识符(1).getText() : 上下文.标识符(0).getText(); int 添加值 = 上下文.标识符().size() > 1 ? 变量表.get(上下文.标识符(0).getText()) : Integer.parseInt(上下文.T数().getText()); 变量表.put(变量名, 变量表.get(变量名) + 添加值); } @Override public void exit打印(打印Context 上下文) { // 打印语句分析结束时运行此方法 String 输出 = 上下文.标识符() == null ? 上下文.T数().getText() : 变量表.get(上下文.标识符().getText()).toString(); System.out.println(输出); } }
2ec941ab097bd56d2e828a9ac9d7e2691e0d88bb
c7872978380cf768450183c214be2f2516071691
/src/main/java/com/example/controller/OrderMasterController.java
05ac39222546a9bdda263508700073b4e5510bfa
[]
no_license
MwGitHub2019/wxdc
7fd72350ca5bd09caeddeab01dd3662fbb76a877
2d8f89f18593eb016ac63baae87d720d1f38d1cd
refs/heads/master
2020-05-14T16:30:39.425566
2019-04-17T11:02:48
2019-04-17T11:02:48
181,873,760
0
0
null
null
null
null
UTF-8
Java
false
false
1,735
java
package com.example.controller; import com.example.common.ResultResponse; import com.example.dto.OrderMasterDto; import com.example.service.OrderMasterService; import com.example.util.JsonUtil; import com.google.common.collect.Maps; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @RestController @RequestMapping("buyer/order") @Api(value = "订单相关接口",description = "完成订单的增删改查") public class OrderMasterController { @Autowired private OrderMasterService orderMasterService; @RequestMapping("/create") @ApiOperation(value = "创建订单",httpMethod = "POST",response = ResultResponse.class) public ResultResponse create(@Valid @ApiParam(name = "订单对象",value = "传入json格式",required = true) OrderMasterDto orderMasterDto, BindingResult bindingResult){ //创建Map Map<String,String> map = Maps.newHashMap(); //判断参数是否有误 if (bindingResult.hasErrors()){ List<String> collect = bindingResult.getFieldErrors().stream().map(err -> err.getDefaultMessage()).collect(Collectors.toList()); map.put("参数校验异常", JsonUtil.object2string(collect)); return ResultResponse.fail(map); } return orderMasterService.insterOrder(orderMasterDto); } }
b332c70c3ce3cd2cd151e4841414739abbfcc958
36e649cb326402a23a1a38e72ac1e765329d9315
/Android/DesTools/des/src/androidTest/java/com/jni/utils/des/ExampleInstrumentedTest.java
7c7622aac8f534e73f8173674487b16e88c27cc3
[]
no_license
yanglw115/Softwares
6d844818bbf99271137cc41c64c8636a9a560f8a
d6772bd1ba89d44a134e396ce9ed8221f40a271f
refs/heads/master
2021-12-09T19:22:13.273159
2020-03-29T02:42:08
2020-03-29T02:42:08
139,205,287
2
6
null
null
null
null
UTF-8
Java
false
false
761
java
package com.jni.utils.des; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * 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() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.jni.utils.des", appContext.getPackageName()); } }
[ "yanglw115@fdc7a43b-4700-4cfd-aa5a-fbf62e556ab2" ]
yanglw115@fdc7a43b-4700-4cfd-aa5a-fbf62e556ab2
98e8232651081ad7d8a391059dd7892ea71fc2cd
e023d5c2f895b8002831c2709badaab82c6d0785
/src/com/dsa/array/RemoveMultipleOccurrence.java
92d1d0c7e6c5c87bfeeea9869f157ac9aba9ad60
[]
no_license
rupambika/Arrays
155a1618c01c8f35ab0280f6c5b653f1f2587ad9
1a42b3fd9a4997bfacfe1a2ec928fc84da3ec909
refs/heads/master
2023-01-09T16:10:21.450168
2020-11-09T16:21:13
2020-11-09T16:21:13
311,397,790
0
0
null
null
null
null
UTF-8
Java
false
false
512
java
package com.dsa.array; public class RemoveMultipleOccurrence { public static void main(String[] args) { int arr[] = { 1, 2, 2, 5, 5, 5, 4, 4, 4, 4, 4, 6, 6 }; // O\P = {1,2,5,4,6} removeMulti(arr); } public static void removeMulti(int arr[]) { int arr2[] = new int[arr.length]; int j = 0; for (int i = 0; i < arr.length-1; i++) { if (arr[i] != arr[i + 1]) { arr2[j] = arr[i]; j++; } } arr2[j]= arr[arr.length-1]; for (int a : arr2) { System.out.println(a + "\n"); } } }
286cd823cd28b75419bd883248a9afd9ed2e9c88
eba01a2bf91141b134bb06d420384d9d1cee4de9
/src/main/java/xyz/yyaos/demo/entity/user/User.java
400b76e3fc604869eb1cfb3b47158b4b4f3d5d90
[]
no_license
yaoyaosen/demo
cdb1a79f01bcfe948529588dd0c38a5f4477d5d6
4296ad81eee95e53e48958054bfb830461d12b15
refs/heads/master
2021-04-16T06:33:07.205393
2020-04-16T12:44:45
2020-04-16T12:44:45
249,334,611
0
0
null
null
null
null
UTF-8
Java
false
false
500
java
package xyz.yyaos.demo.entity.user; import lombok.Data; import java.util.Date; /** * 用户 */ @Data public class User { /** * id */ private String id; /** * 名称 */ private String name; /** * 头像 */ private String img; /** * 性别 */ private Integer gender; /** * 简介 */ private String summary; /** * 电话 */ private String phone; /** * 创建时间 */ private Date createDate; /** * 修改时间 */ private Date updateDate; }
ce65f07df1e6cfe52c2ea3a9d0cb5f193a8c0bee
7e6860768e6d124ba041c896d7122b7faef4f5eb
/1_ThreadsAndLocks/src/main/java/day3/wordcount/v3_wordcount_synchronized_hashmap/Counter.java
e2cab8c342c2ce466f94d7bf4d54513dc2fdb366
[]
no_license
LukasWoodtli/SevenConcurrencyModelsInSevenWeeks
0567e6c6eb2eb0eed94f3acd997ed0b2bebe271d
57d40b9b495f0e491b98b26fcd6f149482eeff4b
refs/heads/master
2021-07-14T15:53:23.803002
2021-03-24T13:37:15
2021-03-24T13:37:15
28,269,669
0
1
null
null
null
null
UTF-8
Java
false
false
1,513
java
package day3.wordcount.v3_wordcount_synchronized_hashmap; import day3.wordcount.common.Page; import day3.wordcount.common.Words; import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.concurrent.locks.ReentrantLock; public class Counter implements Runnable { private BlockingQueue<Page> queue; private Map<String, Integer> counts; private static ReentrantLock lock; public Counter(BlockingQueue<Page> queue, Map<String, Integer> counts) { this.queue = queue; this.counts = counts; lock = new ReentrantLock(); } public void run() { try { while (true) { Page page = queue.take(); if (page.isPoisonPill()) { System.out.println("Poison pill consumed. Thread: " + this); break; } Iterable<String> words = new Words(page.getText()); for (String word: words) { countWord(word); } } } catch (Exception e) { e.printStackTrace(); } } private void countWord(String word) { lock.lock(); try { Integer currentCount = counts.get(word); if (currentCount == null) { counts.put(word, 1); } else { counts.put(word, currentCount + 1); } } finally { lock.unlock(); } } }
fe70cb341cbeec2c4130c2f41440ba051e9fd3a2
b89548ab5bda5d0594fa9131ab3657cef789f167
/SpringMVCDemo/src/cn/com/pers/utils/BeanUtil.java
04c159e4cef2c6be6cabbe287efa9afb671e8150
[]
no_license
xplx/SpringCode
1276216812e6c5bcc4503a0bddbac8d11ce6a446
6bb3b6f98ace2fe43b0e1a3529d3e6daa20779f9
refs/heads/master
2021-05-14T18:36:03.921147
2018-01-31T08:01:34
2018-01-31T08:01:34
116,078,483
0
0
null
null
null
null
UTF-8
Java
false
false
1,051
java
package cn.com.pers.utils; /** * 对象常用方法工具类 * * @author WJ */ public final class BeanUtil { /** * 此类不需要实例化 */ private BeanUtil() { } /** * 判断对象是否为null * * @param object 需要判断的对象 * @return 是否为null */ public static boolean isNull(Object object) { return null == object; } /** * 判断对象是否不为null * * @param object 需要判断的对象 * @return 是否不为null */ public static boolean nonNull(Object object) { return null != object; } /** * 判断对象是否为空,如果为空,直接抛出异常 * * @param object 需要检查的对象 * @param errorMessage 异常信息 * @return 非空的对象 */ public static Object requireNonNull(Object object, String errorMessage){ if (null == object) { throw new NullPointerException(errorMessage); } return object; } }
63eac90c71d26d6f2796f9dc77e4c113bedd8a25
9c7d1e5d606f61247ade6f03ac6f863983d4bed9
/source/WEB-INF/classes/com/jada/service/SimpleAction.java
0cf047ccb449658b58c74f4d61762f1206a689da
[]
no_license
langtianya/JadaSite
96dcc9d3873ae32ee4fdfc0f74f258d548194312
db50635cc77d0fdb99221b98fd8657e3ebf7e56c
refs/heads/master
2021-01-17T14:35:16.588822
2016-09-04T06:13:13
2016-09-04T06:13:13
67,328,699
0
1
null
2016-09-04T06:07:46
2016-09-04T06:07:45
null
UTF-8
Java
false
false
2,455
java
/* * Copyright 2007-2010 JadaSite. * This file is part of JadaSite. * JadaSite is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * JadaSite is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with JadaSite. If not, see <http://www.gnu.org/licenses/>. */ package com.jada.service; import javax.persistence.EntityManager; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.jada.jpa.connection.JpaConnection; public abstract class SimpleAction extends Action { Logger logger = Logger.getLogger(SimpleAction.class); public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { ActionForward forward = null; EntityManager em = null; try { em = JpaConnection.getInstance().getCurrentEntityManager(); em.getTransaction().begin(); process(actionMapping, actionForm, request, response); em.getTransaction().commit(); } catch (Throwable ex) { logger.error("Exception encountered in " + actionMapping.getName()); logger.error("Exception", ex); forward = actionMapping.findForward("exception"); } finally { if (em.isOpen()) { if (em.getTransaction().isActive()) { em.getTransaction().rollback(); } } em.close(); } return forward; } abstract public ActionForward process(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception; }
a1defc083ea7a3fad0c055ca852aab88cdb7f881
cdd225e1f15916327cc00277a97f6dccd4953057
/staticBlock.java
73078e0439c1d0b30cfd3ccb71b241fddf6bdbbb
[]
no_license
alexi001/assignment_6
ed6772332ea40bac70e306292a8aba4c1e7814a2
c61a7cc9b6a317859840725fe346ef10a910f9af
refs/heads/master
2020-03-27T04:26:59.971670
2018-08-29T03:44:33
2018-08-29T03:44:33
145,940,663
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
class abc{ static int i; abc(int x){ super(); i=x; System.out.println(i); } static{ System.out.println("This is a static block"); } } class staticBlock{ public static void main(String args[]){ abc obj=new abc(10); } }
a677450fb9c10aca8c10e984cd54801e319149f8
8005a4573346456721b2da81a024153ff71a002e
/src/sepm/ss17/e1228930/dao/DBManager.java
07208eec6698ed6ac61b629cab959746d4aa61fd
[]
no_license
rasmina/Einzelbeispiel
a1d89c23c5da1c6a03953010b1e5a56c71f13d1a
0ff1148935ef993f067d5f5c7ae867c013ffd3e4
refs/heads/master
2020-12-30T16:02:59.373135
2017-05-11T09:16:23
2017-05-11T09:16:23
90,959,773
0
0
null
null
null
null
UTF-8
Java
false
false
1,442
java
package sepm.ss17.e1228930.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; //singleton public class DBManager { private static Connection singleCon; private static final Logger logger = LoggerFactory.getLogger(DBManager.class); private DBManager(){} public static Connection getInstance(){ //if the connection was not made before try to make a new one if(singleCon==null){ try{ Class.forName("org.h2.Driver"); logger.debug("Loading driver successful!"); }catch (Exception e){ logger.debug("Loading driver failed!"); e.printStackTrace(); } try{ singleCon= DriverManager.getConnection("jdbc:h2:tcp://localhost/~/pferdepension", "sa", ""); logger.debug("Connection to H2 Database successful!"); }catch (SQLException s){ logger.debug("Connection to H2 Database failed!"); s.printStackTrace(); } } //return the only existent connection to the database return singleCon; } public void close() throws Exception{ if(singleCon!=null && !singleCon.isClosed()) singleCon.close(); logger.debug("Connection to H2 Database closed successfully!"); } }
a23357f746e319f928f3ea1bdff0e291bb3c939c
68871d82209187096274eb8013376985ed9f1831
/src/main/java/ru/luvas/physics/cw1/entity/Text.java
ab0f1ef39d05b0afccd3a53bbe3e6b72f0227394
[]
no_license
RinesThaix/PhysicsCW1
b70b32204d1e2f8bd7b87067761af30537906b1f
791573bbfb3280ba9a7227ea7dcf2d651a32c9d2
refs/heads/master
2020-06-17T20:45:10.406181
2016-12-27T23:18:43
2016-12-27T23:18:43
74,970,832
0
0
null
null
null
null
UTF-8
Java
false
false
840
java
package ru.luvas.physics.cw1.entity; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; /** * * @author RINES <[email protected]> */ public class Text extends Colored { private String text; private int size; public Text(int x, int y, String text, Color color, int size) { super(x, y, color); this.text = text; this.size = size; } public String getText() { return text; } public int getSize() { return size; } public void setText(String text) { this.text = text; } public void setSize(int size) { this.size = size; } @Override public void draw(Graphics2D g) { super.draw(g); g.setFont(new Font("Arial", 0, size)); g.drawString(text, x, y); } }
8a8c1f49591571bedffaf623a101838de177ee0d
0c23ed20a42b97fa58f5576b30088fb4e6d68bec
/src/main/java/com/tec/anji/binding/primitive/Main3.java
57fffd3f454817264b58d224a22ac9a45df2e184
[]
no_license
wangxqdev/javafx
460e678f34fb9bc4f7fee76b4ebe58f74f3256dd
860d002c8271ef61cf6cc4ff8e39663f915acc67
refs/heads/master
2020-12-14T21:11:42.015783
2020-02-20T06:28:08
2020-02-20T06:28:08
234,869,709
0
0
null
2020-10-13T18:56:57
2020-01-19T09:01:37
Java
UTF-8
Java
false
false
1,459
java
package com.tec.anji.binding.primitive; import javafx.application.Application; import javafx.beans.property.DoubleProperty; import javafx.beans.property.IntegerProperty; import javafx.beans.property.SimpleDoubleProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.TextField; import javafx.scene.control.TextFormatter; import javafx.scene.layout.VBox; import javafx.stage.Stage; import javafx.util.converter.IntegerStringConverter; /** * Bidirectional */ public class Main3 extends Application { @Override public void start(Stage primaryStage) throws Exception { Button button = new Button("Button"); TextField textField = new TextField(); VBox root = new VBox(textField, button); root.setStyle("-fx-spacing: 10px; -fx-padding: 10px"); IntegerProperty factor = new SimpleIntegerProperty(2); button.prefWidthProperty().bind(root.widthProperty().divide(factor)); button.prefHeightProperty().bind(root.heightProperty().divide(factor)); textField.setTextFormatter(new TextFormatter<>(new IntegerStringConverter())); textField.textProperty().addListener((observable, oldValue, newValue) -> factor.set(Integer.parseInt(newValue))); primaryStage.setScene(new Scene(root, 500, 400)); primaryStage.setTitle("Bidirectional"); primaryStage.show(); } }
f20368e2749d3fc2cfc81159ebd8f935864d2e66
63011b0d7fabbf715f018f019fe1c3ca245c8ada
/src/main/java/com/minejunkie/junkiepass/commands/GiveChallengeCommand.java
ef308dda3f192a7272f7044b416692fab06074e6
[]
no_license
Minertainment/JunkiePass
8fabb6f4785d9251153f48e50843e7ec2fef1de6
cff2caffe465fc0319573e04e7f22cfde2c3c4be
refs/heads/master
2022-02-10T06:32:14.378562
2019-08-05T08:48:24
2019-08-05T08:48:24
136,778,918
0
0
null
null
null
null
UTF-8
Java
false
false
3,463
java
package com.minejunkie.junkiepass.commands; import com.minejunkie.junkiepass.JunkiePass; import com.minejunkie.junkiepass.challenges.Challenge; import com.minejunkie.junkiepass.challenges.ChallengeType; import com.minejunkie.junkiepass.profiles.JunkiePassProfile; import com.minertainment.athena.Athena; import com.minertainment.athena.commands.CommandContext; import com.minertainment.athena.commands.Permission; import com.minertainment.athena.commands.bukkit.AthenaBukkitCommand; import com.minertainment.athena.commands.exceptions.CommandException; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class GiveChallengeCommand extends AthenaBukkitCommand { private JunkiePass plugin; // Tester for giving daily challenges only. public GiveChallengeCommand(JunkiePass plugin) { super("givechallenge", "/givechallenge <challenge> (player)", "Gives a challenge to a player.", new Permission("junkiepass.givechallenge"), "givechal"); this.plugin = plugin; Athena.getCommandManager().registerCommand(this); } @Override public void onCommand(CommandSender sender, CommandContext args) throws CommandException { if (args.argsLength() == 0 || args.argsLength() > 2) { sender.sendMessage("Available challenges: " + plugin.getChallengeManager().getChallengesString(ChallengeType.DAILY)); throw new CommandException(ChatColor.RED + "Usage: " + getUsage()); } if (args.argsLength() == 1) { Player player; if ((player = Bukkit.getPlayer(args.getString(0))) == null) throw new CommandException(ChatColor.RED + "Player not found."); JunkiePassProfile profile = plugin.getProfileManager().getProfile(player.getUniqueId()); Challenge challenge = plugin.getChallengeManager().addRandomDailyChallenge(profile); if (challenge == null) { throw new CommandException(ChatColor.RED + player.getName() + " has too many active challenges."); } else { player.sendMessage(plugin.getPrefix() + ChatColor.GRAY + ChatColor.ITALIC.toString() + "You have been given the " + ChatColor.GOLD + ChatColor.BOLD.toString() + challenge.getName() + "."); } } if (args.argsLength() == 2) { Challenge challenge; if ((challenge = plugin.getChallengeManager().containsChallenge(ChallengeType.DAILY, args.getString(0))) == null) { sender.sendMessage("Available challenges: " + plugin.getChallengeManager().getChallengesString(ChallengeType.DAILY)); throw new CommandException(ChatColor.RED + "Challenge not found."); } Player player; if ((player = Bukkit.getPlayer(args.getString(1))) == null) throw new CommandException(ChatColor.RED + "Player not found."); if (plugin.getChallengeManager().addChallenge(plugin.getProfileManager().getProfile(player.getUniqueId()), challenge.getClass())) { player.sendMessage(plugin.getPrefix() + ChatColor.GRAY + ChatColor.ITALIC.toString() + "You have been given the " + ChatColor.GOLD + ChatColor.BOLD.toString() + challenge.getName() + "."); } else throw new CommandException(ChatColor.RED + player.getName() + " has too many active challenges or is already participating in the challenge."); } } }
02109c32c5ef29d564dd3d3144afb9fc6171f8e2
043703eaf27a0d5e6f02bf7a9ac03c0ce4b38d04
/subject_systems/Struts2/src/struts-2.5.2/src/core/src/main/java/org/apache/struts2/views/freemarker/tags/TextModel.java
f49715da88b5d351351070dd2eb6cb369cc73147
[]
no_license
MarceloLaser/arcade_console_test_resources
e4fb5ac4a7b2d873aa9d843403569d9260d380e0
31447aabd735514650e6b2d1a3fbaf86e78242fc
refs/heads/master
2020-09-22T08:00:42.216653
2019-12-01T21:51:05
2019-12-01T21:51:05
225,093,382
1
2
null
null
null
null
UTF-8
Java
false
false
129
java
version https://git-lfs.github.com/spec/v1 oid sha256:6234e3b250457ae26ec280120aa6eb940d7c34c4747dad3ed1142fad01935c3f size 1416
33aa8f9c94d939dec647b16160d02299814013f3
432f6473e6be5af23beeca0bd86c11b1c7198495
/src/main/java/com/penguin/penguincoco/lib/judge/PythonJudger.java
ef12f52d5b5ebe8976294d0544ef6ca4b9cab37f
[]
no_license
penguin-coco/PenguinCoCoBE
36d66408daa2fe6e4c97de9573b98bcf7dff97f8
0fc1022a9ef166e1439eb2f4c6dcba21df3dc1ee
refs/heads/master
2021-06-18T20:19:31.528925
2020-01-18T09:02:57
2020-01-18T09:02:57
205,515,964
2
0
null
2021-04-26T19:28:08
2019-08-31T08:11:17
Java
UTF-8
Java
false
false
601
java
package com.penguin.penguincoco.lib.judge; import com.penguin.penguincoco.lib.model.JudgeData; import com.penguin.penguincoco.lib.model.JudgeReport; import com.penguin.penguincoco.lib.model.Language; import com.penguin.penguincoco.lib.model.PythonCommand; public class PythonJudger extends Judger { public PythonJudger(JudgeData judgeData) { this.judgeData = judgeData; judgeData.setCommand(new PythonCommand()); } @Override public JudgeReport performJudge() { executor = new Executor(judgeData, Language.PYTHON); return executor.execute(); } }
eaf235c7f447e345a7488b765f068333c8ad8b2e
f0c5e953731e47acb6235a25a0239434bf935642
/Proj_CardGame_Socket/src/ChatWithGame/PersonInfo.java
b6b0a80a5fb45e4dc8bd7bff3ebb92abba8b8db1
[]
no_license
kingkwung/MyProject
e2e08cf1f6c3993312a0288717d638d4c2582a99
855eaf89278e6c4d53e25a2cf372f39329f73124
refs/heads/master
2021-01-10T08:22:21.644679
2015-10-21T05:08:06
2015-10-21T05:08:06
44,615,679
0
0
null
null
null
null
UHC
Java
false
false
2,878
java
package ChatWithGame; import java.io.Serializable; import java.util.Calendar; import java.util.Date; public class PersonInfo implements Serializable{ private String ID; private String password; private String name; private String Sex; private String major; private String StudentNum; private String phoneNum; private String ImagePath; private int GameMoney; private int WinNum; private int LooseNum; private String LastestAccessDate; public PersonInfo(String id,String pw, String theName, String sex, String maj, String sn, String pn, String imgpath){ ID = id; password = pw; name = theName; Sex = sex; major = maj; StudentNum = sn; phoneNum = pn; GameMoney = 10000000; WinNum = LooseNum = 0; LastestAccessDate = null; ImagePath = "D:/SUTTA/UserImg/" + ID + "." + imgpath; } public String getID(){return ID;} public String getPassword(){return password;} public String getName(){return name;} public String getSexString(){return Sex;} public String getMajor(){return major;} public String getStudentNum(){return StudentNum;} public String getPhoneNum(){return phoneNum;} public String getImgPath(){return ImagePath;} public int getGameMoney(){return GameMoney;} public int getWinNum(){return WinNum;} public int getLooseNum(){return LooseNum;} public void setID(String iD){ID = iD;} public void setPassword(String pw){password = pw;} public void setName(String na){na = name;} public void setSex(String sex){Sex = sex;} public void setMajor(String maj){major = maj;} public void setStudentNum(String sNum){StudentNum = sNum;} public void setPhoneNum(String pNum){phoneNum = pNum;} public void setGameMoney(int gm){GameMoney = gm;} public void setWinNum(int win){WinNum = win;} public void setLooseNum(int loose){LooseNum = loose;} public String getWinRate(){ if(WinNum==0 && (LooseNum==0||WinNum==1)) return "0%"; String returnValue = (""+(double)WinNum/(WinNum+LooseNum)*100); return returnValue.substring(0, returnValue.indexOf("."))+"%"; } public String getStringMoney() { int intMoney = GameMoney; String stringMoney = ""; if (intMoney >= 1000000) { stringMoney += Integer.toString(intMoney / 1000000); stringMoney += "억 "; intMoney = intMoney % 1000000; } if (intMoney >= 100000) { stringMoney += Integer.toString(intMoney / 100000); stringMoney += "천 "; intMoney = intMoney % 100000; } if (intMoney >= 10000) { stringMoney += Integer.toString(intMoney / 10000); stringMoney += "백 "; intMoney = intMoney % 10000; } return stringMoney+"만원"; } public void updateAccessDate(){ Date date = Calendar.getInstance().getTime(); LastestAccessDate = date.getMonth()+"/"+date.getDate()+"/"+date.getHours()+":"+date.getMinutes(); } }
3739b03700f65ded1ef303eadbf3bf068573ecac
a8d5e1c3ce10a1f3afda7f668a58771ec1170887
/後端微服務API/DWWorkOrder/workorder-service-impl-dwworkorder/src/main/java/com/digiwin/workorder/dwworkorder/service/impl/DBConstants.java
2536af306354f5ef6b54f01611413d52cc6604c0
[]
no_license
ben802115451/ChenBoMin
b236e4c14886316ffce3e5a27a6b98f7a9df621a
35de19fbce472b5d668ed3d8b20bd2ee709a1559
refs/heads/master
2023-03-01T11:16:43.197235
2021-02-17T02:20:23
2021-02-17T02:20:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,530
java
package com.digiwin.workorder.dwworkorder.service.impl; import com.digiwin.utils.DWTenantUtils; /** * data base constants * * @author falcon */ final class DBConstants { static final String tenantSqlTag = DWTenantUtils.getTenantTagByColumnName(); //default:${tenantsid} // 資料表 static final String WORK_ORDER_TYPE = "work_order_type"; static final String WORK_ORDER_SERVICE_TYPE = "work_order_service_type"; static final String WORK_ORDER_ENGINEER = "work_order_engineer"; // 欄位 // 工單服務別表 static final String SERVICE_NAME = "service_name"; static final String SERVICE_ID = "service_id"; static final String SEQUENCE = "sequence"; //工單類型表 static final String WORK_TYPE_NAME = "type_name"; static final String WORK_TYPE_ID = "type_id"; static final String SERVICE_TYPE = "service_type"; static final String SERVICE_TYPE_ID = "service_type_id"; static final String CREATE_BY_USERID = "create_by_userId"; static final String ENGINEER = "assignee"; // 工程人員表 static final String MAIL = "email"; static final String ENGINEER_NAME = "assignee_name"; static final String ENGINEER_ID = "assignee_id"; static final String START_TIME = "start_time"; static final String END_TIME = "end_time"; static final String IS_PRINCIPAL = "isPrincipal"; public static final String SELECT_FROM_WORK_ORDER_ENGINEER = " SELECT count('isPrincipal') FROM work_order_engineer WHERE isPrincipal = '1' AND type_id = ? "; public static final String UPDATE_TO_UNPRINCIPAL = " UPDATE work_order_engineer SET isPrincipal = '0' ${mgmtFieldUpdateColumns} WHERE type_id = ? "; public static final String UPDATE_TO_PRINCIPAL = " UPDATE work_order_engineer SET isPrincipal = '1' ${mgmtFieldUpdateColumns} WHERE type_id = ? AND assignee_id = ? "; //for工單類型查詢用SQL public static final String SELECT_ORDER_TYPE_AND_ENGINEER = " SELECT order_type.service_type_id, order_type.service_type, " + " order_type.type_id, order_type.type_name, order_type.sequence, " + " order_type.create_by_id, order_type.create_by_userId, order_type.create_date, " + " engineer.assignee_id, engineer.assignee_name, engineer.email, engineer.isPrincipal " + " FROM work_order_type AS order_type JOIN work_order_engineer AS engineer " + " ON order_type.type_id = engineer.type_id WHERE 1=1 "; //for工單類型查詢用SQL public static final String SELECT_ORDER_TYPE_AND_ENGINEER_2 = " SELECT order_type.service_type_id, order_type.service_type, " + " order_type.type_id, order_type.type_name, order_type.sequence, " + " order_type.create_by_id, order_type.create_by_userId, order_type.create_date " + " FROM work_order_type AS order_type WHERE 1=1 "; public static final String SELECT_WORK_ORDER_TYPE_ALL_DATA = " SELECT * FROM work_order_type " + tenantSqlTag; public static final String SQL_ORDER_BY = "order by m.tenantid asc, m.create_date asc"; public static final String SQL_LIMIT = "LIMIT ?, ?"; public static final String GROUP_BY = " GROUP BY order_type.type_id "; //for別名用 public static final String WORK_ORDER_TYPE_ALIAS = "order_type."; public static final String WORK_ORDER_ENGINEER_ALIAS = "engineer."; }
f4468ff2abaf10532200d8e74b869ba019a731d8
3336c692fcfab64e14cae25809225aaf622500dc
/service-core/src/main/java/com/atguigu/srb/core/pojo/entity/BorrowInfo.java
407f729cdf96d60736b2a5d5e57d7f45b900a1c8
[]
no_license
caozheng0401/srb
b6185f40280d5be07f90cc75144340f52c3120e1
dc33531725bce96a2f5b9601281a0448862dada0
refs/heads/main
2023-04-14T18:34:37.987178
2021-04-27T08:22:52
2021-04-27T08:22:52
359,733,025
0
0
null
null
null
null
UTF-8
Java
false
false
1,914
java
package com.atguigu.srb.core.pojo.entity; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; /** * <p> * 借款信息表 * </p> * * @author CaoZheng * @since 2021-04-18 */ @Data @EqualsAndHashCode(callSuper = false) @ApiModel(value="BorrowInfo对象", description="借款信息表") public class BorrowInfo implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "编号") @TableId(value = "id", type = IdType.AUTO) private Long id; @ApiModelProperty(value = "借款用户id") private Long userId; @ApiModelProperty(value = "借款金额") private BigDecimal amount; @ApiModelProperty(value = "借款期限") private Integer period; @ApiModelProperty(value = "年化利率") private BigDecimal borrowYearRate; @ApiModelProperty(value = "还款方式 1-等额本息 2-等额本金 3-每月还息一次还本 4-一次还本") private Integer returnMethod; @ApiModelProperty(value = "资金用途") private Integer moneyUse; @ApiModelProperty(value = "状态(0:未提交,1:审核中, 2:审核通过, -1:审核不通过)") private Integer status; @ApiModelProperty(value = "创建时间") private LocalDateTime createTime; @ApiModelProperty(value = "更新时间") private LocalDateTime updateTime; @ApiModelProperty(value = "逻辑删除(1:已删除,0:未删除)") @TableField("is_deleted") @TableLogic private Boolean deleted; }
6c595679e115fe33701239ecbdfbb7dd59b6351a
b71a250c31025d11708352e951beba8b3ff47f7c
/app/src/main/java/com/yuan/rxokhttp/QQParam.java
03e7760aae30277a9b036c97b919fcec54536774
[]
no_license
PMMKing/RxOkhttp
8d78da303ef727ae8a07ed209e8f3e977c071f3d
8d1930c19c466d123ae85b8cb754005177230e3e
refs/heads/master
2020-03-22T19:25:56.759177
2018-07-13T08:47:09
2018-07-13T08:47:09
140,527,108
0
0
null
null
null
null
UTF-8
Java
false
false
310
java
package com.yuan.rxokhttp; import com.yuan.library.base.BaseParam; /** * Created by shucheng.qu on 2018/7/13 */ public class QQParam extends BaseParam{ public String showapi_appid = "48527"; public String showapi_sign = "8a664492b3d94c51b09f0fd36fbc52f5"; public String qq = "91735485456"; }
3becb6cf5c284e99efff4f520613fdc8b556477d
d0094eec897f6cf935fae911d85366d6da216535
/src/main/java/com/vmware/vim25/DeviceNotSupported.java
155f4ab842aae56aeb1525f8122b23cf0c657118
[ "BSD-3-Clause" ]
permissive
darkedges/vijava
9e09798f8cfc61ec28a7a214e260f464c26e4531
c65a731a25aa41d96e032271496f2464a8aa6fe9
refs/heads/main
2023-04-20T10:41:43.931180
2021-05-22T00:03:58
2021-05-22T00:03:58
369,026,457
0
0
null
null
null
null
UTF-8
Java
false
false
2,586
java
package com.vmware.vim25; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for DeviceNotSupported complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="DeviceNotSupported"> * &lt;complexContent> * &lt;extension base="{urn:vim25}VirtualHardwareCompatibilityIssue"> * &lt;sequence> * &lt;element name="device" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="reason" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DeviceNotSupported", propOrder = { "device", "reason" }) @XmlSeeAlso({ DeviceControllerNotSupported.class, MultiWriterNotSupported.class, DigestNotSupported.class, VMINotSupported.class, VirtualEthernetCardNotSupported.class, RemoteDeviceNotSupported.class, FileBackedPortNotSupported.class, VirtualDiskModeNotSupported.class, SharedBusControllerNotSupported.class, DeviceBackingNotSupported.class, RawDiskNotSupported.class, NonPersistentDisksNotSupported.class, RDMNotSupported.class }) public class DeviceNotSupported extends VirtualHardwareCompatibilityIssue { @XmlElement(required = true) protected String device; protected String reason; /** * Gets the value of the device property. * * @return * possible object is * {@link String } * */ public String getDevice() { return device; } /** * Sets the value of the device property. * * @param value * allowed object is * {@link String } * */ public void setDevice(String value) { this.device = value; } /** * Gets the value of the reason property. * * @return * possible object is * {@link String } * */ public String getReason() { return reason; } /** * Sets the value of the reason property. * * @param value * allowed object is * {@link String } * */ public void setReason(String value) { this.reason = value; } }
a55ce4ead09175116835afc82dca21d54575e687
95e1ddd7adc76bd08249d784cf346e9b8cddcc9f
/1.JavaSyntax/src/com/javarush/task/task09/task0906/Solution.java
50ad24c21a25456d2bc10761e25648e239154bd9
[]
no_license
script972/JavaRush
2f7190e1ce20826bfab6045aee23c6b9e36d3a72
225b5802bd2116f41e2e1ccc57c7427b05ef9a07
refs/heads/master
2021-01-19T18:32:38.809418
2017-10-07T21:44:26
2017-10-07T21:44:26
78,306,557
0
0
null
null
null
null
UTF-8
Java
false
false
470
java
package com.javarush.task.task09.task0906; /* Логирование стек трейса */ public class Solution { public static void main(String[] args) { log("In main method"); } public static void log(String s) { //напишите тут ваш код StackTraceElement[] elem = Thread.currentThread().getStackTrace(); System.out.println(elem[2].getClassName() + ": " + elem[2].getMethodName() + ": " + s); } }
0dcb2b1985a26bd2edc2de1df2840bb181498031
25fe82ea0e1ccb330890191806a8bb35e4043358
/phone/src/main/java/com/example/phone/TouchImageView.java
369566394dbc72064f9bead16e97abff09abc52e
[]
no_license
suhuMM/AriportTv
3e9b029cd4bfc06de1abfb8cde9f99b3a715fa2e
38118b6d809771f8fba26ddb15d1ec82100d6fc9
refs/heads/master
2021-05-04T19:15:47.401075
2018-01-03T13:35:26
2018-01-03T13:35:26
106,654,449
1
0
null
2017-11-13T02:20:14
2017-10-12T06:38:38
Java
UTF-8
Java
false
false
12,575
java
package com.example.phone; /** * Created by suhu on 2017/8/2. */ import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PointF; import android.support.v7.widget.AppCompatImageView; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.MotionEvent; import java.util.ArrayList; import java.util.List; public class TouchImageView extends AppCompatImageView { /** * 小圆的半径 */ private static final int RADIUS = 10; /** * 基础缩放比例,不能比这个更小 */ private float basis_scale = 1.0f; /** * 放缩后图片宽度 */ private float scalingW; /** * 放缩后图片高度 */ private float scalingH; /** * 经度与宽度比例 */ private double ratioX; /** * 纬度与高度比例 */ private double ratioY; /** * 亦庄图 * 116.507807,39.814279 * <p> * 云狐图 * 116.57792,39.796808 */ private Latitude origin = new Latitude(116.507807, 39.814279); /** * 亦庄图 * 116.671515,39.814168 * <p> * 云狐图 * 116.588206,39.796794 */ private Latitude point_x = new Latitude(116.671515, 39.814168); /** * 亦庄图 * 116.508095,39.749625 * <p> * 云狐图 * 116.577947,39.792678 */ private Latitude point_Y = new Latitude(116.508095, 39.749625); /** * 亦庄图 * 锋创科技园坐标 * 116.584559,39.785231 * <p> * 京东大厦坐标 * 116.570042,39.792439 * <p> * 同济南路 * 116.546385,39.77919 * <p> * 徐庄桥 * 116.636153,39.802102 * <p> * <p> * 云狐图 * 云狐时代D座 * 116.582088,39.794569 * <p> * 云时代A座 * 116.583072,39.796032 */ private Latitude test = new Latitude(116.584559, 39.785231); /** * 背景图片的宽度 */ private int width; /** * 背景图片的高度 */ private int height; /** * 画笔 */ private Paint paint; private float x_down = 0; private float y_down = 0; private PointF start = new PointF(); private PointF mid = new PointF(); private float oldDist = 1f; private float oldRotation = 0; private Matrix matrix = new Matrix(); private Matrix matrix1 = new Matrix(); private Matrix savedMatrix = new Matrix(); /** *基础的矩阵 */ private Matrix basicsMatrix = new Matrix(); private static final int NONE = 0; private static final int DRAG = 1; private static final int ZOOM = 2; private int mode = NONE; private boolean matrixCheck = false; private int widthScreen; private int heightScreen; private Bitmap gintama, bitmap; public TouchImageView(Context context) { super(context); init(); } public TouchImageView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public TouchImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); } private void init() { paint = new Paint(); paint.setColor(Color.RED); gintama = BitmapFactory.decodeResource(getResources(), R.mipmap.yizhuang); DisplayMetrics display = getResources().getDisplayMetrics(); widthScreen = display.widthPixels; heightScreen = display.heightPixels; width = gintama.getWidth(); height = gintama.getHeight(); if (width > widthScreen || height > heightScreen) { float scaleW = width * 1.0f / widthScreen; float scaleH = height * 1.0f /heightScreen; //按照宽边进行放缩 if (scaleW > scaleH) { basis_scale = 1/scaleW; matrix.postTranslate(0,(heightScreen-height*basis_scale)/2); } else { basis_scale = 1/scaleH; //平移指的是将坐标原点平移 matrix.postTranslate((widthScreen-width*basis_scale)/2,0); } }else { float scaleW = widthScreen*1.0f/(width*1.0f); float scaleH = heightScreen*1.0f/(height*1.0f); if (scaleW<scaleH){ basis_scale = scaleW; matrix.postTranslate(0,(heightScreen-height*basis_scale)/2); }else { basis_scale = scaleH; matrix.postTranslate((widthScreen-width*basis_scale)/2,0); } } //获得变化后宽高 scalingW = width*basis_scale; scalingH = height*basis_scale; //缩放图片大小,得到新图片 basicsMatrix.postScale(basis_scale,basis_scale); gintama = Bitmap.createBitmap(gintama,0,0,width,height,basicsMatrix,true); //获得比例 measureRatio(point_x,point_Y,scalingW,scalingH); bitmap = gintama; } protected void onDraw(Canvas canvas) { canvas.save(); canvas.drawBitmap(bitmap, matrix, null); canvas.restore(); } /** * @method 触碰按键(手机,pad端) * @author suhu * @time 2017/10/12 13:27 */ public boolean onTouchEvent(MotionEvent event) { switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: mode = DRAG; x_down = event.getX(); y_down = event.getY(); savedMatrix.set(matrix); break; case MotionEvent.ACTION_POINTER_DOWN: mode = ZOOM; oldDist = spacing(event); oldRotation = rotation(event); savedMatrix.set(matrix); midPoint(mid, event); break; case MotionEvent.ACTION_MOVE: if (mode == ZOOM) { matrix1.set(savedMatrix); float newDist = spacing(event); float scale = newDist / oldDist; matrix1.postScale(scale, scale, mid.x, mid.y);// 縮放 matrixCheck = matrixCheck(); if (matrixCheck == false) { matrix.set(matrix1); invalidate(); } } else if (mode == DRAG) { matrix1.set(savedMatrix); matrix1.postTranslate(event.getX() - x_down, event.getY() - y_down);// 平移 matrixCheck = matrixCheck(); if (matrixCheck == false) { matrix.set(matrix1); invalidate(); } } break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_POINTER_UP: mode = NONE; break; default: } return true; } /** * @method 边界计算 * @author suhu * @time 2017/10/12 13:26 */ private boolean matrixCheck() { float[] f = new float[9]; matrix1.getValues(f); // 图片4个顶点的坐标 float x1 = f[0] * 0 + f[1] * 0 + f[2]; float y1 = f[3] * 0 + f[4] * 0 + f[5]; float x2 = f[0] * gintama.getWidth() + f[1] * 0 + f[2]; float y2 = f[3] * gintama.getWidth() + f[4] * 0 + f[5]; float x3 = f[0] * 0 + f[1] * gintama.getHeight() + f[2]; float y3 = f[3] * 0 + f[4] * gintama.getHeight() + f[5]; float x4 = f[0] * gintama.getWidth() + f[1] * gintama.getHeight() + f[2]; float y4 = f[3] * gintama.getWidth() + f[4] * gintama.getHeight() + f[5]; // 图片现宽度 double width = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); // 缩放比率判断 if (width < widthScreen / 3 || width > widthScreen * 3) { return true; } // 出界判断 if ((x1 < widthScreen / 3 && x2 < widthScreen / 3 && x3 < widthScreen / 3 && x4 < widthScreen / 3) || (x1 > widthScreen * 2 / 3 && x2 > widthScreen * 2 / 3 && x3 > widthScreen * 2 / 3 && x4 > widthScreen * 2 / 3) || (y1 < heightScreen / 3 && y2 < heightScreen / 3 && y3 < heightScreen / 3 && y4 < heightScreen / 3) || (y1 > heightScreen * 2 / 3 && y2 > heightScreen * 2 / 3 && y3 > heightScreen * 2 / 3 && y4 > heightScreen * 2 / 3)) { return true; } return false; } /** * @param event * @method 触碰两点间距离 * @author suhu * @time 2017/10/12 13:25 */ private float spacing(MotionEvent event) { float x = event.getX(0) - event.getX(1); float y = event.getY(0) - event.getY(1); return (float) Math.sqrt(x * x + y * y); } /** * @param point * @param event * @method 取手势中心点 * @author suhu * @time 2017/10/12 13:25 */ private void midPoint(PointF point, MotionEvent event) { float x = event.getX(0) + event.getX(1); float y = event.getY(0) + event.getY(1); point.set(x / 2, y / 2); } /** * @param event * @method 取旋转角度 * @author suhu * @time 2017/10/12 13:25 */ private float rotation(MotionEvent event) { double delta_x = (event.getX(0) - event.getX(1)); double delta_y = (event.getY(0) - event.getY(1)); double radians = Math.atan2(delta_y, delta_x); return (float) Math.toDegrees(radians); } /** * @param point_x :x轴坐标点 * @param point_y :y轴坐标点 * @param width :图像宽度 * @param height :图像高度 * @method 获得XY比例 * @author suhu * @time 2017/8/3 14:27 */ private void measureRatio(Latitude point_x, Latitude point_y, float width, float height) { ratioX = width / (point_x.x - point_y.x); ratioY = height / (point_y.y - point_x.y); } /** * @param oldPoint :要转换的点 * @method 单点坐标转换 * @author suhu * @time 2017/8/3 14:38 */ private Latitude coordinateTransformation(Latitude oldPoint) { Latitude newPoint = new Latitude(); newPoint.x = Math.abs((oldPoint.x - origin.x) * ratioX); newPoint.y = Math.abs((oldPoint.y - origin.y) * ratioY); return newPoint; } /** * @param list * @method 整个集合转换 * @author suhu * @time 2017/8/3 14:47 */ private List<Latitude> transformationList(List<Latitude> list) { List<Latitude> newList = new ArrayList<>(); for (Latitude point : list) { newList.add(coordinateTransformation(point)); } return newList; } /** * @param point * @method 绘画单点 * @author suhu * @time 2017/8/4 11:16 */ public void drawPoint(Latitude point) { Bitmap bm = Bitmap.createBitmap(width, height, Config.ARGB_8888); Canvas canvas = new Canvas(bm); canvas.drawBitmap(gintama, 0, 0, null); Latitude latitude = coordinateTransformation(point); canvas.drawCircle((float) latitude.x, (float) latitude.y, RADIUS, paint); canvas.save(); bitmap = bm; invalidate(); } /** * @param pointList * @method 绘画点集 * @author suhu * @time 2017/8/4 11:20 */ public void drawPoint(List<Latitude> pointList) { Bitmap bm = Bitmap.createBitmap(gintama.getWidth(),gintama.getHeight(),Config.ARGB_8888); //Bitmap mm = BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher); Canvas canvas = new Canvas(bm); canvas.drawBitmap(gintama, 0, 0, null); List<Latitude> list = transformationList(pointList); for (Latitude latitude : list) { canvas.drawCircle((float) latitude.x, (float) latitude.y, RADIUS, paint); //canvas.drawBitmap(mm,(float) latitude.x, (float) latitude.y,paint); } canvas.save(); bitmap = bm; //通知重绘 invalidate(); } }
d5f5b9b22308a004c9eb0bae44a6f53740614a22
1204868f57bbd15757cd79c6838b31c903abd177
/camel-blueprint-salesforce-test-6.2/src/main/java/org/apache/camel/salesforce/dto/QueryRecordsContentDocumentFeed.java
d72ae7f46fc6f6d97a1088f913b87e053fdff57b
[]
no_license
shivamlakade95/fuse-examples-6.2
aedaeddcad6efcc8e4f85d550c9e2e174b25fb14
f7f9ac9630828dd4e488f80011dbc2e60a7e3e2c
refs/heads/master
2023-05-11T04:05:40.394046
2020-01-02T08:23:34
2020-01-02T08:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
/* * Salesforce Query DTO generated by camel-salesforce-maven-plugin * Generated on: Thu Sep 03 14:23:16 IST 2015 */ package org.apache.camel.salesforce.dto; import com.thoughtworks.xstream.annotations.XStreamImplicit; import org.apache.camel.component.salesforce.api.dto.AbstractQueryRecordsBase; import java.util.List; /** * Salesforce QueryRecords DTO for type ContentDocumentFeed */ public class QueryRecordsContentDocumentFeed extends AbstractQueryRecordsBase { @XStreamImplicit private List<ContentDocumentFeed> records; public List<ContentDocumentFeed> getRecords() { return records; } public void setRecords(List<ContentDocumentFeed> records) { this.records = records; } }
da196942ffa4e22d92e2d3369b7c6c14636f5a48
35559cc0d6962fde2d67618aae41a8ba1e8dcd43
/②JAVA基础/11月16日作业/四组/IT02_李静静/AnimalDemo/src/Dog.java
3a81b77f97e0735317eef93d85c19b4693b127fa
[]
no_license
qhit2017/GR1702_01
bc9190243fc24db4d19e5ee0daff003f9eaeb2d8
8e1fc9157ef183066c522e1025c97efeabe6329a
refs/heads/master
2021-09-03T16:27:00.789831
2018-01-10T11:08:27
2018-01-10T11:08:27
109,151,555
0
0
null
null
null
null
GB18030
Java
false
false
1,141
java
/** *@author 作者 E-mail:[email protected] * @date 创建时间:2017年11月15日 下午8:18:41 * @version 1.0 * @parameter * @since * @return * @function */ public class Dog extends Animal{ /*定义一个类:狗,属性包括: 品种, * 毛的颜色, 年龄,重量 方法包括:叫、吃、睡觉 * 要求属性私有,并提供get、set方法 */ private String breed ; private String color ; private int age ; private int weiget ; Dog(){ System.out.println("我是无参的"); } public String getBreed() { return breed; } public void setBreed(String breed) { this.breed = breed; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public int getWeiget() { return weiget; } public void setWeiget(int weiget) { this.weiget = weiget; } void wow (){ System.out.println("叫"); } void eat (){ System.out.println("吃"); } void sleep (){ System.out.println("睡觉"); } }
92791a05c6c6e25b1a244c0110fff29094ea0de6
69fefed1b1b16c4af6662cef757c7d2e3d3e6226
/app/src/main/java/com/myappcompany/steve/canvaspaint/Adapters/SaveLoadRecyclerViewAdapter.java
a440b3fa7bb2157f5085e459458b1399598e4907
[]
no_license
tutoringsteve/GameOfLifeAndroid
1299949202efd28af59b541101cd91e18f3d25e1
e2a59cdee27d0708360513c40a0494fe8a392f38
refs/heads/master
2021-08-11T01:35:06.477388
2020-12-26T23:06:54
2020-12-26T23:06:54
236,388,618
0
0
null
null
null
null
UTF-8
Java
false
false
2,716
java
package com.myappcompany.steve.canvaspaint.Adapters; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.myappcompany.steve.canvaspaint.R; import com.myappcompany.steve.canvaspaint.data.SaveData; import java.util.ArrayList; public class SaveLoadRecyclerViewAdapter extends RecyclerView.Adapter<SaveLoadRecyclerViewAdapter.ViewHolder> { private static final String TAG = "RecyclerViewAdapter"; private Context mContext; private ArrayList<SaveData> mSaves; private OnItemListener mOnItemListener; public SaveLoadRecyclerViewAdapter(Context context, ArrayList<SaveData> saves, OnItemListener onItemListener) { mContext = context; mSaves = saves; mOnItemListener = onItemListener; } @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.save_load_list_item, parent, false); return new ViewHolder(view, mOnItemListener); } @Override public void onBindViewHolder(@NonNull final ViewHolder holder, final int position) { Log.d(TAG, "onBindViewHolder: called."); String date = mContext.getString(R.string.saved_on, mSaves.get(position).getSaveDate()); holder.saveDateTextView.setText(date); holder.saveNameTextView.setText(mSaves.get(position).getSaveName()); } @Override public int getItemCount() { return mSaves.size(); } public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { ImageView deleteImageView; TextView saveNameTextView, saveDateTextView; OnItemListener onItemListener; public ViewHolder(@NonNull View itemView, OnItemListener onItemListener) { super(itemView); deleteImageView = itemView.findViewById(R.id.deleteImageView); deleteImageView.setOnClickListener(this); saveNameTextView = itemView.findViewById(R.id.saveNameTextView); saveDateTextView = itemView.findViewById(R.id.saveDateTextView); this.onItemListener = onItemListener; itemView.setOnClickListener(this); } @Override public void onClick(View v) { onItemListener.onItemClick(v, getAdapterPosition()); } } public interface OnItemListener{ void onItemClick(View view, int position); } }
085f67e25ffbcf8610d3aa508f07ab43066311be
990ca50f86bf877f46851425b79ffdfe26590c71
/IC_JL_2.2.4/app/src/main/java/examples/pltw/org/collegeapp/Guardian.java
21de57db86494cd4a4e28560aa3f85841cfa5874
[]
no_license
justlee06/IC_JL_2.2.4
980552b445143fa0bfdbf44193b9517f325627f0
922cbda4ed8f36f23b12e3bb735954f4ac7c93ca
refs/heads/master
2021-09-06T02:29:29.149826
2018-02-01T18:09:39
2018-02-01T18:09:39
119,581,746
0
0
null
null
null
null
UTF-8
Java
false
false
859
java
package examples.pltw.org.collegeapp; /** * Created by wdumas on 4/8/16. */ public class Guardian extends FamilyMember { private String occupation; public Guardian() { super(); occupation = "unknown"; } public Guardian(String firstName, String lastName) { super(firstName, lastName); occupation = "unknown"; } public Guardian(String firstName, String lastName, String occupation) //step 35 { super(firstName, lastName); this.occupation = occupation; } public String toString() //step 36 { return ("Guardian: " + getFirstName() + " " + getLastName() + "\nOccupation: " + occupation ); } public String getOccupation() { return occupation; } public void setOccupation(String occupation) { this.occupation = occupation; } }
9216dc03acd70927fa1a3ca0800d5d4c225a110c
abd6fb9938dfe360906fa92fc6cb47687f781100
/src/main/java/nyist/edu/cn/service/GodService.java
42289f934c80fcc71f6557ca392b5d90dbfe376a
[]
no_license
lovely960823/videomall
d80b35d039ff042978face66f7201cb5c9181b0e
eeab5f3f7abaf69f806d05cf3086c56f48d7ca1b
refs/heads/master
2022-06-27T12:14:04.111580
2020-07-12T11:41:10
2020-07-12T11:41:10
237,393,115
0
0
null
null
null
null
UTF-8
Java
false
false
474
java
package nyist.edu.cn.service; import java.util.List; import nyist.edu.cn.entity.God; import nyist.edu.cn.service.base.BaseService; import nyist.edu.cn.vo.ResultPage; public interface GodService extends BaseService<God> { /** * 后台根据姓名查找 * @param resultPage * @param god * @return */ ResultPage<God> findByName(ResultPage<God> resultPage, God god); /** * 获取八条数据 * @return */ List<God> getGod(); }
e23964b5b9b67d9be313e042af5c6267d9a901b2
e7ca3a996490d264bbf7e10818558e8249956eda
/aliyun-java-sdk-rds/src/main/java/com/aliyuncs/rds/model/v20140815/CreateDampPolicyResponse.java
a0918b83c607f359c40328de7fe39a8c753cead8
[ "Apache-2.0" ]
permissive
AndyYHL/aliyun-openapi-java-sdk
6f0e73f11f040568fa03294de2bf9a1796767996
15927689c66962bdcabef0b9fc54a919d4d6c494
refs/heads/master
2020-03-26T23:18:49.532887
2018-08-21T04:12:23
2018-08-21T04:12:23
145,530,169
1
0
null
2018-08-21T08:14:14
2018-08-21T08:14:13
null
UTF-8
Java
false
false
1,582
java
/* * 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.aliyuncs.rds.model.v20140815; import com.aliyuncs.AcsResponse; import com.aliyuncs.rds.transform.v20140815.CreateDampPolicyResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class CreateDampPolicyResponse extends AcsResponse { private String requestId; private String policyId; private String policyName; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getPolicyId() { return this.policyId; } public void setPolicyId(String policyId) { this.policyId = policyId; } public String getPolicyName() { return this.policyName; } public void setPolicyName(String policyName) { this.policyName = policyName; } @Override public CreateDampPolicyResponse getInstance(UnmarshallerContext context) { return CreateDampPolicyResponseUnmarshaller.unmarshall(this, context); } }
fd516cba3192178c5cdecdeb7dc8bd934fc53b3a
12e49096e213e13f6958ac5ff73009b3a5bec724
/alert-service/src/main/java/ru/ifmo/ailab/daafse/alertservice/CQELSEngineImpl.java
202ae0dea00e1f1377c61b4172b8c662fa2e7cdb
[ "MIT" ]
permissive
ailabitmo/DAAFSE
47a15763228c718b291a945c204c469736601193
6c3b7529954e68b93bd9927564b95a9c3a8fded8
refs/heads/master
2016-09-06T16:55:50.002845
2014-12-08T16:17:19
2014-12-08T16:17:19
19,241,273
1
2
null
null
null
null
UTF-8
Java
false
false
2,409
java
package ru.ifmo.ailab.daafse.alertservice; import java.io.File; import java.io.IOException; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Singleton; import org.aeonbits.owner.ConfigFactory; import org.deri.cqels.engine.ExecContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ru.ifmo.ailab.daafse.alertservice.config.ServiceConfig; @Singleton public class CQELSEngineImpl implements CQELSEngine { private static final Logger logger = LoggerFactory.getLogger( CQELSEngineImpl.class); private static final ServiceConfig CONFIG = ConfigFactory.create( ServiceConfig.class); private static final File HOME = new File(CONFIG.cqelsHome()); private static ExecContext context; @PostConstruct public void postConstruct() { if (!HOME.exists()) { HOME.mkdir(); HOME.setWritable(true); logger.debug("CQELS HOME: " + HOME.getAbsolutePath()); } context = new ExecContext(CONFIG.cqelsHome(), true); } @PreDestroy public void preDestroy() { context.env().close(); context.getDataset().close(); context.getARQExCtx().getDataset().close(); context.dictionary().close(); if (HOME.exists()) { try { Files.walkFileTree(HOME.toPath(), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Files.delete(file); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { Files.delete(dir); return FileVisitResult.CONTINUE; } }); } catch (IOException ex) { logger.error(ex.getMessage(), ex); } } } @Override public ExecContext getContext() { synchronized (CQELSEngineImpl.class) { return context; } } }
ce9ee76679c71f28f279035976752dc1abb6ca6d
4d0c4d6f0de899eb22f400b6769ef0b49430be1f
/web/src/test/java/com/springboot/web/WebApplicationTests.java
eec51f9f217f62cb0d59dcf9d7940c23e8e1e5a5
[]
no_license
LesliePie/springboot-shiro-redis
d266c182dc7ab66258988fc28eee296aeaec36af
ca55268505f369ea22bc56a44c8a90e08fe85f5d
refs/heads/master
2020-04-06T08:23:48.827859
2018-11-28T06:21:38
2018-11-28T06:21:38
157,303,167
4
1
null
null
null
null
UTF-8
Java
false
false
341
java
package com.springboot.web; 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 WebApplicationTests { @Test public void contextLoads() { } }
6135df6e44f6e033020527e7387268abd7a1b9e7
9dab5c69697b7dd8a7bfab4cc8c2f6d580ef2d1a
/JavaSE/src/Day21/GetReflectClassInstanceInfo.java
4abbdd62023327df0ac849a085d7fde79f21db3c
[]
no_license
Jexn/MyCode
f7b7eee50c28161c11d047ebac5ddd7d8a4a1833
23a2833f82534a65a816ed2424ff80f4af94dab5
refs/heads/master
2022-12-23T12:06:45.266482
2019-08-20T00:37:25
2019-08-20T00:37:25
185,705,380
0
0
null
2022-12-16T05:04:07
2019-05-09T01:38:16
Java
UTF-8
Java
false
false
5,644
java
package Day21; import org.junit.Test; import java.lang.reflect.*; public class GetReflectClassInstanceInfo { // 创建运行时类的对象 @Test public void method1() { try { Class getClass = Class.forName("Day21.Person"); Person person = (Person) getClass.newInstance(); System.out.println("person = " + person); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } } // 获取运行时类声明为Public的构造器 @Test public void getConstructor() throws ClassNotFoundException { Class myClass = Class.forName("Day21.Person"); // 获取运行时类声明为Public的构造器 System.out.println("获取运行时类声明为Public的构造器:"); Constructor[] constructors = myClass.getConstructors(); for (Constructor constructor : constructors) { System.out.println(constructor); } System.out.println("获取运行时类中所有的构造器:"); // 获取运行时类中所有的构造器 Constructor[] constructors1 = myClass.getDeclaredConstructors(); for (Constructor constructor : constructors1) { System.out.println(constructor); } } // 获取类的属性信息 @Test public void method2() { Class myClass = Person.class; System.out.println("获取公共属性:"); Field[] fields = myClass.getFields(); for (Field field : fields) { System.out.println(field); } System.out.println("获取所有有属性:"); Field[] fields1 = myClass.getDeclaredFields(); for (Field field : fields1) { System.out.println(field); } } // 获取当前类属性详细情况 @Test public void method3() { Class myClass = Person.class; Field[] fields = myClass.getDeclaredFields(); for (Field field : fields) { // 1. 权限修饰符 int modifier = field.getModifiers(); System.out.print(Modifier.toString(modifier) + '\t'); // 2. 类型 Class type = field.getType(); System.out.print(type.getName() + '\t'); // 3. 变量名 System.out.println(field.getName()); } } // 获取运行类所声明的方法 @Test public void method4() { try { Class myClass = Class.forName("Day21.Person"); // 获取当前运行类及其父类中所声明的方法 Method[] methods = myClass.getMethods(); for (Method method : methods) { System.out.println(method); } System.out.println("获取当前类所有方法:"); // 获取当前运行类中声明的所有方法,不论权限大小 Method[] methods1 = myClass.getDeclaredMethods(); for (Method method : methods1) { System.out.println(method); } } catch (ClassNotFoundException e) { e.printStackTrace(); } } // 获取当前类的接口信息 @Test public void method5() throws ClassNotFoundException { ClassLoader classLoader = GetReflectClassInstanceInfo.class.getClassLoader(); Class myClass = classLoader.loadClass("Day21.Person"); Class[] classes = myClass.getInterfaces(); for (Class aClass : classes) { System.out.println(aClass); } } //获取运行时类的带泛型的父类的泛型 //逻辑性代码 功能性代码 @Test public void method6() { Class clazz = Person.class; Type genericSuperClass = clazz.getGenericSuperclass(); ParameterizedType paramsType = (ParameterizedType) genericSuperClass; Type[] arguments = paramsType.getActualTypeArguments(); System.out.println(((Class) arguments[0]).getName()); } // 动态获取运行时类带泛型父类的泛型 public String getGenericSuperClassParam(String className){ try { Class targetClass = Class.forName(className); Type genericSuperClass = targetClass.getGenericSuperclass(); ParameterizedType parameterizedType = (ParameterizedType) genericSuperClass; Type[] arguments = parameterizedType.getActualTypeArguments(); return ((Class) arguments[0]).getName(); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } @Test public void getGenericSuperClassParamTest(){ String type = getGenericSuperClassParam("Day21.Person"); System.out.println(type); } //获取运行时类的带泛型的父类 @Test public void method7() { Class clazz = Person.class; Type genericSuperClass = clazz.getGenericSuperclass(); System.out.println(genericSuperClass); } //获取运行时类的父类 @Test public void method8() { Class clazz = Person.class; Class superClass = clazz.getSuperclass(); System.out.println(superClass); Class superClass1 = superClass.getSuperclass(); System.out.println(superClass1); } //获取运行时类所属的包 @Test public void method9() { Class clazz = Person.class; Package pack = clazz.getPackage(); System.out.println(pack); } }
0eda6bd01919c3224f6b47033a1734a019262017
ce3515b2787a9473dd4aadbe38c7708debc82cf3
/src/se/liu/ida/gusan092/tddd78/project/game/objects/still/Road.java
fd43d06b56119a37a72c8abf72856040b5b7b0ba
[]
no_license
gvekan/tddd78-project
069ce0e867551ca7f7a7fcf5374ef1b306d92278
45b9abbde759c89ec0e1582b74af4ef9a8147b48
refs/heads/master
2021-01-02T07:27:02.664301
2017-05-07T21:39:16
2017-05-07T21:39:16
239,547,226
0
0
null
null
null
null
UTF-8
Java
false
false
1,410
java
package se.liu.ida.gusan092.tddd78.project.game.objects.still; import se.liu.ida.gusan092.tddd78.project.game.Game; import se.liu.ida.gusan092.tddd78.project.game.Handler; import se.liu.ida.gusan092.tddd78.project.game.objects.Type; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; /** * A still object for the environment handler that displays a road */ public class Road extends StillObject { private BufferedImage img = null; public Road(final int y, final Handler handler) { super(0, y, Game.WIDTH, Game.HEIGHT, Color.BLACK, Type.ROAD, handler); try { img = ImageIO.read(new File("road.png")); } catch (IOException e) { e.printStackTrace(); } } /** * Used to restore a saved game */ public Road(final Handler handler, final String saveValues) { super(Game.WIDTH,Game.HEIGHT,Color.BLACK, Type.ROAD, handler); restoreSaveValues(saveValues); try { img = ImageIO.read(new File("road.png")); } catch (IOException e) { e.printStackTrace(); } } @Override public void render(final Graphics g) { Graphics2D g2d = (Graphics2D) g; if (img != null) { g2d.drawImage(img,x,y,null); } } /** * Not used because nothing has to be saved */ @Override public void setStillSaveValues(final String[] saveValues) { } }
56d1759100b1d804b9628564382ba5127d84247e
37d0b71618c04bff9db134590e05de47e5f057f7
/app/src/main/java/smartparadise/ridewithme/Adapters/HistoryAdapter.java
cdc81c83a48fca837fcd1e2f69f5b5d9e64acac3
[]
no_license
spankaj713/RideWithMe-Online-Cab-Booking-System
d8d477ca2532906be9af8fa35991deed4857a490
53bcb7ecf196b7d90568b829bfdb91189ac7201b
refs/heads/master
2020-03-20T11:10:35.143708
2018-06-14T19:34:46
2018-06-14T19:34:46
137,394,979
0
0
null
null
null
null
UTF-8
Java
false
false
2,422
java
package smartparadise.ridewithme.Adapters; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import java.util.List; import java.util.zip.Inflater; import smartparadise.ridewithme.Activities.HistorySinglePageActivity; import smartparadise.ridewithme.DataModels.HistoryModels; import smartparadise.ridewithme.R; /** * Created by HP on 12-05-2018. */ public class HistoryAdapter extends RecyclerView.Adapter<HistoryAdapter.MyViewHolder> { List<HistoryModels> itemList; Context context; public HistoryAdapter(List<HistoryModels> itemList,Context context){ this.itemList=itemList; this.context=context; } @Override public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view= LayoutInflater.from(parent.getContext()) .inflate(R.layout.history_recycler_item,parent,false); return new MyViewHolder(view); } @Override public void onBindViewHolder(MyViewHolder holder, int position) { holder.rideIdItem.setText(itemList.get(position).getRideId()); holder.timeView.setText(itemList.get(position).getTime()); } @Override public int getItemCount() { return itemList.size(); } public class MyViewHolder extends RecyclerView.ViewHolder { TextView rideIdItem,timeView; CardView historyCard; public MyViewHolder(View itemView) { super(itemView); timeView=(TextView)itemView.findViewById(R.id.timeView); rideIdItem=(TextView)itemView.findViewById(R.id.rideIdView); historyCard=(CardView)itemView.findViewById(R.id.historyCard); historyCard.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent=new Intent(view.getContext(), HistorySinglePageActivity.class); Bundle b=new Bundle(); b.putString("rideId",rideIdItem.getText().toString()); intent.putExtras(b); view.getContext().startActivity(intent); } }); } } }
e6b1a00309728ba5dc50125084a711aadf8f30d0
517fb69ca6b9f7c478f0cd6201d5ec250dc3c776
/FastOrm/src/main/java/org/fastorm/defns/IMutableMakerAndEntityDefnVisitor.java
0b3fe04e3db51317bbd2184a47a1081da6c423e0
[]
no_license
phil-rice/fastorm
2af3baa2f18fa8f2f6bfb319623ce32dd8f5d2e6
ae6f16a147c013e55d39031668a804c3b19c69db
refs/heads/master
2021-01-23T13:29:16.818262
2011-06-14T21:11:27
2011-06-14T21:11:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package org.fastorm.defns; import org.fastorm.temp.IMutatingTempTableMaker; public interface IMutableMakerAndEntityDefnVisitor { void accept(IMutatingTempTableMaker maker, IEntityDefn entityDefn) throws Exception; }
58e6570f82ad8a4d0befd63d7c8fd514f3d41487
45a436b49dc644978f9ae43d512be48d529664bb
/app/src/main/java/pe/edu/cibertec/retrofitgitflow/presentation/main/view/IMainContract.java
21d55137d58a39c354a2a7c64c6b53f0c13b3e02
[]
no_license
wcondori/Retrofic_mvp
36873b659eab6f49a70fd1f097e177fdc88f4dab
e7b5147e1bbd72dbdf922fa8bad6ffdf8d2fe194
refs/heads/master
2020-06-19T19:52:58.668706
2019-07-14T18:50:06
2019-07-14T18:50:06
196,849,771
0
0
null
null
null
null
UTF-8
Java
false
false
571
java
package pe.edu.cibertec.retrofitgitflow.presentation.main.view; import java.util.List; import pe.edu.cibertec.retrofitgitflow.data.entities.Post; public interface IMainContract { interface IView { void showError(String errorMsg); void showProgressBar(); void hideProgressBar(); void getAllPostSuccess(List<Post> postList); void getToDetailPost(int postId); } interface IPresenter { void attachView(IView view); void detachView(); boolean isViewAttached(); void getAllpost(); } }
6b2cbfe3dc8cb0ab130113fbc632967a108b15fa
e6fc90b1044b3830dc76014e210bebfe20723879
/phase3/everything/Node.java
494f4f4328bac984c9056cb8deaedddf178513ce
[]
no_license
DKEProjectGroup26/Project-1-3
3407945d527a03983b1aa2e935d13161f969947d
3f62fe1e5e488991154a322716de4843ed7761ef
refs/heads/master
2020-04-15T05:12:35.960451
2019-01-27T14:02:42
2019-01-27T14:02:42
164,412,943
0
0
null
2019-01-16T19:00:54
2019-01-07T10:00:26
Java
UTF-8
Java
false
false
1,706
java
package phase3.everything; import java.util.ArrayList; /** * The class representing a node (or vertex) in a graph, edge information is stored * in this class as a list of other {@link Node} objects stored as {@link Node#neighbors} */ public class Node implements Comparable { /** * The index of the node inside its parent graph's {@link Graph#nodes} list */ protected int index; /** * A list of the other {@link Node} objects in this node's parent graph which share an edge with this node */ protected ArrayList<Node> neighbors; /** * @return {@link Node#index} */ public int getIndex() { return index; } /** * @return {@link Node#neighbors} */ public ArrayList<Node> getNeighbors() { return neighbors; } /** * Constructor * * @param index the index to be assigned to this node */ public Node(int index) { this.index = index; neighbors = new ArrayList<Node>(); } /** * {@link Node}'s implementation of the {@link Comparable} interface, compares nodes by index * * @param other another object of type {@link Node} which this node will be compared to * @return -1, 0, or 1 */ public int compareTo(Object other) { // -1 if my index < other index // 0 if my index == other index // 1 if my index > other index if (other instanceof Node) { int otherIndex = ((Node) other).index; return index < otherIndex ? -1 : index == otherIndex ? 0 : 1; } else throw new Error("tried to compare Node to " + other.getClass().getSimpleName()); } }
59df80d834f7d6ca5f3cfd629504bcdc1e2ce71b
3f62e1c6e6e7153bde24673bd02cea3ef3a21075
/src/main/java/com/example/userservice/domain/Role.java
d016b68519d682a7d372d72960bf1f2bdacda390
[]
no_license
Testoni/userjwt
7a807d589893a08a7dd7510c34bd123bb01476a6
09a9c56806feaa041eabf77d37a42231606f6bf1
refs/heads/main
2023-06-29T01:23:20.622370
2021-08-01T16:11:07
2021-08-01T16:11:07
390,921,509
0
0
null
null
null
null
UTF-8
Java
false
false
457
java
package com.example.userservice.domain; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Data @Entity @NoArgsConstructor @AllArgsConstructor public class Role { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String name; }
9f124efc65184d899e7ba8048631ef2239760663
1ccd54cc639d489d6bf125f2c4092c36f6900dca
/Part1/Lunch.java
de8e9a8ec42fd4dbab41c133ade93fbf7eb46279
[]
no_license
ahmedgheriani/assignment
a0c3453ac5c7a70c20d59879c7f22405d49fcde4
4b867bf87ce1483f05cbf6687ab5eb3a2b419165
refs/heads/master
2020-03-19T04:33:01.605505
2018-06-07T07:30:53
2018-06-07T07:30:53
135,840,700
1
0
null
2018-06-04T17:23:39
2018-06-02T18:02:39
Java
UTF-8
Java
false
false
251
java
public class Lunch extends Meal { private final double allowance; public Lunch(String description, int meals) { super(description, meals); this.allowance = 11.35; } public double getAmount() { return this.allowance*getNumberOfMeals(); } }
4afb004a82edc4be640f087837de46ef658d2981
5b9a4c4a2cd7250d29ff5833c83efc5be136d668
/ClinicRepresentations/target/generated-sources/edu/stevens/cs548/clinic/service/web/rest/data/RadiologyType.java
c2b74433ff2a3eebd331c365b59f9b4d6a017160
[]
no_license
ShristiH/Clinic-App
931b5d793cef6d826f78fca6f008f50e816904d1
c77c1bc28b80d27ddcc3c0e3cabcb1aadd4a0bcf
refs/heads/master
2021-01-10T15:43:12.726224
2016-01-02T23:56:21
2016-01-02T23:56:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,398
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.11.14 at 01:10:56 AM EST // package edu.stevens.cs548.clinic.service.web.rest.data; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java class for RadiologyType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="RadiologyType"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="date" type="{http://www.w3.org/2001/XMLSchema}date" maxOccurs="unbounded"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RadiologyType", propOrder = { "date" }) public class RadiologyType { @XmlElement(required = true, type = String.class) @XmlJavaTypeAdapter(Adapter1 .class) @XmlSchemaType(name = "date") protected List<Date> date; /** * Gets the value of the date property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the date property. * * <p> * For example, to add a new item, do as follows: * <pre> * getDate().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<Date> getDate() { if (date == null) { date = new ArrayList<Date>(); } return this.date; } }
d533fc24a1693763ca0715996f56480d2e932066
e0e835dac93f7221c2cc178cf33e6a418ed8cd26
/javafx-demonstration/src/main/java/com/etlsolutions/gwise/data/log/LogType.java
4d7aec37b423dba7367d3b27d328516e5efe3713
[]
no_license
eep60b/projects
d810507558c34471bacdf6345ce4b63c18912ac4
2a17c436049a1b5a8769b91d54dea48f41100629
refs/heads/master
2022-09-22T19:39:35.060351
2021-12-03T09:17:29
2021-12-03T09:17:29
126,003,168
0
0
null
null
null
null
UTF-8
Java
false
false
179
java
package com.etlsolutions.gwise.data.log; /** * The LogType interface is mask interface for all log types. * * @author ZhipengChang */ public interface LogType { }
[ "ZhipengChang@DESKTOP-L02HLUE" ]
ZhipengChang@DESKTOP-L02HLUE
0808e1a2701127a6082a7aea0faa4f50ab157942
e58d9bb8d0ec1c0e2d447dd4246d0c7d2f9f22ed
/src/main/java/io/github/mechevo/common/block/ores/ChromiteOre.java
72470980c898df1b42aeaa32c1cd640e3b21142f
[]
no_license
tmLegion/Mechanized_Evolution
86b5e84e65bfe26a7639facaac0e62b9674133f5
e8bd53f3928a0587fbd54b804e609b50537dc491
refs/heads/master
2023-03-24T13:23:00.511805
2021-03-08T02:42:55
2021-03-08T02:42:55
344,593,846
0
0
null
null
null
null
UTF-8
Java
false
false
75
java
package io.github.mechevo.common.block.ores; public class ChromiteOre { }
0f130badf82631d1160ff44e93c5de488dd07d14
f085625f1a0796853f39ee52f71e34aba2b65a5b
/src/main/java/com/common/Utils/JwtUtils.java
3d00a0e0dc8fd751f427a885df6e690ce47bde3d
[]
no_license
h7775259966/medical_waste
7bdf0e1df0a36d0c40edba0fc087eec189513c7c
34297cfccdf83854235c086203249bf9f8c021b2
refs/heads/master
2023-01-30T17:58:41.826491
2020-10-12T03:50:50
2020-10-12T03:52:19
320,127,176
0
0
null
null
null
null
UTF-8
Java
false
false
1,561
java
package com.common.Utils; import io.jsonwebtoken.Claims; import io.jsonwebtoken.JwtBuilder; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; import lombok.Getter; import lombok.Setter; import org.springframework.boot.context.properties.ConfigurationProperties; import java.util.Date; import java.util.Map; @Getter @Setter @ConfigurationProperties("jwt.config") public class JwtUtils { //签名私钥 private String key; //签名的失效时间 private Long ttl; /** * 设置认证token * id:登录用户id * subject:登录用户名 * */ public String createJwt(String id, String name, Map<String,Object> map) { //1.设置失效时间 long now = System.currentTimeMillis();//当前毫秒 long exp = now + ttl; //2.创建jwtBuilder JwtBuilder jwtBuilder = Jwts.builder().setId(id).setSubject(name) .setIssuedAt(new Date()) .signWith(SignatureAlgorithm.HS256, key); //3.根据map设置claims for(Map.Entry<String,Object> entry : map.entrySet()) { jwtBuilder.claim(entry.getKey(),entry.getValue()); } jwtBuilder.setExpiration(new Date(exp)); //4.创建token String token = jwtBuilder.compact(); return token; } /** * 解析token字符串获取clamis */ public Claims parseJwt(String token) { Claims claims = Jwts.parser().setSigningKey(key).parseClaimsJws(token).getBody(); return claims; } }
a081e1febfb99a796b79261317f5f22518f95ca1
5b303da11f72c6acc2c946c9f2b248643e753004
/src/leetcodeproblems/ShuffleAnArray.java
b967d07259f1f19b70a6579b693ea2c6b6e3482c
[]
no_license
MauriPastorini/my-competitive-programming-repo
4687ceaa1fb6b44b49bd1a449e7c33f14915bef6
a851c29eeef03e6d22289acfb75fc4107271d841
refs/heads/master
2020-03-18T20:28:32.374744
2018-06-01T18:51:45
2018-06-01T18:51:45
135,218,302
0
0
null
null
null
null
UTF-8
Java
false
false
1,513
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package leetcodeproblems; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; /** * * @author Mauri-Laptop */ public class ShuffleAnArray { int[] nums; int[] originalNums; public ShuffleAnArray() { this.nums = nums; this.originalNums = nums; } public void Solution(int[] nums) { this.nums = nums; this.originalNums = nums; } /** * Resets the array to its original configuration and return it. */ public void test() { // int[] nums = {1, 3, 2, 5}; // Solution(nums); // int[] res = shuffle(); // for (int i : res) { // System.out.println(i); // } Random rand = new Random(); System.out.println(rand.nextInt(1)); } public int[] reset() { this.nums = this.originalNums; return this.nums; } /** * Returns a random shuffling of the array. */ public int[] shuffle() { Random rand = ThreadLocalRandom.current(); for (int i = nums.length - 1; i >= 1; i--) { int posRand = rand.nextInt(i); int aux = nums[posRand]; nums[posRand] = nums[i]; nums[i] = aux; } return this.nums; } }
68fa83e5439fc4a14a0f3eb8f5475abb0ec61908
3d0f633c7067559c5c3e1eb27ca3ba42bd9ea4bc
/Stabel/src/no/hib/dat102/LabyrintSpill.java
d985fadadd3460eacb6f96f81c2cd7640d64c7fb
[]
no_license
hvl578007/Innlevering_1_dat102
088caf9fe9032454c5b02662eca2e0743dc10363
d02d1a92211d612a8380ae02534442aef0183731
refs/heads/master
2020-04-20T15:53:06.336287
2019-02-13T13:31:22
2019-02-13T13:31:22
168,944,234
0
0
null
null
null
null
UTF-8
Java
false
false
1,482
java
package no.hib.dat102; import no.hib.dat102.adt.StabelADT; import no.hib.dat102.exception.*; import no.hib.dat102.tabell.*; import no.hib.dat102.kjedet.*; public class LabyrintSpill { private Labyrint labyrint; public LabyrintSpill(Labyrint labyrint) { this.labyrint = labyrint; } /** * Fors�ke � gjennomg� labyrinten */ public boolean gjennomgaa() { boolean ferdig = false; Posisjon pos = new Posisjon(); //StabelADT<Posisjon> stabel = new KjedetStabel<Posisjon>(); StabelADT<Posisjon> stabel = new TabellStabel<Posisjon>(); stabel.push(pos); try{ while (!stabel.erTom() && !(ferdig)) { pos = stabel.pop(); labyrint.forsoekPosisjon(pos.getX(), pos.getY()); if (pos.getX() == labyrint.getRekker()-1 && pos.getY() == labyrint.getKolonner() - 1){ ferdig = true; // labyrinten er gjennomg�tt } else{ push_ny_pos(pos.getX(), pos.getY() - 1, stabel); push_ny_pos(pos.getX(), pos.getY() + 1, stabel); push_ny_pos(pos.getX() - 1, pos.getY(), stabel); push_ny_pos(pos.getX() + 1, pos.getY(), stabel); } }//while } catch(EmptyCollectionException ex) { System.out.println(ex.getMessage()); } return ferdig; } private void push_ny_pos(int x, int y, StabelADT<Posisjon> stabel) { Posisjon nypos = new Posisjon(); nypos.setX(x); nypos.setY(y); if (labyrint.gyldigPosisjon(x, y)){ stabel.push(nypos); } } }//class
9e561d5059a0496321d102a849558017168b4f2c
cd880943bbe93d1c542cfe144561be3f81443c96
/ExchangeRates/app/src/main/java/com/achek/exchangerates/repository/model/ResponseModel.java
852b2cb0909a46153e8e1c90a20ee075a00cf672
[]
no_license
a-chekulov/Currency-Converter
a3d1046b82a5e35df1dc90839828d55726250160
fe49934f50dbf0cecb3bbd8a2a3dd13abfab7200
refs/heads/master
2020-07-19T20:21:47.059809
2019-09-05T08:09:12
2019-09-05T08:09:12
206,509,166
0
0
null
null
null
null
UTF-8
Java
false
false
684
java
package com.achek.exchangerates.repository.model; import androidx.annotation.Nullable; public class ResponseModel { public ResponseModel(@Nullable CbrInfo cbrInfo, @Nullable String error) { this.cbrInfo = cbrInfo; this.error = error; } @Nullable private CbrInfo cbrInfo; @Nullable private String error; @Nullable public CbrInfo getCbrInfo() { return cbrInfo; } public void setCbrInfo(@Nullable CbrInfo cbrInfo) { this.cbrInfo = cbrInfo; } @Nullable public String getError() { return error; } public void setError(@Nullable String error) { this.error = error; } }
ef9bcff5dfa6ac0292dae3ed376fd38fc1445b09
c9cba33410c7c79c54ae1d5f1da21b2358ccd220
/app/src/main/java/com/example/fingerprintdemo/FingerPrintActivity.java
03259a2a8af065a8af5b2a1fdfda697c8f46bbb5
[]
no_license
CodeReveal/Finger_Authentication_Android
1341286e0425a6af082e7832e8d4bd27b443e1c8
821ce2b519e019b5de4af4fdca481f20939b2ad4
refs/heads/master
2022-11-15T20:35:45.089412
2020-06-08T23:48:05
2020-06-08T23:48:05
270,857,186
0
0
null
null
null
null
UTF-8
Java
false
false
6,607
java
package com.example.fingerprintdemo; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.annotation.TargetApi; import android.app.KeyguardManager; import android.content.pm.PackageManager; import android.hardware.fingerprint.FingerprintManager; import android.os.Build; import android.os.Bundle; import android.security.keystore.KeyGenParameterSpec; import android.security.keystore.KeyPermanentlyInvalidatedException; import android.security.keystore.KeyProperties; import android.widget.ImageView; import android.widget.TextView; import java.io.IOException; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.NoSuchPaddingException; import javax.crypto.SecretKey; public class FingerPrintActivity extends AppCompatActivity { private KeyStore keyStore; // Variable used for storing the key in the Android Keystore container private static final String KEY_NAME = "androidHive"; private Cipher cipher; private TextView textView; private ImageView icon; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_finger_print); // Initializing both Android Keyguard Manager and Fingerprint Manager KeyguardManager keyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE); FingerprintManager fingerprintManager = (FingerprintManager) getSystemService(FINGERPRINT_SERVICE); textView = (TextView) findViewById(R.id.errorText); icon = findViewById(R.id.icon); // Check whether the device has a Fingerprint sensor. if(!fingerprintManager.isHardwareDetected()){ /** * An error message will be displayed if the device does not contain the fingerprint hardware. * However if you plan to implement a default authentication method, * you can redirect the user to a default authentication activity from here. * Example: * Intent intent = new Intent(this, DefaultAuthenticationActivity.class); * startActivity(intent); */ textView.setText("Your Device does not have a Fingerprint Sensor"); icon.setColorFilter(ContextCompat.getColor(this, R.color.errorText)); }else { // Checks whether fingerprint permission is set on manifest if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) { textView.setText("Fingerprint authentication permission not enabled"); icon.setColorFilter(ContextCompat.getColor(this, R.color.errorText)); }else{ // Check whether at least one fingerprint is registered if (!fingerprintManager.hasEnrolledFingerprints()) { textView.setText("Register at least one fingerprint in Settings"); icon.setColorFilter(ContextCompat.getColor(this, R.color.errorText)); }else{ // Checks whether lock screen security is enabled or not if (!keyguardManager.isKeyguardSecure()) { textView.setText("Lock screen security not enabled in Settings"); icon.setColorFilter(ContextCompat.getColor(this, R.color.errorText)); }else{ generateKey(); if (cipherInit()) { FingerprintManager.CryptoObject cryptoObject = new FingerprintManager.CryptoObject(cipher); FingerprintHandler helper = new FingerprintHandler(this); helper.startAuth(fingerprintManager, cryptoObject); } } } } } } @TargetApi(Build.VERSION_CODES.M) protected void generateKey() { try { keyStore = KeyStore.getInstance("AndroidKeyStore"); } catch (Exception e) { e.printStackTrace(); } KeyGenerator keyGenerator; try { keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, "AndroidKeyStore"); } catch (NoSuchAlgorithmException | NoSuchProviderException e) { throw new RuntimeException("Failed to get KeyGenerator instance", e); } try { keyStore.load(null); keyGenerator.init(new KeyGenParameterSpec.Builder(KEY_NAME, KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_CBC) .setUserAuthenticationRequired(true) .setEncryptionPaddings( KeyProperties.ENCRYPTION_PADDING_PKCS7) .build()); keyGenerator.generateKey(); } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException | CertificateException | IOException e) { throw new RuntimeException(e); } } @TargetApi(Build.VERSION_CODES.M) public boolean cipherInit() { try { cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" + KeyProperties.BLOCK_MODE_CBC + "/" + KeyProperties.ENCRYPTION_PADDING_PKCS7); } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { throw new RuntimeException("Failed to get Cipher", e); } try { keyStore.load(null); SecretKey key = (SecretKey) keyStore.getKey(KEY_NAME, null); cipher.init(Cipher.ENCRYPT_MODE, key); return true; } catch (KeyPermanentlyInvalidatedException e) { return false; } catch (KeyStoreException | CertificateException | UnrecoverableKeyException | IOException | NoSuchAlgorithmException | InvalidKeyException e) { throw new RuntimeException("Failed to init Cipher", e); } } }
ab73266f344b2cb8213f383cf0e5d947f5c7ab75
4746dfc69ef9033dfbcf6551ef246709c66f5ffb
/submission-phase5/java/action/ProvideDegreeDiscAction.java
86c3d936b173249ca062b838845b5c3c6b8f5bbd
[]
no_license
tassapola/cse135putttassapol
c32f451dc7d13279baeffae8ca3c0b9868f13de2
70f34bf6071d228686561daca4765611b6756c84
refs/heads/master
2021-01-20T09:09:23.432990
2010-12-05T00:25:42
2010-12-05T00:25:42
32,342,564
0
0
null
null
null
null
UTF-8
Java
false
false
1,824
java
package action; import java.sql.*; import java.util.*; import javax.servlet.http.*; import model.*; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.apache.struts.action.*; import form.*; public class ProvideDegreeDiscAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //System.out.println("excuting provide degree disc action"); ProvideDegreeDiscForm f = (ProvideDegreeDiscForm) form; /* System.out.println("form = " + f); System.out.println("discipline = " + f.getDiscipline()); System.out.println("otherDiscipline = " + f.getOtherDiscipline()); System.out.println("degreeMonth = " + f.getDegreeMonth()); System.out.println("degreeYear = " + f.getDegreeYear()); System.out.println("degreeGpa = " + f.getDegreeGpa()); System.out.println("degreeTitle = " + f.getDegreeTitle()); System.out.println("transcriptFile = " + f.getTranscriptFile()); */ HttpSession s = request.getSession(); s.setAttribute(Constants.SESS_DISCIPLINE, f.getDiscipline()); s.setAttribute(Constants.SESS_OTHER_DISCIPLINE, f.getOtherDiscipline()); s.setAttribute(Constants.SESS_DEG_MONTH, f.getDegreeMonth()); s.setAttribute(Constants.SESS_DEG_YEAR, f.getDegreeYear()); s.setAttribute(Constants.SESS_DEG_GPA, f.getDegreeGpa()); s.setAttribute(Constants.SESS_DEG_TITLE, f.getDegreeTitle()); s.setAttribute(Constants.SESS_DEG_TRANSCRIPT, (String) f.getTranscriptFile()); return mapping.findForward(Constants.FORWARD_SUCCESS); } }
[ "chilltassapola@16fcbdfc-56bc-7f80-26f2-9ba74a5772c8" ]
chilltassapola@16fcbdfc-56bc-7f80-26f2-9ba74a5772c8
c8de26880f974d1c23e6db6a890d5aa063fcbaf7
dd80a584130ef1a0333429ba76c1cee0eb40df73
/external/apache-http/src/org/apache/http/impl/io/ContentLengthInputStream.java
3b19c5b62f4574b6b542397842d13d5bd6d438cd
[ "MIT", "Apache-2.0" ]
permissive
karunmatharu/Android-4.4-Pay-by-Data
466f4e169ede13c5835424c78e8c30ce58f885c1
fcb778e92d4aad525ef7a995660580f948d40bc9
refs/heads/master
2021-03-24T13:33:01.721868
2017-02-18T17:48:49
2017-02-18T17:48:49
81,847,777
0
2
MIT
2020-03-09T00:02:12
2017-02-13T16:47:00
null
UTF-8
Java
false
false
7,778
java
/* * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ContentLengthInputStream.java $ * $Revision: 652091 $ * $Date: 2008-04-29 13:41:07 -0700 (Tue, 29 Apr 2008) $ * * ==================================================================== * 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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.http.impl.io; import java.io.IOException; import java.io.InputStream; import org.apache.http.io.SessionInputBuffer; /** * Stream that cuts off after a specified number of bytes. * Note that this class NEVER closes the underlying stream, even when close * gets called. Instead, it will read until the "end" of its chunking on * close, which allows for the seamless execution of subsequent HTTP 1.1 * requests, while not requiring the client to remember to read the entire * contents of the response. * * <p>Implementation note: Choices abound. One approach would pass * through the {@link InputStream#mark} and {@link InputStream#reset} calls to * the underlying stream. That's tricky, though, because you then have to * start duplicating the work of keeping track of how much a reset rewinds. * Further, you have to watch out for the "readLimit", and since the semantics * for the readLimit leave room for differing implementations, you might get * into a lot of trouble.</p> * * <p>Alternatively, you could make this class extend * {@link java.io.BufferedInputStream} * and then use the protected members of that class to avoid duplicated effort. * That solution has the side effect of adding yet another possible layer of * buffering.</p> * * <p>Then, there is the simple choice, which this takes - simply don't * support {@link InputStream#mark} and {@link InputStream#reset}. That choice * has the added benefit of keeping this class very simple.</p> * * @author Ortwin Glueck * @author Eric Johnson * @author <a href="mailto:[email protected]">Mike Bowler</a> * * @since 4.0 */ public class ContentLengthInputStream extends InputStream { private static final int BUFFER_SIZE = 2048; /** * The maximum number of bytes that can be read from the stream. Subsequent * read operations will return -1. */ private long contentLength; /** The current position */ private long pos = 0; /** True if the stream is closed. */ private boolean closed = false; /** * Wrapped input stream that all calls are delegated to. */ private SessionInputBuffer in = null; /** * Creates a new length limited stream * * @param in The session input buffer to wrap * @param contentLength The maximum number of bytes that can be read from * the stream. Subsequent read operations will return -1. */ public ContentLengthInputStream(final SessionInputBuffer in, long contentLength) { super(); if (in == null) { throw new IllegalArgumentException("Input stream may not be null"); } if (contentLength < 0) { throw new IllegalArgumentException("Content length may not be negative"); } this.in = in; this.contentLength = contentLength; } /** * <p>Reads until the end of the known length of content.</p> * * <p>Does not close the underlying socket input, but instead leaves it * primed to parse the next response.</p> * @throws IOException If an IO problem occurs. */ public void close() throws IOException { if (!closed) { try { byte buffer[] = new byte[BUFFER_SIZE]; while (read(buffer) >= 0) { } } finally { // close after above so that we don't throw an exception trying // to read after closed! closed = true; } } } /** * Read the next byte from the stream * @return The next byte or -1 if the end of stream has been reached. * @throws IOException If an IO problem occurs * @see java.io.InputStream#read() */ public int read() throws IOException { if (closed) { throw new IOException("Attempted read from closed stream."); } if (pos >= contentLength) { return -1; } pos++; return this.in.read(); } /** * Does standard {@link InputStream#read(byte[], int, int)} behavior, but * also notifies the watcher when the contents have been consumed. * * @param b The byte array to fill. * @param off Start filling at this position. * @param len The number of bytes to attempt to read. * @return The number of bytes read, or -1 if the end of content has been * reached. * * @throws java.io.IOException Should an error occur on the wrapped stream. */ public int read (byte[] b, int off, int len) throws java.io.IOException { if (closed) { throw new IOException("Attempted read from closed stream."); } if (pos >= contentLength) { return -1; } if (pos + len > contentLength) { len = (int) (contentLength - pos); } int count = this.in.read(b, off, len); pos += count; return count; } /** * Read more bytes from the stream. * @param b The byte array to put the new data in. * @return The number of bytes read into the buffer. * @throws IOException If an IO problem occurs * @see java.io.InputStream#read(byte[]) */ public int read(byte[] b) throws IOException { return read(b, 0, b.length); } /** * Skips and discards a number of bytes from the input stream. * @param n The number of bytes to skip. * @return The actual number of bytes skipped. <= 0 if no bytes * are skipped. * @throws IOException If an error occurs while skipping bytes. * @see InputStream#skip(long) */ public long skip(long n) throws IOException { if (n <= 0) { return 0; } byte[] buffer = new byte[BUFFER_SIZE]; // make sure we don't skip more bytes than are // still available long remaining = Math.min(n, this.contentLength - this.pos); // skip and keep track of the bytes actually skipped long count = 0; while (remaining > 0) { int l = read(buffer, 0, (int)Math.min(BUFFER_SIZE, remaining)); if (l == -1) { break; } count += l; remaining -= l; } this.pos += count; return count; } }
9d5155b45be002e6da9c1ca515a29eddeb1c231b
b04e82d070ec21c9d2bd554ad3e2f2066de0e06d
/app/controllers/CurrentOffer.java
644ce3800e865372f729d651a50fcd4463c14d7d
[]
no_license
rward/BookSkateMate
ab6732b779fcc7da5c8e863a4cb1e9a04eb79370
a46158b895b017bca817d3ef0e5943ea10a6cd2f
refs/heads/master
2020-05-21T11:34:23.166823
2013-05-07T21:21:17
2013-05-07T21:21:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,405
java
package controllers; import play.Logger; import play.data.DynamicForm; import play.data.Form; import play.mvc.Controller; import play.mvc.Result; import views.html.myOffers; import java.util.List; import models.Book; import models.Condition; import models.Student; import static play.data.Form.form; /** * Controller for offers that are currently active. * @author Robert Ward * */ public class CurrentOffer extends Controller { public static Result myOffers() { List<models.CurrentOffer> offerList = models.CurrentOffer.find().findList(); List<models.Book> bookList = models.Book.find().findList(); List<models.Condition> conditions = models.Condition.find().findList(); return ok(myOffers.render("",bookList,conditions,offerList,bookList.get(0).primaryKey," ",0L)); } public static Result myOffers(String message, boolean returnCode, Long selectedBook, Double price , Long conditionIndex ) { List<models.CurrentOffer> offerList = models.CurrentOffer.find().findList(); List<models.Book> bookList = models.Book.find().findList(); List<models.Condition> conditions = models.Condition.find().findList(); if (returnCode) { return ok(myOffers.render(message,bookList,conditions,offerList, selectedBook, price.toString(), conditionIndex)); } else { return badRequest(myOffers.render(message,bookList,conditions,offerList, selectedBook, price.toString(), conditionIndex)); } } /** * Response for a request the creation of a new request. * @return OK or badRequest based on whether new request created */ public static Result newOffer() { DynamicForm form = form().bindFromRequest(); Long bid = -1L; Long cid = -1L; if(form.data().get("bookKey") != null) { bid = Long.parseLong(form.data().get("bookKey")); } if(form.data().get("conditionKey") != null) { cid = Long.parseLong(form.data().get("conditionKey")); } Double price = 0.0; if(form.data().get("price") != null) { price = Double.parseDouble(form.data().get("price")); } Book dbBook = Book.find().byId(bid); Condition dbCondition = Condition.find().byId(cid); Student dbStudent = Student.find().findList().get(0); models.CurrentOffer newOffer = new models.CurrentOffer(price,dbCondition,dbBook, dbStudent); if(dbBook == null || dbStudent == null || dbStudent == null ) { return myOffers("The request StudetnId, BookId and Condtion name required.",false,bid,price,cid ); } try { newOffer.save(); } catch (Exception e) { return myOffers("The request StudetnId, BookId and Condtion name required.",false,bid,price ,cid ); } return myOffers("Offer Created.",true,bid,price,cid ); } /** * Response for a request for all the CurrentOffers available. * @return Either the string with list of CurrentOffers or the string "No Offers" */ public static Result index() { List<models.CurrentOffer> offers = models.CurrentOffer.find().findList(); return ok(offers.isEmpty() ? "No Offers" : offers.toString()); } /** * Response for a request the details CurrentOffers available. * @return Either the string details of an Offers or the string "No offer found" */ public static Result details(String studentId, String bookId) { models.CurrentOffer offer = models.CurrentOffer.find().where() .eq("student.studentId", studentId).eq("book.bookId", bookId).findUnique(); return (offer == null) ? notFound("No offer found") : ok(offer.toString()); } /** * Response for a request the deletion of an offer. * @return OK or badRequest based on whether it was deleted or not if offer does * not exist returns OK. * */ public static Result delete(String studentId, String bookId) { models.CurrentOffer offer = models.CurrentOffer.find().where().eq("student.studentId", studentId).eq("book.bookId", bookId).findUnique(); if (offer != null) { models.RemovedOffer removed = new models.RemovedOffer(offer); try { removed.save(); offer.delete(); } catch (Exception e) { return badRequest(" Request not removed."); } } return ok(); } }
608bfa37e952faf0b5bd4e3ee59d1b9ecc4f16c7
e3f340cc5040b1a40f2c7e965c3c6062f4e77494
/test/africa/semicolon/deitelExercises/tddTest/chapter_4/GasMileageTest.java
d22b88e5851454f95d56b19c489f73bcec81630b
[]
no_license
IfeanyiOsuji/Semicolon_Cohort-7-Exercises
cfde5470f4b4ed33197ca26fee29ecc0fa256518
1eb444df5c341dfcf114c899c7cd632f4cb7dec2
refs/heads/main
2023-07-30T19:57:18.496037
2021-09-12T19:54:53
2021-09-12T19:54:53
366,236,390
0
0
null
null
null
null
UTF-8
Java
false
false
1,043
java
package africa.semicolon.deitelExercises.tddTest.chapter_4; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @DisplayName("Gas Mileage") public class GasMileageTest { @BeforeEach void setUp(){ GasMileage gasMileage = new GasMileage(); } @Test void testMethodToCalculateMilesPerGallon(){ GasMileage gasMileage = new GasMileage(); assertEquals(25.0, gasMileage.calculateGasPerGallon(500, 20)); } @Test void showMilesPerGallonWhenMilesDrivenIs1000AndGallonUsedIs25(){ GasMileage gasMileage = new GasMileage(); assertEquals(40, gasMileage.calculateGasPerGallon(1000, 25)); } @Test void showMilesPerGallonWhenMilesDrivenIs2000AndGallonUsedIs30(){ GasMileage gasMileage = new GasMileage(); assertEquals(66.66666666666667, gasMileage.calculateGasPerGallon(2000, 30)); } }
695ecb9faaee2fe438d1573224c71881ce0d1d16
7fcb1bf31b2d952249378d477f74e21d73dc8bf3
/src/P339BXeniaAndRingroad.java
ce9738585018f39dea6ff36c17ffad05225ffcfa
[]
no_license
rebeckao/CodeForcesProblems
2e186889ca5534c19065c7fd4ffa26365e802a05
765c771809de3c4f55d2063ddb33ee997e4ed2a4
refs/heads/master
2021-09-11T00:13:52.776591
2018-03-19T16:47:19
2018-03-19T16:47:19
115,915,870
0
0
null
null
null
null
UTF-8
Java
false
false
1,050
java
import java.math.BigInteger; import java.util.Scanner; public class P339BXeniaAndRingroad { public static void main(String[] args) { Scanner in = new Scanner(System.in); int numberOfHouses = in.nextInt(); int numberOfTasks = in.nextInt(); int previousHouse = 1; BigInteger totalTime = BigInteger.ZERO; for (int i = 0; i < numberOfTasks; i++) { int nextHouse = in.nextInt(); if (nextHouse > previousHouse) { totalTime = totalTime .add(BigInteger.valueOf(nextHouse)) .subtract(BigInteger.valueOf(previousHouse)); } else if (nextHouse < previousHouse) { totalTime = totalTime .add(BigInteger.valueOf(numberOfHouses)) .subtract(BigInteger.valueOf(previousHouse)) .add(BigInteger.valueOf(nextHouse)); } previousHouse = nextHouse; } System.out.println(totalTime); } }
fcb75fe5f2746d9959684ea740641097d4b06af6
b369e3f8258bfbc635fb9d56626301ca6431a673
/src/main/java/com/example/service/UserService.java
c284cddb98f18b0d280c457d540d493a982f503b
[]
no_license
ynfatal/springboot2mybaitsdemo
46a01a4777f5948ba374897a141e68ab90a249df
66699cfcf554a1c63ee53ed7ccdef3082db9ade2
refs/heads/master
2020-03-26T13:28:26.850929
2018-08-17T09:39:53
2018-08-17T09:39:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
282
java
package com.example.service; import com.example.entity.User; import com.github.pagehelper.PageInfo; /** * @author: Fatal * @date: 2018/8/16 0016 11:55 */ public interface UserService { int addUser(User user); PageInfo<User> findAllUser(int pageNum, int pageSize); }
a67b4d9afc70b668d4e1cbd9e1a8a514f5702926
53ad8c9f75de09a1335dd0adfc6f7cd19d3a88fe
/src/main/java/com/chupin/ibanvalidator/validator/IbanFileListReader.java
7aa5ca2e87dfea9a0139ca199fccc242944601fc
[]
no_license
Hleb-Chupin/ibanValidator
485b47c5ff91e3997f8366aca26fa5a3f158add5
d047acc47df9a4ec966a01ae3caafcd8a945e7ac
refs/heads/master
2020-09-09T19:04:04.284065
2019-11-13T19:37:36
2019-11-13T19:37:36
221,536,595
0
0
null
null
null
null
UTF-8
Java
false
false
1,785
java
package com.chupin.ibanvalidator.validator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.xml.bind.ValidationException; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; @Component public class IbanFileListReader { @Autowired private IbanValidator ibanValidator; private String inputFileName; public String getInputFileName() { return inputFileName; } public void setInputFileName(String inputFileName) { this.inputFileName = inputFileName; } public List<String> readFile(String path) { this.inputFileName = path; try (Stream<String> stream = Files.lines(Paths.get(inputFileName))) { return stream.collect(Collectors.toList()); } catch (IOException e) { e.printStackTrace(); } return null; } public List<String> validateListIban(List<String> ibanList) { for (int i = 0; i < ibanList.size(); i++) { try { ibanList.set(i, ibanList.get(i) + ";" + ibanValidator.validate(ibanList.get(i))); } catch (ValidationException e) { e.printStackTrace(); } } System.out.println(ibanList); return ibanList; } public void writeFile(List<String> ibanList) { try (FileWriter writer = new FileWriter(inputFileName + ".out")) { for (String str : ibanList) { writer.write(str + System.lineSeparator()); } } catch (IOException e) { e.printStackTrace(); } } }
e7e1d8edd21dddea71d3202daa1e056b85ccce89
0c11dbb4b4b82f3b4c8a28e4ed8bba1529541e61
/BookCollection-Swing-Hsqldb/src/de/seipler/bookcollection/NamedEntity.java
8cab29590918650597b05953bb017ad0fd77fc17
[]
no_license
tecbeast/misc
706b7dfc4af4b9127d5f1fc19e118a4cc97d05f2
cf6a99e7dce0150b923695c7b2c425793e17effa
refs/heads/master
2021-03-22T05:02:03.423522
2016-08-22T13:51:10
2016-08-22T13:51:10
31,893,137
0
0
null
null
null
null
UTF-8
Java
false
false
1,255
java
package de.seipler.bookcollection; /** * * @author Georg Seipler */ public abstract class NamedEntity extends Entity implements Comparable { private String name; public NamedEntity() { this(ID_UNDEFINED); } public NamedEntity(int id) { super(id); setName(""); } public String getName() { return this.name; } public int compareTo(Object obj) { int result = 0; if (obj instanceof NamedEntity) { NamedEntity anotherEntity = (NamedEntity) obj; result = getName().compareToIgnoreCase(anotherEntity.getName()); } return result; } public boolean equals(Object obj) { boolean result = false; if (obj instanceof NamedEntity) { NamedEntity anotherEntity = (NamedEntity) obj; if ( ((getName() == null) && (anotherEntity.getName() != null)) || (getName().compareToIgnoreCase(anotherEntity.getName()) != 0) ) { result = false; } else { result = true; } } return result; } public String toString() { return getName(); } public void setName(String name) { if (name == null) { throw new IllegalArgumentException("Parameter name must not be null"); } this.name = name; } }
9443d04cc51be151ae15e998926b2cda136b8a37
6c0ed5bd14412605f06513f620792bf293504202
/poverenik/src/main/java/rs/pijz/server/poverenik/soap/client/IzvestajClient.java
6d9e75abf994cc1c3396f111f2c49d9796f6f09b
[]
no_license
gagi3/XML-2020
af05b1f3df1f73ef3c83398c869d968c490ff960
1d3b8b5f91f2e4b2a74deed24143a78b90e06625
refs/heads/dev
2023-03-01T21:50:16.732434
2021-02-06T22:07:35
2021-02-06T22:07:35
319,427,300
0
1
null
2021-02-06T16:34:17
2020-12-07T19:48:09
Java
UTF-8
Java
false
false
1,643
java
package rs.pijz.server.poverenik.soap.client; import org.springframework.ws.client.core.support.WebServiceGatewaySupport; import org.springframework.ws.soap.client.core.SoapActionCallback; import rs.pijz.server.poverenik.model.izvestaj.Izvestaj; import rs.pijz.server.poverenik.soap.communication.izvestaj.ExchangeIzvestajRequest; import rs.pijz.server.poverenik.soap.communication.izvestaj.ExchangeIzvestajResponse; import rs.pijz.server.poverenik.soap.communication.izvestaj.GetIzvestajRequest; import rs.pijz.server.poverenik.soap.communication.izvestaj.GetIzvestajResponse; public class IzvestajClient extends WebServiceGatewaySupport { private static String WSDL_URL = "http://localhost:8082/ws/izvestaj-soap.wsdl"; private static String GET_REQUEST_CALLBACK = "http://www.pijz.rs/izvestaj/GetIzvestajRequest"; private static String EXCHANGE_REQUEST_CALLBACK = "http://www.pijz.rs/izvestaj/ExchangeIzvestajRequest"; public GetIzvestajResponse getIzvestaj(String id) { GetIzvestajRequest request = new GetIzvestajRequest(); request.setId(id); GetIzvestajResponse response = (GetIzvestajResponse) getWebServiceTemplate().marshalSendAndReceive(WSDL_URL, request, new SoapActionCallback(GET_REQUEST_CALLBACK)); return response; } public ExchangeIzvestajResponse exchangeIzvestaj(Izvestaj izvestaj) { ExchangeIzvestajRequest request = new ExchangeIzvestajRequest(); request.setIzvestaj(izvestaj); ExchangeIzvestajResponse response = (ExchangeIzvestajResponse) getWebServiceTemplate().marshalSendAndReceive(WSDL_URL, request, new SoapActionCallback(EXCHANGE_REQUEST_CALLBACK)); return response; } }
197d04c2db7e820b0ce0290d59372a64ae0d741a
8af73b97c606d5ad0b0acba3463cbb4a4bbf2eef
/src/com/javarush/test/level08/lesson11/home02/Solution.java
08c26e3fabfa8799991ef7e59f5b4b1260894772
[]
no_license
alimogh/JavaRush
4d93d9b363344ea98ed3143c221b0f8107156ffb
6e164e50bc326d832d613639a4946a5c5af91f77
refs/heads/master
2021-05-31T07:36:29.760973
2016-03-04T11:31:11
2016-03-04T11:31:11
294,372,520
1
0
null
2020-09-10T10:04:29
2020-09-10T10:04:28
null
UTF-8
Java
false
false
3,131
java
package com.javarush.test.level08.lesson11.home02; import java.util.HashSet; import java.util.Iterator; import java.util.Set; /* Множество всех животных 1. Внутри класса Solution создать public static классы Cat, Dog.+ 2. Реализовать метод createCats, котороый должен возвращать множество с 4 котами.+ 3. Реализовать метод createDogs, котороый должен возвращать множество с 3 собаками.+ 4. Реализовать метод join, котороый должен возвращать объединенное множество всех животных - всех котов и собак. 5. Реализовать метод removeCats, котороый должен удалять из множества pets всех котов, которые есть в множестве cats. 6. Реализовать метод printPets, котороый должен выводить на экран всех животных, которые в нем есть. Каждое животное с новой строки */ public class Solution { public static class Cat { } public static class Dog { } public static void main(String[] args) { Set<Cat> cats = createCats(); Set<Dog> dogs = createDogs(); Set<Object> pets = join(cats, dogs); printPets(pets); removeCats(pets, cats); printPets(pets); } public static Set<Cat> createCats() { HashSet<Cat> result = new HashSet<Cat>(); result.add(new Cat()); result.add(new Cat()); result.add(new Cat()); result.add(new Cat()); //напишите тут ваш код return result; } public static Set<Dog> createDogs() { HashSet<Dog> dog = new HashSet<Dog>(); dog.add(new Dog()); dog.add(new Dog()); dog.add(new Dog()); //напишите тут ваш код return dog; } public static Set<Object> join(Set<Cat> cats, Set<Dog> dogs) { Set<Object> pets = new HashSet<Object>(); //Написать тут ваш код Iterator<Cat>literator=cats.iterator(); while(literator.hasNext()){ Cat t = literator.next(); pets.add(t); } Iterator<Dog>iterator=dogs.iterator(); while(iterator.hasNext()){ Dog t = iterator.next(); pets.add(t); } return pets; } public static void removeCats(Set<Object> pets, Set<Cat> cats) { Iterator<Cat> qwer = cats.iterator(); while (qwer.hasNext()) { Cat d = qwer.next(); pets.remove(d); } //напишите тут ваш код } public static void printPets(Set<Object> pets) { for (Object p : pets) { System.out.println(p); } //напишите тут ваш код } //напишите тут ваш код }
cb8195bd3874da897b90f84cce4897d25b2fe126
126737f19665eb481721835078e9c0eed8188b98
/common-contentlang/src/main/java/jade/content/OntoACLMessage.java
c8e6a9d3fd5640b4595b2a361a59a5c5c9894154
[]
no_license
Maatary/ocean
dbf9ca093fbbb3350c9fb951cb9c6c06847846c2
975275d895d49983e15a3994107fe7f233dfc360
refs/heads/master
2021-03-12T19:55:15.712623
2015-03-25T00:44:42
2015-03-25T00:45:22
32,831,722
0
0
null
null
null
null
UTF-8
Java
false
false
4,232
java
/** * *************************************************************** * JADE - Java Agent DEvelopment Framework is a framework to develop * multi-agent systems in compliance with the FIPA specifications. * Copyright (C) 2000 CSELT S.p.A. * * GNU Lesser General Public License * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * ************************************************************** *//* package jade.content; import jade.lang.acl.ACLMessage; import jade.core.AID; import jade.util.leap.List; import jade.util.leap.Iterator; import jade.content.abs.*; import jade.content.onto.*; *//** * Utility class that allow using an <code>ACLMessage</code> object * as an ontological agent action. * @author Giovanni Caire - TILAB *//* public class OntoACLMessage extends ACLMessage implements AgentAction { *//** * Construct an ontological ACL message whose performative * is ACLMessage.NOT_UNDERSTOOD *//* public OntoACLMessage() { super(ACLMessage.NOT_UNDERSTOOD); } *//** * Construct an ontological ACL message with a given * performative * @param performative the performative of this ACL message. * @see ACLMessage#ACLMessage(int) *//* public OntoACLMessage(int performative) { super(performative); } *//** * Create an ontological ACL message that wraps an existing * <code>ACLMessage</code>. * @param msg the <code>ACLMessage</code>to be wrapped. If * <code>msg</code> * is already an ontological ACL message no new object is * created and <code>msg</code> is returned with the sender * and receivers properly wrapped if necessary. *//* public static OntoACLMessage wrap(ACLMessage msg) { OntoACLMessage wrapper = null; if (msg != null) { if (msg instanceof OntoACLMessage) { wrapper = (OntoACLMessage) msg; } else { wrapper = new OntoACLMessage(msg.getPerformative()); // This automatically performs the wrapping wrapper.setSender(msg.getSender()); Iterator it = msg.getAllReceiver(); while (it.hasNext()) { // This automatically performs the wrapping wrapper.addReceiver((AID) it.next()); } it = msg.getAllReplyTo(); while (it.hasNext()) { // This automatically performs the wrapping wrapper.addReplyTo((AID) it.next()); } wrapper.setLanguage(msg.getLanguage()); wrapper.setOntology(msg.getOntology()); wrapper.setProtocol(msg.getProtocol()); wrapper.setInReplyTo(msg.getInReplyTo()); wrapper.setReplyWith(msg.getReplyWith()); wrapper.setConversationId(msg.getConversationId()); wrapper.setReplyByDate(msg.getReplyByDate()); if (msg.hasByteSequenceContent()) { wrapper.setByteSequenceContent(msg.getByteSequenceContent()); } else { wrapper.setContent(msg.getContent()); } wrapper.setEncoding(msg.getEncoding()); //FIXME: Message Envelope is missing } } return wrapper; } *//** * This method is redefined so that the sender AID is automatically * wrapped into an OntoAID *//* public void setSender(AID aid) { super.setSender(OntoAID.wrap(aid)); } *//** * This method is redefined so that the receiver AID is automatically * wrapped into an OntoAID *//* public void addReceiver(AID aid) { super.addReceiver(OntoAID.wrap(aid)); } *//** * This method is redefined so that the replyTo AID is automatically * wrapped into an OntoAID *//* public void addReplyTo(AID aid) { super.addReplyTo(OntoAID.wrap(aid)); } // FIXME: clone method should be redefined too } */
8ba95ae7e3d93d6de4e970eb135b97b8c63e1e35
88a6154c5090f7f9b2cd8b275e086968b05081d6
/src/main/java/dev/wuffs/itshallnottick/ItShallNotTick.java
de427d8b521e682c165da4b03171534ba5d63028
[]
no_license
nanite/ItShallNotTick
be619f0c337475c7e795b4f4127349a9b8702e79
f0f1d4fe13416ee87b8c3e2650822b2af48df638
refs/heads/main
2023-06-10T15:42:57.749694
2022-08-24T21:26:21
2022-08-24T21:26:21
487,550,995
0
3
null
null
null
null
UTF-8
Java
false
false
2,068
java
package dev.wuffs.itshallnottick; import dev.wuffs.itshallnottick.integration.FTBChunks; import dev.wuffs.itshallnottick.network.PacketHandler; import dev.wuffs.itshallnottick.network.SendMinPlayerPacket; import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @Mod(ItShallNotTick.MODID) public class ItShallNotTick { public static final String MODID = "itshallnottick"; public static final Logger LOGGER = LogManager.getLogger("ISNT"); public static boolean isFTBChunksLoaded = false; public static int minPlayer; public ItShallNotTick() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.CONFIG); isFTBChunksLoaded = ModList.get().isLoaded("ftbchunks"); if (isFTBChunksLoaded) { FTBChunks.setup(); } PacketHandler.regsiter(); modEventBus.addListener(this::commonSetup); MinecraftForge.EVENT_BUS.register(this); } public void commonSetup(FMLCommonSetupEvent event){ minPlayer = Config.minPlayers.get(); } @SubscribeEvent @OnlyIn(Dist.DEDICATED_SERVER) public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { PacketHandler.sendToClient(new SendMinPlayerPacket(minPlayer), (ServerPlayer) event.getEntity()); } }
3e23330f68d674af5974c5c1611bdafd20f7c409
891ae74be3edd5625a235af573b3d82a7b2cb797
/server/src/main/java/com/tuofan/core/TimeUtils.java
f8d2fb13e69038af2082cf0abe30aafa5bc4b15c
[]
no_license
wangyongst/billStar
87bfc8d7405d6b04639e040d5140b582fc56ac38
0519cff9b08539974adcfbe0b51b926a06bb3a1b
refs/heads/master
2022-12-22T03:44:22.394837
2020-03-16T09:39:56
2020-03-16T09:39:56
240,644,022
0
0
null
2022-12-10T08:08:14
2020-02-15T04:22:21
Vue
UTF-8
Java
false
false
1,090
java
package com.tuofan.core; import java.util.Calendar; import java.util.Date; public class TimeUtils { public static Date month(Integer before) { Calendar calendar = Calendar.getInstance();// 获取当前日期 calendar.add(Calendar.YEAR, 0); calendar.add(Calendar.MONTH, -before); calendar.set(Calendar.DAY_OF_MONTH, 1);// 设置为1号,当前日期既为本月第一天 calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return new Date(calendar.getTimeInMillis()); } public static Date day(int before) { Calendar calendar = Calendar.getInstance();// 获取当前日期 calendar.add(Calendar.YEAR, 0); calendar.add(Calendar.MONTH, 0); calendar.add(Calendar.DAY_OF_MONTH, -before);// 设置为1号,当前日期既为本月第一天 calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); return new Date(calendar.getTimeInMillis()); } }
c0f58a0e8d95e6c4c7527477c5d1b99d643f083f
ba90ba9bcf91c4dbb1121b700e48002a76793e96
/com-gameportal-admin/src/main/java/com/gameportal/manage/order/controller/CCAndGroupController.java
574e29b3dcf18acdf7d25d2dd8d9e3696995316a
[]
no_license
portalCMS/xjw
1ab2637964fd142f8574675bd1c7626417cf96d9
f1bdba0a0602b8603444ed84f6d7afafaa308b63
refs/heads/master
2020-04-16T13:33:21.792588
2019-01-18T02:29:40
2019-01-18T02:29:40
165,632,513
0
9
null
null
null
null
UTF-8
Java
false
false
3,541
java
package com.gameportal.manage.order.controller; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONObject; import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.gameportal.manage.order.model.CCAndGroup; import com.gameportal.manage.order.service.ICCAndGroupService; import com.gameportal.manage.order.service.ICCGroupService; import com.gameportal.manage.pojo.ExceptionReturn; import com.gameportal.manage.pojo.ExtReturn; import com.gameportal.manage.pojo.GridPanel; import com.gameportal.manage.redis.service.IRedisService; import com.gameportal.manage.system.service.ISystemService; @Controller @RequestMapping(value = "/manage/ccandgroup") public class CCAndGroupController { private static final Logger logger = Logger .getLogger(CCAndGroupController.class); @Resource(name = "cCAndGroupServiceImpl") private ICCAndGroupService cCAndGroupService = null; @Resource(name = "cCGroupServiceImpl") private ICCGroupService cCGroupService = null; @Resource(name = "systemServiceImpl") private ISystemService systemService = null; @Resource(name = "redisServiceImpl") private IRedisService iRedisService = null; public CCAndGroupController() { super(); } @RequestMapping(value = "/index") public String index( @RequestParam(value = "id", required = false) String id, HttpServletRequest request, HttpServletResponse response) { response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0); request.setAttribute("id", id); // `status` int(2) default NULL COMMENT '状态 0未锁定 1锁定', JSONObject map = new JSONObject(); map.put("0", "未锁定"); map.put("1", "锁定"); request.setAttribute("statusMap", map.toString()); return "com.gameportal.manage.order/cCAndGroup"; } @RequestMapping(value = "/queryCCAndGroup") public @ResponseBody Object queryCCAndGroup( @RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "start", required = false) Integer startNo, @RequestParam(value = "limit", required = false) Integer pageSize, HttpServletRequest request, HttpServletResponse response) { Map<String, Object> params = new HashMap<String, Object>(); if (null!=status) { params.put("status", status); } Long count = cCAndGroupService.queryCCAndGroupCount(params); List<CCAndGroup> list = cCAndGroupService.queryCCAndGroup(params, startNo, pageSize); return new GridPanel(count, list, true); } @RequestMapping("/del/{id}") @ResponseBody public Object delCCAndGroup(@PathVariable Long id) { try { if (!StringUtils.isNotBlank(ObjectUtils.toString(id))) { return new ExtReturn(false, "主键不能为空!"); } if (cCAndGroupService.deleteCCAndGroup(id)) { return new ExtReturn(true, "删除成功!"); } else { return new ExtReturn(false, "删除失败!"); } } catch (Exception e) { logger.error("Exception: ", e); return new ExceptionReturn(e); } } }
c54f3383fade56f4606ef8b15d02f294cc72bef9
33b333ac9411247f544724fd90ef907eeea4ab4e
/src/com/elecfreaks/bleexample/MyArray.java
8fef6e971ae7399009610c77f515c76738b22b74
[]
no_license
varoteamulya/Final-Year-Bachelor-of-Engineering-project-2016
9ebca3285f5b8b02dfe5d4ff9076fc99014aaf38
845ae5e6a377aa463cfabb8e2a8dd1234a4712c6
refs/heads/master
2021-04-09T10:22:15.318216
2018-03-15T05:00:05
2018-03-15T05:00:05
125,314,369
0
0
null
null
null
null
UTF-8
Java
false
false
524
java
package com.elecfreaks.bleexample; public class MyArray { static public byte[] arrayCat(byte[] buf1,byte[] buf2){ byte[] bufret=null; int len1 = 0; int len2 = 0; if(buf1 != null) len1 = buf1.length; if(buf2 != null) len2 = buf2.length; if(len1+len2 > 0) bufret = new byte[len1+len2]; if(len1 > 0) System.arraycopy(buf1, 0, bufret, 0, len1); if(len2 > 0) System.arraycopy(buf2, 0, bufret, len1, len2); return bufret; } }
[ "varoteamulya" ]
varoteamulya
d27a4655ce95b8e95de2ed661e998ee0450a06d7
596f96b33b8d4e20dabab73e2da665c3d455a0f2
/sofa-ark-parent/core/spi/src/main/java/com/alipay/sofa/ark/spi/constant/Constants.java
4836c51ea71a904e74ccad9e1fc771832f52b286
[ "Apache-2.0" ]
permissive
jackge007/sofa-ark
5f5f68c55c8c0dc9b80225ae1e723d32bbce00a9
5d15c3fa1ae5e57778febfcec78ac5ccf8926cdc
refs/heads/master
2020-04-25T13:51:04.199821
2019-02-25T09:52:13
2019-02-25T09:52:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,409
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alipay.sofa.ark.spi.constant; /** * @author qilong.zql * @since 0.1.0 */ public class Constants { /** * String Constants */ public final static String SPACE_SPLIT = "\\s+"; public final static String STRING_COLON = ":"; public final static String TELNET_STRING_END = new String(new byte[] { (byte) 13, (byte) 10 }); public final static String COMMA_SPLIT = ","; /** * ark conf */ public final static String CONF_BASE_DIR = "conf/"; public final static String ARK_CONF_BASE_DIR = "conf/ark"; public final static String ARK_CONF_FILE = "bootstrap.properties"; public final static String ARK_CONF_FILE_FORMAT = "bootstrap-%s.properties"; public final static String DEFAULT_PROFILE = ""; /** * plugin conf, multi value is split by comma. */ public final static String PLUGIN_ACTIVE_INCLUDE = "ark.plugin.active.include"; public final static String PLUGIN_ACTIVE_EXCLUDE = "ark.plugin.active.exclude"; /** * biz conf, multi value is split by comma. */ public final static String BIZ_ACTIVE_INCLUDE = "ark.biz.active.include"; public final static String BIZ_ACTIVE_EXCLUDE = "ark.biz.active.exclude"; /** * Archiver Marker */ public final static String ARK_CONTAINER_MARK_ENTRY = "com/alipay/sofa/ark/container/mark"; public final static String ARK_PLUGIN_MARK_ENTRY = "com/alipay/sofa/ark/plugin/mark"; public final static String ARK_BIZ_MARK_ENTRY = "com/alipay/sofa/ark/biz/mark"; /** * Ark Plugin Attribute */ public final static String PRIORITY_ATTRIBUTE = "priority"; public final static String GROUP_ID_ATTRIBUTE = "groupId"; public final static String ARTIFACT_ID_ATTRIBUTE = "artifactId"; public final static String PLUGIN_NAME_ATTRIBUTE = "pluginName"; public final static String PLUGIN_VERSION_ATTRIBUTE = "version"; public final static String ACTIVATOR_ATTRIBUTE = "activator"; public final static String IMPORT_CLASSES_ATTRIBUTE = "import-classes"; public final static String IMPORT_PACKAGES_ATTRIBUTE = "import-packages"; public final static String EXPORT_CLASSES_ATTRIBUTE = "export-classes"; public final static String EXPORT_PACKAGES_ATTRIBUTE = "export-packages"; /** * Ark Biz Attribute */ public final static String MAIN_CLASS_ATTRIBUTE = "Main-Class"; public final static String ARK_BIZ_NAME = "Ark-Biz-Name"; public final static String ARK_BIZ_VERSION = "Ark-Biz-Version"; public final static String DENY_IMPORT_CLASSES = "deny-import-classes"; public final static String DENY_IMPORT_PACKAGES = "deny-import-packages"; public final static String DENY_IMPORT_RESOURCES = "deny-import-resources"; public final static String PACKAGE_PREFIX_MARK = "*"; public final static String DEFAULT_PACKAGE = "."; public final static String MANIFEST_VALUE_SPLIT = COMMA_SPLIT; public final static String IMPORT_RESOURCES_ATTRIBUTE = "import-resources"; public final static String EXPORT_RESOURCES_ATTRIBUTE = "export-resources"; public final static String SUREFIRE_BOOT_CLASSPATH = "Class-Path"; public final static String SUREFIRE_BOOT_CLASSPATH_SPLIT = " "; /** * Telnet Server */ public final static String TELNET_SERVER_ENABLE = "sofa.ark.telnet.server.enable"; public final static String TELNET_PORT_ATTRIBUTE = "sofa.ark.telnet"; public final static int DEFAULT_TELNET_PORT = 1234; public final static int DEFAULT_SELECT_PORT_SIZE = 100; public final static String TELNET_SERVER_WORKER_THREAD_POOL_NAME = "telnet-server-worker"; public final static String TELNET_SESSION_PROMPT = "sofa-ark>"; public final static int BUFFER_CHUNK = 128; /** * Event */ public final static String BIZ_EVENT_TOPIC_AFTER_INVOKE_BIZ_START = "AFTER-INVOKE-BIZ-START"; public final static String BIZ_EVENT_TOPIC_AFTER_INVOKE_BIZ_STOP = "AFTER-INVOKE-BIZ-STOP"; /** * Environment Properties */ public final static String SPRING_BOOT_ENDPOINTS_JMX_ENABLED = "endpoints.jmx.enabled"; public final static String LOG4J_IGNORE_TCL = "log4j.ignoreTCL"; /** * Command Provider */ public final static String PLUGIN_COMMAND_UNIQUE_ID = "plugin-command-provider"; /** * Ark SPI extension */ public final static String EXTENSION_FILE_DIR = "META-INF/services/sofa-ark/"; public final static String PLUGIN_CLASS_LOADER_HOOK = "plugin-classloader-hook"; public final static String BIZ_CLASS_LOADER_HOOK = "biz-classloader-hook"; }
6d51d2190d3e35b14ad77c7829cd0ea043aeb5ad
6453f9f46528830e53442af2fcba1a4942b8d87c
/6_collections/oefeningen/COL_Oef3/src/ui/CryptoGraphieApplicatie.java
57763fc1d2a4124087ee177ecdef927406751f9b
[]
no_license
henridev/object-oriented-programming-II
6bcd10853d17a6df4411046ef69ebd6c0310c461
40101121ae4856dd8f87478339d6b923ecc2632c
refs/heads/main
2023-04-16T08:24:31.045475
2021-04-25T16:10:25
2021-04-25T16:10:25
337,959,771
0
0
null
null
null
null
UTF-8
Java
false
false
613
java
package ui; import domein.DomeinController; public class CryptoGraphieApplicatie { private DomeinController dc; public CryptoGraphieApplicatie(DomeinController dc) { this.dc = dc; } public void start() { dc.codeerBericht("angstschreeuw"); System.out.println(dc.getGecodeerdBericht()); dc.codeerBericht("de pannenkoek"); System.out.println(dc.getGecodeerdBericht()); dc.codeerBericht("bravo"); System.out.println(dc.getGecodeerdBericht()); dc.codeerBericht("aap"); System.out.println(dc.getGecodeerdBericht()); } }
c0a47fcc7825e4d2257ba5f7dac42304fc18229e
bc4ffed35623458f4b379aaaaf49bd2b15d33eeb
/Duplicate.java
a2df8f0949fcd187be401fb4d88a4b507e6e0181
[]
no_license
aishaansari29/30081998
9831654fd3ae1da95f810c57f99e9d4b61cb06d9
fa686633341b21a106a81ea9fceb585afc113fe8
refs/heads/master
2020-04-01T11:30:25.121098
2019-03-10T17:03:11
2019-03-10T17:03:11
153,165,322
0
0
null
null
null
null
UTF-8
Java
false
false
625
java
import java.util.*; class Duplicate { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] a=new int[n]; for(int i=0;i<n;i++) a[i]=sc.nextInt(); List<Integer> al=new ArrayList<Integer>(); for(int i=0;i<n;i++) { al.add(a[i]); } int count=0; Set<Integer> set=new TreeSet<Integer>(al); for(Integer h:set) { count=Collections.frequency(al,h); if(count>1) { System.out.print(h+" "); } } } }
8cc969570cb70d17c0ac0372316896db0f597fe9
15809c170be102b04c93617d8912944795480c8c
/src/main/java/com/excelsiormc/excelsiorsponge/excelsiorcore/services/chat/ChatPlayerTitle.java
b6a9ee26ab0640aa0e808ab68054c620902f9706
[]
no_license
Jimmeh94/ExcelsiorSponge
0de39e619bf35accf0d66e061667ccbabb080665
24b94332c883d68ee98a5818e2a09bab3ebf8f31
refs/heads/master
2020-03-28T16:29:26.750255
2018-10-18T21:33:59
2018-10-18T21:33:59
148,700,769
0
0
null
null
null
null
UTF-8
Java
false
false
289
java
package com.excelsiormc.excelsiorsponge.excelsiorcore.services.chat; public enum ChatPlayerTitle { TEST("Test"); private String display; ChatPlayerTitle(String display){this.display = display;} public String getDisplay(){ return "[" + display + "] "; } }
819a6a5bc7c6009d4623f47b4ccbb566e6384ea4
db6859dc99912ece5f9333aa7ab1d4d50c9a146c
/src/main/java/com/example/algamoney/api/token/RefreshTokenCookiePreProcessorFilter.java
af891a5b5eacc2ede6c695dfdefbc9e74be2b962
[]
no_license
vjmp06/algamoney-api-04
918df74ac91fc4abfa559f4a0988f36ee845e83b
458b086491996ea046e4f6ff45e3aa7828aa6d42
refs/heads/master
2020-04-07T17:56:15.538357
2018-11-21T23:57:31
2018-11-21T23:57:31
158,590,074
0
0
null
null
null
null
UTF-8
Java
false
false
2,021
java
package com.example.algamoney.api.token; import java.io.IOException; import java.util.Map; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import org.apache.catalina.util.ParameterMap; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; @Component @Order(Ordered.HIGHEST_PRECEDENCE) public class RefreshTokenCookiePreProcessorFilter implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; if("/oauth/token".equalsIgnoreCase(req.getRequestURI()) && "refresh_token".equals(req.getParameter("grant_type")) && req.getCookies() != null){ for(Cookie cookie : req.getCookies()) { if(cookie.getName().equals("refreshToken")) { String refreshToken = cookie.getValue(); req = new MyServletRequestWrapper(req, refreshToken); } } } chain.doFilter(req, response); } @Override public void destroy() { } @Override public void init(FilterConfig filterConfig) throws ServletException { } static class MyServletRequestWrapper extends HttpServletRequestWrapper{ private String refreshToken; public MyServletRequestWrapper(HttpServletRequest request, String refreshToken) { super(request); this.refreshToken = refreshToken; } @Override public Map<String, String[]> getParameterMap() { ParameterMap<String, String[]> map = new ParameterMap<>(getRequest().getParameterMap()); map.put("refresh_token", new String[] {refreshToken}); map.setLocked(true); return map; } } }
04fbf24d59d3ccbd0f7f5c79d89df05aaabfb291
086df42272528be7b414dcd6c05d74e04a939aef
/src/main/java/esprit/fgsc/PROJETMICROSERVICES/services/ProjetService.java
e6ab9300962d170ce392314ddcb1fd3eb407c48a
[]
no_license
ESPRIT-TWIN-MICROSERVICES-FGSC/PROJET_MICROSERVICE
b02be086a5aadfe1ada08b186422e443e9b591ac
cc2a288fa03902ad2a87ed0311c4c162e9027610
refs/heads/main
2023-08-24T04:46:14.391618
2021-10-28T00:28:42
2021-10-28T00:28:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,520
java
package esprit.fgsc.PROJETMICROSERVICES.services; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import esprit.fgsc.PROJETMICROSERVICES.entities.Projet; import esprit.fgsc.PROJETMICROSERVICES.repository.IProjetRepository; @Service public class ProjetService { private static final DateFormat sdf = new SimpleDateFormat("dd/MM/YYYY"); @Autowired private IProjetRepository projetRepository; public Projet addProjet(Projet projet) { return projetRepository.save(projet); } public List<Projet>getAllProjet(){ return projetRepository.findAll(); } public void deleteProjet(String id) { projetRepository.deleteById(id); } public Projet updateProjet(String id,Projet newProjet) { if(projetRepository.findById(id).isPresent()) { Projet existingProjet = projetRepository.findById(id).get(); existingProjet.setClientEmail(newProjet.getClientEmail()); existingProjet.setClientName(newProjet.getClientName()); existingProjet.setProjectName(newProjet.getProjectName()); existingProjet.setTeamSize(newProjet.getTeamSize()); existingProjet.setStartDate( newProjet.getStartDate()); existingProjet.setEndDate(newProjet.getEndDate()); return projetRepository.save(existingProjet); }else { return null; } } public Projet getProjetById(String id) { return projetRepository.findById(id).get(); } }
c166267424f114816a669b61dcb5deaac8823a1e
de91657cdaf0d5f582beda30274c01675899b9f5
/JavaProgramming/src/ch04/exma02/DowhileExample.java
b35d690e209b3b9ab90c78a0ecb5d4287c23e238
[]
no_license
JinByeungKu/MyRepository
98722e827e5cae9029efd146d289ad7e132371f1
e478ba492d069de53fe5a6151bb296fd2daed9d4
refs/heads/master
2020-04-12T08:49:45.275190
2016-11-16T06:12:53
2016-11-16T06:12:53
65,832,475
0
0
null
null
null
null
UTF-8
Java
false
false
222
java
package ch04.exma02; public class DowhileExample { public static void main(String[] args) throws Exception { int num =0; do{ num = System.in.read(); System.out.println(num); } while(num !=113); } }
b21dc54dfeca12a2fbc6ff5619fb18ff92e7883b
336db3411a181742710b4e135cdeb58cad706f26
/gis_game/src/File_format/Csv2Game.java
7dfe38c4f53031ccaed668f6ae40ad5dedb48923
[]
no_license
8onlichtman/gis
cc496c13c14b7b347d42660752e181e55527768d
78f497599d4711df4cdf49db107be9817fbed794
refs/heads/master
2020-04-08T11:26:10.491890
2018-12-30T12:36:15
2018-12-30T12:36:15
159,303,883
0
0
null
null
null
null
UTF-8
Java
false
false
2,427
java
package File_format; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import Coords.Lat_lon_alt; import game_elements.Fruit; import game_elements.Game; import game_elements.Packman; /** * This class converts a csv file to a game. * @author Eitan Lichtman, Netanel Indik */ public class Csv2Game { /** * This constructor initiates the BufferedReader by a given input file path. * @param input */ public Csv2Game(String input) { try { reader = new BufferedReader(new FileReader(input)); } catch (IOException e) { System.out.println("invalid input folder!"); } } /** * This method reads the csv file, creates and returns a game. * @return game * @throws IOException */ public Game run() throws IOException{ try { String tl = reader.readLine(); String[] titles = tl.split(","); Game game = to_game(titles); reader.close(); return game; } catch (IOException e) { e.printStackTrace(); return null; } } //********************private data and methods******************** private BufferedReader reader; private Game to_game(String[] titles) { int sum_p = Integer.parseInt(titles[7]); int sum_f = Integer.parseInt(titles[8]); ArrayList<Packman> packmans = new ArrayList<Packman>(); ArrayList<Fruit> fruits = new ArrayList<Fruit>(); String thisLine; try { for(int i = 0; i < sum_p; i++) { thisLine = reader.readLine(); String [] current = thisLine.split(","); double lat=Double.parseDouble(current[2]); double lon=Double.parseDouble(current[3]); double alt=Double.parseDouble(current[4]); Lat_lon_alt gps_point = new Lat_lon_alt(lat,lon,alt); double weight=Double.parseDouble(current[5]); double radius=Double.parseDouble(current[6]); Packman p = new Packman(gps_point, weight, radius); packmans.add(p); } for(int i = 0; i < sum_f; i++) { thisLine = reader.readLine(); String [] current = thisLine.split(","); double lat=Double.parseDouble(current[2]); double lon=Double.parseDouble(current[3]); double alt=Double.parseDouble(current[4]); Lat_lon_alt gps_point = new Lat_lon_alt(lat,lon,alt); Fruit f = new Fruit(gps_point); fruits.add(f); } Game game = new Game(packmans, fruits); return game; } catch (IOException e) { e.printStackTrace(); return null; } } }
09c8b0f547eaf2434c3591ac4098b67eb21a92a0
481de44bdac308b02beef3fa6f4f4e576c44c5ff
/src/main/resources/archetype-resources/core/src/main/java/core/cache/HealthCheckResourceHystrixClientCache.java
8107acc6dea7fbded5d6352d3c2b15ff85ac45f1
[]
no_license
biins/microservice-archetype
82931baf8c74b433b691e67069e52fde132e6cb3
e3fa3e081527ce858d67b6062c98200cdcbd4f1a
refs/heads/master
2021-06-07T21:11:28.381899
2016-09-28T19:01:01
2016-09-28T19:10:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,086
java
package ${package}.core.cache; import java.util.Optional; import javax.inject.Inject; import ${package}.client.api.test.Message; import ${package}.client.http.HealthCheckResourceHystrixClient; import org.biins.commons.hystrix.HystrixCacheLoader; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; import org.springframework.cache.interceptor.SimpleKey; import org.springframework.stereotype.Component; @Component public class HealthCheckResourceHystrixClientCache { private final HealthCheckResourceHystrixClient client; private final Cache cache; @Inject public HealthCheckResourceHystrixClientCache(HealthCheckResourceHystrixClient client, CacheManager cacheManager) { this.client = client; this.cache = cacheManager.getCache("hello"); } public Optional<Message> sayHello(String name, String origin) { return HystrixCacheLoader.of(new SimpleKey(name, origin), Message.class) .with(cache) .getAndSet(() -> client.sayHelloToHystrixCommand(name, origin)); } }
3d0b49a569955b714450448162c0bbbf1bf50428
0655766295c16f9d82036c17cb1e051957f3a6cc
/src/main/java/fr/insa/fmc/javaback/wrapper/AuthentificationTokenWrapper.java
9abe439e12005b6e98c6ebbc576ba008cebc65b2
[]
no_license
hexif2019/fmc-java-back
f86096f49bf2354cd52058e21e716180c8bad5dc
ead72d8bed0195b17f5b8b14673448820080755b
refs/heads/master
2020-03-13T12:17:35.815888
2018-05-04T07:20:58
2018-05-04T07:20:58
131,116,298
0
0
null
2018-05-04T02:44:58
2018-04-26T07:22:17
Java
UTF-8
Java
false
false
409
java
package fr.insa.fmc.javaback.wrapper; public class AuthentificationTokenWrapper { private String email; private String token; public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } }
f9cb1cfe0c0ce4750008811ae29c7247b87235ee
c99f445a9e71103eb824e718ab01a322e241844d
/SD2x Homework7/src/RandomizedMazeGame.java
19a193bebc059362d50a6c5a69f393a7b25bb96e
[]
no_license
Afrim124/SD2x_Data-Structures-and-Software-Design
489ea32a75027fe3065bbf36063475bdfd3e427c
8da224aee40de175b64304617db46e0efedb3cdb
refs/heads/master
2022-11-09T00:18:16.111358
2020-06-30T15:10:53
2020-06-30T15:10:53
276,129,986
1
0
null
null
null
null
UTF-8
Java
false
false
358
java
import java.util.Collections; import java.util.Random; public class RandomizedMazeGame extends MazeGame { public RandomizedMazeGame() { super(); } public Maze randomize(int roomNumbers) { Random r = new Random(roomNumbers); MazeGame mazegame = new MazeGame(roomNumbers); //Collections.shuffle(mazegame.maze.rooms); return mazegame.maze; } }
8747d8859c2863fea9cfd886bd2dbf2f8a1b7aa9
544bc6e440208470c43838acd3a842862172f1c8
/Wchat/src/main/java/com/wchat/secondhand/entity/Items.java
b334e069adea1c1628e60aaffeeefb5452b30cb9
[]
no_license
Jackofme/Wechat
e4c45da56f3b3205cc3c0e18de8a3e7f77857b60
d6a499fb8456128f8e8a94f6c71b2ec8e021b471
refs/heads/master
2021-06-29T21:10:22.766420
2020-01-12T01:55:19
2020-01-12T01:55:19
233,322,447
0
0
null
2021-06-04T02:25:02
2020-01-12T01:34:22
Java
UTF-8
Java
false
false
292
java
package com.wchat.secondhand.entity; import lombok.Data; import org.springframework.stereotype.Component; @Data @Component public class Items { private String address; private String description; private double price; private String location; }
3f2ba8350e2284d8507999652b1372e2a8d6f4d7
1f207999be869a53c773c4b3dc4cff3d78f60aca
/ybg_base_jar/src/main/java/com/alipay/api/response/ZhimaMerchantOrderRentModifyResponse.java
a1c221b6680e639427549a804eba36cd1eb16bf7
[]
no_license
BrendaHub/quanmin_admin
8b4f1643112910b728adc172324b8fb8a2f672dc
866548dc219a2eaee0a09efbc3b6410eb3c2beb9
refs/heads/master
2021-05-09T04:17:03.818182
2018-01-28T15:00:12
2018-01-28T15:00:12
119,267,872
1
1
null
null
null
null
UTF-8
Java
false
false
355
java
package com.alipay.api.response; import com.alipay.api.AlipayResponse; /** * ALIPAY API: zhima.merchant.order.rent.modify response. * * @author auto create * @since 1.0, 2017-05-25 14:35:11 */ public class ZhimaMerchantOrderRentModifyResponse extends AlipayResponse { private static final long serialVersionUID = 6528341665672394269L; }
a4764bae4a4375d9d7c13eba12c132ff614d3217
fa51a28c045621912eb1dc08416070d0f8c9cb78
/src/main/java/com/subra/model/CustomerRepository.java
05a5eac45204d2b800762cc005b153b3687fe1b0
[]
no_license
sdass/spring-mongo
2b8124e58458b9492cf47c9a069c76d34bafc8c4
a3e11d641bd68d3d83c6b07cae67ae1538ef1e01
refs/heads/master
2020-08-29T03:23:17.891158
2019-10-27T20:05:43
2019-10-27T20:05:43
217,909,325
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
package com.subra.model; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.Query; import org.springframework.stereotype.Repository; @Repository public interface CustomerRepository extends MongoRepository<Customer, String>{ @Query Customer findByFname(String fname); @Query List<Customer> findByLname(String lname); // works @Query Page<Customer> findByLname(String lname, Pageable pageable); }
23d5629d8647a18ddeef7e1d4697ae3c381df56e
5ff40c6e3cd0423cfc5a90d8e1402881ad374126
/src/main/java/utils/LongsRef.java
3b35562ec550ccace7050c697a8bbd2d35080c92
[]
no_license
tanfengtiantian/fst
fd23b255caa641b34e372a0d7192eb0f21511943
026336978ea15aa8a95662d7527d1b315de4c2a7
refs/heads/master
2022-01-25T06:55:31.051191
2019-07-10T09:56:28
2019-07-10T09:56:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,055
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 utils; /** Represents long[], as a slice (offset + length) into an * existing long[]. The {@link #longs} member should never be null; use * {@link #EMPTY_LONGS} if necessary. * * @lucene.internal */ public final class LongsRef implements Comparable<LongsRef>, Cloneable { /** An empty long array for convenience */ public static final long[] EMPTY_LONGS = new long[0]; /** The contents of the LongsRef. Should never be {@code null}. */ public long[] longs; /** Offset of first valid long. */ public int offset; /** Length of used longs. */ public int length; /** Create a LongsRef with {@link #EMPTY_LONGS} */ public LongsRef() { longs = EMPTY_LONGS; } /** * Create a LongsRef pointing to a new array of size <code>capacity</code>. * Offset and length will both be zero. */ public LongsRef(int capacity) { longs = new long[capacity]; } /** This instance will directly reference longs w/o making a copy. * longs should not be null */ public LongsRef(long[] longs, int offset, int length) { this.longs = longs; this.offset = offset; this.length = length; assert isValid(); } /** * Returns a shallow clone of this instance (the underlying longs are * <b>not</b> copied and will be shared by both the returned object and this * object. * * @see #deepCopyOf */ @Override public LongsRef clone() { return new LongsRef(longs, offset, length); } @Override public int hashCode() { final int prime = 31; int result = 0; final long end = offset + length; for(int i = offset; i < end; i++) { result = prime * result + (int) (longs[i] ^ (longs[i]>>>32)); } return result; } @Override public boolean equals(Object other) { if (other == null) { return false; } if (other instanceof LongsRef) { return this.longsEquals((LongsRef) other); } return false; } public boolean longsEquals(LongsRef other) { return FutureArrays.equals(this.longs, this.offset, this.offset + this.length, other.longs, other.offset, other.offset + other.length); } /** Signed int order comparison */ @Override public int compareTo(LongsRef other) { return FutureArrays.compare(this.longs, this.offset, this.offset + this.length, other.longs, other.offset, other.offset + other.length); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append('['); final long end = offset + length; for(int i=offset;i<end;i++) { if (i > offset) { sb.append(' '); } sb.append(Long.toHexString(longs[i])); } sb.append(']'); return sb.toString(); } /** * Creates a new LongsRef that points to a copy of the longs from * <code>other</code> * <p> * The returned IntsRef will have a length of other.length * and an offset of zero. */ public static LongsRef deepCopyOf(LongsRef other) { return new LongsRef(ArrayUtil.copyOfSubArray(other.longs, other.offset, other.offset + other.length), 0, other.length); } /** * Performs internal consistency checks. * Always returns true (or throws IllegalStateException) */ public boolean isValid() { if (longs == null) { throw new IllegalStateException("longs is null"); } if (length < 0) { throw new IllegalStateException("length is negative: " + length); } if (length > longs.length) { throw new IllegalStateException("length is out of bounds: " + length + ",longs.length=" + longs.length); } if (offset < 0) { throw new IllegalStateException("offset is negative: " + offset); } if (offset > longs.length) { throw new IllegalStateException("offset out of bounds: " + offset + ",longs.length=" + longs.length); } if (offset + length < 0) { throw new IllegalStateException("offset+length is negative: offset=" + offset + ",length=" + length); } if (offset + length > longs.length) { throw new IllegalStateException("offset+length out of bounds: offset=" + offset + ",length=" + length + ",longs.length=" + longs.length); } return true; } }
a5113b92385606499bcb99b96694ea9066fb6a24
243d49f85eef4a64851dbe30571a7dbe74f393fb
/src/com/situ/mall/controller/back/UploadController.java
bde86f3d4099b981bddb0e4681ccc8660b3fdc32
[]
no_license
lsskaixinwudi/Java1707Mall
35e4605cf930c5d528616802bd52eab4215789c4
7333e7719fab8dfc3df9f264353a9e9c7268c442
refs/heads/master
2021-07-24T12:51:19.795642
2017-11-06T09:15:58
2017-11-06T09:15:58
105,109,672
0
0
null
null
null
null
GB18030
Java
false
false
3,003
java
package com.situ.mall.controller.back; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.apache.commons.io.FilenameUtils; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.situ.mall.constant.MallConstant; import com.situ.mall.util.JsonUtils; @Controller @RequestMapping("/upload") public class UploadController { /** * kindeditor上传使用 * @param pictureFile * @return */ @RequestMapping(value="/pic", produces=MediaType.TEXT_PLAIN_VALUE+";charset=utf-8") @ResponseBody public String uploadFile(MultipartFile pictureFile) { try { //为了防止重名生成一个随机的名字:aa4fb86a7896458a8c5b34c634011ae3 String name = UUID.randomUUID().toString().replace("-", ""); //jpg,png String ext = FilenameUtils.getExtension(pictureFile.getOriginalFilename()); String fileName = name + "." + ext; String filePath1 = "E:\\pic\\" + fileName; String filePath = MallConstant.SERVER_ADDRES + fileName; try { pictureFile.transferTo(new File(filePath1)); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } //封装到map中返回 Map result = new HashMap<>(); result.put("error", 0); result.put("url", filePath); //将object转换成json return JsonUtils.objectToJson(result); } catch (Exception e) { e.printStackTrace(); Map result = new HashMap<>(); result.put("error", 1); result.put("message", "图片上传失败"); return JsonUtils.objectToJson(result); } } /** * 自定义图片上传使用 * @param pictureFile * @return */ @RequestMapping(value="/uploadPic") @ResponseBody public Map<String, Object> uploadPic(MultipartFile pictureFile) { return upload(pictureFile); //上传到七牛 //return uploadByQiniu(pictureFile); } private Map<String, Object> upload(MultipartFile pictureFile) { //为了防止重名生成一个随机的名字:aa4fb86a7896458a8c5b34c634011ae3 String name = UUID.randomUUID().toString().replace("-", ""); //jpg,png String ext = FilenameUtils.getExtension(pictureFile.getOriginalFilename()); String fileName = name + "." + ext; String filePath = "E:\\pic\\" + fileName; try { pictureFile.transferTo(new File(filePath)); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } Map<String, Object> map = new HashMap<String, Object>(); map.put("fileName", fileName); map.put("filePath", MallConstant.SERVER_ADDRES + fileName); return map; } public static void main(String[] args) { String name = UUID.randomUUID().toString().replace("-", ""); System.out.println(name); } }
41bdd932748ced9518703d2bcb8f1070adcad8d8
48f7514117731fc996178455ef949554927b3c07
/aula9/ex2/Copo.java
ebfbd1f9f182bcf0e8e3ee7fea593ccb43f4ab63
[]
no_license
laramatos22/Programacao3
fc7f6e68f5865a491d2373e8dc5dc79cb9f17ffe
8df8496d518c5006d1020eeeb1e468968d5a32a2
refs/heads/main
2023-03-01T02:23:38.379795
2021-02-14T14:54:05
2021-02-14T14:54:05
302,922,827
1
0
null
null
null
null
ISO-8859-2
Java
false
false
242
java
package aula9.ex2; public class Copo extends GeladoDecorator { //Nao há campos //Construtor public Copo(Gelado g) { super(g); } //Métodos public String toString () { return g.toString() + " em copo"; } }