blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
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
listlengths
1
1
author_id
stringlengths
0
313
b7278cf6d7ae6bca5ee897df171bcee5572ee7d6
ddd3e431f77ae0c774274aa8c64e62011758727e
/MascaraCPFCNPJ/src/br/com/mascaracpfcnpj/MainActivity.java
2481a5567846ab7a8aabaf36426992ca255b2371
[]
no_license
IomarSantos/mascaraCPFCNPJ
3af302be1c82acf1d40188d48dfcc2241a1838f2
d301b0be6ef03b625af35a746d43a4c252601681
refs/heads/master
2021-01-19T10:58:27.344308
2014-11-04T06:24:43
2014-11-04T06:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,414
java
package br.com.mascaracpfcnpj; import android.app.Activity; import android.os.Bundle; import android.text.TextWatcher; import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; public class MainActivity extends Activity { private TextWatcher cpfMask; private TextWatcher cnpjMask; private RadioGroup radioGroup; private RadioButton rdCNPJ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final EditText cpf = (EditText) findViewById(R.id.txtCPF); // Armazene seus TextWatcher para posterior uso cpfMask = Mask.insert("###.###.###-##", cpf); cpf.addTextChangedListener(cpfMask); cnpjMask = Mask.insert("##.###.###/####-##", cpf); rdCNPJ = (RadioButton) findViewById(R.id.rdCNPJ); radioGroup = (RadioGroup) findViewById(R.id.radioGroup); radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup group, int checkedId) { int opcao = radioGroup.getCheckedRadioButtonId(); if (opcao == rdCNPJ.getId()) { cpf.removeTextChangedListener(cpfMask); cpf.addTextChangedListener(cnpjMask); } else { cpf.removeTextChangedListener(cnpjMask); cpf.addTextChangedListener(cpfMask); } } }); } }
[ "iomar.santos@outlook.com" ]
iomar.santos@outlook.com
e24bc4c447455f92692bb1595552cb56b42cb90c
5e970c7dbf63dd6580174ea1546b6ddffcc978da
/Java/.history/Animal_20201128220909.java
9e72ff1e0d10b96a02187c5f13507425c0733b73
[]
no_license
havecourage/program
195ac5470bb2a9d13df1e26f74b4c80b4421e05b
6c388c4448ce1e64bab19b9753e702b4ab807d06
refs/heads/master
2023-08-30T19:26:07.062109
2021-10-21T13:31:46
2021-10-21T13:31:46
207,100,434
0
0
null
null
null
null
UTF-8
Java
false
false
322
java
public class Animal { private static String name; private static String color; private static double weight; public static void getInfo() { System.out.println("Its name is " + name + ", color " + color + ", " + weight + " kg"); } public static void changeColor(String dcolor) { color=dcolor; } }
[ "g610413499@gmail.com" ]
g610413499@gmail.com
33df534900180adb3d7be87d158917c0c76582fd
6d109557600329b936efe538957dfd0a707eeafb
/src/com/google/api/ads/dfp/v201306/CreativeSetServiceInterface.java
b16e57f85f09610960083e1c06211a001c841184
[ "Apache-2.0" ]
permissive
google-code-export/google-api-dfp-java
51b0142c19a34cd822a90e0350eb15ec4347790a
b852c716ef6e5d300363ed61e15cbd6242fbac85
refs/heads/master
2020-05-20T03:52:00.420915
2013-12-19T23:08:40
2013-12-19T23:08:40
32,133,590
0
0
null
null
null
null
UTF-8
Java
false
false
3,020
java
/** * CreativeSetServiceInterface.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.google.api.ads.dfp.v201306; public interface CreativeSetServiceInterface extends java.rmi.Remote { /** * Creates a new {@link CreativeSet}. * * * @param creativeSet the creative set to create * * @return the creative set with its ID filled in */ public com.google.api.ads.dfp.v201306.CreativeSet createCreativeSet(com.google.api.ads.dfp.v201306.CreativeSet creativeSet) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201306.ApiException; /** * Returns the {@link CreativeSet} uniquely identified by the * given ID. * * * @param creativeSetId the ID of the creative set, which must already * exist * * @return the {@code CreativeSet} uniquely identified by the given ID */ public com.google.api.ads.dfp.v201306.CreativeSet getCreativeSet(java.lang.Long creativeSetId) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201306.ApiException; /** * Gets a {@link CreativeSetPage} of {@link CreativeSet} objects * that satisfy the * given {@link Statement#query}. The following fields are supported * for * filtering: * * <table> * <tr> * <th scope="col">PQL Property</th> <th scope="col">Object Property</th> * </tr> * <tr> * <td>{@code id}</td> * <td>{@link CreativeSet#id}</td> * </tr> * <tr> * <td>{@code name}</td> * <td>{@link CreativeSet#name}</td> * </tr> * <tr> * <td>{@code masterCreativeId}</td> * <td>{@link CreativeSet#masterCreativeId}</td> * </tr> * <tr> * <td>{@code lastModifiedDateTime}</td> * <td>{@link CreativeSet#lastModifiedDateTime}</td> * </tr> * </table> * * * @param filterStatement a Publisher Query Language statement used to * filter * a set of creative sets * * @return the creative sets that match the given filter */ public com.google.api.ads.dfp.v201306.CreativeSetPage getCreativeSetsByStatement(com.google.api.ads.dfp.v201306.Statement statement) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201306.ApiException; /** * Updates the specified {@link CreativeSet}. * * * @param creativeSet the creative set to update * * @return the updated creative set */ public com.google.api.ads.dfp.v201306.CreativeSet updateCreativeSet(com.google.api.ads.dfp.v201306.CreativeSet creativeSet) throws java.rmi.RemoteException, com.google.api.ads.dfp.v201306.ApiException; }
[ "api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098" ]
api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098
377a30f2383086e0405e4db55bb2bbaff502bfff
9ee272f359ebed31a38cbce1b358ed4a1d0a93fb
/BOJ/BOJ_9252.java
d2a0234151be1d7ee75efb321ad46401dd1e66bb
[]
no_license
MyNameIsTaeYeong/Problem-Solving
cf9122851bf8e3da63c8ac4c3de248103f41303c
863c5efe9d165fbd097ba40350ed07b41b6b2330
refs/heads/master
2022-05-17T05:09:16.755233
2022-03-22T12:37:26
2022-03-22T12:37:26
163,244,933
2
0
null
null
null
null
UTF-8
Java
false
false
1,942
java
package problem_solving_java; import java.io.*; public class BOJ_9252 { // len[i][j] : s1의 i번째까지와 s2의 j번째까지 중 가장 긴 문자열의 길이. static int[][] len; static char[][] tracking; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s2 = br.readLine(); String s1 = br.readLine(); len = new int[s1.length() + 1][s2.length() + 1]; tracking = new char[s1.length() + 1][s2.length() + 1]; for (int i = 1; i <= s1.length(); i++) { for (int j = 1; j <= s2.length(); j++) { if(s1.charAt(i-1) == s2.charAt(j-1)){ len[i][j] = len[i-1][j-1] + 1; tracking[i][j] = 'c'; }else{ // 위 < 왼 if(len[i-1][j] < len[i][j-1]){ len[i][j] = len[i][j-1]; tracking[i][j] = 'l'; }else{ len[i][j] = len[i-1][j]; tracking[i][j] = 'u'; } } } } int x = s1.length(); int y = s2.length(); StringBuilder seq = new StringBuilder(""); while( x > 0 && y > 0 ){ switch (tracking[x][y]){ case 'c': seq.append(s2.charAt(y-1)); x--; y--; break; case 'l': y--; break; case 'u': x--; break; } } if(len[s1.length()][s2.length()] == 0){ System.out.println(0); }else{ System.out.println(len[s1.length()][s2.length()]); System.out.println(seq.reverse()); } } }
[ "imtaebari@gmail.com" ]
imtaebari@gmail.com
b04beb683cb56558d4471f32845095c20d98db74
4691d65effc75725e2a64f0d3ec9155985f0ab9a
/src/main/java/BankApplication/Customer.java
2713ca5e18591e7e114e1ae9a7d6ae12732da750
[]
no_license
EmilyStacy/UdemyClasses
eaf99a6be774066e80c5d3578d6518ed9197b12f
7cc616ec55750fe205c81e6638ffed98356ddffc
refs/heads/master
2020-12-08T02:37:35.631669
2020-05-09T16:57:50
2020-05-09T16:57:50
232,858,830
0
0
null
null
null
null
UTF-8
Java
false
false
572
java
package BankApplication; import java.util.ArrayList; public class Customer { private ArrayList<Double> transactions; private String name; public Customer(String name, double initialAmount) { this.name = name; this.transactions = new ArrayList<Double>(); addTransaction(initialAmount); } public void addTransaction(double amount){ this.transactions.add(amount); } public ArrayList<Double> getTransactionList() { return transactions; } public String getName() { return name; } }
[ "beyonce@thinkful.com" ]
beyonce@thinkful.com
39fbb9a4a07a601ab9f0c569abd275448f1c89bb
4e7be397406be9149f024550ab3a90ac403d9df2
/Fkart/src/com/fkart/model/Cart.java
a7fe6a5853fd273e0d6f79a52bffed4c8f00a095
[]
no_license
DakshYadav99/PKART_JRNMRCU21
3beefe9578620a082a5540df298112e92f046dd2
d63901b70d041b4018750feda028e91951cb4540
refs/heads/main
2023-03-20T07:20:27.059252
2021-03-18T03:35:49
2021-03-18T03:35:49
348,929,654
0
0
null
null
null
null
UTF-8
Java
false
false
663
java
package com.fkart.model; import java.util.ArrayList; //Model for the Cart containing getters ,setter and contructors public class Cart { private int id; private ArrayList<Product> products; public Cart(){ } public Cart(int id,ArrayList<Product> products) { this.id = id; this.products = products; } public int getId() { return id; } public void setId(int id) { this.id = id; } public ArrayList<Product> getProducts() { return products; } public void setProducts(ArrayList<Product> products) { this.products = products; } @Override public String toString() { return "Cart [id=" + id + ", products=" + products + "]"; } }
[ "noreply@github.com" ]
DakshYadav99.noreply@github.com
dddabe25931627bde955a0f9fb72fd397b9b9e13
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_ebb487c6ef0297b959006ee1aa50ce48cb423a6c/LightSensor/16_ebb487c6ef0297b959006ee1aa50ce48cb423a6c_LightSensor_t.java
894729c40665917208d377058e9be1162ecdbc13
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,461
java
package net.bible.service.device; import java.util.List; import net.bible.android.BibleApplication; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.util.Log; /** Light Sensor interface * * @author Martin Denham [mjdenham at gmail dot com] * @see gnu.lgpl.License for license details.<br> * The copyright to this program is held by it's author. */ public class LightSensor { public final static float NO_READING_YET = -1919; private float mReading = NO_READING_YET; private boolean mMonitoring = false; private static final String TAG = "LightSensor"; /** return reading or null if no light sensor */ public int getReading() { if (!mMonitoring) { ensureMonitoringLightLevel(); } Log.d(TAG, "Light Sensor:"+mReading); return Math.round(mReading); } private synchronized void ensureMonitoringLightLevel() { if (!mMonitoring) { if (isLightSensor()) { SensorManager sm = (SensorManager) BibleApplication.getApplication().getSystemService(Context.SENSOR_SERVICE); Sensor oSensor = sm.getDefaultSensor(Sensor.TYPE_LIGHT); sm.registerListener(myLightListener, oSensor, SensorManager.SENSOR_DELAY_UI); // wait for first event try { Thread.sleep(100); } catch (InterruptedException ie) { Log.e(TAG, "Interrupted getting light signal", ie); } } mMonitoring = true; } } final SensorEventListener myLightListener = new SensorEventListener() { public void onSensorChanged(SensorEvent sensorEvent) { if (sensorEvent.sensor.getType() == Sensor.TYPE_LIGHT) { mReading = sensorEvent.values[0]; } } public void onAccuracyChanged(Sensor sensor, int accuracy) { } }; /** * Returns true if at least one Orientation sensor is available */ public boolean isLightSensor() { boolean isLightSensor = false; SensorManager sm = (SensorManager) BibleApplication.getApplication().getSystemService(Context.SENSOR_SERVICE); if (sm != null) { List<Sensor> sensors = sm.getSensorList(Sensor.TYPE_LIGHT); isLightSensor = (sensors.size() > 0); } return isLightSensor; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
33d1b7a5ba298bdf1293f88ecb827e90f9450592
2943f233ac0e073f585c9142f5ff66ecba7d8b13
/MessageStore/src/main/java/jpa/data/preload/RuleNameEnum.java
031d4872a34bca5b46e681809770047715151e53
[]
no_license
barbietunnie/jboss-5-to-7-migration
1a519afeee052cf02c51823b5bf2003d99056112
675e33b8510ca09e7efdb5ca63ccb73c93abba8a
refs/heads/master
2021-01-10T18:40:13.068747
2015-05-29T19:01:26
2015-05-29T19:01:26
57,383,835
0
0
null
null
null
null
UTF-8
Java
false
false
8,161
java
package jpa.data.preload; import java.util.ArrayList; import java.util.List; import jpa.constant.RuleCategory; import jpa.constant.RuleType; // // define SMTP Built-in Rule Types // public enum RuleNameEnum { /* * From MessageParserBo, when no rules were matched */ GENERIC("Generic", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Non bounce or system could not recognize it"), // default rule name for SMTP Email /* * From RFC Scan routine, rule reassignment, or custom routine */ HARD_BOUNCE("Hard Bounce", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "From RFC Scan Routine, or from postmaster with sub-rules"), // Hard bounce - suspend,notify,close SOFT_BOUNCE("Soft Bounce", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Soft bounce, from RFC scan routine"), // Soft bounce - bounce++,close MAILBOX_FULL("Mailbox Full", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Mailbox full from postmaster with sub-rules"), // treated as Soft Bounce SIZE_TOO_LARGE("Size Too Large", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Message size too large"), // message length exceeded administrative limit, treat as Soft Bounce MAIL_BLOCK("Mail Block", RuleType.ALL, RuleCategory.MAIN_RULE, true, false, "Bounced from Bulk Email Filter"), // message content rejected, treat as Soft Bounce SPAM_BLOCK("Spam Block", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Bounced from Spam blocker"), // blocked by SPAM filter, VIRUS_BLOCK("Virus Block", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Bounced from Virus blocker"), // blocked by Virus Scan, CHALLENGE_RESPONSE("Challenge Response", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Bounced from Challenge Response"), // human response needed AUTO_REPLY("Auto Reply", RuleType.ANY, RuleCategory.MAIN_RULE, true, false, "Auto reply from email sender software"), // automatic response from mail sender CC_USER("Carbon Copies", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "From scan routine, message received as recipient of CC or BCC"), // Mail received from a CC address, drop MDN_RECEIPT("MDN Receipt", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "From RFC scan, Message Delivery Notification, a positive receipt"), // MDN - read receipt, drop UNSUBSCRIBE("Unsubscribe", RuleType.ALL, RuleCategory.MAIN_RULE, true, false, "Remove from a mailing list"), // remove from mailing list SUBSCRIBE("Subscribe", RuleType.ALL, RuleCategory.MAIN_RULE, true, false, "Subscribe to a mailing list"), // add to mailing list /* * From rule reassignment or custom routine */ CSR_REPLY("CSR Reply", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Called from internal program"), // internal only, reply message from CSR RMA_REQUEST("RMA Request", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "RMA request, internal only"), // internal only BROADCAST("Broadcast", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Called from internal program"), // internal only SEND_MAIL("Send Mail", RuleType.SIMPLE, RuleCategory.MAIN_RULE, true, false, "Called from internal program"), // internal only /* * Custom rules */ UNATTENDED_MAILBOX("Unattended_Mailbox", RuleType.ALL, RuleCategory.PRE_RULE, false, false, "Simply get rid of the messages from the mailbox."), OUF_OF_OFFICE_AUTO_REPLY("OutOfOffice_AutoReply", RuleType.ALL, RuleCategory.MAIN_RULE, false, false, "Ouf of the office auto reply"), CONTACT_US("Contact_Us", RuleType.ALL, RuleCategory.MAIN_RULE, false, false, "Contact Us Form submitted from web site"), XHEADER_SPAM_SCORE("XHeader_SpamScore", RuleType.SIMPLE, RuleCategory.MAIN_RULE, false, false, "Examine x-headers for SPAM score."), EXECUTABLE_ATTACHMENT("Executable_Attachment", RuleType.ALL, RuleCategory.MAIN_RULE, false, false, "Emails with executable attachment file(s)"), HARD_BOUNCE_WATCHED_MAILBOX("HardBouce_WatchedMailbox", RuleType.ALL, RuleCategory.POST_RULE, false, false, "Post rule for hard bounced emails."), HARD_BOUNCE_NO_FINAL_RCPT("HardBounce_NoFinalRcpt", RuleType.ALL, RuleCategory.POST_RULE, false, false, "Post rule for hard bounces without final recipient."), /* * Sub rules */ HardBounce_Subj_Match("HardBounce_Subj_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for hard bounces from postmaster"), HardBounce_Body_Match("HardBounce_Body_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for hard bounces from postmaster"), MailboxFull_Body_Match("MailboxFull_Body_Match", RuleType.ALL, RuleCategory.MAIN_RULE, true, true, "Sub rule for mailbox full"), SpamBlock_Body_Match("SpamBlock_Body_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for spam block"), VirusBlock_Body_Match("VirusBlock_Body_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for virus block"), ChalResp_Body_Match("ChalResp_Body_Match", RuleType.ANY, RuleCategory.MAIN_RULE, true, true, "Sub rule for challenge response"); private final String value; private final RuleType ruleType; private RuleCategory ruleCategory; private boolean isBuiltin; private boolean isSubrule; private final String description; private RuleNameEnum(String value, RuleType ruleType, RuleCategory ruleCategory, boolean isBuiltin, boolean isSubrule, String description) { this.value = value; this.ruleType = ruleType; this.ruleCategory = ruleCategory; this.isBuiltin = isBuiltin; this.isSubrule = isSubrule; this.description = description; } public static RuleNameEnum getByValue(String value) { for (RuleNameEnum rule : RuleNameEnum.values()) { if (rule.getValue().equalsIgnoreCase(value)) { return rule; } } throw new IllegalArgumentException("No enum const found by value (" + value + ")"); } private static final List<RuleNameEnum> builtinRules = new ArrayList<RuleNameEnum>(); public static List<RuleNameEnum> getBuiltinRules() { if (builtinRules.isEmpty()) { synchronized (builtinRules) { for (RuleNameEnum rn : RuleNameEnum.values()) { if (rn.isBuiltin && !rn.isSubrule) { builtinRules.add(rn); } } } } return builtinRules; } private static final List<RuleNameEnum> customRules = new ArrayList<RuleNameEnum>(); public static List<RuleNameEnum> getCustomRules() { if (customRules.isEmpty()) { synchronized (customRules) { for (RuleNameEnum rn : RuleNameEnum.values()) { if (!rn.isBuiltin && !rn.isSubrule) { customRules.add(rn); } } } } return customRules; } private static final List<RuleNameEnum> subRules = new ArrayList<RuleNameEnum>(); public static List<RuleNameEnum> getSubRules() { if (subRules.isEmpty()) { synchronized (subRules) { for (RuleNameEnum rn : RuleNameEnum.values()) { if (rn.isBuiltin && rn.isSubrule) { subRules.add(rn); } } } } return subRules; } private static final List<RuleNameEnum> preRules = new ArrayList<RuleNameEnum>(); public static List<RuleNameEnum> getPreRules() { if (preRules.isEmpty()) { synchronized (preRules) { for (RuleNameEnum rn : RuleNameEnum.values()) { if (rn.ruleCategory.equals(RuleCategory.PRE_RULE)) { preRules.add(rn); } } } } return preRules; } private static final List<RuleNameEnum> postRules = new ArrayList<RuleNameEnum>(); public static List<RuleNameEnum> getPostRules() { if (postRules.isEmpty()) { synchronized (postRules) { for (RuleNameEnum rn : RuleNameEnum.values()) { if (rn.ruleCategory.equals(RuleCategory.POST_RULE)) { postRules.add(rn); } } } } return postRules; } public String getValue() { return value; } public RuleType getRuleType() { return ruleType; } public RuleCategory getRuleCategory() { return ruleCategory; } public boolean isBuiltin() { return isBuiltin; } public boolean isSubrule() { return isSubrule; } public String getDescription() { return description; } }
[ "jackwng@gmail.com" ]
jackwng@gmail.com
210a95bd57a64223cc5e19eb746a1e2d81464fe1
3272570f2745456f0dd9312e7a75ce1646e69cf6
/project/主要工程模块化整合v1.01/brmp/brmp_ssofilter_sheng/src/main/java/org/jasig/cas/client/validation/AssertionImpl.java
4846089d669aec61acebee5af897c6a7b7c94b39
[]
no_license
Amsss/BRMP
9f6a6a86d4e280c8b2e123cacfacf0ecaebff24e
e331659b5a6cd0b5a40cf0883508ef1ce73c7e2c
refs/heads/master
2023-05-08T21:02:49.456531
2020-07-31T06:34:12
2020-07-31T06:34:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,208
java
/** * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a * copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.jasig.cas.client.validation; import org.jasig.cas.client.authentication.AttributePrincipal; import org.jasig.cas.client.authentication.AttributePrincipalImpl; import org.jasig.cas.client.util.CommonUtils; import java.util.Collections; import java.util.Date; import java.util.Map; /** * Concrete Implementation of the {@link Assertion}. * * @author Scott Battaglia * @version $Revision: 7288 $ $Date: 2016-01-21 16:33:54 +0800 (Thu, 21 Jan 2016) $ * @since 3.1 * */ public final class AssertionImpl implements Assertion { /** Unique Id for serialization. */ private static final long serialVersionUID = -7767943925833639221L; /** The date from which the assertion is valid. */ private final Date validFromDate; /** The date the assertion is valid until. */ private final Date validUntilDate; /** Map of key/value pairs associated with this assertion. I.e. authentication type. */ private final Map<String,Object> attributes; /** The principal for which this assertion is valid for. */ private final AttributePrincipal principal; /** * Constructs a new Assertion with a Principal of the supplied name, a valid from date of now, no valid until date, and no attributes. * * @param name the name of the principal for which this assertion is valid. */ public AssertionImpl(final String name) { this(new AttributePrincipalImpl(name)); } /** * Creates a new Assertion with the supplied Principal. * * @param principal the Principal to associate with the Assertion. */ public AssertionImpl(final AttributePrincipal principal) { this(principal, Collections.<String, Object>emptyMap()); } /** * Create a new Assertion with the supplied principal and Assertion attributes. * * @param principal the Principal to associate with the Assertion. * @param attributes the key/value pairs for this attribute. */ public AssertionImpl(final AttributePrincipal principal, final Map<String,Object> attributes) { this(principal, new Date(), null, attributes); } /** * Creates a new Assertion with the supplied principal, Assertion attributes, and start and valid until dates. * * @param principal the Principal to associate with the Assertion. * @param validFromDate when the assertion is valid from. * @param validUntilDate when the assertion is valid to. * @param attributes the key/value pairs for this attribute. */ public AssertionImpl(final AttributePrincipal principal, final Date validFromDate, final Date validUntilDate, final Map<String,Object> attributes) { this.principal = principal; this.validFromDate = validFromDate; this.validUntilDate = validUntilDate; this.attributes = attributes; CommonUtils.assertNotNull(this.principal, "principal cannot be null."); CommonUtils.assertNotNull(this.validFromDate, "validFromDate cannot be null."); CommonUtils.assertNotNull(this.attributes, "attributes cannot be null."); } public Date getValidFromDate() { return this.validFromDate; } public Date getValidUntilDate() { return this.validUntilDate; } public Map<String,Object> getAttributes() { return this.attributes; } public AttributePrincipal getPrincipal() { return this.principal; } }
[ "wosisingle@163.com" ]
wosisingle@163.com
1d21fd29919a2355104b1f4977ee9e26d411bd63
785ceb349755508362c679d1612aa3ac4dc90abe
/projects/asw-sfingegram/enigmi-seguiti/src/main/java/asw/sfingegram/enigmiseguiti/connessioni/ConnessioniServiceWebClient.java
9a8d4ec05726b2e5d9a02563976f0bbea24a3d6e
[ "MIT" ]
permissive
francesco-di-marcantonio/asw-2021
e3ca7c7f6626d470e727d0f480283caf4bdacb8c
5f67a40159bb765e2b2cf8e3cca493156982dfbc
refs/heads/master
2023-05-30T20:47:36.542467
2021-06-01T07:43:35
2021-06-01T07:43:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,897
java
package asw.sfingegram.enigmiseguiti.connessioni; import asw.sfingegram.enigmiseguiti.domain.*; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Primary; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.WebClientException; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.util.*; @Service @Primary public class ConnessioniServiceWebClient implements ConnessioniService { @Autowired @Qualifier("loadBalancedWebClient") private WebClient loadBalancedWebClient; public Collection<ConnessioneConAutore> getConnessioniConAutoriByUtente(String utente) { Collection<ConnessioneConAutore> connessioni = null; Flux<ConnessioneConAutore> response = loadBalancedWebClient .get() .uri("http://connessioni/connessioniconautori/{utente}", utente) .retrieve() .bodyToFlux(ConnessioneConAutore.class); try { connessioni = response.collectList().block(); } catch (WebClientException e) { e.printStackTrace(); } return connessioni; } public Collection<ConnessioneConTipo> getConnessioniConTipiByUtente(String utente) { Collection<ConnessioneConTipo> connessioni = null; Flux<ConnessioneConTipo> response = loadBalancedWebClient .get() .uri("http://connessioni/connessionicontipi/{utente}", utente) .retrieve() .bodyToFlux(ConnessioneConTipo.class); try { connessioni = response.collectList().block(); } catch (WebClientException e) { e.printStackTrace(); } return connessioni; } }
[ "luca.cabibbo@uniroma3.it" ]
luca.cabibbo@uniroma3.it
ae8dc6054f076409fc534d9e1684484fe3a4ebc9
7bd71f63b4a57ae7b435c7bb69a608ba5331ceb2
/app/src/main/java/com/nicbit/traquer/common/crop/Crop.java
31ba12f81a850540a043a138c64cea38a14bc236
[]
no_license
nemoabdullah1234/aapptrk
1f736942a9fdf1b304c5636f500f21beb2ccdb7b
cb9bd4e53b887d6aa7e0ca220836da7269a926f7
refs/heads/master
2020-03-27T08:20:52.427907
2018-08-27T04:35:28
2018-08-27T04:35:28
146,246,454
0
0
null
null
null
null
UTF-8
Java
false
false
5,670
java
package com.nicbit.traquer.common.crop; import android.app.Activity; import android.app.Fragment; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.provider.MediaStore; import android.widget.Toast; import com.nicbit.traquer.common.crop.CropImageActivity; import com.nicbit.traquer.stryker.R; /** * Builder for crop Intents and utils for handling result */ public class Crop { public static final int REQUEST_CROP = 6709; public static final int REQUEST_PICK = 9162; public static final int RESULT_ERROR = 404; interface Extra { String ASPECT_X = "aspect_x"; String ASPECT_Y = "aspect_y"; String MAX_X = "max_x"; String MAX_Y = "max_y"; String ERROR = "error"; } private Intent cropIntent; /** * Create a crop Intent builder with source and destination image Uris * * @param source Uri for image to crop * @param destination Uri for saving the cropped image */ public static Crop of(Uri source, Uri destination) { return new Crop(source, destination); } private Crop(Uri source, Uri destination) { cropIntent = new Intent(); cropIntent.setData(source); cropIntent.putExtra(MediaStore.EXTRA_OUTPUT, destination); } /** * Set fixed aspect ratio for crop area * * @param x Aspect X * @param y Aspect Y */ public Crop withAspect(int x, int y) { cropIntent.putExtra(Extra.ASPECT_X, x); cropIntent.putExtra(Extra.ASPECT_Y, y); return this; } /** * Crop area with fixed 1:1 aspect ratio */ public Crop asSquare() { cropIntent.putExtra(Extra.ASPECT_X, 1); cropIntent.putExtra(Extra.ASPECT_Y, 1); return this; } /** * Set maximum crop size * * @param width Max width * @param height Max height */ public Crop withMaxSize(int width, int height) { cropIntent.putExtra(Extra.MAX_X, width); cropIntent.putExtra(Extra.MAX_Y, height); return this; } /** * Send the crop Intent from an Activity * * @param activity Activity to receive result */ public void start(Activity activity) { start(activity, REQUEST_CROP); } /** * Send the crop Intent from an Activity with a custom requestCode * * @param activity Activity to receive result * @param requestCode requestCode for result */ public void start(Activity activity, int requestCode) { activity.startActivityForResult(getIntent(activity), requestCode); } /** * Send the crop Intent from a Fragment * * @param context Context * @param fragment Fragment to receive result */ public void start(Context context, Fragment fragment) { start(context, fragment, REQUEST_CROP); } /** * Send the crop Intent from a support library Fragment * * @param context Context * @param fragment Fragment to receive result */ public void start(Context context, android.support.v4.app.Fragment fragment) { start(context, fragment, REQUEST_CROP); } /** * Send the crop Intent with a custom requestCode * * @param context Context * @param fragment Fragment to receive result * @param requestCode requestCode for result */ public void start(Context context, Fragment fragment, int requestCode) { fragment.startActivityForResult(getIntent(context), requestCode); } /** * Send the crop Intent with a custom requestCode * * @param context Context * @param fragment Fragment to receive result * @param requestCode requestCode for result */ public void start(Context context, android.support.v4.app.Fragment fragment, int requestCode) { fragment.startActivityForResult(getIntent(context), requestCode); } /** * Get Intent to start crop Activity * * @param context Context * @return Intent for CropImageActivity */ public Intent getIntent(Context context) { cropIntent.setClass(context, CropImageActivity.class); return cropIntent; } /** * Retrieve URI for cropped image, as set in the Intent builder * * @param result Output Image URI */ public static Uri getOutput(Intent result) { return result.getParcelableExtra(MediaStore.EXTRA_OUTPUT); } /** * Retrieve error that caused crop to fail * * @param result Result Intent * @return Throwable handled in CropImageActivity */ public static Throwable getError(Intent result) { return (Throwable) result.getSerializableExtra(Extra.ERROR); } /** * Utility to start an image picker * * @param activity Activity that will receive result */ public static void pickImage(Activity activity) { pickImage(activity, REQUEST_PICK); } /** * Utility to start an image picker with request code * * @param activity Activity that will receive result * @param requestCode requestCode for result */ public static void pickImage(Activity activity, int requestCode) { Intent intent = new Intent(Intent.ACTION_GET_CONTENT).setType("image/*"); try { activity.startActivityForResult(intent, requestCode); } catch (ActivityNotFoundException e) { Toast.makeText(activity, R.string.crop__pick_error, Toast.LENGTH_SHORT).show(); } } }
[ "nemoabdullah1234@gmail.com" ]
nemoabdullah1234@gmail.com
250ed642ac10bb836b6fcf2ca666b7e8fe9e7888
047e95a8c7549e90be2670b8c85df2f8d94ba012
/src/introsde/assignment3/soap/SavePersonPreferencesResponse.java
19e56cd6406b7d2993e3c9772a0129f5d923907c
[]
no_license
kamauz/introsde-2017-assignment-3-client
1803a92fc37ad70896139e6cd8e715f12ba6bb51
12a61599adacd242247045717b5c95905a9362fa
refs/heads/master
2021-08-31T13:38:04.589456
2017-12-21T14:23:19
2017-12-21T14:23:19
114,682,756
0
0
null
null
null
null
UTF-8
Java
false
false
828
java
package introsde.assignment3.soap; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Classe Java per savePersonPreferencesResponse complex type. * * <p>Il seguente frammento di schema specifica il contenuto previsto contenuto in questa classe. * * <pre> * &lt;complexType name="savePersonPreferencesResponse"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "savePersonPreferencesResponse") public class SavePersonPreferencesResponse { }
[ "marco.michelotti-1@studenti.unitn.it" ]
marco.michelotti-1@studenti.unitn.it
db1036f58fbb4c63013b1fa299bbee40ceae7da9
3b7173629dab3237f4c6a118784000a16284b65c
/game/src/main/org/apollo/game/model/area/update/ObjectUpdateOperation.java
a763f5be2679d84037b0d03d5513e64dcd2647fb
[ "ISC" ]
permissive
zpoch-rsps/server
d141325c886d14b65d426831842ea9be17097763
bbf566eb915e3f2dc34a0f93546e8c69d1f3787c
refs/heads/master
2021-01-19T01:11:47.973544
2017-04-04T20:36:40
2017-04-04T20:36:40
87,226,822
0
0
null
null
null
null
UTF-8
Java
false
false
1,201
java
package org.apollo.game.model.area.update; import org.apollo.game.message.impl.RegionUpdateMessage; import org.apollo.game.message.impl.RemoveObjectMessage; import org.apollo.game.message.impl.SendObjectMessage; import org.apollo.game.model.area.EntityUpdateType; import org.apollo.game.model.area.Region; import org.apollo.game.model.entity.obj.GameObject; /** * A {@link UpdateOperation} for addition or removal of {@link GameObject}s. * * @author Major */ public final class ObjectUpdateOperation extends UpdateOperation<GameObject> { /** * Creates the ObjectUpdateOperation. * * @param region The {@link Region} in which the ObjectUpdateOperation occurred. Must not be {@code null}. * @param type The {@link EntityUpdateType}. Must not be {@code null}. * @param object The {@linkGameObject}. Must not be {@code null}. */ public ObjectUpdateOperation(Region region, EntityUpdateType type, GameObject object) { super(region, type, object); } @Override protected RegionUpdateMessage add(int offset) { return new SendObjectMessage(entity, offset); } @Override protected RegionUpdateMessage remove(int offset) { return new RemoveObjectMessage(entity, offset); } }
[ "zpoch.rsps@gmail.com" ]
zpoch.rsps@gmail.com
a99971dbda4646dbd0ed257f60b7eae5e86ee500
998aa109551d7d90d84d239c77e9e97f7e31846c
/src/main/java/ke/co/suncha/tembo/tenant/products/attributes/set/instance/AttributeSetInstance.java
8ec24ee83f6f5302e47a68ae36427eb75f49791f
[]
no_license
opentembo/temboPOS
f2784f7b0b229d396e94864197f427c8f31413e5
9ac18dca5195a82d1d5b1c7d078fd7f6e731a8ec
refs/heads/master
2021-01-10T05:59:27.212170
2016-01-09T22:41:30
2016-01-09T22:41:30
49,344,202
0
0
null
null
null
null
UTF-8
Java
false
false
1,679
java
package ke.co.suncha.tembo.tenant.products.attributes.set.instance; import com.fasterxml.jackson.annotation.JsonManagedReference; import ke.co.suncha.tembo.tenant.products.attributes.set.ProductAttributeSet; import ke.co.suncha.tembo.tenant.products.attributes.set.instance.values.AttributeValueInstance; import ke.co.suncha.tembo.tenant.admin.models.BaseEntity; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * Created by maitha.manyala on 9/21/15. */ public class AttributeSetInstance extends BaseEntity implements Serializable { private long attributeSetInstanceId; private ProductAttributeSet productAttributeSet; //this is what i need to fetch @JsonManagedReference private List<AttributeValueInstance> attributeValueInstances; public long getAttributeSetInstanceId() { return attributeSetInstanceId; } public void setAttributeSetInstanceId(long attributeSetInstanceId) { this.attributeSetInstanceId = attributeSetInstanceId; } public ProductAttributeSet getProductAttributeSet() { return productAttributeSet; } public void setProductAttributeSet(ProductAttributeSet productAttributeSet) { this.productAttributeSet = productAttributeSet; } public List<AttributeValueInstance> getAttributeValueInstances() { if (attributeValueInstances == null) { attributeValueInstances = new ArrayList<>(); } return attributeValueInstances; } public void setAttributeValueInstances(List<AttributeValueInstance> attributeValueInstances) { this.attributeValueInstances = attributeValueInstances; } }
[ "maitha.manyala@gmail.com" ]
maitha.manyala@gmail.com
83dad8853846dfbfd788d67aae112e63287125dc
a8f0b75db3a3cf55533aa6bdc7083b59de58b004
/CLASS WORK/ExceptionHandlingExample/src/com/capgemini/userdefinedexceptionexample/MobileNumberCkeckMain.java
14a107ebe4b41c9756012c9fb661e2403ff23461
[]
no_license
PURBITAM/PURBITA-CAPGEMINI-JA-17-ASSIGNMENTS
d007c644fa1607aae48f6c0769b81f5f18eff329
d44380110fb0784a8d224b5e697f6ec11066e576
refs/heads/master
2023-06-01T22:16:10.627421
2021-06-15T02:50:41
2021-06-15T02:50:41
366,982,408
0
0
null
null
null
null
UTF-8
Java
false
false
702
java
package com.capgemini.userdefinedexceptionexample; import java.util.Scanner; public class MobileNumberCkeckMain { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("enter Mobile Number : "); long mobileNo=sc.nextLong(); String str=""+mobileNo; try { if(str.length()<10) { throw new MobileNumberNotValid("mobile number is less than 10 digits"); } else if(str.length()>10) { throw new MobileNumberNotValid("mobile number is greater than 10 digits"); } else { System.out.println("Mobile number is Correct"); } } catch(MobileNumberNotValid an) { System.out.println(an.getMessage()); } } }
[ "purbitamajumdar@gmail.com" ]
purbitamajumdar@gmail.com
fc608cf386d752784964a8298578ee7c13caafa0
9abf3e2faa8fabf580b7d0263669ea066d647760
/src/main/java/com/example/springjwt/controller/UserController.java
56afc765c99a0810f96b3144145f9a0dc1e598d9
[]
no_license
tmdrl5779/SpringJWT
6b9041f42de864bfa867c997d89110255980c1a9
e040676df5daa71a180387c59192ac47500dadc7
refs/heads/main
2023-08-20T06:01:48.574734
2021-11-01T17:21:03
2021-11-01T17:21:03
421,303,516
0
0
null
null
null
null
UTF-8
Java
false
false
1,773
java
package com.example.springjwt.controller; import com.example.springjwt.dto.UserDto; import com.example.springjwt.entity.User; import com.example.springjwt.service.UserService; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; @RestController @RequestMapping("/api") public class UserController { private final UserService userService; public UserController(UserService userService) { this.userService = userService; } @GetMapping("/hello") public ResponseEntity<String> hello() { return ResponseEntity.ok("hello"); } @PostMapping("/test-redirect") public void testRedirect(HttpServletResponse response) throws IOException { response.sendRedirect("/api/user"); } @PostMapping("/signup") //회원가입 public ResponseEntity<User> signup( @Valid @RequestBody UserDto userDto ) { return ResponseEntity.ok(userService.signup(userDto)); } @GetMapping("/user") @PreAuthorize("hasAnyRole('USER','ADMIN')") //권한 설정 : user, admin 둘다 호출가능 public ResponseEntity<User> getMyUserInfo(HttpServletRequest request) { return ResponseEntity.ok(userService.getMyUserWithAuthorities().get()); } @GetMapping("/user/{username}") @PreAuthorize("hasAnyRole('ADMIN')") //권한 설정 : admin 호출가능 public ResponseEntity<User> getUserInfo(@PathVariable String username) { return ResponseEntity.ok(userService.getUserWithAuthorities(username).get()); } }
[ "tmdrl5779@gmail.com" ]
tmdrl5779@gmail.com
9e8ab57816e6f3dff19ac2ec26b36d9d96d65245
7dde1b1a7fd34927c014f927aa956d58b9341ba4
/MeiTuan-portal/.svn/pristine/ef/efef2d5c3c3f66c4ee2ab6fe0e23a3e64b0fc485.svn-base
01e4bbe0044f19137c955dc9fba443def7aa201e
[]
no_license
MyChiCa/meituan
7f219b100ab43cb349fb60dd34176d6dedd2a88e
4901b8353b44b4713df9f006b458f847b6df8dc2
refs/heads/master
2020-03-22T23:05:28.879591
2018-07-13T03:05:19
2018-07-13T03:05:19
140,789,062
9
1
null
null
null
null
UTF-8
Java
false
false
1,896
package com.MeiTuan.portal.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.MeiTuan.portal.mapper.TFoodMapper; import com.MeiTuan.portal.mapper.TOrderDetailsMapper; import com.MeiTuan.portal.pojo.TCart; import com.MeiTuan.portal.pojo.TFood; import com.MeiTuan.portal.pojo.TOrderDetails; import com.MeiTuan.portal.service.OrderDetailService; @Service public class OrderDetailServiceImpl implements OrderDetailService { @Autowired TOrderDetailsMapper tOrderDetailsMapper; @Autowired TFoodMapper tFoodMapper; @Override public TFood findFoodById(int odId) { TFood tFood = tFoodMapper.selectByPrimaryKey(odId); return tFood; } //查找食物id对应详情 @Override public TOrderDetails findOrderDetailsByFood(Integer foodId) { TOrderDetails tOrderDetails = null; tOrderDetails = tOrderDetailsMapper.selectODByFood(foodId); return tOrderDetails; } //插入orderdetail @Override public void insertODDetail(TFood tFood) { tOrderDetailsMapper.insertODDetail(tFood); } //更新已有食物orderdetail @Override public void updateOrderDetail(Float foodPrice) { tOrderDetailsMapper.updateOrderDetail(foodPrice); } //获得所有的总的数量和价格 @Override public TOrderDetails selectSum() { TOrderDetails tOrderDetails = null; tOrderDetails = tOrderDetailsMapper.selectSum(); return tOrderDetails; } //数量减一 @Override public void subFoodById(TFood tFood) { tOrderDetailsMapper.subFoodById(tFood); } //数量加一 @Override public void plusFoodById(TFood tFood) { tOrderDetailsMapper.plusFoodById(tFood); } //删除所有 @Override public void deleteAllOD() { tOrderDetailsMapper.deleteAllOD(); } //为商品添加订单号 @Override public void updataOrderdDet(int orderId) { tOrderDetailsMapper.updateOrderdDet(orderId); } }
[ "zhuang1623550986@qq.com" ]
zhuang1623550986@qq.com
b9a10ffa5edc9c73c75c6b12aa61e958b5aad864
99808689f2a9e2df06a4f34cbd72e964e821d30b
/cab_rider/android/app/src/main/java/com/sahilsaleem/cab_rider/MainActivity.java
df9ee44ccb113576aff3e852cfe98ce44484e0cc
[]
no_license
sahilsaleem2907/CabApp
ba732b28fb46b7660f67b8247127cc985f802244
cef9d68421c694d365a8a13bff1338bebf5bb12f
refs/heads/main
2023-07-12T18:07:12.810061
2021-08-20T09:28:33
2021-08-20T09:28:33
341,288,232
1
0
null
null
null
null
UTF-8
Java
false
false
144
java
package com.sahilsaleem.cab_rider; import io.flutter.embedding.android.FlutterActivity; public class MainActivity extends FlutterActivity { }
[ "sahi@gmail.com" ]
sahi@gmail.com
14929a54abf48a0b659741dbd5ea169e82b2700b
1be0f4f2573c7a9e0333345e6d288810cfbf6000
/app/src/main/java/com/sladma/common/mvvm/BaseFragment.java
1c25a1376b313993781df5949e70090f260440a3
[]
no_license
sladma/meteorite
a7089a11d55244f1ffc41cb1ac906d5a8e0ba361
8b0bc43c02846ab2a431c2420f623ebd36ec017e
refs/heads/master
2020-07-28T19:26:58.866959
2016-11-14T11:59:39
2016-11-14T11:59:39
73,697,753
0
0
null
null
null
null
UTF-8
Java
false
false
1,761
java
package com.sladma.common.mvvm; import android.databinding.DataBindingUtil; import android.databinding.ViewDataBinding; import android.os.Bundle; import android.support.annotation.CallSuper; import android.support.annotation.LayoutRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * Base class for all Fragments which use MVVM pattern. * <p> * initAndBind() has to be called in subclass. * <p> * Created by sladma */ public abstract class BaseFragment<D extends ViewDataBinding, VM extends IViewModel> extends Fragment implements IView { protected D dataBinding; protected VM viewModel; protected final View initAndBind(@NonNull VM viewModel, @NonNull LayoutInflater inflater, @Nullable ViewGroup container, @LayoutRes int layoutResId, int variableId, Bundle storedState) { this.viewModel = viewModel; this.dataBinding = DataBindingUtil.inflate(inflater, layoutResId, container, false); this.dataBinding.setVariable(variableId, viewModel); //noinspection unchecked this.viewModel.attachView(this, storedState); return this.dataBinding.getRoot(); } @Override @CallSuper public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); if (viewModel != null) { viewModel.saveState(outState); } } @Override @CallSuper public void onDestroyView() { super.onDestroyView(); if (viewModel != null) { viewModel.detachView(); } dataBinding = null; viewModel = null; } }
[ "sladecekmartincz@gmail.com" ]
sladecekmartincz@gmail.com
d8a828cbad5389ca5fd3ca238fefcdc36c3c7f5b
06a05c97acb9e35e5c078b782c29c1a3f82a9ee0
/02Decisao/src/ContaHotel.java
5e483fcc6998fe7f5dfa8020df6e4a1b2e9ad7f7
[]
no_license
KalinkaKalinka/workspacejavase
c7f8a6bca4bb5d91784eecb4b01fbd79d649f71c
56fbf5f491f5554a03869897c6472075ae146674
refs/heads/master
2022-12-22T07:05:29.855735
2020-09-23T12:14:44
2020-09-23T12:14:44
294,692,059
0
0
null
null
null
null
ISO-8859-1
Java
false
false
1,262
java
import javax.swing.JOptionPane; public class ContaHotel { public static void main(String[] args) { /*1. Um hotel cobra R$ 80,00 a diária e mais uma taxa de serviços. * A taxa de serviços é de: * R$ 5,50 por diária, se o número de diárias for maior que 15; * R$ 6,00 por diária, se o número de diárias for igual a 15; * R$ 8,00 por diária, se o número de diárias for menor que 15. * Monte uma aplicação que apresente a conta do cliente. */ String cliente = JOptionPane.showInputDialog("Nome do cliente"); int diarias = Integer.parseInt(JOptionPane.showInputDialog("Digite a quantidade de diárias")); double custodiaria = 80.00; double custotaxa = 8; if (diarias==15) { custotaxa = 6; } else if (diarias > 15) { custotaxa = 5.50; } //o que será exibido na conta System.out.println("Cliente "+cliente); System.out.println("Estadia de "+diarias+" dias"); System.out.println("Valor da diária R$ " + custodiaria + " / Total em diárias R$ " + (custodiaria * diarias)); System.out.println("Taxa de serviços por dia R$ " + custotaxa + " / Total em taxa de serviço R$ " + custotaxa*diarias); System.out.println("Custo total em R$ " + (custodiaria + custotaxa) * diarias); } }
[ "kalinka.reaper@gmail.com" ]
kalinka.reaper@gmail.com
2e43b716450747139f9aa00c7ad0c420b7cf198f
b5d1e02297c022a6054246c2d3d6ae5de2ac94e3
/src/main/java/com/giggagit/exam/Service/UserServiceImpl.java
dc9fb164df298c8aa191ecb6cd7a91e5ccb3ab72
[ "Apache-2.0" ]
permissive
giggagit/online-exercise-maker
2ebd6103e53e2110ede8f3a6fcb15872831c9176
207eeeea46a2725def83a845c33b85eb19abb245
refs/heads/master
2022-12-01T18:43:54.471204
2020-08-14T16:17:37
2020-08-14T16:17:37
242,560,340
0
0
null
null
null
null
UTF-8
Java
false
false
7,513
java
package com.giggagit.exam.Service; import java.util.Arrays; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import javax.transaction.Transactional; import com.giggagit.exam.Model.CustomUserDetails; import com.giggagit.exam.Model.ExamModel; import com.giggagit.exam.Model.RoleModel; import com.giggagit.exam.Model.ScoreModel; import com.giggagit.exam.Model.TopicModel; import com.giggagit.exam.Model.UserModel; import com.giggagit.exam.Repository.RoleRepository; import com.giggagit.exam.Repository.UserRepository; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; /** * UserServiceImpl */ @Service public class UserServiceImpl implements UserService { private final ScoreService scoreService; private final TopicService topicService; private final UserRepository userRepository; private final RoleRepository roleRepository; private final BCryptPasswordEncoder bCryptPasswordEncoder; public UserServiceImpl(ScoreService scoreService, TopicService topicService, UserRepository userRepository, RoleRepository roleRepository, BCryptPasswordEncoder bCryptPasswordEncoder) { this.scoreService = scoreService; this.topicService = topicService; this.userRepository = userRepository; this.roleRepository = roleRepository; this.bCryptPasswordEncoder = bCryptPasswordEncoder; } @Override @Transactional public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { UserModel user = userRepository.findByUsername(username); if (user == null) { throw new UsernameNotFoundException("Invalid username or password."); } Set<GrantedAuthority> grantedAuthorities = new HashSet<>(); for (RoleModel role : user.getRoles()) { grantedAuthorities.add(new SimpleGrantedAuthority(role.getName())); } UserDetails userDetails = new CustomUserDetails(user); return (userDetails); } @Override public void save(UserModel userModel) { userRepository.save(userModel); } @Override public Boolean create(UserModel userModel) { Boolean registerStatus = false; if (userModel.getPassword().equals(userModel.getPasswordConfirm())) { if (userRepository.findByUsername(userModel.getUsername()) == null) { userModel.setPassword(bCryptPasswordEncoder.encode(userModel.getPassword())); userModel.setRoles(new HashSet<RoleModel>(Arrays.asList(roleRepository.findByName("ROLE_USER")))); save(userModel); registerStatus = true; } } return (registerStatus); } @Override public void deleteById(int userId) { userRepository.deleteById(userId); } @Override public Boolean exist(int userId) { return userRepository.existsById(userId); } @Override public void update(UserModel userModel) { UserModel updateUser = findByUsername(userModel.getUsername()); // Update user detail updateUser.setFirstname(userModel.getFirstname()); updateUser.setLastname(userModel.getLastname()); updateUser.setEmail(userModel.getEmail()); updateUser.setClassroom(userModel.getClassroom()); save(updateUser); } @Override public void updateContext(Authentication authentication, UserModel userModel) { UserModel updateUser = findByUsername(authentication.getName()); // Update user detail updateUser.setFirstname(userModel.getFirstname()); updateUser.setLastname(userModel.getLastname()); updateUser.setEmail(userModel.getEmail()); updateUser.setClassroom(userModel.getClassroom()); // Update user's SecurityContextHolder.Details UserDetails userDetails = new CustomUserDetails(updateUser); UsernamePasswordAuthenticationToken contextDetails = new UsernamePasswordAuthenticationToken(userDetails, userDetails.getPassword(), userDetails.getAuthorities()); SecurityContextHolder.getContext().setAuthentication(contextDetails); save(updateUser); } @Override public ScoreModel submitExam(int topicId, String username, Map<String, String> userAnswer, TopicModel topicModel) { int userScore = 0; ScoreModel scoreModel = new ScoreModel(); // Convert Map<String,String> to Map<Integer,Integer> Map<Integer, Integer> userAnswers = userAnswer.entrySet().stream().collect(Collectors .toMap(entry -> Integer.parseInt(entry.getKey()), entry -> Integer.parseInt(entry.getValue()))); TopicModel getTopic = topicService.findById(topicId); UserModel userModel = findByUsername(username); for (ExamModel examAnswer : getTopic.getExamModel()) { if (examAnswer.getAnswer() == userAnswers.get(examAnswer.getId())) { userScore++; } } scoreModel = scoreService.result(userScore, getTopic.getPassScore(), getTopic, userModel); return scoreModel; } @Override public UserModel findByid(int userId) { return userRepository.findById(userId).orElseThrow(null); } @Override public UserModel findByUsername(String username) { return userRepository.findByUsername(username); } @Override public Page<UserModel> findAll(Pageable pageable) { return userRepository.findAll(pageable); } @Override public Boolean changePassword(Authentication authentication, UserModel userModel) { Boolean changeStatus = false; CustomUserDetails authenUser = (CustomUserDetails) authentication.getPrincipal(); UserModel updateUser = findByUsername(authentication.getName()); // Compare password with database if (bCryptPasswordEncoder.matches(userModel.getPassword(), authenUser.getPassword())) { // Compare new password and confirm password if (userModel.getPasswordNew().equals(userModel.getPasswordConfirm())) { // Set new password updateUser.setPassword(bCryptPasswordEncoder.encode(userModel.getPasswordNew())); // Update user's SecurityContextHolder.Details UserDetails userDetails = new CustomUserDetails(updateUser); UsernamePasswordAuthenticationToken contextDetails = new UsernamePasswordAuthenticationToken( userDetails, userDetails.getPassword(), userDetails.getAuthorities()); SecurityContextHolder.getContext().setAuthentication(contextDetails); save(updateUser); changeStatus = true; } } return changeStatus; } }
[ "gigg@outlook.com" ]
gigg@outlook.com
77a7702c34c5b1dc0ea239912f86609901f5ce03
49fda4bbb5a202e8d5d1be4e974e3509c85b4c3a
/fr.ocelet/src-gen/fr/ocelet/lang/validation/AbstractOceletValidator.java
2426358f74924b2b29875094a3368122c016c016
[]
no_license
ElsevierSoftwareX/SOFTX-D-16-00024
b3fe5c621cc4599d4e9af814993b16c84b4bb3fe
ddd46a68db1d4163de837f9b0da18241b783d4cb
refs/heads/master
2020-07-10T09:36:14.456531
2016-04-07T13:00:45
2016-04-07T13:00:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
/* * generated by Xtext 2.9.1 */ package fr.ocelet.lang.validation; import java.util.ArrayList; import java.util.List; import org.eclipse.emf.ecore.EPackage; import org.eclipse.xtext.xbase.validation.XbaseValidator; public abstract class AbstractOceletValidator extends XbaseValidator { @Override protected List<EPackage> getEPackages() { List<EPackage> result = new ArrayList<EPackage>(super.getEPackages()); result.add(fr.ocelet.lang.ocelet.OceletPackage.eINSTANCE); result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/xbase/Xbase")); result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/common/JavaVMTypes")); result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/xbase/Xtype")); return result; } }
[ "pdegenne@teledetection.fr" ]
pdegenne@teledetection.fr
701408f0cdf4ae5c14c9376549fc3bb80a9ccbdc
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
/eclipsejdt_cluster/17510/tar_0.java
283599c58dac284762e0f70cd9be5d2106399f5f
[]
no_license
martinezmatias/GenPat-data-C3
63cfe27efee2946831139747e6c20cf952f1d6f6
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
refs/heads/master
2022-04-25T17:59:03.905613
2020-04-15T14:41:34
2020-04-15T14:41:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
15,529
java
package org.eclipse.jdt.internal.core; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.core.*; import org.eclipse.jdt.internal.core.util.*; import java.io.File; import java.util.*; /** * Implementation of <code>IJavaModel<code>. The Java Model maintains a cache of * active <code>IJavaProject</code>s in a workspace. A Java Model is specific to a * workspace. To retrieve a workspace's model, use the * <code>#getJavaModel(IWorkspace)</code> method. * * @see IJavaModel */ public class JavaModel extends Openable implements IJavaModel { /** * The workspace this Java Model represents */ protected IWorkspace workspace = null; /** * Constructs a new Java Model on the given workspace. * * @exception Error if called more than once */ protected JavaModel(IWorkspace workspace) throws Error { super(JAVA_MODEL, null, "" /*workspace has empty name*/); //$NON-NLS-1$ this.workspace = workspace; } /** * Remove the Java Model from the cache */ protected void closing(Object info) throws JavaModelException { if (JavaModelManager.VERBOSE){ System.out.println("CLOSING Element ("+ Thread.currentThread()+"): " + this.getHandleIdentifier()); //$NON-NLS-1$//$NON-NLS-2$ } JavaModelManager.fgManager.fModelInfo.close(); JavaModelManager.fgManager.fModelInfo= null; } /** * @see IJavaModel */ public void copy(IJavaElement[] elements, IJavaElement[] containers, IJavaElement[] siblings, String[] renamings, boolean force, IProgressMonitor monitor) throws JavaModelException { if (elements != null && elements[0] != null && elements[0].getElementType() < IJavaElement.TYPE) { runOperation(new CopyResourceElementsOperation(elements, containers, force), elements, siblings, renamings, monitor); } else { runOperation(new CopyElementsOperation(elements, containers, force), elements, siblings, renamings, monitor); } } /** * Returns a new element info for this element. */ protected OpenableElementInfo createElementInfo() { return new JavaModelInfo(this, this.workspace); } /** * Computes the depth of the given java project following its classpath. * Only projects are taken into consideration. Store the depth in the given table. * Returns the depth. * Note that a project with no prerequisites has a depth of 0. * Returns -1 if a cycle is detected */ protected int computeDepth(String projectName, StringHashtableOfInt depthTable) throws JavaModelException { int depth = depthTable.get(projectName); switch (depth) { case -2: // project already visited -> it's a cycle throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.NAME_COLLISION)); case -1: depthTable.put(projectName, -2); // mark we're visiting the project int prereqDepth = -1; JavaProject project = (JavaProject)this.getJavaProject(projectName); String[] prerequisites = null; try { prerequisites = project.getRequiredProjectNames(); } catch (JavaModelException e) { prerequisites = JavaProject.NO_PREREQUISITES; } for (int i = 0, length = prerequisites.length; i < length; i++) { String prerequisite = prerequisites[i]; prereqDepth = Math.max( prereqDepth, this.computeDepth(prerequisite, depthTable) ); } depth = 1 + prereqDepth; depthTable.put(projectName, depth); return depth; default: return depth; } } /** * @see IJavaModel */ public void delete(IJavaElement[] elements, boolean force, IProgressMonitor monitor) throws JavaModelException { if (elements != null && elements[0] != null && elements[0].getElementType() < IJavaElement.TYPE) { runOperation(new DeleteResourceElementsOperation(elements, force), monitor); } else { runOperation(new DeleteElementsOperation(elements, force), monitor); } } /** * Java Models are equal if their workspaces are equal * * @see Object#equals */ public boolean equals(Object o) { if (this == o) return true; if (o instanceof JavaModel) { JavaModel other = (JavaModel) o; return this.workspace.equals(other.workspace); } return false; } /** */ protected boolean generateInfos( OpenableElementInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource) throws JavaModelException { fgJavaModelManager.fModelInfo = (JavaModelInfo) info; // determine my children try { IProject[] projects = workspace.getRoot().getProjects(); for (int i = 0, max = projects.length; i < max; i++) { IProject project = projects[i]; if (project.isOpen() && project.hasNature(JavaCore.NATURE_ID)) { info.addChild(getJavaProject(project)); } } } catch (CoreException e) { throw new JavaModelException(e); } return true; } /** * Returns the <code>IJavaElement</code> represented by the <code>String</code> * memento. * @see getHandleMemento() */ protected IJavaElement getHandleFromMementoForBinaryMembers(String memento, IPackageFragmentRoot root, int rootEnd, int end) throws JavaModelException { //deal with class file and binary members IPackageFragment frag = null; if (rootEnd == end - 1) { //default package frag= root.getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME); } else { frag= root.getPackageFragment(memento.substring(rootEnd + 1, end)); } int oldEnd = end; end = memento.indexOf(JavaElement.JEM_TYPE, oldEnd); if (end == -1) { //we ended with a class file return frag.getClassFile(memento.substring(oldEnd + 1)); } IClassFile cf = frag.getClassFile(memento.substring(oldEnd + 1, end)); oldEnd = end; end = memento.indexOf(JavaElement.JEM_TYPE, oldEnd); oldEnd = end; end = memento.indexOf(JavaElement.JEM_FIELD, end); if (end != -1) { //binary field IType type = cf.getType(); return type.getField(memento.substring(end + 1)); } end = memento.indexOf(JavaElement.JEM_METHOD, oldEnd); if (end != -1) { //binary method oldEnd = end; IType type = cf.getType(); String methodName; end = memento.lastIndexOf(JavaElement.JEM_METHOD); String[] parameterTypes = null; if (end == oldEnd) { methodName = memento.substring(end + 1); //no parameter types parameterTypes = new String[] {}; } else { String parameters = memento.substring(oldEnd + 1); StringTokenizer tokenizer = new StringTokenizer(parameters, new String(new char[] {JavaElement.JEM_METHOD})); parameterTypes = new String[tokenizer.countTokens() - 1]; methodName= tokenizer.nextToken(); int i = 0; while (tokenizer.hasMoreTokens()) { parameterTypes[i] = tokenizer.nextToken(); i++; } } return type.getMethod(methodName, parameterTypes); } //binary type return cf.getType(); } /** * Returns the <code>IJavaElement</code> represented by the <code>String</code> * memento. * @see getHandleMemento() */ protected IJavaElement getHandleFromMementoForSourceMembers(String memento, IPackageFragmentRoot root, int rootEnd, int end) throws JavaModelException { //deal with compilation units and source members IPackageFragment frag = null; if (rootEnd == end - 1) { //default package frag= root.getPackageFragment(IPackageFragment.DEFAULT_PACKAGE_NAME); } else { frag= root.getPackageFragment(memento.substring(rootEnd + 1, end)); } int oldEnd = end; end = memento.indexOf(JavaElement.JEM_PACKAGEDECLARATION, end); if (end != -1) { //package declaration ICompilationUnit cu = frag.getCompilationUnit(memento.substring(oldEnd + 1, end)); return cu.getPackageDeclaration(memento.substring(end + 1)); } end = memento.indexOf(JavaElement.JEM_IMPORTDECLARATION, oldEnd); if (end != -1) { //import declaration ICompilationUnit cu = frag.getCompilationUnit(memento.substring(oldEnd + 1, end)); return cu.getImport(memento.substring(end + 1)); } int typeStart = memento.indexOf(JavaElement.JEM_TYPE, oldEnd); if (typeStart == -1) { //we ended with a compilation unit return frag.getCompilationUnit(memento.substring(oldEnd + 1)); } //source members ICompilationUnit cu = frag.getCompilationUnit(memento.substring(oldEnd + 1, typeStart)); end = memento.indexOf(JavaElement.JEM_FIELD, oldEnd); if (end != -1) { //source field IType type = getHandleFromMementoForSourceType(memento, cu, typeStart, end); return type.getField(memento.substring(end + 1)); } end = memento.indexOf(JavaElement.JEM_METHOD, oldEnd); if (end != -1) { //source method IType type = getHandleFromMementoForSourceType(memento, cu, typeStart, end); oldEnd = end; String methodName; end = memento.lastIndexOf(JavaElement.JEM_METHOD); String[] parameterTypes = null; if (end == oldEnd) { methodName = memento.substring(end + 1); //no parameter types parameterTypes = new String[] {}; } else { String parameters = memento.substring(oldEnd + 1); StringTokenizer mTokenizer = new StringTokenizer(parameters, new String(new char[] {JavaElement.JEM_METHOD})); parameterTypes = new String[mTokenizer.countTokens() - 1]; methodName = mTokenizer.nextToken(); int i = 0; while (mTokenizer.hasMoreTokens()) { parameterTypes[i] = mTokenizer.nextToken(); i++; } } return type.getMethod(methodName, parameterTypes); } end = memento.indexOf(JavaElement.JEM_INITIALIZER, oldEnd); if (end != -1 ) { //initializer IType type = getHandleFromMementoForSourceType(memento, cu, typeStart, end); return type.getInitializer(Integer.parseInt(memento.substring(end + 1))); } //source type return getHandleFromMementoForSourceType(memento, cu, typeStart, memento.length()); } /** * Returns the <code>IJavaElement</code> represented by the <code>String</code> * memento. * @see getHandleMemento() */ protected IType getHandleFromMementoForSourceType(String memento, ICompilationUnit cu, int typeStart, int typeEnd) throws JavaModelException { int end = memento.lastIndexOf(JavaElement.JEM_TYPE); IType type = null; if (end == typeStart) { String typeName = memento.substring(typeStart + 1, typeEnd); type = cu.getType(typeName); } else { String typeNames = memento.substring(typeStart + 1, typeEnd); StringTokenizer tokenizer = new StringTokenizer(typeNames, new String(new char[] {JavaElement.JEM_TYPE})); type = cu.getType(tokenizer.nextToken()); while (tokenizer.hasMoreTokens()) { //deal with inner types type= type.getType(tokenizer.nextToken()); } } return type; } /** * @see JavaElement#getHandleMemento() */ public String getHandleMemento(){ return getElementName(); } /** * Returns the <code>char</code> that marks the start of this handles * contribution to a memento. */ protected char getHandleMementoDelimiter(){ Assert.isTrue(false, Util.bind("assert.shouldNotImplement")); //$NON-NLS-1$ return 0; } /** * @see IJavaElement */ public IJavaModel getJavaModel() { return this; } /** * @see IJavaElement */ public IJavaProject getJavaProject() { return null; } /** * @see IJavaModel */ public IJavaProject getJavaProject(String name) { return new JavaProject(this.workspace.getRoot().getProject(name), this); } /** * Returns the active Java project associated with the specified * resource, or <code>null</code> if no Java project yet exists * for the resource. * * @exception IllegalArgumentException if the given resource * is not one of an IProject, IFolder, or IFile. */ public IJavaProject getJavaProject(IResource resource) { if (resource.getType() == IResource.FOLDER) { return new JavaProject(((IFolder)resource).getProject(), this); } else if (resource.getType() == IResource.FILE) { return new JavaProject(((IFile)resource).getProject(), this); } else if (resource.getType() == IResource.PROJECT) { return new JavaProject((IProject)resource, this); } else { throw new IllegalArgumentException(Util.bind("element.invalidResourceForProject")); //$NON-NLS-1$ } } /** * @see IJavaModel */ public IJavaProject[] getJavaProjects() throws JavaModelException { ArrayList list = getChildrenOfType(JAVA_PROJECT); IJavaProject[] array= new IJavaProject[list.size()]; list.toArray(array); return array; } /** * @see IOpenable */ public IResource getUnderlyingResource() throws JavaModelException { return null; } /** * Returns the workbench associated with this object. */ public IWorkspace getWorkspace() { return this.workspace; } /** * The hashcode of a Java Model is that of its workspace. */ public int hashCode() { return this.workspace.hashCode(); } /** * @see IJavaModel */ public void move(IJavaElement[] elements, IJavaElement[] containers, IJavaElement[] siblings, String[] renamings, boolean force, IProgressMonitor monitor) throws JavaModelException { if (elements != null && elements[0] != null && elements[0].getElementType() < IJavaElement.TYPE) { runOperation(new MoveResourceElementsOperation(elements, containers, force), elements, siblings, renamings, monitor); } else { runOperation(new MoveElementsOperation(elements, containers, force), elements, siblings, renamings, monitor); } } /** * @see IJavaModel */ public void rename(IJavaElement[] elements, IJavaElement[] destinations, String[] renamings, boolean force, IProgressMonitor monitor) throws JavaModelException { MultiOperation op; if (elements != null && elements[0] != null && elements[0].getElementType() < IJavaElement.TYPE) { op = new RenameResourceElementsOperation(elements, destinations, renamings, force); } else { op = new RenameElementsOperation(elements, destinations, renamings, force); } runOperation(op, monitor); } /* * @see JavaElement#rootedAt(IJavaProject) */ public IJavaElement rootedAt(IJavaProject project) { return this; } /** * Configures and runs the <code>MultiOperation</code>. */ protected void runOperation(MultiOperation op, IJavaElement[] elements, IJavaElement[] siblings, String[] renamings, IProgressMonitor monitor) throws JavaModelException { op.setRenamings(renamings); if (siblings != null) { for (int i = 0; i < elements.length; i++) { op.setInsertBefore(elements[i], siblings[i]); } } runOperation(op, monitor); } /** * @private Debugging purposes */ protected void toStringInfo(int tab, StringBuffer buffer, Object info) { buffer.append(this.tabString(tab)); buffer.append("Java Model"); //$NON-NLS-1$ if (info == null) { buffer.append(" (not open)"); //$NON-NLS-1$ } } /** * Helper method - returns the targeted item (IResource if internal or java.io.File if external), * or null if unbound * Internal items must be referred to using container relative paths. */ public static Object getTarget(IContainer container, IPath path, boolean checkResourceExistence) { if (path == null) return null; // lookup - inside the container IResource resource = container.findMember(path); if (resource != null){ if (!checkResourceExistence ||resource.exists()) return resource; return null; } // lookup - outside the container File externalFile = new File(path.toOSString()); if (!checkResourceExistence ||externalFile.exists()) return externalFile; return null; } }
[ "375833274@qq.com" ]
375833274@qq.com
de6b2325e15faacea4db609920df839831a8a54f
80bb6257e9f6a8349e5e480ce26300bdb8addce5
/src/main/java/com/infotop/system/MainController.java
f0588d4009db0bda34d835ed5cf59eaa3389ec46
[]
no_license
Prussia/SamplesProject
36e5217f6a1b9e343d570b2a6f5d1ec5bb892d6f
d5a18feeadff4f3c7d550ec66f1498783893bb6d
refs/heads/master
2021-01-10T16:07:27.492025
2016-01-25T05:23:06
2016-01-25T05:23:06
49,878,816
0
0
null
null
null
null
UTF-8
Java
false
false
445
java
package com.infotop.system; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.infotop.common.BasicController; @Controller @RequestMapping(value = "/home") public class MainController extends BasicController { /** * 首页系统选择页面 * @return */ @RequestMapping(value = "") public String mainframe() { return "mainFrame"; } }
[ "prussia.hu@gmail.com" ]
prussia.hu@gmail.com
3c44411cb020570a05fb5af3dcfdd61137ab8322
898619d07ec0843d0bdad6caf7617eb85e00cff4
/src/br/com/csh/model/repository/TipoTelefoneRepository.java
21ee5f3a57e7167752dfd459cd312507d6ce5328
[]
no_license
hernanifcmoreno/control-system-hotel
0e93f4e4a6c33b806842fadb5dd0c6729c3bf040
ce2552d3eed376e3ce07d4fc58b554101779b0fa
refs/heads/master
2020-04-06T06:51:58.438829
2015-01-23T19:51:11
2015-01-23T19:51:11
29,706,161
0
0
null
null
null
null
UTF-8
Java
false
false
248
java
package br.com.csh.model.repository; import javax.enterprise.context.RequestScoped; import br.com.csh.model.bean.TipoTelefoneBean; @RequestScoped public interface TipoTelefoneRepository extends GenericRepository<TipoTelefoneBean, Integer> { }
[ "hernani.fernandes@fcmoreno.com.br" ]
hernani.fernandes@fcmoreno.com.br
8425e7ce247d0121e95beb9c222331c9fabbb3d4
093a6bf70b0e2e2f0839d399cc1bfe39b652f6c0
/src/main/java/Fetch/FetchData.java
94fc7198f18f9a8e4cb9b66116aa2b0c65385d6b
[]
no_license
nesquick7777/posaoHR
3aa6e2cee535d1e9fbb8599921e541c5e4de173e
24f9000047e417ec685d4bba80f2aa55cef9a07c
refs/heads/master
2022-12-12T10:55:26.188590
2020-09-12T12:05:17
2020-09-12T12:05:17
294,936,418
0
0
null
null
null
null
UTF-8
Java
false
false
1,228
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 Fetch; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import org.jsoup.Jsoup; import org.jsoup.helper.Validate; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; /** * * @author Bole */ public class FetchData { public static void main(String[] args) { System.out.println("hello"); try { Document doc = Jsoup.connect("https://www.posao.hr/oglasi/angular-frontend-developer-m-z/703458/").userAgent("Mozilla/5.0").get(); // System.out.println(doc.body()); Elements temp=doc.select(".jobs_about_p, .jobs_about_right "); System.out.println(temp.size()); for(Element posao:temp){ System.out.println(posao.text()); } } catch (IOException e) { e.printStackTrace(); } System.out.println("čđčšćđĐĆŽŠČĆž"); } }
[ "nesquick7777@gmail.com" ]
nesquick7777@gmail.com
8cca062316d40069f178615971176cb9a9d4cfb4
bf2966abae57885c29e70852243a22abc8ba8eb0
/aws-java-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/StreamProcessorOutputJsonUnmarshaller.java
e1ced8edfc44cebfe3c96d0d38277fd0e7fbe585
[ "Apache-2.0" ]
permissive
kmbotts/aws-sdk-java
ae20b3244131d52b9687eb026b9c620da8b49935
388f6427e00fb1c2f211abda5bad3a75d29eef62
refs/heads/master
2021-12-23T14:39:26.369661
2021-07-26T20:09:07
2021-07-26T20:09:07
246,296,939
0
0
Apache-2.0
2020-03-10T12:37:34
2020-03-10T12:37:33
null
UTF-8
Java
false
false
2,844
java
/* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.rekognition.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.rekognition.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * StreamProcessorOutput JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class StreamProcessorOutputJsonUnmarshaller implements Unmarshaller<StreamProcessorOutput, JsonUnmarshallerContext> { public StreamProcessorOutput unmarshall(JsonUnmarshallerContext context) throws Exception { StreamProcessorOutput streamProcessorOutput = new StreamProcessorOutput(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("KinesisDataStream", targetDepth)) { context.nextToken(); streamProcessorOutput.setKinesisDataStream(KinesisDataStreamJsonUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return streamProcessorOutput; } private static StreamProcessorOutputJsonUnmarshaller instance; public static StreamProcessorOutputJsonUnmarshaller getInstance() { if (instance == null) instance = new StreamProcessorOutputJsonUnmarshaller(); return instance; } }
[ "" ]
8df83a02a29d54c2e1a22dfbf0a9d2105aa2f1f2
9d2809ee4669e3701884d334c227c68a24c5787f
/distributioncenter/distribution-core/src/test/java/com/mockuai/distributioncenter/core/service/action/fans_gain/FansGainTest.java
e85a26930903c00c1eff017d99f0c0c884c127a4
[]
no_license
vinfai/hy_project
5370367876fe6bcb4109f2af9391b9d817c320b5
8fd99f23cf83b1b3f7bec9560fbd2edc46621d0b
refs/heads/master
2021-01-19T00:58:26.436196
2017-03-01T16:47:22
2017-03-01T16:49:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,813
java
package com.mockuai.distributioncenter.core.service.action.fans_gain; import com.mockuai.common.uils.StarterRunner; import com.mockuai.distributioncenter.common.api.BaseRequest; import com.mockuai.distributioncenter.common.api.DistributionService; import com.mockuai.distributioncenter.common.api.Request; import com.mockuai.distributioncenter.common.api.Response; import com.mockuai.distributioncenter.common.constant.ActionEnum; import com.mockuai.distributioncenter.common.domain.dto.FansDistDTO; import com.mockuai.distributioncenter.common.domain.dto.GainsSetDTO; import com.mockuai.distributioncenter.common.domain.qto.FansDistQTO; import com.mockuai.distributioncenter.core.manager.GainsSetManager; import com.mockuai.distributioncenter.core.service.action.UnitTestUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.List; /** * Created by lizg on 2016/8/29. */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "classpath:applicationContext.xml") public class FansGainTest { private static final String APP_NAME = "distribution"; private static final String LOCAL_PROPERTIES = "e:/hy_workspace_test/haiyn/haiyn_properties/distribution/haiyn.properties"; // E:\hy_workspace_test\haiyn\haiyn_properties @Autowired private DistributionService distributionService; @Autowired private GainsSetManager gainsSetManager; private static final String appKey = "27c7bc87733c6d253458fa8908001eef"; static { try { StarterRunner.localSystemProperties(APP_NAME,LOCAL_PROPERTIES, new String[]{"local"}); } catch (Exception e) { e.printStackTrace(); } } @Test public void FansGainTest111(){ FansDistQTO fansDistQTO = new FansDistQTO(); fansDistQTO.setInviterId(1615260L); fansDistQTO.setOffset(0L); fansDistQTO.setCount(100); // fansDistQTO.setInviterId() Request request = new BaseRequest(); request.setParam("fansDistQTO",fansDistQTO); request.setCommand(ActionEnum.QUERY_FANS_AND_DIST.getActionName()); request.setParam("appKey",appKey); Response<List<FansDistDTO>> fansDistDTOS = (Response<List<FansDistDTO>>) distributionService.execute(request); if (fansDistDTOS.isSuccess()){ System.out.println("success!!-------------------------------------"); } List<FansDistDTO> fansDistDTOS1 = fansDistDTOS.getModule(); for (FansDistDTO fansDistDTO : fansDistDTOS1){ System.out.println(fansDistDTO.toString()); } } }
[ "1147478866@qq.com" ]
1147478866@qq.com
39b990da60d798ad26d3343c19b0fdc25ce133b8
2251181bc47fecf338a2d0245a6e1f6f78532fff
/Source/Anki/src/main/java/vn/com/luanvan/controller/LoginController.java
b4481b4555f3a4decd1bc4420412b0bb4983b6e6
[]
no_license
trandien/graduate-CanTho
c97e637ee9ea9ff06cd4a95d2a8afc2e2ac8deb6
f367f10a39bd1feeb0fc2d20d9d5f4d1c454ba26
refs/heads/master
2020-12-24T16:31:49.209809
2015-05-01T18:41:04
2015-05-01T18:41:04
29,422,235
0
0
null
null
null
null
UTF-8
Java
false
false
776
java
package vn.com.luanvan.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import vn.com.luanvan.dao.UserDao; import vn.com.luanvan.dao.UserDaoImpl; import vn.com.luanvan.model.User; import vn.com.luanvan.service.UserService; import vn.com.luanvan.service.UserServiceImpl; @Controller public class LoginController { @Autowired UserService userService; @RequestMapping(value = "/", method = RequestMethod.GET) public ModelAndView Register(ModelAndView model) { model.setViewName("register"); return model; } }
[ "tranthanhdien123321@gmail.com" ]
tranthanhdien123321@gmail.com
5e209e178e1946929e544dfd068576ec93ac5eaa
73650c79eaf9d58caa92c6fb8aed0bf95db551f8
/src/main/java/org/cg/persistence/NoticeDAOImpl.java
9d0ec953087a2d1cd1cb3a0bd147e96451cb3e18
[]
no_license
bbako/5am_hy_customer
8cafdf160d5e6c5ee32e6a7210aec106d0bafadb
c6f2e8385fb749fccd7f3f683b45ef4bfe3812b4
refs/heads/master
2020-03-22T15:25:15.822798
2018-10-19T02:44:18
2018-10-19T02:44:18
140,251,273
0
0
null
null
null
null
UTF-8
Java
false
false
771
java
package org.cg.persistence; import java.util.List; import javax.inject.Inject; import org.cg.domain.NoticeVO; import org.mybatis.spring.SqlSessionTemplate; import org.springframework.stereotype.Repository; @Repository public class NoticeDAOImpl implements NoticeDAO { String namespace = "org.cg.persistence.NoticeDAO"; @Inject SqlSessionTemplate sess; @Override public void create(NoticeVO vo) { sess.insert(namespace+".addNotice", vo); } @Override public List<NoticeVO> getList(int page) { return sess.selectList(namespace+".noticeList",page); } @Override public void update(NoticeVO vo) { sess.update(namespace+".modiNotice", vo); } @Override public void delete(String tcno) { sess.delete(namespace+".delNotice", tcno); } }
[ "Administrator@admin-PC" ]
Administrator@admin-PC
e376d1477630921071ac2ab87ac7391cae754c4c
6a553176ecc88c6f7a5f8b3e570407e935688357
/app/src/main/java/com/example/aisletest/repository/API.java
30ae4005ee131059e921a64634bdc8c4e84b336d
[]
no_license
ankitmhatre/Aisle
08bbe5062bff6ec090c7d1229bcd61dddbc34c35
7571fe704418da378360b7f845b9589d0fda2bf1
refs/heads/master
2023-05-24T08:01:29.082706
2021-06-16T06:01:03
2021-06-16T06:01:03
377,284,591
0
0
null
null
null
null
UTF-8
Java
false
false
569
java
package com.example.aisletest.repository; import retrofit2.Retrofit; import retrofit2.converter.gson.GsonConverterFactory; public class API { public static final String BASE_URL = "https://testa2.aisle.co/V1/"; private static Retrofit retrofit = null; public static Retrofit getClient() { if (retrofit==null) { retrofit = new Retrofit.Builder() .baseUrl(BASE_URL) .addConverterFactory(GsonConverterFactory.create()) .build(); } return retrofit; } }
[ "ankit@1337lab.io" ]
ankit@1337lab.io
cb5c509f5b12b5e20ae5add4414637ed8f4cd837
507b1a1ba7ea968aa0f80abc836fe24a04a22bb6
/src/main/java/by/toxa/fishingshop/controller/command/impl/go/GoToAdminPageCommand.java
20fbce2ee364d9a67c2b4c3a7cac6bd2153aeb4d
[]
no_license
Toxa1987/FishingShopFinalTask
6f656e474a730a09c96ab29ca486456b7065ecdd
527fe0eda41d5c4efece26379695e941217d43b3
refs/heads/main
2023-07-13T21:51:58.936012
2021-08-26T11:52:56
2021-08-26T11:52:56
376,716,362
0
1
null
null
null
null
UTF-8
Java
false
false
552
java
package by.toxa.fishingshop.controller.command.impl.go; import by.toxa.fishingshop.controller.command.Command; import by.toxa.fishingshop.controller.command.Router; import javax.servlet.http.HttpServletRequest; import static by.toxa.fishingshop.controller.command.PagePath.ADMIN_PAGE; import static by.toxa.fishingshop.controller.command.Router.RouterType.REDIRECT; public class GoToAdminPageCommand implements Command { @Override public Router execute(HttpServletRequest request) { return new Router(ADMIN_PAGE, REDIRECT); } }
[ "wertyal.87@mail.ru" ]
wertyal.87@mail.ru
198ba6325c873d152145fe83871440a5ff11e296
ba3a3c274e149220af02db7b3fe01c51f1503f53
/app/src/main/java/com/udacity/gradle/builditbigger/DialogHelper.java
49e1fafef0c5a05367c43a3a827d2251d5c98f7c
[]
no_license
semmiverian/Build-It-Bigger
d1d926a3f071708997cea4a6905ea91ab59281b9
4f0e74e9f4cdaf256c3019ab301e609c8250fb3b
refs/heads/master
2020-05-26T04:57:40.463430
2017-02-19T14:49:18
2017-02-19T14:49:18
82,466,202
0
0
null
null
null
null
UTF-8
Java
false
false
1,697
java
package com.udacity.gradle.builditbigger; import android.content.Context; import com.afollestad.materialdialogs.MaterialDialog; /** * Created by Semmiverian on 2/19/17. */ public class DialogHelper { private Context context; public DialogHelper(Context context) { this.context = context; } public void singlePositiveDialog(String title, String content, String buttonText,MaterialDialog.SingleButtonCallback callback){ new MaterialDialog.Builder(context) .title(title) .content(content) .positiveText(buttonText) .positiveColorRes(R.color.teal_400) .onPositive(callback) .show(); } public void positiveAndNegativeDialog(String title, String content, String buttonPositiveText, String buttonNegativeText, MaterialDialog.SingleButtonCallback callbackPositive, MaterialDialog.SingleButtonCallback callbackNegative){ new MaterialDialog.Builder(context) .title(title) .content(content) .positiveText(buttonPositiveText) .negativeText(buttonNegativeText) .positiveColorRes(R.color.teal_400) .negativeColorRes(R.color.teal_400) .onPositive(callbackPositive) .onNegative(callbackNegative) .show(); } public MaterialDialog loadingDialog(String title,String content){ return new MaterialDialog.Builder(context) .title(title) .content(content) .progress(true, 0) .widgetColorRes(R.color.teal_400) .show(); } }
[ "semmivp1@gmail.com" ]
semmivp1@gmail.com
ac59bb78c03653349e6d23deb6e10fa17bbc52a5
cade2b49c0202468f250c5c8aef7c4fe9f9e1a6b
/MyApplication/app/src/main/java/com/krypton/core/internal/queries/SendPasswordRecoveryQuery.java
000090c2f3d1f3d6ddf2384601dd0c22f4a7de4c
[]
no_license
E-leg/CodevP52
f9068e8cf5a6235299db3177915c424e72452d24
c27fc0f22a829671a8f5c7f2035bd4dd67ffe08d
refs/heads/master
2022-06-08T19:39:34.029819
2020-05-06T20:05:54
2020-05-06T20:05:54
260,432,181
2
0
null
null
null
null
UTF-8
Java
false
false
480
java
package com.krypton.core.internal.queries; import java.util.HashMap; public class SendPasswordRecoveryQuery extends Query { public SendPasswordRecoveryQuery(HashMap<String, Object> variables) { super(variables); this.getQuery(); } public void getQuery() { StringBuilder sb = new StringBuilder(); sb.append("query sendPasswordRecoveryEmail($email: String!) {") .append("sendPasswordRecoveryEmail(email: $email)").append("}"); this.query = sb.toString(); } }
[ "dylanrachwal@hotmail.fr" ]
dylanrachwal@hotmail.fr
139be70a6106077d24553e506cb0284479791c93
179008134f5ea5b91842041aa4cf78eaecd1948f
/2/server/src/ua/kiev/prog/AddUserServlet.java
a42be1a7c24b6006e29f3e3b06a49c4a1c5a99d8
[]
no_license
prokhorind/chat
4b4b6704998fce031a60489e4e89839605c01018
2f15c28d3b3dd1e60644e115c86506de36ca5965
refs/heads/master
2021-01-17T23:34:25.885351
2017-03-07T17:48:02
2017-03-07T17:48:02
84,228,112
0
0
null
null
null
null
UTF-8
Java
false
false
1,784
java
package ua.kiev.prog; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; /** * Created by kleba on 02.03.2017. */ public class AddUserServlet extends HttpServlet { public static String from; private UserList userList=UserList.getInstance(); @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException { byte[] buf = requestBodyToArray(req); //message в json String bufStr = new String(buf, StandardCharsets.UTF_8); User u = User.fromJSON(bufStr); System.out.println("USer="+u.getName()); if (u != null) { userList.add(u); /* if(userList.size()==0){ userList.add(u); } else { for (int i = 0; i < userList.size(); i++) { if (u.getName().equals(userList.getName(i))) { break; } else if(i==(userList.size()-1)) userList.add(u); } } */ } else resp.setStatus(HttpServletResponse.SC_BAD_REQUEST); } private byte[] requestBodyToArray(HttpServletRequest req) throws IOException { InputStream is = req.getInputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte[] buf = new byte[10240]; int r; do { r = is.read(buf); if (r > 0) bos.write(buf, 0, r); } while (r != -1); return bos.toByteArray(); } }
[ "den.u@mail.ru" ]
den.u@mail.ru
4ca02a5cf622b067897c50b0af00f9fbef56e222
de3c2d89f623527b35cc5dd936773f32946025d2
/src/main/java/epco/C8004v.java
c1d8b4f939d1b833ead99c83e18a4748d33cce9b
[]
no_license
ren19890419/lvxing
5f89f7b118df59fd1da06aaba43bd9b41b5da1e6
239875461cb39e58183ac54e93565ec5f7f28ddb
refs/heads/master
2023-04-15T08:56:25.048806
2020-06-05T10:46:05
2020-06-05T10:46:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,847
java
package epco; /* renamed from: epco.v */ public class C8004v { /* renamed from: a */ private long f27210a; /* renamed from: b */ private short f27211b; /* renamed from: c */ private short f27212c; /* renamed from: d */ private String f27213d; /* renamed from: e */ private String f27214e; /* renamed from: f */ private short f27215f; /* renamed from: g */ private short f27216g; /* renamed from: h */ private int f27217h; /* renamed from: i */ private short f27218i; /* renamed from: j */ private short f27219j; /* renamed from: k */ private short f27220k; /* renamed from: l */ private short f27221l; /* renamed from: m */ private int f27222m; /* renamed from: n */ private int f27223n; /* renamed from: o */ private int f27224o; /* renamed from: p */ private int f27225p; /* renamed from: q */ private short f27226q; /* renamed from: r */ private short f27227r; /* renamed from: s */ private short f27228s; /* renamed from: t */ private short f27229t; /* renamed from: a */ public String mo38452a() { return this.f27214e; } /* renamed from: a */ public void mo38453a(int i) { this.f27217h = i; } /* renamed from: a */ public void mo38454a(long j) { this.f27210a = j; } /* renamed from: a */ public void mo38455a(String str) { this.f27214e = str; } /* renamed from: a */ public void mo38456a(short s) { this.f27220k = s; } /* renamed from: b */ public int mo38457b() { return this.f27217h; } /* renamed from: b */ public void mo38458b(int i) { this.f27225p = i; } /* renamed from: b */ public void mo38459b(String str) { this.f27213d = str; } /* renamed from: b */ public void mo38460b(short s) { this.f27221l = s; } /* renamed from: c */ public short mo38461c() { return this.f27220k; } /* renamed from: c */ public void mo38462c(int i) { this.f27223n = i; } /* renamed from: c */ public void mo38463c(short s) { this.f27218i = s; } /* renamed from: d */ public short mo38464d() { return this.f27221l; } /* renamed from: d */ public void mo38465d(int i) { this.f27222m = i; } /* renamed from: d */ public void mo38466d(short s) { this.f27211b = s; } /* renamed from: e */ public short mo38467e() { return this.f27218i; } /* renamed from: e */ public void mo38468e(int i) { this.f27224o = i; } /* renamed from: e */ public void mo38469e(short s) { this.f27212c = s; } /* renamed from: f */ public String mo38470f() { return this.f27213d; } /* renamed from: f */ public void mo38471f(short s) { this.f27219j = s; } /* renamed from: g */ public short mo38472g() { return this.f27211b; } /* renamed from: g */ public void mo38473g(short s) { this.f27215f = s; } /* renamed from: h */ public int mo38474h() { return this.f27225p; } /* renamed from: h */ public void mo38475h(short s) { this.f27228s = s; } /* renamed from: i */ public short mo38476i() { return this.f27212c; } /* renamed from: i */ public void mo38477i(short s) { this.f27229t = s; } /* renamed from: j */ public short mo38478j() { return this.f27219j; } /* renamed from: j */ public void mo38479j(short s) { this.f27226q = s; } /* renamed from: k */ public short mo38480k() { return this.f27215f; } /* renamed from: k */ public void mo38481k(short s) { this.f27216g = s; } /* renamed from: l */ public short mo38482l() { return this.f27228s; } /* renamed from: l */ public void mo38483l(short s) { this.f27227r = s; } /* renamed from: m */ public short mo38484m() { return this.f27229t; } /* renamed from: n */ public int mo38485n() { return this.f27223n; } /* renamed from: o */ public short mo38486o() { return this.f27226q; } /* renamed from: p */ public int mo38487p() { return this.f27222m; } /* renamed from: q */ public int mo38488q() { return this.f27224o; } /* renamed from: r */ public long mo38489r() { return this.f27210a; } /* renamed from: s */ public short mo38490s() { return this.f27216g; } /* renamed from: t */ public short mo38491t() { return this.f27227r; } }
[ "593746220@qq.com" ]
593746220@qq.com
9957a88e016e8da957af04cd0fbe1cea1bbf3476
5f63a60fd029b8a74d2b1b4bf6992f5e4c7b429b
/com/planet_ink/coffee_mud/Abilities/Spells/Spell_PassDoor.java
7616feff90d9a3dde0271cd376d0b020d4fdd9d0
[ "Apache-2.0" ]
permissive
bozimmerman/CoffeeMud
5da8b5b98c25b70554ec9a2a8c0ef97f177dc041
647864922e07572b1f6c863de8f936982f553288
refs/heads/master
2023-09-04T09:17:12.656291
2023-09-02T00:30:19
2023-09-02T00:30:19
5,267,832
179
122
Apache-2.0
2023-04-30T11:09:14
2012-08-02T03:22:12
Java
UTF-8
Java
false
false
6,841
java
package com.planet_ink.coffee_mud.Abilities.Spells; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2001-2023 Bo Zimmerman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ public class Spell_PassDoor extends Spell { @Override public String ID() { return "Spell_PassDoor"; } private final static String localizedName = CMLib.lang().L("Pass Door"); @Override public String name() { return localizedName; } private final static String localizedStaticDisplay = CMLib.lang().L("(Pass Door)"); @Override public String displayText() { return localizedStaticDisplay; } @Override protected int canTargetCode() { return 0; } @Override protected int overrideMana() { return Ability.COST_ALL; } @Override public int classificationCode() { return Ability.ACODE_SPELL | Ability.DOMAIN_CONJURATION; } @Override public long flags() { return Ability.FLAG_TRANSPORTING; } @Override public int abstractQuality() { return Ability.QUALITY_INDIFFERENT; } @Override public void affectPhyStats(final Physical affected, final PhyStats affectedStats) { super.affectPhyStats(affected,affectedStats); affectedStats.setDisposition(affectedStats.disposition()|PhyStats.IS_INVISIBLE); affectedStats.setHeight(-1); } @Override public void unInvoke() { // undo the affects of this spell if(!(affected instanceof MOB)) return; final MOB mob=(MOB)affected; if(canBeUninvoked()) { if((mob.location()!=null)&&(!mob.amDead())) mob.location().show(mob,null,CMMsg.MSG_OK_VISUAL,L("<S-NAME> <S-IS-ARE> no longer translucent.")); } super.unInvoke(); } protected int highestLevelHere(final MOB mob, final Room R, int highestLevel) { for(final Enumeration<MOB> m=R.inhabitants();m.hasMoreElements();) { final MOB M=m.nextElement(); if((M!=null) && M.isMonster() &&(M.amFollowing()==null) &&(M.phyStats().level()>highestLevel)) highestLevel=M.phyStats().level(); } for(final Enumeration<Item> i=R.items();i.hasMoreElements();) { final Item I=i.nextElement(); if((I!=null) &&(I.phyStats().level()>highestLevel)) highestLevel = I.phyStats().level(); } final LandTitle T=CMLib.law().getLandTitle(R); if((T!=null) &&(!CMLib.law().doesHavePriviledgesHere(mob, R))) { final MOB M = CMLib.law().getPropertyOwner(T); if((M!=null) &&(M.phyStats().level()>highestLevel)) highestLevel = M.phyStats().level(); } return highestLevel; } @Override public boolean invoke(final MOB mob, final List<String> commands, final Physical givenTarget, final boolean auto, final int asLevel) { if((auto||mob.isMonster())&&((commands.size()<1)||((commands.get(0)).equals(mob.name())))) { commands.clear(); int theDir=-1; for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--) { final Exit E=mob.location().getExitInDir(d); if((E!=null) &&(!E.isOpen())) { theDir=d; break; } } if(theDir>=0) commands.add(CMLib.directions().getDirectionName(theDir)); } final String whatToOpen=CMParms.combine(commands,0); final int dirCode=CMLib.directions().getGoodDirectionCode(whatToOpen); int adjustment = 0; if(!auto) { if(dirCode<0) { mob.tell(L("Pass which direction?!")); return false; } final Room R=mob.location(); final Exit exit=R.getExitInDir(dirCode); final Room room=R.getRoomInDir(dirCode); if((exit==null)||(room==null)||(!CMLib.flags().canBeSeenBy(exit,mob))) { mob.tell(L("You can't see anywhere to pass that way.")); return false; } //Exit opExit=room.getReverseExit(dirCode); if(exit.isOpen()) { mob.tell(L("But it looks free and clear that way!")); return false; } int highestLevel = exit.phyStats().level(); highestLevel = highestLevelHere(mob,R,highestLevel); highestLevel = highestLevelHere(mob,room,highestLevel); adjustment = (mob.phyStats().level() - highestLevel) * 5; if(adjustment > 0) adjustment = 0; } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,adjustment,auto); if((!success) ||(mob.fetchEffect(ID())!=null)) beneficialVisualFizzle(mob,null,L("<S-NAME> walk(s) @x1, but go(es) no further.",CMLib.directions().getDirectionName(dirCode))); else if(auto) { final CMMsg msg=CMClass.getMsg(mob,null,null,verbalCastCode(mob,null,auto),L("^S<S-NAME> shimmer(s) and turn(s) translucent.^?")); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); beneficialAffect(mob,mob,asLevel,5); mob.recoverPhyStats(); } } else { final CMMsg msg=CMClass.getMsg(mob,null,null,verbalCastCode(mob,null,auto),L("^S<S-NAME> shimmer(s) and pass(es) @x1.^?",CMLib.directions().getDirectionName(dirCode))); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); if(mob.fetchEffect(ID())==null) { final Ability A=(Ability)this.copyOf(); A.setSavable(false); try { mob.addEffect(A); mob.recoverPhyStats(); CMLib.tracking().walk(mob,dirCode,false,false); } finally { mob.delEffect(A); } } else CMLib.tracking().walk(mob,dirCode,false,false); mob.recoverPhyStats(); } } return success; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
7778ce16ccf95557845ae6321fcd604e8f52c461
040f53d3ae953774822b02bac9d7b7a1a080a1bb
/Sistema_Reserva_Hotel/src/Datos/DPersona.java
f5a53fa542caa6a9f5041bca3d9f59166cc97e4d
[]
no_license
yadiratello/SistemaReservaHotel
58b765602594cea0627ef55442f8bc14c0e2a6a2
bef855eb1bca5b5a12f173a01ee242dc569626d4
refs/heads/master
2020-03-28T19:13:14.982983
2018-09-16T02:14:23
2018-09-16T02:14:23
148,955,760
0
0
null
null
null
null
UTF-8
Java
false
false
3,256
java
package Datos; public class DPersona { private int idpersona; private String nombre; private String apaterno; private String amaterno; private String tipo_documento; private String num_documento; private String direccion; private String telefono; private String email; public DPersona(){ } public DPersona(int idpersona, String nombre, String apaterno, String amaterno, String tipo_documento, String num_documento, String direccion, String telefono, String email) { this.idpersona = idpersona; this.nombre = nombre; this.apaterno = apaterno; this.amaterno = amaterno; this.tipo_documento = tipo_documento; this.num_documento = num_documento; this.direccion = direccion; this.telefono = telefono; this.email = email; } /** * @return the idpersona */ public int getIdpersona() { return idpersona; } /** * @param idpersona the idpersona to set */ public void setIdpersona(int idpersona) { this.idpersona = idpersona; } /** * @return the nombre */ public String getNombre() { return nombre; } /** * @param nombre the nombre to set */ public void setNombre(String nombre) { this.nombre = nombre; } /** * @return the apaterno */ public String getApaterno() { return apaterno; } /** * @param apaterno the apaterno to set */ public void setApaterno(String apaterno) { this.apaterno = apaterno; } /** * @return the amaterno */ public String getAmaterno() { return amaterno; } /** * @param amaterno the amaterno to set */ public void setAmaterno(String amaterno) { this.amaterno = amaterno; } /** * @return the tipo_documento */ public String getTipo_documento() { return tipo_documento; } /** * @param tipo_documento the tipo_documento to set */ public void setTipo_documento(String tipo_documento) { this.tipo_documento = tipo_documento; } /** * @return the num_documento */ public String getNum_documento() { return num_documento; } /** * @param num_documento the num_documento to set */ public void setNum_documento(String num_documento) { this.num_documento = num_documento; } /** * @return the direccion */ public String getDireccion() { return direccion; } /** * @param direccion the direccion to set */ public void setDireccion(String direccion) { this.direccion = direccion; } /** * @return the telefono */ public String getTelefono() { return telefono; } /** * @param telefono the telefono to set */ public void setTelefono(String telefono) { this.telefono = telefono; } /** * @return the email */ public String getEmail() { return email; } /** * @param email the email to set */ public void setEmail(String email) { this.email = email; } }
[ "yadira.tello.cainicela@gmail.com" ]
yadira.tello.cainicela@gmail.com
59fcadd8e5e5a5adb7ebf8ffc2656cc0356af86c
f99447770664af9c82c0e67f05bbaf2c0b09f333
/day12/Banking.java
2dbb2450d9c92a5b892242ca7e12563377d76b76
[]
no_license
sw-Jack/--myJava
cb775fb67185954a82e9b7a95ffd01aee3d1cde2
86b75dc7526fb65e06cd2c8bb99d50d81c79bc53
refs/heads/master
2023-02-22T07:18:36.422063
2021-01-22T13:53:20
2021-01-22T13:53:20
323,334,197
1
0
null
null
null
null
UHC
Java
false
false
3,116
java
import java.io.*; public class Banking{//Banking.java public static void main(String[] args) throws IOException{ NewAccount na = new NewAccount("홍길동", "1111"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String strWork; int cnt = 0; do { System.out.print("비밀번호 입력 : "); strWork = br.readLine(); if(!na.passCheck(strWork)) { cnt++; System.err.println("비밀번호 오류"); System.out.println(); } if(cnt >= 3) { System.out.println("비밀번호 입력 3회 오류!\n시스템을 종료합니다..."); System.exit(0); } } while(!na.passCheck(strWork)); do{ System.out.println("\n \n 작업내용을 선택하세요"); System.out.println("========================="); System.out.println("입 금 =======> 1"); System.out.println("출 금 =======> 2"); System.out.println("잔 고 확 인 =======> 3"); System.out.println("비밀번호변경 =======> 4"); System.out.println("종 료 =======> 0"); System.out.println("========================="); System.out.print("작업내용을 선택하세요 : "); strWork = br.readLine(); int switchInt = 0; if(!strWork.equals("")) switchInt = Integer.parseInt(strWork); else{ System.out.println("작업내용을 입력하지 않았습니다."); continue; } switch(switchInt){ case 0: break; case 1: System.out.println("\n ================="); System.out.print("금액을 입력하세요 : "); String strdepositIn = br.readLine(); long depositLong = Long.parseLong(strdepositIn); na.deposit(depositLong); break; case 2: System.out.println("\n ================="); System.out.print("금액을 입력하세요 : "); String strwithdrawIn = br.readLine(); long withdrawLong = Long.parseLong(strwithdrawIn); na.withdraw(withdrawLong); break; case 3: System.out.println(na.getName() + "님의 잔고는 " + na.getBalance() + " 원이고 비밀번호는 " + na.getPass() + "입니다."); break; case 4: System.out.println("\n ================="); System.out.print("변경할 비밀번호를 입력하세요 : "); String strPass = br.readLine(); na.setPass(strPass); System.out.println("성공적으로 비밀번호를 변경하였습니다."); break; default: System.out.println("0 ~ 4 사이 숫자 입력\n"); } }while(!strWork.equals("0")); } } /* String a = "test"; String b = "test"; String c = new String("test"); String d = new String("test"); a == b : true c == d : false 문자열 비교시 equals()메서드 사용 a.equals(b); true c.equals(d); true */
[ "jacksuwon@gmail.com" ]
jacksuwon@gmail.com
f98cfb1ca2659ed9be9d338ffc6c60c877eba46c
d21f06d57ff2de32f1bee9108951debf79abc3a8
/java/One.java
a95548097f5caa8d1652f2ff9a7cb78b91bb1426
[]
no_license
AkshayDube/coding
d638dbb9b80a358c51320213ba700d8ca52da88b
fdc8078b018702b0c779d4cf467e6da59e19bd58
refs/heads/master
2023-05-20T13:38:20.356251
2021-06-10T20:08:17
2021-06-10T20:08:17
375,781,769
0
0
null
null
null
null
UTF-8
Java
false
false
932
java
import java.util.Scanner; public class One{ public static void main(String[] args){ Scanner sc =new Scanner(System.in); System.out.println("Enter the no. of Rows"); int rows = sc.nextInt(); System.out.println("\nEnter the no. of Columns"); int cols = sc.nextInt(); sc.close(); //For Normal Rectangle for(int i=1;i<=rows;i++){ for(int j=1;j<=cols;j++){ System.out.print("* "); } System.out.println(); } //For Hollow Rectangle System.out.println("==============================================\n"); for(int i=1;i<=rows;i++){ for(int j=1;j<=cols;j++){ if(i==1||i==rows||j==1||j==cols) System.out.print("* "); else System.out.print(" "); } System.out.println(); } } }
[ "dubeyakshay09@gmail.com" ]
dubeyakshay09@gmail.com
64b096ab2c4dc222732fc778fa4fdaada3612b71
8f83845385dc20a1b052bdbadf3e6b5b8d146182
/javatest/src/myself/WhileEx.java
997cee09b8f2d1f3bcc1f0a8aa3317fd6c61bec4
[]
no_license
JaeHyeonKim9604/javaworks
0e99d642c4062890affae5edf3ef27505d031be9
c50a766b3f379df63241129a3a7e9d810070792c
refs/heads/master
2023-08-07T01:42:57.334773
2021-09-26T05:56:19
2021-09-26T05:56:19
400,675,602
0
0
null
null
null
null
UTF-8
Java
false
false
1,176
java
package myself; import java.util.Scanner; public class WhileEx { public static void main(String[] args) { Scanner sc = new Scanner(System.in); boolean run = true; int num; int mon = 0; int mm = 0; while(run) { System.out.println("============================="); System.out.println("1.예금 | 2.출금 | 3.잔고 | 4.종료"); System.out.println("============================="); System.out.print("선택>"); num = sc.nextInt(); switch(num) { case 1: System.out.print("예금액>"); mon += sc.nextInt(); System.out.println("입금되었습니다."); break; case 2: while(true) { System.out.println(2); mm = sc.nextInt(); if ((mon - mm) >= 0) { mon -= mm; System.out.println("출금처리되었습니다."); break; } else { System.out.println("잔액이 부족합니다. 다시 입력해주세요."); } } break; case 3: System.out.println("잔고>" + mon); break; case 4: run = false; break; default: System.out.println("잘못된 키를 입력하셨습니다. 다시 입력해주세요."); } } sc.close(); } }
[ "gpejvkdlf17@gmail.com" ]
gpejvkdlf17@gmail.com
ec5f2d7053782ed336544ae5938b1b92a98c2391
414097095cc77fcb17736b8992c17633b16d2343
/app/src/main/java/com/poolapps/simplecrud/fragments/DetailsFragment.java
cb8ce64251aac7bd067181a3f29707e741cc45cb
[]
no_license
ThedSantana/SimpleAndroidCRUD
040939a31a69a977f18bd1439df8e562add3f691
98ca3a807b507a0d1f5af294bc17442959856b69
refs/heads/master
2021-06-19T08:49:38.970782
2017-07-10T09:50:53
2017-07-10T09:50:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,077
java
package com.poolapps.simplecrud.fragments; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.DialogFragment; import android.support.v4.app.Fragment; import android.support.v4.app.LoaderManager; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.TextView; import com.poolapps.simplecrud.R; import com.poolapps.simplecrud.activities.DetailsActivity; import com.poolapps.simplecrud.database.PersonContract; import com.poolapps.simplecrud.dialog.ConfirmDeletionDialog; import com.poolapps.simplecrud.listeners.DeletionListener; import static android.app.Activity.RESULT_OK; public class DetailsFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor>, DeletionListener { private static final int LOADER_DETAIL_PERSON_ID = 0; private TextView mFirstNameView; private TextView mLastNameView; private String oldFirstName; private String oldLastName; private Uri mUri; private ContentValues values = new ContentValues(); @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setHasOptionsMenu(true); ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.details_fragment, container, false); mFirstNameView = (TextView) view.findViewById(R.id.tvFirstName); mLastNameView = (TextView) view.findViewById(R.id.tvLastName); oldFirstName = ""; oldLastName = ""; Button btnRegister = (Button) view.findViewById(R.id.btn_register); btnRegister.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { registerPerson(); } }); return view; } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); getActivity().getSupportLoaderManager().initLoader(LOADER_DETAIL_PERSON_ID, null, this); Bundle extras = getActivity().getIntent().getExtras(); if (extras != null ) { mUri = extras.getParcelable(DetailsActivity.EXTRA_PERSON_URI); } else { mUri = null; } } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { if (mUri != null) { inflater.inflate(R.menu.detail_menu, menu); } super.onCreateOptionsMenu(menu, inflater); } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); switch (id){ case R.id.action_remove: showDeletionDialog(); break; case android.R.id.home: getActivity().finish(); break; } return true; } private void deletePerson(){ getContext().getContentResolver().delete(mUri, null, null); getActivity().getIntent().putExtra(MainFragment.ACTION_KEY, MainFragment.PERSON_DELETED); getActivity().setResult(RESULT_OK, getActivity().getIntent()); getActivity().finish(); } private void registerPerson() { mFirstNameView.setError(null); mLastNameView.setError(null); String firstName = mFirstNameView.getText().toString(); String lastName = mLastNameView.getText().toString(); if (oldFirstName.equals(firstName) && oldLastName.equals(lastName)){ getActivity().finish(); return; } View emptyView = checkForEmptyView(firstName, lastName); if(emptyView != null){ emptyView.requestFocus(); } else { values.clear(); values.put(PersonContract.Person.COLUMN_FIRST_NAME, firstName); values.put(PersonContract.Person.COLUMN_LAST_NAME, lastName); if(mUri != null){ getActivity().getIntent().putExtra(MainFragment.ACTION_KEY, MainFragment.PERSON_UPDATED); getContext().getContentResolver().update(mUri, values, null, null); }else { getActivity().getIntent().putExtra(MainFragment.ACTION_KEY, MainFragment.PERSON_INSERTED); getContext().getContentResolver().insert(PersonContract.Person.CONTENT_URI, values); } getActivity().setResult(RESULT_OK, getActivity().getIntent()); getActivity().finish(); } } private View checkForEmptyView(String firstName, String lastName){ if(TextUtils.isEmpty(firstName)){ mFirstNameView.setError(getString(R.string.empty_first_name)); return mFirstNameView; } if(TextUtils.isEmpty(lastName)){ mLastNameView.setError(getString(R.string.empty_last_name)); return mLastNameView; } return null; } //*** Cursor Loader implementation ***// @Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { if (mUri == null){ return null; } String[] projection = {PersonContract.Person.COLUMN_FIRST_NAME, PersonContract.Person.COLUMN_LAST_NAME}; return new CursorLoader(getContext(), mUri, projection, null, null, null); } @Override public void onLoadFinished(Loader<Cursor> loader, Cursor c) { if (c != null && c.moveToFirst()){ oldFirstName = c.getString(c.getColumnIndex(PersonContract.Person.COLUMN_FIRST_NAME)); oldLastName = c.getString(c.getColumnIndex(PersonContract.Person.COLUMN_LAST_NAME)); mFirstNameView.setText(oldFirstName); mLastNameView.setText(oldLastName); } } @Override public void onLoaderReset(Loader<Cursor> loader) { } //*** DeletionListener implementation ***// public void showDeletionDialog() { DialogFragment dialog = new ConfirmDeletionDialog(); dialog.show(getFragmentManager(), dialog.getClass().getSimpleName()); } @Override public void onDialogPositiveClick() { deletePerson(); } @Override public void onDialogNegativeClick() { Log.d(DetailsFragment.class.getSimpleName(), " Deletion canceled!"); } }
[ "Paulo Henrique Inocêncio" ]
Paulo Henrique Inocêncio
a071e694a3af9a9f7a97ad1f5b2512285cef600f
38b6743ee3961af61057c392336a2f1cecd80a69
/app/src/androidTest/java/com/example/frutillap/ExampleInstrumentedTest.java
0ef9044c0ea58a23318bbcceb6997a0684b87ce8
[]
no_license
sebarocca/Frutillap
9a48b49d57093a3de3101a919b9ea39b21e4d45a
f6bf081c2e3839d43a30d9bc4df3d55900c5f3b9
refs/heads/master
2020-06-28T16:10:43.421108
2019-08-02T18:08:42
2019-08-02T18:08:42
200,277,686
0
0
null
null
null
null
UTF-8
Java
false
false
726
java
package com.example.frutillap; 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() { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.frutillap", appContext.getPackageName()); } }
[ "sebarocca@github.com" ]
sebarocca@github.com
2be89cfec8dadab8f004d9e60b29cbb1c310b34f
609f1638b9deebbb6000ed3634aa0e54767051c4
/src/main/java/com/design/patterns/chapter12/dynamicproxy/model/MyInvocationHandler.java
d354befb160aaf6cb668b12a3786b1184740e1fd
[]
no_license
soochowcjf/sgc-learn
93ba6dd6fef46831f2e8562289124a30f0778882
b99c801498504d2bd0e1e068f0e46905c32e785f
refs/heads/master
2021-08-18T13:42:52.870267
2021-02-08T05:24:21
2021-02-08T05:24:21
243,742,116
0
0
null
2021-02-08T01:21:07
2020-02-28T11:00:32
Java
UTF-8
Java
false
false
599
java
package com.design.patterns.chapter12.dynamicproxy.model; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; /** * @author cjf on 2019/12/4 11:02 */ public class MyInvocationHandler implements InvocationHandler { /** * 被代理类 */ private Subject target; public MyInvocationHandler(Subject subject) { this.target = subject; } @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { //被代理类执行的返回值 return method.invoke(this.target, args); } }
[ "OuosxAygJw" ]
OuosxAygJw
c9bcd991f0fa5e01cc4d6f39c43c4a05abd3d880
9cf92cd17f7979d7a80f71bffee49564272280fe
/java-aiplatform/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/ScheduleProto.java
8e4f54640cf782c37ab444eaad96ae371a4f99bd
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
sumodgeorge/google-cloud-java
32aea14097af929420b25abf71443aa22286e88b
389ac8dca201302a2ceb2299b32eb69fd0d79077
refs/heads/master
2023-08-31T10:56:49.958206
2023-08-17T21:26:13
2023-08-17T21:26:13
162,004,285
0
0
Apache-2.0
2023-06-27T15:15:51
2018-12-16T13:33:36
Java
UTF-8
Java
false
false
7,703
java
/* * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/aiplatform/v1beta1/schedule.proto package com.google.cloud.aiplatform.v1beta1; public final class ScheduleProto { private ScheduleProto() {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_aiplatform_v1beta1_Schedule_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_aiplatform_v1beta1_Schedule_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_aiplatform_v1beta1_Schedule_RunResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_aiplatform_v1beta1_Schedule_RunResponse_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; } private static com.google.protobuf.Descriptors.FileDescriptor descriptor; static { java.lang.String[] descriptorData = { "\n.google/cloud/aiplatform/v1beta1/schedu" + "le.proto\022\037google.cloud.aiplatform.v1beta" + "1\032\037google/api/field_behavior.proto\032\031goog" + "le/api/resource.proto\0326google/cloud/aipl" + "atform/v1beta1/pipeline_service.proto\032\037g" + "oogle/protobuf/timestamp.proto\"\244\t\n\010Sched" + "ule\022\016\n\004cron\030\n \001(\tH\000\022`\n\033create_pipeline_j" + "ob_request\030\016 \001(\01329.google.cloud.aiplatfo" + "rm.v1beta1.CreatePipelineJobRequestH\001\022\022\n" + "\004name\030\001 \001(\tB\004\342A\001\003\022\032\n\014display_name\030\002 \001(\tB" + "\004\342A\001\002\0224\n\nstart_time\030\003 \001(\0132\032.google.proto" + "buf.TimestampB\004\342A\001\001\0222\n\010end_time\030\004 \001(\0132\032." + "google.protobuf.TimestampB\004\342A\001\001\022\033\n\rmax_r" + "un_count\030\020 \001(\003B\004\342A\001\001\022\037\n\021started_run_coun" + "t\030\021 \001(\003B\004\342A\001\003\022D\n\005state\030\005 \001(\0162/.google.cl" + "oud.aiplatform.v1beta1.Schedule.StateB\004\342" + "A\001\003\0225\n\013create_time\030\006 \001(\0132\032.google.protob" + "uf.TimestampB\004\342A\001\003\0225\n\013update_time\030\023 \001(\0132" + "\032.google.protobuf.TimestampB\004\342A\001\003\0227\n\rnex" + "t_run_time\030\007 \001(\0132\032.google.protobuf.Times" + "tampB\004\342A\001\003\0229\n\017last_pause_time\030\010 \001(\0132\032.go" + "ogle.protobuf.TimestampB\004\342A\001\003\022:\n\020last_re" + "sume_time\030\t \001(\0132\032.google.protobuf.Timest" + "ampB\004\342A\001\003\022&\n\030max_concurrent_run_count\030\013 " + "\001(\003B\004\342A\001\002\022\034\n\016allow_queueing\030\014 \001(\010B\004\342A\001\001\022" + "\026\n\010catch_up\030\r \001(\010B\004\342A\001\003\022`\n\033last_schedule" + "d_run_response\030\022 \001(\01325.google.cloud.aipl" + "atform.v1beta1.Schedule.RunResponseB\004\342A\001" + "\003\032[\n\013RunResponse\0226\n\022scheduled_run_time\030\001" + " \001(\0132\032.google.protobuf.Timestamp\022\024\n\014run_" + "response\030\002 \001(\t\"E\n\005State\022\025\n\021STATE_UNSPECI" + "FIED\020\000\022\n\n\006ACTIVE\020\001\022\n\n\006PAUSED\020\002\022\r\n\tCOMPLE" + "TED\020\003:e\352Ab\n\"aiplatform.googleapis.com/Sc" + "hedule\022<projects/{project}/locations/{lo" + "cation}/schedules/{schedule}B\024\n\022time_spe" + "cificationB\t\n\007requestB\344\001\n#com.google.clo" + "ud.aiplatform.v1beta1B\rScheduleProtoP\001ZC" + "cloud.google.com/go/aiplatform/apiv1beta" + "1/aiplatformpb;aiplatformpb\252\002\037Google.Clo" + "ud.AIPlatform.V1Beta1\312\002\037Google\\Cloud\\AIP" + "latform\\V1beta1\352\002\"Google::Cloud::AIPlatf" + "orm::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), com.google.cloud.aiplatform.v1beta1.PipelineServiceProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_google_cloud_aiplatform_v1beta1_Schedule_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_cloud_aiplatform_v1beta1_Schedule_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_Schedule_descriptor, new java.lang.String[] { "Cron", "CreatePipelineJobRequest", "Name", "DisplayName", "StartTime", "EndTime", "MaxRunCount", "StartedRunCount", "State", "CreateTime", "UpdateTime", "NextRunTime", "LastPauseTime", "LastResumeTime", "MaxConcurrentRunCount", "AllowQueueing", "CatchUp", "LastScheduledRunResponse", "TimeSpecification", "Request", }); internal_static_google_cloud_aiplatform_v1beta1_Schedule_RunResponse_descriptor = internal_static_google_cloud_aiplatform_v1beta1_Schedule_descriptor.getNestedTypes().get(0); internal_static_google_cloud_aiplatform_v1beta1_Schedule_RunResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_Schedule_RunResponse_descriptor, new java.lang.String[] { "ScheduledRunTime", "RunResponse", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.ResourceProto.resource); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.cloud.aiplatform.v1beta1.PipelineServiceProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) }
[ "noreply@github.com" ]
sumodgeorge.noreply@github.com
1ee275f7daef33032d6e7fd6c091b38b04867390
b6255f7ca81451ac9377ab9fc0cffa3235250929
/test/src/test11/Student.java
5ec97c3292c1409c53105c624dfe7a0a44f6f930
[]
no_license
seunng/java
07e3f1fe2531dd93d52efdbc1ad6e5c6606c6d24
3c4556247733a1f414985a4d849ead9397826939
refs/heads/master
2020-03-22T17:31:16.558723
2018-07-10T08:27:00
2018-07-10T08:27:00
139,947,630
0
0
null
null
null
null
UTF-8
Java
false
false
428
java
package test11; public class Student { private String clazz; private String name; private int grade; public void setterC(String clazz) { this.clazz = clazz; } public void setterN(String name) { this.name = name; } public void setterG(int grade) { this.grade = grade; } public void println() { System.out.println(clazz); System.out.println(name); System.out.println(grade); } }
[ "koitt03-A@koitt03-A-PC" ]
koitt03-A@koitt03-A-PC
3183487eb255ec21c4f56525478cb883bc84726b
8e3cb3391da5701c26a2fc32891ee134e14f7470
/Gameplay.java
2b55a8d6d84353380339cd301cee85aa7cb269ae
[]
no_license
jontystanley/Breakout
aa11ea51c876e117267e8b95675e3b9bb2005f5b
a3fb266d0ed7d3bb97419afe0e3fc98b41d5a403
refs/heads/master
2023-01-09T20:24:27.328428
2020-11-09T19:55:24
2020-11-09T19:55:24
267,460,388
0
0
null
null
null
null
UTF-8
Java
false
false
4,047
java
package brickBreaker; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.Timer; import javax.swing.JPanel; public class Gameplay extends JPanel implements KeyListener,ActionListener { private boolean play=false; private int score=0; private int totalBricks=40; private Timer timer; private int delay=8; private int playerX=310; private int ballposX=120; private int ballposY=350; private int ballXdir=-2; private int ballYdir=-4; private int max=0; private MapGenerator map; public Gameplay() { map=new MapGenerator(5,8); addKeyListener(this); setFocusable(true); setFocusTraversalKeysEnabled(true); timer = new Timer(delay,this); timer.start(); } public void paint(Graphics g) { //background g.setColor(Color.black); g.fillRect(1,1,692,592); //map map.draw((Graphics2D)g); //borders g.setColor(Color.blue); g.fillRect(0,0,3,592); g.fillRect(0,0,692,3); g.fillRect(691,0,10,592); //scores g.setColor(Color.white); g.setFont(new Font("serif",Font.BOLD,25)); g.drawString(""+score, 590, 30); //board g.setColor(Color.green); g.fillRect(playerX,550,100,8); //ball g.setColor(Color.yellow); g.fillOval(ballposX,ballposY,20,20); if(ballposY>570||score==400) { play=false; ballXdir=0; ballYdir=0; g.setColor(Color.RED); g.setFont(new Font("serif",Font.BOLD,30)); g.drawString("Game Over!! , Score ="+score, 190, 300); if(score>max) max=score; g.setColor(Color.GRAY); g.drawString("HIGHEST SCORE: "+max,205,400); g.setColor(Color.BLUE); g.setFont(new Font("serif",Font.BOLD,20)); g.drawString("Press Enter to Restart", 235, 350); } g.dispose(); } @Override public void actionPerformed(ActionEvent e) { timer.start(); if(play) { if(new Rectangle(ballposX,ballposY,20,20).intersects(new Rectangle(playerX,550,100,8))) { ballYdir=-ballYdir; } for(int i=0;i<map.map.length;i++) { for(int j=0;j<map.map[0].length;j++) { if(map.map[i][j]>0) { int brickX=j* map.brickWidth + 80; int brickY=i* map.brickHeight+ 50; int brickWidth=map.brickWidth; int brickHeight=map.brickHeight; Rectangle rect=new Rectangle(brickX,brickY,brickWidth,brickHeight); Rectangle ballRect=new Rectangle(ballposX,ballposY,20,20); Rectangle brickRect=rect; if(ballRect.intersects(brickRect)) { map.setBrickValue(0, i, j); totalBricks--; score+=10; if(ballposX + 19 <=brickRect.x|| ballposX + 1 >=brickRect.x+brickRect.width) { ballXdir=-ballXdir; }else { ballYdir=-ballYdir; } } } } } ballposX+=ballXdir; ballposY+=ballYdir; //bounce left surface if(ballposX<0) { ballXdir=-ballXdir; } //bounce top surface if(ballposY<0) { ballYdir=-ballYdir; } //bounce right surface if(ballposX>670) { ballXdir=-ballXdir; } } repaint(); } @Override public void keyReleased(KeyEvent e) {} @Override public void keyTyped(KeyEvent e) {} @Override public void keyPressed(KeyEvent e) { if(e.getKeyCode() == KeyEvent.VK_RIGHT){ if(playerX>=600) { playerX=600; }else { moveRight(); } } if(e.getKeyCode() == KeyEvent.VK_LEFT){ if(playerX<10) { playerX=10; }else { moveLeft(); } } if(e.getKeyCode()== KeyEvent.VK_ENTER) { if(!play) { play=true; ballposX=120; ballposY=350; ballXdir=-2; ballYdir=-4; playerX=310; score=0; totalBricks=21; map=new MapGenerator(5,8); repaint(); } } } public void moveRight() { play=true; playerX+=20; } public void moveLeft() { play=true; playerX-=20; } }
[ "neonhitch64@gmail.com" ]
neonhitch64@gmail.com
45f6cdcfdd48a0e3870517a8a31e6268af415875
8212b2d5bd0d86e7a8d83556888d1a9dfd1d7651
/to-do-list/src/main/java/com/todolist/controller/SignUpController.java
bf3539ee4e3922592580524ad23cf3c9ddbdaeb6
[]
no_license
sangjiexun/java-spring
dce26a2fcee0f957c4234b32de676a4ae2c739ed
16ca676bd5ec9d3ae7d957bf4ebd32269fdae66c
refs/heads/master
2020-12-18T23:24:01.508876
2019-05-13T17:11:14
2019-05-13T17:11:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,183
java
package com.todolist.controller; import java.io.Serializable; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; import org.springframework.validation.ObjectError; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import com.todolist.domain.SignUpForm; import com.todolist.domain.User; import com.todolist.service.UserService; @Controller @RequestMapping("signup") public class SignUpController { @Autowired UserService userService; @GetMapping public String input(User user, Model model) { return "signUp"; } @PostMapping public String conform(@Validated @ModelAttribute User user, BindingResult result, Model model) { if(result.hasErrors()) { model.addAttribute("validationError", "不正な値が入力されました"); return input(user, model); } if(!user.getPassword().equals(user.getConfpassword())) { model.addAttribute("validationError", "パスワードが一致しません"); return input(user, model); } return "signUpConfirm"; } @PostMapping("register") public String save(@Validated User user, BindingResult result, Model model) { //System.out.println("form.getNickname : " + form.getNickname()); //System.out.println("form.getPassword * " + form.getPassword()); //SignUpFormの全てのフィールドに値を入れてないとエラーが出る。 if(result.hasErrors()) { System.out.println("Error Count : " + result.getErrorCount()); for(ObjectError e : result.getAllErrors()) System.out.println("Error : " + e); model.addAttribute("validationError", "登録できませんでした。"); return "signup"; } userService.save(User.of(user.getName(), user.getPassword(), user.getEmail())); return "loginForm"; } }
[ "kmtary13@gmail.com" ]
kmtary13@gmail.com
59be986cf988cfa4ffdc4f6f1acfa4d7d04c7238
1956fd7af8efd4dbe9d4b00564229d6bfb61af97
/src/main/java/com/nagappans/dsalgolab/App.java
6d24c1db947177508d8c9301f95393b2af84ffdb
[ "Apache-2.0" ]
permissive
nagappan080810/dsjavaworkouts
6a1606d50ae082d78f9632492004a588329ff0ae
4fb810e9995a3ce3e1720a0d3a498bff1fe52f8c
refs/heads/master
2021-07-06T19:04:23.009855
2020-02-15T14:07:47
2020-02-15T14:07:47
193,869,044
0
1
Apache-2.0
2020-10-13T14:10:29
2019-06-26T09:03:26
Java
UTF-8
Java
false
false
427
java
package com.nagappans.dsalgolab; import org.apache.commons.codec.digest.DigestUtils; /** * Hello world! * */ public class App { public static void main( String[] args ) { if (args.length < 1) { System.err.println("Please provide an input"); System.exit(0); } System.out.println(DigestUtils.sha256Hex(args[0])); System.out.println( "Hello World!" ); } }
[ "nagappan08@gmail.com" ]
nagappan08@gmail.com
f0f1049742a1e936913f4b7f8f7e89c464c603d6
9255ca07e5a07c1799d9d6b0155c18e978a3ccf8
/audit/src/main/java/org/xipki/audit/Audits.java
93c8a43e6307cf58b57ced245482a18d675d7fba
[ "Apache-2.0" ]
permissive
ygy203/xipki
18281a024c24ed6bf55151f1de28f8a7ec608243
8ab9e203bb2f41f1dfc7327a67e3e20e1b0f0782
refs/heads/master
2022-04-28T19:12:09.651753
2022-03-29T02:53:38
2022-03-29T02:53:38
230,175,699
0
0
Apache-2.0
2022-01-17T08:59:57
2019-12-26T01:46:05
null
UTF-8
Java
false
false
3,893
java
/* * * Copyright (c) 2013 - 2020 Lijun Liao * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.xipki.audit; import org.xipki.audit.services.EmbedAuditService; import org.xipki.audit.services.FileMacAuditService; import org.xipki.audit.services.Slf4jAuditService; import org.xipki.password.PasswordResolver; import java.lang.reflect.InvocationTargetException; /** * Helper class to configure and initialize the Audit. * * @author Lijun Liao */ public class Audits { public static class AuditConf { /** * valid values are: * embed: use the embedded slf4j logging * java:&lt;name of class that implements org.xipki.audit.AuditService&gt; */ private String type; private String conf; public static AuditConf DEFAULT = new AuditConf(); public String getType() { return type == null || type.isEmpty() ? "embed" : type; } public void setType(String type) { this.type = type; } public String getConf() { return conf; } public void setConf(String conf) { this.conf = conf; } } private static AuditService auditService; private static AuditServiceRuntimeException initializationException; private Audits() { } public static AuditService getAuditService() { if (auditService != null) { return auditService; } if (initializationException != null) { throw initializationException; } else { throw new IllegalStateException("Please call Audits.init() first."); } } // method getAuditService public static void init(String auditType, String auditConf, PasswordResolver passwordResolver) { try { AuditService service; if ("embed".equalsIgnoreCase(auditType)) { service = new EmbedAuditService(); } else if ("slf4j".equals(auditType)) { service = new Slf4jAuditService(); } else if ("file-mac".equals(auditType)) { service = new FileMacAuditService(); } else { String className; if (auditType.startsWith("java:")) { className = auditType.substring("java:".length()); } else if ("database-mac".equals(auditType)) { className = "org.xipki.audit.extra.DatabaseMacAuditService"; } else { throw new AuditServiceRuntimeException("invalid Audit.Type '" + auditType + "'. Valid values are 'embed' or java:<name of class that implements " + AuditService.class.getName() + ">"); } try { Class<?> clazz = Class.forName(className); service = (AuditService) clazz.getDeclaredConstructor().newInstance(); } catch (ClassCastException | ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException ex) { throw new AuditServiceRuntimeException( "error caught while initializing AuditService " + auditType + ": " + ex.getClass().getName() + ": " + ex.getMessage(), ex); } } service.init(auditConf, passwordResolver); auditService = service; } catch (AuditServiceRuntimeException ex) { initializationException = ex; } catch (Exception ex) { initializationException = new AuditServiceRuntimeException(ex.getMessage(), ex); } } // method init }
[ "lijun.liao@gmail.com" ]
lijun.liao@gmail.com
bcb8ab817484677495ab6c26c8abfb5ec68b4149
bc21c7e30c7b55afd0a83561aef69c60d24a2e81
/src/main/java/np2016/GraphSearch/SequentialLTSBuilder.java
31136c4a81f60696266b753057fc4173bcbd3fe7
[]
no_license
Gelin007/np_project
26c0b22eef75f771c1c3dfb963cf0d2e8f97f736
104af1d85bf57fa8e8c92ee1d170fb9f74ef55a0
refs/heads/master
2020-04-06T07:07:18.946510
2016-08-29T17:34:53
2016-08-29T17:34:53
62,944,255
0
0
null
null
null
null
UTF-8
Java
false
false
862
java
package np2016.GraphSearch; import np2016.CCSSemantics.LTS; import np2016.CCSSemantics.State; import np2016.CCSSemantics.Transition; import np2016.Graph.Graph; /** * Sequential implementation of the {@link LTSBuilder}. * * @see LTSBuilder */ public final class SequentialLTSBuilder extends LTSBuilder { @Override public void startVertex(final Graph<State, Transition> graph, final State state) { this.lts = new LTS(state); } @Override public void nonTreeEdge(final Graph<State, Transition> graph, final Transition transition) { this.lts.addTransition(transition); } @Override public void treeEdge(final Graph<State, Transition> graph, final Transition transition) { this.lts.addState(transition.getTarget()); this.lts.addTransition(transition); } }
[ "felix@fefrei.de" ]
felix@fefrei.de
2b2423b6f6163669670ab416b89bfeb25566f15f
8c8ebcb52e67bc7978b69c9bb510e5bc7622dd9c
/PartyMat/src/main/java/com/aplsoftware/partymat/db/model/image/Imagen.java
9dde91437e99c748817bef8bcac6ec725027c98b
[]
no_license
jesusaplsoft/partymat
f12a4ac59ed85cbfc9c9d606155ee89aa58644b8
ba5da583f2c9f9daac60ce74ce9001ed898f1717
refs/heads/master
2020-05-24T14:35:29.444619
2013-12-19T02:14:10
2013-12-19T02:14:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,011
java
package com.aplsoftware.partymat.db.model.image; import com.apl.base.exception.InfrastructureException; import com.apl.base.model.AbstractPersistent; import com.apl.base.tool.MiscBase; import java.io.IOException; import java.util.Arrays; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.MappedSuperclass; import javax.swing.ImageIcon; @MappedSuperclass public abstract class Imagen<I extends Imagen<I>> extends AbstractPersistent<I> { private static final long serialVersionUID = 855052768561469236L; private static final String[] EQUAL_FIELDS = { "parentId" }; @Column(name = "ID", nullable = false) @GeneratedValue(strategy = GenerationType.AUTO, generator = "genImagenId") @Id @javax.persistence.SequenceGenerator(name = "genImagenId", sequenceName = "IMG_GEN_ID") private Long id; @Column(name = "IMAGEN", nullable = false) @Lob private byte[] imagen; @Column(name = "ORIGINAL", nullable = false) @Lob private byte[] original; public Imagen() { super(); } public Imagen(final I img) { super(img); } public Imagen(final ImageIcon imagen) { this.setImagen(imagen); } public Imagen(final ImageIcon imagen, final ImageIcon original) { this.setImagen(imagen); this.setOriginal(original); } public Imagen(final byte[] img) { this.setImagenBinario(img); } public Imagen(final Long id) { super(id); } public byte[] getOriginalBinario() { return this.original; } public void setOriginalBinario(final byte[] original) { this.original = original; } public void guardarCopia() { if (this.imagen == null) { this.original = null; } else { this.original = Arrays.copyOf(this.imagen, this.imagen.length); } } public void restaurar() { if (this.original == null) { this.imagen = null; } else { this.imagen = Arrays.copyOf(this.original, this.original.length); } } // ///////////////////////////// // campos Persistentes // ///////////////////////////// /** * Obtiene el id. * * @return el id */ @Override public Long getId() { return this.id; } /** * Pone el id. * * @param id el nuevo id */ @Override public void setId(final Long id) { this.id = id; } /** * Obtiene el id. * * @return el id */ protected Long setId() { return this.id; } // *************************************************************************** /** * Obtiene el logo del Centro. * * @return imagen */ public ImageIcon getImagen() { if (this.imagen == null) { return null; } else { return new ImageIcon(this.imagen); } } public final void setImagen(final ImageIcon imagen) { final String descripcion; if (imagen == null) { this.imagen = null; } else { descripcion = imagen.getDescription(); /*Si existe descripción entronces la imagen es nueva, si no la * tiene, es la misma imagen que *estaba guardada previamente */ if (descripcion != null) { try { this.imagen = MiscBase.image2Array(imagen.getImage(), descripcion.substring( descripcion.lastIndexOf(".") + 1)); } catch (final IOException e) { this.imagen = null; throw new InfrastructureException(e); } } } } public ImageIcon getOriginal() { if (this.original == null) { return null; } else { return new ImageIcon(this.original); } } public final void setOriginal(final ImageIcon imagen) { if (imagen == null) { this.original = null; } else { imagen.getDescription(); try { this.original = MiscBase.image2Array(imagen.getImage(), ""); } catch (final IOException e) { this.original = null; throw new InfrastructureException(e); } } } public void setImagenBinario(final byte[] imagen) { this.imagen = imagen; } public byte[] getImagenBinario() { return this.imagen; } protected abstract Long getParentId(); @Override protected String[] equalizer() { return Imagen.EQUAL_FIELDS; } @Override public boolean canEqual(final Object other) { return (other instanceof Imagen); } }
[ "jesus.marin.ruiz@gmail.com" ]
jesus.marin.ruiz@gmail.com
9db43d32c33eb4fb379d212e325bec74db578aa5
95e8a8249f30bc6a5f7f94efa4de0d5314329470
/src/test/java/AnyTest.java
198b7aab48b94a17b81fc211e81bb6d491b61990
[]
no_license
xunyuc/xproject
e587a41193a7ef5965e35409de428df1b25820a5
6856420c66bb265bd8a4baf1562dda68fbc3c0ba
refs/heads/master
2021-01-22T10:32:09.994190
2017-09-01T02:44:13
2017-09-01T02:44:13
92,644,782
0
0
null
null
null
null
UTF-8
Java
false
false
1,970
java
import com.xunyuc.xproject.web.entity.UserInfo; import com.xunyuc.xproject.web.proxy.UserProxy; import com.xunyuc.xproject.web.dao.IUserInfoDAO; import com.xunyuc.xproject.web.service.UserService; import com.xunyuc.xproject.web.utils.SpringContextUtil; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisSentinelPool; import java.util.EnumSet; import java.util.HashSet; import java.util.Set; /** * Created by Xunyuc on 2017/6/24. */ @ContextConfiguration(locations = {"classpath:spring.xml"}) @RunWith(SpringJUnit4ClassRunner.class) public class AnyTest { @Test public void test1() { // UserService userService = SpringContextUtil.getBean(UserService.class); // UserInfo user = userService.findUserByName("admin"); // System.out.println(user.getSecretKey()); // Jedis jedis = new Jedis("192.168.80.134", 6380); // jedis.set("test","testtest"); Set<String> set = new HashSet(); set.add("192.168.80.134:26379"); set.add("192.168.80.134:26380"); set.add("192.168.80.134:26381"); JedisSentinelPool jedisSentinelPool = new JedisSentinelPool("mymaster", set); jedisSentinelPool.getResource().set("test","testtest"); } // @Test public void test2() { // UserService userService = SpringContextUtil.getBean(UserService.class); // // EnumSet<UserProxy.Field> fields = EnumSet.of(UserProxy.Field.NAME, UserProxy.Field.SECRET_KEY); // UserProxy userProxy = userService.findUserProxyByName2(fields, "admin"); // System.out.println(userProxy.getSecretKey()); } @Test public void test3() { IUserInfoDAO IUserInfoDAO = SpringContextUtil.getBean(IUserInfoDAO.class); IUserInfoDAO.findUserByName("admin"); } }
[ "xxx@xx.com" ]
xxx@xx.com
228c761cfbc93e9b91d20632e891603d860df01b
4611ba9c852bcc03b330ca00e98884746082e57f
/CommandInterfaces/.svn/pristine/22/228c761cfbc93e9b91d20632e891603d860df01b.svn-base
5b0b639503ba04543eb3d1fdcf4fabb7adbf8b23
[ "Apache-2.0" ]
permissive
sami-sari/cezmi
374ddb4606586282613e0abef04fc70e2550c97d
6042b566fb8598b60faef0dcf8671b819d2e4f0a
refs/heads/master
2021-07-02T12:26:13.707009
2020-12-01T02:45:08
2020-12-01T02:45:08
193,400,687
0
0
Apache-2.0
2020-12-01T02:45:09
2019-06-23T22:18:44
HTML
UTF-8
Java
false
false
329
package com.samisari.graphics.commands; import java.awt.Color; import java.awt.Font; import java.util.List; public interface ICmdWindow extends ICmdRectangle { public Font getTitleFont(); public String getTitleText(); public Color getTitleColor(); public String getWindowListener(); List<ICmdRectangle> getComponents(); }
[ "sari@alumni.bilkent.edu.tr" ]
sari@alumni.bilkent.edu.tr
c8a6bea31a6d9887eefb5f2e0a7580283e53d048
117f20e0531636e91325e08175e82795698a8ce7
/java/labs/common/supcan/annotation/common/fonts/SupFont.java
9b0c7d73acd169fd04647088530df6160fd14f81
[ "Apache-2.0" ]
permissive
crosslab/MISDEV
9400c18c02d3faea424310f50180592d2e65426e
b0d4d9d7324a3a5ffe639530b50aaf62db22bf25
refs/heads/master
2021-01-10T20:22:38.875318
2015-09-10T02:36:53
2015-09-10T02:36:53
40,691,236
3
6
null
null
null
null
UTF-8
Java
false
false
1,205
java
/** * */ package labs.common.supcan.annotation.common.fonts; import java.lang.annotation.ElementType; import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * 硕正Font注解 * @author WangZhen * @version 2013-11-12 */ @Target({ ElementType.ANNOTATION_TYPE }) @Retention(RetentionPolicy.RUNTIME) @Inherited public @interface SupFont { /** * 字体名称 微软雅黑 宋体 */ String faceName() default ""; /** * 字符集 134 */ String charSet() default ""; /** * Height(或size)是字体的尺寸,单位是字体的逻辑单位,通常采用小于0的数字, * 如果大于0,则高度不包含文字的内部行距(internal-leading)。 * 常用的尺寸是-8, -9, -10, -11, -12, -14, -16, -18, -20, -22, -24, -26, -28, -36, -48, -72() ; */ String height() default ""; /** * 字体加粗 weight=400/700 对应 非粗体/粗体; */ String weight() default ""; /** * 字体宽度 */ String width() default ""; /** * 字体斜体 */ String italic() default ""; /** * 字体下划线 */ String underline() default ""; }
[ "crosslab@163.com" ]
crosslab@163.com
9d77be591551712f6e9fab4f490e846f583a69d7
ade43c95a131bc9f33b8f99e8b0053b5bc1393e8
/src/OWON_VDS_v1.0.24/com/owon/uppersoft/vds/core/aspect/control/VoltageProvider.java
2bd41104e9bb4c534bbb8e14a0c33bca175987c9
[]
no_license
AbirFaisal/RealScope
7ba7532986ea1ee11683b4bd96f746e800ea144a
f80ff68a8e9d61d7bec12b464b637decb036a3f0
refs/heads/master
2020-03-30T04:21:38.344659
2018-10-03T17:54:16
2018-10-03T17:54:16
150,738,973
7
0
null
null
null
null
UTF-8
Java
false
false
330
java
package com.owon.uppersoft.vds.core.aspect.control; public interface VoltageProvider { // mV int getVoltage(int probe, int vbIndex); int getVoltageNumber(); String getVoltageLabel(int vbIndex); int getPos0HalfRange(int currentVolt); int[] getVoltages(int probe); public Integer[] getProbeMulties(); }
[ "administrator@Computer.local" ]
administrator@Computer.local
082105a7acf031e760835ef312e8a46deb8ab6fc
a078497b34386d162a4cebdd0fffd03ff056281a
/app/src/main/java/com/e91/express/di/qualifier/AppContext.java
804d101e63c32bc88bf02218bb336535d4b91b94
[]
no_license
ali-geng/91Express
b514bd7ba12366e1538e713a14fc3d75c65e1cbe
79ae05dc1c98beaad7088dda017ac9d3be10dd20
refs/heads/master
2021-06-14T03:32:14.815099
2016-12-22T10:52:14
2016-12-22T10:52:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
247
java
package com.e91.express.di.qualifier; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import javax.inject.Qualifier; /** * */ @Qualifier @Retention(RetentionPolicy.RUNTIME) public @interface AppContext { }
[ "Point" ]
Point
b2bb440feb0326c02ef43d13dad002d2b8732335
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Chart/5/org/jfree/chart/title/TextTitle_getText_253.java
b52967ecabdd5bc8d3b7c22ca447a91bd58e337e
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,088
java
org jfree chart titl chart titl displai text string automat wrap requir text titl texttitl titl return titl text text code code set text settext string string text gettext text
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
7abd7415c9b68b155f4e2963bed1cab15d2b7c23
5964bacfd5a6b8ba25c068a7733bef858359716f
/FactoryDesignPattern/DesignPatternPractieProblm/src/Admin.java
946fa75db2b5fc98ce716f31572a5072b5d05bea
[]
no_license
sftmaruf/design-pattern
c3eefb62ae48ff9522dad7eca4cf9fa239448f98
6d0b3069e1f1d1db01667b416e98043e363c9af2
refs/heads/master
2022-11-24T08:00:48.803957
2020-07-23T08:55:02
2020-07-23T08:55:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
279
java
public class Admin implements ITask { int serial; public void setSerial(int s) { serial = s; } @Override public void checkWorkProcess(Work w) { if(serial == 342) { w.setStatus("In progress"); System.out.println("In progress"); } } }
[ "noreply@github.com" ]
sftmaruf.noreply@github.com
f53366a897c9e5a0c2fe1b72fb4efad46177c9f7
b89655e6e1d341c98c4b46d29a3864622198210a
/src/main/java/coderetreat/take_2/Game.java
e9828c5c15646554826afbec0184d9a800bb0603
[]
no_license
rishikeshdhokare/ds-algo
47a0c56d65c1e1687fa982486b18774d52e8b122
5b61d902370c28ea9bc0d11e67b60ac1dafc311e
refs/heads/master
2021-07-24T13:00:50.179163
2018-11-19T04:42:45
2018-11-19T04:42:45
145,869,945
1
0
null
null
null
null
UTF-8
Java
false
false
977
java
package coderetreat.take_2; import java.util.stream.Collectors; public class Game { private Universe universe; public Game(Universe universe) { this.universe = universe; } public Universe play() { for (Cell cell: universe.getCells()) { int noOfLiveNeighbours = findLiveNeighboursCount(cell); if(cell.isAlive() && noOfLiveNeighbours < 2) { cell.setAlive(false); } } universe.getCells().forEach(c -> c.setAlive(false)); return universe; } private int findLiveNeighboursCount(Cell cell) { return universe.getCells().stream() .filter(c -> c.getX() == cell.getX() + 1 || c.getX() == cell.getX() - 1 || c.getY() == cell.getY() + 1 || c.getY() == cell.getY() - 1 ) .filter(c -> c.isAlive()) .collect(Collectors.toList()) .size(); } }
[ "rishikesh.m.dhokare@gmail.com" ]
rishikesh.m.dhokare@gmail.com
774d395f674eddf10507074efbe777840f47ed7a
ca73f36358f924ac3424db5a2cc7656144163fa5
/QLDSV(BE)/src/main/java/com/example/demo/controller/bangdiemController.java
1f4c6b1ce72bdda08258a670bfa83d24fb8f967d
[]
no_license
minhladung051120/QLDiem_ITSOL
3716259df77451aa0af5b8f3b8eca8c00bb4c3c1
410af59e075e1adcd3afbfc0279bc928b19c59bd
refs/heads/master
2022-12-24T18:52:09.786027
2020-10-12T05:04:51
2020-10-12T05:04:51
297,216,036
0
0
null
null
null
null
UTF-8
Java
false
false
678
java
package com.example.demo.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import com.example.demo.dto.BangDiem; import com.example.demo.repository.BangDiemRepository; @RestController @CrossOrigin(origins = "http://localhost:4200") public class bangdiemController { @Autowired private BangDiemRepository bangDiemRepository; @GetMapping("/getBangDiem") public List<BangDiem> getBangDiem() { return bangDiemRepository.getBangDiem(); } }
[ "some@email.com" ]
some@email.com
19fa8799e450148fdccd0dfd5506c7535985ce26
4ab46039b2e318b8b23f519ed9d38b5930dde530
/src/test/java/com/caglarturkurka/web/rest/errors/ExceptionTranslatorIntTest.java
f657e1f576501244d2c678ceb9ef0fe32a3786e0
[]
no_license
caglarturkurka/microapp
80f7ba281d3783acd4628513e1f0118e72ba56b5
08173cda7d9c5733ef0accfdc2b16e703efad9bc
refs/heads/master
2021-03-30T22:02:55.254478
2018-03-13T09:04:17
2018-03-13T09:04:17
125,022,246
0
0
null
2018-03-13T09:08:23
2018-03-13T09:04:15
Java
UTF-8
Java
false
false
6,497
java
package com.caglarturkurka.web.rest.errors; import com.caglarturkurka.MicroappApp; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.zalando.problem.spring.web.advice.MediaTypes; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Test class for the ExceptionTranslator controller advice. * * @see ExceptionTranslator */ @RunWith(SpringRunner.class) @SpringBootTest(classes = MicroappApp.class) public class ExceptionTranslatorIntTest { @Autowired private ExceptionTranslatorTestController controller; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; private MockMvc mockMvc; @Before public void setup() { mockMvc = MockMvcBuilders.standaloneSetup(controller) .setControllerAdvice(exceptionTranslator) .setMessageConverters(jacksonMessageConverter) .build(); } @Test public void testConcurrencyFailure() throws Exception { mockMvc.perform(get("/test/concurrency-failure")) .andExpect(status().isConflict()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE)); } @Test public void testMethodArgumentNotValid() throws Exception { mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION)) .andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO")) .andExpect(jsonPath("$.fieldErrors.[0].field").value("test")) .andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull")); } @Test public void testParameterizedError() throws Exception { mockMvc.perform(get("/test/parameterized-error")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.param0").value("param0_value")) .andExpect(jsonPath("$.params.param1").value("param1_value")); } @Test public void testParameterizedError2() throws Exception { mockMvc.perform(get("/test/parameterized-error2")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.foo").value("foo_value")) .andExpect(jsonPath("$.params.bar").value("bar_value")); } @Test public void testMissingServletRequestPartException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-part")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testMissingServletRequestParameterException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-parameter")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testAccessDenied() throws Exception { mockMvc.perform(get("/test/access-denied")) .andExpect(status().isForbidden()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.403")) .andExpect(jsonPath("$.detail").value("test access denied!")); } @Test public void testUnauthorized() throws Exception { mockMvc.perform(get("/test/unauthorized")) .andExpect(status().isUnauthorized()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.401")) .andExpect(jsonPath("$.path").value("/test/unauthorized")) .andExpect(jsonPath("$.detail").value("test authentication failed!")); } @Test public void testMethodNotSupported() throws Exception { mockMvc.perform(post("/test/access-denied")) .andExpect(status().isMethodNotAllowed()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.405")) .andExpect(jsonPath("$.detail").value("Request method 'POST' not supported")); } @Test public void testExceptionWithResponseStatus() throws Exception { mockMvc.perform(get("/test/response-status")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")) .andExpect(jsonPath("$.title").value("test response status")); } @Test public void testInternalServerError() throws Exception { mockMvc.perform(get("/test/internal-server-error")) .andExpect(status().isInternalServerError()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.500")) .andExpect(jsonPath("$.title").value("Internal Server Error")); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
464cd6f7bf5a8a6ce0cbf1ecae3167b2c2b3dfc5
abade586a195bc3349a1608172d81f0df887f870
/main/calibration/benchmark/boofcv/abst/calib/BenchmarkCalibrationDetectors.java
f7fbf980393e2fd26cb460c4a1c659017713c0d8
[ "Apache-2.0" ]
permissive
liuli9203/BoofCV
05baef37efaf1e825510ffaec266a87ef92d290a
3d0078ecd0b62245430c08e6b53297404ddc3dd1
refs/heads/master
2021-01-18T12:36:18.067216
2015-05-01T15:45:37
2015-05-01T15:45:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,549
java
/* * Copyright (c) 2011-2014, Peter Abeles. All Rights Reserved. * * This file is part of BoofCV (http://boofcv.org). * * 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 boofcv.abst.calib; import boofcv.factory.calib.FactoryPlanarCalibrationTarget; import boofcv.io.image.ConvertBufferedImage; import boofcv.misc.PerformerBase; import boofcv.misc.ProfileOperation; import boofcv.struct.image.ImageFloat32; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; /** * @author Peter Abeles */ public class BenchmarkCalibrationDetectors { public static final int TEST_TIME = 1000; public static ImageFloat32 imageChess; public static ImageFloat32 imageSquare; public static class Chessboard extends PerformerBase { PlanarCalibrationDetector detector = FactoryPlanarCalibrationTarget. detectorChessboard(new ConfigChessboard(5,7)); @Override public void process() { if( !detector.process(imageChess) ) throw new RuntimeException("Can't find target!"); } } public static class Square extends PerformerBase { PlanarCalibrationDetector detector = FactoryPlanarCalibrationTarget. detectorSquareGrid(new ConfigSquareGrid(5, 7)); @Override public void process() { if( !detector.process(imageSquare) ) throw new RuntimeException("Can't find target!"); } } public static ImageFloat32 loadImage(String fileName) { BufferedImage img; try { img = ImageIO.read(new File(fileName)); } catch (IOException e) { return null; } return ConvertBufferedImage.convertFrom(img, (ImageFloat32) null); } public static void main(String[] args) { String chess = "../data/evaluation/calibration/stereo/Bumblebee2_Chess/left01.jpg"; String square = "../data/evaluation/calibration/stereo/Bumblebee2_Square/left01.jpg"; imageChess = loadImage(chess); imageSquare = loadImage(square); ProfileOperation.printOpsPerSec(new Chessboard(), TEST_TIME); ProfileOperation.printOpsPerSec(new Square(), TEST_TIME); } }
[ "peter.abeles@gmail.com" ]
peter.abeles@gmail.com
97d1734429422fdb07107f7ed60b82c4f66b5f38
6c904b6530fcb00580c09e6e531d31dcf7845b92
/src/main/java/com/dylan/bean/Cat.java
0d0c2f4f20293e1c8b2350b72c0a91a9ab370f7a
[]
no_license
dylan1009/myLearning
47cdba06db624635b80555ed9525e183513cb6b2
c947a39c0e013a5474ee9a0d4e56cbd074af196f
refs/heads/master
2021-05-08T18:40:20.916995
2018-02-03T13:39:10
2018-02-03T13:39:10
119,529,473
0
0
null
null
null
null
UTF-8
Java
false
false
838
java
package com.dylan.bean; import java.io.Serializable; public class Cat implements Cloneable,Serializable { private String name = "miaomiao"; private int age = 2; MainPerson mainPerson; public MainPerson getMainPerson() { return mainPerson; } public void setMainPerson(MainPerson mainPerson) { this.mainPerson = mainPerson; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } @Override public Cat clone() { try { return (Cat)super.clone(); } catch (CloneNotSupportedException e) { e.printStackTrace(); } return null; } }
[ "ahua1009@126.com" ]
ahua1009@126.com
2b50283cf0df7a75928ed7d2aeda53c94f5ef18c
7c78c034b6eee74af3b398d4d31c1898df96e2bd
/Practice/src/pathSums/SumOfPaths.java
4570b2e14689b884bc1d455b6e3f29fd060a80ea
[]
no_license
Gaurav6982/java
4880e3de174dbc86be2cf8839bcee9d216307899
e2f91a5990ab32717c00bed6782f0eac806134ee
refs/heads/master
2022-12-26T00:25:32.331162
2020-10-13T16:39:38
2020-10-13T16:39:38
303,767,490
1
0
null
null
null
null
UTF-8
Java
false
false
1,397
java
package pathSums; import java.util.Stack; class Node{ int data; Node left,right=null; Node(int a){ data=a; left=null; right=null; } } public class SumOfPaths { static Node root=null; static Node construct(int[] arr,int l,int r) { // if(root==null) return null; if(l>r) return null; int mid=l+(r-l)/2; Node temp=new Node(arr[mid]); temp.left=construct(arr,l,mid-1); temp.right=construct(arr,mid+1,r); return temp; } static void inorder(Node root) { if(root==null) return; inorder(root.left); System.out.print(root.data+" "); inorder(root.right); } // static int sum=0; static void paths(Node root,int sum,int k,Stack<Integer> st) { if(root==null) return; // Stack<Integer> st=new Stack<Integer>(); // Stack<Integer> temp = new Stack<Integer>(); sum+=root.data; st.push(root.data); if(sum==k) { System.out.println(); while(st.size()>0) { System.out.print(st.pop()+" "); } } paths(root.left,sum,k,st); paths(root.right,sum,k,st); sum-=root.data; if(!st.isEmpty()) st.pop(); } public static void main(String[] args) { // TODO Auto-generated method stub int[] arr= {1,2,3,4,5,6,7}; // SumOfPaths tree=new SumOfPaths(); root=construct(arr,0,arr.length-1); // System.out.println(root.data); Stack<Integer> stack = new Stack<Integer>(); inorder(root); paths(root,0,17,stack); } }
[ "gaurav.jss.027@gmail.com" ]
gaurav.jss.027@gmail.com
683cf65d04020bf69389bbd59bde3586ae56254d
d06072e3a7152dfc2c8a6163ea02bf6d3acbe51e
/auth-core/src/main/java/com/fireman/yang/auth/core/session/Session.java
320ad2a2ee9d25fce94613d00304bae0ffe08474
[]
no_license
WaterMan666666/yang-auth
c94b874c4ec18600e009fa13d865a033a9498409
4c2091fb1a94ae5c3683fd6c9d887aaa96e18843
refs/heads/main
2023-01-11T13:05:41.319225
2020-11-20T04:24:39
2020-11-20T04:24:39
310,523,120
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package com.fireman.yang.auth.core.session; import com.fireman.yang.auth.core.User; /** * @author tongdong * @Date: 2020/6/8 * @Description: */ public interface Session { void setId(String id); String getId(); Object getAttribute(String key); void setAttribute(String key, Object value); Object removeAttribute(String key); void setUser(User user); User getUser(); }
[ "tongdong@xiaomi.com" ]
tongdong@xiaomi.com
c21e95539c6877d227c640aa9d61e1c86b9f9885
6f2d90996bbe8256b13bfbdd10a450df47f4f0c4
/org.xtext.datalog/src-gen/org/xtext/mde/datalog/impl/ParamListImpl.java
1091d68a2240ed4920cb138cfc1e72d15a05edf5
[]
no_license
Bensmithbortey/MDEDatalogIDE
6fb7addd7370f3c30b363e61c02cf59fc1bb9d7d
aad233b200639a17241b8d20f0ef269103d9f6bc
refs/heads/main
2023-04-07T20:44:21.448829
2021-04-15T13:36:52
2021-04-15T13:36:52
351,745,148
0
0
null
null
null
null
UTF-8
Java
false
false
6,267
java
/** * generated by Xtext 2.24.0 */ package org.xtext.mde.datalog.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.xtext.mde.datalog.DatalogPackage; import org.xtext.mde.datalog.Par; import org.xtext.mde.datalog.ParamList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Param List</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.xtext.mde.datalog.impl.ParamListImpl#getComma <em>Comma</em>}</li> * <li>{@link org.xtext.mde.datalog.impl.ParamListImpl#getRight <em>Right</em>}</li> * </ul> * * @generated */ public class ParamListImpl extends ParImpl implements ParamList { /** * The default value of the '{@link #getComma() <em>Comma</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getComma() * @generated * @ordered */ protected static final String COMMA_EDEFAULT = null; /** * The cached value of the '{@link #getComma() <em>Comma</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getComma() * @generated * @ordered */ protected String comma = COMMA_EDEFAULT; /** * The cached value of the '{@link #getRight() <em>Right</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRight() * @generated * @ordered */ protected Par right; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ParamListImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DatalogPackage.Literals.PARAM_LIST; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getComma() { return comma; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setComma(String newComma) { String oldComma = comma; comma = newComma; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DatalogPackage.PARAM_LIST__COMMA, oldComma, comma)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Par getRight() { return right; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetRight(Par newRight, NotificationChain msgs) { Par oldRight = right; right = newRight; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DatalogPackage.PARAM_LIST__RIGHT, oldRight, newRight); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void setRight(Par newRight) { if (newRight != right) { NotificationChain msgs = null; if (right != null) msgs = ((InternalEObject)right).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DatalogPackage.PARAM_LIST__RIGHT, null, msgs); if (newRight != null) msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DatalogPackage.PARAM_LIST__RIGHT, null, msgs); msgs = basicSetRight(newRight, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, DatalogPackage.PARAM_LIST__RIGHT, newRight, newRight)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DatalogPackage.PARAM_LIST__RIGHT: return basicSetRight(null, 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 DatalogPackage.PARAM_LIST__COMMA: return getComma(); case DatalogPackage.PARAM_LIST__RIGHT: return getRight(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DatalogPackage.PARAM_LIST__COMMA: setComma((String)newValue); return; case DatalogPackage.PARAM_LIST__RIGHT: setRight((Par)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DatalogPackage.PARAM_LIST__COMMA: setComma(COMMA_EDEFAULT); return; case DatalogPackage.PARAM_LIST__RIGHT: setRight((Par)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DatalogPackage.PARAM_LIST__COMMA: return COMMA_EDEFAULT == null ? comma != null : !COMMA_EDEFAULT.equals(comma); case DatalogPackage.PARAM_LIST__RIGHT: return right != null; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (comma: "); result.append(comma); result.append(')'); return result.toString(); } } //ParamListImpl
[ "robert.ciochina@kcl.ac.uk" ]
robert.ciochina@kcl.ac.uk
48ccf118fa48be70ab42f4e7da5799bb20ecf615
4a3560aea0921ebac0cc769ea59d4769700a5aec
/src/main/java/com/codegym/controller/CustomerController.java
7c238ae6718b8a10c8522372924c6891ca478de0
[]
no_license
face13ss/customer-management
bbea0c41d7dbdaa29068e2e368c6a4770a94341f
d216060a6744f9a66e4c8b7fef9a3fe5ad637b1c
refs/heads/master
2023-02-21T11:09:43.170452
2021-01-23T01:54:06
2021-01-23T01:54:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,100
java
package com.codegym.controller; import com.codegym.model.Customer; import com.codegym.services.CustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import java.util.List; @Controller public class CustomerController { @Autowired private CustomerService customerService; @GetMapping("/customer") public String index(Model model) { List customers = customerService.findAll(); model.addAttribute("customers", customers); return "index"; } @GetMapping("/customer/create") public String create(Model model) { model.addAttribute("customer", new Customer()); return "create"; } @PostMapping("/customer/save") public String save(Customer customer) { customer.setId((int) (Math.random() * 10000)); customerService.save(customer); return "redirect:/customer"; } }
[ "=" ]
=
f70fdd39516f5b54c5ee10fc9852cc58804d597b
b0d1dd5611bd6deb4cd5549dc778d7c6cd77477a
/sams/src/com/narendra/sams/web/restws/admission/StudentGaurdianRestController.java
78449e7a67517961cfa9b12a66464f358cc8d4f3
[]
no_license
kajubaba/kamlesh
a28496e4bb8a277532ed01c9c9e0ced31b27b064
3419fd55afe8044660948cd6ed5342ed025b81e8
refs/heads/master
2021-07-06T16:22:47.738261
2017-10-02T06:59:23
2017-10-02T06:59:23
105,502,681
0
0
null
null
null
null
UTF-8
Java
false
false
11,801
java
package com.narendra.sams.web.restws.admission; import com.narendra.sams.admission.domain.Address; import com.narendra.sams.admission.domain.GaurdianAddress; import com.narendra.sams.admission.domain.Student; import com.narendra.sams.admission.domain.StudentGaurdian; import com.narendra.sams.admission.domain.StudentParentsInformation; import com.narendra.sams.admission.domain.StudentPersonalInformation; import com.narendra.sams.admission.service.StudentService; import com.narendra.sams.core.address.domain.Country; import com.narendra.sams.core.address.domain.State; import com.narendra.sams.core.util.DateUtil; import com.narendra.sams.web.restws.admission.vo.AjaxSuccessResponse; import com.narendra.sams.web.restws.admission.vo.GaurdianInformationVO; import com.narendra.sams.web.restws.admission.vo.ParentsInformationVO; import com.narendra.sams.web.restws.admission.vo.StudentPersonalInformationVO; import com.narendra.sams.web.utils.AJAXResponseStatus; import com.narendra.sams.web.utils.LoggedinUserAssistant; import java.text.ParseException; import java.util.HashSet; import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.propertyeditors.StringTrimmerEditor; import org.springframework.stereotype.Controller; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @Controller @RequestMapping({"/ws/studentinfo"}) public class StudentGaurdianRestController { @Autowired private StudentService studentService; @InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); } @ResponseBody @RequestMapping(method = {RequestMethod.POST}, value = {"/update/gaurdianinfo"}) public AjaxSuccessResponse addGaurdian(@RequestBody GaurdianInformationVO gaurdian) { StudentGaurdian studentGaurdian = prepareGaurdianToAdd(gaurdian); AjaxSuccessResponse ajaxSuccessResponse = new AjaxSuccessResponse(); if (studentGaurdian != null) { if (studentGaurdian.getId() != null) { this.studentService.updateGaurdian(studentGaurdian, LoggedinUserAssistant.getLoggedInUserId()); ajaxSuccessResponse.setGeneratedId(gaurdian.getId()); } else { ajaxSuccessResponse.setGeneratedId(this.studentService.addGaurdian(studentGaurdian, LoggedinUserAssistant.getLoggedInUserId())); } ajaxSuccessResponse.setStatus(AJAXResponseStatus.SUCCESS); } else { ajaxSuccessResponse.setStatus(AJAXResponseStatus.FAIL); } return ajaxSuccessResponse; } @ResponseBody @RequestMapping(method = {RequestMethod.POST}, value = {"/update/personalinfo"}) private AjaxSuccessResponse updateStudentPersonalInformation(@RequestBody StudentPersonalInformationVO studentPersonalInformationVO) { this.studentService.updateStudentPersonalInformation(prepareStudentPersonalinformationToUpdate(studentPersonalInformationVO), LoggedinUserAssistant.getLoggedInUserId()); AjaxSuccessResponse ajaxSuccessResponse = new AjaxSuccessResponse(); ajaxSuccessResponse.setStatus(AJAXResponseStatus.SUCCESS); return ajaxSuccessResponse; } @ResponseBody @RequestMapping(method = {RequestMethod.POST}, value = {"/update/parentsinfo"}) private AjaxSuccessResponse updateParentsInformation(@RequestBody ParentsInformationVO parentsInformationVO) { this.studentService.updateStudentParentsInformation(prepareStudentParentsinformationToUpdate(parentsInformationVO), LoggedinUserAssistant.getLoggedInUserId()); AjaxSuccessResponse ajaxSuccessResponse = new AjaxSuccessResponse(); ajaxSuccessResponse.setStatus(AJAXResponseStatus.SUCCESS); return ajaxSuccessResponse; } private StudentGaurdian prepareGaurdianToAdd(GaurdianInformationVO gaurdian) { if (gaurdian == null) { return null; } StudentGaurdian studentGaurdian = new StudentGaurdian(); studentGaurdian.setId(gaurdian.getId()); studentGaurdian.setName(gaurdian.getName()); studentGaurdian.setDob(null); studentGaurdian.setAnnualIncome(gaurdian.getAnnaulIncome()); studentGaurdian.setOccupation(gaurdian.getOccupation()); studentGaurdian.setContactNo1(gaurdian.getContactNo1()); studentGaurdian.setContactNo2(gaurdian.getContactNo2()); studentGaurdian.setGender(""); studentGaurdian.setRelationWithStudent(gaurdian.getRelationWithStudent()); Student student = new Student(); student.setId(gaurdian.getStudentId()); studentGaurdian.setStudent(student); GaurdianAddress gaurdianAddress = new GaurdianAddress(); gaurdianAddress.setLine1(gaurdian.getAddress().getFullAddress()); gaurdianAddress.setLine2(gaurdian.getAddress().getVillegeTownArea()); gaurdianAddress.setCity(gaurdian.getAddress().getCity()); gaurdianAddress.setTeh(""); gaurdianAddress.setDistrict(""); gaurdianAddress.setZipCode(gaurdian.getAddress().getZipCode()); gaurdianAddress.setAddressType("Current"); if (gaurdian.getAddress().getStateId() != null) { State state = new State(); state.setId(gaurdian.getAddress().getStateId()); gaurdianAddress.setState(state); } Country country = new Country(); country.setId(Long.valueOf(1)); gaurdianAddress.setCountry(country); gaurdianAddress.setStudentGaurdian(studentGaurdian); Set<GaurdianAddress> addresses = new HashSet(); addresses.add(gaurdianAddress); studentGaurdian.setAddresses(addresses); return studentGaurdian; } private StudentPersonalInformation prepareStudentPersonalinformationToUpdate(StudentPersonalInformationVO newInformation) { if (newInformation == null) { return null; } StudentPersonalInformation studentPersonalInformation = new StudentPersonalInformation(); studentPersonalInformation.setStudentId(newInformation.getStudentId()); studentPersonalInformation.setStudentAssignedId(newInformation.getStudentAssignedId()); String[] names = newInformation.getName().split(" "); if (names != null) { if (names.length == 1) { studentPersonalInformation.setFirstName(names[0]); } else if (names.length == 2) { studentPersonalInformation.setFirstName(names[0]); studentPersonalInformation.setLastName(names[1]); } else if (names.length == 3) { studentPersonalInformation.setFirstName(names[0]); studentPersonalInformation.setMiddleName(names[1]); studentPersonalInformation.setLastName(names[2]); } } studentPersonalInformation.setGender(newInformation.getGender()); studentPersonalInformation.setSubCaste(newInformation.getSubCaste()); studentPersonalInformation.setCategoryId(newInformation.getCategoryId()); studentPersonalInformation.setMobileNo1(newInformation.getMobileNo1()); studentPersonalInformation.setMobileNo2(newInformation.getMobileNo2()); if (!(newInformation.getDob() == null || newInformation.getDob().isEmpty())) { try { studentPersonalInformation.setDob(DateUtil.parseDate(newInformation.getDob(), "dd-MMM-yyyy")); } catch (ParseException e) { e.printStackTrace(); } } studentPersonalInformation.setBirthPlace(newInformation.getBirthPlace()); studentPersonalInformation.setEmail(newInformation.getEmail()); studentPersonalInformation.setSamagraId(newInformation.getSamagraId()); studentPersonalInformation.setFamilyId(newInformation.getFamilyId()); studentPersonalInformation.setAadharNo(newInformation.getAadharNo()); studentPersonalInformation.setReligion(newInformation.getReligion()); studentPersonalInformation.setBloodGroup(newInformation.getBloodGroup()); studentPersonalInformation.setNationality(newInformation.getNationality()); studentPersonalInformation.setLanguagesKnown(newInformation.getLanguagesKnown()); studentPersonalInformation.setEnrollmentNo(newInformation.getEnrollmentNo()); Address address = new Address(); address.setId(newInformation.getAddress().getAddressId()); address.setLine1(newInformation.getAddress().getFullAddress()); address.setLine2(newInformation.getAddress().getVillegeTownArea()); address.setCity(newInformation.getAddress().getCity()); address.setTeh(newInformation.getAddress().getTeh()); address.setDistrict(newInformation.getAddress().getDist()); if (newInformation.getAddress().getStateId() != null) { State state = new State(); state.setId(newInformation.getAddress().getStateId()); address.setState(state); } else { address.setState(new State()); } address.setZipCode(newInformation.getAddress().getZipCode()); studentPersonalInformation.setAddress(address); return studentPersonalInformation; } private StudentParentsInformation prepareStudentParentsinformationToUpdate(ParentsInformationVO newInformation) { if (newInformation == null) { return null; } StudentParentsInformation studentParentsInformation = new StudentParentsInformation(); studentParentsInformation.setStudentId(newInformation.getStudentId()); studentParentsInformation.setFatherName(newInformation.getFatherName()); studentParentsInformation.setFatherContactNo1(newInformation.getFatherContactNo1()); studentParentsInformation.setFatherContactNo2(newInformation.getFatherContactNo2()); studentParentsInformation.setFatherOccupation(newInformation.getFatherOccupation()); studentParentsInformation.setFatherAnnulaIncome(newInformation.getFatherAnnulaIncome()); studentParentsInformation.setMotherName(newInformation.getMotherName()); studentParentsInformation.setMotherContactNo1(newInformation.getMotherContactNo1()); studentParentsInformation.setMotherContactNo2(newInformation.getMotherContactNo2()); studentParentsInformation.setMotherOccupation(newInformation.getMotherOccupation()); studentParentsInformation.setMotherAnnulaIncome(newInformation.getMotherAnnulaIncome()); Address address = new Address(); address.setId(newInformation.getAddress().getAddressId()); address.setLine1(newInformation.getAddress().getFullAddress()); address.setLine2(newInformation.getAddress().getVillegeTownArea()); address.setCity(newInformation.getAddress().getCity()); address.setTeh(newInformation.getAddress().getTeh()); address.setDistrict(newInformation.getAddress().getDist()); if (newInformation.getAddress().getStateId() != null) { State state = new State(); state.setId(newInformation.getAddress().getStateId()); address.setState(state); } else { address.setState(new State()); } address.setZipCode(newInformation.getAddress().getZipCode()); studentParentsInformation.setAddress(address); return studentParentsInformation; } }
[ "34kamlesh@gmail.com" ]
34kamlesh@gmail.com
7be096668ef4ee79f34d202cca9a909cdafa5153
efe1a296bbfc4acd8045de587bde4eda68ea721e
/src/main/java/report/report_data/ReportDataImpl.java
a3d5d57f0a879d4564d705e009be77f8d5478117
[]
no_license
nenadmit/hyper-reports-engine
f3455a76806928ecdaae9ffaccd9862ee1acf792
de394fe04c0a006e4d277dbd87c510ac0e4c5d84
refs/heads/master
2022-07-01T17:30:39.415023
2020-04-29T08:25:05
2020-04-29T08:25:05
259,866,809
0
0
null
2022-06-21T03:20:06
2020-04-29T08:21:53
Java
UTF-8
Java
false
false
1,474
java
package report.report_data; import java.util.LinkedHashMap; import java.util.Map; public class ReportDataImpl implements ReportData { private String name; private Map<String,Double> monthTurnoverMap = new LinkedHashMap<>(); private double turnover = 0; private static final String[] MONTH_NAMES = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}; public String getName() { return name; } public void setName(String storeName) { this.name = storeName; } public Map<String, Double> getMonthTurnoverMap() { return monthTurnoverMap; } public void setMonthTurnoverMap(Map<String, Double> monthTurnoverMap) { this.monthTurnoverMap = monthTurnoverMap; } public void setTurnover(double total) { this.turnover = total; } public double getTurnover() { return turnover; } public void put(int month,double turnover){ this.monthTurnoverMap.put(MONTH_NAMES[month-1],turnover); } public void calculateTurnover(){ for(Map.Entry<String,Double> entry:monthTurnoverMap.entrySet()){ turnover = turnover + entry.getValue(); } } @Override public int compareTo(ReportData o) { return Double.compare(this.turnover,o.getTurnover()); } }
[ "noreply@github.com" ]
nenadmit.noreply@github.com
a4170fe7ab258b1d4381e77cc01e8dc4feaf1e7d
389442ede69d1983057824c7e6d44c2d052df52d
/Java/ADV_Lab1/src/TestShapes.java
5632f00afa067f0b39766385b95d6a00b3cf909e
[]
no_license
Maddaz/Coursework
53a17e1afcd48daff79431340a36604c1305bbda
3e0b3ebc7eae84717b6dc7baf4d591a38216d41d
refs/heads/master
2020-07-11T06:11:42.966282
2019-08-26T11:47:53
2019-08-26T11:47:53
204,463,415
0
0
null
null
null
null
UTF-8
Java
false
false
1,508
java
/****************************************** * Lab 1 Advanced Programming * Question 4 * Author: Mateusz Glogowski s4546642 ******************************************/ public class TestShapes { public static void main(String[] args) { //Initialize array GeometricObject [] shapes = new GeometricObject[5]; //Populate Array shapes[0] = new Circle("pink",true,4.5); shapes[1] = new Circle("blue",false,3.1); shapes[2] = new Rectangle("cyan", true,2.0,2.4); shapes[3] = new Circle("green", true, 3.6); shapes[4] = new Rectangle("orange", false,5.0,1.4); //Print object details printDetails(shapes); //Print object perimeter printPerimeter(shapes); //Print object area printArea(shapes); } //Printing Methods public static void printDetails(GeometricObject[] shapes){ System.out.println("The details for each object is"); for(int x=0; x<shapes.length;x++){ System.out.println("Object " + (x+1) + " is " + shapes[x].toString()); } } public static void printPerimeter(GeometricObject[] shapes){ System.out.print("\n\n"); System.out.println("The perimeter for each object is"); for(int x=0; x<shapes.length; x++){ System.out.println("Object " + (x+1) + " is " + shapes[x].findPerimeter()); } } public static void printArea(GeometricObject[] shapes){ System.out.print("\n\n"); System.out.println("The area for each object is"); for(int x=0; x<shapes.length; x++){ System.out.println("Object " + (x+1) + " is " + shapes[x].findArea()); } } }
[ "m_glogowski@hotmail.com" ]
m_glogowski@hotmail.com
42177ad3d3a8cc9a26a899a88c88954c6fb0892a
d09768e52a5b10ac897c07dd5c2720129d00567a
/src/webservices/Client/LVLClient.java
636e7d9243ee02630ede5ac8a43ac20e5c9065b7
[]
no_license
stallonemacwan/DCMS-via-WebServices
f8d43c3a58560297586eace4f49a2f4655ba5145
8f6ad2884857d0805aeb04e8965851d15c3734cf
refs/heads/master
2023-07-24T13:31:21.685114
2021-08-29T19:24:15
2021-08-29T19:24:15
401,123,431
0
0
null
null
null
null
UTF-8
Java
false
false
15,009
java
package webservices.Client; import Log.Log; import webservices.Client.LVLClassService; import webservices.Client.WebInterface; import java.io.IOException; import java.util.Scanner; public class LVLClient { public static void main(String args[]) throws IOException { LVLClassService lvlc = new LVLClassService(); WebInterface lvl = lvlc.getLVLClassPort(); Scanner sc = new Scanner(System.in); System.out.println("Enter the managerID for Laval Client"); String managerID = sc.next(); //input string String prefix = ""; if (managerID.length() > 3) { prefix = managerID.substring(0, 3); //substring containing first 3 characters } while (!check_valid_managerID(managerID, prefix)) { if(prefix.equals("MTL")|| prefix.equals("DDO")){ System.out.println("LVL Client is running, cannot use DDO or MTL clients."); } System.out.println("Manager ID not valid." + " Insert a valid ManagerID"); managerID = sc.next(); if (managerID.length() > 3) { prefix = managerID.substring(0, 3); } }Log LogObject = new Log( "Logs/" + managerID + ".txt"); LogObject.logger.info(managerID + " has logged in the " + prefix + " Server"); while (true) { System.out.println("----- Select which operation you want to perform -----"); System.out.println("1. Creating a teacher record (TR)"); System.out.println("2. Creating a student record (SR)"); System.out.println("3. Edit record"); System.out.println("4. Display all records"); System.out.println("5. Displaying a record"); System.out.println("6. Display total Record count of all servers."); System.out.println("7. Transfer records."); System.out.println("8. Exit."); int ch; ch = sc.nextInt(); switch (ch) { case 1: LogObject.logger.info("The Manager " + managerID + " attempting to create a new Teacher Record"); System.out.println("Enter First name:"); String fname = sc.next(); while (hasNumbers(fname)) { System.out.println("A name can not contain numbers, please insert valid input."); fname = sc.next(); } System.out.println("Enter Last name:"); String lname = sc.next(); while (hasNumbers(lname)) { System.out.println("A name can not contain numbers, please insert valid input."); lname = sc.next(); } System.out.println("Enter Address:"); sc.nextLine(); String add = sc.nextLine(); while (add == null || add.equals("")) { System.out.println("Address can not be null, please insert valid input."); add = sc.next(); } System.out.println("Enter Phone number in the format (514-888-9999):"); String ph = sc.nextLine(); while (ph.length() != 12 || hasAlpha(ph)) { System.out.println("Invalid phone number"); System.out.println("Try another"); ph = sc.nextLine(); } System.out.println("Specialization courses:"); String spc = sc.nextLine(); lvl.createTRecord(fname, lname, add, ph, spc, "LVL", managerID); LogObject.logger.info("The Manager " + managerID + " successfully created a new Teacher Record"); break; case 2: LogObject.logger.info("The Manager " + managerID + " attempting to create a new Student Record"); System.out.println("Enter First name:"); String firstName = sc.next(); while (hasNumbers(firstName)) { System.out.println("A name can not contain numbers, please insert valid input."); firstName = sc.next(); } System.out.println("Enter Last name:"); String lastName = sc.next(); while (hasNumbers(lastName)) { System.out.println("A name can not contain numbers, please insert valid input."); lastName = sc.next(); } System.out.println("Name courses the student is registered in:"); sc.nextLine(); String CourseRegistered = sc.nextLine(); System.out.println("Enter Status of the student:"); String status = sc.next(); while (!(status.equals("active") || status.equals("inactive") || status.equals("Active") || status.equals("Inactive"))) { System.out.println("Status inserted is not accepted, please enter (active or inactive)."); status = sc.next(); } System.out.println("Enter status date: (format - dd/mm/yyyy)"); String statusDate = sc.next(); while (hasAlpha(statusDate) || !((Character.toString(statusDate.charAt(2))).equals("/") || (Character.toString(statusDate.charAt(5))).equals("/")) || dateFormatChecker(statusDate)) { System.out.println("Invalid date format, please insert again in this format dd/mm/yyyy"); statusDate = sc.next(); } lvl.createSRecord(firstName, lastName, CourseRegistered, status, statusDate, managerID); LogObject.logger.info("The Manager " + managerID + " successfully created a new Student Record"); break; case 3: LogObject.logger.info("The Manager " + managerID + " attempting to edit a Record"); System.out.println("Enter the recordID of the record you want to edit:"); String RecordID = sc.next(); while (!(validRecordID(RecordID))) { System.out.println("Invalid recordID, insert a valid ID"); RecordID = sc.next(); } if (RecordID.startsWith("SR")) { System.out.println("Enter name of the field you want to change:" + "\n" + "Enter in this format: " + "courses_registered,status, status_date"); } if (RecordID.startsWith("TR")) { System.out.println("Enter name of the field you want to change:" + "\n" + "Enter in this format: " + "address, phone, specialization, location"); } String field = sc.next(); while (!(field.equals("courses_registered") || field.equals("status") || field.equals("status_date") || field.equals("address") || field.equals("phone") || field.equals("specialization") || field.equals("location"))) { System.out.println("Field name not properly mentioned, please write as provided above"); field = sc.next(); } System.out.println("What value you want to change to:"); sc.nextLine(); String value = sc.nextLine(); switch (field) { case ("address"): while (value == null || value.equals("")) { System.out.println("Address can not be null, please insert valid input."); value = sc.nextLine(); } break; case ("phone"): while (value.length() != 12 || hasAlpha(value)) { System.out.println("Invalid phone number"); System.out.println("Try another"); value = sc.next(); } break; case ("location"): while (!(value.equals("MTL") || value.equals("LVL") || value.equals("DDO"))) { System.out.println("Invalid location entered"); System.out.println("Try another"); value = sc.next(); } break; case ("status"): while (!(value.equals("active") || value.equals("inactive") || value.equals("Active") || value.equals("Inactive"))) { System.out.println("Status inserted is not accepted, please enter (active or inactive)."); value = sc.next(); } break; case ("status_date"): while (hasAlpha(value) || !((Character.toString(value.charAt(2))).equals("/") || (Character.toString(value.charAt(5))).equals("/")) || dateFormatChecker(value)) { System.out.println("Invalid date format, please insert again in this format dd/mm/yyyy"); value = sc.next(); } break; default: break; } System.out.println(lvl.editRecord(RecordID, field, value, managerID)); LogObject.logger.info("The Manager " + managerID + " successfully edited the Record " + RecordID); break; case 4: LogObject.logger.info("The Manager " + managerID + " displayed all Records"); System.out.println(lvl.displayAllRecords(managerID)); break; case 5: LogObject.logger.info("The Manager " + managerID + " attempting to display a specific Record"); System.out.println("Enter the recordID of the record to display:"); String recordID = sc.next(); while (!(validRecordID(recordID))) { System.out.println("Invalid recordID, insert a valid ID"); recordID = sc.next(); } System.out.println(lvl.displayRecord(recordID, managerID)); LogObject.logger.info("The Manager " + managerID + " displayed the Record " + recordID); break; case 6: LogObject.logger.info("The Manager " + managerID + " attempting to retrieve Record count over all the servers"); System.out.println(lvl.getRecordCounts(managerID)); LogObject.logger.info("The Manager " + managerID + " retrieved Record count of all the servers"); break; case 7: LogObject.logger.info("The Manager " + managerID + " attempting to transfer a Record"); System.out.println("Enter the recordID of the record to transfer:"); String recorID = sc.next(); while (!(validRecordID(recorID))) { System.out.println("Invalid recordID, insert a valid ID"); recorID = sc.next(); } System.out.println("Enter the center server name:"); String centServer = sc.next(); while (!(centServer.equals("MTL") || centServer.equals("LVL") || centServer.equals("DDO"))) { System.out.println("Invalid Server Name mentioned"); centServer = sc.next(); } System.out.println(lvl.transferRecord(recorID, centServer, managerID)); if (centServer.equals("DDO") || centServer.equals("MTL")) { LogObject.logger.info("The Manager " + managerID + " transferred the Record " + recorID + " to server " + centServer); } else if (centServer.equals("LVL")) { System.out.println("Cannot transfer to the same server"); LogObject.logger.info("The Manager " + managerID + " attempted to transfer the Record " + recorID + " to itself and it failed"); } break; case 8: System.exit(0); break; default: System.out.println("Wrong choice"); break; } } } public static boolean hasNumbers(String input) { char[] chars = input.toCharArray(); for (char c : chars) { if (Character.isDigit(c)) { return true; } } return false; } public static boolean validRecordID(String ID) { String firstTwoLetters = Character.toString(ID.charAt(0)) + Character.toString(ID.charAt(1)); for (int i = 2; i < ID.length(); i++) { if (hasAlpha(Character.toString(ID.charAt(i)))) { return false; } } if ((firstTwoLetters.equals("TR") || firstTwoLetters.equals("SR")) && ID.length() == 7) { return true; } return false; } public static boolean dateFormatChecker(String statusdate) { if (statusdate.length()!=10) return true; String month1 = Character.toString(statusdate.charAt(3)) + Character.toString(statusdate.charAt(4)); int month = Integer.parseInt(month1); if (month > 12) { return true; } return false; } public static boolean hasAlpha(String input) { char[] chars = input.toCharArray(); for (char c : chars) { if (Character.isLetter(c)) { return true; } } return false; } public static boolean check_valid_managerID(String input, String prefix) { if ((!(prefix.equals("LVL"))) || input.length() != 7) { return false; } boolean check = hasAlpha(input.substring(3, input.length())); return !check; } }
[ "32460884+stallonemacwan@users.noreply.github.com" ]
32460884+stallonemacwan@users.noreply.github.com
3c584540059b27f2557f9e124ccde63102aca18a
f3eda97d0b3c39ebf14ab901e67f1a9d05883967
/src/main/java/ma/dwm/magasin/entities/Commande.java
ef8269977f6ffe867f53029838d598c362e8f389
[]
no_license
BadreBoufarhate/java-magasin
032ed9eccaee4f1a15522a644afc453856dffc2f
00837e2eb4bfa237fee952803d40f98baa8fb7a0
refs/heads/main
2023-06-09T00:22:00.217794
2021-07-03T17:46:48
2021-07-03T17:46:48
382,677,009
0
0
null
null
null
null
UTF-8
Java
false
false
1,017
java
package ma.dwm.magasin.entities; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import javax.persistence.Table; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Entity @Table(name = "COMMANDES") @Data @NoArgsConstructor @AllArgsConstructor public class Commande implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id_commande; private double qte; private double sous_total; @ManyToOne @JoinColumn(name = "vente_id", referencedColumnName = "id_vente", nullable = false) private Vente vente; @OneToOne @JoinColumn(name = "commande_id", referencedColumnName = "id_produit", nullable = false) private Produit produit; public double getSous_total(){ return qte*produit.getPrix(); } }
[ "noreply@github.com" ]
BadreBoufarhate.noreply@github.com
648dcda398e353fbc240e90180bafb9874ca1f97
86158d8fa9c3b44e561f61c87136125f72cc3e28
/auburn/50 _ mobile0/mobile0/androidx/core/os/OperationCanceledException.java
ef05a5e845c83e1703c1eb5c427a016e845c4d7c
[]
no_license
congtrung2k1/CTF-Write-up
3e0cecb4888759d6da2a29c5213f249637fc1713
fadbdceed4713d273d5c9268ff5edd10438bad9d
refs/heads/master
2021-11-11T16:39:10.912008
2021-10-21T18:26:51
2021-10-21T18:26:51
230,739,687
1
0
null
null
null
null
UTF-8
Java
false
false
404
java
// // Decompiled by Procyon v0.5.36 // package androidx.core.os; public class OperationCanceledException extends RuntimeException { public OperationCanceledException() { this((String)null); } public OperationCanceledException(String message) { if (message == null) { message = "The operation has been canceled."; } super(message); } }
[ "42043537+congtrung2k1@users.noreply.github.com" ]
42043537+congtrung2k1@users.noreply.github.com
12c2f86b49b66c04126e720acca7eb815fa6fa37
260785497f1d4704d153866843a6add0cd432a1a
/src/main/java/com/inheritor/mycompany/quickcabsservice/dto/OrdersDto.java
46bdb949acbdf931dc5dd9f83f20456d9f2453a5
[]
no_license
ChathuraHansika/Project1
c22db48d4226436969d89ddea8a63bc49f94ccd4
6b309f22954e8e56f3cb86095ba34aa3959100bc
refs/heads/master
2021-01-18T20:27:50.087088
2019-02-15T05:05:43
2019-02-15T05:05:43
86,969,398
1
0
null
null
null
null
UTF-8
Java
false
false
1,377
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.inheritor.mycompany.quickcabsservice.dto; import sun.util.calendar.BaseCalendar; import java.util.Date; /** * * @author Chathura */ public class OrdersDto { private String carbrand; private String carmodel; private Date pickupDate; private Date handOverDate; public OrdersDto(String carbrand, String carmodel, Date pickupDate, Date handOverDate) { this.carbrand = carbrand; this.carmodel = carmodel; this.pickupDate = pickupDate; this.handOverDate = handOverDate; } public String getCarbrand() { return carbrand; } public void setCarbrand(String carbrand) { this.carbrand = carbrand; } public String getCarmodel() { return carmodel; } public void setCarmodel(String carmodel) { this.carmodel = carmodel; } public Date getPickupDate() { return pickupDate; } public void setPickupDate(Date pickupDate) { this.pickupDate = pickupDate; } public Date getHandOverDate() { return handOverDate; } public void setHandOverDate(Date handOverDate) { this.handOverDate = handOverDate; } }
[ "chathuraivh@gmail.com" ]
chathuraivh@gmail.com
96aa8d7585e50513af0e93003ee8e7a6970d2b69
fd252df3f03c9d8b58e0ae5fee65e1ff3c1d2aa4
/app/src/main/java/za/co/iclub/pss/layoutapp/RegisterActivity.java
c7d77e2c93eefad4b0391f8bd54cfbfb22a291b2
[]
no_license
sairamdikondawar/LayoutAPP
8bf48f33a22e0db39ea6fec9654eb785bff22d18
fcff84d8320944ef97f5f86ed63feae11a75fa42
refs/heads/master
2020-12-31T04:28:43.516596
2015-10-21T12:01:08
2015-10-21T12:01:08
44,666,311
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package za.co.iclub.pss.layoutapp; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class RegisterActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set View to register.xml setContentView(R.layout.register); TextView loginScreen = (TextView) findViewById(R.id.link_to_login); // Listening to Login Screen link loginScreen.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { // Switching to Login Screen/closing register screen finish(); } }); } }
[ "sairamdikondawar@gmail.com" ]
sairamdikondawar@gmail.com
584fdbfda8f7dc0596c093b4bcd5d7239c7f9b00
b0f62ddf974be4190e6ecd3af698aaa973f9e2a3
/src/test/java/com/jujogoru/springboot/app/users/SpringbootServiceUsersApplicationTests.java
3951b30571dc95a5b2c5055fa1e582360ce9d071
[]
no_license
jujogoru/springboot-service-users
b411d5b35b60eeb30c4c3b7d0a59e7a512aaa18a
d6f8f42c2b3a31972e06d3d990dadf716b67b2e3
refs/heads/master
2022-12-22T17:43:39.440123
2020-09-30T21:29:29
2020-09-30T21:29:29
300,067,544
0
0
null
null
null
null
UTF-8
Java
false
false
241
java
package com.jujogoru.springboot.app.users; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SpringbootServiceUsersApplicationTests { @Test void contextLoads() { } }
[ "jujogoru@hotmail.com" ]
jujogoru@hotmail.com
6ffe6c43a3d45d13a42f58da017dc8b18006780e
034debca54a8560e4ad7d8e66788ce2e4e31a9f9
/src/main/java/com/jason/network/util/HttpUtil.java
0277194228d90ef570aaaf0c72ac07dd676be144
[]
no_license
jasonGeng88/java-network-programming
49c3f0e404508916af0caa0ebee58810505ffa64
c3c156fb1c354c4b1824216bc9652da200d372ac
refs/heads/master
2021-01-16T18:55:15.624871
2017-10-15T17:44:55
2017-10-15T17:44:55
100,127,301
14
11
null
null
null
null
UTF-8
Java
false
false
336
java
package com.jason.network.util; /** * Created by jason-geng on 8/17/17. */ public class HttpUtil { public static String compositeRequest(String host){ return "GET / HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "User-Agent: curl/7.43.0\r\n" + "Accept: */*\r\n\r\n"; } }
[ "gj@tezign.com" ]
gj@tezign.com
21bc2c73666d69a41ba64eef9b8d7462f0e7b2e6
cb3dc25ee29d09f6a6270564c7d7d54fa7e11ef6
/serial-distribute-service/src/main/java/com/gzs/learn/serial/SerialDistributeServer.java
0ab9905db125cddf546c38654eb594a5d9090819
[ "Apache-2.0" ]
permissive
devsong/serial
6944c6dfe21b97a6107ffd599e0531ca921bed8b
ef89004e84003c2699c602ee4cad9454fd3c8d8a
refs/heads/master
2020-04-10T15:26:25.146326
2018-12-10T03:12:29
2018-12-10T03:13:57
161,109,631
0
0
null
null
null
null
UTF-8
Java
false
false
902
java
package com.gzs.learn.serial; import java.util.concurrent.CountDownLatch; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; import lombok.extern.slf4j.Slf4j; @Configuration @EnableAutoConfiguration @ComponentScan @ImportResource("classpath:/META-INF/applicationContext.xml") @Slf4j public class SerialDistributeServer { public static void main(String[] args) throws Exception { SpringApplication.run(SerialDistributeServer.class, args); log.info("----------->Serial Distribute Server Start Success<----------"); CountDownLatch latch = new CountDownLatch(1); latch.await(); } }
[ "guanzhisong@gmail.com" ]
guanzhisong@gmail.com
3386a9cfd960a539aa4195e18a521a5b715f406b
a0f1001a3e872a17d21ec76461cc6761286c5734
/day10/王楚杰/myCode/app/src/main/java/com/example/mycode/fragment/HomeFragment.java
eb32fff15d65ee0540fcec9933448449e8229a23
[]
no_license
JohnZhang1000/group6
e7d0a447a77cc9e0426e9ba602fef2293d6f105a
a26297b745585e60f03264effa8a81ccb063e5f0
refs/heads/main
2023-02-08T22:48:08.882603
2021-01-05T00:26:52
2021-01-05T00:26:52
322,816,503
0
0
null
null
null
null
UTF-8
Java
false
false
1,713
java
package com.example.mycode.fragment; import android.util.Log; import android.view.View; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.example.mvplibrary.base.BaseFragment; import com.example.mycode.Bean; import com.example.mycode.MyPresenter; import com.example.mycode.R; import com.example.mycode.adapter.HomeAdapter; import java.util.ArrayList; public class HomeFragment extends BaseFragment<MyPresenter, Bean> { private static final String TAG = "HomeFragment"; private RecyclerView mRec; private ArrayList<Bean.DataBean.DatasBean> datasBeans; private MyPresenter myPresenter; private HomeAdapter mAdapter; @Override protected MyPresenter createPresenter() { return myPresenter; } @Override protected void init() { myPresenter = new MyPresenter(this); View view = getLayoutInflater().inflate(getLayoutId(), null); mRec = view.findViewById(R.id.home_rec); mRec.setLayoutManager(new LinearLayoutManager(getContext())); datasBeans = new ArrayList<>(); mAdapter = new HomeAdapter(datasBeans,getContext()); mRec.setAdapter(mAdapter); iniData(); } private void iniData() { myPresenter.start(); } @Override protected int getLayoutId() { return R.layout.fragment_home; } @Override public void onSuccess(Bean bean) { super.onSuccess(bean); datasBeans.addAll(bean.getData().getDatas()); mAdapter.notifyDataSetChanged(); } @Override public void onFail(String msg) { super.onFail(msg); Log.d(TAG, "onFail: "+msg); } }
[ "15904886258@163.com" ]
15904886258@163.com
5bfe8bb8ce6ccfa6ee3a48f23df1447a435be2e3
f62a5552985cd516a440bef1c45fcbac425ef43b
/src/test/java/com/orangehrmlive/demo/testsuite/LoginTest.java
22526fc1493ddec4e6de77d27b4d5601065be22d
[]
no_license
lalu009/orangeHrmJunit
24537c5c8a7f2cfa84a02bf5bc460386b1408622
8a8c1b8cfb9638790267c02c5e29305c6a1d2214
refs/heads/master
2021-05-18T16:15:22.782924
2020-03-30T13:31:25
2020-03-30T13:31:25
251,313,004
0
0
null
2020-10-13T20:46:28
2020-03-30T13:28:02
Java
UTF-8
Java
false
false
786
java
package com.orangehrmlive.demo.testsuite; import com.orangehrmlive.demo.basepage.BasePage; import com.orangehrmlive.demo.pages.HomePage; import com.orangehrmlive.demo.pages.LoginPage; import com.orangehrmlive.demo.testbase.TestBase; import org.junit.Assert; import org.junit.Test; /** * Created by : Gaurang Patel * since : Saturday 28/03/2020 * TIME : 09:32 **/ public class LoginTest extends TestBase { HomePage homePage = new HomePage(); LoginPage loginPage = new LoginPage(); @Test public void userShouldLogInSuccessfully(){ homePage.enterUserName(); homePage.enterPassword(); homePage.clickOnLogIn(); String welComeText = "Welcome Admin"; Assert.assertEquals(welComeText,loginPage.getWelcomeText()); } }
[ "Vaidehi_5489@yahoo.com" ]
Vaidehi_5489@yahoo.com
e3c297f4849395e85017690611cbecdab3e72df1
dd6baf32a8a3c7304c42b3a6bed4b995c6a4fcb4
/src/main/java/be/ac/umons/exercice3/DuplicateStudentException.java
cfad8952a73322ce7bdb316e91b4963aaf967b15
[]
no_license
umons-polytech-odl-2019/odl-tp4-streams-abdoun98
2ed1b2744abce6c2de23e7ab96c1c571d96af0a5
1c997ae718e368690998edeb958a675d5465f029
refs/heads/master
2021-07-17T15:33:41.770066
2020-10-13T18:47:12
2020-10-13T18:47:12
219,941,951
0
0
null
2020-10-13T18:47:14
2019-11-06T07:56:57
Java
UTF-8
Java
false
false
544
java
package be.ac.umons.exercice3; /** * Indicates that you're trying to store a Student with the same registration number. */ public class DuplicateStudentException extends RuntimeException { private final String registrationNumber; /** * @param registrationNumber the registration number that is duplicated. */ public DuplicateStudentException(String registrationNumber) { this.registrationNumber = registrationNumber; } public String getRegistrationNumber() { return registrationNumber; } }
[ "olivier.debauche@umons.ac.be" ]
olivier.debauche@umons.ac.be
e9b9d4575cdf71d223636b7da129366eaf45d9e9
894aa6e6232a204985bd948892253ab639fca912
/Kotlin/GSYGithubAppKotlin/app/build/tmp/kapt3/stubs/debug/com/example/gsygithubappkotlin/common/gsyimageloader/gsygiideloader/GSYGlideCacheKey.java
cad66f6567ac057d61da52c64d372ce8fced6628
[]
no_license
linxiaoxing/MyTest
4bb6a9a4b9d8e23d45537d04d33d26a6feeb5a61
beec69911e8446f349b7ca65d0c68e3c116e0b31
refs/heads/master
2023-08-31T14:49:30.399608
2023-08-05T06:03:46
2023-08-05T06:03:46
44,009,438
3
1
null
2023-03-21T22:45:39
2015-10-10T12:17:47
Kotlin
UTF-8
Java
false
false
2,066
java
package com.example.gsygithubappkotlin.common.gsyimageloader.gsygiideloader; import java.lang.System; /** * Glide原图缓存Key */ @kotlin.Metadata(mv = {1, 1, 15}, bv = {1, 0, 3}, k = 1, d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0001\u00a2\u0006\u0002\u0010\u0005J\u0013\u0010\u0006\u001a\u00020\u00072\b\u0010\b\u001a\u0004\u0018\u00010\tH\u0096\u0002J\b\u0010\n\u001a\u00020\u000bH\u0016J\u0010\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000fH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0001X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0010"}, d2 = {"Lcom/example/gsygithubappkotlin/common/gsyimageloader/gsygiideloader/GSYGlideCacheKey;", "Lcom/bumptech/glide/load/Key;", "id", "", "signature", "(Ljava/lang/String;Lcom/bumptech/glide/load/Key;)V", "equals", "", "o", "", "hashCode", "", "updateDiskCacheKey", "", "messageDigest", "Ljava/security/MessageDigest;", "app_debug"}) public final class GSYGlideCacheKey implements com.bumptech.glide.load.Key { private final java.lang.String id = null; private final com.bumptech.glide.load.Key signature = null; @java.lang.Override() public boolean equals(@org.jetbrains.annotations.Nullable() java.lang.Object o) { return false; } @java.lang.Override() public int hashCode() { return 0; } @java.lang.Override() public void updateDiskCacheKey(@org.jetbrains.annotations.NotNull() java.security.MessageDigest messageDigest) { } public GSYGlideCacheKey(@org.jetbrains.annotations.NotNull() java.lang.String id, @org.jetbrains.annotations.NotNull() com.bumptech.glide.load.Key signature) { super(); } }
[ "1208280008@qq.com" ]
1208280008@qq.com
5996544ef5f4491721344fc00d67b8cab49f088a
90c537b4ae2d574a681a8167fc7ae220837f843a
/HealthyMe2/src/han/com/activity/track/goals/ActivityGoalSettingTime.java
fed34c8e4eab893885b66096e900ddeed80fc2ca
[]
no_license
sakuramanstain/healthyme
7d4b07a4eb5b103329313e651959746aa1fba585
82a96a98a987a056e10d75538a6f78904873007f
refs/heads/master
2021-01-10T03:58:45.627760
2014-11-03T00:16:15
2014-11-03T00:16:15
48,732,199
0
0
null
null
null
null
UTF-8
Java
false
false
4,901
java
package han.com.activity.track.goals; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.Window; import android.widget.AdapterView; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import han.com.R; import han.com.datapool.CurrentGoal; import han.com.db.UserGoal; import han.com.utils.Messages; import han.com.utils.MyWidgets; import han.com.utils.Values; /** * * @author han */ public class ActivityGoalSettingTime extends Activity implements InterfaceClockSetterValue, AdapterView.OnItemClickListener { private static final String className = ActivityGoalSettingTime.class.getName(); private TextView clockValueTextView; private float timeValue; private GoalHelper goalHelper; private DialogGoalFrequency dialog; @Override public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.activity_time_goal_setting); Log.d(className, "onCreate"); MyWidgets.makeSubActivityTitle(this, "Time Goal", R.drawable.ic_list_time); goalHelper = new GoalHelper(this, (TextView) findViewById(R.id.button_back_workout_name), (TextView) findViewById(R.id.button_save_new_goal), (ImageView) findViewById(R.id.button_sport_type_image)); LinearLayout layout = (LinearLayout) findViewById(R.id.clock_container); LayoutParams params = layout.getLayoutParams(); int height = params.height; int width = params.width; boolean scale = false; float scaleVlaue = 0; if (Values.DisplayDensity < 2) { scale = true; scaleVlaue = Values.DisplayDensity / 2.5f; height *= Values.DisplayDensity / 1.8f; width *= Values.DisplayDensity / 1.8f; } params.height = height; params.width = width; ViewClockSetter c = new ViewClockSetter(this, 600, 600, 50, scale, scaleVlaue); layout.addView(c); clockValueTextView = (TextView) findViewById(R.id.act_time_set_mins_text); clockValueTextView.setText("0 min"); c.setValueListener(this); } @Override public void onResume() { super.onResume(); Log.d(className, "onResume"); goalHelper.updateWorkoutDisplay(); if (!goalHelper.isNameReady(false)) { goalHelper.chooseWorkout(); } } @Override public void onDestroy() { super.onDestroy(); Log.d(className, "onDestroy"); } public void newValue(float degree) { float mins = degree / (360 / 60); clockValueTextView.setText((int) mins + " min"); timeValue = (int) mins; goalHelper.resetGoalData(); } public void chooseWorkout(View view) { goalHelper.chooseWorkout(); } public void saveGoal(View view) { if (!goalHelper.isNameReady(true)) { return; } if (timeValue <= 0) { Toast.makeText(this, Messages.ERROR_NO_TIME_VALUE, Toast.LENGTH_SHORT).show(); return; } dialog = new DialogGoalFrequency(this, "And this goal is for"); dialog.setDialogOnItemClickListener(this); dialog.show(); } private void doSaveGoal(String freq) { UserGoal newGoal = CurrentGoal.makeGoal(timeValue, UserGoal.GOAL_IS_VALID, goalHelper.getGoalName(), goalHelper.getGoalOrder(), "min", 0, UserGoal.GOAL_TYPE_TIME, freq); goalHelper.setGoalData(newGoal); } public void useGoal(View view) { if (!goalHelper.isNameReady(true)) { return; } if (!goalHelper.isGoalAlreadySaved()) { if (timeValue <= 0) { Toast.makeText(this, Messages.ERROR_NO_TIME_VALUE, Toast.LENGTH_SHORT).show(); return; } UserGoal newGoal = CurrentGoal.makeGoal(timeValue, UserGoal.GOAL_IS_NOT_VALID, goalHelper.getGoalName(), goalHelper.getGoalOrder(), "min", 0, UserGoal.GOAL_TYPE_TIME, null); goalHelper.setGoalData(newGoal); } goalHelper.useCurrentGoalData(); goalHelper.finishPreviousActivity(); finish(); } public void onItemClick(AdapterView<?> parent, View view, int position, long id) { String freq = (String) DialogGoalFrequency.GoalFrequencies[position][1]; doSaveGoal(freq); if (dialog != null) { dialog.dismiss(); dialog = null; } } }
[ "hanaldo520124@gmail.com" ]
hanaldo520124@gmail.com
7335680be3ab923e79ed115eaa1cb298e0682398
821eea25624740a008311eed3f962f1488684a5a
/src/main/java/company/frequence/LC336.java
1b6d017b0b253b4cc5dad9ec8dba3111ae8073e5
[]
no_license
cchaoqun/Chaoqun_LeetCode
0c45598a0ba89cae9c53725b7b70adf767b226f1
5b2bf42bca66e46e4751455b81b17198b447bb39
refs/heads/master
2023-06-30T20:53:49.779110
2021-08-02T12:45:16
2021-08-02T12:45:16
367,815,848
0
0
null
null
null
null
UTF-8
Java
false
false
2,553
java
package company.frequence; import java.util.*; /** * @author Chaoqun Cheng * @date 2021-07-2021/7/9-13:06 */ public class LC336 { public List<List<Integer>> palindromePairs(String[] words) { List<List<Integer>> res = new ArrayList<>(); for(int i=0;i<words.length; i++){ for(int j=i+1; j<words.length; j++){ if(isPalind(words[i]+words[j])){ res.add(Arrays.asList(i,j)); } if(isPalind(words[j]+words[i])){ res.add(Arrays.asList(j,i)); } } } return res; } private boolean isPalind(String str){ if(str==null || str.length()==0){ return true; } int i = 0; int j = str.length(); while(i<j){ if(str.charAt(i)!=str.charAt(j)){ return false; } i++; j--; } return true; } } class LC336_M2{ List<String> wordRev = new ArrayList<>(); Map<String, Integer> map = new HashMap<>(); public List<List<Integer>> palindromePairs(String[] words) { List<List<Integer>> res = new ArrayList<>(); for(String word : words){ wordRev.add(new StringBuffer(word).reverse().toString()); } for(int i=0; i<words.length; i++){ map.put(wordRev.get(i), i); } int len = words.length; for(int i=0; i<len; i++){ String word = words[i]; int m = word.length(); if(m==0){ continue; } for(int j=0;j<=m; j++){ if(j!=0 && isPalind(word, 0, j-1)){ int right = find(word, j, m-1); if(right!=-1 && right!=i){ res.add(Arrays.asList(right,i)); } } if(isPalind(word, j, m-1)){ int left = find(word, 0, j-1); if(left!=-1 && left!=i){ res.add(Arrays.asList(i,left)); } } } } return res; } private int find(String str, int left, int right){ return map.getOrDefault(str.substring(left, right+1), -1); } private boolean isPalind(String str, int i, int j){ while(i<j){ if(str.charAt(i)!=str.charAt(j)){ return false; } i++; j--; } return true; } }
[ "chengchaoqun@hotmail.com" ]
chengchaoqun@hotmail.com
c1822571b82670e4e2ee34672d8bc35ef273eb5d
1bc34af65ed22ed3af3b1fb2399cc4f0d6fa49e5
/src/com/xgr/tour/ui/FavActivity.java
0996e6eeb4b95ecc5bfba928b8d6b550584a7d3d
[]
no_license
iprocoder/Tour
d6aae04653e1894cd60023c117987e573ccf02d6
cdbd5e22451d3358e8d846e914c3b1b9cbb6425a
refs/heads/master
2021-01-10T09:48:26.063577
2015-06-14T12:28:42
2015-06-14T12:28:42
36,047,828
0
0
null
null
null
null
UTF-8
Java
false
false
1,911
java
package com.xgr.tour.ui; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.view.View; import com.markupartist.android.widget.ActionBar; import com.markupartist.android.widget.ActionBar.Action; import com.xgr.tour.R; import com.xgr.tour.ui.base.BasePageActivity; public class FavActivity extends BasePageActivity { private ActionBar actionbar; @Override protected void setLayoutView() { // TODO Auto-generated method stub setContentView(R.layout.activity_fav); } @Override protected void findViews() { // TODO Auto-generated method stub actionbar = (ActionBar) findViewById(R.id.actionbar_fav); } @Override protected void setupViews(Bundle bundle) { // TODO Auto-generated method stub actionbar.setTitle("我的收藏"); actionbar.setDisplayHomeAsUpEnabled(true); actionbar.setHomeAction(new Action() { @Override public void performAction(View view) { // TODO Auto-generated method stub finish(); } @Override public int getDrawable() { // TODO Auto-generated method stub return R.drawable.icon; } }); setInitialFragment(); } private void setInitialFragment() { FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager .beginTransaction(); fragmentTransaction.add(R.id.content_frame_fav, FavFragment.newInstance()) .commit(); } @Override protected void setListener() { // TODO Auto-generated method stub } @Override protected void fetchData() { // TODO Auto-generated method stub } }
[ "iprocoder@gmail.com" ]
iprocoder@gmail.com
8ee2e5ff6aaa1c9b7b11f25d8ccc7198533ba788
698c4e4195a98660edaa1f5e315dbe71177f210c
/src/main/java/com/pionware/starter/spring5/controller/view/S3ViewController.java
ed547070cabf6dda2cc4a1c704da92d793e52d01
[]
no_license
vnikolaou/spring5-web-demo
6476fbda8b6f702465f40e0f9b0adc43ca241c47
5168844f5e3ba054c89acfd7ba08a4027f837ee5
refs/heads/master
2021-09-12T12:51:34.256281
2018-04-16T22:15:04
2018-04-16T22:15:04
114,407,098
0
0
null
null
null
null
UTF-8
Java
false
false
5,748
java
package com.pionware.starter.spring5.controller.view; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.util.FileCopyUtils; import org.springframework.validation.BindingResult; import org.springframework.validation.Validator; import org.springframework.validation.annotation.Validated; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.pionware.starter.spring5.model.Bucket; import com.pionware.starter.spring5.model.FileBucket; import com.pionware.starter.spring5.service.S3Service; import com.pionware.starter.spring5.validator.FileValidator; @Controller @SessionAttributes("author") public class S3ViewController { @Autowired private S3Service s3Service; @Autowired private LocalValidatorFactoryBean validator; @Autowired private Validator bucketValidator; @Autowired private FileValidator fileValidator; public S3ViewController() { System.out.println("Creating S3Controller..."); } @GetMapping("/buckets.html") public ModelAndView showBucketList(@ModelAttribute("message") String message) { List<Bucket> buckets = s3Service.getBuckets(); if(1==1) throw new RuntimeException("Err !"); ModelAndView mv = new ModelAndView("buckets", "bucket_list", buckets); System.out.println("message=" + message); mv.addObject("message", message); // message is a flash attribute being passed from a redirect via RedirectAttributes mv.addObject("author", "Vagelis Nikolaou"); return mv; } @GetMapping("/addBucket.html") public ModelAndView showBucketForm(ModelMap map) throws Exception { Bucket bucket = new Bucket(); map.addAttribute(bucket); return new ModelAndView("bucket-form"); } @PostMapping("/addBucket.html") public ModelAndView addBook(@Validated @ModelAttribute("bucket") Bucket bucket, BindingResult bindingResult, ModelMap map, RedirectAttributes attrs) throws Exception { // IMPORTANT: RedirectAttributes parameter goes to the end (the order is extremely important !!!!) /* @Validated is for the custom validators while the validator.validate checks the simple validation annotations basically PropertyEditor comes first during Bucket conversion Then the custom validator check comes next Finally the default validation annotations checks come last NOTE: You don't need validator.validate if the @EnableWebMvc is present in SpringDispatcherConfig. In this case the @Validated is enough for all sorts of validations */ //validator.validate(bucket, bindingResult); if(bindingResult.hasErrors()) { return new ModelAndView("bucket-form"); } s3Service.insertBucket(bucket); // this works instead of ModelMap.. also note that there is no need to pass it somehow to ModelAndView object attrs.addFlashAttribute("message", "The bucket " + bucket.getName() + " was added"); String author = (String)map.get("author"); System.out.println("author=" + author); return new ModelAndView("redirect:/buckets.html"); } @GetMapping(value = "/upload.html") public ModelAndView fileUpload(ModelMap model) { FileBucket fileBucket = new FileBucket(); model.addAttribute("fileBucket", fileBucket); return new ModelAndView("upload-form"); } @PostMapping(value = "/upload.html") public ModelAndView fileUpload(@Validated FileBucket fileBucket, BindingResult bindingResult, ModelMap model) throws IOException { if (bindingResult.hasErrors()) { System.out.println("validation errors"); return new ModelAndView("upload-form"); } else { System.out.println("Fetching file"); MultipartFile multipartFile = fileBucket.getFile(); // Now do something with file... try { FileCopyUtils.copy(fileBucket.getFile().getBytes(), new File(UPLOAD_LOCATION + fileBucket.getFile().getOriginalFilename())); String fileName = multipartFile.getOriginalFilename(); model.addAttribute("fileName", fileName ); } catch(Exception ex) { ex.printStackTrace(); } return new ModelAndView("upload-form"); } } @ModelAttribute("zones") public List<String>availableZones() { List<String> zones = new ArrayList<String>(); zones.add("Zone1"); zones.add("Zone2"); return zones; } @InitBinder({"bucket"}) private void initBinder(WebDataBinder webDataBinder) { webDataBinder.addValidators(bucketValidator); // add custom validator apart the basic ones from annotations } @InitBinder("fileBucket") protected void initBinderFileBucket(WebDataBinder binder) { binder.setValidator(fileValidator); } private static String UPLOAD_LOCATION="/home/vnik/my/"; }
[ "vnikolaou12@gmail.com" ]
vnikolaou12@gmail.com
e12a983dc334bc80879dd6ff93e4537b0a480897
34d4b0fd92cb9ede9c7ffbc665fc9285ee80e2f0
/app/src/main/java/com/kfc/julianalmanza/kfc/sandwiches_fragment.java
dce56130f90da4076b745e7887c5217444b4a7dd
[]
no_license
julian-93/KFC-2.0
7bf8de624c19ffad584721844c46bb843bbfa1a6
6f81899c502d0791796289fd9d81366592c4ba38
refs/heads/master
2021-01-12T11:57:29.509138
2016-09-22T01:18:05
2016-09-22T01:18:05
68,871,823
0
0
null
null
null
null
UTF-8
Java
false
false
672
java
package com.kfc.julianalmanza.kfc; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. */ public class sandwiches_fragment extends Fragment { public sandwiches_fragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_sandwiches, container, false); } }
[ "julian david almaza velasquez" ]
julian david almaza velasquez
37cb083ba7ae2b09bd57280a2e5f437e08e4b7d5
ce4308551fb60364ddb0b845d3f3623ecabc84f6
/src/Chapter_6/Chapter6_05.java
2388f052500e69f9cee77473f43e1c401d375da5
[]
no_license
damarshen/Assignment2
5d4d7b2838ee2e05844fac87c23488b5f1854ea1
a6d53b9c2da2ef60e68f922ab3ae416c4d3d5eef
refs/heads/master
2021-08-09T02:56:25.699435
2017-11-12T01:13:06
2017-11-12T01:13:06
107,912,471
0
0
null
null
null
null
UTF-8
Java
false
false
867
java
package Chapter_6; import java.util.Scanner; public class Chapter6_05 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter three numberss: "); double num1 = input.nextDouble(); double num2 = input.nextDouble(); double num3 = input.nextDouble(); displaySortednumbers(num1, num2, num3); } public static void displaySortednumbers(double num1, double num2, double num3) { double empty; if (num2 < num1 && num2 < num3){ empty = num1; num1 = num2; num2 = empty; } else if (num3 < num1 && num3 < num2) { empty = num1; num1 = num3; num3 = empty; } else if (num3 < num2) { empty = num2; num2 = num3; num3 = empty; } System.out.println("the numberss in increasing order are: " + num1 + ", " + num2 + ", " + num3); } }
[ "ousainouj@gmail.com" ]
ousainouj@gmail.com
96cec5771b71df23494d804086c794471ea9e091
29b944ddc5eb889ee922eecf7c3f6ee736200b77
/gulimall-product/src/main/java/com/atguigu/gulimall/product/controller/CategoryBrandRelationController.java
a88cd76059808b0733bde20447668a2ec897faac
[]
no_license
songjiqing/gulimall
36b40f1c1ec1fa39e42b3ca21e6af619813b4b84
7c281b324a8beacc92937e8c08f0749c3f13bcdb
refs/heads/main
2023-03-01T16:35:00.315643
2021-02-02T14:07:12
2021-02-02T14:07:12
331,020,985
0
0
null
null
null
null
UTF-8
Java
false
false
2,222
java
package com.atguigu.gulimall.product.controller; import java.util.Arrays; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.atguigu.gulimall.product.entity.CategoryBrandRelationEntity; import com.atguigu.gulimall.product.service.CategoryBrandRelationService; import com.atguigu.common.utils.PageUtils; import com.atguigu.common.utils.R; /** * 品牌分类关联 * * @author songjiqing * @email 1256478037@qq.com * @date 2021-01-24 10:48:05 */ @RestController @RequestMapping("product/categorybrandrelation") public class CategoryBrandRelationController { @Autowired private CategoryBrandRelationService categoryBrandRelationService; /** * 列表 */ @RequestMapping("/list") public R list(@RequestParam Map<String, Object> params){ PageUtils page = categoryBrandRelationService.queryPage(params); return R.ok().put("page", page); } /** * 信息 */ @RequestMapping("/info/{id}") public R info(@PathVariable("id") Long id){ CategoryBrandRelationEntity categoryBrandRelation = categoryBrandRelationService.getById(id); return R.ok().put("categoryBrandRelation", categoryBrandRelation); } /** * 保存 */ @RequestMapping("/save") public R save(@RequestBody CategoryBrandRelationEntity categoryBrandRelation){ categoryBrandRelationService.save(categoryBrandRelation); return R.ok(); } /** * 修改 */ @RequestMapping("/update") public R update(@RequestBody CategoryBrandRelationEntity categoryBrandRelation){ categoryBrandRelationService.updateById(categoryBrandRelation); return R.ok(); } /** * 删除 */ @RequestMapping("/delete") public R delete(@RequestBody Long[] ids){ categoryBrandRelationService.removeByIds(Arrays.asList(ids)); return R.ok(); } }
[ "1256478037@qq.com" ]
1256478037@qq.com
e1cbaaeab276aac978bebab92d15928e55bface3
ba99e7f63c669151036108f4eb5c975d43f2d8ae
/app/src/main/java/com/wma/ozfoodhunter/Utils/OnReceiverEvent.java
66ef0b2b4c84a11a8b3ac4902f702e3055a05384
[]
no_license
JayattamaPrusty/OZFoodHunter2
30938e5568d156cb4e27e74f222daebba9884bc3
7c79dd4a5bc335262fef06b9b3bb70abdad987c1
refs/heads/master
2021-01-20T03:53:31.055433
2017-04-29T14:57:03
2017-04-29T14:57:03
89,600,022
0
0
null
null
null
null
UTF-8
Java
false
false
314
java
package com.wma.ozfoodhunter.Utils; /** * Created by lovekushvishwakarma on 08/12/16. */ public class OnReceiverEvent { private String itemcount; public OnReceiverEvent(String itemcount) { this.itemcount = itemcount; } public String getItemcount() { return itemcount; } }
[ "contact.jprusty@gmail.com" ]
contact.jprusty@gmail.com
7ca87ab7b7361dba3593650e0064a8f353320a74
28d668061f66ad7e42e332324ffeddd8a3db7373
/src/main/java/com/simplify/marketplace/domain/SkillsMaster.java
d7aff7bcbb6dcb29b63b94c95e855e2fcb011b46
[]
no_license
ashwaqkhan/project1
638524a912e7b13bae0f07e8bbbb882e447a578c
43e452a2b3b8046425a22f69911c678d21627fea
refs/heads/main
2023-07-10T15:43:15.123266
2021-08-16T15:52:22
2021-08-16T15:52:22
396,867,920
0
0
null
2021-08-16T16:03:24
2021-08-16T16:03:24
null
UTF-8
Java
false
false
3,165
java
package com.simplify.marketplace.domain; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import java.io.Serializable; import java.util.HashSet; import java.util.Set; import javax.persistence.*; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; /** * A SkillsMaster. */ @Entity @Table(name = "skills_master") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) public class SkillsMaster implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(name = "skill_name") private String skillName; @ManyToMany(mappedBy = "skills") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @JsonIgnoreProperties( value = { "customUser", "files", "educations", "certificates", "employments", "portfolios", "refereces", "jobPreferences", "skills", }, allowSetters = true ) private Set<Worker> workers = new HashSet<>(); // jhipster-needle-entity-add-field - JHipster will add fields here public Long getId() { return id; } public void setId(Long id) { this.id = id; } public SkillsMaster id(Long id) { this.id = id; return this; } public String getSkillName() { return this.skillName; } public SkillsMaster skillName(String skillName) { this.skillName = skillName; return this; } public void setSkillName(String skillName) { this.skillName = skillName; } public Set<Worker> getWorkers() { return this.workers; } public SkillsMaster workers(Set<Worker> workers) { this.setWorkers(workers); return this; } public SkillsMaster addWorker(Worker worker) { this.workers.add(worker); worker.getSkills().add(this); return this; } public SkillsMaster removeWorker(Worker worker) { this.workers.remove(worker); worker.getSkills().remove(this); return this; } public void setWorkers(Set<Worker> workers) { if (this.workers != null) { this.workers.forEach(i -> i.removeSkill(this)); } if (workers != null) { workers.forEach(i -> i.addSkill(this)); } this.workers = workers; } // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof SkillsMaster)) { return false; } return id != null && id.equals(((SkillsMaster) o).id); } @Override public int hashCode() { // see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/ return getClass().hashCode(); } // prettier-ignore @Override public String toString() { return "SkillsMaster{" + "id=" + getId() + ", skillName='" + getSkillName() + "'" + "}"; } }
[ "chaitanyaprasad794@gmail.com" ]
chaitanyaprasad794@gmail.com
77a3db494431b9c2324419aadd78c2db61250799
0c4c0a5554ef4cb02211ec78b1d1a2b47acca30e
/MyApplication/app/src/main/java/com/example/myapplication/Curtain.java
706c4982910e95dd7fe0b941942139b496d30d44
[]
no_license
B18022022/luoyu
3bb235dde4a9489a928f79641c58bf74b0733437
45291fbe8cf5b67e60e0b10acf00d2617d879be7
refs/heads/master
2022-06-07T05:45:00.856294
2022-05-14T09:17:01
2022-05-14T09:17:01
196,904,088
0
0
null
null
null
null
UTF-8
Java
false
false
4,296
java
package com.example.myapplication; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.widget.Toast; import java.io.IOException; public class Curtain extends AppCompatActivity { Httpconnect httpconnect = new Httpconnect(); String dId = "012345678"; //请修改为你的设备ID String akey = "0123456789012345678901234567"; //请修改为你的api_key boolean flag; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_curtain); Toolbar toolbar = findViewById(R.id.curtain_toolbar); toolbar.setTitle("窗帘设备"); } public void on_click(View view) throws IOException { if (Interval.isFastClickonCurtain()) { Toast.makeText(Curtain.this, "发送指令过快,请稍后", Toast.LENGTH_SHORT).show(); return; } SharedPreferences sp = getSharedPreferences("Flag", Context.MODE_PRIVATE); flag = sp.getBoolean("CurtainFlag", false); if (flag) { new AlertDialog.Builder(Curtain.this).setTitle("警告")//设置对话框标题 .setMessage("系统监测为开启状态,是否继续开启?") .setNegativeButton("否", new DialogInterface.OnClickListener() {//添加返回按钮 @Override public void onClick(DialogInterface dialog, int which) {//确定按钮的响应事件,点击事件没写,自己添加 } }).setPositiveButton("是", new DialogInterface.OnClickListener() {//添加确定按钮 @Override public void onClick(DialogInterface dialog, int which) {//响应事件,点击事件没写,自己添加 httpconnect.onSync(Curtain.this, dId, akey); } }).show();//在按键响应事件中显示此对话框 } else { httpconnect.onSync(Curtain.this, dId, akey); sp.edit().putBoolean("CurtainFlag", true).apply();//apply才会写入xml配置文件 } } public void off_click(View view) throws IOException { if (Interval.isFastClickonCurtain()) { Toast.makeText(Curtain.this, "发送指令过快,请稍后", Toast.LENGTH_SHORT).show(); return; } SharedPreferences sp = getSharedPreferences("Flag", Context.MODE_PRIVATE); flag = sp.getBoolean("CurtainFlag", false); if (!flag) { new AlertDialog.Builder(Curtain.this).setTitle("警告")//设置对话框标题 .setMessage("系统监测为关闭状态,是否继续关闭?") .setNegativeButton("否", new DialogInterface.OnClickListener() {//添加返回按钮 @Override public void onClick(DialogInterface dialog, int which) {//确定按钮的响应事件,点击事件没写,自己添加 } }).setPositiveButton("是", new DialogInterface.OnClickListener() {//添加确定按钮 @Override public void onClick(DialogInterface dialog, int which) {//响应事件,点击事件没写,自己添加 httpconnect.offSync(Curtain.this, dId, akey); } }).show();//在按键响应事件中显示此对话框 } else { httpconnect.offSync(Curtain.this, dId, akey); sp.edit().putBoolean("CurtainFlag", false).apply();//apply才会写入xml配置文件 } } public void return_click(View view) { Intent intent = new Intent(Curtain.this, MainActivity.class); startActivity(intent); } }
[ "noreply@github.com" ]
B18022022.noreply@github.com
d1a15d011f7a5837fd2c5f339640c03e0bd05392
ff314b7f4ac535ca24b549ed23a49f22c493f02c
/src/test/java/com/mycompany/myapp/web/rest/CompanyResourceIntTest.java
2388e375c303d7fd8dd1e51787e661d5b322d0a2
[]
no_license
yazquez/jhispter-mapstruct-error-fixed
300ab0134b9be447f7ed06a6e1dad70256e421fd
a2dd6075be53172913e0d5ecc0de15409e99b5fc
refs/heads/master
2021-01-13T16:22:50.343418
2017-01-23T17:35:06
2017-01-23T17:35:06
79,827,664
0
0
null
null
null
null
UTF-8
Java
false
false
9,478
java
package com.mycompany.myapp.web.rest; import com.mycompany.myapp.PocApp; import com.mycompany.myapp.domain.Company; import com.mycompany.myapp.repository.CompanyRepository; import com.mycompany.myapp.service.CompanyService; import com.mycompany.myapp.service.dto.CompanyDTO; import com.mycompany.myapp.service.mapper.CompanyMapper; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import javax.inject.Inject; import javax.persistence.EntityManager; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.Matchers.hasItem; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Test class for the CompanyResource REST controller. * * @see CompanyResource */ @RunWith(SpringRunner.class) @SpringBootTest(classes = PocApp.class) public class CompanyResourceIntTest { private static final String DEFAULT_FISCAL_NAME = "AAAAAAAAAA"; private static final String UPDATED_FISCAL_NAME = "BBBBBBBBBB"; @Inject private CompanyRepository companyRepository; @Inject private CompanyMapper companyMapper; @Inject private CompanyService companyService; @Inject private MappingJackson2HttpMessageConverter jacksonMessageConverter; @Inject private PageableHandlerMethodArgumentResolver pageableArgumentResolver; @Inject private EntityManager em; private MockMvc restCompanyMockMvc; private Company company; @Before public void setup() { MockitoAnnotations.initMocks(this); CompanyResource companyResource = new CompanyResource(); ReflectionTestUtils.setField(companyResource, "companyService", companyService); this.restCompanyMockMvc = MockMvcBuilders.standaloneSetup(companyResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setMessageConverters(jacksonMessageConverter).build(); } /** * Create an entity for this test. * * This is a static method, as tests for other entities might also need it, * if they test an entity which requires the current entity. */ public static Company createEntity(EntityManager em) { Company company = new Company() .fiscalName(DEFAULT_FISCAL_NAME); return company; } @Before public void initTest() { company = createEntity(em); } @Test @Transactional public void createCompany() throws Exception { int databaseSizeBeforeCreate = companyRepository.findAll().size(); // Create the Company CompanyDTO companyDTO = companyMapper.companyToCompanyDTO(company); restCompanyMockMvc.perform(post("/api/companies") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(companyDTO))) .andExpect(status().isCreated()); // Validate the Company in the database List<Company> companyList = companyRepository.findAll(); assertThat(companyList).hasSize(databaseSizeBeforeCreate + 1); Company testCompany = companyList.get(companyList.size() - 1); assertThat(testCompany.getFiscalName()).isEqualTo(DEFAULT_FISCAL_NAME); } @Test @Transactional public void createCompanyWithExistingId() throws Exception { int databaseSizeBeforeCreate = companyRepository.findAll().size(); // Create the Company with an existing ID Company existingCompany = new Company(); existingCompany.setId(1L); CompanyDTO existingCompanyDTO = companyMapper.companyToCompanyDTO(existingCompany); // An entity with an existing ID cannot be created, so this API call must fail restCompanyMockMvc.perform(post("/api/companies") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(existingCompanyDTO))) .andExpect(status().isBadRequest()); // Validate the Alice in the database List<Company> companyList = companyRepository.findAll(); assertThat(companyList).hasSize(databaseSizeBeforeCreate); } @Test @Transactional public void checkFiscalNameIsRequired() throws Exception { int databaseSizeBeforeTest = companyRepository.findAll().size(); // set the field null company.setFiscalName(null); // Create the Company, which fails. CompanyDTO companyDTO = companyMapper.companyToCompanyDTO(company); restCompanyMockMvc.perform(post("/api/companies") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(companyDTO))) .andExpect(status().isBadRequest()); List<Company> companyList = companyRepository.findAll(); assertThat(companyList).hasSize(databaseSizeBeforeTest); } @Test @Transactional public void getAllCompanies() throws Exception { // Initialize the database companyRepository.saveAndFlush(company); // Get all the companyList restCompanyMockMvc.perform(get("/api/companies?sort=id,desc")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].id").value(hasItem(company.getId().intValue()))) .andExpect(jsonPath("$.[*].fiscalName").value(hasItem(DEFAULT_FISCAL_NAME.toString()))); } @Test @Transactional public void getCompany() throws Exception { // Initialize the database companyRepository.saveAndFlush(company); // Get the company restCompanyMockMvc.perform(get("/api/companies/{id}", company.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.id").value(company.getId().intValue())) .andExpect(jsonPath("$.fiscalName").value(DEFAULT_FISCAL_NAME.toString())); } @Test @Transactional public void getNonExistingCompany() throws Exception { // Get the company restCompanyMockMvc.perform(get("/api/companies/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } @Test @Transactional public void updateCompany() throws Exception { // Initialize the database companyRepository.saveAndFlush(company); int databaseSizeBeforeUpdate = companyRepository.findAll().size(); // Update the company Company updatedCompany = companyRepository.findOne(company.getId()); updatedCompany .fiscalName(UPDATED_FISCAL_NAME); CompanyDTO companyDTO = companyMapper.companyToCompanyDTO(updatedCompany); restCompanyMockMvc.perform(put("/api/companies") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(companyDTO))) .andExpect(status().isOk()); // Validate the Company in the database List<Company> companyList = companyRepository.findAll(); assertThat(companyList).hasSize(databaseSizeBeforeUpdate); Company testCompany = companyList.get(companyList.size() - 1); assertThat(testCompany.getFiscalName()).isEqualTo(UPDATED_FISCAL_NAME); } @Test @Transactional public void updateNonExistingCompany() throws Exception { int databaseSizeBeforeUpdate = companyRepository.findAll().size(); // Create the Company CompanyDTO companyDTO = companyMapper.companyToCompanyDTO(company); // If the entity doesn't have an ID, it will be created instead of just being updated restCompanyMockMvc.perform(put("/api/companies") .contentType(TestUtil.APPLICATION_JSON_UTF8) .content(TestUtil.convertObjectToJsonBytes(companyDTO))) .andExpect(status().isCreated()); // Validate the Company in the database List<Company> companyList = companyRepository.findAll(); assertThat(companyList).hasSize(databaseSizeBeforeUpdate + 1); } @Test @Transactional public void deleteCompany() throws Exception { // Initialize the database companyRepository.saveAndFlush(company); int databaseSizeBeforeDelete = companyRepository.findAll().size(); // Get the company restCompanyMockMvc.perform(delete("/api/companies/{id}", company.getId()) .accept(TestUtil.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()); // Validate the database is empty List<Company> companyList = companyRepository.findAll(); assertThat(companyList).hasSize(databaseSizeBeforeDelete - 1); } }
[ "yazquez@gmail.com" ]
yazquez@gmail.com
8b0f8d12be7f59b461b21fd83d7df7eb3a49cbfd
e4e2af05f935ce4bfd667b16d68ef10c401b707a
/src/org/andrew/plugin/form/EntryHeader.java
e0f0934ccf411e3374f4aed9c208cc60933a697b
[]
no_license
han-br/Butter-Knife-Plugin
e01d699bf9ba4f1a69269d3e02b7f3d235a7bd2e
d82f8d5469112165a93b351c0a3d22ccb2785872
refs/heads/master
2021-01-06T16:35:30.005866
2020-02-18T15:51:49
2020-02-18T15:51:49
241,399,950
1
0
null
null
null
null
UTF-8
Java
false
false
2,601
java
package org.andrew.plugin.form; import org.andrew.plugin.iface.OnCheckBoxStateChangedListener; import javax.swing.*; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; public class EntryHeader extends JPanel { protected JCheckBox mAllCheck; protected JLabel mType; protected JLabel mID; protected JLabel mEvent; protected JLabel mName; protected OnCheckBoxStateChangedListener mAllListener; public void setAllListener(final OnCheckBoxStateChangedListener onStateChangedListener) { this.mAllListener = onStateChangedListener; } public EntryHeader() { mAllCheck = new JCheckBox(); mAllCheck.setPreferredSize(new Dimension(40, 26)); mAllCheck.setSelected(false); mAllCheck.addItemListener(new AllCheckListener()); mType = new JLabel(); mType.setPreferredSize(new Dimension(100, 26)); // mType.setFont(new Font(mType.getFont().getFontName(), Font.BOLD, mType.getFont().getSize())); mType.setText("类型"); mID = new JLabel(); mID.setPreferredSize(new Dimension(100, 26)); mID.setText("ID"); // mID.setFont(new Font(mID.getFont().getFontName(), Font.BOLD, mID.getFont().getSize())); mEvent = new JLabel(); mEvent.setPreferredSize(new Dimension(100, 26)); mEvent.setText("事件"); // mEvent.setFont(new Font(mEvent.getFont().getFontName(), Font.BOLD, mEvent.getFont().getSize())); mName = new JLabel(); mName.setPreferredSize(new Dimension(100, 26)); mName.setText("变量名"); // mName.setFont(new Font(mName.getFont().getFontName(), Font.BOLD, mName.getFont().getSize())); setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); add(Box.createRigidArea(new Dimension(1, 0))); add(mAllCheck); add(Box.createRigidArea(new Dimension(11, 0))); add(mType); add(Box.createRigidArea(new Dimension(12, 0))); add(mID); add(Box.createRigidArea(new Dimension(12, 0))); add(mEvent); add(Box.createRigidArea(new Dimension(22, 0))); add(mName); add(Box.createHorizontalGlue()); } public JCheckBox getAllCheck() { return mAllCheck; } // classes private class AllCheckListener implements ItemListener { @Override public void itemStateChanged(ItemEvent itemEvent) { if (mAllListener != null) { mAllListener.changeState(itemEvent.getStateChange() == ItemEvent.SELECTED); } } } }
[ "hanbingran1@163.com" ]
hanbingran1@163.com
81a2863f52e393655beee25ad65bd101aa9d7d91
e6d5d0a2ebc1d8a2ecb7edc78daf550d1e0e0b3c
/14/Player.java
9df172ba71a2a7dda9ebe0385f5b05f2659bfe7f
[]
no_license
nchong128/ThinkJava
d62848963b85e97e8887b295c182313364a6f834
d85e65bd7d99f5cef72f1161897dc89111a60409
refs/heads/master
2021-09-27T17:38:09.015459
2018-11-10T04:03:28
2018-11-10T04:03:28
137,901,259
0
0
null
null
null
null
UTF-8
Java
false
false
2,367
java
/** * Player class is used to encapsulate player strategy */ public class Player { private String name; private Hand hand; public Player(String name) { this.name = name; this.hand = new Hand(name); } /** * Decides which card to discard during each turn * First parameter is reference to Eights object that encapsulates * the state of the game * Second parameter, prev, is the card on top of the discard pile */ public Card play(Eights eights, Card prev) { Card card = searchForMatch(prev); if (card == null) { card = drawForMatch(eights, prev); } return card; } /** * Looks in the player's hand for a card that matches the previous played cardd */ public Card searchForMatch(Card prev) { for (int i = 0; i < hand.size(); i++) { Card card = hand.getCard(i); if (cardMatches(card, prev)) { return hand.popCard(i); } } return null; } /** * Keeps drawing until it finds a match */ public Card drawForMatch(Eights eights, Card prev) { while (true) { Card card = eights.draw(); System.out.println(name + " draws " + card); if (cardMatches(card, prev)) { return card; } hand.addCard(card); } } /** * A static method that checks if a card matches another card */ public static boolean cardMatches(Card card1, Card card2) { if (card1.getSuit() == card2.getSuit()) { return true; } if (card1.getRank() == card2.getRank()) { return true; } if (card1.getRank() == 8) { return true; } return false; } /** * Computes penalty points for cards left in the player's hand * at the end of the game */ public int score() { int sum = 0; for (int i = 0; i < hand.size(); i++) { Card card = hand.getCard(i); int rank = card.getRank(); if (rank == 8) { sum -= 20; } else if (rank > 10) { sum -= 10; } else { sum -= rank; } } return sum; } }
[ "nchong128@gmail.com" ]
nchong128@gmail.com
12131307842583a421cfb43358c002a0c993ddfe
f88432e262030f1b82a1c6edab0d569e236387b5
/Java Programy/Software Design Patterns/src/main/java/pl/patterns/chor1/bank/PinPayment.java
13c4cf67e7929fca2a916c53f87a6f2e26f97d03
[]
no_license
FilSos/SDA
20389b168eadbeaab3ba85079ab99422e58ecad3
3fd11684961730567161205a54b0eaf3af5cd9eb
refs/heads/master
2021-08-19T14:21:18.002896
2017-11-26T16:25:33
2017-11-26T16:25:33
96,998,590
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package pl.patterns.chor1.bank; import java.util.Scanner; public class PinPayment extends Payment { private final Double MAX_PAYMENT = 500d; public PinPayment(Account account) { super(account); } @Override protected Double getMaxAmount() { return MAX_PAYMENT; } @Override protected boolean handlePayment(Double amount) { System.out.println("Your pin: "); Scanner sc = new Scanner(System.in); int pinFromUser = sc.nextInt(); return account.pay(amount, pinFromUser); } }
[ "filip.sosnowski88@gmail.com" ]
filip.sosnowski88@gmail.com
6403b34fabbe80a9c58b372a9122b7358476caa1
49b4cb79c910a17525b59d4b497a09fa28a9e3a8
/parserValidCheck/src/main/java/com/ke/css/cimp/fwb/fwb17/Rule_CUSTOMS_ORIGIN_CODE.java
c1776bfd836681e934e363ea079127f62d7b6108
[]
no_license
ganzijo/koreanair
a7d750b62cec2647bfb2bed4ca1bf8648d9a447d
e980fb11bc4b8defae62c9d88e5c70a659bef436
refs/heads/master
2021-04-26T22:04:17.478461
2018-03-06T05:59:32
2018-03-06T05:59:32
124,018,887
0
0
null
null
null
null
UTF-8
Java
false
false
2,319
java
package com.ke.css.cimp.fwb.fwb17; /* ----------------------------------------------------------------------------- * Rule_CUSTOMS_ORIGIN_CODE.java * ----------------------------------------------------------------------------- * * Producer : com.parse2.aparse.Parser 2.5 * Produced : Tue Mar 06 10:25:52 KST 2018 * * ----------------------------------------------------------------------------- */ import java.util.ArrayList; final public class Rule_CUSTOMS_ORIGIN_CODE extends Rule { public Rule_CUSTOMS_ORIGIN_CODE(String spelling, ArrayList<Rule> rules) { super(spelling, rules); } public Object accept(Visitor visitor) { return visitor.visit(this); } public static Rule_CUSTOMS_ORIGIN_CODE parse(ParserContext context) { context.push("CUSTOMS_ORIGIN_CODE"); boolean parsed = true; int s0 = context.index; ParserAlternative a0 = new ParserAlternative(s0); ArrayList<ParserAlternative> as1 = new ArrayList<ParserAlternative>(); parsed = false; { int s1 = context.index; ParserAlternative a1 = new ParserAlternative(s1); parsed = true; if (parsed) { boolean f1 = true; @SuppressWarnings("unused") int c1 = 0; for (int i1 = 0; i1 < 2 && f1; i1++) { Rule rule = Rule_Typ_Mixed.parse(context); if ((f1 = rule != null)) { a1.add(rule, context.index); c1++; } } parsed = true; } if (parsed) { as1.add(a1); } context.index = s1; } ParserAlternative b = ParserAlternative.getBest(as1); parsed = b != null; if (parsed) { a0.add(b.rules, b.end); context.index = b.end; } Rule rule = null; if (parsed) { rule = new Rule_CUSTOMS_ORIGIN_CODE(context.text.substring(a0.start, a0.end), a0.rules); } else { context.index = s0; } context.pop("CUSTOMS_ORIGIN_CODE", parsed); return (Rule_CUSTOMS_ORIGIN_CODE)rule; } } /* ----------------------------------------------------------------------------- * eof * ----------------------------------------------------------------------------- */
[ "wrjo@wrjo-PC" ]
wrjo@wrjo-PC
3bc9b770e295cc9d25ea6cf61d4cdd313f45183c
7ff5c66186590e8ec18718bf9b5acd2f8222d688
/WarpAPBR/src/rush/warpapbr/command/FinalCommand.java
d9da49b0eadfeba0debc5f5bf1e012aa646c3b76
[]
no_license
abandonadoRUSHyoutuber/ProjetosAbandonadosDoRUSH
4ebe35b4dd5abd1ab664c804b627365a68d476a4
c5c9281626475f284ba2e782b654acafb0ae3aa6
refs/heads/master
2022-09-29T18:08:09.591655
2020-12-13T15:12:23
2020-12-13T15:12:23
199,115,633
0
0
null
2022-09-08T01:12:34
2019-07-27T04:31:48
Java
UTF-8
Java
false
false
2,250
java
package rush.warpapbr.command; import java.util.Map; import java.util.Random; import org.bukkit.Location; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import rush.warpapbr.config.Config; import rush.warpapbr.utils.CommandUtils; public class FinalCommand extends Config implements CommandExecutor { private Map<String, Location> locations; private String name; private String command; private final Random random = new Random(); protected FinalCommand(String command, String name) { this.locations = CommandUtils.loadLocations(command); this.command = command; this.name = name; } @Override public boolean onCommand(CommandSender s, Command cmd, String lbl, String[] args) { if (!(s instanceof Player)) { s.sendMessage(CONSOLE_ERRO); return true; } final Player p = (Player) s; if (args.length > 0 && s.hasPermission("warp.admin")) { if (args.length != 2) { p.sendMessage(INCORRETO.replace("%comando%", cmd.getName())); return true; } if (args[0].equalsIgnoreCase("set")) { CommandUtils.setLocation(command, p.getLocation(), args[1]); locations.put(args[1], p.getLocation()); p.sendMessage(CRIADA.replace("%pos%", args[1])); return true; } else if (args[0].equalsIgnoreCase("del")) { CommandUtils.deleteLocation(command, args[1]); locations.remove(args[1]); p.sendMessage(DELETADA.replace("%pos%", args[1])); return true; } else { p.sendMessage(INCORRETO.replace("%comando%", cmd.getName())); return true; } } else { if (locations.isEmpty()) { p.sendMessage(ERRO.replace("%nome%", name)); } else { p.teleport(random(), TeleportCause.COMMAND); p.sendMessage(TELEPORTADO.replace("%nome%", name)); } } return true; } private Location random() { int size = locations.values().size(); int item = random.nextInt(size); int i = 0; for (Location obj : locations.values()) { if (i == item) { return obj; } i++; } return null; } }
[ "noreply@github.com" ]
abandonadoRUSHyoutuber.noreply@github.com
e87f6ca887b5785f3db00f4ea0ffbd3b1b9dc82a
ad64a14fac1f0d740ccf74a59aba8d2b4e85298c
/linkwee-supermarket/src/main/java/com/linkwee/api/controller/cfp/CrmCfpLevelRecordTempController.java
02dcb3c436c2222ca322c6adeff25fed23086968
[]
no_license
zhangjiayin/supermarket
f7715aa3fdd2bf202a29c8683bc9322b06429b63
6c37c7041b5e1e32152e80564e7ea4aff7128097
refs/heads/master
2020-06-10T16:57:09.556486
2018-10-30T07:03:15
2018-10-30T07:03:15
193,682,975
0
1
null
2019-06-25T10:03:03
2019-06-25T10:03:03
null
UTF-8
Java
false
false
6,834
java
package com.linkwee.api.controller.cfp; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; import javax.annotation.Resource; import javax.validation.ConstraintViolation; import javax.validation.Validation; import javax.validation.Validator; import javax.validation.ValidatorFactory; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.ConvertUtils; import org.apache.commons.beanutils.converters.DateConverter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.propertyeditors.StringTrimmerEditor; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.linkwee.core.base.api.BaseResponse; import com.linkwee.core.datatable.DataInfo; import com.linkwee.core.datatable.DataResult; import com.linkwee.core.datatable.DataTable; import com.linkwee.core.datatable.DataTableReturn; import com.linkwee.core.datatable.ErrorField; import com.linkwee.core.util.JsonUtils; import com.linkwee.web.model.CrmCfpLevelRecordTemp; import com.linkwee.web.response.CfpLevelWarningResp; import com.linkwee.web.service.CrmCfpLevelRecordTempService; import com.linkwee.xoss.api.AppRequestHead; import com.linkwee.xoss.helper.JsonWebTokenHepler; import com.linkwee.xoss.interceptors.DateConvertEditor; import com.linkwee.xoss.util.AppResponseUtil; import com.linkwee.xoss.util.RequestLogging; /** * * @描述: CrmCfpLevelRecordTempController控制器 * * @创建人: liqimoon * * @创建时间:2017年04月10日 13:51:28 * * Copyright (c) 深圳领会科技有限公司-版权所有 */ @Controller @RequestMapping(value = "/api/cim/crmcfplevelrecordtemp") @RequestLogging("CrmCfpLevelRecordTempController控制器") public class CrmCfpLevelRecordTempController { private static final Logger LOGGER = LoggerFactory.getLogger(CrmCfpLevelRecordTempController.class); @Resource private CrmCfpLevelRecordTempService crmCfpLevelRecordTempService; /** * 转换器 * * @param binder */ @InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(Date.class, new DateConvertEditor()); binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); } /** * 查看列表 */ @RequestMapping(value="/list", method=RequestMethod.GET) @RequestLogging("查看列表页面") public String crmCfpLevelRecordTemp(Model model) { return "crmcfplevelrecordtemp/crmcfplevelrecordtemp-list"; } /** * datatables<br> * @return */ @RequestMapping(value="/list", method = RequestMethod.POST) @ResponseBody @RequestLogging("查看列表") public DataTableReturn getCrmCfpLevelRecordTemps(@RequestParam String _dt_json) { LOGGER.debug("CrmCfpLevelRecordTemp list _dt_json={}", _dt_json); DataTable dataTable = JsonUtils.fromJsonToObject(_dt_json, DataTable.class); dataTable.initOrders(); DataTableReturn tableReturn = crmCfpLevelRecordTempService.selectByDatatables(dataTable); return tableReturn; } @RequestMapping(value = "/save", method = RequestMethod.POST) @ResponseBody @RequestLogging("CUD操作") public DataResult save(@RequestParam String rows) { DataInfo df = JsonUtils.fromJsonToObject(rows, DataInfo.class); @SuppressWarnings("unchecked") Map<String,CrmCfpLevelRecordTemp> map = (Map<String, CrmCfpLevelRecordTemp>) df.getData(); DataResult dr = new DataResult(); List<CrmCfpLevelRecordTemp> datas = new ArrayList<CrmCfpLevelRecordTemp>(); List<ErrorField> errors = new ArrayList<ErrorField>(); ValidatorFactory factory = Validation.buildDefaultValidatorFactory(); Validator validator = factory.getValidator(); //下面用到bean属性copy,需要对日期进行转换 DateConverter dateConverter = new DateConverter(); dateConverter.setPattern("yyyy-MM-dd HH:mm:ss"); ConvertUtils.register(dateConverter, java.util.Date.class); try { if(DataInfo.ACTION_CREATE.equals(df.getAction())){ for (String key : map.keySet()) { CrmCfpLevelRecordTemp r = new CrmCfpLevelRecordTemp(); BeanUtils.copyProperties(r, map.get(key)); datas.add(r); Set<ConstraintViolation<CrmCfpLevelRecordTemp>> constraintViolations = validator.validate(r); for (ConstraintViolation<CrmCfpLevelRecordTemp> constraintViolation : constraintViolations) { errors.add(new ErrorField(constraintViolation.getPropertyPath().toString(),constraintViolation.getMessage())); dr.setFieldErrors(errors); return dr; } this.crmCfpLevelRecordTempService.insert(r); } } if(DataInfo.ACTION_EDIT.equals(df.getAction())){ for (String key : map.keySet()) { CrmCfpLevelRecordTemp r = new CrmCfpLevelRecordTemp(); BeanUtils.copyProperties(r, map.get(key)); datas.add(r); Set<ConstraintViolation<CrmCfpLevelRecordTemp>> constraintViolations = validator.validate(r); for (ConstraintViolation<CrmCfpLevelRecordTemp> constraintViolation : constraintViolations) { errors.add(new ErrorField(constraintViolation.getPropertyPath().toString(),constraintViolation.getMessage())); dr.setFieldErrors(errors); return dr; } this.crmCfpLevelRecordTempService.update(r); } } if(DataInfo.ACTION_REMOVE.equals(df.getAction())){ for (String key : map.keySet()) { this.crmCfpLevelRecordTempService.delete(Long.parseLong(key)); } } } catch (Exception e) { dr.setError(e.getMessage()); } dr.setData(datas); return dr; } /** * 理财师职级提醒 * @param appRequestHead * @return */ @RequestMapping(value="/cfpLevelWarning") @ResponseBody @RequestLogging("理财师职级提醒") public BaseResponse cfpLevelWarning(AppRequestHead appRequestHead) { CfpLevelWarningResp cfpLevelWarningResp = new CfpLevelWarningResp(); String userId = JsonWebTokenHepler.getUserIdByToken(appRequestHead.getToken());//查询userId cfpLevelWarningResp= crmCfpLevelRecordTempService.cfpLevelWarning(userId); return AppResponseUtil.getSuccessResponse(cfpLevelWarningResp); } }
[ "liqimoon@qq.com" ]
liqimoon@qq.com