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
cb01bdc67e5f530a73792c0051607275dfd02cfa
7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b
/Crawler/data/Day 8 - Dictionaries and Maps.java
c018321ea94fb032960d139a11fdf73cb164c70e
[]
no_license
NayrozD/DD2476-Project
b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0
94dfb3c0a470527b069e2e0fd9ee375787ee5532
refs/heads/master
2023-03-18T04:04:59.111664
2021-03-10T15:03:07
2021-03-10T15:03:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
890
java
16 https://raw.githubusercontent.com/Chitturiarunkrishna/Hackerrank30DaysOfCode/master/Day%208%20-%20Dictionaries%20and%20Maps.java import java.util.*; import java.io.*; class Solution{ public static void main(String []argh){ Scanner in = new Scanner(System.in); int n = in.nextInt(); Map<String,Integer> myMap = new HashMap<String,Integer>(); for(int i = 0; i < n; i++){ String name = in.next(); int phone = in.nextInt(); // Write code here myMap.put(name, phone); } while(in.hasNext()){ String s = in.next(); // Write code here if (myMap.get(s)!=null) System.out.println(s + "=" + myMap.get(s) ); else System.out.println("Not found"); } in.close(); } }
[ "veronika.cucorova@gmail.com" ]
veronika.cucorova@gmail.com
27677f4b8ffa075f6b83121e8ebe4e3d2a8fdada
d23a98fd12d037caf549dc31b0da356e9d5bc4e6
/grid/src/main/java/com/mycompany/hadoop_study/grid/hcat/GetPartitions.java
2e35176887e4573c68f8b466e61a3c74c4009ca5
[]
no_license
siyu618/hadoop_study
29160a03a6328a887e9ecb5ee6e970945f0b7ec6
b2926cf4aa48dee4b6cbd72b723207673e09f82a
refs/heads/master
2021-01-18T16:36:40.131066
2014-06-12T01:31:36
2014-06-12T01:31:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,036
java
package com.mycompany.hadoop_study.grid.hcat; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.ToolRunner; import org.apache.hcatalog.api.HCatClient; import org.apache.hcatalog.api.HCatPartition; import java.util.List; /** * Created by tianzy on 4/16/14. */ public class GetPartitions extends Configured implements Tool { public static void main(String[] args) throws Exception { int res = ToolRunner.run(new Configuration(), new GetPartitions(), args); if (0 != res) { throw new RuntimeException("GetPartitions failed..."); } System.exit(res); } @Override public int run(String[] args) throws Exception { if (args.length < 4) { System.out.println("GetPartitions <hive_conf> <db_nme> <table_name> <partition_filter>"); return 0; } String hiveConf = args[0]; String dbName = args[1]; String tableName = args[2]; String partitionFilter = args[3]; System.out.println("hiveConfig = [" + hiveConf + "]"); System.out.println("dbName = [" + dbName + "]"); System.out.println("tableName = [" + tableName + "]"); System.out.println("partitionFilter = [" + partitionFilter + "]"); Configuration conf = new Configuration(); conf.addResource(hiveConf); HCatClient hCatClient = null; try { hCatClient = HCatClient.create(conf); List<HCatPartition> hCatPartitionList = hCatClient.listPartitionsByFilter(dbName, tableName, partitionFilter); System.out.println("Found # of partitions : " + hCatPartitionList.size()); for (HCatPartition hCatPartition : hCatPartitionList) { System.out.println(hCatPartition.getLocation()); } } finally { if (null != hCatClient) { hCatClient.close(); } } return 0; } }
[ "tianzy@yahoo-inc.com" ]
tianzy@yahoo-inc.com
cfd6577659af2ed2eec609566813a2800271a988
170f202be6a33126fdbab38fc7230822dc50cbf5
/design/src/main/java/com/luolei/design/visitor/ch1/Visitor.java
3eb25bb3028e1c530e1c075847f3e09ec14c2ef3
[]
no_license
askluolei/study
101e831bf0ae70b25b34e9e3bc55e98ea11be44e
b32506ff333e3bb0e0f6eccd841d30313d8cb719
refs/heads/master
2020-04-18T19:53:01.338186
2017-07-04T15:45:08
2017-07-04T15:45:08
67,342,581
0
0
null
null
null
null
UTF-8
Java
false
false
350
java
package com.luolei.design.visitor.ch1; /** * @author luolei * @date 2017-03-31 15:53 */ public abstract class Visitor { public abstract void visit(ConcreteElementA elementA); public abstract void visit(ConcreteElementB elementB); public void visit(ConcreteElementC elementC) { //ๅ…ƒ็ด ConcreteElementCๆ“ไฝœไปฃ็  } }
[ "353284427@qq.com" ]
353284427@qq.com
0b002dc75e9b8e1fddd7bd3ff1d266630a99d351
4e3ad3a6955fb91d3879cfcce809542b05a1253f
/schema/ab-products/common/resources/src/main/com/archibus/app/common/finanal/metrics/summary/SummaryMetricGenericProvider.java
3c452e5aaa416afdb7e3bbc58e3de2a2c90fa01c
[]
no_license
plusxp/ARCHIBUS_Dev
bee2f180c99787a4a80ebf0a9a8b97e7a5666980
aca5c269de60b6b84d7871d79ef29ac58f469777
refs/heads/master
2021-06-14T17:51:37.786570
2017-04-07T16:21:24
2017-04-07T16:21:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,600
java
package com.archibus.app.common.finanal.metrics.summary; import java.util.*; import com.archibus.app.common.finanal.dao.datasource.FinancialSummaryDataSource; import com.archibus.app.common.finanal.domain.*; import com.archibus.app.common.finanal.impl.*; import com.archibus.app.common.finanal.metrics.*; import com.archibus.datasource.SqlUtils; import com.archibus.service.Period; import com.archibus.utility.StringUtil; /** * Generic summary metric data provider. Calculate sum of metric values for metrics defined in * activity parameter id * * <p> * * Used by Financial Analysis service. Managed by Spring. Configured in * financialMetrics-definition.xml file. * * @author Ioan Draghici * @since 23.1 * */ public class SummaryMetricGenericProvider implements MetricProvider { /** * Activity parameter that specify related metrics. */ private String activityParameter; /** * List with asset types. */ private List<String> assetTypes; /** * Financial metric object. */ private FinancialMetric metric; /** * Error message string. */ private String errorMessage = ""; /** {@inheritDoc} */ @Override public void calculateValues(final FinancialAnalysisParameter financialParameter, final Date dateFrom, final Date dateTo) { if (Constants.ANALYSIS_CALC_ORDER_0 == this.metric.getCalculationOrder() && isValidFinancialParameter(financialParameter)) { calculateFinancialSummaryLifecycleValues(financialParameter, dateFrom); } else if (Constants.ANALYSIS_CALC_ORDER_2 == this.metric.getCalculationOrder()) { calculateFinancialSummaryValues(financialParameter, dateFrom, dateTo); } } /** {@inheritDoc} */ @Override public Map<Date, Double> getValues(final FinancialAnalysisParameter financialParameter, final Date dateFrom, final Date dateTo) { // used to return calculated values if necessary return null; } /** {@inheritDoc} */ @Override public void setMetric(final FinancialMetric metric) { this.metric = metric; } /** {@inheritDoc} */ @Override public boolean isApplicableForAssetType(final AssetType assetType) { return this.assetTypes.contains(assetType.toString()); } /** {@inheritDoc} */ @Override public boolean isApplicableForAllAssetTypes() { return StringUtil.isNullOrEmpty(this.assetTypes); } /** {@inheritDoc} */ @Override public String getAssetTypeRestriction() { return MetricProviderUtils.getAssetTypeRestrictionForTable(Constants.FINANAL_PARAMS, this.assetTypes); } /** * Getter for the activityParameter property. * * @see activityParameter * @return the activityParameter property. */ public String getActivityParameter() { return this.activityParameter; } /** * Setter for the activityParameter property. * * @see activityParameter * @param activityParameter the activityParameter to set */ public void setActivityParameter(final String activityParameter) { this.activityParameter = activityParameter; } /** * Getter for the assetTypes property. * * @see assetTypes * @return the assetTypes property. */ public List<String> getAssetTypes() { return this.assetTypes; } /** * Setter for the assetTypes property. * * @see assetTypes * @param assetTypes the assetTypes to set */ public void setAssetTypes(final List<String> assetTypes) { this.assetTypes = assetTypes; } /** {@inheritDoc} */ @Override public String getErrorMessage() { return this.errorMessage; } /** * Calculate financial summary values. * * @param financialParameter financial parameter * @param dateFrom start date * @param dateTo end date * * <p> * Suppress PMD warning "AvoidUsingSql" in this method. * <p> * Justification Case 2.2 Bulk Update; Statements with UPDATE ..WHERE pattern. */ @SuppressWarnings("PMD.AvoidUsingSql") private void calculateFinancialSummaryValues( final FinancialAnalysisParameter financialParameter, final Date dateFrom, final Date dateTo) { // update metric values using sql updates final String resultField = this.metric.getResultField(); final String sqlSumFormula = getSumFormulaSql(); final AssetType assetType = financialParameter.getAssetType(); final String assetId = financialParameter.getAssetId(); final String sqlUpdate = "UPDATE finanal_sum SET finanal_sum." + resultField + Constants.OPERATOR_EQUAL + sqlSumFormula + " WHERE " + Constants.NO_RESTRICTION + " AND finanal_sum.asset_type = " + SqlUtils.formatValueForSql(assetType.toString()) + " AND finanal_sum." + assetType.getAssetFieldName() + Constants.OPERATOR_EQUAL + SqlUtils.formatValueForSql(assetId); final Period recurringPeriod = new Period(Constants.YEAR_PATTERN, dateFrom, dateTo); MetricProviderUtils.executeSql(Constants.FINANAL_SUM, sqlUpdate, recurringPeriod, dateFrom, dateTo); } /** * Calculate financial summary lifecycle values. * * @param financialParameter financial parameter * @param calculationDate calculation date */ private void calculateFinancialSummaryLifecycleValues( final FinancialAnalysisParameter financialParameter, final Date calculationDate) { final int startYear = DateUtils.getFiscalYearForDate(financialParameter.getDatePurchased()); final int period = financialParameter.getPlannedLife(); // final int yearDiff = DateUtils.getFieldFromDate(Calendar.YEAR, calculationDate) // - DateUtils.getFiscalYearForDate(financialParameter.getDatePurchased()); // if (financialParameter.getPlannedLife() > yearDiff) { // period = yearDiff; // } final String sqlSumFormula = getSumFormulaSql(); final FinancialSummaryDataSource financialSummaryDataSource = new FinancialSummaryDataSource(); for (int index = 0; index < period; index++) { final int fiscalYear = startYear + index; double metricValue = financialSummaryDataSource.getSummaryValueForFormula( financialParameter.getAssetType(), financialParameter.getAssetId(), fiscalYear, sqlSumFormula); if (Double.isNaN(metricValue)) { metricValue = 0.0; } else { metricValue = MetricProviderUtils.round(metricValue, this.metric.getMetricDecimals()); } MetricProviderUtils.saveToFinancialSummaryLifecycle(financialParameter, DateUtils.getFiscalYearStartDate(fiscalYear), this.metric.getName(), metricValue); } } /** * Validate financial parameter settings. * * @param financialAnalysisParameter financial parameter * @return boolean */ private boolean isValidFinancialParameter( final FinancialAnalysisParameter financialAnalysisParameter) { String message = "Metric Name: " + this.metric.getName() + "; Asset Type: " + financialAnalysisParameter.getAssetType().toString() + "; Asset Id: " + financialAnalysisParameter.getAssetId(); boolean isValid = true; if (StringUtil.isNullOrEmpty(financialAnalysisParameter.getDatePurchased())) { isValid = false; message += " ; Undefined Purchase Date !"; } if (financialAnalysisParameter.getPlannedLife() == 0) { isValid = false; message += "; Undefined planned life!"; } if (!isValid) { this.errorMessage = message; } return isValid; } /** * Returns the sql for sum formula. * * @return String */ private String getSumFormulaSql() { final List<String> metrics = ActivityParameterUtils.getValuesFromActivityParameter(this.activityParameter); final List<String> calculationFields = MetricProviderUtils.getCalculationFields(metrics); return MetricProviderUtils.getSumFormulaForFields(Constants.FINANAL_SUM, calculationFields); } }
[ "imranh.khan@ucalgary.ca" ]
imranh.khan@ucalgary.ca
ed0e6adb6ca31b2b53d0e41706928f2a333446b2
1340008b0c11f30d14f4ed2fbfb42849b5c5ccd5
/test/src/json/JsonUtils1.java
ebbaa47f632d937329b4d472a273ed5d894af12d
[]
no_license
hopana/Test
b7652532968d208bafed3d07ca4490f8961ce7f4
117dd8f9319bc16a24acc3e9c72be75f33b9a09f
refs/heads/master
2023-05-03T13:37:00.370904
2022-06-15T02:45:45
2022-06-15T02:45:45
127,226,829
0
0
null
null
null
null
UTF-8
Java
false
false
5,417
java
package json; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; /** * @author Mickey */ public class JsonUtils1 { public static String stringToJson(String s) { if (s == null) { return nullToJson(); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); switch (ch) { case '"': sb.append("\\\""); break; case '\\': sb.append("\\\\"); break; case '\b': sb.append("\\b"); break; case '\f': sb.append("\\f"); break; case '\n': sb.append("\\n"); break; case '\r': sb.append("\\r"); break; case '\t': sb.append("\\t"); break; case '/': sb.append("\\/"); break; default: if (ch >= '\u0000' && ch <= '\u001F') { String ss = Integer.toHexString(ch); sb.append("\\u"); for (int k = 0; k < 4 - ss.length(); k++) { sb.append('0'); } sb.append(ss.toUpperCase()); } else { sb.append(ch); } } } return sb.toString(); } public static String nullToJson() { return ""; } public static String objectToJson(Object obj) { StringBuilder json = new StringBuilder(); if (obj == null) { json.append("\"\""); } else if (obj instanceof Number) { json.append(numberToJson((Number) obj)); } else if (obj instanceof Boolean) { json.append(booleanToJson((Boolean) obj)); } else if (obj instanceof String) { json.append("\"").append(stringToJson(obj.toString())).append("\""); } else if (obj instanceof Object[]) { json.append(arrayToJson((Object[]) obj)); } else if (obj instanceof List) { json.append(listToJson((List<?>) obj)); } else if (obj instanceof Map) { json.append(mapToJson((Map<?, ?>) obj)); } else if (obj instanceof Set) { json.append(setToJson((Set<?>) obj)); } else { json.append(beanToJson(obj)); } return json.toString(); } public static String numberToJson(Number number) { return number.toString(); } public static String booleanToJson(Boolean bool) { return bool.toString(); } /** * @param bean beanๅฏน่ฑก * @return String */ public static String beanToJson(Object bean) { StringBuilder json = new StringBuilder(); json.append("{"); PropertyDescriptor[] props = null; try { props = Introspector.getBeanInfo(bean.getClass(), Object.class).getPropertyDescriptors(); } catch (IntrospectionException e) { } if (props != null) { for (int i = 0; i < props.length; i++) { try { String name = objectToJson(props[i].getName()); String value = objectToJson(props[i].getReadMethod().invoke(bean)); json.append(name); json.append(":"); json.append(value); json.append(","); } catch (Exception e) { } } json.setCharAt(json.length() - 1, '}'); } else { json.append("}"); } return json.toString(); } /** * @param list listๅฏน่ฑก * @return String */ public static String listToJson(List<?> list) { StringBuilder json = new StringBuilder(); json.append("["); if (list != null && list.size() > 0) { for (Object obj : list) { json.append(objectToJson(obj)); json.append(","); } json.setCharAt(json.length() - 1, ']'); } else { json.append("]"); } return json.toString(); } /** * @param array ๅฏน่ฑกๆ•ฐ็ป„ * @return String */ public static String arrayToJson(Object[] array) { StringBuilder json = new StringBuilder(); json.append("["); if (array != null && array.length > 0) { for (Object obj : array) { json.append(objectToJson(obj)); json.append(","); } json.setCharAt(json.length() - 1, ']'); } else { json.append("]"); } return json.toString(); } /** * @param map mapๅฏน่ฑก * @return String */ public static String mapToJson(Map<?, ?> map) { StringBuilder json = new StringBuilder(); json.append("{"); if (map != null && map.size() > 0) { for (Object key : map.keySet()) { json.append(objectToJson(key)); json.append(":"); json.append(objectToJson(map.get(key))); json.append(","); } json.setCharAt(json.length() - 1, '}'); } else { json.append("}"); } return json.toString(); } /** * @param set set้›†ๅˆๅฏน่ฑก * @return String */ public static String setToJson(Set<?> set) { StringBuilder json = new StringBuilder(); json.append("["); if (set != null && set.size() > 0) { for (Object obj : set) { json.append(objectToJson(obj)); json.append(","); } json.setCharAt(json.length() - 1, ']'); } else { json.append("]"); } return json.toString(); } public static void main(String[] args) { List<String> list = new ArrayList<String>(); System.out.println(objectToJson(list)); } } class Person { String name; int age; String[] friends; public Person() { } public Person(String name, int age, String[] friends) { super(); this.name = name; this.age = age; this.friends = friends; } 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; } public String[] getFriends() { return friends; } public void setFriends(String[] friends) { this.friends = friends; } }
[ "hopana@163.com" ]
hopana@163.com
ce9987fdfabeb014a4583722583c525e8b6f9f0f
7e09d27c9b6f7cc6272d138fa75020bbdd20c387
/src/main/java/org/bcia/julongchain/events/producer/GenericHandlerList.java
bea5e54423d863cbcfae3a71e73fbab03e13a3a5
[ "Apache-2.0" ]
permissive
GadSun/julongchain
937fc13fd53fb4994e2b2ea26163a224388758ab
b9c2345a10b7e5e95abfa61b257c21b63e91a812
refs/heads/master
2020-04-01T00:59:04.203378
2018-10-15T01:26:55
2018-10-15T01:26:55
152,721,326
1
0
Apache-2.0
2018-10-12T08:48:00
2018-10-12T08:47:59
null
UTF-8
Java
false
false
2,501
java
/** * Copyright Dingxuan. All Rights Reserved. * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.bcia.julongchain.events.producer; import org.bcia.julongchain.common.exception.ValidateException; import org.bcia.julongchain.common.util.ValidateUtils; import org.bcia.julongchain.protos.node.EventsPackage; import java.util.HashMap; import java.util.Map; /** * ้€š็”จๅค„็†ๅ™จๅˆ—่กจ * * @author zhouhui * @date 2018/05/18 * @company Dingxuan */ public class GenericHandlerList implements IHandlerList { private Map<IEventHandler, Boolean> handlers = new HashMap<>(); @Override public boolean add(EventsPackage.Interest interest, EventHandler eventHandler) throws ValidateException { ValidateUtils.isNotNull(interest, "Interest can not be null"); ValidateUtils.isNotNull(eventHandler, "EventHandler can not be null"); synchronized (this) { if (handlers.containsKey(eventHandler)) { return false; } else { handlers.put(eventHandler, true); return true; } } } @Override public boolean delete(EventsPackage.Interest interest, EventHandler eventHandler) throws ValidateException { ValidateUtils.isNotNull(interest, "Interest can not be null"); ValidateUtils.isNotNull(eventHandler, "EventHandler can not be null"); synchronized (this) { if (!handlers.containsKey(eventHandler)) { return false; } else { handlers.remove(eventHandler, true); return true; } } } @Override public void foreach(EventsPackage.Event event, IHandlerAction action) { if (event != null && action != null) { synchronized (this) { for (IEventHandler eventHandler : handlers.keySet()) { action.doAction(eventHandler); } } } } }
[ "wlb@dxct.org" ]
wlb@dxct.org
eb98bef06b556262347d1751ab87ced4e8df7ebc
a1e6d3dce69e54060528884fa3b604437b8f5892
/sca-ativos/src/main/java/com/sca/ativo/model/Ativo.java
61cfa112350c4db4f5d6f293751a598c70e2684d
[]
no_license
wanersbh/sca
cc73305585c10e230f942747abefcfe4d6f9202c
af83d6417a522ce4e46f51b6610d9755ed5c65b4
refs/heads/master
2023-09-01T10:22:36.418749
2023-08-24T14:01:07
2023-08-24T14:01:07
199,446,242
6
1
null
2023-01-07T08:30:18
2019-07-29T12:13:11
Java
UTF-8
Java
false
false
2,791
java
package com.sca.ativo.model; import java.time.LocalDate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @Entity @Table(name = "ativo") public class Ativo { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long codigo; @NotNull @Size(min=2, max = 50) private String descricao; @NotNull @Column(name = "data_aquisicao") private LocalDate dataAquisicao; @NotNull @Column(name = "ano_fabricacao") private Integer anoFabricacao; @Size(max = 300) private String observacao; @Column(name = "data_exclusao") private LocalDate dataExclusao; @NotNull @ManyToOne @JoinColumn(name = "codigo_categoria") private Categoria categoria; @NotNull @ManyToOne @JoinColumn(name = "codigo_fabricante") private Fabricante fabricante; public Long getCodigo() { return codigo; } public void setCodigo(Long codigo) { this.codigo = codigo; } public String getDescricao() { return descricao; } public void setDescricao(String descricao) { this.descricao = descricao; } public LocalDate getDataAquisicao() { return dataAquisicao; } public void setDataAquisicao(LocalDate dataAquisicao) { this.dataAquisicao = dataAquisicao; } public Integer getAnoFabricacao() { return anoFabricacao; } public void setAnoFabricacao(Integer anoFabricacao) { this.anoFabricacao = anoFabricacao; } public String getObservacao() { return observacao; } public void setObservacao(String observacao) { this.observacao = observacao; } public LocalDate getDataExclusao() { return dataExclusao; } public void setDataExclusao(LocalDate dataExclusao) { this.dataExclusao = dataExclusao; } public Categoria getCategoria() { return categoria; } public void setCategoria(Categoria categoria) { this.categoria = categoria; } public Fabricante getFabricante() { return fabricante; } public void setFabricante(Fabricante fabricante) { this.fabricante = fabricante; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((codigo == null) ? 0 : codigo.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Ativo other = (Ativo) obj; if (codigo == null) { if (other.codigo != null) return false; } else if (!codigo.equals(other.codigo)) return false; return true; } }
[ "wanersbh@gmail.com" ]
wanersbh@gmail.com
804d9a9731c85884d7949c84c6a0aa1fcd18c92e
9ea18faa893ef4bba4db16638dbbefa93288c57c
/wallpaper/crystal-swan/ios/src/com/kivvi/crystalswan/IOSLauncher.java
c160e3116ff2d4805075bd5330b0b4cbc1faaad2
[]
no_license
ViralHud/oldprojects
2f6a20da0afb3e73ea1b08fd62524402bbf7071c
80d7f674987bb641f09027afd1862384ddb08739
refs/heads/master
2022-01-08T16:40:14.076501
2015-03-14T10:15:36
2015-03-14T10:15:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
package com.kivvi.crystalswan; import org.robovm.apple.foundation.NSAutoreleasePool; import org.robovm.apple.uikit.UIApplication; import com.badlogic.gdx.backends.iosrobovm.IOSApplication; import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration; import com.kivvi.crystalswan.CrystalSwan; public class IOSLauncher extends IOSApplication.Delegate { @Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new CrystalSwan(), config); } public static void main(String[] argv) { NSAutoreleasePool pool = new NSAutoreleasePool(); UIApplication.main(argv, null, IOSLauncher.class); pool.close(); } }
[ "suyu0925@gmail.com" ]
suyu0925@gmail.com
def75de1472793a6e6638d7894e880ac663d1225
7f44e93963634d19da7f4874a64a2881853427e7
/src/main/java/com/patient/treatment/documentation/gui/service/LoginService.java
d1eb3f7063731775b63d3fb27f8af3361c5ed389
[]
no_license
emilzajac/patient-documentation
7dbcf7304e344b70fcdf65bbc5295cefe7cc544a
81bb3330fead96cd31d3a95ba68a8903fb6ce786
refs/heads/develop
2023-01-24T18:04:40.601444
2021-02-11T12:46:40
2021-02-11T12:46:40
203,060,441
0
0
null
2023-01-07T20:57:07
2019-08-18T21:57:10
TypeScript
UTF-8
Java
false
false
2,101
java
package com.patient.treatment.documentation.gui.service; import com.patient.treatment.documentation.gui.model.dto.UserJwtDto; import com.patient.treatment.documentation.gui.model.dto.mappers.UserMapper; import com.patient.treatment.documentation.gui.model.forms.LoginForm; import com.patient.treatment.documentation.gui.model.security.UserPrincipal; import com.patient.treatment.documentation.gui.model.security.jwt.JwtUtils; import com.patient.treatment.documentation.gui.session.SessionService; import lombok.AllArgsConstructor; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.RequestBody; @Service @AllArgsConstructor public class LoginService { private AuthenticationManager authenticationManager; private SessionService sessionService; private UserMapper userMapper; private JwtUtils jwtUtils; public UserJwtDto getUserJwtDto(@RequestBody LoginForm loginForm) { Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(loginForm.getUsername(), loginForm.getPassword())); SecurityContextHolder.getContext().setAuthentication(authentication); UserJwtDto userJwt = createJwt(authentication); addUserToSession(authentication); return userJwt; } private UserJwtDto createJwt(Authentication authentication) { UserJwtDto userJwt = userMapper.toUserJwtDTO(((UserPrincipal) authentication.getPrincipal()).getUser()); userJwt.setToken(jwtUtils.generateJwtToken(authentication)); userJwt.setTokenType("Bearer"); return userJwt; } private void addUserToSession(Authentication authentication) { sessionService.setAuthenticatedUser(((UserPrincipal) authentication.getPrincipal()).getUser()); } }
[ "Emil.Zajac@ttpsc.pl" ]
Emil.Zajac@ttpsc.pl
ad564360e943382104c8e9d7e0a8aea0c496a9b1
a8dee88144e687edcd310598978f4d0931427188
/FileManager/src/com/mlt/filemanager/ftp/cmdTools/CmdCDUP.java
6c695d06ab0dd145d077eba93428b3d2b8b0d63b
[]
no_license
chongbo2013/Features
b354e28a71b304217e3966f8212a73a01acb2372
bcdce12f314616cc43be9f29ba135a70d53ff02b
refs/heads/master
2021-05-30T21:37:57.204713
2015-12-31T09:58:37
2015-12-31T09:58:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,137
java
/* Copyright 2009 David Revell This file is part of SwiFTP. SwiFTP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SwiFTP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SwiFTP. If not, see <http://www.gnu.org/licenses/>. */ package com.mlt.filemanager.ftp.cmdTools; import java.io.File; import java.io.IOException; import android.util.Log; public class CmdCDUP extends FtpCmd implements Runnable { protected String input; public CmdCDUP(SessionThread sessionThread, String input) { super(sessionThread, CmdCDUP.class.toString()); } public void run() { myLog.l(Log.DEBUG, "CDUP executing"); File newDir; String errString = null; mainBlock: { File workingDir = sessionThread.getWorkingDir(); newDir = workingDir.getParentFile(); if(newDir == null) { errString = "550 Current dir cannot find parent\r\n"; break mainBlock; } // Ensure the new path does not violate the chroot restriction if(violatesChroot(newDir)) { errString = "550 Invalid name or chroot violation\r\n"; break mainBlock; } try { newDir = newDir.getCanonicalFile(); if(!newDir.isDirectory()) { errString = "550 Can't CWD to invalid directory\r\n"; break mainBlock; } else if(newDir.canRead()) { sessionThread.setWorkingDir(newDir); } else { errString = "550 That path is inaccessible\r\n"; break mainBlock; } } catch(IOException e) { errString = "550 Invalid path\r\n"; break mainBlock; } } if(errString != null) { sessionThread.writeString(errString); myLog.i("CDUP error: " + errString); } else { sessionThread.writeString("200 CDUP successful\r\n"); myLog.l(Log.DEBUG, "CDUP success"); } } }
[ "635252544@qq.com" ]
635252544@qq.com
7d9b258feeb8b53e18365cde74746878e5e8bb80
270c84be41a22ea85c7d00e571f1024b599a73b4
/src/main/java/onlineShop/dao/CustomerDao.java
558635bd874ed47dbe2486eb9118a698afa1d831
[]
no_license
zyyturbo/online-shop
d30d8cb23e2c496494293b7951643030822f096b
b092de37b4245bc644e59dd89cdcd466bed01a2d
refs/heads/master
2022-12-20T18:46:50.155703
2020-09-19T02:58:23
2020-09-19T02:58:23
296,774,349
0
0
null
null
null
null
UTF-8
Java
false
false
1,996
java
package onlineShop.dao; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Root; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import onlineShop.model.Authorities; import onlineShop.model.Cart; import onlineShop.model.Customer; import onlineShop.model.User; @Repository public class CustomerDao { @Autowired private SessionFactory sessionFactory; public void addCustomer(Customer customer) { customer.getUser().setEnabled(true); Authorities authorities = new Authorities(); authorities.setAuthorities("ROLE_USER"); authorities.setEmailId(customer.getUser().getEmailId()); Cart cart = new Cart(); cart.setCustomer(customer); customer.setCart(cart); Session session = null; try { session = sessionFactory.openSession(); session.beginTransaction(); session.save(authorities); session.save(customer); // ็บง่”ๆ“ไฝœ๏ผŒๆ‰€ไปฅไธ้œ€่ฆๅ•็‹ฌsave cart session.getTransaction().commit(); } catch (Exception e) { e.printStackTrace(); session.getTransaction().rollback(); } finally { if (session != null) { session.close(); } } } public Customer getCustomerByUserName(String userName) { User user = null; try (Session session = sessionFactory.openSession()) { session.beginTransaction(); CriteriaBuilder builder = session.getCriteriaBuilder(); CriteriaQuery<User> criteriaQuery = builder.createQuery(User.class); Root<User> root = criteriaQuery.from(User.class); criteriaQuery.select(root).where(builder.equal(root.get("emailId"), userName)); user = session.createQuery(criteriaQuery).getSingleResult(); session.getTransaction().commit(); } catch (Exception e) { e.printStackTrace(); } if (user != null) return user.getCustomer(); return null; } }
[ "yiyinzhang97@gmail.com" ]
yiyinzhang97@gmail.com
733ab02ecb2739cbc37c6d5694bb36f995da648b
8efb8780631d81fe18a1f7bdd53d73cdc2bbca97
/AndroidAudioRecorder/src/main/java/cafe/adriel/androidaudiorecorder/AudioRecorderActivity.java
59035ef9be5377c7e7367ec2da597f07dd0e18db
[]
no_license
cendelinova/EventMate_Android
e0e66e0685baa58f1624906f83b114ceee25d4f8
977be1c4f99045800d561a12a2e7db4f07886c06
refs/heads/master
2020-04-08T12:54:51.903900
2019-01-21T22:21:30
2019-01-21T22:21:30
159,366,973
1
0
null
2018-11-28T18:21:01
2018-11-27T16:37:10
Kotlin
UTF-8
Java
false
false
14,278
java
package cafe.adriel.androidaudiorecorder; import android.content.Intent; import android.graphics.Color; import android.graphics.PorterDuff; import android.graphics.drawable.ColorDrawable; import android.media.MediaPlayer; import android.net.Uri; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.WindowManager; import android.widget.ImageButton; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; import cafe.adriel.androidaudiorecorder.model.AudioChannel; import cafe.adriel.androidaudiorecorder.model.AudioSampleRate; import cafe.adriel.androidaudiorecorder.model.AudioSource; import com.cleveroad.audiovisualization.DbmHandler; import com.cleveroad.audiovisualization.GLAudioVisualizationView; import omrecorder.AudioChunk; import omrecorder.OmRecorder; import omrecorder.PullTransport; import omrecorder.Recorder; import java.io.File; import java.util.Timer; import java.util.TimerTask; public class AudioRecorderActivity extends AppCompatActivity implements PullTransport.OnAudioChunkPulledListener, MediaPlayer.OnCompletionListener { private String filePath; private AudioSource source; private AudioChannel channel; private AudioSampleRate sampleRate; private int color; private boolean autoStart; private boolean keepDisplayOn; private MediaPlayer player; private Recorder recorder; private VisualizerHandler visualizerHandler; private Timer timer; private MenuItem saveMenuItem; private int recorderSecondsElapsed; private int playerSecondsElapsed; private boolean isRecording; private RelativeLayout contentLayout; private GLAudioVisualizationView visualizerView; private TextView statusView; private TextView timerView; private ImageButton restartView; private ImageButton recordView; private ImageButton playView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.aar_activity_audio_recorder); if (savedInstanceState != null) { filePath = savedInstanceState.getString(AndroidAudioRecorder.EXTRA_FILE_PATH); source = (AudioSource) savedInstanceState.getSerializable(AndroidAudioRecorder.EXTRA_SOURCE); channel = (AudioChannel) savedInstanceState.getSerializable(AndroidAudioRecorder.EXTRA_CHANNEL); sampleRate = (AudioSampleRate) savedInstanceState.getSerializable(AndroidAudioRecorder.EXTRA_SAMPLE_RATE); color = savedInstanceState.getInt(AndroidAudioRecorder.EXTRA_COLOR); autoStart = savedInstanceState.getBoolean(AndroidAudioRecorder.EXTRA_AUTO_START); keepDisplayOn = savedInstanceState.getBoolean(AndroidAudioRecorder.EXTRA_KEEP_DISPLAY_ON); } else { filePath = getIntent().getStringExtra(AndroidAudioRecorder.EXTRA_FILE_PATH); source = (AudioSource) getIntent().getSerializableExtra(AndroidAudioRecorder.EXTRA_SOURCE); channel = (AudioChannel) getIntent().getSerializableExtra(AndroidAudioRecorder.EXTRA_CHANNEL); sampleRate = (AudioSampleRate) getIntent().getSerializableExtra(AndroidAudioRecorder.EXTRA_SAMPLE_RATE); color = getIntent().getIntExtra(AndroidAudioRecorder.EXTRA_COLOR, Color.BLACK); autoStart = getIntent().getBooleanExtra(AndroidAudioRecorder.EXTRA_AUTO_START, false); keepDisplayOn = getIntent().getBooleanExtra(AndroidAudioRecorder.EXTRA_KEEP_DISPLAY_ON, false); } if (keepDisplayOn) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } if (getSupportActionBar() != null) { getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowTitleEnabled(false); getSupportActionBar().setElevation(0); getSupportActionBar().setBackgroundDrawable( new ColorDrawable(Util.getDarkerColor(color))); getSupportActionBar().setHomeAsUpIndicator( ContextCompat.getDrawable(this, R.drawable.aar_ic_clear)); } visualizerView = new GLAudioVisualizationView.Builder(this) .setLayersCount(1) .setWavesCount(6) .setWavesHeight(R.dimen.aar_wave_height) .setWavesFooterHeight(R.dimen.aar_footer_height) .setBubblesPerLayer(20) .setBubblesSize(R.dimen.aar_bubble_size) .setBubblesRandomizeSize(true) .setBackgroundColor(Util.getDarkerColor(color)) .setLayerColors(new int[]{color}) .build(); contentLayout = (RelativeLayout) findViewById(R.id.content); statusView = (TextView) findViewById(R.id.status); timerView = (TextView) findViewById(R.id.timer); restartView = (ImageButton) findViewById(R.id.restart); recordView = (ImageButton) findViewById(R.id.record); playView = (ImageButton) findViewById(R.id.play); contentLayout.setBackgroundColor(Util.getDarkerColor(color)); contentLayout.addView(visualizerView, 0); restartView.setVisibility(View.INVISIBLE); playView.setVisibility(View.INVISIBLE); if (Util.isBrightColor(color)) { ContextCompat.getDrawable(this, R.drawable.aar_ic_clear) .setColorFilter(Color.BLACK, PorterDuff.Mode.SRC_ATOP); ContextCompat.getDrawable(this, R.drawable.aar_ic_check) .setColorFilter(Color.BLACK, PorterDuff.Mode.SRC_ATOP); statusView.setTextColor(Color.BLACK); timerView.setTextColor(Color.BLACK); restartView.setColorFilter(Color.BLACK); recordView.setColorFilter(Color.BLACK); playView.setColorFilter(Color.BLACK); } } @Override public void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); if (autoStart && !isRecording) { toggleRecording(null); } } @Override public void onResume() { super.onResume(); try { visualizerView.onResume(); } catch (Exception e) { } } @Override protected void onPause() { restartRecording(null); try { visualizerView.onPause(); } catch (Exception e) { } super.onPause(); } @Override protected void onDestroy() { restartRecording(null); setResult(RESULT_CANCELED); try { visualizerView.release(); } catch (Exception e) { } super.onDestroy(); } @Override protected void onSaveInstanceState(Bundle outState) { outState.putString(AndroidAudioRecorder.EXTRA_FILE_PATH, filePath); outState.putInt(AndroidAudioRecorder.EXTRA_COLOR, color); super.onSaveInstanceState(outState); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.aar_audio_recorder, menu); saveMenuItem = menu.findItem(R.id.action_save); saveMenuItem.setIcon(ContextCompat.getDrawable(this, R.drawable.aar_ic_check)); return super.onCreateOptionsMenu(menu); } @Override public boolean onOptionsItemSelected(MenuItem item) { int i = item.getItemId(); if (i == android.R.id.home) { finish(); } else if (i == R.id.action_save) { selectAudio(); } return super.onOptionsItemSelected(item); } @Override public void onAudioChunkPulled(AudioChunk audioChunk) { float amplitude = isRecording ? (float) audioChunk.maxAmplitude() : 0f; visualizerHandler.onDataReceived(amplitude); } @Override public void onCompletion(MediaPlayer mediaPlayer) { stopPlaying(); } private void selectAudio() { stopRecording(); Intent intent = new Intent(); intent.setData(Uri.parse(filePath)); setResult(RESULT_OK, intent); finish(); } public void toggleRecording(View v) { stopPlaying(); Util.wait(100, new Runnable() { @Override public void run() { if (isRecording) { pauseRecording(); } else { resumeRecording(); } } }); } public void togglePlaying(View v) { pauseRecording(); Util.wait(100, new Runnable() { @Override public void run() { if (isPlaying()) { stopPlaying(); } else { startPlaying(); } } }); } public void restartRecording(View v) { if (isRecording) { stopRecording(); } else if (isPlaying()) { stopPlaying(); } else { visualizerHandler = new VisualizerHandler(); visualizerView.linkTo(visualizerHandler); visualizerView.release(); if (visualizerHandler != null) { visualizerHandler.stop(); } } saveMenuItem.setVisible(false); statusView.setVisibility(View.INVISIBLE); restartView.setVisibility(View.INVISIBLE); playView.setVisibility(View.INVISIBLE); recordView.setImageResource(R.drawable.aar_ic_rec); timerView.setText("00:00:00"); recorderSecondsElapsed = 0; playerSecondsElapsed = 0; } private void resumeRecording() { isRecording = true; saveMenuItem.setVisible(false); statusView.setText(R.string.aar_recording); statusView.setVisibility(View.VISIBLE); restartView.setVisibility(View.INVISIBLE); playView.setVisibility(View.INVISIBLE); recordView.setImageResource(R.drawable.aar_ic_pause); playView.setImageResource(R.drawable.aar_ic_play); visualizerHandler = new VisualizerHandler(); visualizerView.linkTo(visualizerHandler); if (recorder == null) { timerView.setText("00:00:00"); recorder = OmRecorder.wav( new PullTransport.Default(Util.getMic(source, channel, sampleRate), AudioRecorderActivity.this), new File(filePath)); } recorder.resumeRecording(); startTimer(); } private void pauseRecording() { isRecording = false; if (!isFinishing()) { saveMenuItem.setVisible(true); } statusView.setText(R.string.aar_paused); statusView.setVisibility(View.VISIBLE); restartView.setVisibility(View.VISIBLE); playView.setVisibility(View.VISIBLE); recordView.setImageResource(R.drawable.aar_ic_rec); playView.setImageResource(R.drawable.aar_ic_play); visualizerView.release(); if (visualizerHandler != null) { visualizerHandler.stop(); } if (recorder != null) { recorder.pauseRecording(); } stopTimer(); } private void stopRecording() { visualizerView.release(); if (visualizerHandler != null) { visualizerHandler.stop(); } recorderSecondsElapsed = 0; if (recorder != null) { recorder.stopRecording(); recorder = null; } stopTimer(); } private void startPlaying() { try { stopRecording(); player = new MediaPlayer(); player.setDataSource(filePath); player.prepare(); player.start(); visualizerView.linkTo(DbmHandler.Factory.newVisualizerHandler(this, player)); visualizerView.post(new Runnable() { @Override public void run() { player.setOnCompletionListener(AudioRecorderActivity.this); } }); timerView.setText("00:00:00"); statusView.setText(R.string.aar_playing); statusView.setVisibility(View.VISIBLE); playView.setImageResource(R.drawable.aar_ic_stop); playerSecondsElapsed = 0; startTimer(); } catch (Exception e) { e.printStackTrace(); } } private void stopPlaying() { statusView.setText(""); statusView.setVisibility(View.INVISIBLE); playView.setImageResource(R.drawable.aar_ic_play); visualizerView.release(); if (visualizerHandler != null) { visualizerHandler.stop(); } if (player != null) { try { player.stop(); player.reset(); } catch (Exception e) { } } stopTimer(); } private boolean isPlaying() { try { return player != null && player.isPlaying() && !isRecording; } catch (Exception e) { return false; } } private void startTimer() { stopTimer(); timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { updateTimer(); } }, 0, 1000); } private void stopTimer() { if (timer != null) { timer.cancel(); timer.purge(); timer = null; } } private void updateTimer() { runOnUiThread(new Runnable() { @Override public void run() { if (isRecording) { recorderSecondsElapsed++; timerView.setText(Util.formatSeconds(recorderSecondsElapsed)); } else if (isPlaying()) { playerSecondsElapsed++; timerView.setText(Util.formatSeconds(playerSecondsElapsed)); } } }); } }
[ "cendelinova@master.cz" ]
cendelinova@master.cz
d9ec7ca11f69183ef0af38fd3b2bf47ac75cd3db
c3b8f86643593fd48562117acb6cf09ce10c85f8
/ky-webapp/src/main/java/com/ky/logic/entity/ConfigEntity.java
3909a01a93284812ef932f12690c3073fc15d0a8
[]
no_license
dlxsvip/ky
05457c6d075d06958e20306bafc7681d5915ca25
e14468bf0ba0caa81c9663793e6ad1bd623260ef
refs/heads/master
2021-05-06T15:48:07.792950
2017-12-16T01:02:13
2017-12-16T01:02:13
113,654,800
0
0
null
null
null
null
UTF-8
Java
false
false
1,837
java
package com.ky.logic.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; /** * ็ณป็ปŸ้…็ฝฎๅ‚ๆ•ฐ * Created by yl on 2017/8/14. */ @Entity @Table(name = "config") public class ConfigEntity { /** * ้…็ฝฎid */ @Id @Column(name = "config_id") private String configId; /** * ้…็ฝฎๅ็งฐ */ @Column(name = "config_name") private String configName; /** * ้…็ฝฎkey */ @Column(name = "config_key") private String configKey; /** * ้…็ฝฎvalue */ @Column(name = "config_value") private String configValue; /** * ้…็ฝฎvalue */ @Column(name = "value_type") private String valueType; /** * ้…็ฝฎๆ่ฟฐ */ private String description; public String getConfigId() { return configId; } public void setConfigId(String configId) { this.configId = configId; } public String getConfigName() { return configName; } public void setConfigName(String configName) { this.configName = configName; } public String getConfigKey() { return configKey; } public void setConfigKey(String configKey) { this.configKey = configKey; } public String getConfigValue() { return configValue; } public void setConfigValue(String configValue) { this.configValue = configValue; } public String getValueType() { return valueType; } public void setValueType(String valueType) { this.valueType = valueType; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
[ "dlxsvip@163.com" ]
dlxsvip@163.com
111b74885381c2629eb2b5cf77ca309cb5b4d729
a52d6bb42e75ef0678cfcd291e5696a9e358fc4d
/af_webapp/src/main/java/org/kuali/kfs/module/purap/pdf/PurapPdf.java
625f8576c0b34ca94d7152dfe9b6cea06f93de6d
[]
no_license
Ariah-Group/Finance
894e39cfeda8f6fdb4f48a4917045c0bc50050c5
ca49930ca456799f99aad57e1e974453d8fe479d
refs/heads/master
2021-01-21T12:11:40.987504
2016-03-24T14:22:40
2016-03-24T14:22:40
26,879,430
0
0
null
null
null
null
UTF-8
Java
false
false
8,689
java
/* * Copyright 2007 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.kfs.module.purap.pdf; import java.io.File; import org.kuali.kfs.module.purap.document.PurchaseOrderDocument; import org.kuali.kfs.sys.context.SpringContext; import org.kuali.rice.core.api.datetime.DateTimeService; import org.kuali.rice.core.api.util.type.KualiDecimal; import org.kuali.rice.krad.util.GlobalVariables; import org.kuali.rice.krad.util.KRADUtils; import org.kuali.rice.krad.util.ObjectUtils; import com.lowagie.text.Document; import com.lowagie.text.Element; import com.lowagie.text.Font; import com.lowagie.text.FontFactory; import com.lowagie.text.Image; import com.lowagie.text.PageSize; import com.lowagie.text.pdf.BaseFont; import com.lowagie.text.pdf.PdfContentByte; import com.lowagie.text.pdf.PdfPTable; import com.lowagie.text.pdf.PdfPageEventHelper; import com.lowagie.text.pdf.PdfTemplate; import com.lowagie.text.pdf.PdfWriter; /** * Base class to be extended for implementing PDF documents in Purchasing/Accounts Payable module. */ public class PurapPdf extends PdfPageEventHelper { private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PurapPdf.class); /** headerTable pieces need to be public */ public PdfTemplate tpl; // A template that will hold the total number of pages. public PdfContentByte cb; public Image logo; public PdfPTable headerTable; public PdfPTable nestedHeaderTable; public String campusName; public PurchaseOrderDocument po; public String logoImage; public BaseFont helv; public String environment; public boolean isPreview = false; public boolean isRetransmit = false; Font ver_4_normal = FontFactory.getFont("VERDANA", 4, 0); Font ver_5_normal = FontFactory.getFont("VERDANA", 5, 0); Font ver_6_normal = FontFactory.getFont("VERDANA", 6, 0); Font ver_8_normal = FontFactory.getFont("VERDANA", 8, 0); Font ver_10_normal = FontFactory.getFont("VERDANA", 10, 0); Font ver_11_normal = FontFactory.getFont("VERDANA", 11, 0); Font ver_12_normal = FontFactory.getFont("VERDANA", 12, 0); Font ver_13_normal = FontFactory.getFont("VERDANA", 13, 0); Font ver_14_normal = FontFactory.getFont("VERDANA", 14, 0); Font ver_15_normal = FontFactory.getFont("VERDANA", 15, 0); Font ver_16_normal = FontFactory.getFont("VERDANA", 16, 0); Font ver_17_normal = FontFactory.getFont("VERDANA", 17, 0); Font ver_6_bold = FontFactory.getFont("VERDANA", 6, 1); Font ver_8_bold = FontFactory.getFont("VERDANA", 8, 1); Font ver_10_bold = FontFactory.getFont("VERDANA", 10, 1); Font cour_7_normal = FontFactory.getFont("COURIER", 7, 0); Font cour_10_normal = FontFactory.getFont("COURIER", 10, 0); static KualiDecimal zero = KualiDecimal.ZERO; private DateTimeService dateTimeService; public PurapPdf() { super(); } public DateTimeService getDateTimeService() { if (ObjectUtils.isNull(dateTimeService)) { this.dateTimeService = SpringContext.getBean(DateTimeService.class); } return this.dateTimeService; } /** * Overrides the method in PdfPageEventHelper from itext to include our watermark text to indicate that * this is a Test document and include the environment, if the environment is not a production environment. * * @param writer The PdfWriter for this document. * @param document The document. * @see com.lowagie.text.pdf.PdfPageEventHelper#onStartPage(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document) */ public void onStartPage(PdfWriter writer, Document document) { if (!KRADUtils.isProductionEnvironment()) { PdfContentByte cb = writer.getDirectContentUnder(); cb.saveState(); cb.beginText(); cb.setFontAndSize(helv, 48); String watermarkText = "Test document (" + environment + ")"; cb.showTextAligned(Element.ALIGN_CENTER, watermarkText, document.getPageSize().getWidth() / 2, document.getPageSize().getHeight() / 2, 45); cb.endText(); cb.restoreState(); } if(GlobalVariables.getUserSession() != null && GlobalVariables.getUserSession().retrieveObject("isPreview") != null) { GlobalVariables.getUserSession().removeObject("isPreview"); PdfContentByte cb = writer.getDirectContentUnder(); cb.saveState(); cb.beginText(); cb.setFontAndSize(helv, 48); String watermarkText = "DRAFT"; cb.showTextAligned(Element.ALIGN_CENTER, watermarkText, document.getPageSize().getWidth() / 2, document.getPageSize().getHeight() / 2, 45); cb.endText(); cb.restoreState(); } } /** * Overrides the method in PdfPageEventHelper from itext to write the headerTable, compose the footer and show the * footer. * * @param writer The PdfWriter for this document. * @param document The document. * @see com.lowagie.text.pdf.PdfPageEventHelper#onEndPage(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document) */ public void onEndPage(PdfWriter writer, Document document) { LOG.debug("onEndPage() started."); PdfContentByte cb = writer.getDirectContent(); cb.saveState(); // write the headerTable headerTable.setTotalWidth(document.right() - document.left()); headerTable.writeSelectedRows(0, -1, document.left(), document.getPageSize().getHeight() - 10, cb); // compose the footer String text = "Page " + writer.getPageNumber() + " of "; float textSize = helv.getWidthPoint(text, 12); float textBase = document.bottom() - 20; cb.beginText(); cb.setFontAndSize(helv, 12); // show the footer float adjust = helv.getWidthPoint("0", 12); cb.setTextMatrix(document.right() - textSize - adjust, textBase); cb.showText(text); cb.endText(); cb.addTemplate(tpl, document.right() - adjust, textBase); cb.saveState(); } /** * Overrides the method in the PdfPageEventHelper from itext to put the total number of pages into the template. * * @param writer The PdfWriter for this document. * @param document The document. * @see com.lowagie.text.pdf.PdfPageEventHelper#onCloseDocument(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document) */ public void onCloseDocument(PdfWriter writer, Document document) { LOG.debug("onCloseDocument() started."); tpl.beginText(); tpl.setFontAndSize(helv, 12); tpl.setTextMatrix(0, 0); tpl.showText("" + (writer.getPageNumber() - 1)); tpl.endText(); } /** * Gets a PageEvents object. * * @return a new PageEvents object */ public PurapPdf getPageEvents() { LOG.debug("getPageEvents() started."); return new PurapPdf(); } /** * Creates an instance of a new Document and set its margins according to * the given input parameters. * * @param f1 Left margin. * @param f2 Right margin. * @param f3 Top margin. * @param f4 Bottom margin. * @return The created Document object. */ public Document getDocument(float f1, float f2, float f3, float f4) { LOG.debug("getDocument() started"); Document document = new Document(PageSize.A4); // Margins: 36pt = 0.5 inch, 72pt = 1 inch. Left, right, top, bottom. document.setMargins(f1, f2, f3, f4); return document; } /** * Deletes an already created PDF. * * @param pdfFileLocation The location of the pdf file. * @param pdfFilename The name of the pdf file. */ public void deletePdf(String pdfFileLocation, String pdfFilename) { if (LOG.isDebugEnabled()) { LOG.debug("deletePdf() started for po pdf file: " + pdfFilename); } File f = new File(pdfFileLocation + pdfFilename); f.delete(); } }
[ "code@ariahgroup.org" ]
code@ariahgroup.org
9106f34db498aee6c348468cea128c48972d88cd
3d3b1cb78068e855ce1d1d1d3b970131e074136c
/app/src/main/java/cn/icarowner/icarowner/IcarApplication.java
c9aa2b4516be23400c15dad236b89f3338bdfe92
[]
no_license
jp5201314/icar-client-android-login
05608e6152402bb898d8026ccbb7ea97dab88da6
90c6af04a0596bd9c2c66548388f1606f56b0a15
refs/heads/master
2021-01-19T10:52:02.994906
2017-04-11T07:53:40
2017-04-11T07:53:40
87,903,442
0
0
null
null
null
null
UTF-8
Java
false
false
600
java
package cn.icarowner.icarowner; import android.app.Application; import android.content.Context; /** * Created by cj on 2016/9/5. */ public class IcarApplication extends Application { private static IcarApplication INSTANCE; private static Context mContext; @Override public void onCreate() { super.onCreate(); INSTANCE = this; mContext = getApplicationContext(); } public static synchronized IcarApplication getInstance() { return INSTANCE; } public static synchronized Context getContext() { return mContext; } }
[ "1160873948@qq.com" ]
1160873948@qq.com
b8eea09d3debeddca89919a3c0ecb5b27c634cfb
a027decfa44fccc0eef63485b0087919690ecacc
/app/src/main/java/com/example/rafiw/securechild/Parentlogin.java
86231acc2f805fdd0eefd6bfcef51a6bb0892d43
[]
no_license
rafi4204/rafi.securechild
7f217706ab84e6ff961c7bb6320c19adb0a4f58d
2b825f46781a7c779d86893e67519b3fa26a9962
refs/heads/master
2020-04-03T03:20:43.230018
2018-10-27T16:01:05
2018-10-27T16:01:05
154,983,117
1
0
null
null
null
null
UTF-8
Java
false
false
3,743
java
package com.example.rafiw.securechild; import android.app.ProgressDialog; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; public class Parentlogin extends AppCompatActivity implements View.OnClickListener { //define all the views private Button buttonSignin; private EditText editTextEmail; private EditText editTextPassword; private TextView textViewSignup; private ProgressDialog progressDialog; // defining FirebaseAuth private FirebaseAuth firebaseAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_parentlogin); firebaseAuth = FirebaseAuth.getInstance(); //if someone is already logged in if (firebaseAuth.getCurrentUser() != null){ finish(); // then close this activity startActivity(new Intent(Parentlogin.this, selectDevice.class)); // and go to their profile page } //initializing all the views editTextEmail = (EditText) findViewById(R.id.email); editTextPassword = (EditText) findViewById(R.id.password); buttonSignin = (Button) findViewById(R.id.login); textViewSignup = (TextView) findViewById(R.id.signup); progressDialog = new ProgressDialog(this); buttonSignin.setOnClickListener(this); textViewSignup.setOnClickListener(this); } @Override public void onClick(View view) { if (view == buttonSignin){ userLogin(); } if (view == textViewSignup){ startActivity(new Intent(Parentlogin.this, Parentsignup.class)); } } private void userLogin() { //getting all the inputs from the user String email = editTextEmail.getText().toString().trim(); String password = editTextPassword.getText().toString().trim(); //validation if (TextUtils.isEmpty(email)){ Toast.makeText(this, "Please enter email!", Toast.LENGTH_SHORT).show(); return; } if (TextUtils.isEmpty(password)){ Toast.makeText(this, "Please enter password!", Toast.LENGTH_SHORT).show(); return; } if (password.length() <= 5){ Toast.makeText(this, "Password must be more than 5 characters!", Toast.LENGTH_SHORT).show(); return; } progressDialog.setMessage("Signing in, Please Wait..."); progressDialog.show(); firebaseAuth.signInWithEmailAndPassword(email, password) .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()){ finish(); progressDialog.hide(); startActivity(new Intent(getApplicationContext(), selectDevice.class)); } else { Toast.makeText(Parentlogin.this, "Invalid Credentials!", Toast.LENGTH_SHORT).show(); progressDialog.hide(); } } }); } }
[ "35198987+CyberneticsBd@users.noreply.github.com" ]
35198987+CyberneticsBd@users.noreply.github.com
d17e1b58e0cfa25af689a4c52eb99a3f80606d95
27d516b97627fc66f22c463bd4e04635b43b1d91
/app/src/main/java/view/local/zz/customviews/views/baseegl/GlError.java
88844841a18d5f741410b9a0e5e243d34ea3d214
[]
no_license
XiFanYin/CustomViews
7c629611ec60f2c797e3c3bb483c5739d28e5d51
dca7bb0eddeb5f35a02d93bf80e48cc3c2cbb5a4
refs/heads/master
2022-06-16T22:53:28.715273
2022-06-09T07:31:36
2022-06-09T07:31:36
139,921,498
2
1
null
null
null
null
UTF-8
Java
false
false
373
java
package view.local.zz.customviews.views.baseegl; public enum GlError { OK(0,"ok"), ConfigErr(101,"config not support"); int code; String msg; GlError(int code, String msg){ this.code=code; this.msg=msg; } public int value(){ return code; } @Override public String toString() { return msg; } }
[ "807142217@qq.com" ]
807142217@qq.com
6bf6d3fac10a03e2d32ec4abc40343e2e725d413
49fbea5078427bc98a5f4eac19e0dfa48170f705
/app/src/main/java/com/example/matthewsykes/tapdaat/MainActivity.java
8f24c5030be53cd0f0e640ffaaa7ef1d165a0c66
[]
no_license
bexsive/Tap_Daat
adfe757831d220de58aba8326a38a1fc5e52357a
33aabe0a51f48ee4a70202deb833dad3a4b026fc
refs/heads/master
2016-08-11T21:35:15.205485
2015-09-30T23:56:25
2015-09-30T23:56:25
43,459,458
1
0
null
null
null
null
UTF-8
Java
false
false
1,130
java
package com.example.matthewsykes.tapdaat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "bexsive@gmail.com" ]
bexsive@gmail.com
3362f8579a4b2970150000f260ec60ef8ac2c894
6829b8608dbda8aa16db9dd3df9b71024141339b
/o2b2/src/o2b2/Raspberry_Socket.java
2aa3bca5c71972b7bab95892fffb071c8880363e
[]
no_license
0318jin/O2B2Project
27514e6de737ea62ae962fdd012b1ba0c1c80d30
ff319503ace9966020c67a8971169098a5417d98
refs/heads/master
2021-02-15T01:13:23.906850
2020-04-08T02:26:54
2020-04-08T02:26:54
244,850,904
0
1
null
null
null
null
UHC
Java
false
false
1,663
java
package o2b2; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; import java.text.SimpleDateFormat; import java.util.Calendar; public class Raspberry_Socket { public Raspberry_Socket() { SingleTon sR = SingleTon.getInstanse(); //ํ˜„์žฌ ์‹œ๊ฐ„ ๊ฐ€์ ธ์˜ค๊ธฐ ๋ถ€๋ถ„ SimpleDateFormat format1 = new SimpleDateFormat ( "yyyy-MM-dd"); Calendar time = Calendar.getInstance(); String nowDate = format1.format(time.getTime()); System.out.println(nowDate); while (true) { try { ServerSocket serversock = new ServerSocket(8888); System.out.println("ํด๋ผ์ด์–ธํŠธ ์ ‘์† ๋Œ€๊ธฐ ์ค‘..."); Socket socket = serversock.accept(); System.out.println("ํด๋ผ์ด์–ธํŠธ ์ ‘์†"); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream())); PrintWriter out = new PrintWriter(socket.getOutputStream(), true); sR.raspStudyTime_singleTon = in.readLine(); System.out.println("Received : " + sR.raspStudyTime_singleTon); out.println("Echo : " + sR.raspStudyTime_singleTon); System.out.println("Send : " + sR.raspStudyTime_singleTon); socket.close(); serversock.close(); String studyTime = sR.raspStudyTime_singleTon; String[] array; if(studyTime !=null) { studyTime = studyTime.trim(); array = studyTime.split(":"); String serialnum ="1"; String subject = "0"; Insert_RealStudyTime.insert(serialnum, array[1], nowDate, subject); } } catch (IOException e) { e.printStackTrace(); } } } }
[ "csh5362@gmail.com" ]
csh5362@gmail.com
b040b41aa6788d3a9ceb104a787e3cdca7e0201d
783d4ba61b16d6fef4caf9e05cbc450afb54a423
/EditShopDomain/src/main/java/vo/ReviewVo.java
f5732826afeb3d883124cd9c49ef1e3b39e01b63
[]
no_license
yong87/editshop
beb66ace0aac726cb887bac0d67a9ab91837c2e2
11464dc4579f2779e6cbfd1bf56d3025528aafb3
refs/heads/master
2021-01-17T12:35:44.447492
2016-07-22T07:00:19
2016-07-22T07:00:19
59,539,940
2
0
null
null
null
null
UTF-8
Java
false
false
1,464
java
package vo; import java.sql.Timestamp; public class ReviewVo { private String ordernumber; private String content; private int point; private int like; private int hate; private Timestamp writetime; public ReviewVo(String ordernumber, String content, int point, int like, int hate, Timestamp writetime) { super(); this.ordernumber = ordernumber; this.content = content; this.point = point; this.like = like; this.hate = hate; this.writetime = writetime; } public ReviewVo() { super(); } public String getOrdernumber() { return ordernumber; } public void setOrdernumber(String ordernumber) { this.ordernumber = ordernumber; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public int getPoint() { return point; } public void setPoint(int point) { this.point = point; } public int getLike() { return like; } public void setLike(int like) { this.like = like; } public int getHate() { return hate; } public void setHate(int hate) { this.hate = hate; } public Timestamp getWritetime() { return writetime; } public void setWritetime(Timestamp writetime) { this.writetime = writetime; } @Override public String toString() { return "ReviewVo [ordernumber=" + ordernumber + ", content=" + content + ", point=" + point + ", like=" + like + ", hate=" + hate + ", writetime=" + writetime + "]"; } }
[ "qwe@192.168.0.4" ]
qwe@192.168.0.4
1105aa0a2fa6347956932ac013e492c269d807c7
a306f79281c4eb154fbbddedea126f333ab698da
/com/facebook/litho/sections/LoadingEvent.java
f2c481df7ac565eaadf533a162944ceccdf5b090
[]
no_license
pkcsecurity/decompiled-lightbulb
50828637420b9e93e9a6b2a7d500d2a9a412d193
314bb20a383b42495c04531106c48fd871115702
refs/heads/master
2022-01-26T18:38:38.489549
2019-05-11T04:27:09
2019-05-11T04:27:09
186,070,402
0
0
null
null
null
null
UTF-8
Java
false
false
668
java
package com.facebook.litho.sections; import com.facebook.litho.annotations.Event; import javax.annotation.Nullable; @Event public class LoadingEvent { public boolean isEmpty; public LoadingEvent.LoadingState loadingState; @Nullable public Throwable t; public static enum LoadingState { // $FF: synthetic field private static final LoadingEvent.LoadingState[] $VALUES = new LoadingEvent.LoadingState[]{INITIAL_LOAD, LOADING, SUCCEEDED, FAILED}; FAILED("FAILED", 3), INITIAL_LOAD("INITIAL_LOAD", 0), LOADING("LOADING", 1), SUCCEEDED("SUCCEEDED", 2); private LoadingState(String var1, int var2) {} } }
[ "josh@pkcsecurity.com" ]
josh@pkcsecurity.com
ee16699a4b017fd18768e54fc545f4f6219c2e72
97748311ae438e87ed12013fefa31bf64a675ef5
/service-product/src/main/java/co/com/poli/store/product/repositories/ProductRepository.java
04958e70f8cd2fde7b0003bd77ddd6543e129dab
[]
no_license
Malcak/store-spring
9d9a4ad97e5c9d0f1e8bc79bdd48859cf0585ca4
5ff0efe82b06447e9e59c7eaa8fa12f6a7fa938b
refs/heads/main
2023-06-16T01:47:28.937889
2021-07-03T09:25:36
2021-07-03T09:25:36
382,576,156
0
0
null
null
null
null
UTF-8
Java
false
false
432
java
package co.com.poli.store.product.repositories; import co.com.poli.store.product.entities.Category; import co.com.poli.store.product.entities.Product; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface ProductRepository extends JpaRepository<Product, Long> { List<Product> findByCategory(Category category); }
[ "malcakx@gmail.com" ]
malcakx@gmail.com
4b2b9b8cd27c0db8bc1384b7e12507e2ca852f91
aef98469b2531c54ab16eadbfa66d6905cd8e262
/mainProject/src/main/java/com/erip/config/WebfluxConfig.java
7e9edad0af26d8697f72e4b50bdccc3766002cb6
[]
no_license
AlexBobko/erip
d6f950c56c020155b37207ce6b398e9b6a9f1f4e
5f2bbd6a90b5cb873197fc72343684a909bb325a
refs/heads/master
2020-11-24T23:37:20.160889
2019-12-16T13:32:31
2019-12-16T13:32:31
228,390,687
1
0
null
null
null
null
UTF-8
Java
false
false
772
java
package com.erip.config; import org.springframework.context.annotation.Configuration; import org.springframework.web.reactive.config.ResourceHandlerRegistry; import org.springframework.web.reactive.config.WebFluxConfigurer; @Configuration public class WebfluxConfig implements WebFluxConfigurer { // @Bean // CustomerController controller() { // return new CustomerController(customerService()); // } @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/swagger-ui.html**") .addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/"); } }
[ "bobko.a.n@gmail.com" ]
bobko.a.n@gmail.com
8e03dfb2c1c831f55a9bbf19f7a88b40540a775a
cdf59519d0acbcd9d7a90dde9fa9afe514f25c27
/src/main/java/org/lw/mavendemo/sys/utils/DBUtil.java
5e7c6344b8e08d9f8a9ff739d1c83b6d824a126b
[]
no_license
yangxin114/mavenDemo
19f7f7135b367e15622fe7e235d597e5fb90912d
bcf189624dee3e1fac06b19d103f1ff5c52be56d
refs/heads/master
2021-01-23T13:23:08.625709
2013-11-25T10:03:05
2013-11-25T10:03:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
613
java
package org.lw.mavendemo.sys.utils; public class DBUtil { public static String USER_PREFIX = "UR"; public static String ROLE_PREFIX = "RL"; public static String RESOURCE_PREFIX = "RES"; public static String PERMISSION_PREFIX = "PERM"; public static int INIT_NUM = 10000001; public static String genericUserNo(String lastUserNo) { return genericNo(USER_PREFIX, lastUserNo); } private static String genericNo(String prefix, String lastNo) { if (lastNo == null) { return prefix + INIT_NUM; } else { return prefix + Integer.parseInt(lastNo.replace(prefix, "")); } } }
[ "yangxin114@126.com" ]
yangxin114@126.com
7b2c8a772693ef4da9a55456f77d257d747103fd
94d91903819947c4fb2598af40cf53344304dbac
/wssmall_1.2.0/.svn/pristine/2d/2dee1f8fd714b5748bf6f6946638fb275ed92de7.svn-base
2bcea3b09afbafd9434fcfdc118268451ed2d06c
[]
no_license
lichao20000/Union
28175725ad19733aa92134ccbfb8c30570f4795a
a298de70065c5193c98982dacc7c2b3e2d4b5d86
refs/heads/master
2023-03-07T16:24:58.933965
2021-02-22T12:34:05
2021-02-22T12:34:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
925
package zte.net.common.params.req; import params.ZteRequest; import zte.net.common.params.resp.ZteVoInsertResponse; import com.ztesoft.api.ApiRuleException; import com.ztesoft.net.framework.database.NotDbField; /** * * @author wu.i * ๅฎžไฝ“ๅฏน่ฑกๆŸฅ่ฏข๏ผŒๅ…ฅๅ‚ๅฏน่ฑก * @param <T> * */ public class ZteVoInsertRequest extends ZteRequest<ZteVoInsertResponse> { private Object serObject; private String table_name; public Object getSerObject() { return serObject; } public void setSerObject(Object serObject) { this.serObject = serObject; } public String getTable_name() { return table_name; } public void setTable_name(String table_name) { this.table_name = table_name; } @Override @NotDbField public void check() throws ApiRuleException { // TODO Auto-generated method stub } @Override @NotDbField public String getApiMethodName() { return "zte.net.vo.insert"; }}
[ "hxl971230.outlook.com" ]
hxl971230.outlook.com
23aca13713ebee2c190faec4d610c3f00c44cdee
61fc50078d62cb2638204d3ff070cebcca08923a
/pglp_5_1/src/main/java/priscille/pglp_5_1/Dao.java
a801987a25f12646667826d637b50af40d2d3033
[]
no_license
priscdls/pglp_5.1
52dbd697a7bf38edf95dbfe148e39fbe94a6d76b
1cdf7b8cb8614173a22ac5aa32f993abd5129eee
refs/heads/master
2021-04-23T21:01:59.944939
2020-04-23T21:57:41
2020-04-23T21:57:41
250,003,322
0
0
null
2020-10-13T20:39:02
2020-03-25T14:37:38
Java
UTF-8
Java
false
false
839
java
package priscille.pglp_5_1; import java.util.ArrayList; import java.util.Map; public interface Dao<T> { /** * Retourne le personnel recherchรฉ. * @param id L'identifiant du personnel * @return Le personnel trouvรฉ */ T get(int id); /** * Retourne la liste du personnel. * @return La liste du personnel. */ ArrayList<T> getAll(); /** * Ajoute un membre a la liste du personnel. * @param t Le membre a ajouter */ void ajouter(T t); /** * Modifie un membre du personnel * de la liste. * @param t Le membre a modifier * @param params Le parametre a modifier */ void update(T t, Map<String, Object> params); /** * Retire un membre de la liste du personnel. * @param t Le membre a retirer */ void retirer(T t); }
[ "priscilledaoulas@gmail.com" ]
priscilledaoulas@gmail.com
38fdf5091596d6919152a89f807b83c26e45b9db
6d8f15cf5b0f19685d101b0093431dc0aae87f86
/telenoetica.field.service.app.persistence/src/main/java/com/telenoetica/jpa/repositories/JobHistoryDAO.java
3dfead5f4435d1fee048fd090dc2299266b46675
[]
no_license
spkhillar/demo-field-app
81da6857abb9e9b51e07880fddf084d273134af7
4b0518825565aa08aac83f050e30f7cec6f08b3c
refs/heads/master
2020-12-24T16:50:12.331434
2013-11-01T16:25:24
2013-11-01T16:25:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
557
java
/* * Copyright (C) 2013 Telenoetica, Inc. All rights reserved */ package com.telenoetica.jpa.repositories; import java.util.Date; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import com.telenoetica.jpa.entities.JobHistory; /** * The Interface JobHistoryDAO. * * @author Shiv Prasad Khillar */ public interface JobHistoryDAO extends JpaRepository<JobHistory, Long> { List<JobHistory> findByJobNameAndStartTimeBetween(String jobName, Date startDate, Date endDate); JobHistory findById(Long id); }
[ "shivprasad.khillar@gmail.com" ]
shivprasad.khillar@gmail.com
4a1db04910870d1a7059e2d5d6ce3a894e7ca56c
dd4b005de0d3112725fe8ff4d81b377589da8ea5
/twitter-core/src/main/java/com/twitter/sdk/android/core/internal/scribe/EventsFilesManager.java
a4a9bfd75620f844471b2fc0382eea65fb551596
[]
no_license
MaryMargarethDomingo/ProjectDapa
dfad9cfe1624723325035ef6fa41354c9b66d991
6d193b2f77461daa30f8de6a6ea61dea6ded3d3d
refs/heads/master
2022-11-29T18:58:24.165289
2018-07-27T17:03:20
2018-07-27T17:03:20
280,859,370
0
0
null
null
null
null
UTF-8
Java
false
false
9,011
java
/* * Copyright (C) 2015 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.twitter.sdk.android.core.internal.scribe; import android.content.Context; import android.util.Log; import com.twitter.sdk.android.core.Twitter; import com.twitter.sdk.android.core.internal.CommonUtils; import com.twitter.sdk.android.core.internal.CurrentTimeProvider; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.TreeSet; import java.util.concurrent.CopyOnWriteArrayList; /** * Manages files containing events. This includes, writing events to them * and periodically (size or time triggered) rolling them over to a target directory. */ public abstract class EventsFilesManager<T> { public static final String ROLL_OVER_FILE_NAME_SEPARATOR = "_"; public static final int MAX_BYTE_SIZE_PER_FILE = 8000; public static final int MAX_FILES_IN_BATCH = 1; public static final int MAX_FILES_TO_KEEP = 100; protected final Context context; protected final EventTransform<T> transform; protected final CurrentTimeProvider currentTimeProvider; protected final EventsStorage eventStorage; private final int defaultMaxFilesToKeep; protected volatile long lastRollOverTime; protected final List<EventsStorageListener> rollOverListeners = new CopyOnWriteArrayList<>(); /** * @param context Context to use for file access * @param transform EventTransform used to convert events to bytes for storage * @param currentTimeProvider CurrentTimeProvider that defines how we determine time * @param eventStorage EventsStorage into which we will store events * @param defaultMaxFilesToKeep int defining the maximum number of storage files we will buffer * on device. This is useful for providing a constant maximum, or * a default value that varies based on overriding * {@link #getMaxFilesToKeep()} * @throws IOException */ EventsFilesManager(Context context, EventTransform<T> transform, CurrentTimeProvider currentTimeProvider, EventsStorage eventStorage, int defaultMaxFilesToKeep) throws IOException { this.context = context.getApplicationContext(); this.transform = transform; this.eventStorage = eventStorage; this.currentTimeProvider = currentTimeProvider; lastRollOverTime = this.currentTimeProvider.getCurrentTimeMillis(); this.defaultMaxFilesToKeep = defaultMaxFilesToKeep; } public void writeEvent(T event) throws IOException { final byte[] eventBytes = transform.toBytes(event); rollFileOverIfNeeded(eventBytes.length); eventStorage.add(eventBytes); } /** * Register a listener for session analytics file roll over events that may get triggered * due to the file reaching threshold size. */ public void registerRollOverListener(EventsStorageListener listener){ if (listener != null) { rollOverListeners.add(listener); } } /** * Trigger a file roll over. Returns <code>true</code> if events existed and a roll-over file was created. * Returns <code>false</code> if no events existed and a roll-over file was not created. */ public boolean rollFileOver() throws IOException { boolean fileRolledOver = false; String targetFileName = null; // if the current active file is empty, don't roll it over, however // still trigger listeners as they may be interested in the fact that an event were fired if (!eventStorage.isWorkingFileEmpty()){ targetFileName = generateUniqueRollOverFileName(); eventStorage.rollOver(targetFileName); CommonUtils.logControlled(context, Log.INFO, Twitter.TAG, String.format(Locale.US, "generated new file %s", targetFileName) ); lastRollOverTime = currentTimeProvider.getCurrentTimeMillis(); fileRolledOver = true; } triggerRollOverOnListeners(targetFileName); return fileRolledOver; } /** * Roll-over active session analytics file if writing new event will put it over our target * limit. * * @param newEventSizeInBytes size of event to be written */ private void rollFileOverIfNeeded(int newEventSizeInBytes) throws IOException{ if (!eventStorage.canWorkingFileStore(newEventSizeInBytes, getMaxByteSizePerFile())) { final String msg = String.format(Locale.US, "session analytics events file is %d bytes," + " new event is %d bytes, this is over flush limit of %d," + " rolling it over", eventStorage.getWorkingFileUsedSizeInBytes(), newEventSizeInBytes, getMaxByteSizePerFile()); CommonUtils.logControlled(context, Log.INFO, Twitter.TAG, msg); rollFileOver(); } } protected abstract String generateUniqueRollOverFileName(); /** * This method can be overridden by subclasses to vary the maximum file count value used * during file clean-up. */ protected int getMaxFilesToKeep() { return defaultMaxFilesToKeep; } protected int getMaxByteSizePerFile() { return MAX_BYTE_SIZE_PER_FILE; } public long getLastRollOverTime() { return lastRollOverTime; } private void triggerRollOverOnListeners(String rolledOverFile){ for (EventsStorageListener eventStorageRollOverListener : rollOverListeners){ try { eventStorageRollOverListener.onRollOver(rolledOverFile); } catch (Exception e){ CommonUtils.logControlledError(context, "One of the roll over listeners threw an exception", e); } } } public List<File> getBatchOfFilesToSend(){ return eventStorage.getBatchOfFilesToSend(MAX_FILES_IN_BATCH); } public void deleteSentFiles(List<File> files){ eventStorage.deleteFilesInRollOverDirectory(files); } public void deleteAllEventsFiles(){ eventStorage.deleteFilesInRollOverDirectory( eventStorage.getAllFilesInRollOverDirectory()); eventStorage.deleteWorkingFile(); } public void deleteOldestInRollOverIfOverMax(){ final List<File> allFiles = eventStorage.getAllFilesInRollOverDirectory(); final int maxFiles = getMaxFilesToKeep(); if (allFiles.size() <= maxFiles) { return; } final int numberOfFilesToDelete = allFiles.size() - maxFiles; CommonUtils.logControlled(context, String.format(Locale.US, "Found %d files in " + " roll over directory, this is greater than %d, deleting %d oldest files", allFiles.size(), maxFiles, numberOfFilesToDelete)); final TreeSet<FileWithTimestamp> sortedFiles = new TreeSet<>( (arg0, arg1) -> (int) (arg0.timestamp - arg1.timestamp)); for (File file : allFiles){ final long creationTimestamp = parseCreationTimestampFromFileName(file.getName()); sortedFiles.add(new FileWithTimestamp(file, creationTimestamp)); } final ArrayList<File> toDelete = new ArrayList<>(); for (FileWithTimestamp fileWithTimestamp : sortedFiles){ toDelete.add(fileWithTimestamp.file); if (toDelete.size() == numberOfFilesToDelete){ break; } } eventStorage.deleteFilesInRollOverDirectory(toDelete); } public long parseCreationTimestampFromFileName(String fileName){ final String[] fileNameParts = fileName.split(ROLL_OVER_FILE_NAME_SEPARATOR); if (fileNameParts.length != 3) { return 0; } try { return Long.valueOf(fileNameParts[2]); } catch (NumberFormatException e) { return 0; } } static class FileWithTimestamp{ final File file; final long timestamp; FileWithTimestamp(File file, long timestamp) { this.file = file; this.timestamp = timestamp; } } }
[ "michael.cadavillo@gmail.com" ]
michael.cadavillo@gmail.com
285a44b1de2ad9b1b8049dc96174224d92580e92
53f895ac58cb7c9e1e8976c235df9c4544e79d33
/07_Instance Variables & Methods (115 - 138 in Section2)/com/source/instance/var/Q.java
38dfa260fa7860a27288da5a432e18a0e2ff6331
[]
no_license
alagurajan/CoreJava
c336356b45cdbcdc88311efbba8f57503e050b66
be5a8c2a60aac072f777d8b0320e4c94a1266cb3
refs/heads/master
2021-01-11T01:33:11.447570
2016-12-16T22:24:58
2016-12-16T22:24:58
70,690,915
0
0
null
null
null
null
UTF-8
Java
false
false
279
java
package com.source.instance.var; public class Q { int i; public static void main(String[] args) { Q q1 = new Q(); q1.i=10; Q q2 = q1; System.out.println(q2.i); q2.i=20; Q q3 = q2; System.out.println(q3.i); System.out.println(q1.i); } }
[ "aalagurajan@gmail.com" ]
aalagurajan@gmail.com
a4a0c77c33d56d4e2f182e28ac28b0e1a76658f0
de90bab2303f8f9ecbf6b9b002c68baad64c25af
/backend/src/main/java/com/devsuperior/dspesquisa/services/GameService.java
a0bbd1a1097f9846b2984798b5697c85b043f287
[]
no_license
Matheus-Ferreira95/Semana-DevSuperior
524a50f4ade61308562f3f916014833c0d572ec1
716c228be7de9e3b3ca609524c74895266169122
refs/heads/master
2022-12-17T17:37:05.872360
2020-09-20T23:40:16
2020-09-20T23:40:16
295,785,560
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package com.devsuperior.dspesquisa.services; import java.util.List; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.devsuperior.dspesquisa.dto.GameDTO; import com.devsuperior.dspesquisa.entities.Game; import com.devsuperior.dspesquisa.repositories.GameRepository; @Service public class GameService { @Autowired private GameRepository repository; @Transactional(readOnly = true) public List<GameDTO> findAll(){ List<Game>list = repository.findAll(); return list.stream().map(x -> new GameDTO(x)).collect(Collectors.toList()); // fazemos isso para transformar cada objeto da nossa lista de game em gameDTO } }
[ "matheus_fsilva05@hotmail.com" ]
matheus_fsilva05@hotmail.com
36a1f5d3fc3e109880d2c3fbedb66021b6c81b2e
7528eeeabbc25f3014d9de875e4f6b69bc0bf0f1
/iTrust/iTrust/httptests/edu/ncsu/csc/itrust/http/DocumentOfficeVisitUseCaseTest.java
95eacf102f01f6e07d6e6dd94cb09c7fa7b3a77e
[]
no_license
locklearm/resume
95a32b3852db190611d7b401031d2a0c91a9bac8
7337ea61b5912c23d76eb5324751a538a8b2402f
refs/heads/master
2021-01-19T06:49:51.506240
2015-01-09T22:38:11
2015-01-09T22:38:11
29,026,167
1
0
null
null
null
null
UTF-8
Java
false
false
5,767
java
package edu.ncsu.csc.itrust.http; import com.meterware.httpunit.WebConversation; import com.meterware.httpunit.WebForm; import com.meterware.httpunit.WebResponse; import com.meterware.httpunit.WebTable; import edu.ncsu.csc.itrust.enums.TransactionType; /** * test DocumentOfficeVisit * Use Case 11 * * @ author student * */ public class DocumentOfficeVisitUseCaseTest extends iTrustHTTPTest { @Override protected void setUp() throws Exception{ super.setUp(); gen.clearAllTables(); gen.standardData(); } /** * Test AddLabProcedure * @throws Exception */ public void testAddLabProcedure() throws Exception { // login UAP WebConversation wc = login("8000000009", "pw"); WebResponse wr = wc.getCurrentPage(); assertEquals("iTrust - UAP Home", wr.getTitle()); // click Document Office Visit wr = wr.getLinkWith("Document Office Visit").click(); // choose patient 2 WebForm patientForm = wr.getForms()[0]; patientForm.getScriptableObject().setParameterValue("UID_PATIENTID", "2"); patientForm.getButtons()[1].click(); wr = wc.getCurrentPage(); assertEquals(ADDRESS + "auth/hcp-uap/documentOfficeVisit.jsp", wr.getURL().toString()); // click 06/10/2007 wr.getLinkWith("06/10/2007").click(); wr = wc.getCurrentPage(); assertEquals(ADDRESS + "auth/hcp-uap/editOfficeVisit.jsp?ovID=955", wr.getURL().toString()); assertEquals("iTrust - Document Office Visit", wr.getTitle()); //add new lab procedure WebForm form = wr.getFormWithID("labProcedureForm"); form.setParameter("loinc", "10666-6"); form.setParameter("labTech", "5000000001"); form.getSubmitButton("addLP").click(); wr = wc.getCurrentPage(); assertEquals("iTrust - Document Office Visit", wr.getTitle()); assertTrue(wr.getText().contains("information successfully updated")); } /** * Test RemoveLabProcedure * @throws Exception */ public void testRemoveLabProcedure() throws Exception { // login UAP WebConversation wc = login("8000000009", "pw"); WebResponse wr = wc.getCurrentPage(); assertEquals("iTrust - UAP Home", wr.getTitle()); // click Document Office Visit wr = wr.getLinkWith("Document Office Visit").click(); // choose patient 2 WebForm patientForm = wr.getForms()[0]; patientForm.getScriptableObject().setParameterValue("UID_PATIENTID", "2"); patientForm.getButtons()[1].click(); wr = wc.getCurrentPage(); assertEquals(ADDRESS + "auth/hcp-uap/documentOfficeVisit.jsp", wr.getURL().toString()); // click 10/10/2005 wr.getLinkWith("06/10/2007").click(); wr = wc.getCurrentPage(); assertEquals(ADDRESS + "auth/hcp-uap/editOfficeVisit.jsp?ovID=955", wr.getURL().toString()); assertEquals("iTrust - Document Office Visit", wr.getTitle()); //remove lab procedure WebTable wt = wr.getTableStartingWith("[Top]Laboratory Procedures"); assertFalse(wt.getText().contains("No Laboratory Procedures on record")); //click the remove link wt = wr.getTableStartingWith("[Top]Laboratory Procedures"); wr = wt.getTableCell(2, 10).getLinkWith("Remove").click(); // confirm delete assertEquals("iTrust - Delete Lab Procedure", wr.getTitle()); WebForm form = wr.getFormWithID("deleteLabProcedureForm"); form.getButtonWithID("confirmDelete").click(); wr = wc.getCurrentPage(); assertLogged(TransactionType.OFFICE_VISIT_EDIT, 8000000009L, 2L, "Office visit"); assertEquals("iTrust - Document Office Visit", wr.getTitle()); assertTrue(wr.getText().contains("information successfully updated")); // Cannot remove the next lab procedure--it is not in the In_Transit or // Received states. wt = wr.getTableStartingWith("[Top]Laboratory Procedures"); assertEquals(null, wt.getTableCell(2, 10).getLinkWith("Remove")); /*wr = wt.getTableCell(2, 9).getLinkWith("Remove").click(); assertLogged(TransactionType.OFFICE_VISIT_EDIT, 8000000009L, 2L, "Office visit"); assertEquals("iTrust - Document Office Visit", wr.getTitle()); assertTrue(wr.getText().contains("information successfully updated"));*/ assertLogged(TransactionType.OFFICE_VISIT_VIEW, 8000000009L, 2L, "Office visit"); wt = wr.getTableStartingWith("[top]Laboratory Procedures"); assertFalse(wt.getText().contains("No Laboratory Procedures on record")); } public void testAddDiagnosisBlank() throws Exception { // login UAP WebConversation wc = login("9000000000", "pw"); WebResponse wr = wc.getCurrentPage(); assertEquals("iTrust - HCP Home", wr.getTitle()); // click All Patients wr = wr.getLinkWith("All Patients").click(); // Select Trend Setter wr = wr.getLinkWith("Trend Setter").click(); // Edit visit wr = wr.getLinkWith("Aug 30, 2011").click(); // Submit add diagnosis form WebForm diagnosisForm = wr.getFormWithID("diagnosisForm"); wr = diagnosisForm.submit(); // Should show a validation error assertNotNull(wr.getElementWithID("iTrustFooter")); assertNotNull(wr.getElementWithID("diagnosisForm")); } public void testAddDiagnosisGood() throws Exception { // login UAP WebConversation wc = login("9000000000", "pw"); WebResponse wr = wc.getCurrentPage(); assertEquals("iTrust - HCP Home", wr.getTitle()); // click All Patients wr = wr.getLinkWith("All Patients").click(); // Select Trend Setter wr = wr.getLinkWith("Trend Setter").click(); // Edit visit wr = wr.getLinkWith("Aug 30, 2011").click(); // Submit add diagnosis form for tuberculosis WebForm diagnosisForm = wr.getFormWithID("diagnosisForm"); diagnosisForm.setParameter("ICDCode", "11.40"); wr = diagnosisForm.submit(); // Should not show any validation errors assertNotNull(wr.getElementWithID("iTrustFooter")); assertTrue(wr.getText().contains("Diagnosis information successfully updated")); } }
[ "melockle@ncsu.edu" ]
melockle@ncsu.edu
1a1a7343e43509be71d9e6739180c71e4d263fb6
91482ae04a4473528ebe26eeec5e39d21f781f4b
/PolovniAutomobili/app/src/main/java/stefan/marinkov/polovniautomobili/Car.java
a7e26e177ea4a46c53baf82e2bedec96c775ebe6
[]
no_license
StefanM126/AndroidLessons
3474bf491ae0bc2d9a1f1d4e3c5d1de339162e4e
d761b351f602c436529b789e8222389465c4eec7
refs/heads/master
2023-05-02T18:22:40.757517
2021-05-18T15:46:13
2021-05-18T15:46:13
349,385,371
0
0
null
null
null
null
UTF-8
Java
false
false
1,053
java
package stefan.marinkov.polovniautomobili; public class Car { private String mBrand; private String mModel; private int mYear; private int mKM; private int mID; public Car(String mBrand, String mModel, int mYear, int mKM, int mID) { this.mBrand = mBrand; this.mModel = mModel; this.mYear = mYear; this.mKM = mKM; this.mID = mID; } public String getmBrand() { return mBrand; } public String getmModel() { return mModel; } public int getmYear() { return mYear; } public int getmKM() { return mKM; } public int getmID() { return mID; } public void setmBrand(String mBrand) { this.mBrand = mBrand; } public void setmModel(String mModel) { this.mModel = mModel; } public void setmYear(int mYear) { this.mYear = mYear; } public void setmKM(int mKM) { this.mKM = mKM; } public void setmID(int mID) { this.mID = mID; } }
[ "marinkovstefan99@gmail.com" ]
marinkovstefan99@gmail.com
a5060ff70941b05ff2499a4a8268edfa134fcecd
150a393ddb886c3ee3ce0355e4bcfc5f2b0e44bf
/src/main/java/com/SpringShop/demo/Entity/Design.java
0841a1712b75790f884a0d6951e211cf29bc0996
[]
no_license
KacperKromka/SpringShop
119854cb999c360514a69d2e75c8334a4a00ac86
4650d737ef60ae85f90ce5efbe6746d0735da84c
refs/heads/main
2023-04-10T23:08:49.943506
2021-04-15T19:31:19
2021-04-15T19:31:19
349,125,294
0
0
null
null
null
null
UTF-8
Java
false
false
580
java
package com.SpringShop.demo.Entity; import lombok.AccessLevel; import lombok.Data; import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Data @RequiredArgsConstructor @NoArgsConstructor(access = AccessLevel.PRIVATE, force = true) @Entity public class Design { @Id private final long id; private final String name; private final Type type; public enum Type { BLACKWHITE, COLOR } }
[ "kacper.kromkaa@gmail.com" ]
kacper.kromkaa@gmail.com
15d2aeea3556b9f8ce756f92daf0d55468db88ee
c34181d72eaa3449a40ae0a9bef60f4d2815bdba
/java-base-system/java-base-thread/src/main/java/com/mmc/java/base/system/thread/jmm/sample/NoSafeMain.java
52b263396badb876be324618f08272724e5f0a0f
[]
no_license
gaowei0115/java-base
a519468664a3da2ec3dc6a99b0458c65a75d66c1
4ba904f76562b276569f16278bed688984594819
refs/heads/master
2020-12-02T06:33:25.542176
2017-10-16T09:51:58
2017-10-16T09:51:58
96,853,512
1
0
null
null
null
null
UTF-8
Java
false
false
859
java
// Copyright (C) 2017-2017 GGWW All rights reserved package com.mmc.java.base.system.thread.jmm.sample; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * className: NoSafeMain<br/> * Description: <br/> * Author: GW<br/> * CreateTime๏ผš 2017ๅนด8ๆœˆ14ๆ—ฅ<br/> * * History: (version) Author DateTime Note <br/> */ public class NoSafeMain { /** * Description๏ผš<br/> * Author๏ผšGW<br/> * History: (version) Author DateTime Note <br/> * @param args */ public static void main(String[] args) { NoSafeThread noSafeThread = new NoSafeThread(); int nThreads = 10; ExecutorService es = Executors.newFixedThreadPool(nThreads); for (int i = 0; i < nThreads; i++) { es.execute(noSafeThread); } es.shutdown(); System.out.println(noSafeThread.getState()); } }
[ "gao_wei0115@sina.com" ]
gao_wei0115@sina.com
0a2c3408bfa6ec116bbdb1da486f6be79162e2fe
23cd327d97900ce0e5b0c071a2e4a6cbcc3d9950
/entitymeta/metaandrepositoryservice/src/main/java/org/livem/dao/Query2.java
55aecf865920a9babc9df0c8676ff2e6180e168f
[]
no_license
lmlive/fastframework
742568c3da78292a3395913cb74cd18041dbd0fc
f4726b227f552697c3471d0927e2b66a4efaf657
refs/heads/master
2020-03-26T04:38:14.120129
2018-11-03T14:15:40
2018-11-03T14:15:40
144,513,978
0
0
null
null
null
null
UTF-8
Java
false
false
1,011
java
package org.livem.dao; import java.util.Collection; import java.util.Date; import java.util.List; public interface Query2<T> { Query2 addLinkQuery(String propertyName, Query2 query); Query2 eq(String propertyName, Object value); Query2 or(List<String> propertyName, Object value); Query2 orLike(List<String> propertyName, String value); Query2 isNull(String propertyName); Query2 isNotNull(String propertyName); Query2 notEq(String propertyName, Object value); Query2 notIn(String propertyName, Collection value); Query2 like(String propertyName, String value); Query2 between(String propertyName, Object lo, Object go); Query2 le(String propertyName, Object value); Query2 lt(String propertyName, Object value); Query2 ge(String propertyName, Object value); Query2 gt(String propertyName, Object value); Query2 in(String propertyName, Collection value); Long count(); void addOrder(String propertyName, String order); }
[ "live_lm@live.cn" ]
live_lm@live.cn
c6cc011780992ef2748b1e6cc10e4a6e5afdc44d
aa424ea451ae34fb82c259ab0d40d8d7dd8fdbb8
/src/com/jatools/vo/stock/ProcChangeNewline.java
afe4fcd9c022c606a6347e6c73072e2802ee7dc1
[]
no_license
lejingw/wlscm
494fc3e8b39cd4ff5d20854f48a629c3c92842e8
f152aaf93657e712722283f53a6bd62091398799
refs/heads/master
2020-12-24T16:50:31.168377
2013-11-08T09:35:58
2013-11-08T09:35:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,246
java
package com.jatools.vo.stock; /** * ๅฝขๆ€่ฝฌๆข ๆ–ฐ่กŒ่กจ * @author ren.ming * Created 2011-11-28 */ public class ProcChangeNewline { private String lineid ; // n lineid private String billid ; // n ๅ•ๆฎid private String rowId ; // y ่กŒๅท private String materialType ; //(20) y ๅŽŸๆ–™็ฑปๅž‹ private String itemClassId ; // y ๅคง็ฑปid private String ornaClassId ; // y ๅฐ็ฑปid private String status ; // y ็Šถๆ€ private String memo ; //(1000) y ๅค‡ๆณจ private String createDate ; //(20) y ๅˆ›ๅปบๆ—ถ้—ด private String createId ; // y ๅˆ›ๅปบไบบๅ‘˜ private String updateDate ; //(20) y ๆœ€ๅŽไฟฎๆ”นๆ—ถ้—ด private String updateId ; // y ๆœ€ๅŽไฟฎๆ”นไบบๅ‘˜ public String getLineid() { return lineid; } public void setLineid(String lineid) { this.lineid = lineid; } public String getBillid() { return billid; } public void setBillid(String billid) { this.billid = billid; } public String getRowId() { return rowId; } public void setRowId(String rowId) { this.rowId = rowId; } public String getMaterialType() { return materialType; } public void setMaterialType(String materialType) { this.materialType = materialType; } public String getItemClassId() { return itemClassId; } public void setItemClassId(String itemClassId) { this.itemClassId = itemClassId; } public String getOrnaClassId() { return ornaClassId; } public void setOrnaClassId(String ornaClassId) { this.ornaClassId = ornaClassId; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getMemo() { return memo; } public void setMemo(String memo) { this.memo = memo; } public String getCreateDate() { return createDate; } public void setCreateDate(String createDate) { this.createDate = createDate; } public String getCreateId() { return createId; } public void setCreateId(String createId) { this.createId = createId; } public String getUpdateDate() { return updateDate; } public void setUpdateDate(String updateDate) { this.updateDate = updateDate; } public String getUpdateId() { return updateId; } public void setUpdateId(String updateId) { this.updateId = updateId; } }
[ "lejingw@163.com" ]
lejingw@163.com
8693dd941882148eeccec6c2b00379356a33d8c7
46db77f009e73b16aa60d66db0395fc4661f462a
/idea/src/test/java/com/zy/helloworld/HelloworldApplicationTests.java
3795ca49c5e90bfe932a716239e5795293598241
[]
no_license
Skyshine-zy/springboot
f04b0fd8b9662939afb9a64988bc92ec90e763aa
f004148427c7a921a88fc7d0ad08756aa1601d2a
refs/heads/master
2023-07-09T01:18:50.532758
2021-08-19T06:53:57
2021-08-19T06:53:57
390,003,537
0
0
null
null
null
null
UTF-8
Java
false
false
237
java
package com.zy.helloworld; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; //ๅ•ๅ…ƒๆต‹่ฏ• @SpringBootTest class HelloworldApplicationTests { @Test void contextLoads() { } }
[ "469583624@qq.com" ]
469583624@qq.com
a0431fda7a041ee2c1459213548a37170ef990a1
d50950acac88a8955b41edfd4d3d547a1dd906d3
/examples/modules/for_loop_test.java
86cbc920d73711f9454d21ee25aa24b36f7d9123
[ "Apache-2.0" ]
permissive
Joaquinecc/java2cpp
a386c2a33fda285ace96caf93ae61fb0ab6976bb
87686534e8e7accaae8d1a18806697e38fc28674
refs/heads/main
2023-05-31T03:22:21.195830
2021-06-02T01:44:50
2021-06-02T01:44:50
368,340,036
0
0
Apache-2.0
2021-05-17T22:45:50
2021-05-17T22:45:49
null
UTF-8
Java
false
false
210
java
public class Main { public static void main(String[] args) { for (int i = 0; i < 5; i++) { // System.out.println(i); } for (String i : cars) { // System.out.println(i); } } }
[ "lucasoctaviom@gmail.com" ]
lucasoctaviom@gmail.com
89a1261c40f4e1e2786e172997ddb47bb1437ac4
1b22496804c3d29c721512c7a09c01567029d1f9
/Lab2/app/src/main/java/org/example/roadischosen/lab2/ExportableGraphView.java
f0727a38e05f68da81663807751b9131d17f55ac
[]
no_license
roadischosen/Algorithms-and-calculation-methods
d2c74482bcac589831ba00d12fd9674a5f7c92f6
c9fb06b5fa23eef962fed83ccb087da551b4fd0d
refs/heads/master
2021-09-13T00:49:57.616908
2018-04-23T12:38:24
2018-04-23T12:38:24
103,730,148
0
0
null
null
null
null
UTF-8
Java
false
false
1,228
java
package org.example.roadischosen.lab2; import android.content.Context; import android.graphics.Canvas; import android.util.AttributeSet; import com.jjoe64.graphview.GraphView; import com.jjoe64.graphview.series.Series; import java.util.Iterator; public class ExportableGraphView extends GraphView { public ExportableGraphView(Context context) { super(context); } public ExportableGraphView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void drawGraphElements(Canvas canvas) { this.drawTitle(canvas); this.getViewport().drawFirst(canvas); this.getGridLabelRenderer().draw(canvas); Iterator var2 = this.getSeries().iterator(); Series s; while(var2.hasNext()) { s = (Series)var2.next(); s.draw(this, canvas, false); } if(this.mSecondScale != null) { var2 = this.mSecondScale.getSeries().iterator(); while(var2.hasNext()) { s = (Series)var2.next(); s.draw(this, canvas, true); } } this.getViewport().draw(canvas); this.getLegendRenderer().draw(canvas); } }
[ "awesomenamesmail@gmail.com" ]
awesomenamesmail@gmail.com
418a1c5722cf9a3db33f563ede984a4ea2bb2f9f
84db1cda98a6f6a36990e8364b3c6c2516e3a8c0
/ch18-jpa/src/test/java/com/manning/junitbook/ch18/SchemaTest.java
c882113f414e0c0c1d72b34ca50290b71c2d6732
[ "Apache-2.0" ]
permissive
aronerry/Book_JUnitInAction2
0c84d4bd0d60a9a5ff03c2e00d6023cbc9b71cc5
b7b4b3d72ad29bc57d0278fd1e3c90266ac3041c
refs/heads/master
2020-05-29T17:59:29.182521
2015-03-31T05:26:24
2015-03-31T05:26:24
32,120,630
2
2
null
null
null
null
UTF-8
Java
false
false
2,759
java
/* * ======================================================================== * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ======================================================================== */ package com.manning.junitbook.ch18; import static org.junit.Assert.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.Test; public class SchemaTest extends AbstractJpaTestCase { @Test public void testForeignKeysNames() { SqlHandler handler = new SqlHandler() { public void handle(String sql) { assertForeignKeysDoesNotHaveFunnyNames(sql); } }; analyzeSchema(handler); } private static final String FK_LINE_REGEXP = "alter table (.*) add constraint (.*) foreign key .*"; private static final Pattern FK_LINE_PATTERN = Pattern.compile(FK_LINE_REGEXP); private static final Matcher FK_LINE_MATCHER = FK_LINE_PATTERN.matcher(""); private static final String FK_REGEXP = "fk_[a-z]+_[a-z]+$"; private static final Pattern FK_PATTERN = Pattern.compile(FK_REGEXP); private static final Matcher FK_MATCHER = FK_PATTERN.matcher(""); private void assertForeignKeysDoesNotHaveFunnyNames(String sql) { String[] lines = sql.split("\n"); StringBuilder buffer = new StringBuilder(); for ( String line : lines ) { // System.err.println("SQL line: " + line ); FK_LINE_MATCHER.reset(line); if( FK_LINE_MATCHER.find() ) { final String table = FK_LINE_MATCHER.group(1); final String fk = FK_LINE_MATCHER.group(2); // System.err.println("SQL constraint line: " + line ); if ( ! isValidFk(fk) ) { buffer.append(table).append("(").append(fk).append(") "); } } } String violations = buffer.toString(); if ( violations.length() > 0 ) { fail( "One or more tables have weird FK names: " + violations ); } } private boolean isValidFk(String fk) { FK_MATCHER.reset(fk); return FK_MATCHER.find(); } }
[ "aron.seven@qq.com" ]
aron.seven@qq.com
3cc639458fef426d5192c6ba1bcb2e4890fcfd91
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/33/33_a8fa714bf868c623573e8e4aae171bbff4449e52/Main/33_a8fa714bf868c623573e8e4aae171bbff4449e52_Main_s.java
4d639ec84bfe6b0c76d9c43d914c997c314503ad
[]
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
58,720
java
/* The contents of this file are subject to the terms * of the Common Development and Distribution License * (the License). You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * https://opensso.dev.java.net/public/CDDLv1.0.html or * opensso/legal/CDDLv1.0.txt * See the License for the specific language governing * permission and limitations under the License. * * When distributing Covered Code, include this CDDL * Header Notice in each file and include the License file * at opensso/legal/CDDLv1.0.txt. * If applicable, add the following below the CDDL Header, * with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * * $Id: Main.java,v 1.2 2007-11-14 18:53:39 veiming Exp $ * * Copyright 2007 Sun Microsystems Inc. All Rights Reserved */ package com.iplanet.am.admin.cli; import com.iplanet.am.sdk.AMException; import com.iplanet.am.sdk.AMStoreConnection; import com.iplanet.am.util.SystemProperties; import com.iplanet.sso.SSOException; import com.iplanet.sso.SSOToken; import com.iplanet.services.util.Crypt; import com.sun.identity.common.ISResourceBundle; /* Federation: Commented out import com.sun.identity.federation.alliance.FSAllianceManagementException; import com.sun.identity.liberty.ws.meta.LibertyMetaHandler; import com.sun.identity.liberty.ws.meta.MetaException; */ import com.sun.identity.policy.PolicyUtils; import com.sun.identity.security.AdminTokenAction; import com.sun.identity.shared.Constants; import com.sun.identity.shared.debug.Debug; import com.sun.identity.sm.SMSException; import com.sun.identity.sm.ServiceConfigManager; import com.sun.identity.sm.ServiceManager; import com.sun.identity.sm.ServiceSchema; import com.sun.identity.sm.ServiceSchemaManager; import com.sun.identity.sm.SMSMigration70; import com.sun.identity.authentication.AuthContext; import com.sun.identity.authentication.spi.AuthLoginException; import com.sun.identity.setup.Bootstrap; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.Set; import java.util.StringTokenizer; import java.util.logging.Level; import netscape.ldap.LDAPException; /** * The <code>Main </code> class provides methods to parse the * commandline arguments, execute them accordingly for the declarative * interface/command line tool - amadmin. * Based on the commandline argument, this class * calls the DPRO SDK for user management and SMS API for * service management. * */ class Main { static final String AUTH_CORE_SERVICE = "iPlanetAMAuthService"; private static ResourceBundle bundle = null; private static final int INVALID=0; private static final int RUN_AS_DN=1; private static final int PASSWORD=2; private static final int VERBOSE=3; private static final int DEBUG=4; private static final int SCHEMA=5; private static final int DATA=6; private static final int LOCALE_NAME=7; private static final int HELP=8; private static final int DELETE=9; private static final int VERSION=10; private static final int PASSWORDFILE=11; private static final int SESSION=12; private static final int CONTINUE=13; private static final int IMPORT_REMOTE=14; private static final int IMPORT_HOSTED=15; private static final int ADD_ATTRIBUTES=16; private static final int NOLOG= 17; private static final int LIBERTY_DATA= 18; private static final int ENTITY_NAME=19; private static final int OUTPUT=20; private static final int XML_SIG=21; private static final int VERIFY_SIG=22; private static final int DEFAULT_URL_PREFIX=23; private static final int META_ALIAS=24; private static final int ADD_RESOURCE_BUNDLE = 25; private static final int RESOURCE_BUNDLE_FILE = 26; private static final int GET_RESOURCE_STRING = 27; private static final int DELETE_RESOURCE_BUNDLE = 28; private static final int RESOURCE_LOCALE = 29; private static final int DELETE_POLICY_RULE = 30; private static final int MIGRATE70TOREALMS = 31; private static final int OUTPUTFILENAME = 32; private static Map arguments = new HashMap(); private List infileNames = Collections.synchronizedList(new ArrayList()); private String outfileName; private static String bindDN = null; private static String bindPW = null; private String passwordfile = null; private String localeName = null; private static String inUserId = null; private String smUserId = null; private int operation = 0; private int comptype; private int debugFlg = 0; private int verboseFlg = 0; private boolean continueFlag = false; private AMStoreConnection connec = null; private SSOToken ssot; private String entityName = null; private String serverName = null; private String defaultUrlPrefix; private String addServiceName = null; private String addSchemaType = null; private boolean xmlSig = false; private boolean verifySig = false; private String metaPrefix = null; private List metaAlias = Collections.synchronizedList(new ArrayList()); String sprotocol; String _sserver; String sserver; String sport; private String resourceBundleName; private String resourceFileName; private String resourceLocale; private int deletePolicyRuleFlg = 0; private Map sessionStoreInfo = null; private String entryDN; private String outputFileName = null; private Authenticator auth = null; private static String libertyDN; private static final String DEBUGDIR = "com.iplanet.services.debug.directory"; private static String debugDir; private static String admDbugDir; static { try { Bootstrap.load(); debugDir = SystemProperties.get(DEBUGDIR); admDbugDir = debugDir + Constants.FILE_SEPARATOR + "amadmincli"; libertyDN = SystemProperties.get("com.iplanet.am.defaultOrg"); arguments.put("--debug", new Integer(DEBUG)); arguments.put("-d", new Integer(DEBUG)); arguments.put("--verbose", new Integer(VERBOSE)); arguments.put("-v", new Integer(VERBOSE)); arguments.put("--nolog", new Integer(NOLOG)); arguments.put("-O", new Integer(NOLOG)); arguments.put("--schema", new Integer(SCHEMA)); arguments.put("-s", new Integer(SCHEMA)); arguments.put("--data", new Integer(DATA)); arguments.put("-t", new Integer(DATA)); arguments.put("--runasdn", new Integer(RUN_AS_DN)); arguments.put("-u", new Integer(RUN_AS_DN)); arguments.put("--password", new Integer(PASSWORD)); arguments.put("-w", new Integer(PASSWORD)); arguments.put("--passwordfile", new Integer(PASSWORDFILE)); arguments.put("-f", new Integer(PASSWORDFILE)); arguments.put("--locale", new Integer(LOCALE_NAME)); arguments.put("-l", new Integer(LOCALE_NAME)); arguments.put("--help", new Integer(HELP)); arguments.put("-h", new Integer(HELP)); arguments.put("--deleteservice", new Integer(DELETE)); arguments.put("-r", new Integer(DELETE)); arguments.put("--version", new Integer(VERSION)); arguments.put("-n", new Integer(VERSION)); arguments.put("--session", new Integer(SESSION)); arguments.put("-m", new Integer(SESSION)); arguments.put("--continue", new Integer(CONTINUE)); arguments.put("-c", new Integer(CONTINUE)); arguments.put("--importRemote", new Integer(IMPORT_REMOTE)); arguments.put("-I", new Integer(IMPORT_REMOTE)); arguments.put("--importHosted", new Integer(IMPORT_HOSTED)); arguments.put("-p", new Integer(IMPORT_HOSTED)); arguments.put("--addAttribute", new Integer(ADD_ATTRIBUTES)); arguments.put("-a", new Integer(ADD_ATTRIBUTES)); arguments.put("--import", new Integer(LIBERTY_DATA)); arguments.put("-g", new Integer(LIBERTY_DATA)); arguments.put("--entityname", new Integer(ENTITY_NAME)); arguments.put("-e", new Integer(ENTITY_NAME)); arguments.put("--verifysig", new Integer(VERIFY_SIG)); arguments.put("-y", new Integer(VERIFY_SIG)); arguments.put("--export", new Integer(OUTPUT)); arguments.put("-o", new Integer(OUTPUT)); arguments.put("--xmlsig", new Integer(XML_SIG)); arguments.put("-x", new Integer(XML_SIG)); arguments.put("--defaulturlprefix", new Integer(DEFAULT_URL_PREFIX)); arguments.put("-k", new Integer(DEFAULT_URL_PREFIX)); arguments.put("--metaalias", new Integer(META_ALIAS)); arguments.put("-q", new Integer(META_ALIAS)); arguments.put("--addresourcebundle", new Integer(ADD_RESOURCE_BUNDLE)); arguments.put("-b", new Integer(ADD_RESOURCE_BUNDLE)); arguments.put("--resourcebundlefilename", new Integer(RESOURCE_BUNDLE_FILE)); arguments.put("-i", new Integer(RESOURCE_BUNDLE_FILE)); arguments.put("--resourcelocale", new Integer(RESOURCE_LOCALE)); arguments.put("-R", new Integer(RESOURCE_LOCALE)); arguments.put("--getresourcestrings", new Integer(GET_RESOURCE_STRING)); arguments.put("-z", new Integer(GET_RESOURCE_STRING)); arguments.put("--deleteresourcebundle", new Integer(DELETE_RESOURCE_BUNDLE)); arguments.put("-j", new Integer(DELETE_RESOURCE_BUNDLE)); arguments.put("-C",new Integer(DELETE_POLICY_RULE)); arguments.put("--cleanpolicyrules",new Integer(DELETE_POLICY_RULE)); arguments.put("-M", new Integer(MIGRATE70TOREALMS)); arguments.put("--migrate70torealms", new Integer(MIGRATE70TOREALMS)); arguments.put("-ofilename", new Integer(OUTPUTFILENAME)); arguments.put("--ofilename", new Integer(OUTPUTFILENAME)); arguments.put("-F", new Integer(OUTPUTFILENAME)); SystemProperties.initializeProperties (DEBUGDIR, admDbugDir); } catch (Exception ex) { ex.printStackTrace(); } } Main() { } /** Command line is parsed and appropriate values are stored **/ private String readFromPassword(String passwordfile) throws AdminException { String line =null; BufferedReader in =null; try{ in = new BufferedReader(new FileReader(passwordfile)); if(in.ready()) { line = in.readLine(); } return line; } catch(IOException e){ if(AdminUtils.logEnabled()) { AdminUtils.log("Could not open file " + e.getMessage() ); } } finally { if (in !=null ) { try { in.close(); } catch (Exception e) { if(AdminUtils.logEnabled()) { AdminUtils.log( "Unable to close the file: " + e.getMessage()); } } } } return null; } private void parseCommandLine(String[] argv) throws AdminException { if (!ArgumentValidator.validateArguments(argv, bundle)) { System.err.println(bundle.getString("usage")); System.exit(1); } for (int i = 0; i < argv.length; i++) { int opt = getToken(argv[i]); switch(opt) { case IMPORT_REMOTE : operation = opt; i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } //Populate the list of files to be loaded. for (int j=i;j<argv.length;j++,i++) { infileNames.add(argv[j]); } break; case IMPORT_HOSTED : operation = opt; i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } //The first parameter that corresponds to the //value to be used for autopopulation. defaultUrlPrefix = argv[i]; i++; //Capture the list of files to be imported for (int j=i;j<argv.length;j++,i++) { infileNames.add(argv[j]); } break; case SESSION : operation = opt; i++; if ((i >= argv.length) || (arguments.containsKey(argv[i].toString())) ) { System.err.println(bundle.getString("usage")); System.exit(1); } serverName = (argv[i] == null) ? "*" : argv[i]; i++; smUserId = (i >= argv.length) ? "*" : argv[i]; break; case RUN_AS_DN : i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } bindDN = argv[i]; if ((comptype = getToken(bindDN.toLowerCase())) != INVALID) { throw new AdminException( bundle.getString("nodnforadmin")); } else { StringTokenizer DNToken = new StringTokenizer(bindDN,","); if (DNToken.hasMoreTokens()) { String uidString = DNToken.nextToken(); StringTokenizer uidToken = new StringTokenizer( uidString, "="); if (uidToken.hasMoreTokens()) { String s1 = uidToken.nextToken(); if ( s1.equals("uid")) { if (uidToken.hasMoreTokens()) { inUserId = uidToken.nextToken(); } } } } } break; case PASSWORD : i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } bindPW = argv[i]; if ((comptype = getToken(bindPW.toLowerCase())) != INVALID) throw new AdminException( bundle.getString("nopwdforadmin")); break; case PASSWORDFILE : i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } passwordfile = argv[i]; bindPW = readFromPassword(passwordfile); if ((bindPW == null) || ((comptype = getToken(bindPW.toLowerCase())) != INVALID) ) { throw new AdminException( bundle.getString("nopwdforadmin")); } bindPW = bindPW.trim(); break; case ENTITY_NAME: i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } entityName = argv[i]; if (((comptype = getToken(entityName.toLowerCase())) != INVALID) ) { throw new AdminException(bundle.getString( "noentityname")); } break; case DATA : case SCHEMA : case LIBERTY_DATA : operation = opt; i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } String tmp = argv[i].toLowerCase(); if (!tmp.endsWith(".xml")) throw new AdminException(bundle.getString("nofile")); for (int j=i;j<argv.length;j++) { tmp = argv[j].toLowerCase(); if (tmp.endsWith(".xml")) { infileNames.add(argv[j]); i = i+j; } else { i = j-1; break; } } break; case VERIFY_SIG: verifySig = true; break; case XML_SIG: xmlSig = true; break; case DEFAULT_URL_PREFIX: i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } metaPrefix = argv[i]; if ((comptype = getToken(metaPrefix.toLowerCase())) != INVALID ) { throw new AdminException(bundle.getString( "nodefaulturlprefix")); } break; case META_ALIAS: int startIndx = i; i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } //Populate the list of meta alias. for (int j=i;j<argv.length;j++,i++) { if ((comptype = getToken(argv[j].toLowerCase())) != INVALID) { i--; break; } metaAlias.add(argv[j]); } if (startIndx == i) { throw new AdminException(bundle.getString("nometaalias")); } break; case OUTPUT: operation = opt; i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } outfileName = argv[i]; if ((comptype=getToken(outfileName.toLowerCase())) != INVALID) throw new AdminException(bundle.getString( "nooutfilename")); break; case LOCALE_NAME : i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } localeName = argv[i]; if ((localeName == null) || ((comptype = getToken(localeName.toLowerCase())) != INVALID) ) { throw new AdminException( bundle.getString("nolocalename")); } // Set the locale to English eventhough localeName is given, // to write all messages in the debug file. if (debugFlg == 1 ) { AdminResourceBundle.setLocale("en_US"); bundle = AdminResourceBundle.getResources(); } else { AdminResourceBundle.setLocale(localeName); bundle = AdminResourceBundle.getResources(); } break; case DEBUG : debugFlg = 1; if (verboseFlg == 1 ) { System.out.println(bundle.getString("dbgerror") + " --verbose|--debug"); System.exit(1); } else { AdminUtils.setDebug(AdminReq.debug); AdminUtils.setDebugStatus(Debug.ON); AdminUtils.enableDebug(true); AdminResourceBundle.setLocale("en_US"); bundle = AdminResourceBundle.getResources(); } break; case NOLOG: AdminUtils.setLog(false); break; case VERBOSE : verboseFlg = 1; if (debugFlg == 1 ) { System.out.println(bundle.getString("dbgerror") + " --verbose|--debug"); System.exit(1); } else { AdminUtils.setDebug(AdminReq.debug); AdminUtils.enableVerbose(true); } break; case HELP : printHelp(); System.exit(0); break; case VERSION : printVersion(); System.exit(0); break; case CONTINUE : continueFlag=true; break; case DELETE : operation = opt; i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } if ((argv[i] == null) || (arguments.containsKey(argv[i].toString())) ) { throw new AdminException( bundle.getString("noservicename")); } for (int j=i;j<argv.length;j++) { infileNames.add(argv[j]); i++; if (arguments.containsKey(argv[j].toString())) { i = j-1; infileNames.remove(argv[j]); break; } } break; case ADD_ATTRIBUTES : operation = opt; i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } addServiceName = argv[i]; i++; addSchemaType = argv[i]; i++; //Populate the list of files to be loaded. for (int j=i;j<argv.length;j++,i++) { infileNames.add(argv[j]); } break; case GET_RESOURCE_STRING: case ADD_RESOURCE_BUNDLE: case DELETE_RESOURCE_BUNDLE: if ((++i >= argv.length) || (operation != 0)) { System.err.println(bundle.getString("usage")); System.exit(1); } operation = opt; resourceBundleName = argv[i]; break; case RESOURCE_BUNDLE_FILE: if (++i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } resourceFileName = argv[i]; break; case RESOURCE_LOCALE: if (++i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } resourceLocale = argv[i]; break; case DELETE_POLICY_RULE: deletePolicyRuleFlg = 1; break; case MIGRATE70TOREALMS: if (++i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } operation = opt; entryDN = argv[i]; break; case OUTPUTFILENAME: i++; if (i >= argv.length) { System.err.println(bundle.getString("usage")); System.exit(1); } outputFileName = argv[i]; break; default : AdminUtils.setDebug(AdminReq.debug); AdminUtils.setDebugStatus(Debug.OFF); System.err.println(bundle.getString("usage")); System.err.println(bundle.getString("invopt")+argv[i]); System.exit(1); } } if ((bindDN == null) || (bindPW == null)) { AdminUtils.setDebug(AdminReq.debug); AdminUtils.setDebugStatus(Debug.OFF); System.err.println(bundle.getString("usage")); System.exit(1); } } /** * Actual execution of the operations are performed here */ private void runCommand() throws AdminException, LDAPException { boolean bError = false; if (operation != SESSION) { auth = new Authenticator(bundle); auth.ldapLogin(bindDN, bindPW); ssot = auth.getSSOToken(); } switch (operation) { /* Federation: Commented out case IMPORT_REMOTE: processImportRemoteRequests(); break; case IMPORT_HOSTED: processImportHostedRequests(); break; */ case DATA: processDataRequests(); break; case SCHEMA: processSchemaRequests(); break; case DELETE: processDeleteRequests(); break; case SESSION: processSessionRequest(); break; case ADD_ATTRIBUTES: processAddAttributesRequests(); break; /* Federation: Commented out case LIBERTY_DATA: processLibertyDataRequests(); break; case OUTPUT: outputLibertyData(); break; */ case ADD_RESOURCE_BUNDLE: addResourceBundle(); break; case GET_RESOURCE_STRING: getResourceStrings(); break; case DELETE_RESOURCE_BUNDLE: deleteResourceBundle(); break; case MIGRATE70TOREALMS: migrate70ToRealms(); break; default: bError = true; } if (auth != null) { auth.destroySSOToken(); } if (bError) { AdminUtils.setDebug(AdminReq.debug); AdminUtils.setDebugStatus(Debug.OFF); System.err.println(bundle.getString("nodataschemawarning")); System.err.println(bundle.getString("usage")); System.exit(1); } } private void processSessionRequest() throws AdminException { Authenticator auth = new Authenticator(bundle); String bindUser = (inUserId != null) ? inUserId : bindDN; AuthContext lc = auth.sessionBasedLogin(bindUser, bindPW); SSOToken ssot = auth.getSSOToken(); AdminUtils.setSSOToken(ssot); SessionRequest req = new SessionRequest(ssot, serverName, bundle); req.displaySessions(smUserId); try { lc.logout(); } catch (AuthLoginException e) { handleRunCommandException(e); } } /* Federation: Commented out private void processImportRemoteRequests() { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg1")); } for (Iterator iter = infileNames.iterator(); iter.hasNext(); ) { String infile = (String)iter.next(); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg2") + infile); } try { convertImportMetaData(infile, ssot, "remote", null); } catch (AdminException e) { handleRunCommandException(e); } } } private void processImportHostedRequests() { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg1")); } for (Iterator iter = infileNames.iterator(); iter.hasNext(); ) { String infile = (String)iter.next(); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg2") + infile); } try { convertImportMetaData(infile, ssot, "hosted", defaultUrlPrefix); } catch (AdminException e) { handleRunCommandException(e); } } } */ private void processDataRequests() throws AdminException { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg1")); } try { connec = new AMStoreConnection(ssot); } catch (SSOException ssoe) { throw new AdminException(ssoe); } for (Iterator iter = infileNames.iterator(); iter.hasNext(); ) { String infile = (String)iter.next(); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg2") + infile); } try { processDataRequests(infile, connec, ssot, continueFlag); } catch (AdminException e) { handleRunCommandException(e); } } } /* Federation: Commented out private void processLibertyDataRequests() throws AdminException { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg1")); } if ((infileNames == null) || infileNames.isEmpty()) { throw new AdminException( bundle.getString("missingLibertyMetaInputFile")); } LibertyMetaHandler metaHandler = getLibertyMetaHandler(); for (Iterator iter = infileNames.iterator(); iter.hasNext(); ) { String infile = (String)iter.next(); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg2") + infile); } try { metaHandler.metaToSM(infile, verifySig, metaPrefix, metaAlias); } catch (MetaException me) { throw new AdminException( bundle.getString("failLoadLibertyMeta") + me.getMessage()); } } } private void outputLibertyData() throws AdminException { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg40") + outfileName); } if (entityName == null) { throw new AdminException(bundle.getString("missingEntityName")); } if (outfileName == null) { throw new AdminException( bundle.getString("missingLibertyMetaOutputFile")); } LibertyMetaHandler metaHandler = getLibertyMetaHandler(); try { metaHandler.SMToMeta(entityName, xmlSig, outfileName); } catch (MetaException me) { throw new AdminException(me); } } private LibertyMetaHandler getLibertyMetaHandler() throws AdminException { LibertyMetaHandler metaHandler = null; try { metaHandler = new LibertyMetaHandler(ssot, libertyDN); if (metaHandler == null) { throw new AdminException( bundle.getString("cannotObtainMetaHandler")); } } catch (FSAllianceManagementException fe) { throw new AdminException(fe); } return metaHandler; } */ private void processSchemaRequests() { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg3")); } for (Iterator iter = infileNames.iterator(); iter.hasNext(); ) { String infile = (String)iter.next(); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg4") + infile); } try { Set names = registerServiceSchema(infile); if ((names != null) && !names.isEmpty()) { String[] params = {(String)names.iterator().next()}; AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, AdminUtils.LOAD_SERVICE, params); } } catch (AdminException e) { handleRunCommandException(e); } } } private void processDeleteRequests() { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg28")); } for (Iterator iter = infileNames.iterator(); iter.hasNext(); ) { String infile = (String)iter.next(); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg29") + infile); } try { processDeleteService(infile); String[] params = {infile}; // AdminUtils.logOperation(AdminUtils.LOG_ACCESS, // MessageFormat.format(bundle.getString("service-deleted"), // params)); AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, AdminUtils.DELETE_SERVICE, params); } catch (AdminException e) { handleRunCommandException(e); } } } private void processAddAttributesRequests() { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg34")); } for (Iterator iter = infileNames.iterator(); iter.hasNext(); ) { String infile = (String)iter.next(); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg35") + infile); } try { processAddAttributes(addServiceName, addSchemaType, infile); String[] params = {infile}; // AdminUtils.logOperation(AdminUtils.LOG_ACCESS, // MessageFormat.format(bundle.getString("addAttributes"), // params)); AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, AdminUtils.ADD_ATTRIBUTES, params); } catch (AdminException e) { handleRunCommandException(e); } } } private void handleRunCommandException(Exception e) { if (debugFlg != -1) { System.err.println(bundle.getString("execfailed") + "\n" + e.getLocalizedMessage()); } // // leave this one (for now, anyway), as it has // the exception stacktrace in it // AdminUtils.logOperation(AdminUtils.LOG_ERROR, bundle.getString("execfailed") + " " + e); if (!continueFlag) { if (auth != null) { auth.destroySSOToken(); } System.exit(1); } } /** Method to print the descriptive information about the utility, such as its version, legal notices, license keys, and other similar information, if 'amadmin --version' is executed. **/ void printVersion() { System.out.println(); ResourceBundle rb = ResourceBundle.getBundle("AMConfig"); String[] arg = {rb.getString("com.iplanet.am.version")}; System.out.println(MessageFormat.format( bundle.getString("version"), arg)); System.out.println(); } /** Method to print the definitions of the mandatory and optional arguments and their values, if 'amadmin --help' is executed. **/ void printHelp() { System.out.println(bundle.getString("usage")); } /** Method to process Data Requests from the commandline. **/ void processDataRequests(String dataXML, AMStoreConnection connection, SSOToken ssotkn, boolean continueFlag) throws AdminException { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("processingDataXML") + " " + dataXML); AdminUtils.log(bundle.getString("statusmsg5")); } AdminXMLParser dpxp = new AdminXMLParser(); dpxp.processAdminReqs(dataXML, connection, ssotkn, continueFlag, outputFileName); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("doneProcessingXML") + " " + dataXML); } } /* Federation: Commented Out * Method to process the metadata pertaining to the Liberty Spec. * The input file would have xml that would stick to the liberty.xsd * This needs to be transformed into xml that sticks to amAdmin.dtd. * This xml can then be loaded/imported like any other XML file that * sticks to amAdmin.dtd. * void convertImportMetaData( String dataXML, SSOToken ssotkn, String provType, String defaultUrlPrefix ) throws AdminException { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("processingDataXML") + " " + dataXML); AdminUtils.log(bundle.getString("statusmsg5")); } AdminXMLParser dpxp = new AdminXMLParser(); dpxp.processLibertyMetaData( dataXML, ssotkn, provType, defaultUrlPrefix ); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("doneProcessingXML") + " " + dataXML); } } */ public static boolean isInstallTime() { String s = System.getProperty("installTime"); return (s != null) && s.toLowerCase().startsWith("true"); } static public void main(String[] args) throws AdminException { /* * Set the property to inform AdminTokenAction that * "amadmin" CLI is executing the program */ if (isInstallTime()) { SystemProperties.initializeProperties( AdminTokenAction.AMADMIN_MODE, "true"); } /*if the locale is set to null it will *take the OS default locale. */ AdminResourceBundle.setLocale(null); bundle = AdminResourceBundle.getResources(); // Initialize Crypt class Crypt.checkCaller(); Main dpa = new Main(); try { dpa.parseCommandLine(args); dpa.runCommand(); System.out.println(bundle.getString("successful")); System.exit(0); } catch (Exception eex) { System.err.println(bundle.getString("oprfailed") + " " + eex.getLocalizedMessage()); System.exit(1); } } int getToken(String arg) { try { return(((Integer)arguments.get(arg)).intValue()); } catch(Exception e) { return 0; } } /** * Supports LDAP Authentication in amadmin. * Calls AuthContext class to get LDAP authenticated by passing * principal,password * Also gets the SSO token from the AuthContext class to have * AMStoreConnection. */ /** * Registers a service schema. * * @param schemaFile name of XML file that contains service schema * information. * @return names of registered services. * @throws AdminException if service schema cannot registered. */ Set registerServiceSchema(String schemaFile) throws AdminException { Set serviceNames = Collections.EMPTY_SET; if (AdminUtils.logEnabled()) { AdminUtils.log("\n" + bundle.getString("loadingServiceSchema") + " " + schemaFile); } System.out.println(bundle.getString("loadServiceSchema") + " " + schemaFile); FileInputStream fis = null; try { ServiceManager ssm = new ServiceManager(ssot); fis = new FileInputStream(schemaFile); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg12") + schemaFile); } serviceNames = ssm.registerServices(fis); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("doneLoadingServiceSchema") + " " + serviceNames.toString()); } } catch (IOException ioe) { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("file"), ioe); } throw new AdminException(bundle.getString("file")); } catch (SSOException sse) { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg13"), sse); } throw new AdminException(sse); } catch (SMSException sme) { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg14"), sme); } throw new AdminException(sme); } finally { if (fis != null) { try { fis.close(); } catch (IOException ie) { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg15"),ie); } } } } return serviceNames; } /** * Adds the attributes to the XML with the default value * **/ void processAddAttributes(String serviceName, String schemaType, String inputFile) throws AdminException { if (AdminUtils.logEnabled()) AdminUtils.log("\n"+bundle.getString("addAttributes") + " " +serviceName + " " + schemaType ); try { ServiceSchemaManager ssm = new ServiceSchemaManager( serviceName, ssot); ServiceSchema ss = null; FileInputStream fis = null; if (schemaType.equalsIgnoreCase("global")) { ss = ssm.getGlobalSchema(); } else if (schemaType.equalsIgnoreCase("organization")) { ss = ssm.getOrganizationSchema(); } else if (schemaType.equalsIgnoreCase("dynamic")) { ss = ssm.getDynamicSchema(); } else if (schemaType.equalsIgnoreCase("user")) { ss = ssm.getUserSchema(); } else if (schemaType.equalsIgnoreCase("policy")) { ss = ssm.getPolicySchema(); } fis = new FileInputStream(inputFile); ss.addAttributeSchema(fis); if (AdminUtils.logEnabled()) AdminUtils.log(bundle.getString("doneAddingAttributes")+ " " + serviceName); } catch (IOException ioe) { if (AdminUtils.logEnabled() && (debugFlg == 1)) AdminUtils.log(bundle.getString("file"),ioe); throw new AdminException(bundle.getString("file")); } catch (SSOException sse) { if (AdminUtils.logEnabled() && (debugFlg == 1)) AdminUtils.log(bundle.getString("statusmsg13"),sse); throw new AdminException("\n"+bundle.getString("smsdelexception") +"\n\n"+sse.getLocalizedMessage()+"\n"); } catch (SMSException sme) { if (AdminUtils.logEnabled()) AdminUtils.log(bundle.getString("statusmsg14"),sme); throw new AdminException("\n"+bundle.getString("smsdelexception") +"\n\n"+sme.getLocalizedMessage()+"\n"); } } /** * Deletes the service configuration, and all the sub-configuration, * including all the organization-based configurations * * @param serviceName to be deleted * @throws AdminException if service schema cannot be deleted. **/ void processDeleteService(String serviceName) throws AdminException { if (AdminUtils.logEnabled()) { AdminUtils.log("\n" + bundle.getString("deletingService") + " " + serviceName); } System.out.println(bundle.getString("deleteServiceSchema") + " " + serviceName); try { ServiceManager ssm = new ServiceManager(ssot); ServiceConfigManager scm = new ServiceConfigManager( serviceName, ssot); if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg12") + serviceName); } if(deletePolicyRuleFlg == 1){ ServiceSchemaManager ssmgr = new ServiceSchemaManager( serviceName, ssot); if (ssmgr == null) { if (AdminUtils.logEnabled() && (debugFlg == 1)) { String[] params = { serviceName }; // AdminUtils.logOperation(AdminUtils.LOG_ACCESS, // MessageFormat.format( // bundle.getString("noPolicyPriviliges"), params)); AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, AdminUtils.NO_POLICY_PRIVILEGES, params); } }else { if (ssmgr.getPolicySchema() == null) { if (AdminUtils.logEnabled() && (debugFlg == 1)) { String[] params = { serviceName }; // AdminUtils.logOperation(AdminUtils.LOG_ACCESS, // MessageFormat.format( // bundle.getString("serviceNameNotFound"), // params)); AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, AdminUtils.SERVICE_NOT_FOUND, params); } } else { processCleanPolicies(serviceName) ; } } } if (scm.getGlobalConfig(null) != null) { scm.removeGlobalConfiguration(null); } if (serviceName.equalsIgnoreCase(AUTH_CORE_SERVICE)) { ssm.deleteService(serviceName); } else { Set versions = ssm.getServiceVersions(serviceName); for (Iterator iter = versions.iterator(); iter.hasNext(); ) { ssm.removeService(serviceName, (String)iter.next()); } } if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("doneDeletingService") + " " + serviceName); } } catch (SSOException sse) { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg13"), sse); } throw new AdminException(sse); } catch (SMSException sme) { if (AdminUtils.logEnabled()) { AdminUtils.log(bundle.getString("statusmsg14"),sme); } throw new AdminException(sme); } } private void processCleanPolicies(String serviceName) throws AdminException { if (AdminUtils.logEnabled()) { String[] params = { serviceName }; // AdminUtils.logOperation(AdminUtils.LOG_ACCESS, // MessageFormat.format(bundle.getString("startDeletingRules"),params)); AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, AdminUtils.START_DELETING_RULES, params); } try { PolicyUtils.removePolicyRules(ssot,serviceName); if (AdminUtils.logEnabled()) { String[] params = { serviceName }; // AdminUtils.logOperation(AdminUtils.LOG_ACCESS, // MessageFormat.format( // bundle.getString("doneDeletingRules"),params)); AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, AdminUtils.DONE_DELETING_RULES, params); } } catch (SSOException ssoe) { throw new AdminException(ssoe); } catch (AMException ame) { throw new AdminException(ame); } } /** * Adds resource bundle to directory server. * * @throws AdminException if resource bundle cannot be added. */ private void addResourceBundle() throws AdminException { if ((resourceBundleName == null) || (resourceBundleName.length() == 0)) { throw new AdminException( bundle.getString("missingResourceBundleName")); } if ((resourceFileName == null) || (resourceFileName.length() == 0)) { throw new AdminException( bundle.getString("missingResourceFileName")); } try { Map mapStrings = getResourceStringsMap(resourceFileName); ISResourceBundle.storeResourceBundle(ssot, resourceBundleName, resourceLocale, mapStrings); String message = null; String message1 = null; String[] params; if (resourceLocale != null) { params = new String[2]; params[0] = resourceBundleName; params[1] = resourceLocale; message1 = MessageFormat.format( bundle.getString("add-resource-bundle-to-directory-server"), params); message = AdminUtils.ADD_RESOURCE_BUNDLE_TO_DIRECTORY_SERVER; } else { params = new String[1]; params[0] = resourceBundleName; message1 = MessageFormat.format( bundle.getString( "add-default-resource-bundle-to-directory-server"), params); message = AdminUtils.ADD_DEFAULT_RESOURCE_BUNDLE_TO_DIRECTORY_SERVER; } // AdminUtils.logOperation(AdminUtils.LOG_ACCESS, message); AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, message, params); System.out.println(message1); } catch (SMSException smse) { throw new AdminException(smse); } catch (SSOException ssoe) { throw new AdminException(ssoe); } } private Map getResourceStringsMap(String resourceFileName) throws AdminException { Map resourceStrings = new HashMap(); BufferedReader in = null; try { int commented = 0; in = new BufferedReader(new FileReader(resourceFileName)); String line = in.readLine(); while (line != null) { line = line.trim(); if (line.startsWith("/*")) { commented++; } else if (line.endsWith("*/")) { commented--; } else if (line.startsWith("#")) { // ignore this line } else if (commented == 0) { int idx = line.indexOf('='); if (idx != -1) { String key = line.substring(0, idx).trim(); if (key.length() > 0) { Set tmp = new HashSet(2); String value = line.substring(idx+1).trim(); tmp.add(value); resourceStrings.put(key, tmp); } } } line = in.readLine(); } } catch(IOException e){ throw new AdminException(e); } finally { if (in !=null ) { try { in.close(); } catch (IOException e) { throw new AdminException(e); } } } return resourceStrings; } /** * Gets resource strings from directory server. * * @throws AdminException if failed to get resource strings. */ private void getResourceStrings() throws AdminException { if ((resourceBundleName == null) || (resourceBundleName.length() == 0)) { throw new AdminException( bundle.getString("missingResourceBundleName")); } try { ResourceBundle rb = ISResourceBundle.getResourceBundle(ssot, resourceBundleName, resourceLocale); if (rb != null) { for (Enumeration e = rb.getKeys(); e.hasMoreElements(); ) { String key = (String)e.nextElement(); String value = rb.getString(key); System.out.println(key + "=" + value); } } } catch (SSOException ssoe) { throw new AdminException(ssoe); } catch (MissingResourceException mre) { throw new AdminException(mre); } } /** * Deletes resource bundle from directory server. * * @throws AdminException if fails to delete resource bundle. */ private void deleteResourceBundle() throws AdminException { if ((resourceBundleName == null) || (resourceBundleName.length() == 0)) { throw new AdminException( bundle.getString("missingResourceBundleName")); } try { ISResourceBundle.deleteResourceBundle(ssot, resourceBundleName, resourceLocale); String message = null; String message1 = null; String[] params; if (resourceLocale != null) { params = new String[2]; params[0] = resourceBundleName; params[1] = resourceLocale; message1 = MessageFormat.format( bundle.getString( "delete-resource-bundle-from-directory-server"), params); message = AdminUtils.DELETE_RESOURCE_BUNDLE_FROM_DIRECTORY_SERVER; } else { params = new String[1]; params[0] = resourceBundleName; message1 = MessageFormat.format( bundle.getString( "delete-default-resource-bundle-from-directory-server"), params); message = AdminUtils.DELETE_DEFAULT_RESOURCE_BUNDLE_FROM_DIRECTORY_SERVER; } // AdminUtils.logOperation(AdminUtils.LOG_ACCESS, message); AdminUtils.logOperation(AdminUtils.LOG_ACCESS, Level.INFO, message, params); System.out.println(message); } catch (SMSException smse) { throw new AdminException(smse); } catch (SSOException ssoe) { throw new AdminException(ssoe); } } private void migrate70ToRealms() throws AdminException { try { SMSMigration70.migrate63To70(ssot, entryDN); } catch (Exception ex) { throw new AdminException(ex); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b603890717b1f330fde7ce3bb8c46fdb55a7d0f7
0b4fac8f46f1daca62bca935054ea026524c3981
/src/vulc/luag/gfx/Screen.java
147a945a50df8ec56d6e44f05161bd626f69b860
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
gitter-badger/LuaG-Console
cf2042c955dbe4e7ff433228d1bac77c5d90eab5
effbf0e33adeeed6e3294252d767b4672fbc06be
refs/heads/master
2023-02-23T01:00:43.581967
2021-01-19T15:45:02
2021-01-19T15:45:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
384
java
package vulc.luag.gfx; import vulc.bitmap.IntBitmap; import vulc.bitmap.font.Font; public class Screen extends IntBitmap { public static final Font FONT; static { FONT = new Font(Screen.class.getResourceAsStream("/res/font.fv3")); FONT.setLetterSpacing(1); FONT.setLineSpacing(1); } public Screen(int width, int height) { super(width, height); setFont(FONT); } }
[ "rusponirocco@gmail.com" ]
rusponirocco@gmail.com
b49483618600f8c172bf4fa497fb2740b0dba7bf
6e6aca5a70d675e7df2b1b491d5af843daab900e
/app/src/main/java/com/example/dell/GestionIntervention/Entities/Client.java
c0e5b9632105cad7bca9ae98c379fa58a22dc762
[]
no_license
chamadalhoum/GestionIntervention
108fffc293f5c172c6e08d4e3158e3cbef8d1449
c6d77e8544f7065d7cc6d4002eabb48c65f866c7
refs/heads/master
2021-01-19T14:18:41.263875
2017-08-21T00:14:44
2017-08-21T00:14:44
100,896,408
0
0
null
null
null
null
UTF-8
Java
false
false
2,700
java
package com.example.dell.GestionIntervention.Entities; /** * Created by Hp on 08/04/2017. */ public class Client { private String code_client; private String nom_client; private String prenom_client; private String adresse_client; private String email_client; private String Categorie_client; private String raisonSocial_client; private String tel_gsm_client; private String code_postale; private String ville; private String delegation; private String gouvernorat; public Client() { } public void setCode_client(String code_client) { this.code_client = code_client; } public void setNom_client(String nom_client) { this.nom_client = nom_client; } public void setPrenom_client(String prenom_client) { this.prenom_client = prenom_client; } public void setAdresse_client(String adresse_client) { this.adresse_client = adresse_client; } public void setEmail_client(String email_client) { this.email_client = email_client; } public void setCategorie_client(String categorie_client) { Categorie_client = categorie_client; } public void setRaisonSocial_client(String raisonSocial_client) { this.raisonSocial_client = raisonSocial_client; } public void setTel_gsm_client(String tel_gsm_client) { this.tel_gsm_client = tel_gsm_client; } public void setCode_postale(String code_postale) { this.code_postale = code_postale; } public void setVille(String ville) { this.ville = ville; } public void setDelegation(String delegation) { this.delegation = delegation; } public void setGouvernorat(String gouvernorat) { this.gouvernorat = gouvernorat; } public String getCode_client() { return code_client; } public String getNom_client() { return nom_client; } public String getPrenom_client() { return prenom_client; } public String getAdresse_client() { return adresse_client; } public String getEmail_client() { return email_client; } public String getCategorie_client() { return Categorie_client; } public String getRaisonSocial_client() { return raisonSocial_client; } public String getTel_gsm_client() { return tel_gsm_client; } public String getCode_postale() { return code_postale; } public String getVille() { return ville; } public String getDelegation() { return delegation; } public String getGouvernorat() { return gouvernorat; } }
[ "chamadalhoum@gmail.com" ]
chamadalhoum@gmail.com
d5abf3116405fc415ae043148d078d2f278e1bd4
188ddf54f6e69b07b271cafd8a71fd0e4a5edb26
/CHAPTER 6/Spring-Boot-Community-Rest/rest-web/src/main/java/com/community/rest/domain/Board.java
facba8ce0a2327a5a055eb6de8a4dbf36c641512
[]
no_license
pdh6547/study-spring-boot
027c089037dccc20d10cbbbaa53eff1dd670e2b6
74cab086defd9a656716af20eb6a851129973aad
refs/heads/master
2020-04-15T04:42:01.793242
2019-02-14T06:25:33
2019-02-14T06:25:33
164,392,698
1
0
null
null
null
null
UTF-8
Java
false
false
1,557
java
package com.community.rest.domain; import com.community.rest.domain.enums.BoardType; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; import javax.persistence.*; import java.io.Serializable; import java.time.LocalDateTime; @Getter @NoArgsConstructor @Entity @Table public class Board implements Serializable { @Id @Column @GeneratedValue (strategy = GenerationType.IDENTITY) private Long idx; @Column private String title; @Column private String subTitle; @Column private String content; @Column @Enumerated(EnumType.STRING) private BoardType boardType; @Column private LocalDateTime createdDate; @Column private LocalDateTime updatedDate; @OneToOne private User user; @Builder public Board(String title, String subTitle, String content, BoardType boardType, LocalDateTime createdDate, LocalDateTime updatedDate, User user) { this.title = title; this.subTitle = subTitle; this.content = content; this.boardType = boardType; this.createdDate = createdDate; this.updatedDate = updatedDate; this.user = user; } public void setCreatedDateNow() { this.createdDate = LocalDateTime.now(); } public void update(Board board) { this.title = board.getTitle(); this.subTitle = board.getSubTitle(); this.content = board.getContent(); this.boardType = board.getBoardType(); this.updatedDate = LocalDateTime.now(); } }
[ "pdh6547@gmail.com" ]
pdh6547@gmail.com
fc36000dca2a4c3602c63eb97118353399c10892
656ec756f1a6f278c2ac0a40b2b80ed4cc53b0e2
/leetCode/src/main/java/leetcode/leet_867.java
bc0f66c52a9d126f3ac1cbf67fb1a504039b4003
[]
no_license
peterr4405/leet_code
4856bda7a14004c7f4b2555819f31eda391ca5ad
ce481d0221e8aa04fe49c572e3bcd6a801263ac9
refs/heads/master
2020-12-02T01:31:27.398167
2020-04-15T05:36:45
2020-04-15T05:36:45
230,843,290
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package leetcode; public class leet_867 { public static int[][] transpose(int[][] A) { int[][] res = new int[A[0].length][A.length]; for (int i = 0; i < A[0].length; i++) { for (int j = 0; j < A.length; j++) { res[i][j] = A[j][i]; } } return res; } public static void main(String[] args) { int[][] A = { {1, 2, 3}, {4, 5, 6},}; int[][] ans = transpose(A); for (int i = 0; i < ans.length; i++) { for (int j = 0; j < ans[0].length; j++) { System.out.print(ans[i][j] + "\t"); } System.out.println(""); } } }
[ "noreply@github.com" ]
peterr4405.noreply@github.com
0d759cb85bfaa43ee021e639326024055b0209cd
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes2.dex_source_from_JADX/com/facebook/zero/protocol/methods/ZeroOptinMethod.java
7351177a1359e87ea74de1cda3850ac170c7e152
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
2,019
java
package com.facebook.zero.protocol.methods; import com.facebook.common.json.FbObjectMapperMethodAutoProvider; import com.facebook.http.protocol.ApiMethod; import com.facebook.http.protocol.ApiRequest; import com.facebook.http.protocol.ApiResponse; import com.facebook.http.protocol.ApiResponseType; import com.facebook.inject.InjectorLike; import com.facebook.zero.sdk.request.ZeroOptinParams; import com.facebook.zero.sdk.request.ZeroOptinResult; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.annotations.VisibleForTesting; import java.lang.reflect.Type; import java.util.List; import javax.inject.Inject; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; /* compiled from: fgl_write_fail */ public class ZeroOptinMethod extends ZeroBaseMethod implements ApiMethod<ZeroOptinParams, ZeroOptinResult> { private static final Class<?> f23740a = ZeroOptinMethod.class; private final ObjectMapper f23741b; public static ZeroOptinMethod m32170b(InjectorLike injectorLike) { return new ZeroOptinMethod(FbObjectMapperMethodAutoProvider.m6609a(injectorLike)); } public final ApiRequest mo672a(Object obj) { List b = m32171b((ZeroOptinParams) obj); b.toString(); return new ApiRequest("zeroOptin", "GET", "method/mobile.zeroOptin", b, ApiResponseType.JSON); } @Inject public ZeroOptinMethod(ObjectMapper objectMapper) { this.f23741b = objectMapper; } @VisibleForTesting private List<NameValuePair> m32171b(ZeroOptinParams zeroOptinParams) { List<NameValuePair> a = ZeroBaseMethod.m32153a(zeroOptinParams); a.add(new BasicNameValuePair("enc_phone", zeroOptinParams.a)); return a; } public final Object mo673a(Object obj, ApiResponse apiResponse) { apiResponse.m22211i(); return (ZeroOptinResult) this.f23741b.m6648a(apiResponse.m22205c().mo722c(), this.f23741b._typeFactory.m7109a((Type) ZeroOptinResult.class)); } }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
91610522b8e1a779a2dccae1782fe46b24132578
75950d61f2e7517f3fe4c32f0109b203d41466bf
/modules/tags/fabric3-modules-parent-pom-1.3/extension/implementation/fabric3-web/src/main/java/org/fabric3/implementation/web/runtime/WebComponentCreationException.java
47de0de4348a0dfb6125505765bc5ad824d42150
[]
no_license
codehaus/fabric3
3677d558dca066fb58845db5b0ad73d951acf880
491ff9ddaff6cb47cbb4452e4ddbf715314cd340
refs/heads/master
2023-07-20T00:34:33.992727
2012-10-31T16:32:19
2012-10-31T16:32:19
36,338,853
0
0
null
null
null
null
UTF-8
Java
false
false
2,213
java
/* * Fabric3 * Copyright (c) 2009 Metaform Systems * * Fabric3 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version, with the * following exception: * * Linking this software statically or dynamically with other * modules is making a combined work based on this software. * Thus, the terms and conditions of the GNU General Public * License cover the whole combination. * * As a special exception, the copyright holders of this software * give you permission to link this software with independent * modules to produce an executable, regardless of the license * terms of these independent modules, and to copy and distribute * the resulting executable under terms of your choice, provided * that you also meet, for each linked independent module, the * terms and conditions of the license of that module. An * independent module is a module which is not derived from or * based on this software. If you modify this software, you may * extend this exception to your version of the software, but * you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * * Fabric3 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the * GNU General Public License along with Fabric3. * If not, see <http://www.gnu.org/licenses/>. */ package org.fabric3.implementation.web.runtime; import org.fabric3.spi.builder.BuilderException; /** * Thrown when there is an error instantiating a web component. * * @version $Rev$ $Date$ */ public class WebComponentCreationException extends BuilderException { private static final long serialVersionUID = -679264080783573274L; public WebComponentCreationException(String message, Throwable cause) { super(message, cause); } public WebComponentCreationException(Throwable cause) { super(cause); } }
[ "jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf" ]
jmarino@83866bfc-822f-0410-aa35-bd5043b85eaf
6dbc6a308387f82bec950533a246d8f69504e6e1
b93ca50006703ba8d12b0d86f7727a616866a5d5
/arquillian-recorder/arquillian-recorder-api/src/main/java/org/arquillian/extension/recorder/RecorderStrategyRegister.java
309cd5b37f9d066cce16536ca063bd167ac7dbbf
[ "Apache-2.0" ]
permissive
CSchulz/arquillian-recorder
8a29e8950a9915a85f319cef7f5dc3d75d850e03
4df24b124460cd7bae0e1f73644bf77b512be081
refs/heads/master
2021-01-20T03:06:18.506586
2016-02-07T16:05:42
2016-02-09T21:36:35
57,077,475
0
0
null
2016-05-08T11:28:13
2016-04-25T21:26:37
Java
UTF-8
Java
false
false
1,956
java
/* * JBoss, Home of Professional Open Source * Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * 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.arquillian.extension.recorder; import java.util.Collections; import java.util.Set; import java.util.TreeSet; /** * @author <a href="mailto:smikloso@redhat.com">Stefan Miklosovic</a> * */ public class RecorderStrategyRegister { private final Set<RecorderStrategy<?>> recorderStrategies = new TreeSet<RecorderStrategy<?>>(new RecorderStrategyComparator()); public void add(RecorderStrategy<?> recorderStrategy) { this.recorderStrategies.add(recorderStrategy); } public void addAll(Set<RecorderStrategy<?>> recorderStrategies) { this.recorderStrategies.addAll(recorderStrategies); } public void clear() { recorderStrategies.clear(); } public void size() { recorderStrategies.size(); } public RecorderStrategy<?> get(int precedence) { for (final RecorderStrategy<?> strategy : recorderStrategies) { if (strategy.precedence() == precedence) { return strategy; } } return null; } public Set<RecorderStrategy<?>> getAll() { return Collections.unmodifiableSet(recorderStrategies); } }
[ "smikloso@redhat.com" ]
smikloso@redhat.com
ab2dd3de6d92d640db98e541d7bf4b8da02bebf9
b15a5627e81ef0ca9e6a7adc87621de8eb5cbacb
/src/main/java/trixware/erp/prodezydesktop/examples/SingleProcessDE_FormMachineWise.java
2d045432ba85f4ff5ede2fe85673fdbb7d41f7fd
[]
no_license
ladganesh/cicd-desktop
c17826949bdc8c2fa242b76a4e747db8ded0942b
c7298088c7931f0f033ee3d82c9f0ceb29438c16
refs/heads/master
2021-07-10T14:01:43.451408
2019-09-07T15:13:58
2019-09-07T15:13:58
206,965,619
0
0
null
2020-10-13T15:52:31
2019-09-07T12:33:24
Java
UTF-8
Java
false
false
71,441
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 trixware.erp.prodezydesktop.examples; import datechooser.view.WeekDaysStyle; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Vector; import javax.swing.BoxLayout; import javax.swing.DefaultListModel; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRootPane; import javax.swing.JScrollPane; import javax.swing.JSpinner; import javax.swing.JTextField; import javax.swing.SpinnerDateModel; import javax.swing.table.DefaultTableModel; import org.json.JSONArray; import org.json.JSONObject; import trixware.erp.prodezydesktop.Model.DailyDataEntryModel3; import trixware.erp.prodezydesktop.Model.EmployeeDR; import trixware.erp.prodezydesktop.Model.ProductDR; import trixware.erp.prodezydesktop.Model.RejectionModel; import trixware.erp.prodezydesktop.Model.Rejection_Reasons; import trixware.erp.prodezydesktop.Model.ShiftDR; import trixware.erp.prodezydesktop.Model.StaticValues; import trixware.erp.prodezydesktop.Model.TimeLossModel; import trixware.erp.prodezydesktop.Model.TimeLoss_Reasons; import trixware.erp.prodezydesktop.Model.UOMDR; import trixware.erp.prodezydesktop.components.RejectionDetailPanel; import trixware.erp.prodezydesktop.components.TimeLossDetailPanel; import trixware.erp.prodezydesktop.web_services.WebAPITester; /** * * @author Rajesh */ public class SingleProcessDE_FormMachineWise extends javax.swing.JPanel { DailyDataEntryModel3 data; String qin, qout, rej; boolean formIncomplete = false; JSpinner fromTimeSpinner = new JSpinner ( new SpinnerDateModel () ); JSpinner toTimeSpinner = new JSpinner ( new SpinnerDateModel () ); JSpinner.DateEditor fromTimeEditor = new JSpinner.DateEditor ( fromTimeSpinner , "hh:mm a" ); JSpinner.DateEditor toTimeEditor = new JSpinner.DateEditor ( toTimeSpinner , "hh:mm a" ); JComboBox<JPanel> jComboBox4 = new JComboBox<JPanel> (); // public ArrayList<String> list = = new ArrayList<String>( Arrays.asList( new String{ "Time Pass","Load shading", "Chaha Nashta","Zop" } ) ); // public List<String> list = new ArrayList<String>( Arrays.asList ( new String[] { "Time Pass" , "Load shading" , "Chaha Nashta" , "Zop" } ); public ShowShiftSelection dialog = null; public ShowTimeLossForm dialog2 = null; public ShowRejectionsForm dialog3 = null; ArrayList<TimeLoss_Reasons> timeloss_reasons = null; ArrayList<Rejection_Reasons> rej_reasons = null; private int selectedShiftId = 0; private ArrayList<TimeLossModel> selectedTimeLoss = new ArrayList<TimeLossModel> (); private ArrayList<RejectionModel> selectedrejections = new ArrayList<RejectionModel> (); /** * Creates new form SingleProcessDE_Form */ public SingleProcessDE_FormMachineWise () { initComponents (); // AutoCompletion.enable ( jComboBox1 ); // AutoCompletion.enable ( jComboBox2 ); // AutoCompletion.enable ( jComboBox3 ); data = new DailyDataEntryModel3 (); jLabel1.setVisible ( false ); dateChooserCombo1.setText ( dateChooserCombo3.getText () ); dateChooserCombo1.setFormat ( DateFormat.MEDIUM ); dateChooserCombo3.setFormat ( DateFormat.MEDIUM ); dateChooserCombo1.setWeekStyle ( WeekDaysStyle.NORMAL ); dateChooserCombo3.setWeekStyle ( WeekDaysStyle.NORMAL ); dateChooserCombo1.setOpaque ( false ); dateChooserCombo3.setOpaque ( false ); dateChooserCombo1.setBackground ( Color.WHITE ); dateChooserCombo3.setBackground ( Color.WHITE ); dateChooserCombo1.revalidate (); dateChooserCombo3.repaint (); jTextField1.addKeyListener ( k ); jTextField2.addKeyListener ( k ); jTextField3.addKeyListener ( k ); jTextField1.addFocusListener ( f2 ); jTextField2.addFocusListener ( f2 ); jTextField3.addFocusListener ( f3 ); jTextField4.addKeyListener ( k ); jTextField4.addFocusListener ( f ); jTextField5.addFocusListener ( f ); jTextField5.addKeyListener ( k ); jTextField6.addFocusListener ( f ); jTextField6.addKeyListener ( k ); jTextField7.addFocusListener ( f ); jTextField7.addKeyListener ( k ); fromTimeSpinner.setEditor ( fromTimeEditor ); fromTimeSpinner.setValue ( new Date () ); fromTimeSpinner.setBounds ( 125 , 10 , 70 , 32 ); fromTimeSpinner.setOpaque ( false ); fromTimeSpinner.setFont ( new java.awt.Font ( "Leelawadee UI" , 0 , 12 ) ); add ( fromTimeSpinner ); toTimeSpinner.setEditor ( toTimeEditor ); toTimeSpinner.setValue ( new Date () ); toTimeSpinner.setBounds ( 325 , 10 , 70 , 32 ); toTimeSpinner.setOpaque ( false ); toTimeSpinner.setFont ( new java.awt.Font ( "Leelawadee UI" , 0 , 12 ) ); add ( toTimeSpinner ); jButton1.addActionListener ( shift ); jButton2.addActionListener ( timeloss ); jButton3.addActionListener ( rejections ); jComboBox1.addActionListener(product); revalidate (); repaint (); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings( "unchecked" ) // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jTextField3 = new javax.swing.JTextField(); jComboBox2 = new javax.swing.JComboBox<>(); jTextField4 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField(); jSpinner1 = new javax.swing.JSpinner(); jTextField6 = new javax.swing.JTextField(); jTextField7 = new javax.swing.JTextField(); jSpinner2 = new javax.swing.JSpinner(); dateChooserCombo3 = new datechooser.beans.DateChooserCombo(); dateChooserCombo1 = new datechooser.beans.DateChooserCombo(); jComboBox3 = new javax.swing.JComboBox<>(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jComboBox1 = new javax.swing.JComboBox<>(); UOMOUT1 = new javax.swing.JComboBox<>(); UOMOUT = new javax.swing.JComboBox<>(); UOMIN = new javax.swing.JComboBox<>(); setBorder(javax.swing.BorderFactory.createTitledBorder("")); setOpaque(false); setPreferredSize(new java.awt.Dimension(1310, 60)); setLayout(null); jTextField1.setFont(new java.awt.Font("Leelawadee UI", 0, 12)); // NOI18N jTextField1.setText("0"); jTextField1.setToolTipText(""); jTextField1.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { jTextField1KeyTyped(evt); } }); add(jTextField1); jTextField1.setBounds(720, 10, 50, 30); jTextField2.setFont(new java.awt.Font("Leelawadee UI", 0, 12)); // NOI18N jTextField2.setText("0"); jTextField2.setToolTipText(""); jTextField2.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { jTextField2KeyTyped(evt); } }); add(jTextField2); jTextField2.setBounds(780, 10, 50, 30); jTextField3.setFont(new java.awt.Font("Leelawadee UI", 0, 12)); // NOI18N jTextField3.setText("0"); jTextField3.setToolTipText(""); jTextField3.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { jTextField3KeyTyped(evt); } }); add(jTextField3); jTextField3.setBounds(840, 10, 50, 30); jComboBox2.setFont(new java.awt.Font("Leelawadee UI", 0, 12)); // NOI18N jComboBox2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jComboBox2MouseClicked(evt); } }); add(jComboBox2); jComboBox2.setBounds(990, 10, 140, 30); jTextField4.setText("0"); jTextField4.setPreferredSize(new java.awt.Dimension(0, 0)); add(jTextField4); jTextField4.setBounds(370, 10, 0, 0); jTextField5.setText("0"); jTextField5.setPreferredSize(new java.awt.Dimension(0, 0)); add(jTextField5); jTextField5.setBounds(400, 10, 0, 0); jSpinner1.setFont(new java.awt.Font("Leelawadee UI", 0, 11)); // NOI18N jSpinner1.setModel(new javax.swing.SpinnerListModel(new String[] {"AM", "PM"})); jSpinner1.setPreferredSize(new java.awt.Dimension(0, 0)); add(jSpinner1); jSpinner1.setBounds(430, 10, 0, 0); jTextField6.setText("0"); jTextField6.setPreferredSize(new java.awt.Dimension(0, 0)); jTextField6.addFocusListener(new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { jTextField6FocusLost(evt); } }); jTextField6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField6ActionPerformed(evt); } }); jTextField6.addKeyListener(new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { jTextField6KeyTyped(evt); } }); add(jTextField6); jTextField6.setBounds(120, 10, 0, 0); jTextField7.setText("0"); jTextField7.setPreferredSize(new java.awt.Dimension(0, 0)); add(jTextField7); jTextField7.setBounds(150, 10, 0, 0); jSpinner2.setFont(new java.awt.Font("Leelawadee UI", 0, 11)); // NOI18N jSpinner2.setModel(new javax.swing.SpinnerListModel(new String[] {"AM", "PM"})); jSpinner2.setPreferredSize(new java.awt.Dimension(0, 0)); add(jSpinner2); jSpinner2.setBounds(180, 10, 0, 0); dateChooserCombo3.setCalendarPreferredSize(new java.awt.Dimension(320, 220)); dateChooserCombo3.setFormat(2); add(dateChooserCombo3); dateChooserCombo3.setBounds(10, 10, 110, 30); dateChooserCombo1.setCalendarPreferredSize(new java.awt.Dimension(320, 220)); try { dateChooserCombo1.setDefaultPeriods(dateChooserCombo3.getDefaultPeriods()); } catch (datechooser.model.exeptions.IncompatibleDataExeption e1) { e1.printStackTrace(); } dateChooserCombo1.addCommitListener(new datechooser.events.CommitListener() { public void onCommit(datechooser.events.CommitEvent evt) { dateChooserCombo1OnCommit(evt); } }); add(dateChooserCombo1); dateChooserCombo1.setBounds(210, 10, 110, 30); jComboBox3.setFont(new java.awt.Font("Leelawadee UI", 0, 12)); // NOI18N jComboBox3.setEnabled(false); jComboBox3.setPreferredSize(new java.awt.Dimension(0, 0)); add(jComboBox3); jComboBox3.setBounds(890, 10, 0, 0); jLabel1.setText("jLabel1"); add(jLabel1); jLabel1.setBounds(500, 10, 10, 30); jLabel2.setText("jLabel2"); add(jLabel2); jLabel2.setBounds(410, 16, 130, 20); jButton3.setFont(new java.awt.Font("Leelawadee UI", 0, 10)); // NOI18N jButton3.setText("Rejections"); add(jButton3); jButton3.setBounds(900, 10, 80, 23); jButton1.setFont(new java.awt.Font("Leelawadee UI", 0, 10)); // NOI18N jButton1.setText("Select Shift"); add(jButton1); jButton1.setBounds(1140, 10, 80, 23); jButton2.setFont(new java.awt.Font("Leelawadee UI", 0, 10)); // NOI18N jButton2.setText("AddTime Loss Details"); add(jButton2); jButton2.setBounds(1230, 10, 120, 23); jComboBox1.setFont(new java.awt.Font("Leelawadee UI", 0, 12)); // NOI18N add(jComboBox1); jComboBox1.setBounds(550, 10, 160, 30); UOMOUT1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); UOMOUT1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { UOMOUT1ActionPerformed(evt); } }); add(UOMOUT1); UOMOUT1.setBounds(840, 40, 50, 20); UOMOUT.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); add(UOMOUT); UOMOUT.setBounds(780, 40, 50, 20); UOMIN.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); add(UOMIN); UOMIN.setBounds(720, 40, 50, 20); }// </editor-fold>//GEN-END:initComponents ActionListener product=new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setUni(); } }; ActionListener shift = new ActionListener () { @Override public void actionPerformed ( ActionEvent e ) { dialog = new ShowShiftSelection ( HomeScreen.home ); dialog.setVisible ( true ); } }; ActionListener timeloss = new ActionListener () { @Override public void actionPerformed ( ActionEvent e ) { dialog2 = new ShowTimeLossForm ( HomeScreen.home ); dialog2.setVisible ( true ); } }; ActionListener rejections = new ActionListener () { @Override public void actionPerformed ( ActionEvent e ) { dialog3 = new ShowRejectionsForm ( HomeScreen.home ); dialog3.setVisible ( true ); } }; private void dateChooserCombo1OnCommit(datechooser.events.CommitEvent evt) {//GEN-FIRST:event_dateChooserCombo1OnCommit // TODO add your handling code here: }//GEN-LAST:event_dateChooserCombo1OnCommit private void jTextField6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField6ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jTextField6ActionPerformed private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyTyped // TODO add your handling code here: char enter = evt.getKeyChar (); if ( ! ( Character.isDigit ( enter ) ) ) { evt.consume (); } }//GEN-LAST:event_jTextField1KeyTyped private void jTextField2KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField2KeyTyped // TODO add your handling code here: char enter = evt.getKeyChar (); if ( ! ( Character.isDigit ( enter ) ) ) { evt.consume (); } }//GEN-LAST:event_jTextField2KeyTyped private void jTextField3KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField3KeyTyped // TODO add your handling code here: char enter = evt.getKeyChar (); if ( ! ( Character.isDigit ( enter ) ) ) { evt.consume (); } }//GEN-LAST:event_jTextField3KeyTyped private void jTextField6KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField6KeyTyped // TODO add your handling code here: }//GEN-LAST:event_jTextField6KeyTyped private void jTextField6FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField6FocusLost // TODO add your handling code here: }//GEN-LAST:event_jTextField6FocusLost private void jComboBox2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBox2MouseClicked if ( jComboBox2.getItemCount () == 0 ) { JOptionPane.showMessageDialog ( null , "<html><size='06'>First add EmployyeName from Employee Master" ); } // TODO add your handling code here: }//GEN-LAST:event_jComboBox2MouseClicked private void UOMOUT1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_UOMOUT1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_UOMOUT1ActionPerformed FocusListener f = new FocusListener () { @Override public void focusGained ( FocusEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. JTextField jcb = ( JTextField ) e.getSource (); // jcb.setText(""); jcb.selectAll (); } @Override public void focusLost ( FocusEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. JTextField jcb = ( JTextField ) e.getSource (); try { int num = Integer.parseInt ( String.valueOf ( jcb.getText ().toString () ) ); if ( num < 1 || num > 59 ) { jcb.setText ( "0" ); //evt.consume (); } } catch ( NumberFormatException ex1 ) { jcb.setText ( "0" ); StaticValues.writer.writeExcel ( SingleProcessDE_FormMachineWise.class.getSimpleName () , SingleProcessDE_FormMachineWise.class.getSimpleName () , ex1.getClass ().toString () , Thread.currentThread ().getStackTrace ()[ 1 ].getLineNumber () + "" , ex1.getMessage () , StaticValues.sdf2.format ( Calendar.getInstance ().getTime () ) ); } } }; FocusListener f2 = new FocusListener () { @Override public void focusGained ( FocusEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. JTextField jcb = ( JTextField ) e.getSource (); // jcb.setText(""); jcb.selectAll (); } @Override public void focusLost ( FocusEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To Search Google or type URL //change body of generated methods, choose Tools | Templates. JTextField jcb = ( JTextField ) e.getSource (); String x = jcb.getText ().trim (); if ( x.equalsIgnoreCase ( "" ) ) { x = "0"; } try { int num = Integer.parseInt ( String.valueOf ( jcb.getText ().toString () ) ); if ( num < 0 ) { jcb.setText ( x ); //evt.consume (); } } catch ( NumberFormatException ex1 ) { jcb.setText ( x ); StaticValues.writer.writeExcel ( SingleProcessDE_FormMachineWise.class.getSimpleName () , SingleProcessDE_FormMachineWise.class.getSimpleName () , ex1.getClass ().toString () , Thread.currentThread ().getStackTrace ()[ 1 ].getLineNumber () + "" , ex1.getMessage () , StaticValues.sdf2.format ( Calendar.getInstance ().getTime () ) ); } } }; FocusListener f3 = new FocusListener () { @Override public void focusGained ( FocusEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. JTextField jcb = ( JTextField ) e.getSource (); // jcb.setText(""); jcb.selectAll (); } @Override public void focusLost ( FocusEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To Search Google or type URL //change body of generated methods, choose Tools | Templates. JTextField jcb = ( JTextField ) e.getSource (); String x = jcb.getText ().trim (); if ( x.equalsIgnoreCase ( "" ) ) { x = "0"; } try { int num = Integer.parseInt ( String.valueOf ( jcb.getText ().toString () ) ); if ( num < 0 || num == 0 ) { jcb.setText ( x ); jComboBox3.setEnabled ( false ); } else { jComboBox3.setEnabled ( true ); } } catch ( NumberFormatException ex1 ) { jcb.setText ( x ); StaticValues.writer.writeExcel ( SingleProcessDE_FormMachineWise.class.getSimpleName () , SingleProcessDE_FormMachineWise.class.getSimpleName () , ex1.getClass ().toString () , Thread.currentThread ().getStackTrace ()[ 1 ].getLineNumber () + "" , ex1.getMessage () , StaticValues.sdf2.format ( Calendar.getInstance ().getTime () ) ); } } }; FocusListener f4 = new FocusListener () { @Override public void focusGained ( FocusEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. JTextField jcb = ( JTextField ) e.getSource (); // jcb.setText(""); jcb.selectAll (); } @Override public void focusLost ( FocusEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. JTextField jcb = ( JTextField ) e.getSource (); try { int num = Integer.parseInt ( String.valueOf ( jcb.getText ().toString () ) ); if ( num < 1 || num > 59 ) { jcb.setText ( "0" ); //evt.consume (); } } catch ( NumberFormatException ex1 ) { jcb.setText ( "0" ); StaticValues.writer.writeExcel ( SingleProcessDE_Form.class.getSimpleName () , SingleProcessDE_Form.class.getSimpleName () , ex1.getClass ().toString () , Thread.currentThread ().getStackTrace ()[ 1 ].getLineNumber () + "" , ex1.getMessage () , StaticValues.sdf2.format ( Calendar.getInstance ().getTime () ) ); } } }; KeyListener k = new KeyListener () { @Override public void keyTyped ( KeyEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. char enter = e.getKeyChar (); if ( ! ( Character.isDigit ( enter ) ) ) { e.consume (); } } @Override public void keyPressed ( KeyEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. } @Override public void keyReleased ( KeyEvent e ) { // throw new UnsupportedOperationException ( "Not supported yet." ); //To change body of generated methods, choose Tools | Templates. } }; // String FromDate; // String FromTime; // String ToDate; // String ToTime; // String Processname; // String ProcessID; // String QIn; // String Qout; // String Rejected; // ArrayList<EmployeeDR> Employee; // ArrayList<MachineDR> Machine; // setProduct name public void setProductName ( String productName ) { data.productName = productName; } // set product id public void setProductId ( int productId ) { data.productId = productId; } // get product name public String getProductName () { return data.productName; } // get product id public int getProductId () { //return data.productId; return data.Products.get ( jComboBox1.getSelectedIndex() ).FG_ID ; } public String getRDate () { return sdf2.format ( dateChooserCombo3.getSelectedDate ().getTime () ) + " 00:00:00"; } public String getRTDate () { return sdf2.format ( dateChooserCombo1.getSelectedDate ().getTime () ) + " 00:00:00"; } public String getSFromTime () { try { return new SimpleDateFormat ( "HH:mm" ).format ( ( Date ) new SimpleDateFormat ( "E MMM dd HH:mm:ss Z yyyy" ).parse ( fromTimeSpinner.getValue ().toString () ) ); } catch ( ParseException e ) { return ""; } //return fromTime(); } public String getSToTime () { try { return new SimpleDateFormat ( "HH:mm" ).format ( ( Date ) new SimpleDateFormat ( "E MMM dd HH:mm:ss Z yyyy" ).parse ( toTimeSpinner.getValue ().toString () ) ); } catch ( ParseException e ) { return ""; } // return toTime(); } public String getFromDate () { return dateChooserCombo3.getText (); } public String getFromTime () { // return fromHr + ":" + fromMin; try { return new SimpleDateFormat ( "HH:mm" ).format ( ( Date ) new SimpleDateFormat ( "E MMM dd HH:mm:ss Z yyyy" ).parse ( fromTimeSpinner.getValue ().toString () ) ); } catch ( ParseException e ) { return ""; } } public String getToDate () { return dateChooserCombo1.getText (); } public String getToTime () { //return toHr + ":" + toMin; try { return new SimpleDateFormat ( "HH:mm" ).format ( ( Date ) new SimpleDateFormat ( "E MMM dd HH:mm:ss Z yyyy" ).parse ( toTimeSpinner.getValue ().toString () ) ); } catch ( ParseException e ) { return ""; } } public String getQIn () { return jTextField1.getText (); } public String getQout () { return jTextField2.getText (); } public String getRejected () { return jTextField3.getText (); } public int getEmployee () { //return Employee; return data.Employee.get(jComboBox2.getSelectedIndex ()).EMP_ID; } public int getUOMIn () { //return Employee; return UOMIN.getSelectedIndex (); } public int getUOMOut () { //return Employee; return UOMOUT.getSelectedIndex (); } public int getUOMOutRej () { //return Employee; return UOMOUT1.getSelectedIndex (); } public String getProcessname () { return jLabel2.getText (); } public String getProcessID () { return jLabel1.getText (); } public void setProcessname ( String processname ) { //data.Processname = processname; data.setProcessname ( processname ); jLabel2.setText ( processname ); } public void setProcessID ( String processID ) { // data.ProcessID = processID; data.setProcessID ( processID ); jLabel1.setText ( processID ); } // public int getMachine() { // //return Machine; // return jComboBox1.getSelectedIndex () ; // } public int getRejectionReason () { //return Machine; return jComboBox3.getSelectedIndex (); } public String getShift () { //selectedShiftId = dialog.getSelectedShift (); return selectedShiftId + ""; } public ArrayList<TimeLossModel> getTimeLossReasons () { return selectedTimeLoss; } public ArrayList<RejectionModel> getRejectionReasons () { return selectedrejections; } public void setFromDate ( String fromDate ) { data.FromDate = fromDate; } public void setFromTime ( String fromTime ) { data.FromTime = fromTime; } public void setToDate ( String toDate ) { data.ToDate = toDate; } public void setToTime ( String toTime ) { data.ToTime = toTime; } public void setMachinename ( String processname ) { data.Machinename = processname; jLabel2.setText ( processname ); } public void setMachineID ( String processID ) { data.MachineID = processID; jLabel1.setText ( processID ); } public void setQIn ( String QIn ) { data.QIn = QIn; // jTextField1.setText ( QIn ); } public void setQout ( String qout ) { data.Qout = qout; // jTextField2.setText (qout ); } public void setRejected ( String rejected ) { data.Rejected = rejected; // jTextField3.setText ( rejected ); } public void setEmployee ( ArrayList<EmployeeDR> employee ) { data.Employee = employee; jComboBox2.removeAllItems (); for ( int i = 0 ; i < employee.size () ; i ++ ) { jComboBox2.addItem ( employee.get ( i ).EMP_NAME ); } } public void setUni() { try{ int pid=Integer.parseInt(getProcessID()); int FGID=getProductId(); if(new DailyReportFormMachineWise(0).verifyFirstOrOnlyProcess(FGID, pid)) { int RMID=DailyReportFormMachineWise.RMID; int unitValue = DailyReportForm.getUnitNumber(RMID, FGID); int unitOfM=Integer.parseInt(data.Products.get(jComboBox1.getSelectedIndex()).UOM); String unit1=""; String unit = ""; for (int j = 0; j <data.UOM.size() ; j++) { if (unitValue == data.UOM.get(j).UOM_ID) { unit = data.UOM.get(j).UOM_NAME; } if(unitOfM==data.UOM.get(j).UOM_ID) { unit1=data.UOM.get(j).UOM_NAME; } } UOMIN.removeAllItems(); UOMOUT.removeAllItems(); UOMOUT1.removeAllItems(); UOMIN.addItem(unit); UOMOUT.addItem(unit1); UOMOUT1.addItem(unit1); }else{ int unitOfM=Integer.parseInt(data.Products.get(jComboBox1.getSelectedIndex()).UOM); String unit = ""; for (int j = 0; j < data.UOM.size(); j++) { if (unitOfM == data.UOM.get(j).UOM_ID) { unit = data.UOM.get(j).UOM_NAME; } } UOMIN.removeAllItems(); UOMOUT.removeAllItems(); UOMOUT1.removeAllItems(); UOMIN.addItem(unit); UOMOUT.addItem(unit); UOMOUT1.addItem(unit); } }catch(Exception ex){} } public void setUnit(ArrayList<UOMDR> oum) { data.UOM = oum; // UOMIN.removeAllItems(); // UOMOUT.removeAllItems(); // UOMOUT1.removeAllItems(); // // for (int i = 0; i < oum.size(); i++) { // UOMIN.addItem(oum.get(i).UOM_NAME); // UOMOUT.addItem(oum.get(i).UOM_NAME); // UOMOUT1.addItem(oum.get(i).UOM_NAME); // } } public void setProducts(ArrayList<ProductDR> products) { data.Products = products; jComboBox1.removeAllItems (); for( int i=0; i<products.size (); i++ ){ jComboBox1.addItem ( products.get ( i ).FG_PART_NO ); } } public void setShift ( String shift ) { //data.SelShift = Integer.parseInt ( shift ); data.setShiftData ( Integer.parseInt ( shift ) ); selectedShiftId = Integer.parseInt ( shift ); // jButton1.setText ( shift ); } public void setTimeLoss ( ArrayList<TimeLossModel> timeLossList ) { data.selectedtimeLossData = timeLossList; selectedTimeLoss = timeLossList; } public void setrejections ( ArrayList<RejectionModel> rejectionList ) { data.selectedtimeRejections = rejectionList; selectedrejections = rejectionList; } public void setRejectionReasons ( ArrayList<Rejection_Reasons> rejectionReasons ) { data.RejRsn = rejectionReasons; jComboBox3.removeAllItems (); for ( int i = 0 ; i < rejectionReasons.size () ; i ++ ) { jComboBox3.addItem ( rejectionReasons.get ( i ).REJ_DESC ); } } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JComboBox<String> UOMIN; private javax.swing.JComboBox<String> UOMOUT; private javax.swing.JComboBox<String> UOMOUT1; private datechooser.beans.DateChooserCombo dateChooserCombo1; private datechooser.beans.DateChooserCombo dateChooserCombo3; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JComboBox<String> jComboBox1; private javax.swing.JComboBox<String> jComboBox2; private javax.swing.JComboBox<String> jComboBox3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JSpinner jSpinner1; private javax.swing.JSpinner jSpinner2; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField jTextField6; private javax.swing.JTextField jTextField7; // End of variables declaration//GEN-END:variables Calendar c1 = null, c2 = null; SimpleDateFormat sdf2 = new SimpleDateFormat ( "yyyy-MM-dd" ); SimpleDateFormat sdf1 = new SimpleDateFormat ( "HH:mm:ss" ); Calendar c3 = Calendar.getInstance (); Calendar c4 = Calendar.getInstance (); int fromHr, fromMin, toHr, toMin; public String fromTime () { // if(jSpinner2.getValue ().equals ( "PM")){ // fromHr = Integer.parseInt( jTextField6.getText ()) + 12; // // c3.set ( Calendar.AM_PM, Calendar.PM); // }else{ // fromHr = Integer.parseInt( jTextField6.getText ()) ; // // c3.set ( Calendar.AM_PM, Calendar.AM); // } // fromMin = Integer.parseInt(jTextField7.getText ()); // // if(fromHr == 0 ){ // if(fromMin==0){ // formIncomplete = true ; // }else{ // formIncomplete = false ; // } // }else{ // formIncomplete = false ; // } // // // c3.set ( Calendar.HOUR , Integer.parseInt( jTextField6.getText ())); // c3.set ( Calendar.MINUTE , fromMin); // if(jSpinner2.getValue ().equals ( "PM")){ // c3.set ( Calendar.AM_PM, Calendar.PM); // }else{ // c3.set ( Calendar.AM_PM, Calendar.AM); // } // // return sdf1.format(c3.getTime()) ; try { return new SimpleDateFormat ( "HH:mm" ).format ( ( Date ) new SimpleDateFormat ( "E MMM dd HH:mm:ss Z yyyy" ).parse ( fromTimeSpinner.getValue ().toString () ) ); } catch ( ParseException e ) { return ""; } } public String toTime () { // return toTimeSpinner.getValue ().toString (); try { return new SimpleDateFormat ( "HH:mm" ).format ( ( Date ) new SimpleDateFormat ( "E MMM dd HH:mm:ss Z yyyy" ).parse ( toTimeSpinner.getValue ().toString () ) ); } catch ( ParseException e ) { return ""; } // if(jSpinner1.getValue ().equals ( "PM")){ // toHr = Integer.parseInt( jTextField4.getText ()) + 12; // // c4.set ( Calendar.AM_PM, Calendar.PM); // }else{ // toHr = Integer.parseInt( jTextField4.getText ()) ; // // c4.set ( Calendar.AM_PM, Calendar.AM); // } // toMin = Integer.parseInt(jTextField5.getText ()); // // if(toHr == 0 ){ // if(toMin==0){ // formIncomplete = true ; // }else{ // formIncomplete = false ; // } // }else{ // formIncomplete = false ; // } // // c4.set ( Calendar.HOUR , Integer.parseInt( jTextField4.getText ())); // c4.set ( Calendar.MINUTE , toMin); // if(jSpinner1.getValue ().equals ( "PM")){ // c4.set ( Calendar.AM_PM, Calendar.PM); // }else{ // c4.set ( Calendar.AM_PM, Calendar.AM); // } // // // return sdf1.format(c4.getTime()); } public String formatFromDate () { // // c1 = Calendar.getInstance (); // // String[] dateIP = dateChooserCombo3.getText ().split ( " " ); // // String fromDate = null; // // if ( dateIP[ 1 ].length () == 3 ) { // fromDate = dateIP[ 1 ].substring ( 0 , 2 ) + "-"; // c1.set ( Calendar.DATE , Integer.parseInt ( dateIP[ 1 ].substring ( 0 , 2 ) ) ); // } else if ( dateIP[ 1 ].length () == 2 ) { // fromDate = "0" + dateIP[ 1 ].substring ( 0 , 1 ) + "-"; // c1.set ( Calendar.DATE , Integer.parseInt ( dateIP[ 1 ].substring ( 0 , 1 ) ) ); // } // // String mon = dateIP[ 0 ]; // // switch ( mon ) { // // case "Jan": // fromDate = fromDate + "01-"; // c1.set ( Calendar.MONTH , 0 ); // break; // case "Feb": // fromDate = fromDate + "02-"; // c1.set ( Calendar.MONTH , 1 ); // break; // case "Mar": // fromDate = fromDate + "03-"; // c1.set ( Calendar.MONTH , 2 ); // break; // case "Apr": // fromDate = fromDate + "04-"; // c1.set ( Calendar.MONTH , 3 ); // break; // case "May": // fromDate = fromDate + "05-"; // c1.set ( Calendar.MONTH , 4 ); // break; // case "Jun": // fromDate = fromDate + "06-"; // c1.set ( Calendar.MONTH , 5 ); // break; // case "Jul": // fromDate = fromDate + "07-"; // c1.set ( Calendar.MONTH , 6 ); // break; // case "Aug": // fromDate = fromDate + "08-"; // c1.set ( Calendar.MONTH , 7 ); // break; // case "Sep": // fromDate = fromDate + "09-"; // c1.set ( Calendar.MONTH , 8 ); // break; // case "Oct": // fromDate = fromDate + "10-"; // c1.set ( Calendar.MONTH , 9 ); // break; // case "Nov": // fromDate = fromDate + "11-"; // c1.set ( Calendar.MONTH , 10 ); // break; // case "Dec": // fromDate = fromDate + "12-"; // c1.set ( Calendar.MONTH , 11 ); // break; // // } // // // fromDate = fromDate + dateIP[2]; // c1.set ( Calendar.YEAR , Integer.parseInt ( dateIP[ 2 ] ) ); // fromDate = sdf2.format ( c1.getTime () ) + " 00:00:00"; // // // c1.setFirstDayOfWeek ( Calendar.SUNDAY); // // System.out.println( "This is #"+ c1.get ( Calendar.WEEK_OF_MONTH) +" week in the month"); // // System.out.println( "This is #"+ (c1.get ( Calendar.MONTH) +1)+" month in the year"); // SimpleDateFormat sdf = new SimpleDateFormat ( "EEEE" ); // SimpleDateFormat sdf1 = new SimpleDateFormat ( "MMM" ); // SimpleDateFormat sdf2 = new SimpleDateFormat ( "yyyy" ); // SimpleDateFormat sdf3 = new SimpleDateFormat ( "dd" ); // return sdf2.format ( dateChooserCombo3.getSelectedDate ().getTime () ) + " 00:00:00"; } public String formatToDate () { // c2 = Calendar.getInstance () ; // // String[] dateIP2 = dateChooserCombo1.getText ().split ( " " ); // String toDate = null; // // if ( dateIP2[ 1 ].length () == 3 ) { // toDate = dateIP2[ 1 ].substring ( 0 , 2 ) + "-"; // c2.set ( Calendar.DATE , Integer.parseInt ( dateIP2[ 1 ].substring ( 0 , 2 ) ) ); // } else if ( dateIP2[ 1 ].length () == 2 ) { // toDate = "0" + dateIP2[ 1 ].substring ( 0 , 1 ) + "-"; // c2.set ( Calendar.DATE , Integer.parseInt ( dateIP2[ 1 ].substring ( 0 , 1 ) ) ); // } // String mon2 = dateIP2[ 0 ]; // // switch ( mon2 ) { // // case "Jan": // toDate = toDate + "01-"; // c2.set ( Calendar.MONTH , 0 ); // break; // case "Feb": // toDate = toDate + "02-"; // c2.set ( Calendar.MONTH , 1 ); // break; // case "Mar": // toDate = toDate + "03-"; // c2.set ( Calendar.MONTH , 2 ); // break; // case "Apr": // toDate = toDate + "04-"; // c2.set ( Calendar.MONTH , 3 ); // break; // case "May": // toDate = toDate + "05-"; // c2.set ( Calendar.MONTH , 4 ); // break; // case "Jun": // toDate = toDate + "06-"; // c2.set ( Calendar.MONTH , 5 ); // break; // case "Jul": // toDate = toDate + "07-"; // c2.set ( Calendar.MONTH , 6 ); // break; // case "Aug": // toDate = toDate + "08-"; // c2.set ( Calendar.MONTH , 7 ); // break; // case "Sep": // toDate = toDate + "09-"; // c2.set ( Calendar.MONTH , 8 ); // break; // case "Oct": // toDate = toDate + "10-"; // c2.set ( Calendar.MONTH , 9 ); // break; // case "Nov": // toDate = toDate + "11-"; // c2.set ( Calendar.MONTH , 10 ); // break; // case "Dec": // toDate = toDate + "12-"; // c2.set ( Calendar.MONTH , 11 ); // break; // // } // // //toDate = toDate + dateIP2[2]; // c2.set ( Calendar.YEAR , Integer.parseInt ( dateIP2[ 2 ] ) ); // toDate = sdf2.format ( c2.getTime () ) + " 00:00:00"; // // c2.setFirstDayOfWeek ( Calendar.SUNDAY ); // // System.out.println( "This is #"+ c2.get ( Calendar.WEEK_OF_MONTH) +" week in the month"); // // System.out.println( "This is #"+ (c2.get ( Calendar.MONTH) +1)+" month in the year"); // return toDate; return sdf2.format ( dateChooserCombo1.getSelectedDate ().getTime () ) + " 00:00:00"; } class ShowShiftSelection extends JDialog { ShiftsList confirm; public ShowShiftSelection ( Frame parent ) { super ( parent , "Login" , true ); setUndecorated ( true ); getRootPane ().setWindowDecorationStyle ( JRootPane.NONE ); confirm = new ShiftsList (); confirm.setBounds ( 10 , 10 , 200 , 225 ); getContentPane ().add ( confirm , BorderLayout.CENTER ); setBackground ( Color.yellow ); pack (); setResizable ( false ); setBounds ( 0 , 0 , 220 , 255 ); setLocationRelativeTo ( parent ); // this.getRootPane().setDefaultButton(btnLogin); } public int getSelectedShift () { return confirm.getSelectedShiftId (); } public void closeBOMWindow () { dispose (); } } class ShiftsList extends javax.swing.JPanel { ResultSet result = null; ArrayList<ShiftDR> shifts = new ArrayList<ShiftDR> (); DefaultListModel<String> list = null; String selectedShiftStr = ""; /** * Creates new form ProdDataConformationScreen */ public ShiftsList () { initComponents (); jList1.setVisibleRowCount ( 4 ); list = new DefaultListModel<> (); String addEmpAPICall = "shifts"; String result2 = WebAPITester.prepareWebCall ( addEmpAPICall, StaticValues.getHeader () , ""); try{ if( ! result2.contains( "not found" ) ){ HashMap<String, Object> map = new HashMap<String, Object>(); JSONObject jObject = new JSONObject( result2 ); Iterator<?> keys = jObject.keys(); while( keys.hasNext() ){ String key = (String)keys.next(); Object value = jObject.get ( key ) ; map.put(key, value); } JSONObject st = (JSONObject) map.get ( "data" ); JSONArray records = st.getJSONArray ( "records"); JSONObject emp = null; shifts = new ArrayList<ShiftDR> (); for ( int i = 0 ; i < records.length () ; i ++ ) { emp = records.getJSONObject ( i); ShiftDR sdr1 = new ShiftDR (); sdr1.SHIFT_ID = Integer.parseInt(emp.get ( "shiftid" ).toString ()) ; sdr1.SHIFT_NAME = emp.get ( "shifttitle" ).toString () ; list.addElement ( emp.get ( "shifttitle" ).toString ()); shifts.add( sdr1 ); } jList1.setModel ( list ); } }catch(ArrayIndexOutOfBoundsException e){ System.out.println ( ""+e.getMessage () ); } // jList1.setBounds(10 , 10 , 200, 200); } public DefaultTableModel buildTableModel ( ResultSet rs ) throws SQLException { ResultSetMetaData metaData = rs.getMetaData (); // names of columns Vector<String> columnNames = new Vector<String> (); int columnCount = metaData.getColumnCount (); for ( int column = 1 ; column <= columnCount ; column ++ ) { columnNames.add ( metaData.getColumnName ( column ) ); } // data of the table Vector<Vector<Object>> data = new Vector<Vector<Object>> (); while ( rs.next () ) { Vector<Object> vector = new Vector<Object> (); for ( int columnIndex = 1 ; columnIndex <= columnCount ; columnIndex ++ ) { vector.add ( rs.getObject ( columnIndex ) ); } data.add ( vector ); } return new DefaultTableModel ( data , columnNames ); } @SuppressWarnings( "unchecked" ) // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents () { jButton1 = new javax.swing.JButton (); jButton2 = new javax.swing.JButton (); jLabel1 = new javax.swing.JLabel (); jScrollPane2 = new javax.swing.JScrollPane (); jList1 = new javax.swing.JList<> (); setLayout ( null ); jButton1.setText ( "Select" ); jButton1.setOpaque ( false ); jButton1.addMouseListener ( new java.awt.event.MouseAdapter () { public void mouseClicked ( java.awt.event.MouseEvent evt ) { jButton1MouseClicked ( evt ); } } ); add ( jButton1 ); jButton1.setBounds ( 10 , 220 , 90 , 30 ); jButton2.setText ( "Cancel" ); jButton2.setOpaque ( false ); jButton2.addMouseListener ( new java.awt.event.MouseAdapter () { public void mouseClicked ( java.awt.event.MouseEvent evt ) { jButton2MouseClicked ( evt ); } } ); add ( jButton2 ); jButton2.setBounds ( 100 , 220 , 100 , 30 ); jLabel1.setHorizontalAlignment ( javax.swing.SwingConstants.CENTER ); jLabel1.setText ( "Select Shift" ); jLabel1.setForeground ( Color.WHITE ); add ( jLabel1 ); jLabel1.setBounds ( 0 , 0 , 200 , 30 ); jList1.setModel ( new javax.swing.AbstractListModel<String> () { String[] strings = { "Item 1" , "Item 2" , "Item 3" , "Item 4" , "Item 5" }; public int getSize () { return strings.length; } public String getElementAt ( int i ) { return strings[ i ]; } } ); jList1.setVisibleRowCount ( 4); jList1.setFixedCellHeight ( 40); jList1.setSelectionMode ( javax.swing.ListSelectionModel.SINGLE_SELECTION ); jScrollPane2.setViewportView ( jList1 ); add ( jScrollPane2 ); jScrollPane2.setBounds ( 15, 50, 180, 160 ); setBackground ( new java.awt.Color ( 60,63,65 ) ); setPreferredSize ( new java.awt.Dimension ( 200 , 300 ) ); }// </editor-fold> private void jButton1MouseClicked ( java.awt.event.MouseEvent evt ) { selectedShiftId = shifts.get( jList1.getSelectedIndex () ).SHIFT_ID; selectedShiftStr = shifts.get( jList1.getSelectedIndex () ).SHIFT_NAME; setShift ( selectedShiftId + "" ); dialog.dispose (); } private void jButton2MouseClicked ( java.awt.event.MouseEvent evt ) { // TODO add your handling code here: dialog.dispose (); } public int getSelectedShiftId () { return selectedShiftId; } public String getSelectedShiftStr () { return selectedShiftStr; } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JList<String> jList1; private javax.swing.JScrollPane jScrollPane2; // End of variables declaration } class ShowTimeLossForm extends JDialog { private TimeLossList timeLoss; public ShowTimeLossForm ( Frame parent ) { super ( parent , "Login" , true ); setUndecorated ( true ); getRootPane ().setWindowDecorationStyle ( JRootPane.NONE ); timeLoss = new TimeLossList (); timeLoss.setBounds ( 0 , 0 , 400 , 380 ); setBackground ( Color.yellow ); getContentPane ().add ( timeLoss , BorderLayout.CENTER ); pack (); setResizable ( false ); setBounds ( 0 , 0 , 400 , 380 ); setLocationRelativeTo ( parent ); // this.getRootPane().setDefaultButton(btnLogin); } public ArrayList<TimeLossModel> getTImeLossList () { return timeLoss.getTimeLossList (); } public void closeBOMWindow () { dispose (); } } class TimeLossList extends javax.swing.JPanel { ResultSet result = null; public ArrayList<TimeLossDetailPanel> timeLossList = null; private ArrayList<TimeLossModel> timeLossDetailList = new ArrayList<TimeLossModel> (); /** * Creates new form ProdDataConformationScreen */ public TimeLossList () { initComponents (); TimeLossReasonList panel = new TimeLossReasonList (); panel.setBounds ( 100 , 50 , 260 , 260 ); panel.setBackground ( Color.white ); add ( panel ); } public DefaultTableModel buildTableModel ( ResultSet rs ) throws SQLException { ResultSetMetaData metaData = rs.getMetaData (); // names of columns Vector<String> columnNames = new Vector<String> (); int columnCount = metaData.getColumnCount (); for ( int column = 1 ; column <= columnCount ; column ++ ) { columnNames.add ( metaData.getColumnName ( column ) ); } // data of the table Vector<Vector<Object>> data = new Vector<Vector<Object>> (); while ( rs.next () ) { Vector<Object> vector = new Vector<Object> (); for ( int columnIndex = 1 ; columnIndex <= columnCount ; columnIndex ++ ) { vector.add ( rs.getObject ( columnIndex ) ); } data.add ( vector ); } return new DefaultTableModel ( data , columnNames ); } /** * This method is called from within the constructor to initialize the * form. WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings( "unchecked" ) // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents () { jButton1 = new javax.swing.JButton (); jButton2 = new javax.swing.JButton (); jLabel1 = new javax.swing.JLabel (); setBackground ( new java.awt.Color ( 255 , 255 , 255 ) ); setBorder ( javax.swing.BorderFactory.createTitledBorder ( "" ) ); setMinimumSize ( new java.awt.Dimension ( 1150 , 500 ) ); setPreferredSize ( new java.awt.Dimension ( 1100 , 500 ) ); setLayout ( null ); jButton1.setText ( "Submit" ); jButton1.setOpaque ( false ); jButton1.addMouseListener ( new java.awt.event.MouseAdapter () { public void mouseClicked ( java.awt.event.MouseEvent evt ) { jButton1MouseClicked ( evt ); } } ); add ( jButton1 ); jButton1.setBounds ( 100 , 332 , 100 , 40 ); jButton2.setText ( "Cancel" ); jButton2.setOpaque ( false ); jButton2.addMouseListener ( new java.awt.event.MouseAdapter () { public void mouseClicked ( java.awt.event.MouseEvent evt ) { jButton2MouseClicked ( evt ); } } ); add ( jButton2 ); jButton2.setBounds ( 200 , 332 , 100 , 40 ); jLabel1.setHorizontalAlignment ( javax.swing.SwingConstants.CENTER ); jLabel1.setText ( "Add time in minutes for applicable timeloss reasons" ); add ( jLabel1 ); jLabel1.setBounds ( 0 , 0 , 410 , 30 ); }// </editor-fold> private void jButton1MouseClicked ( java.awt.event.MouseEvent evt ) { // TODO add your handling code here: TimeLossModel tlm = null; int totalTimeLoss = 0; for ( int i = 0 ; i < timeLossList.size () ; i ++ ) { tlm = new TimeLossModel (); if ( timeLossList.get ( i ).getMinutes () > 0 ) { tlm.setId ( timeLossList.get ( i ).getTRLid () ); tlm.setReason ( timeLossList.get ( i ).getReasonStr () ); tlm.setTimelossForReason ( timeLossList.get ( i ).getMinutes () ); tlm.setMinutes ( timeLossList.get ( i ).getMinutes () ); timeLossDetailList.add ( tlm ); } } TimeLossModel tlm2 = null; StringBuilder sb = new StringBuilder (); for ( int i = 0 ; i < timeLossDetailList.size () ; i ++ ) { tlm2 = timeLossDetailList.get ( i ); sb.append ( tlm2.getId () ); sb.append ( tlm2.getReason () ); sb.append ( tlm2.getMinutes () ); sb.append ( "\n" ); } selectedTimeLoss = timeLossDetailList; dialog2.dispose (); } private void jButton2MouseClicked ( java.awt.event.MouseEvent evt ) { // TODO add your handling code here: dialog2.dispose (); } public ArrayList<TimeLossModel> getTimeLoss () { // TODO add your handling code here: TimeLossModel tlm = null; int totalTimeLoss = 0; for ( int i = 0 ; i < timeLossList.size () ; i ++ ) { tlm = new TimeLossModel (); if ( timeLossList.get ( i ).getMinutes () > 0 ) { tlm.setId ( timeLossList.get ( i ).getTRLid () ); tlm.setReason ( timeLossList.get ( i ).getReasonStr () ); tlm.setTimelossForReason ( timeLossList.get ( i ).getMinutes () ); tlm.setMinutes ( timeLossList.get ( i ).getMinutes () ); timeLossDetailList.add ( tlm ); } } TimeLossModel tlm2 = null; StringBuilder sb = new StringBuilder (); for ( int i = 0 ; i < timeLossDetailList.size () ; i ++ ) { tlm2 = timeLossDetailList.get ( i ); sb.append ( tlm2.getId () ); sb.append ( tlm2.getReason () ); sb.append ( tlm2.getMinutes () ); sb.append ( "\n" ); } selectedTimeLoss = timeLossDetailList; // setTimeLoss ( selectedTimeLoss ); return selectedTimeLoss; } public ArrayList<TimeLossModel> getTimeLossList () { return timeLossDetailList; } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; // End of variables declaration class TimeLossReasonList extends JPanel { private JPanel panel; private JScrollPane scroll; private JButton btnAddType; public TimeLossReasonList () { setLayout ( new BorderLayout () ); panel = new JPanel (); panel.setLayout ( new BoxLayout ( panel , BoxLayout.Y_AXIS ) ); scroll = new JScrollPane ( panel , JScrollPane.VERTICAL_SCROLLBAR_ALWAYS , JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); add ( scroll , BorderLayout.CENTER ); setVisible ( true ); TimeLossDetailPanel pane = null; timeLossList = new ArrayList<TimeLossDetailPanel> (); String addEmpAPICall = "timeloss_reason"; String result2 = WebAPITester.prepareWebCall ( addEmpAPICall , StaticValues.getHeader () , "" ); if ( ! result2.contains ( "not found" ) && result2.contains ( "success" ) ) { HashMap<String , Object> map = new HashMap<String , Object> (); JSONObject jObject = new JSONObject ( result2 ); Iterator<?> keys = jObject.keys (); while ( keys.hasNext () ) { String key = ( String ) keys.next (); Object value = jObject.get ( key ); map.put ( key , value ); } JSONObject st = ( JSONObject ) map.get ( "data" ); JSONArray records = st.getJSONArray ( "records" ); JSONObject emp = null; timeloss_reasons = new ArrayList<TimeLoss_Reasons> (); panel.setBounds ( 0 , 0 , 250 , 36 * records.length () ); for ( int i = 0 ; i < records.length () ; i ++ ) { emp = records.getJSONObject ( i ); timeloss_reasons.add ( new TimeLoss_Reasons ( Integer.parseInt ( emp.get ( "TLR_ID" ).toString () ) , emp.get ( "TLR_DESC" ).toString () ) ); pane = new TimeLossDetailPanel (); pane.setBounds ( 0 , ( i * 40 ) , 250 , 36 ); pane.setTRLid ( Integer.parseInt ( emp.get ( "TLR_ID" ).toString () ) ); pane.setReasonStr ( emp.get ( "TLR_DESC" ).toString () ); pane.setMinutes ( 0 ); panel.add ( pane ); panel.revalidate (); timeLossList.add ( pane ); } } } } } class ShowRejectionsForm extends JDialog { private RejectionsList rejection; public ShowRejectionsForm ( Frame parent ) { super ( parent , "Login" , true ); setUndecorated ( true ); getRootPane ().setWindowDecorationStyle ( JRootPane.NONE ); rejection = new RejectionsList (); rejection.setBounds ( 0 , 0 , 400 , 380 ); setBackground ( Color.yellow ); getContentPane ().add ( rejection , BorderLayout.CENTER ); pack (); setResizable ( false ); setBounds ( 0 , 0 , 400 , 380 ); setLocationRelativeTo ( parent ); // this.getRootPane().setDefaultButton(btnLogin); } // public ArrayList<TimeLossModel> getTImeLossList () { // // return rejection.getRe // } public void closeBOMWindow () { dispose (); } } class RejectionsList extends javax.swing.JPanel { ResultSet result = null; public ArrayList<RejectionDetailPanel> rejectionList = null; private ArrayList<RejectionModel> rejectionDetailList = new ArrayList<RejectionModel> (); public RejectionsList () { initComponents (); RejectionReasonList panel = new RejectionReasonList (); panel.setBounds ( 10 , 50 , 360 , 280 ); panel.setBackground ( Color.white ); add ( panel ); } @SuppressWarnings( "unchecked" ) // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents () { jButton1 = new javax.swing.JButton (); jButton2 = new javax.swing.JButton (); jLabel1 = new javax.swing.JLabel (); setBackground ( new java.awt.Color ( 255 , 255 , 255 ) ); setBorder ( javax.swing.BorderFactory.createTitledBorder ( "" ) ); setMinimumSize ( new java.awt.Dimension ( 1150 , 500 ) ); setPreferredSize ( new java.awt.Dimension ( 1100 , 500 ) ); setLayout ( null ); jButton1.setText ( "Submit" ); jButton1.setOpaque ( false ); jButton1.addMouseListener ( new java.awt.event.MouseAdapter () { public void mouseClicked ( java.awt.event.MouseEvent evt ) { jButton1MouseClicked ( evt ); } } ); add ( jButton1 ); jButton1.setBounds ( 100 , 332 , 100 , 40 ); jButton2.setText ( "Cancel" ); jButton2.setOpaque ( false ); jButton2.addMouseListener ( new java.awt.event.MouseAdapter () { public void mouseClicked ( java.awt.event.MouseEvent evt ) { jButton2MouseClicked ( evt ); } } ); add ( jButton2 ); jButton2.setBounds ( 200 , 332 , 100 , 40 ); jLabel1.setHorizontalAlignment ( javax.swing.SwingConstants.CENTER ); jLabel1.setText ( "" ); add ( jLabel1 ); jLabel1.setBounds ( 0 , 0 , 410 , 30 ); }// </editor-fold> private void jButton1MouseClicked ( java.awt.event.MouseEvent evt ) { // TODO add your handling code here: RejectionModel tlm = null; int totalRejection = 0 ; for ( int i = 0 ; i < rejectionList.size () ; i ++ ) { tlm = new RejectionModel (); if ( rejectionList.get ( i ).getRejectionForReason () > 0 ) { tlm.setRejectionReasonId ( rejectionList.get ( i ).getRejectionReasonId ()); tlm.setRejectionReasonStr ( rejectionList.get ( i ).getRejectionReasonStr () ); tlm.setRejectionForReason ( rejectionList.get ( i ).getRejectionForReason () ); tlm.setTotalRejection ( rejectionList.get ( i ).getTotalRejection () ); totalRejection = totalRejection + rejectionList.get ( i ).getRejectionForReason () ; //lm.setReason ( rejectionList.get ( i ).getReasonStr () ); rejectionDetailList.add ( tlm ); } } if( totalRejection == Integer.parseInt( getRejected () ) ){ RejectionModel tlm2 = null; StringBuilder sb = new StringBuilder (); for ( int i = 0 ; i < rejectionDetailList.size () ; i ++ ) { tlm2 = rejectionDetailList.get ( i ); sb.append ( tlm2.getRejectionForReason ()); sb.append ( tlm2.getRejectionReasonId () ); sb.append ( tlm2.getRejectionReasonStr () ); sb.append ( "\n" ); } selectedrejections = rejectionDetailList; setrejections (rejectionDetailList ); // JOptionPane.showMessageDialog( null, sb.toString () ); dialog3.dispose (); }else{ JOptionPane.showMessageDialog ( null, "Total rejection count cannot be greater than "+getRejected () ); } } private void jButton2MouseClicked ( java.awt.event.MouseEvent evt ) { // TODO add your handling code here: dialog3.dispose (); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; // End of variables declaration class RejectionReasonList extends JPanel { private JPanel panel; private JScrollPane scroll; private JButton btnAddType; // public ArrayList<RMQtyPanel> rmBomList = null ; public RejectionReasonList () { // getContentPane().setLayout(new BorderLayout()); setLayout ( new BorderLayout () ); panel = new JPanel (); panel.setLayout ( new BoxLayout ( panel , BoxLayout.Y_AXIS ) ); scroll = new JScrollPane ( panel , JScrollPane.VERTICAL_SCROLLBAR_ALWAYS , JScrollPane.HORIZONTAL_SCROLLBAR_NEVER ); add ( scroll , BorderLayout.CENTER ); setVisible ( true ); RejectionDetailPanel pane = null; rejectionList = new ArrayList<RejectionDetailPanel> (); String addEmpAPICall = "rejreasons"; String result2 = WebAPITester.prepareWebCall ( addEmpAPICall, StaticValues.getHeader () , ""); HashMap<String, Object> map = new HashMap<String, Object>(); JSONObject jObject = new JSONObject( result2 ); Iterator<?> keys = jObject.keys(); while( keys.hasNext() ){ String key = (String)keys.next(); Object value = jObject.get ( key ) ; map.put(key, value); } JSONObject st = (JSONObject) map.get ( "data" ); JSONArray records = st.getJSONArray ( "records"); JSONObject emp = null; rej_reasons = new ArrayList<Rejection_Reasons> (); panel.setBounds(0,0,250,36*records.length ()); for ( int i = 0 ; i < records.length () ; i ++ ) { emp = records.getJSONObject ( i); rej_reasons.add( new Rejection_Reasons ( Integer.parseInt(emp.get ( "RR_ID" ).toString ()), emp.get ( "RR_DESC" ).toString () )); pane = new RejectionDetailPanel (); pane.setBounds(0,(i*40),250,36); pane.setRejectionReasonId ( Integer.parseInt(emp.get ( "RR_ID" ).toString ())); pane.setRejectionReasonStr ( emp.get ( "RR_DESC" ).toString () ); pane.setRejectionForReason ( 0); pane.setTotalRejection ( 0 ); panel.add ( pane ); panel.revalidate (); rejectionList.add ( pane ); } } } } }
[ "ladganesh7@gmail.com" ]
ladganesh7@gmail.com
f1d292b08f6251299417ad43e95a37f2ff402871
eadacc83f63cb3217aa59c5eb19c24871d89e6cd
/src/com/common/ExtentReportSetup.java
ff24a316a30e98583d2fce41cd8a3df643ab4480
[]
no_license
yogeshag192/CILAutomationFramework
75379507c0d731e89b3095d141263e04404b12a6
dbe5d9416226723ca82321b3743dee4486c03522
refs/heads/master
2021-05-11T17:13:27.666869
2018-12-31T11:28:19
2018-12-31T11:28:19
117,792,830
1
0
null
null
null
null
UTF-8
Java
false
false
1,328
java
package com.common; import java.io.File; import java.lang.reflect.Method; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeSuite; import org.testng.annotations.BeforeTest; import com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.ExtentTest; public class ExtentReportSetup { public static ExtentReports extent; public static ExtentTest test; @BeforeSuite public void beforeSuiteSetup(){ System.out.println("In BeforeSuiteSetup Method.."); extent = new ExtentReports(System.getProperty("user.dir")+ "/extent-output/ExtentExecutionReport.html",true); extent.addSystemInfo("HostName", "Yogesh") .addSystemInfo("Environment", "QA") .addSystemInfo("User Name", " Yogesh Agrawal"); extent.loadConfig(new File(System.getProperty("user.dir")+ "/extent-config.xml")); } @BeforeMethod public void beforeMethodSetup(Method method){ System.out.println("In BeforeMethodSetup Method.."); test = extent.startTest((this.getClass().getSimpleName() + " :: " +method.getName()), method.getName()); test.assignAuthor("Yogesh Author").assignCategory("Smoke Tests"); } @AfterSuite public void endReport(){ extent.flush(); //extent.close(); } }
[ "agrawaly@hcl.com" ]
agrawaly@hcl.com
250906922b2f5ff5c3bce9978ced2ee84491ae4d
d4c090656ad6f32bea4763968a48bb8478f597a7
/DyeingOnline/src/main/java/com/mongo/yrzx/service/query/CompanyService.java
704adafdac56706831ec65c772a6feb53fd3eb05
[]
no_license
huaqainxi/DyeOnlineCMS
1a49c49869621b0bd1735203510c4c2dd280f6ef
83a5421ead488b5aa3fe899843b8a7cb5b47eec0
refs/heads/master
2022-12-14T16:08:41.501358
2020-09-13T12:25:25
2020-09-13T12:25:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
198
java
package com.mongo.yrzx.service.query; /** * ็ปŸ่ฎกๆŸฅ่ฏข๏ผšๅ…จๅŽ‚ๆ—ฅๆŠฅไธšๅŠก่ง„่Œƒๅฑ‚ * * @author hzw * @project DyeingOnline * @date 2019-08-07 * */ public interface CompanyService { }
[ "1290499013@qq.com" ]
1290499013@qq.com
42baf27ac32aa03304dd061d96fc12c376d5d386
9f8304a649e04670403f5dc1cb049f81266ba685
/common/src/main/java/com/cmcc/vrp/province/service/impl/CrowdFundingServiceImpl.java
997ff614a0db10235ce0403b629a8a464cc72ed9
[]
no_license
hasone/pdata
632d2d0df9ddd9e8c79aca61a87f52fc4aa35840
0a9cfd988e8a414f3bdbf82ae96b82b61d8cccc2
refs/heads/master
2020-03-25T04:28:17.354582
2018-04-09T00:13:55
2018-04-09T00:13:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
28,215
java
package com.cmcc.vrp.province.service.impl; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.cmcc.vrp.charge.ChargeResult; import com.cmcc.vrp.enums.ActivityStatus; import com.cmcc.vrp.enums.ActivityType; import com.cmcc.vrp.enums.ActivityWinRecordStatus; import com.cmcc.vrp.enums.ChargeRecordStatus; import com.cmcc.vrp.enums.GDCrowdFundingResult; import com.cmcc.vrp.province.model.Activities; import com.cmcc.vrp.province.model.ActivityPaymentInfo; import com.cmcc.vrp.province.model.ActivityPrize; import com.cmcc.vrp.province.model.ActivityWinRecord; import com.cmcc.vrp.province.model.ChargeRecord; import com.cmcc.vrp.province.model.CrowdfundingActivityDetail; import com.cmcc.vrp.province.model.CrowdfundingQueryUrl; import com.cmcc.vrp.province.model.SerialNum; import com.cmcc.vrp.province.service.ActivitiesService; import com.cmcc.vrp.province.service.ActivityBlackAndWhiteService; import com.cmcc.vrp.province.service.ActivityPaymentInfoService; import com.cmcc.vrp.province.service.ActivityPrizeService; import com.cmcc.vrp.province.service.ActivityWinRecordService; import com.cmcc.vrp.province.service.ChargeRecordService; import com.cmcc.vrp.province.service.CrowdFundingService; import com.cmcc.vrp.province.service.CrowdfundingActivityDetailService; import com.cmcc.vrp.province.service.CrowdfundingQueryUrlService; import com.cmcc.vrp.province.service.EnterprisesService; import com.cmcc.vrp.province.service.SerialNumService; import com.cmcc.vrp.queue.TaskProducer; import com.cmcc.vrp.queue.pojo.ActivitiesWinPojo; import com.cmcc.vrp.util.StringUtils; import com.cmcc.vrp.wx.PayResultQueryService; import com.google.gson.Gson; /** * Created by qinqinyan on 2017/1/21. */ @Service("crowdFundingService") public class CrowdFundingServiceImpl implements CrowdFundingService { private static final Logger logger = LoggerFactory.getLogger(CrowdFundingServiceImpl.class); @Autowired ActivitiesService activitiesService; @Autowired EnterprisesService enterprisesService; @Autowired CrowdfundingActivityDetailService crowdfundingActivityDetailService; @Autowired ActivityPrizeService activityPrizeService; @Autowired ActivityBlackAndWhiteService activityBlackAndWhiteService; @Autowired ActivityWinRecordService activityWinRecordService; @Autowired SerialNumService serialNumService; @Autowired ChargeRecordService chargeRecordService; @Autowired TaskProducer taskProducer; @Autowired CrowdfundingQueryUrlService crowdfundingQueryUrlService; @Autowired ActivityPaymentInfoService activityPaymentInfoService; @Autowired PayResultQueryService payResultQueryService; /** * ไผ—็ญนๆดปๅŠจๆ’ๅ…ฅ * * @author qinqinyan */ @Override @Transactional public boolean insertActivity(Activities activities, CrowdfundingActivityDetail crowdfundingActivityDetail, List<ActivityPrize> activityPrizes, String phones, String queryurl) throws RuntimeException { if (activities == null || crowdfundingActivityDetail == null || activityPrizes == null || activityPrizes.size() < 1) { logger.info("ๆ’ๅ…ฅๅ‚ๆ•ฐไธบ็ฉบ"); return false; } if (!activitiesService.insert(initActivities(activities))) { logger.info("ๆ’ๅ…ฅๆดปๅŠจๅŸบๆœฌไฟกๆฏๅคฑ่ดฅ"); return false; } crowdfundingActivityDetail.setActivityId(activities.getActivityId()); if (!crowdfundingActivityDetailService.insert(initCrowdfundingActivityDetail(crowdfundingActivityDetail))) { logger.info("ๆ’ๅ…ฅๆดปๅŠจ่ฏฆ็ป†ไฟกๆฏๅคฑ่ดฅ"); throw new RuntimeException(); } if (!activityPrizeService .batchInsertForCrowdFunding(initActivityPrizes(activityPrizes, activities.getActivityId()))) { logger.info("ๆ’ๅ…ฅๆดปๅŠจๅฅ–ๅ“ไฟกๆฏๅคฑ่ดฅ"); throw new RuntimeException(); } if (crowdfundingActivityDetail.getUserList() == 1 && !StringUtils.isEmpty(phones)) { if (!activityBlackAndWhiteService.batchInsert(activities.getActivityId(), crowdfundingActivityDetail.getHasWhiteOrBlack(), phones)) { logger.info("ๆ’ๅ…ฅๆดปๅŠจ้ป‘็™ฝๅๅ•ๅคฑ่ดฅ"); throw new RuntimeException(); } } if (crowdfundingActivityDetail.getUserList() == 3) { CrowdfundingQueryUrl crowdfundingQueryUrl = new CrowdfundingQueryUrl(); crowdfundingQueryUrl.setCrowdfundingActivityDetailId(crowdfundingActivityDetail.getId()); crowdfundingQueryUrl.setDeleteFlag(0); crowdfundingQueryUrl.setQueryUrl(queryurl); if (!crowdfundingQueryUrlService.insert(crowdfundingQueryUrl)) { logger.info("ๆ’ๅ…ฅไผไธšๆŸฅ่ฏขๆŽฅๅฃๅคฑ่ดฅ"); throw new RuntimeException(); } } return true; } /** * ๅˆๅง‹ๅŒ–ๆดปๅŠจไฟกๆฏ */ private Activities initActivities(Activities record) { record.setStatus(ActivityStatus.SAVED.getCode()); record.setCreateTime(new Date()); record.setUpdateTime(new Date()); record.setDeleteFlag(0); return record; } /** * ๅˆๅง‹ๅŒ–ๆดปๅŠจไฟกๆฏ */ private CrowdfundingActivityDetail initCrowdfundingActivityDetail(CrowdfundingActivityDetail record) { record.setCurrentCount(0L); record.setResult(GDCrowdFundingResult.Crowd_Funding.getCode()); record.setDeleteFlag(0); record.setVersion(0L); return record; } /** * ๅˆๅง‹ๅŒ–ๅฅ–ๅ“ไฟกๆฏ */ private List<ActivityPrize> initActivityPrizes(List<ActivityPrize> records, String activityId) { for (ActivityPrize item : records) { item.setActivityId(activityId); item.setCreateTime(new Date()); item.setUpdateTime(new Date()); item.setDeleteFlag(0); } return records; } @Override @Transactional public boolean updateActivity(Activities activities, CrowdfundingActivityDetail crowdfundingActivityDetail, List<ActivityPrize> activityPrizes, String phones, String queryurl) { // TODO Auto-generated method stub // 1ใ€ๆ›ดๆ–ฐๅฅ–ๅ“ไฟกๆฏ Activities historyActivity = activitiesService.selectByActivityId(activities.getActivityId()); List<ActivityPrize> historyPrizes = activityPrizeService.selectByActivityId(activities.getActivityId()); /*CrowdfundingActivityDetail historyDetail = crowdfundingActivityDetailService .selectByActivityId(activities.getActivityId());*/ if (historyActivity.getEntId().longValue() == activities.getEntId().longValue()) { // ๅฆ‚ๆžœไผไธšไธๅ˜๏ผŒๆ›ดๆ–ฐๅฅ–ๅ“ไฟกๆฏ List<ActivityPrize> addList = getAddActivityPrizes(activityPrizes, historyPrizes); List<Long> delList = getDelelteActivityPrizes(activityPrizes, historyPrizes); List<ActivityPrize> updateList = getUpdateActivityPrizes(activityPrizes, historyPrizes); // 1.1 ๅขžๅŠ ๆ–ฐๅฅ–ๅ“ if (addList != null && addList.size() > 0) { if (!activityPrizeService .batchInsertForCrowdFunding(initActivityPrizes(addList, historyActivity.getActivityId()))) { logger.info("ๆ’ๅ…ฅๆ–ฐๅฅ–ๅ“ๅคฑ่ดฅใ€‚"); return false; } } // 1.2 ๅˆ ้™คๅฅ–ๅ“ if (delList != null && delList.size() > 0) { if (!activityPrizeService.deleteActivityPrize(delList, activities.getActivityId())) { logger.info("ๅˆ ้™คๅฅ–ๅ“ๅคฑ่ดฅใ€‚"); throw new RuntimeException(); } } // 1.3 ๆ›ดๆ–ฐๅฅ–ๅ“ if (updateList != null && updateList.size() > 0) { if (!activityPrizeService.batchUpdateDiscount(updateList)) { logger.info("ๆ›ดๆ–ฐๅฅ–ๅ“ๆŠ˜ๆ‰ฃๅคฑ่ดฅใ€‚"); throw new RuntimeException(); } } } else { // ไผไธšไฟกๆฏๆ”นๅ˜๏ผŒๅˆ™ๅˆ ้™คๅŽŸๆœ‰ๅฅ–ๅ“ไฟกๆฏ๏ผŒ้‡ๆ–ฐๆ’ๅ…ฅๆ–ฐๅฅ–ๅ“ไฟกๆฏ if (!activityPrizeService.deleteByActivityId(activities.getActivityId()) || !activityPrizeService .batchInsert(initActivityPrizes(activityPrizes, activities.getActivityId()))) { logger.info("ๆ’ๅ…ฅๆดปๅŠจๅฅ–ๅ“ไฟกๆฏๅคฑ่ดฅใ€‚"); throw new RuntimeException(); } } // 2ใ€ๆ›ดๆ–ฐๆดปๅŠจๅŸบๆœฌไฟกๆฏ if (!activitiesService.updateByPrimaryKeySelective(activities)) { logger.info("ๆ›ดๆ–ฐๆดปๅŠจๅŸบๆœฌไฟกๆฏๅคฑ่ดฅใ€‚"); throw new RuntimeException(); } // 3ใ€ๆ›ดๆ–ฐๆดปๅŠจ่ฏฆๆƒ… if (!crowdfundingActivityDetailService.updateByPrimaryKeySelective(crowdfundingActivityDetail)) { logger.info("ๆ›ดๆ–ฐๆดปๅŠจ่ฏฆๆƒ…ๅคฑ่ดฅใ€‚"); throw new RuntimeException(); } //4.ๅชๆœ‰็”จๆˆทๅˆ—่กจ๏ผˆ้ƒฝๆ˜ฏ็™ฝๅๅ•๏ผ‰ if (crowdfundingActivityDetail.getUserList() == 1 && !StringUtils.isEmpty(phones)) { //ๅˆ ้™คๅŽŸๆœ‰ๅๅ• if (!activityBlackAndWhiteService.deleteByActivityId(activities.getActivityId())) { logger.info("ๅˆ ้™ค็”จๆˆทๅๅ•ๅคฑ่ดฅใ€‚"); throw new RuntimeException(); } //ๆ’ๅ…ฅ็Žฐๆœ‰ๅๅ• if (!activityBlackAndWhiteService.batchInsert(activities.getActivityId(), crowdfundingActivityDetail.getHasWhiteOrBlack(), phones)) { logger.info("ๆ’ๅ…ฅ็”จๆˆทๅๅ•ๅคฑ่ดฅ"); throw new RuntimeException(); } } //5.ๆ›ดๆ–ฐไผไธšๆŸฅ่ฏขๆŽฅๅฃ่ฎฐๅฝ• if (crowdfundingActivityDetail.getUserList() == 3 && !StringUtils.isEmpty(queryurl)) { CrowdfundingActivityDetail newCrowdfundingActivityDetail = crowdfundingActivityDetailService.selectByActivityId(activities.getActivityId()); if (crowdfundingQueryUrlService.getByCrowdfundingActivityDetailId(newCrowdfundingActivityDetail.getId()) == null) { CrowdfundingQueryUrl crowdfundingQueryUrl = new CrowdfundingQueryUrl(); crowdfundingQueryUrl.setCrowdfundingActivityDetailId(newCrowdfundingActivityDetail.getId()); crowdfundingQueryUrl.setDeleteFlag(0); crowdfundingQueryUrl.setQueryUrl(queryurl); if (!crowdfundingQueryUrlService.insert(crowdfundingQueryUrl)) { logger.info("ๆ’ๅ…ฅไผไธšๆŸฅ่ฏขๆŽฅๅฃๅคฑ่ดฅ"); throw new RuntimeException(); } } else { CrowdfundingQueryUrl crowdfundingQueryUrl = new CrowdfundingQueryUrl(); crowdfundingQueryUrl.setCrowdfundingActivityDetailId(newCrowdfundingActivityDetail.getId()); crowdfundingQueryUrl.setQueryUrl(queryurl); if (!crowdfundingQueryUrlService.updateByCrowdfundingActivityDetailId(crowdfundingQueryUrl)) { logger.info("ๆ›ดๆ–ฐไผไธšๆŸฅ่ฏขๆŽฅๅฃๅคฑ่ดฅ"); throw new RuntimeException(); } } } // 4ใ€ๆ›ดๆ–ฐๆดปๅŠจ้ป‘็™ฝๅๅ• // 4.1ๅ…ˆๅˆ ้™ค /*if ((!historyDetail.getHasWhiteOrBlack().toString().equals(BlackAndWhiteListType.NOLIST.getCode().toString()) && !crowdfundingActivityDetail.getHasWhiteOrBlack().toString() .equals(BlackAndWhiteListType.NOLIST.getCode().toString()) && !StringUtils.isEmpty(phones)) || !historyDetail.getHasWhiteOrBlack().toString() .equals(BlackAndWhiteListType.NOLIST.getCode().toString()) && crowdfundingActivityDetail.getHasWhiteOrBlack().toString() .equals(BlackAndWhiteListType.NOLIST.getCode().toString())) { // (1)ๅŽŸ่ฎพ็ฝฎ้ป‘็™ฝๅๅ•๏ผŒ็Žฐๅœจ่ฎพ็ฝฎไบ†๏ผŒๅนถไธ”ไธŠไผ ็š„ๆ‰‹ๆœบๅทไธไธบ็ฉบ๏ผŒๅ…ˆๅˆ ้™คๅŽŸๆœ‰; // (2)ๅŽŸๆœ‰่ฎพ็ฝฎไบ†้ป‘็™ฝๅๅ•๏ผŒ็Žฐๅœจ่ฎพ็ฝฎไธบไธ้œ€่ฆ้ป‘็™ฝๅๅ•๏ผŒๅˆ™็›ดๆŽฅๅˆ ้™คๆ‰€ๆœ‰ๅๅ• if (!activityBlackAndWhiteService.deleteByActivityId(activities.getActivityId())) { logger.info("ๅˆ ้™ค้ป‘็™ฝๅๅ•ๅคฑ่ดฅใ€‚"); throw new RuntimeException(); } } // 4.2ๅ†ๆ’ๅ…ฅ if (historyDetail.getHasWhiteOrBlack().toString().equals(BlackAndWhiteListType.NOLIST.getCode().toString()) && !crowdfundingActivityDetail.getHasWhiteOrBlack().toString() .equals(BlackAndWhiteListType.NOLIST.getCode().toString()) || !historyDetail.getHasWhiteOrBlack().toString() .equals(BlackAndWhiteListType.NOLIST.getCode().toString()) && !crowdfundingActivityDetail.getHasWhiteOrBlack().toString() .equals(BlackAndWhiteListType.NOLIST.getCode().toString())) { // (1)ๅŽŸๆœช่ฎพ็ฝฎ้ป‘็™ฝๅๅ•๏ผŒ็Žฐๅœจ่ฎพ็ฝฎไบ†๏ผŒ็›ดๆŽฅๆ’ๅ…ฅ้ป‘็™ฝๅๅ•๏ผ› // (2)ๅŽŸ่ฎพ็ฝฎ้ป‘็™ฝๅๅ•๏ผŒ็Žฐๅœจ่ฎพ็ฝฎไบ†๏ผŒๅ†ๆ’ๅ…ฅ; if (!StringUtils.isEmpty(phones)) { if (!activityBlackAndWhiteService.batchInsert(activities.getActivityId(), crowdfundingActivityDetail.getHasWhiteOrBlack(), phones)) { logger.info("ๆ’ๅ…ฅๆดปๅŠจ้ป‘็™ฝๅๅ•ๅคฑ่ดฅ"); throw new RuntimeException(); } } }*/ return true; } /** * ่Žทๅ–่ฆๅˆ ้™ค็š„ๅฅ–ๅ“ไฟกๆฏ * * @author qinqinyan */ private List<Long> getDelelteActivityPrizes(List<ActivityPrize> prizes, List<ActivityPrize> historyPrizes) { // List<ActivityPrize> delPrizes = new ArrayList<ActivityPrize>(); List<Long> delProdIds = new ArrayList<Long>(); for (ActivityPrize historyItem : historyPrizes) { int i = 0; for (ActivityPrize prize : prizes) { if (prize.getProductId().toString().equals(historyItem.getProductId().toString())) { break; } i++; } if (i == prizes.size()) { // delPrizes.add(historyItem); delProdIds.add(historyItem.getProductId()); } } // return delPrizes; return delProdIds; } /** * ่Žทๅ–่ฆๅขžๅŠ ็š„ๅฅ–ๅ“ไฟกๆฏ * * @author qinqinyan */ private List<ActivityPrize> getAddActivityPrizes(List<ActivityPrize> prizes, List<ActivityPrize> historyPrizes) { List<ActivityPrize> addPrizes = new ArrayList<ActivityPrize>(); for (ActivityPrize prize : prizes) { int i = 0; for (ActivityPrize historyItem : historyPrizes) { if (prize.getProductId().toString().equals(historyItem.getProductId().toString())) { break; } i++; } if (i == historyPrizes.size()) { addPrizes.add(prize); } } return addPrizes; } /** * ่Žทๅ–่ฆๆ›ดๆ–ฐ็š„ๅฅ–ๅ“ไฟกๆฏ * * @author qinqinyan */ private List<ActivityPrize> getUpdateActivityPrizes(List<ActivityPrize> prizes, List<ActivityPrize> historyPrizes) { List<ActivityPrize> updatePrizes = new ArrayList<ActivityPrize>(); for (ActivityPrize prize : prizes) { for (ActivityPrize historyItem : historyPrizes) { if (prize.getProductId().toString().equals(historyItem.getProductId().toString()) && !prize.getDiscount().toString().equals(historyItem.getDiscount().toString())) { ActivityPrize updateItem = historyItem; updateItem.setIdPrefix(prize.getIdPrefix()); updateItem.setDiscount(prize.getDiscount()); updatePrizes.add(updateItem); break; } } } return updatePrizes; } @Override public boolean offShelf(String activityId) { // TODO Auto-generated method stub if (!StringUtils.isEmpty(activityId)) { if (activitiesService.changeStatus(activityId, ActivityStatus.DOWN.getCode())) { return true; } } return false; } @Override public boolean onShelf(String activityId) { // TODO Auto-generated method stub if (!StringUtils.isEmpty(activityId)) { if (activitiesService.changeStatus(activityId, ActivityStatus.ON.getCode())) { return true; } } return false; } @Override public boolean charge(String activityWinRecordId) { // TODO Auto-generated method stub ActivityWinRecord activityWinRecord = activityWinRecordService.selectByRecordId(activityWinRecordId); activityWinRecord.setStatus(ActivityWinRecordStatus.PROCESSING.getCode()); //ๆต้‡ไผ—็ญน้‡Œ๏ผŒๅฐ†createTimeๅฝ“ๆˆ้ข†ๅ–ๆต้‡ๆ—ถ้—ด๏ผŒๆ‰€ไปฅๅœจๆญคๆ›ดๆ–ฐ(ๅคงไผไธš็‰ˆไธบๆต้‡้ข†ๅ–ๆ—ถ้—ด๏ผŒไธญๅฐไผไธš็‰ˆไธบๅ‘่ตทๅ……ๅ€ผๆต็จ‹ๆ—ถ้—ด) activityWinRecord.setCreateTime(new Date()); //activityWinRecord.setWinTime(new Date()); //activityWinRecord.setChargeTime(new Date()); if (!activityWinRecordService.updateByPrimaryKey(activityWinRecord)) { logger.error("ๆ›ดๆ–ฐๆดปๅŠจ่ฎฐๅฝ•็Šถๆ€ๆ—ถๅ‡บ้”™. ActivityWinRecordId = {}.", activityWinRecordId); return false; } //ๆ’ๅ…ฅๆตๆฐดๅท่ฎฐๅฝ• if (!serialNumService.insert(buildSerailNum(activityWinRecordId))) { logger.error("ๆ’ๅ…ฅๅนณๅฐๆตๆฐดๅท่ฎฐๅฝ•ๅ‡บ้”™. pltSerailNum = {}.", activityWinRecordId); return false; } //ๆ’ๅ…ฅๅ……ๅ€ผ้˜Ÿๅˆ—ๅคฑ่ดฅ if (!insertRabbitmq(activityWinRecordId)) { logger.error("ๆ’ๅ…ฅๅ……ๅ€ผ้˜Ÿๅˆ—ๅ‡บ้”™. pltSerailNum = {}.", activityWinRecordId); return false; } return true; /*ChargeRecord cr = buildChargeRecord(activityWinRecord, activities); if (!chargeRecordService.create(cr)) { logger.error("ๆ’ๅ…ฅๅ……ๅ€ผ่ฎฐๅฝ•ๅ‡บ้”™. pltSerailNum = {}.", activityWinRecordId); return false; } if (!taskProducer.produceActivityWinMsg(buildPojo(activities, activityWinRecordId))) { logger.error("็”ŸไบงๆถˆๆฏๅˆฐๆดปๅŠจ้˜Ÿๅˆ—ไธญๆ—ถๅ‡บ้”™. Activites = {}, RecordId = {}.", new Gson().toJson(activities), activityWinRecordId); return false; } else { logger.info("ๅ…ฅไธšๅŠก้˜Ÿๅˆ—ๆˆๅŠŸ."); if (!activityWinRecordService.updateStatusCodeByRecordId(activityWinRecordId, ChargeResult.ChargeMsgCode.businessQueue.getCode())) { logger.error("ๅ…ฅไธšๅŠก้˜Ÿๅˆ—ๆˆๅŠŸ, ๆ›ดๆ–ฐๆดปๅŠจ่ฎฐๅฝ•็Šถๆ€็ ๅคฑ่ดฅ"); } if (!chargeRecordService.updateStatusCode(cr.getId(), ChargeResult.ChargeMsgCode.businessQueue.getCode())) { logger.error("ๅ…ฅไธšๅŠก้˜Ÿๅˆ—ๆˆๅŠŸ, ๆ›ดๆ–ฐๅ……ๅ€ผ่ฎฐๅฝ•็Šถๆ€็ ๅคฑ่ดฅ"); } logger.info("ๅ…ฅไธšๅŠก้˜Ÿๅˆ—ๆˆๅŠŸ, recordId = {}, ็Šถๆ€็  = {}", activityWinRecordId, ChargeResult.ChargeMsgCode.businessQueue.getCode()); return true; }*/ } @Override @Transactional public boolean insertRabbitmq(String recordId) { ActivityWinRecord activityWinRecord = activityWinRecordService.selectByRecordId(recordId); Activities activities = activitiesService.selectByActivityId(activityWinRecord.getActivityId()); ChargeRecord cr = buildChargeRecord(activityWinRecord, activities); if (!chargeRecordService.create(cr)) { logger.error("ๆ’ๅ…ฅๅ……ๅ€ผ่ฎฐๅฝ•ๅ‡บ้”™. recordId = {}.", recordId); return false; } if (!taskProducer.produceActivityWinMsg(buildPojo(activities, recordId))) { logger.error("็”ŸไบงๆถˆๆฏๅˆฐๆดปๅŠจ้˜Ÿๅˆ—ไธญๆ—ถๅ‡บ้”™. Activites = {}, RecordId = {}.", new Gson().toJson(activities), recordId); throw new RuntimeException(); } else { logger.info("ๅ…ฅไธšๅŠก้˜Ÿๅˆ—ๆˆๅŠŸ."); if (!activityWinRecordService.updateStatusCodeByRecordId(recordId, ChargeResult.ChargeMsgCode.businessQueue.getCode())) { logger.error("ๅ…ฅไธšๅŠก้˜Ÿๅˆ—ๆˆๅŠŸ, ๆ›ดๆ–ฐๆดปๅŠจ่ฎฐๅฝ•็Šถๆ€็ ๅคฑ่ดฅ"); } if (!chargeRecordService.updateStatusCode(cr.getId(), ChargeResult.ChargeMsgCode.businessQueue.getCode())) { logger.error("ๅ…ฅไธšๅŠก้˜Ÿๅˆ—ๆˆๅŠŸ, ๆ›ดๆ–ฐๅ……ๅ€ผ่ฎฐๅฝ•็Šถๆ€็ ๅคฑ่ดฅ"); } logger.info("ๅ…ฅไธšๅŠก้˜Ÿๅˆ—ๆˆๅŠŸ, recordId = {}, ็Šถๆ€็  = {}", recordId, ChargeResult.ChargeMsgCode.businessQueue.getCode()); return true; } } private ChargeRecord buildChargeRecord(ActivityWinRecord activityWinRecord, Activities activities) { ActivityType activityType = ActivityType.fromValue(activities.getType()); ChargeRecord cr = new ChargeRecord(); if(activities.getType().toString() .equals(ActivityType.CROWD_FUNDING.getCode().toString())){ //ไผ—็ญนๆดปๅŠจ๏ผŒไธญๅฅ–็บชๅฝ•้‡Œ็š„prizeIdๆ˜ฏๅฅ–ๅ“็š„id๏ผŒๅ…ถไฝ™ๆดปๅŠจไธญๅฅ–็บชๅฝ•็š„prizeIdๆ˜ฏไบงๅ“id ActivityPrize prize = activityPrizeService.selectByPrimaryKey(activityWinRecord.getPrizeId()); cr.setPrdId(prize.getProductId()); }else{ cr.setPrdId(activityWinRecord.getPrizeId()); } cr.setEnterId(activities.getEntId()); cr.setTypeCode(activities.getType()); cr.setRecordId(activityWinRecord.getId()); cr.setStatus(ChargeRecordStatus.WAIT.getCode()); cr.setType(activityType.getname()); cr.setPhone(activityWinRecord.getOwnMobile()); cr.setaName(activities.getName()); //ไธญๅฅ–uuidๅณไธบๅ……ๅ€ผuuid cr.setSystemNum(activityWinRecord.getRecordId()); cr.setChargeTime(new Date()); return cr; } private ActivitiesWinPojo buildPojo(Activities activities, String activityWinRecordId) { ActivitiesWinPojo pojo = new ActivitiesWinPojo(); pojo.setActivities(activities); pojo.setActivitiesWinRecordId(activityWinRecordId); return pojo; } private SerialNum buildSerailNum(String platformSerialNum) { SerialNum serialNum = new SerialNum(); serialNum.setPlatformSerialNum(platformSerialNum); serialNum.setUpdateTime(new Date()); serialNum.setCreateTime(new Date()); serialNum.setDeleteFlag(0); return serialNum; } /** * ๆŸฅ่ฏขๆŸไธช็”จๆˆท็š„ๆ‰€ๆœ‰ๆดปๅŠจ็š„ๆ”ฏไป˜ๆƒ…ๅ†ต๏ผŒๅฆ‚ๆžœๅญ˜ๅœจๆ”ฏไป˜ไธญ็š„่ฎขๅ•๏ผŒ่ฟ”ๅ›žๆดปๅŠจๅ‚ๅŠ ่ฎฐๅฝ•๏ผŒๆฒกๆœ‰ๆ”ฏไป˜ไธญ็š„่ฎขๅ•๏ผŒ่ฟ”ๅ›žnull * @Title: queryPayResult * @param mobile * @return * @Author: wujiamin * @date 2017ๅนด6ๆœˆ7ๆ—ฅ */ @Override public String queryPayResult(String mobile) { Map queryMap = new HashMap(); queryMap.put("activityType", ActivityType.CROWD_FUNDING.getCode()); queryMap.put("mobile", mobile); queryMap.put("joinType", 2); queryMap.put("payResult", 1);//ๆ”ฏไป˜็Šถๆ€ไธบๆ”ฏไป˜ไธญ List<ActivityWinRecord> winRecords = activityWinRecordService.getWinRecordsForCrowdFundingByMap(queryMap); if(winRecords.size()>0){ ActivityWinRecord record = winRecords.get(0); List<ActivityPaymentInfo> payInfos = activityPaymentInfoService.selectByWinRecordId(record.getRecordId()); boolean payTag = false;//ๆ ‡่ฎฐๆ˜ฏๅฆๅญ˜ๅœจๆœชๆ”ฏไป˜ๅฎŒๆˆ็š„ๆ”ฏไป˜่ฎฐๅฝ• for(ActivityPaymentInfo payInfo : payInfos){ if(payInfo.getStatus().equals(1)||payInfo.getStatus().equals(7) ||payInfo.getStatus().equals(8)||payInfo.getStatus().equals(9)){ //ๅฆ‚ๆžœๆœ‰ไบคๆ˜“่ฎขๅ•ๆœชๆ”ถๅˆฐๅ›ž่ฐƒใ€ๆ”ถๅˆฐๅ›ž่ฐƒไธบ็ญ‰ๅพ…ไป˜ๆฌพใ€ๅทฒๅ–ๆถˆใ€่ถ…ๆ—ถๅˆ™็ณป็ปŸ่ฐƒ็”จ่Žทๅ–ไบคๆ˜“ๅ•ไฟกๆฏๆŽฅๅฃๆŸฅ่ฏขไบคๆ˜“่ฎขๅ• //ๅผ€ๅง‹ๆŸฅ่ฏข่ฎขๅ•็ป“ๆžœ //ๆŸฅ่ฏข็ป“ๆžœไธบ๏ผšๆˆๅŠŸ๏ผŒๅคฑ่ดฅ๏ผŒ่ถ…ๆ—ถ๏ผŒๆ›ดๆ–ฐactivity_payment_info/activity_win_record็š„ๆ”ฏไป˜็ป“ๆžœไธบๆˆๅŠŸ๏ผŒๅคฑ่ดฅ๏ผŒๆœช็Ÿฅ้”™่ฏฏ //ๅ…ถไป–็Šถๆ€ไธๅšๅ˜ๆ›ด๏ผŒๅฆ‚ๆžœๅญ˜ๅœจๅ…ถไป–็Šถๆ€๏ผŒๅˆ™ๅฐ†ๆ”ฏไป˜ๆ ‡่ฏ†็ฝฎไธบtrue if(payResultQueryService.checkPayingStatus(payInfo.getSysSerialNum())){ payTag = true; } } } if(payTag){ return record.getActivityId(); } } return null; } /** * ๅค„็†ๆ”ฏไป˜ไธญ็Šถๆ€็š„ๆ”ฏไป˜่ฎฐๅฝ•ๅŠๆดปๅŠจๅ‚ๅŠ ่ฎฐๅฝ• * @Title: processPayingRecord * @param activityId * @return * @Author: wujiamin * @date 2017ๅนด6ๆœˆ7ๆ—ฅ */ @Override public boolean processPayingRecord(String activityId, String currentMobile) { Map queryMap = new HashMap(); queryMap.put("activityType", ActivityType.CROWD_FUNDING.getCode()); queryMap.put("mobile", currentMobile); queryMap.put("joinType", 2); queryMap.put("payResult", 1);//ๆ”ฏไป˜็Šถๆ€ไธบๆ”ฏไป˜ไธญ queryMap.put("activityId", activityId); //ๆ‰พๅˆฐ่ฏฅ็”จๆˆทๆ‰€ๆœ‰่ฏฅๆดปๅŠจๆ”ฏไป˜ไธญ็Šถๆ€็š„ๆ”ฏไป˜่ฎฐๅฝ• List<ActivityWinRecord> winRecords = activityWinRecordService.getWinRecordsForCrowdFundingByMap(queryMap); logger.info("็”จๆˆทๅค„็†ๆ”ฏไป˜ไธญ็š„ๅ‚ไธŽ่ฎฐๅฝ•๏ผŒsize={}", winRecords.size()); if(winRecords.size()<=0){ logger.info("็”จๆˆทๅค„็†ๆ”ฏไป˜ไธญ็š„ๅ‚ไธŽ่ฎฐๅฝ•ไธๅญ˜ๅœจ"); return false; } ActivityWinRecord record = winRecords.get(0); List<ActivityPaymentInfo> payInfos = activityPaymentInfoService.selectByWinRecordId(record.getRecordId()); for(ActivityPaymentInfo payInfo : payInfos){ if(payInfo.getStatus().equals(1) || payInfo.getStatus().equals(7) || payInfo.getStatus().equals(8) || payInfo.getStatus().equals(9)){ //ๆ”ฏไป˜็Šถๆ€ไธบๆ”ฏไป˜ไธญ๏ผŒ็ญ‰ๅพ…ไป˜ๆฌพ๏ผŒๅทฒๅ–ๆถˆ๏ผŒ่ถ…ๆ—ถ๏ผŒๅฐ†activity_payment_info็š„ๆ”ฏไป˜็Šถๆ€ๆ”นๆˆๅ…ณ้—ญๆ”ฏไป˜ logger.info("ๅฐ†ๆ”ฏไป˜่ฎฐๅฝ•ๆ”นๆˆๆ”ฏไป˜ๅ…ณ้—ญ็Šถๆ€๏ผŒๆดปๅŠจๆ”ฏไป˜่ฎฐๅฝ•SysSerialNum={}๏ผŒๅŽŸๆ”ฏไป˜็Šถๆ€{}", payInfo.getSysSerialNum(), payInfo.getStatus()); payInfo.setChargeUpdateTime(new Date()); payInfo.setStatus(10);//ๆ”ฏไป˜ๅ…ณ้—ญ็Šถๆ€ if(!activityPaymentInfoService.updateBySysSerialNumSelective(payInfo)){ logger.info("ๅฐ†ๆ”ฏไป˜่ฎฐๅฝ•ๆ”นๆˆๅ…ณ้—ญ็Šถๆ€ๅคฑ่ดฅ๏ผŒๆดปๅŠจๆ”ฏไป˜่ฎฐๅฝ•SysSerialNum={}", payInfo.getSysSerialNum()); return false; } } } logger.info("็”จๆˆทๅญ˜ๅœจๆ”ฏไป˜ไธญ่ฎขๅ•๏ผŒๅทฒๅฐ†ๆ‰€ๆœ‰ๆ”ฏไป˜่ฎฐๅฝ•็ฝฎไธบๅ…ณ้—ญ๏ผŒๅฐ†ๆดปๅŠจไธญๅฅ–่ฎฐๅฝ•ๆ”นๆˆๅพ…ๆ”ฏไป˜๏ผŒactivityWinRecord={}", record.getRecordId()); record.setPayResult(0);//activity_win_record้‡ๆ–ฐ่ฎพ็ฝฎๆˆๆœชๆ”ฏไป˜ record.setUpdateTime(new Date()); if(!activityWinRecordService.updateByPrimaryKeySelective(record)){ logger.info("ๅฐ†ๆดปๅŠจไธญๅฅ–่ฎฐๅฝ•ๆ”นๆˆๅพ…ๆ”ฏไป˜ๅคฑ่ดฅ๏ผŒactivityWinRecord={}", record.getRecordId()); return false; } return true; } }
[ "fromluozuwu@qq.com" ]
fromluozuwu@qq.com
2ec4ad739263429026475b06866146da5af7e720
f835ecfa232489b71379f256cd27c47a56b072ae
/touchnan/src/main/java/cn/touchnan/dto/bean/UserDto.java
168c5af91ffdffa3c6b5270ffa5f8ce6934aad2b
[]
no_license
touchnan/touchmine
76dd5fe4fd0591fae8ba68cdae80fc4797632cfc
5e508db01cfc48e41a7ef52b711dfb7d6bed8a35
refs/heads/master
2022-12-22T08:30:08.628566
2021-01-18T15:34:40
2021-01-18T15:34:40
11,272,527
0
0
null
2022-12-16T04:49:52
2013-07-09T04:08:53
Java
UTF-8
Java
false
false
3,249
java
/* * cn.touchnan.dto.UserDto.java * May 24, 2012 */ package cn.touchnan.dto.bean; import java.sql.ResultSet; import org.apache.struts2.json.annotations.JSON; import org.nutz.lang.Strings; import cn.touch.kit.encrypt.MD5; import cn.touchin.dto.Dto; import cn.touchnan.entity.User; /** * May 24, 2012 * * @author <a href="mailto:touchnan@gmail.com">chegnqiang.han</a> * */ public class UserDto extends Dto<User> { private static final long serialVersionUID = -4100368477318151602L; private Long id; /** * ็”จๆˆทๅ็งฐ */ private String nickName; /** * ็”จๆˆท็™ปๅฝ•ๅ */ private String loginName; /** * ็”จๆˆทๅฏ†็  */ private String passwd; /** * ๆ–ฐๅฏ†็  */ private String newPasswd; /** * ็”จๆˆท่ง’่‰ฒ */ private int role; /** * ็”จๆˆท็ฑปๅž‹ */ private int type; /* * (non-Javadoc) * * @see cn.touchin.dto.Dto#invokeForCallback(java.lang.Object) */ @Override public Dto<User> invokeForCallback(User entity) { copyProperties(entity); this.passwd = null; return this; } public Dto<User> init(ResultSet rs) { return this; } public static String encryptPasswd(String passwd) { if (!Strings.isBlank(passwd)) { return MD5.digest(passwd); } return ""; } /** * @return the nickName */ public String getNickName() { return nickName; } /** * @param nickName * the nickName to set */ public void setNickName(String nickName) { this.nickName = nickName; } /** * @return the loginName */ public String getLoginName() { return loginName; } /** * @param loginName * the loginName to set */ public void setLoginName(String loginName) { this.loginName = loginName; } /** * @return the passwd */ @JSON(serialize=false) public String getPasswd() { return passwd; } /** * @param passwd * the passwd to set */ public void setPasswd(String passwd) { this.passwd = passwd; } /** * @return the role */ public int getRole() { return role; } /** * @param role * the role to set */ public void setRole(int role) { this.role = role; } /** * @return the type */ public int getType() { return type; } /** * @param type * the type to set */ public void setType(int type) { this.type = type; } /** * @return the id */ public Long getId() { return id; } /** * @param id the id to set */ public void setId(Long id) { this.id = id; } /** * @return the newPasswd */ @JSON(serialize=false) public String getNewPasswd() { return newPasswd; } /** * @param newPasswd * the newPasswd to set */ public void setNewPasswd(String newPasswd) { this.newPasswd = newPasswd; } }
[ "88052350@qq.com" ]
88052350@qq.com
9753945706b2d92f64e39b395409c3ce76eb77b0
d15058fec18f4cd2c4d869f6a5e2fb5116215eb3
/src/main/java/com/tranzvision/gd/TZApplicationSurveyBundle/dao/PsTzDcXxxKxzTMapper.java
f62b31fa878f6edeef41e8ef75c2d2913d33ed2b
[]
no_license
YujunWu-King/university
1c08118d753c870f4c3fa410f7127d910a4e3f2d
bac7c919f537153025bec9de2942f0c9890d1b7a
refs/heads/BaseLocal
2022-12-26T19:51:20.994957
2019-12-30T11:38:20
2019-12-30T11:38:20
231,065,763
0
0
null
2022-12-16T06:34:06
2019-12-31T09:43:56
Java
UTF-8
Java
false
false
575
java
package com.tranzvision.gd.TZApplicationSurveyBundle.dao; import com.tranzvision.gd.TZApplicationSurveyBundle.model.PsTzDcXxxKxzT; import com.tranzvision.gd.TZApplicationSurveyBundle.model.PsTzDcXxxKxzTKey; public interface PsTzDcXxxKxzTMapper { int deleteByPrimaryKey(PsTzDcXxxKxzTKey key); int insert(PsTzDcXxxKxzT record); int insertSelective(PsTzDcXxxKxzT record); PsTzDcXxxKxzT selectByPrimaryKey(PsTzDcXxxKxzTKey key); int updateByPrimaryKeySelective(PsTzDcXxxKxzT record); int updateByPrimaryKey(PsTzDcXxxKxzT record); }
[ "raosheng@tranzvision.com.cn" ]
raosheng@tranzvision.com.cn
b6a66a869d8f1726f96a1fe33e8be528e5c26179
164891e198022003e8bdddcf51920bbe55f5b881
/Point.java
e8e5c1d4d36a3638d6129923744098286a51db62
[]
no_license
SanthoshShanmu/Snake
8352f6834fd44bdd14fa981b6fbc654c3cdf9570
64b5c74ee3d6106409fcf6faa8fa8855c75f7576
refs/heads/master
2022-12-15T17:20:56.743463
2020-09-19T12:40:49
2020-09-19T12:40:49
260,226,493
0
0
null
null
null
null
UTF-8
Java
false
false
1,048
java
package app; import javafx.geometry.Bounds; public class Point { private int x; private int y; public Point(int x, int y) { this.x=x; this.y=y; } public Point(Point p){ this(p.x, p.y); } public Point(){ this(0, 0); } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public void translate(int a, int b) { x += a; y += b; } public boolean inBounds(Bounds bounds) { return x >= bounds.getMinX() && y >= bounds.getMinY() && x < bounds.getMaxX() && y < bounds.getMaxY(); } @Override public boolean equals(Object ting) { if (this == ting) return true; if (ting == null) return false; if (!(ting instanceof Point)) return false; Point other = (Point) ting; if (x != other.x) return false; if (y != other.y) return false; return true; } public String toString() { return x + ", " + y; } }
[ "noreply@github.com" ]
SanthoshShanmu.noreply@github.com
f69ef52cf36beac2ce7cefd40b90cf4b10a0d4cc
a0c2c06673352199d493b3037b104b3eb0d2d5f5
/dao/DatabaseClient.java
f9e8f4ce81df3edcbc9962a6997dc0727193257b
[]
no_license
amitmehto/ute-hhsession-svc
5cb0b99afe85184f89427a8c52865924b95e8b95
f70267412c2104322d45926043d1bf7bcccf26f3
refs/heads/master
2021-01-12T08:43:21.194016
2016-12-16T18:25:27
2016-12-16T18:25:27
76,675,233
0
0
null
null
null
null
UTF-8
Java
false
false
2,723
java
package com.rogers.ute.hhsessionsvc.dao; import com.datastax.driver.core.Cluster; import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.ResultSetFuture; import com.datastax.driver.core.Session; import com.datastax.driver.core.exceptions.NoHostAvailableException; import com.datastax.driver.core.exceptions.QueryExecutionException; import com.datastax.driver.core.exceptions.QueryValidationException; import com.typesafe.config.Config; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class DatabaseClient { Logger logger = LoggerFactory.getLogger(DatabaseClient.class); private Cluster cluster; private Session session; private String keyspace; private String password; private String userName; private String[] host; private DatabaseClient() { logger.info("DatabaseClient: in constructor"); } public DatabaseClient(Config config) { logger.info("DatabaseClient: in constructor"); host = config.getString("cassandra.host").split(";"); userName = config.getString("hh-session-service.cassandra.user"); password = config.getString("hh-session-service.cassandra.password"); keyspace = config.getString("hh-session-service.cassandra.keyspace"); cluster = Cluster.builder().addContactPoints(host) .withCredentials(userName, password) .build(); session = cluster.connect(keyspace); } public ResultSet executeAsync(String query) throws Exception { ResultSet results = null; ResultSetFuture resultSetFuture = null; try { logger.info("Established new connection using: Host server - " + host.toString() + "keyspace - " + keyspace); resultSetFuture = session.executeAsync(query); results = resultSetFuture.get(); if (null != results) { logger.debug("Query executed: " + results.wasApplied() + " query is-->" + query); } } catch (NoHostAvailableException exp) { logger.error("NoHostAvailableException occurred while executing the query --> " + query + " Exception: " + exp.getStackTrace()); throw exp; } catch (QueryExecutionException exp) { logger.error("QueryExecutionException occurred while executing the query --> " + query + " Exception: " + exp.getStackTrace()); throw exp; } catch (QueryValidationException exp) { logger.error("QueryValidationException occurred while executing the query --> " + query + " Exception: " + exp.getStackTrace()); throw exp; } return results; } }
[ "amit.mehto@rci.rogers.com" ]
amit.mehto@rci.rogers.com
6020a3bf3864a46dec542fb7d69e703fe077ca40
9cc1f9bd9836fd5f37f0cc4993d7c6fa77388d03
/src/main/java/com/game/config/WebSocketConfig.java
13d05604e9bbb2978a72c0d7902ccfb606b31287
[]
no_license
yniejun/Paint-Splat
e764c39e6863ef17bc00da9cd93fbfd0b398ad94
621d02800d8006f5a5ac716321be352d331dc28e
refs/heads/master
2023-01-14T08:03:22.925599
2020-11-19T16:43:15
2020-11-19T16:43:15
309,978,104
3
0
null
null
null
null
UTF-8
Java
false
false
388
java
package com.game.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.socket.server.standard.ServerEndpointExporter; @Configuration public class WebSocketConfig { @Bean public ServerEndpointExporter serverEndpointExporter() { return new ServerEndpointExporter(); } }
[ "yinnj@2345.com" ]
yinnj@2345.com
7343960f37aa8e7d608e55b26e47051cbf3376b7
d17310e0030ec73258c14bcb152151c5444f83c5
/ly-mybatis-generator/src/main/java/com/macro/mall/model/TbSku.java
9798550606431ede4b9f8947de8756297126fc60
[]
no_license
chenkangqin/leyou
28e9479193b21c450efdfcb2f07149a00c4174ad
df0be459f440a3667c8b4ff293de92439f95f25a
refs/heads/master
2022-06-23T13:37:49.100168
2020-05-11T15:08:15
2020-05-11T15:08:15
183,844,628
0
0
null
2022-06-21T03:26:47
2019-04-28T02:30:05
Java
UTF-8
Java
false
false
3,571
java
package com.macro.mall.model; import java.io.Serializable; import java.util.Date; public class TbSku implements Serializable { /** * sku id * * @mbggenerated */ private Long id; /** * spu id * * @mbggenerated */ private Long spuId; /** * ๅ•†ๅ“ๆ ‡้ข˜ * * @mbggenerated */ private String title; /** * ๅ•†ๅ“็š„ๅ›พ็‰‡๏ผŒๅคšไธชๅ›พ็‰‡ไปฅโ€˜,โ€™ๅˆ†ๅ‰ฒ * * @mbggenerated */ private String images; /** * ้”€ๅ”ฎไปทๆ ผ๏ผŒๅ•ไฝไธบๅˆ† * * @mbggenerated */ private Long price; /** * ็‰นๆœ‰่ง„ๆ ผๅฑžๆ€งๅœจspuๅฑžๆ€งๆจกๆฟไธญ็š„ๅฏนๅบ”ไธ‹ๆ ‡็ป„ๅˆ * * @mbggenerated */ private String indexes; /** * sku็š„็‰นๆœ‰่ง„ๆ ผๅ‚ๆ•ฐ้”ฎๅ€ผๅฏน๏ผŒjsonๆ ผๅผ๏ผŒๅๅบๅˆ—ๅŒ–ๆ—ถ่ฏทไฝฟ็”จlinkedHashMap๏ผŒไฟ่ฏๆœ‰ๅบ * * @mbggenerated */ private String ownSpec; /** * ๆ˜ฏๅฆๆœ‰ๆ•ˆ๏ผŒ0ๆ— ๆ•ˆ๏ผŒ1ๆœ‰ๆ•ˆ * * @mbggenerated */ private Boolean enable; /** * ๆทปๅŠ ๆ—ถ้—ด * * @mbggenerated */ private Date createTime; /** * ๆœ€ๅŽไฟฎๆ”นๆ—ถ้—ด * * @mbggenerated */ private Date lastUpdateTime; private static final long serialVersionUID = 1L; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getSpuId() { return spuId; } public void setSpuId(Long spuId) { this.spuId = spuId; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getImages() { return images; } public void setImages(String images) { this.images = images; } public Long getPrice() { return price; } public void setPrice(Long price) { this.price = price; } public String getIndexes() { return indexes; } public void setIndexes(String indexes) { this.indexes = indexes; } public String getOwnSpec() { return ownSpec; } public void setOwnSpec(String ownSpec) { this.ownSpec = ownSpec; } public Boolean getEnable() { return enable; } public void setEnable(Boolean enable) { this.enable = enable; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Date getLastUpdateTime() { return lastUpdateTime; } public void setLastUpdateTime(Date lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", spuId=").append(spuId); sb.append(", title=").append(title); sb.append(", images=").append(images); sb.append(", price=").append(price); sb.append(", indexes=").append(indexes); sb.append(", ownSpec=").append(ownSpec); sb.append(", enable=").append(enable); sb.append(", createTime=").append(createTime); sb.append(", lastUpdateTime=").append(lastUpdateTime); sb.append(", serialVersionUID=").append(serialVersionUID); sb.append("]"); return sb.toString(); } }
[ "chenkq@minstone.com.cn" ]
chenkq@minstone.com.cn
704faedbfbb97bcbdfe694fbc088d80af551ea9f
3250ae1c61f7f3a9f3be5d4d38aeecfd8c7fc683
/src/main/java/com/rafakwolf/pontointeligente/api/security/dto/TokenDto.java
6c5a97b5d466195f5cf17f3be51bba3e470844b9
[ "MIT" ]
permissive
rafakwolf/ponto-inteligente-api
4dac8eeb277434d279fad864111df7a575d1a462
995d53bd9512e11298da4bcb0d772559b6ee476a
refs/heads/master
2020-03-11T17:05:50.578843
2018-05-12T14:48:18
2018-05-12T14:48:18
130,137,447
0
0
null
null
null
null
UTF-8
Java
false
false
308
java
package com.rafakwolf.pontointeligente.api.security.dto; public class TokenDto { private String token; public TokenDto() { } public TokenDto(String token) { this.token = token; } public String getToken() { return token; } public void setToken(String token) { this.token = token; } }
[ "rafakwolf@outlook.com" ]
rafakwolf@outlook.com
1a77711fb7febfd7506b6e12199387f7f1d79111
5f04f0f213c02355f61464454e41e097d8fbb368
/sca-api/src/main/java/com/ciel/scaapi/feign/FuckMyLifeFeign.java
40e09ede8e41aae17f06add03e4d52d45d909539
[ "Apache-2.0" ]
permissive
cielswift/spring-cloud-alibaba
b01738f03ab0b0c958428059daf9946882df0986
ace794666f640caa4ac6574d235c4debda855598
refs/heads/master
2022-10-06T08:42:36.043577
2020-08-30T12:19:47
2020-08-30T12:19:47
240,160,605
1
1
Apache-2.0
2022-10-05T18:22:20
2020-02-13T02:30:28
Java
UTF-8
Java
false
false
652
java
package com.ciel.scaapi.feign; import com.ciel.scaentity.entity.ScaGirls; import java.util.List; /** * feign่ฐƒ็”จ */ public interface FuckMyLifeFeign { /** * get ่ฐƒ็”จ ๅธฆๅ‚ๆ•ฐ */ List<String> format(String name); /** * ไผ ้€’่ฏทๆฑ‚ๅคด */ String head(String token); /** * get ่ฏทๆฑ‚ไผ ้€’ๅฏน่ฑก */ String getQueryMap(ScaGirls scaGirls); /** * post ่ฐƒ็”จๅธฆๅ‚ๆ•ฐ */ String posts(ScaGirls scaGirls,Long id); /** * put ่ฐƒ็”จ */ String puts(ScaGirls scaGirls,Long id); /** * del ่ฐƒ็”จ */ String delete(Long id,String name); }
[ "101886648@qq.com" ]
101886648@qq.com
98e6294ba16031e31961178241b46ad59386e12b
e51092661fece966d7804779780a45408dd3ef1c
/wechat-video-dev/wechat-video-dev-domain/src/main/java/com/atlantis/domain/vo/PublisherVideo.java
b623b849ba97dc8459d20b730b6302ef18e49a85
[]
no_license
AtlantisChina/WeChat-Video
57ca17fbc54a5fd23b5960e696463bc6a314946c
f37b66aa311f87164a9b0522bfa9b288a0a0a764
refs/heads/master
2020-11-24T21:41:44.627128
2020-05-29T03:58:30
2020-05-29T03:58:30
228,351,638
5
0
null
2019-12-18T11:40:03
2019-12-16T09:37:01
CSS
UTF-8
Java
false
false
421
java
package com.atlantis.domain.vo; public class PublisherVideo { public UsersVO publisher; public boolean userLikeVideo; public UsersVO getPublisher() { return publisher; } public void setPublisher(UsersVO publisher) { this.publisher = publisher; } public boolean isUserLikeVideo() { return userLikeVideo; } public void setUserLikeVideo(boolean userLikeVideo) { this.userLikeVideo = userLikeVideo; } }
[ "atlantis.work@foxmail.com" ]
atlantis.work@foxmail.com
a0f8135fcba1f5736e954fe54f1ddf1de64922fd
e4fd77ad9b1f2c5c23a9740cfb008fef2011c8b3
/src/main/java/com/oxygen/oblog/util/RSAUtil.java
44f920a4c5514a3eda1b62ef396fd2f776247506
[ "MIT" ]
permissive
EQ2L/OBlog
d9cc1c109514261934dfb901dc3ab829251f5e61
35a973dbd94dfca2c311e2fe5936ac9977dbe943
refs/heads/main
2022-12-30T02:48:01.907071
2020-10-18T08:21:41
2020-10-18T08:21:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,446
java
package com.oxygen.oblog.util; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import java.io.*; import java.security.*; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; import java.util.HashMap; import java.util.Map; /** * RSA็ฎ—ๆณ•๏ผŒๅฎž็Žฐๆ•ฐๆฎ็š„ๅŠ ๅฏ†่งฃๅฏ†ใ€‚ */ public class RSAUtil { private static Cipher cipher; static{ try { cipher = Cipher.getInstance("RSA"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (NoSuchPaddingException e) { e.printStackTrace(); } } /** * ็”Ÿๆˆๅฏ†้’ฅๅฏน * @param filePath ็”Ÿๆˆๅฏ†้’ฅๅฏน็š„ไฟๅญ˜่ทฏๅพ„ * @return */ public static Map<String,String> generateKeyPair(String filePath){ try { KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); // ๅฏ†้’ฅไฝๆ•ฐ keyPairGen.initialize(2048); // ๅฏ†้’ฅๅฏน KeyPair keyPair = keyPairGen.generateKeyPair(); // ๅ…ฌ้’ฅ PublicKey publicKey = keyPair.getPublic(); // ็ง้’ฅ PrivateKey privateKey = keyPair.getPrivate(); //ๅพ—ๅˆฐๅ…ฌ้’ฅๅญ—็ฌฆไธฒ String publicKeyString = getKeyString(publicKey); //ๅพ—ๅˆฐ็ง้’ฅๅญ—็ฌฆไธฒ String privateKeyString = getKeyString(privateKey); //ๅฐ†ๅฏ†้’ฅๅฏนๅ†™ๅ…ฅๅˆฐๆ–‡ไปถ FileWriter pubfw = new FileWriter(filePath + "/publicKey.key"); FileWriter prifw = new FileWriter(filePath + "/privateKey.key"); BufferedWriter pubbw = new BufferedWriter(pubfw); BufferedWriter pribw = new BufferedWriter(prifw); pubbw.write(publicKeyString); pribw.write(privateKeyString); pubbw.flush(); pubbw.close(); pubfw.close(); pribw.flush(); pribw.close(); prifw.close(); //ๅฐ†็”Ÿๆˆ็š„ๅฏ†้’ฅๅฏน่ฟ”ๅ›ž Map<String,String> map = new HashMap<String,String>(); map.put("publicKey", publicKeyString); map.put("privateKey", privateKeyString); return map; } catch (Exception e) { e.printStackTrace(); } return null; } /** * ่Žทๅ–ๅ…ฌ้’ฅ * * @param key ๅฏ†้’ฅๅญ—็ฌฆไธฒ๏ผˆ็ป่ฟ‡base64็ผ–็ ๏ผ‰ * @throws Exception */ public static PublicKey getPublicKey(String key) throws Exception { byte[] keyBytes; keyBytes = (new BASE64Decoder()).decodeBuffer(key); X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); PublicKey publicKey = keyFactory.generatePublic(keySpec); return publicKey; } /** * ่Žทๅ–็ง้’ฅ * * @param key ๅฏ†้’ฅๅญ—็ฌฆไธฒ๏ผˆ็ป่ฟ‡base64็ผ–็ ๏ผ‰ * @throws Exception */ public static PrivateKey getPrivateKey(String key) throws Exception { byte[] keyBytes; keyBytes = (new BASE64Decoder()).decodeBuffer(key); PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance("RSA"); PrivateKey privateKey = keyFactory.generatePrivate(keySpec); return privateKey; } /** * ่Žทๅ–ๅฏ†้’ฅๅญ—็ฌฆไธฒ๏ผˆ็ป่ฟ‡base64็ผ–็ ๏ผ‰ * * @return */ public static String getKeyString(Key key) throws Exception { byte[] keyBytes = key.getEncoded(); String s = (new BASE64Encoder()).encode(keyBytes); return s; } /** * ไฝฟ็”จๅ…ฌ้’ฅๅฏนๆ˜Žๆ–‡่ฟ›่กŒๅŠ ๅฏ†๏ผŒ่ฟ”ๅ›žBASE64็ผ–็ ็š„ๅญ—็ฌฆไธฒ * @param publicKey * @param plainText * @return */ public static String encrypt(PublicKey publicKey, String plainText){ try { cipher.init(Cipher.ENCRYPT_MODE, publicKey); byte[] enBytes = cipher.doFinal(plainText.getBytes()); return (new BASE64Encoder()).encode(enBytes); } catch (InvalidKeyException e) { e.printStackTrace(); } catch (IllegalBlockSizeException e) { e.printStackTrace(); } catch (BadPaddingException e) { e.printStackTrace(); } return null; } /** * ไฝฟ็”จkeystoreๅฏนๆ˜Žๆ–‡่ฟ›่กŒๅŠ ๅฏ† * @param publicKeystore ๅ…ฌ้’ฅๆ–‡ไปถ่ทฏๅพ„ * @param plainText ๆ˜Žๆ–‡ * @return */ public static String fileEncrypt(String publicKeystore, String plainText){ try { FileReader fr = new FileReader(publicKeystore); BufferedReader br = new BufferedReader(fr); String publicKeyString=""; String str; while((str=br.readLine())!=null){ publicKeyString+=str; } br.close(); fr.close(); cipher.init(Cipher.ENCRYPT_MODE,getPublicKey(publicKeyString)); byte[] enBytes = cipher.doFinal(plainText.getBytes()); return (new BASE64Encoder()).encode(enBytes); } catch (Exception e) { e.printStackTrace(); } return null; } /** * ไฝฟ็”จๅ…ฌ้’ฅๅฏนๆ˜Žๆ–‡่ฟ›่กŒๅŠ ๅฏ† * @param publicKey ๅ…ฌ้’ฅ * @param plainText ๆ˜Žๆ–‡ * @return */ public static String encrypt(String publicKey, String plainText){ try { cipher.init(Cipher.ENCRYPT_MODE,getPublicKey(publicKey)); byte[] enBytes = cipher.doFinal(plainText.getBytes()); return (new BASE64Encoder()).encode(enBytes); } catch (InvalidKeyException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; } /** * ไฝฟ็”จ็ง้’ฅๅฏนๆ˜Žๆ–‡ๅฏ†ๆ–‡่ฟ›่กŒ่งฃๅฏ† * @param privateKey * @param enStr * @return */ public static String decrypt(PrivateKey privateKey, String enStr){ try { cipher.init(Cipher.DECRYPT_MODE, privateKey); byte[] deBytes = cipher.doFinal((new BASE64Decoder()).decodeBuffer(enStr)); return new String(deBytes); } catch (InvalidKeyException e) { e.printStackTrace(); } catch (IllegalBlockSizeException e) { e.printStackTrace(); } catch (BadPaddingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; } /** * ไฝฟ็”จ็ง้’ฅๅฏนๅฏ†ๆ–‡่ฟ›่กŒ่งฃๅฏ† * @param privateKey ็ง้’ฅ * @param enStr ๅฏ†ๆ–‡ * @return */ public static String decrypt(String privateKey, String enStr){ try { cipher.init(Cipher.DECRYPT_MODE, getPrivateKey(privateKey)); byte[] deBytes = cipher.doFinal((new BASE64Decoder()).decodeBuffer(enStr)); return new String(deBytes); } catch (InvalidKeyException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; } /** * ไฝฟ็”จkeystoreๅฏนๅฏ†ๆ–‡่ฟ›่กŒ่งฃๅฏ† * @param privateKeystore ็ง้’ฅ่ทฏๅพ„ * @param enStr ๅฏ†ๆ–‡ * @return */ public static String fileDecrypt(String privateKeystore, String enStr){ try { FileReader fr = new FileReader(privateKeystore); BufferedReader br = new BufferedReader(fr); String privateKeyString=""; String str; while((str=br.readLine())!=null){ privateKeyString+=str; } br.close(); fr.close(); cipher.init(Cipher.DECRYPT_MODE, getPrivateKey(privateKeyString)); byte[] deBytes = cipher.doFinal((new BASE64Decoder()).decodeBuffer(enStr)); return new String(deBytes); } catch (InvalidKeyException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return null; } public static void main(String[] args) { String path = "F:/"; generateKeyPair(path); System.out.println("็”Ÿๆˆๅฏ†้’ฅๅฏนๅฎŒๆˆ"); } }
[ "2451809588@qq.com" ]
2451809588@qq.com
1b18272fd4c14ffaa80d48a4770e8301bae3da56
3eb7b81eed8220de5370350b6cc401311d745d07
/่ฎฟ้—ฎ่€…ๆจกๅผ/src/่ฎฟ้—ฎ่€…ๆจกๅผ/Apple.java
4ff3ed11928b55e43dd949428a97fa0a42dcfa3c
[]
no_license
honghongzhou/design-patterns
563da609e0f5bd89ac2452965a7e6fd85dbf737f
52205906b6f2602467bd138da30904528f41d684
refs/heads/master
2021-08-30T15:33:49.513623
2017-12-18T13:24:15
2017-12-18T13:24:15
null
0
0
null
null
null
null
WINDOWS-1256
Java
false
false
137
java
package ยทุฃุฎุชุตูƒุคยฃุชยฝ; public class Apple implements Product{ public void accept(Visitor visitor){ visitor.visit(this); } }
[ "3286252390@qq.com" ]
3286252390@qq.com
8a9077923114c83ddd9da54f1c8c2d9651b49a5b
b21e238eb6f2b1e1af54e7123c918b259559c6ea
/richest-customer-wealth/Solution.java
f35560afecf4fc61c33538bad243c4109cb8aff9
[]
no_license
kristina-head/leetcode
e070d3ae00f6d7aef8fa4ef2c16831e992162ad2
d05e8b64b21750638d76a0f58502250e4dce4b11
refs/heads/master
2023-09-06T07:11:26.928544
2023-09-04T06:38:21
2023-09-04T06:38:21
241,868,906
3
0
null
null
null
null
UTF-8
Java
false
false
493
java
class Solution { public int maximumWealth(int[][] accounts) { // O(N*M) int wealth; // O(1) int maxWealth = 0; // O(1) for (int i = 0; i < accounts.length; i++) { // O(M) wealth = 0; // O(1) for (int j = 0; j < accounts[i].length; j++) { // O(N) wealth += accounts[i][j]; // O(1) } maxWealth = Math.max(maxWealth, wealth); // O(1) } return maxWealth; // O(1) } }
[ "noreply@github.com" ]
kristina-head.noreply@github.com
4e5e04ed47395a73c99d07b75b6200508035c945
dd43b6da5989926805cde77740b24c10d499dc3c
/src/main/java/com/quasar/hibernateh2/dao/entity/Branch.java
ed339f984732cb6a0d95776878fcb732c88609dd
[]
no_license
FreeIrbis/ICanFly
32d8476663f91b68a3425fdb9f3f9be8f0c8f7bc
c3e81cf7f64e69f52ea0dbdd587fc3e7645e40ab
refs/heads/master
2016-09-13T07:18:40.416483
2016-05-30T02:28:19
2016-05-30T02:28:19
59,785,501
0
0
null
null
null
null
UTF-8
Java
false
false
1,063
java
package com.quasar.hibernateh2.dao.entity; import java.io.Serializable; import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.OneToMany; import javax.persistence.Table; /** * * @author Irbis */ @Entity @Table(name = "branch") public class Branch extends Model implements Serializable { private static final long serialVersionUID = 1990501617629593245L; @OneToMany(mappedBy = "id_branch") private Set<Student> students = new HashSet<>(); public void setStudents(Set<Student> students) { this.students = students; } public Set<Student> getStudents() { return students; } @Column(name = "name") private String name; public Branch() { name = null; } public Branch(Branch s) { name = s.getName(); } public String getName() { return name; } public void setName(String s) { name = s; } }
[ "Irbis@CRUDELIS" ]
Irbis@CRUDELIS
fe57ec181202b8eefc334f0ba8f35579350f7b87
13fd035cf041339646a649ced1522e74bc0e88c8
/GoodReading/src/server/core/CClientSession.java
4297595925a8fa216bf1c82a9a6fc13869604fd0
[]
no_license
dmishne/cs-lab-dnyy
7c22deb14bad0dd72906de3fe9ab8b29d5e2d8d8
6c7129909e766ed353627f6800df746fc68276a7
refs/heads/master
2020-05-05T08:20:42.210950
2011-01-31T17:39:55
2011-01-31T17:39:55
38,606,380
0
0
null
null
null
null
UTF-8
Java
false
false
2,596
java
package server.core; import common.api.CEntry; /** * class to contain the client's session details. * */ public class CClientSession implements Comparable<Object> { /** the clients session ID by which we recognize him, is actually the key for identification */ private int m_SessionID; /** holds the client's username */ private String m_UserName; /** holds the user's authorization (privilage) */ private int m_UserAuth; /** simple constructor * @param ID a session ID by which to recognize the session (distinct during runtime - ) * @param user the client's username * @param auth the clients authorization */ public CClientSession(int ID,String user,int auth) { this.m_UserName=user; this.m_SessionID=ID; this.m_UserAuth=auth; } /** * certifies that the noted entry is of the session's user's request * @param b CEntry by which to check. * @return answer if the Entry is related to ClientSession */ public boolean isOfUser(CEntry b)// { if (this.m_UserName == b.getUserName()) return true; return false; } /** * simple setter for session ID * @param SessionID sets the new SID */ public void setSessionID(int SessionID) { this.m_SessionID = SessionID; } /**getter for Session ID */ public int getSessionID() { return m_SessionID; } /** comparator for class * implements the Comparable interface * @param b is the other object to which we compare THIS * @return 0 if equal, 1 if this > b, -1 else. */ public int compareTo(Object b) { if(b instanceof CEntry) { if(this.m_UserName.compareTo(((CEntry) b).getUserName()) == 0) if(this.m_SessionID > ((CEntry) b).getSessionID()) return 1; else if(this.m_SessionID == ((CEntry) b).getSessionID()) return 0; else return -1; return this.m_UserName.compareTo(((CEntry) b).getUserName()); } if(b instanceof CClientSession) { if(this.m_UserName.compareTo(((CClientSession)b).m_UserName) == 0) if(this.m_SessionID > ((CClientSession)b).m_SessionID) return 1; else if(this.m_SessionID == ((CClientSession)b).m_SessionID) return 0; else return -1; return this.m_UserName.compareTo(((CClientSession)b).m_UserName); } if(this.equals(b)) return 0; return this.toString().compareTo(b.toString()); } /** getter for privilage / user authorization */ public int getUserAuth() { return m_UserAuth; } /**getter for user name */ public String getUsername() { return this.m_UserName; } }
[ "geffen.nir@ee6e6aaf-207a-3dc3-f7a4-2c6dd9a5b256" ]
geffen.nir@ee6e6aaf-207a-3dc3-f7a4-2c6dd9a5b256
3fcb697c25cb5cd0d76dc2f990627ae2278b17dc
308351c2025a9c1f10c3f2c287f15caf354902ba
/benchmarks/NetworkMonitorServer/src/edu/gatech/networkMonitorServer/UDPReceiver.java
55e05256890c394fd3d9208cd8e37db8884b9ed2
[]
no_license
XujieSi/mercury-share
53ac59177739f2cd3f0e73568e8e4b660dbb57d5
c96416371448478d263c4a5fcdea6245ca362606
refs/heads/master
2020-03-19T15:09:22.814152
2018-06-10T02:28:38
2018-06-10T02:28:38
136,658,103
0
0
null
null
null
null
UTF-8
Java
false
false
3,996
java
package edu.gatech.networkMonitorServer; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.net.DatagramPacket; import java.net.DatagramSocket; public class UDPReceiver extends Thread { static final int PORT = 8001; static final int UDPDATASIZE = 1500-20-8; DatagramSocket socket = null; byte[] receiverBuffer = new byte[UDPDATASIZE]; String sessionID; long startTime; long lastTime; int RSSI; double bandwidth; int sampleID; int currentSampleSession = -1; int count; int total; boolean started = false; boolean isWifi = false; String apMac; double distance; public UDPReceiver(){ } @Override public void run(){ int currentSample = -1; while(true){ try{ socket = new DatagramSocket(PORT); while(true){ DatagramPacket packet = new DatagramPacket(receiverBuffer, UDPDATASIZE); socket.receive(packet); String data = new String(packet.getData()); String[] tokens =data.split(":"); int sampleId = Integer.parseInt(tokens[0]); if(sampleId < currentSample){ if(Integer.parseInt(tokens[2]) != currentSampleSession ) //1.0. a new session, reset it currentSample = -1; else //1.1. this packet is time out, ignore it continue; } if(!started){ if(sampleId <= currentSample) //1.1. this packet is time out, ignore it continue; if(!tokens[1].startsWith("address")) //2. out-of-order packets, ignore it continue; //3. a new sampling, start a new sampling currentSample = sampleId; newSession(data, packet); continue; } //4. check if currentSampling is time out if(sampleId > currentSample){ //4.1. current sampling is time out, let's record it System.out.println("timeout"); record(packet); started = false; //4.2. deal with the new packet if(!tokens[1].startsWith("address")) //2. this packet is the out-of-order continue; else { //3. a new sampling currentSample = sampleId; newSession(data, packet); continue; } } total++; //5. this packet belongs to current sampling if(tokens[1].startsWith("address")){ //5.1 duplicated address packet, prepare for the packet train startTime = System.currentTimeMillis(); lastTime = System.currentTimeMillis(); continue; } //5.2 receive packet train, update the info lastTime = System.currentTimeMillis(); count += UDPDATASIZE; //5.3 end packet if(tokens[1].startsWith("end")){ //end of session record(packet); started = false; } } } catch(Exception e){} finally{ socket.close(); } } } private void newSession(String data, DatagramPacket packet){ //this the first packet received started = true; startTime = System.currentTimeMillis(); lastTime = System.currentTimeMillis(); count = 0; total = 0; String[] loc = data.split(":"); RSSI = Integer.parseInt(loc[3]); sessionID = loc[2]; currentSampleSession = Integer.parseInt(sessionID); sampleID = Integer.parseInt(loc[0]); //SUDPSender sender = new SUDPSender(socket,packet.getAddress(),packet.getPort()); //sender.start(); } public void record(DatagramPacket packet){ UDPSender sender = new UDPSender(socket,packet.getAddress(),packet.getPort()); sender.start(); long date = startTime/(1000*3600*24)%365; bandwidth = count*1.0/(lastTime - startTime)*1000.0/1024.0; int packetNum = count/UDPDATASIZE; // File f = new File("./signalup-"+date+"-"+sessionID+".txt"); File f = new File("./signalup.txt"); try{ BufferedWriter writer = new BufferedWriter(new FileWriter(f,true)); writer.append(sampleID+"\t"+startTime+"\t"+bandwidth+"\t" +RSSI+"\t"+packetNum+"\t"+"\n"); writer.flush(); writer.close(); }catch(Exception e){ } } }
[ "xsi@cis.upenn.edu" ]
xsi@cis.upenn.edu
614f044df5a56339dd0f943c889e9d8995d92ba9
36e3791eca92611ec2600565f183a811e4c41446
/src/org/jopac2/jbal/xml/Rdf.java
8f98a6f8d172e10b934c6bffcb4574af57f774f4
[]
no_license
datazuul/jbal
c721897a74e584902eeb5021877b220f4a64d622
e9da8ce983c74afcca8d21b08a25a09fa2eca318
refs/heads/master
2021-01-13T02:08:42.265775
2013-07-18T16:48:30
2013-07-18T16:48:30
38,447,415
0
0
null
null
null
null
UTF-8
Java
false
false
16,260
java
package org.jopac2.jbal.xml; /******************************************************************************* * * JOpac2 (C) 2002-2007 JOpac2 project * * This file is part of JOpac2. http://jopac2.sourceforge.net * * JOpac2 is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * JOpac2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with JOpac2; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *******************************************************************************/ /* * @author Romano Trampus * @version 17/02/2005 */ /** * JOpac2 - Modulo formato "RDF". v. 0.1 * Questo modulo permette di importare dati registrati nel formato * XML/RDF Dublin Core + DCMI Cite */ /** * TODO: tutto da rifare */ import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.util.*; //import javax.xml.parsers.SAXParser; //import javax.xml.parsers.SAXParserFactory; import org.apache.xerces.parsers.DOMParser; import org.w3c.dom.Attr; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.jopac2.jbal.RecordInterface; import org.jopac2.jbal.abstractStructure.Tag; import org.jopac2.jbal.classification.ClassificationInterface; import org.jopac2.jbal.iso2709.ISO2709Impl; import org.jopac2.jbal.subject.SubjectInterface; import org.jopac2.utils.BookSignature; import org.jopac2.utils.JOpac2Exception; //import org.xml.sax.XMLReader; @SuppressWarnings("unchecked") public class Rdf extends ISO2709Impl { // private String Rdf="http://www.w3.org/1999/02/22-Rdf-syntax-ns#"; // private String xsi="http://www.w3.org/2001/XMLSchema"; // private String dcterms="http://purl.org/dc/terms/"; // private String dcq="http://purl.org/dc/qualifiers/1.0/"; // private String dc="http://purl.org/dc/elements/1.1/"; RdfData record; private String originalData=""; public Rdf(RdfData r) { record=r; } public Rdf(String stringa, String dTipo) { init(stringa); } public Rdf(String stringa, String dTipo, String livello) { init(stringa); } public String toXML() { return originalData; } public Hashtable<String, List<Tag>> getRecordMapping() { return null; } public String getRecordTypeDescription() { return "General RDF text"; } public void init(String stringa) { record=new RdfData(); parse(stringa,record); } /* * Da un nodo esplora e carica gli autori. * Si aspetta di essere in una Rdf:bag e poi le linee */ private void exploreData(Node node, Object v,String prefix) { int type = node.getNodeType(); switch(type) { case Node.ELEMENT_NODE: NodeList children = node.getChildNodes(); int len = children.getLength(); for (int i=0; i<len; i++) exploreData(children.item(i),v,prefix); break; case Node.TEXT_NODE: if(v.getClass().getCanonicalName().equals("java.util.Vector")) { ((Vector)v).addElement(node.getNodeValue()); } else if (v.getClass().getCanonicalName().equals("java.util.String")) { v=prefix+node.getNodeValue(); } break; } } private void exploreData(Node node, Object v) { exploreData(node, v, null); } public void exploreAttributes(Node node) { NamedNodeMap attrs = node.getAttributes(); int len = attrs.getLength(); for (int i=0; i<len; i++) { Attr attr = (Attr)attrs.item(i); System.out.print(" " + attr.getNodeName() + "=\"" + attr.getNodeValue() + "\""); } } public String lookAttr(NamedNodeMap attrs,String name) { String r=null; int len = attrs.getLength(); for (int i=0; i<len; i++) { Attr attr = (Attr)attrs.item(i); if(attr.getNodeName().equals(name)) r=attr.getNodeValue(); } return r; } public void explore(Node node, RdfData r) { int type = node.getNodeType(); String nodeName = node.getNodeName(); NamedNodeMap attrs = node.getAttributes(); switch (type) { case Node.ELEMENT_NODE: if(nodeName.equals("Rdf:Description")) { r.addAbout(lookAttr(attrs,"Rdf:about")); } if(nodeName.equals("dc:creator")) { exploreData(node,r.getAuthors()); } if(nodeName.equals("dc:source")) { exploreData(node,r.getSource()); } if(nodeName.equals("dc:publisher")) { exploreData(node,r.getEditors()); } if(nodeName.equals("dc:date")) { exploreData(node,r.getPublicationDate()); } if(nodeName.equals("dc:language")) { exploreData(node,r.getLanguage()); } if(nodeName.equals("dc:title")) { exploreData(node,r.getTitle()); } if(nodeName.equals("dc:description")) { exploreData(node,r.getDescription()); } if(nodeName.equals("dcterms:isPartOf")) { exploreData(node,r.getIsPartOf()); } if(nodeName.equals("dcterms:bibliographicCitation")) { exploreData(node,r.getCitations(),lookAttr(attrs,"xsi:type")+"://"); } if(nodeName.equals("dc:relation")) { if(lookAttr(attrs,"Rdf:parseType").equalsIgnoreCase("Resource")) { NodeList l=node.getChildNodes(); Node c=l.item(0); if(c.getNodeName().equalsIgnoreCase("dcq:relationType")) { String relType= lookAttr(c.getAttributes(),"Rdf:resource"); if(relType.equalsIgnoreCase("http://purl.org/dc/qualifiers/1.0/IsPartOf")) { RdfData rt=new RdfData(); explore(l.item(1), rt); r.getLinkUp().addElement(new Rdf(rt)); } if(relType.equalsIgnoreCase("http://purl.org/dc/qualifiers/1.0/hasPart")) { RdfData rt=new RdfData(); explore(l.item(1), rt); r.getLinkDown().addElement(new Rdf(rt)); } } } } NodeList children = node.getChildNodes(); int len = children.getLength(); for (int i=0; i<len; i++) explore(children.item(i),r); break; case Node.ENTITY_REFERENCE_NODE: // System.out.print("&" + node.getNodeName() + ";"); break; case Node.CDATA_SECTION_NODE: // System.out.print("<![CDATA[" + node.getNodeValue() + "]]>"); break; case Node.TEXT_NODE: // System.out.print(node.getNodeValue()); break; case Node.PROCESSING_INSTRUCTION_NODE: // System.out.print("<?" + node.getNodeName()); // String data = node.getNodeValue(); // if (data!=null && data.length()>0) // System.out.print(" " + data); // System.out.println("?>"); break; } } static void print(Node node) { int type = node.getNodeType(); switch (type) { case Node.ELEMENT_NODE: System.out.print("<" + node.getNodeName()); NamedNodeMap attrs = node.getAttributes(); int len = attrs.getLength(); for (int i=0; i<len; i++) { Attr attr = (Attr)attrs.item(i); System.out.print(" " + attr.getNodeName() + "=\"" + attr.getNodeValue() + "\""); } System.out.print('>'); NodeList children = node.getChildNodes(); len = children.getLength(); for (int i=0; i<len; i++) print(children.item(i)); System.out.print("</" + node.getNodeName() + ">"); break; case Node.ENTITY_REFERENCE_NODE: System.out.print("&" + node.getNodeName() + ";"); break; case Node.CDATA_SECTION_NODE: System.out.print("<![CDATA[" + node.getNodeValue() + "]]>"); break; case Node.TEXT_NODE: System.out.print(node.getNodeValue()); break; case Node.PROCESSING_INSTRUCTION_NODE: System.out.print("<?" + node.getNodeName()); String data = node.getNodeValue(); if (data!=null && data.length()>0) System.out.print(" " + data); System.out.println("?>"); break; } } public void parse(String in,RdfData record) { try{ originalData=in; in=in.replaceAll("&#13;",""); in=in.replaceAll("&#10;",""); in=in.replaceAll("&#9;",""); //in=in.replaceAll("&","&amp;"); if(in.length()>0) { InputSource is=new InputSource(new StringReader(in)); DOMParser p=new DOMParser(); p.parse(is); Node n=p.getDocument(); NodeList children = n.getChildNodes(); int len = children.getLength(); for (int i=0; i<len; i++) explore(children.item(i),record); } // System.out.println("Out Rdf"); } catch(Exception e){ e.printStackTrace(); } } public void initLinkUp() { //linkUp=getLink(""); } public void initLinkSerie() { // linkSerie=getLink("016"); } public void initLinkDown() { // linkDown=getLink("021"); } // ritorna un vettore di elementi Rdf public Vector getAuthors() { return record.getAuthors(); } public Vector getSignatures() { Vector res=new Vector(); // res.addElement(new BookSignature(codiceBib,b,inv,col,con)); try { res.addElement(new BookSignature((String)record.getAbout().firstElement(), "Catalogo "+record.getSource().firstElement(), null,null,null)); } catch(Exception e) {} return res; } /* * TODO da implementare getEdition */ public String getEdition() {return null;} public boolean hasLinkUp() { return (record.getLinkUp().size()>0); } public boolean hasLinkDown() { return (record.getLinkDown().size()>0); } public boolean hasLinkSerie() { return (record.getLinkSerie().size()>0); } public Vector getHasParts() { return record.getLinkDown(); } public Vector getIsPartOf() { return record.getLinkUp(); } public Vector getSerie() { return record.getLinkSerie(); } public String getTitle() {return record.getTitle().size()>0?(String)record.getTitle().elementAt(0):null;} public String getISBD() {return record.getISBD().size()>0?(String)record.getISBD().elementAt(0):null;} public Vector<SubjectInterface> getSubjects() {return record.getSubjects();} public Vector getClassifications() {return record.getClassifications();} public Vector getEditors() {return record.getEditors();} public String getPublicationPlace() {return record.getPublicationPlace().size()>0?(String)record.getPublicationPlace().elementAt(0):null;} public String getPublicationDate() {return record.getPublicationDate().size()>0?(String)record.getPublicationDate().elementAt(0):null;} public String getBid() {return record.getAbout().size()>0?(String)record.getAbout().elementAt(0):null;} public String getAbstract() {return record.getDescription().size()>0?(String)record.getDescription().elementAt(0):null;} public Rdf() { } public void doJob() { String ris=new String(); try { File f=new File("c:/result.xml"); FileInputStream fi=new FileInputStream(f); BufferedReader r=new BufferedReader(new InputStreamReader(fi)); int i=2500; while((r.ready())&&(i-->0)) { ris=ris+r.readLine(); } } catch (Exception e) { e.printStackTrace(); } parse(ris,new RdfData()); } public static void main(String args[]) { Rdf r=new Rdf(); r.doJob(); } /* (non-Javadoc) * @see JOpac2.dataModules.ISO2709#getDescription() */ public String getDescription() { // TODO Auto-generated method stub return null; } @Override public Vector<RecordInterface> getLinked(String tag) throws JOpac2Exception { // TODO Auto-generated method stub return null; } public void addAuthor(String author) throws JOpac2Exception { // TODO Auto-generated method stub } public void addClassification(ClassificationInterface data) throws JOpac2Exception { // TODO Auto-generated method stub } public void addComment(String comment) throws JOpac2Exception { // TODO Auto-generated method stub } public void addPart(RecordInterface part) throws JOpac2Exception { // TODO Auto-generated method stub } public void addPartOf(RecordInterface partof) throws JOpac2Exception { // TODO Auto-generated method stub } public void addSerie(RecordInterface serie) throws JOpac2Exception { // TODO Auto-generated method stub } public void addSignature(BookSignature signature) throws JOpac2Exception { // TODO Auto-generated method stub } public void addSubject(SubjectInterface subject) throws JOpac2Exception { // TODO Auto-generated method stub } public void clearSignatures() throws JOpac2Exception { // TODO Auto-generated method stub } public String getComments() { // TODO Auto-generated method stub return null; } public String getStandardNumber() { // TODO Auto-generated method stub return null; } public void setAbstract(String abstractText) throws JOpac2Exception { // TODO Auto-generated method stub } public void setDescription(String description) throws JOpac2Exception { // TODO Auto-generated method stub } public void setEdition(String edition) throws JOpac2Exception { // TODO Auto-generated method stub } public void setISBD(String isbd) throws JOpac2Exception { // TODO Auto-generated method stub } public void setPublicationDate(String publicationDate) throws JOpac2Exception { // TODO Auto-generated method stub } public void setPublicationPlace(String publicationPlace) throws JOpac2Exception { // TODO Auto-generated method stub } public void setStandardNumber(String standardNumber, String codeSystem) throws JOpac2Exception { // TODO Auto-generated method stub } public void setTitle(String title) throws JOpac2Exception { // TODO Auto-generated method stub } public void setTitle(String title, boolean significant) throws JOpac2Exception { // TODO Auto-generated method stub } public void addPublisher(String publisher) throws JOpac2Exception { // TODO Auto-generated method stub } public BufferedImage getImage() { // TODO Auto-generated method stub return null; } public String getLanguage() { // TODO Auto-generated method stub return null; } public void setLanguage(String language) throws JOpac2Exception { // TODO Auto-generated method stub } @Override public void setImage(BufferedImage image, int maxx, int maxy) { // TODO Auto-generated method stub } @Override public String getBase64Image() { // TODO Auto-generated method stub return null; } @Override public String getAvailabilityAndOrPrice() { // TODO Auto-generated method stub return null; } @Override public void setAvailabilityAndOrPrice(String availabilityAndOrPrice) throws JOpac2Exception { // TODO Auto-generated method stub } @Override public String getPublisherName() { // TODO Auto-generated method stub return null; } @Override public void setPublisherName(String publisherName) throws JOpac2Exception { // TODO Auto-generated method stub } @Override public String getRecordModificationDate() { // TODO Auto-generated method stub return null; } @Override public void setRecordModificationDate(String date) { // TODO Auto-generated method stub } }
[ "romano.trampus@8e2fbf33-5753-0410-912e-857dddcdf106" ]
romano.trampus@8e2fbf33-5753-0410-912e-857dddcdf106
aabc1ce463d2f055899d4f1ee44094ab9a1a6488
21dcb4bdbec793660294039217b31aa8ee44312d
/src/main/java/analysis/java/Analysis.java
6fc299019f07ecc6498daef6915568f93c60863b
[]
no_license
tracywanggg/World-Bank-Database
0b041b99ba1c4a826ce027d83eef7e4b20501f73
d1f8cec0250500cb0e79912c3546f99801abf999
refs/heads/main
2023-04-09T08:03:37.162500
2021-04-22T06:58:40
2021-04-22T06:58:40
360,421,692
0
0
null
null
null
null
UTF-8
Java
false
false
478
java
package analysis.java; import main.java.Selection; /** * Abstract class from which all analysis types inherit. * @author Group18 */ abstract class Analysis { float[][] inputData = new float[100][100]; // declare array of arrays to hold data retrieved /** * Method to get call reader class to get data from World Bank Database (abstract). */ abstract float[][] calculate(Selection s); /** * Method to return ID (abstract). */ abstract String[] getID(); }
[ "noreply@github.com" ]
tracywanggg.noreply@github.com
2ac55721f929800ba098ca904a4ffa4fbc93edc3
28e635e58f17d8fe8bab14fda3145839a56cfcdd
/java/eve-gae-demo/src/main/java/com/almende/eve/agent/MessageAgent.java
8ac92aac7ff103f64f424e6e84e9f0b26f281c70
[]
no_license
JennYung/eve
b926c67b51a8917d32dce136599d1cb4dc71cca1
e92c6fa4b6932c73cfbc1ebb34735e977f1577f6
refs/heads/master
2021-01-17T07:07:26.584146
2013-02-15T16:26:28
2013-02-15T16:26:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,015
java
package com.almende.eve.agent; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.joda.time.DateTime; import com.almende.eve.agent.annotation.Name; import com.almende.eve.agent.annotation.Required; import com.almende.eve.entity.Message; import com.almende.eve.rpc.jsonrpc.JSONRequest; import com.almende.eve.rpc.jsonrpc.jackson.JOM; import com.almende.util.TwigUtil; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.appengine.api.datastore.QueryResultIterator; import com.google.appengine.api.datastore.Query.FilterOperator; import com.google.code.twig.FindCommand.RootFindCommand; import com.google.code.twig.ObjectDatastore; import com.google.code.twig.annotation.AnnotationObjectDatastore; /** * @class MessageAgent * The MessageAgent can send and receive messages from other MessageAgents. * It has an inbox and outbox for messages, which is stored in Google Datastore, * and can be queried. * * A MessageAgent is stateless, and its messages are stored in the Google * Datastore. Messages are stored in an inbox and an outbox, and can be * retrieved and filtered. * Messages are sent in parallel, they are put in a task queue and are * dispatched asynchronously. * * Core methods: * - send Send a message to one or multiple agents * Messages will be retrieved by recipients via the method onMessage * - getInbox Retrieve messages from the agents inbox * - getOutbox Retrieve messages from the agents outbox * - clear Clear inbox and outbox, delete all data from this agent. * * Example usage: * Open the web pages of the following agents in your browser: * http://localhost:8080/agents/messageagent1/ * http://localhost:8080/agents/messageagent2/ * http://localhost:8080/agents/messageagent3/ * * Send the following JSON-RPC request using a REST Client or via the web page * of this agent * url: * http://localhost:8080/agents/messageagent1/ * message: * { * "id": 1, * "method": "send", * "params": { * "message": { * "description": "Test message", * "to": [ * "http://localhost:8080/agents/messageagent2/", * "http://localhost:8080/agents/messageagent3/" * ] * } * } * } * * The message will be put in the outbox of agent 1, and will be sent to the * inbox of agent 2 and 3. To check if the message is in the inbox of agent 2, * Go the the webpage of agent 2 and execute the method getInbox. * * Note that the used GAE TaskQueue processes maximum 5 tasks per second by * default. This rate can be configured, see * https://developers.google.com/appengine/docs/java/config/queue * Example configuration: * <queue-entries> * <queue> * <name>default</name> * <rate>20/s</rate> * <bucket-size>40</bucket-size> * <max-concurrent-requests>10</max-concurrent-requests> * </queue> * </queue-entries> * * @author jos * @date 2013-02-15 */ public class MessageAgent extends Agent { @Override public void init() { TwigUtil.register(Message.class); } /** * Receive a message. The message will be stored in the agents inbox. * @param message * @throws Exception */ public void onMessage(@Name("message") Message message) throws Exception { // store the message in the inbox message.setAgent(getFirstUrl()); message.setBox("inbox"); ObjectDatastore datastore = new AnnotationObjectDatastore(); datastore.store(message); // trigger receive event (not necessary) String event = "receive"; ObjectNode params = JOM.createObjectNode(); params.put("message", JOM.getInstance().convertValue(message, ObjectNode.class)); trigger(event, params); } /** * Send a message. Message will be send to all recipients, and will be * stored in the agents outbox * @param message * @throws Exception */ public void send (@Name("message") Message message) throws Exception { // set timestamp and from fields message.setTimestamp(DateTime.now().toString()); message.setFrom(getFirstUrl()); message.setStatus("unread"); // store the message in the outbox message.setAgent(getFirstUrl()); message.setBox("outbox"); ObjectDatastore datastore = new AnnotationObjectDatastore(); datastore.store(message); // send the message to all recipients Set<String> to = message.getTo(); if (to != null) { for (String url : to) { try { // create a task to send the message to this agent asynchronously // this is important, it parallelizes dispatching of the messages String method = "dispatch"; ObjectNode params = JOM.createObjectNode(); params.put("url", url); params.put("message", JOM.getInstance().convertValue(message, ObjectNode.class)); JSONRequest request = new JSONRequest(method, params); long delay = 1; // milliseconds getScheduler().createTask(request, delay); } catch (Exception e) { e.printStackTrace(); } } } // trigger send event (not necessary) String event = "send"; ObjectNode params = JOM.createObjectNode(); params.put("message", JOM.getInstance().convertValue(message, ObjectNode.class)); trigger(event, params); } /** * Send a message to one particular recipient * This method is called asynchronously from the method send * @param url * @param message */ public void dispatch (@Name("url") String url, @Name("message") Message message) { try { String method = "onMessage"; ObjectNode params = JOM.createObjectNode(); params.put("message", JOM.getInstance().convertValue(message, ObjectNode.class)); send(url, method, params); } catch (Exception e) { e.printStackTrace(); } } /** * Retrieve all messages in the agents inbox * @param since Optional. An ISO date. messages will be filtered on a * timestamp greater or equal than since * @param status Optional. Messages will be filtered on a status like * "read", "unread", etc... * @return messages * @throws Exception */ public List<Message> getInbox ( @Name("since") @Required(false) String since, @Name("status") @Required(false) String status) throws Exception { return find("inbox", since, status); } /** * Retrieve all messages in the agents outbox * @param since Optional. An ISO date. messages will be filtered on a * timestamp greater or equal than since * @param status Optional. Messages will be filtered on a status like * "read", "unread", etc... * @return messages * @throws Exception */ public List<Message> getOutbox ( @Name("since") @Required(false) String since, @Name("status") @Required(false) String status) throws Exception { return find("outbox", since, status); } /** * Find messages from this agent * @param box Optional. Messagebox like "inbox" or "outbox" * @param since Optional. ISO Date containing a timestamp * @param status Optional. Status like "read", "unread" * @return messages * @throws Exception */ private List<Message> find (String box, String since, String status) throws Exception { ObjectDatastore datastore = new AnnotationObjectDatastore(); RootFindCommand<Message> command = datastore.find() .type(Message.class) .addFilter("agent", FilterOperator.EQUAL, getFirstUrl()); if (box != null) { command = command.addFilter("box", FilterOperator.EQUAL, box); } if (since != null) { command = command.addFilter("timestamp", FilterOperator.GREATER_THAN_OR_EQUAL, since); } if (status != null) { command = command.addFilter("status", FilterOperator.EQUAL, status); } QueryResultIterator<Message> it = command.now(); List<Message> messages = new ArrayList<Message>(); while (it.hasNext()) { messages.add(it.next()); } return messages; } /** * Clear inbox and outbox and everything the agent has stored. */ @Override public void clear() throws Exception { ObjectDatastore datastore = new AnnotationObjectDatastore(); QueryResultIterator<Message> it = datastore.find() .type(Message.class) .addFilter("agent", FilterOperator.EQUAL, getFirstUrl()) .now(); while (it.hasNext()) { Message message = it.next(); datastore.delete(message); // TODO: bulk delete all messages instead of one by one } } /** * Get the first url of the agents urls. Returns null if the agent does not * have any urls. * @return firstUrl */ private String getFirstUrl() { List<String> urls = getUrls(); if (urls.size() > 0) { return urls.get(0); } return null; } @Override public String getDescription() { return "The MessageAgent can send and receive messages from other " + "MessageAgents. It has an persisted inbox and outbox for messages"; } @Override public String getVersion() { return "0.1"; } }
[ "wjosdejong@gmail.com" ]
wjosdejong@gmail.com
88f8c8b9e88f2dec0594b12a39d9db4d072e5a20
66eb0bd17d7277650ece6c9eed1e0500f3850d1e
/serstapa/api/src/main/java/de/jbiblio/serstapa/api/LoginService.java
61a604ca435200aa0f9c63d79d47bee3812b2fde
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
jbiblio/experiments
28f997986279cd93688bb43797c29b623ff94154
1dc8a48f4730e45995762964b3e517eb372ca066
refs/heads/master
2021-11-23T13:43:48.184486
2021-11-02T19:47:16
2021-11-02T19:47:16
15,477,439
0
0
null
null
null
null
UTF-8
Java
false
false
725
java
/* * Copyright 2013 Michael Holtermann * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.jbiblio.serstapa.api; public interface LoginService { String login(String userName, String password); }
[ "michael@jbiblio.de" ]
michael@jbiblio.de
794ef67a484223c4bcd831883a7ce7ef6113a073
4269ac85ae69a9413735e3947d0fa01ca9f5cef7
/ImmidartEnterpriseArtfactId/src/main/java/testData/createBeneficiaryWorkVisaData.java
44e436989d9654d4034d6b4aa90eef771be4da21
[]
no_license
medineshkumar/IDEnterpriseAutomationTesting
68a68608a9af3d412711b9e148a0e868f05fcef4
30448ea1f6d2529b819667c5923d9b76889c62ac
refs/heads/master
2020-03-22T15:17:57.321133
2018-07-11T12:24:32
2018-07-11T12:24:32
140,241,760
0
0
null
null
null
null
UTF-8
Java
false
false
756
java
package testData; import org.testng.annotations.DataProvider; import genericClasses.TestDataReader; public class createBeneficiaryWorkVisaData { @DataProvider(name = "createWorkVisa") public static Object[][] getWorkVisaData() { TestDataReader createWorkVisaObj = new TestDataReader( "C:\\Users\\dinesh.r\\Desktop\\Automation\\EnterpriseTestData\\beneficiaryData.xls"); int row = createWorkVisaObj.getRowCount(5); int col = createWorkVisaObj.getColCount(5, 0); Object[][] createWorkVisa = new Object[row - 1][col]; for (int i = 1; i < row; i++) { for (int j = 0; j < col; j++) { createWorkVisa[i - 1][j] = createWorkVisaObj.readDataFromFile(5, i, j); } } return createWorkVisa; } }
[ "dineshthesoftwaretester@gmail.com" ]
dineshthesoftwaretester@gmail.com
a67f1e38eb11127318d3aa07d802a6c038c2c209
51ecc56dd9540b02fad0d6e0f6bc67ae7298edf6
/Fun/Self/self/app/src/main/java/com/wesleyruede/self/MainActivity.java
564dc2b78766cb7e46036bd05f3b3ef76da2bd68
[]
no_license
wesley-ruede/Android
bfb8ccab9d8670a1c0cf644aa3661c6a598c1bc0
74aab81cc46fc0a9bc054234ca5039e4522c3686
refs/heads/master
2020-07-24T08:49:09.147277
2020-07-01T04:16:26
2020-07-01T04:16:26
207,871,459
0
0
null
null
null
null
UTF-8
Java
false
false
733
java
package com.wesleyruede.self; import android.media.MediaPlayer; import android.media.SoundPool; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.storage.FirebaseStorage; public class MainActivity extends AppCompatActivity { private MediaPlayer mediaPlayer; private SoundPool soundPool; private FirebaseFirestore firestore; private FirebaseAuth auth; private FirebaseStorage storage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "wesley.k.r1993@gmail.com" ]
wesley.k.r1993@gmail.com
2cda26872d576c81e77eb0cd1cd1413393a28037
cd1900aeacda06d45db946e2309990a87712f0c0
/src/supermarket/Simulator.java
5951acdf534d5bd75f4c77c90fa7e7a6f9337dc7
[]
no_license
rodkulman/trabalho-final-alpro2
73062977515f1fde5b533e1ce240d04592d8112b
e872fa9d5489c88ec957f952c35fd24788243160
refs/heads/master
2021-01-10T20:59:55.789533
2014-07-08T21:44:36
2014-07-08T21:44:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,776
java
package supermarket; import services.*; import meta.*; import meta.collections.*; /** * Defines the supermarket simulator. * * @author rodkulman@gmail.com */ public class Simulator extends BaseSimulator { /** * The cashier serving the clients. */ private Cashier cashier; /** * Calculates the average waiting time. */ private Counter watingTime; /** * Calculates the average queue size. */ private Counter queueSize; /** * Initializes a new simulator, indicating whether it should trace. * * @param trace */ public Simulator() { clear(); } @Override protected void simulation(int time) { // check if a new client arrived. if (clientGenerator.generate(time, 0.0, 0.0)) { // if arrived, add to the cashier queue. Client c = clientGenerator.getGeneratedClient(); clientQueue.enqueue(c); Trace.log(time + ": cliente " + c.getID() + " (" + c.getRemainigTime() + " min) entra na fila - " + clientQueue.size() + " pessoa(s)"); } // checks if the cashier is free. if (cashier.isEmpty()) { // if the cashier is free, checks if there is a client waiting if (!clientQueue.isEmpty()) { // gets the first client in the queue try { cashier.serveNewClient(clientQueue.dequeue()); } catch (Exception ex) { Trace.log(ex); return; } watingTime.add(time - cashier.getCurrentClient().getArrival()); Trace.log(time + ": cliente " + cashier.getCurrentClient().getID() + " chega ao caixa."); } } else { // if the cashier is busy, reduce the remaining time until it // reaches 0 if (cashier.getCurrentClient().getRemainigTime() == 0) { Trace.log(time + ": cliente " + cashier.getCurrentClient().getID() + " deixa o caixa."); // when it reaches 0, ends the service cashier.endServing(); } else { cashier.getCurrentClient().decreaseRemaingTime(); } } queueSize.add(clientQueue.size()); } @Override public void clear() { clientQueue = new QueueLinked<Client>(); cashier = new Cashier(); clientGenerator = new ClientGenerator(arrivalProbability); watingTime = new Counter(); queueSize = new Counter(); cashiers = new Cashiers(); cashiers.add(cashier); } @Override public void printResults() { System.out.println(); System.out.println("Resultados da Simulacao"); System.out.println("Duracao:" + duration); System.out.println("Probabilidade de chegada de clientes:" + arrivalProbability); System.out.println("Tempo de atendimento minimo:" + Client.minServingTime); System.out.println("Tempo de atendimento maximo:" + Client.maxServingTime); System.out.println("Cliente atendidos:" + cashier.getAmountServed()); System.out.println("Clientes ainda na fila:" + clientQueue.size()); System.out.println("Cliente ainda no caixa:" + (cashier.getCurrentClient() != null)); System.out.println("Total de clientes gerados:" + clientGenerator.getAmountGenerated()); System.out.println("Tempo medio de espera:" + watingTime.getAverage()); System.out.println("Comprimento medio da fila:" + queueSize.getAverage()); } @Override public double getAverageWaitingTime() { return watingTime.getAverage(); } @Override public double getAverageQueueSize() { return queueSize.getAverage(); } @Override public boolean getClientStillBeingServed() { return cashier.getCurrentClient() != null; } @Override public int getClientsInQueue() { return clientQueue.size(); } @Override public int getAmountOfNoWaitServings() { return 0; } @Override public int getEmptyQueueTime() { return 0; } }
[ "rodkulman@gmail.com" ]
rodkulman@gmail.com
e8f6c3dd6d0d7599e939783615d978d9d00a55ae
9cab67d1af507fc1fe60c72489194ed760b8d3a0
/jni_win/me.stec.jni/src/me/stec/jni/XCryptException.java
add1035a1c143038c0f35687b3d56f9e625d1402
[]
no_license
wortjanin/jni_win
1cfe0f59bae4a1044038610ac88a563c5e3d453a
f5aef370b84a90f5272c32ec8f118a9c60b87bfe
refs/heads/master
2020-06-05T17:08:42.003779
2015-03-12T11:58:24
2015-03-12T11:58:24
32,074,405
0
0
null
null
null
null
UTF-8
Java
false
false
433
java
package me.stec.jni; public class XCryptException extends Throwable { private static final long serialVersionUID = 1L; String mistake; public XCryptException() { super(); // call superclass constructor mistake = "unknown"; } public XCryptException(String err) { super(err); // call super class constructor mistake = err; // save message } public String getError() { return mistake; } }
[ "achernoivanov@gmail.com" ]
achernoivanov@gmail.com
551cb20ef3a42466337b721cd906d5dec6e5b279
352234de888d913acc6788a05b99f2b8c8d70115
/src/main/java/ua/com/reveta/view/View.java
676d7a9254bcdd427333152c6b59d581299fce89
[]
no_license
Reveta/ProgressOrganiser
88ab24b16be10b72c45d364282475e6075c8a2e8
3a8437885660fc118f75fec69c333d93810f12dc
refs/heads/master
2020-03-10T19:52:08.118628
2018-04-29T23:41:05
2018-04-29T23:41:05
129,557,519
0
0
null
null
null
null
UTF-8
Java
false
false
661
java
package ua.com.reveta.view; import com.Utils; import ua.com.reveta.controller.Controller; public class View{ Controller controller = new Controller(); public void startProgram(){ frontMenu(); } private void frontMenu(){ String messege = "ะ’ะธะฑะตั€ะธ ะดั–ัŽ:" + "\n 1. ะ”ะพะดะฐั‚ะธ ะดะพััะณะฝะตะฝะฝั;" + "\n 2. ะžะณะปัะฝัƒั‚ะธ ะดะพััะณะฝะตะฝะฝั;"; System.out.println(messege); switch (Utils.scanInt()){ case 1: controller.saveAchievement(); break; case 2: controller.findAchievement(); break; } } }
[ "gfdsre1999@gmail.com" ]
gfdsre1999@gmail.com
5ebec3676c12b3f32f4d54b2ee8ea761289b099e
5df6ec20865da29d6ed43bfd45902d3f22e562a8
/api/src/main/java/org/openmrs/module/pacsintegration/PacsIntegrationException.java
1edef23485f25be69d082c9f4881bbddecf62470
[]
no_license
PIH/openmrs-module-pacsintegration
f636e34a2da23110d3ff9e01b21c00c6cdb0d132
a94e68faba0c2b05c619d13f653d138527fb6c9f
refs/heads/master
2023-04-14T18:36:07.027263
2023-04-04T14:03:36
2023-04-04T14:03:36
5,769,661
1
2
null
2022-11-21T16:35:05
2012-09-11T19:29:21
Java
UTF-8
Java
false
false
1,008
java
/** * The contents of this file are subject to the OpenMRS Public License * Version 1.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://license.openmrs.org * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * Copyright (C) OpenMRS, LLC. All Rights Reserved. */ package org.openmrs.module.pacsintegration; /** * Generic exception thrown by PACS Integration module */ public class PacsIntegrationException extends RuntimeException { private static final long serialVersionUID = 1L; public PacsIntegrationException() { super(); } public PacsIntegrationException(String message) { super(message); } public PacsIntegrationException(String message, Throwable throwable) { super(message, throwable); } }
[ "mgoodrich@pih.org" ]
mgoodrich@pih.org
42b52f39f5002979992fe10572d906970523706a
0c7deb7abd3bfe21e6de2bbf86b5b6ac54824268
/src/Vehicle/vehicleRegister2.java
a200cf00ef08e3234b59b034018815fcba69a124
[]
no_license
PavaniLilaksha/ITP-Project
0a20de04a4faf8f9e9443573c4f406c0f30114c4
120ecc0eb79fa7a11cb77f1f354471f4f5e26a40
refs/heads/master
2020-04-21T23:55:11.607264
2019-01-14T18:12:55
2019-01-14T18:12:55
169,961,496
2
0
null
2019-02-10T09:25:08
2019-02-10T09:25:08
null
UTF-8
Java
false
false
1,134
java
package Vehicle; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * Servlet implementation class vehicleRegister2 */ @WebServlet("/vehicleRegister2") public class vehicleRegister2 extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public vehicleRegister2() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub } }
[ "38455210+NimshiAshera@users.noreply.github.com" ]
38455210+NimshiAshera@users.noreply.github.com
97d81e1d5f4395d48d16d275e9a4dfc372f29fb3
35620b1d04c5891eec9350bb566fb00c94cb89ee
/src/main/java/snapshot/SnapshotList.java
41270ce463c88696186da644e57b6b41786e6f53
[]
no_license
daja0923/SynchronizedUnbalancedSnapshotList
5a4857b55045a7aae8aba6d0a8da7e735a414217
8d0d1354a27f921cdbfe3ca836f2d9fe75dd13c2
refs/heads/main
2023-05-07T20:40:16.496619
2021-05-31T13:46:51
2021-05-31T13:46:51
372,235,833
1
0
null
null
null
null
UTF-8
Java
false
false
1,154
java
package snapshot; /** * A <pre>List</pre> that offers the possibility to create snapshots of the * elements currently stored in it. <pre>SnapshotList</pre> may not remove * existing elements and it can only grow by appending elements, not inserting. */ public interface SnapshotList<E> extends List<E> { /** * Removes all versions prior to the specified one. * * The version must be no greater than the current version. */ void dropPriorSnapshots(int version); /** * Retrieves the element at the specified position for the version. * * @param index the specified position in the list * @param version the specified snapshot */ E getAtVersion(int index, int version); /** * Creates a snapshot of the current <pre>List</pre>. * * @return the version after the snapshot */ int snapshot(); /** * Indicates the version of the current <pre>SnapshotList</pre>; it may * also be regarded as the number of times that {@link #snapshot()} was * called on the instance. * * @return the version of the instance */ int version(); }
[ "djjamol@gmail.com" ]
djjamol@gmail.com
1d06e8357a3c9cc6e25f558176e6db2cb15c276c
fd751ca7cf3cce17323b0a26781be6b24266db46
/src/com/javarush/test/level21/lesson02/task03/Solution.java
0583da10c33778c7bb73d3a373edc4839a968811
[]
no_license
OlegVasylkov/JavaRushHomeWork
ddada3136818c4a4f38f75be4d98bcacee577db3
8b89b167c7e47bf42cdf2c1e6bad2b9a8ca138ba
refs/heads/master
2020-05-21T16:41:53.246830
2016-10-04T12:44:28
2016-10-04T12:44:28
63,808,986
0
0
null
null
null
null
UTF-8
Java
false
false
1,303
java
package com.javarush.test.level21.lesson02.task03; /* ะ’ัะต ะณะตะฝะธะฐะปัŒะฝะพะต - ะฟั€ะพัั‚ะพ! ะฃะฟั€ะพัั‚ะธั‚ัŒ. ะŸะตั€ะตะผะตะฝะฝั‹ะต ะฝะต ะฟะตั€ะตะธะผะตะฝะพะฒั‹ะฒะฐั‚ัŒ, ะบะพะผะผะตะฝั‚ะฐั€ะธะธ ะฝะต ะพัั‚ะฐะฒะปัั‚ัŒ. */ public class Solution { public static boolean calculate(boolean a, boolean b, boolean c, boolean d) { //System.out.println(true && (b||!a) && (c||!a) && (!d||!a) && (a||c) && (b||c) && c && (!d||c) || !b && c || c && d); //System.out.println(true && (c||!a||!b) && (!d||!a||!b) && (a||c||!b) && (!d||c||!b) && (!d||!a||c) && c && (!d||c) || c && d); // System.out.println(true && (c||!a||!b) && (!d||!a||!b||c) && (a||c||!b) && (!d||c||!b) && (!d||!a||c) && c && (!d||c) && // true && (c||!a||!b||d) && true && (a||c||!b||!d) && (!d||c||!b) && true && (c||d) && true); // System.out.println((!a||!b||c) && (!a||!b||c||!d) && (a||!b||c) && (c||!b||!d) && (!a||!d||c) && c && (!a||!b||c||d) && (a|!b||c||!d)); System.out.println(c && ( a && b && !d || !a || !b || d)); System.out.println(c); return a && b && c && !d || !a && c || !b && c || c && d; } public static void main(String[] args) { System.out.println(calculate(true, true, false, false)); } }
[ "olehvasylkov@ukr.net" ]
olehvasylkov@ukr.net
9f32699c80eb4da838686846a12a07e92987458d
7cf50e85458b34ce26e00501d94d41c4416add35
/GameEntity.java
3eb287d4e53f282366b083096f7d751d71e201fa
[]
no_license
jpswann288/notZombicide
e72a47a569668bedc349c498cf60e67a40d0702b
13afddec29445c8852f0856d8ef738e64ca28781
refs/heads/master
2021-04-06T08:26:54.420011
2018-03-12T19:49:22
2018-03-12T19:49:22
124,940,980
0
0
null
null
null
null
UTF-8
Java
false
false
12,614
java
package jri.agile.game; import java.util.LinkedList; public class GameEntity { private BoardPosition position; private boolean isAlive; protected LinkedList<String> actionLog; protected Game game; private boolean hasWall; private boolean hasDoor; private Room room; private boolean hasExit; public GameEntity (Game game, int yPos, int XPos) { isAlive = true; position = new BoardPosition(yPos, XPos); this.game = game; actionLog = new LinkedList<>(); } public LinkedList<String> getActionLog () { return actionLog; } public BoardPosition getCurrentPosition () { return position; } public boolean move (char direction) { boolean moved = false; if (canMoveEast(direction)) { if (doesEastHaveDoor()) { if (canBreakDownDoor()) { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks + 1) { moved = true; position.setXPos(position.getXPos() + 1); game.setRoom(position.getYPos(), position.getXPos(), new Room (position.getYPos(), position.getXPos(), Room.RoomType.Normal, 0, true)); game.spawnBuilding(position.getYPos(), position.getXPos() + 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - (numOfRicks + 1)); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 1) { moved = true; position.setXPos(position.getXPos() + 1); game.setRoom(position.getYPos(), position.getXPos(), new Room (position.getYPos(), position.getXPos(), Room.RoomType.Normal, 0, true)); game.spawnBuilding(position.getYPos(), position.getXPos() + 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); } else { moved = false; } } } else { moved = false; } } else if (doesEastHaveExit()) { if (canPlayerExit()) { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks) { moved = true; position.setXPos(position.getXPos() + 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - numOfRicks); game.win(); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 0) { moved = true; position.setXPos(position.getXPos() + 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); game.win(); } else { moved = false; } } } else { moved = false; } } else { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks) { moved = true; position.setXPos(position.getXPos() + 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - numOfRicks); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 0) { moved = true; position.setXPos(position.getXPos() + 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); } else { moved = false; } } } } else if (canMoveWest(direction)) { if (doesWestHaveDoor()) { if (canBreakDownDoor()) { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks + 1) { moved = true; position.setXPos(position.getXPos() - 1); game.setRoom(position.getYPos(), position.getXPos(), new Room (position.getYPos(), position.getXPos(), Room.RoomType.Normal, 0, true)); game.spawnBuilding(position.getYPos(), position.getXPos() - 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - (numOfRicks + 1)); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 1) { moved = true; position.setXPos(position.getXPos() - 1); game.setRoom(position.getYPos(), position.getXPos(), new Room (position.getYPos(), position.getXPos(), Room.RoomType.Normal, 0, true)); game.spawnBuilding(position.getYPos(), position.getXPos() - 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); } else { moved = false; } } } else { moved = false; } } else { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks) { moved = true; position.setXPos(position.getXPos() - 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - numOfRicks); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 0) { moved = true; position.setXPos(position.getXPos() - 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); } else { moved = false; } } } } else if (canMoveNorth(direction)) { if (doesNorthHaveDoor()) { if (canBreakDownDoor()) { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks + 1) { moved = true; position.setYPos(position.getYPos() - 1); game.setRoom(position.getYPos(), position.getXPos(), new Room (position.getYPos(), position.getXPos(), Room.RoomType.Normal, 0, true)); game.spawnBuilding(position.getYPos() - 1, position.getXPos()); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - (numOfRicks + 1)); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 2) { moved = true; position.setYPos(position.getYPos() - 1); game.setRoom(position.getYPos(), position.getXPos(), new Room (position.getYPos(), position.getXPos(), Room.RoomType.Normal, 0, true)); game.spawnBuilding(position.getYPos() - 1, position.getXPos()); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); } else { moved = false; } } } else { moved = false; } } else { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks) { moved = true; position.setYPos(position.getYPos() - 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - numOfRicks); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 0) { moved = true; position.setYPos(position.getYPos() - 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); } else { moved = false; } } } } else if (canMoveSouth(direction)) { if (doesSouthHaveDoor()) { if (canBreakDownDoor()) { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks + 1) { moved = true; position.setYPos(position.getYPos() + 1); game.setRoom(position.getYPos(), position.getXPos(), new Room (position.getYPos(), position.getXPos(), Room.RoomType.Normal, 0, true)); game.spawnBuilding(position.getYPos() + 1, position.getXPos()); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - (numOfRicks + 1)); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 2) { moved = true; position.setYPos(position.getYPos() + 1); game.setRoom(position.getYPos(), position.getXPos(), new Room (position.getYPos(), position.getXPos(), Room.RoomType.Normal, 0, true)); game.spawnBuilding(position.getYPos() + 1, position.getXPos()); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); } else { moved = false; } } } else { moved = false; } } else { if (game.isPlayerInRoomWithRick()) { int numOfRicks = game.getNumberOfRicks(); if (game.getPlayer().getActionPoints() >= numOfRicks) { moved = true; position.setYPos(position.getYPos() + 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - numOfRicks); } else { moved = false; } } else { if (game.getPlayer().getActionPoints() >= 0) { moved = true; position.setYPos(position.getYPos() + 1); game.getPlayer().setActionPoints(game.getPlayer().getActionPoints() - 1); } else { moved = false; } } } } return moved; } private boolean canMoveNorth(char direction) { return direction == 'N' && position.getYPos() > 0 && !doesNorthHaveWall(); } private boolean canMoveSouth(char direction) { return direction == 'S' && position.getYPos() < game.getHeight() - 1 && !doesSouthHaveWall(); } private boolean canMoveEast(char direction) { return direction == 'E' && position.getXPos() < game.getWidth() - 1 && !doesEastHaveWall(); } private boolean canMoveWest(char direction) { return direction == 'W' && position.getXPos() > 0 && !doesWestHaveWall(); } @SuppressWarnings("unused") private boolean playerCanEscape(boolean rickPresent) { if(rickPresent){ Rick rick; int ap = game.getPlayer().getActionPoints(); for(int i = 0; i < game.getRicks().size(); i++) { rick = game.getRicks().get(i); if (game.getPlayer().getCurrentPosition().equals(rick.getCurrentPosition())){ int rickNumber = rick.getRandNumberOfRicks(); if (ap - rickNumber >= 0) { game.getPlayer().setActionPoints(ap - rickNumber); return true; } } } } return false; } private boolean canBreakDownDoor () { boolean breakDoors = false; if(!game.getPlayer().getInvintory().isEmpty()) { if (game.getPlayer().getInvintory().get(0).canBreakDoors()) { breakDoors = true; } } return breakDoors; } private boolean canPlayerExit () { boolean exit = false; if(game.getObjectives() == 3) { exit = true; } return exit; } public boolean doesEastHaveExit () { if (position.getXPos() != game.getWidth()) { room = game.getRoom(position.getYPos(), position.getXPos() + 1); hasExit = room.isHasExit(); } return hasExit; } private boolean doesSouthHaveDoor () { if (position.getYPos() != game.getHeight()) { room = game.getRoom(position.getYPos() + 1, position.getXPos()); hasDoor = room.hasDoor(); } return hasDoor; } private boolean doesNorthHaveDoor () { if (position.getYPos() != 0) { room = game.getRoom(position.getYPos() - 1, position.getXPos()); hasDoor = room.hasDoor(); } return hasDoor; } public boolean doesEastHaveDoor () { if (position.getXPos() != game.getWidth()) { room = game.getRoom(position.getYPos(), position.getXPos() + 1); hasDoor = room.hasDoor(); } return hasDoor; } public boolean doesWestHaveDoor () { if (position.getXPos() != game.getWidth()) { room = game.getRoom(position.getYPos(), position.getXPos() - 1); hasDoor = room.hasDoor(); } return hasDoor; } public boolean doesNorthHaveWall () { if (position.getYPos() != 0) { room = game.getRoom(position.getYPos() - 1, position.getXPos()); hasWall = room.hasWall(); } return hasWall; } public boolean doesSouthHaveWall () { if (position.getYPos() != game.getHeight()) { room = game.getRoom(position.getYPos() + 1, position.getXPos()); hasWall = room.hasWall(); } return hasWall; } public boolean doesEastHaveWall () { if (position.getXPos() != game.getWidth()) { room = game.getRoom(position.getYPos(), position.getXPos() + 1); hasWall = room.hasWall(); } return hasWall; } public boolean doesWestHaveWall () { if (position.getXPos() != game.getWidth()) { room = game.getRoom(position.getYPos(), position.getXPos() - 1); hasWall = room.hasWall(); } return hasWall; } public boolean isAlive () { return isAlive; } public void die () { isAlive = false; } }
[ "noreply@github.com" ]
jpswann288.noreply@github.com
8ea14feab0b166828dc037033e737760d3a7b465
0af8b92686a58eb0b64e319b22411432aca7a8f3
/single-large-project/src/main/java/org/gradle/test/performancenull_428/Productionnull_42709.java
350166d0a1b1f4d2f51f80501a42d666a6112f10
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
588
java
package org.gradle.test.performancenull_428; public class Productionnull_42709 { private final String property; public Productionnull_42709(String param) { this.property = param; } public String getProperty() { return property; } private String prop0; public String getProp0() { return prop0; } public void setProp0(String value) { prop0 = value; } private String prop1; public String getProp1() { return prop1; } public void setProp1(String value) { prop1 = value; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
61bcad7774e8100e3f9c8265956f3ef44555ea73
41fb9c2c28cdfaa56a191ecdb869fc34519d63c4
/src/main/java/com/azure/dev/api/model/AccountRecentActivityWorkItemModel2.java
0233c44be07f2580a78380c4ef889c9ad17dc673
[]
no_license
thomas-worm-fernuni/gitlab-ados-hook
9dc810a4667540b2966e7614eb2e199720cbc729
fd36e2ddf7ee5eacc565ed2894292c5bc5c862bc
refs/heads/main
2023-07-02T02:57:14.480888
2021-08-21T21:25:42
2021-08-21T21:25:42
398,499,566
0
1
null
null
null
null
UTF-8
Java
false
false
11,130
java
/* * WorkItemTracking * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 6.1-preview * Contact: nugetvss@microsoft.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package com.azure.dev.api.model; import java.util.Objects; import java.util.Arrays; import com.azure.dev.api.model.AccountRecentActivityWorkItemModelBase; import com.azure.dev.api.model.IdentityRef; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.UUID; import org.threeten.bp.OffsetDateTime; /** * Represents Work Item Recent Activity */ @ApiModel(description = "Represents Work Item Recent Activity") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-08-21T10:09:21.598267402Z[Etc/UTC]") public class AccountRecentActivityWorkItemModel2 { public static final String SERIALIZED_NAME_ASSIGNED_TO = "assignedTo"; @SerializedName(SERIALIZED_NAME_ASSIGNED_TO) private IdentityRef assignedTo; public static final String SERIALIZED_NAME_ACTIVITY_DATE = "activityDate"; @SerializedName(SERIALIZED_NAME_ACTIVITY_DATE) private OffsetDateTime activityDate; /** * Type of the activity */ @JsonAdapter(ActivityTypeEnum.Adapter.class) public enum ActivityTypeEnum { VISITED("visited"), EDITED("edited"), DELETED("deleted"), RESTORED("restored"); private String value; ActivityTypeEnum(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return String.valueOf(value); } public static ActivityTypeEnum fromValue(String value) { for (ActivityTypeEnum b : ActivityTypeEnum.values()) { if (b.value.equals(value)) { return b; } } throw new IllegalArgumentException("Unexpected value '" + value + "'"); } public static class Adapter extends TypeAdapter<ActivityTypeEnum> { @Override public void write(final JsonWriter jsonWriter, final ActivityTypeEnum enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override public ActivityTypeEnum read(final JsonReader jsonReader) throws IOException { String value = jsonReader.nextString(); return ActivityTypeEnum.fromValue(value); } } } public static final String SERIALIZED_NAME_ACTIVITY_TYPE = "activityType"; @SerializedName(SERIALIZED_NAME_ACTIVITY_TYPE) private ActivityTypeEnum activityType; public static final String SERIALIZED_NAME_CHANGED_DATE = "changedDate"; @SerializedName(SERIALIZED_NAME_CHANGED_DATE) private OffsetDateTime changedDate; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) private Integer id; public static final String SERIALIZED_NAME_IDENTITY_ID = "identityId"; @SerializedName(SERIALIZED_NAME_IDENTITY_ID) private UUID identityId; public static final String SERIALIZED_NAME_STATE = "state"; @SerializedName(SERIALIZED_NAME_STATE) private String state; public static final String SERIALIZED_NAME_TEAM_PROJECT = "teamProject"; @SerializedName(SERIALIZED_NAME_TEAM_PROJECT) private String teamProject; public static final String SERIALIZED_NAME_TITLE = "title"; @SerializedName(SERIALIZED_NAME_TITLE) private String title; public static final String SERIALIZED_NAME_WORK_ITEM_TYPE = "workItemType"; @SerializedName(SERIALIZED_NAME_WORK_ITEM_TYPE) private String workItemType; public AccountRecentActivityWorkItemModel2 assignedTo(IdentityRef assignedTo) { this.assignedTo = assignedTo; return this; } /** * Get assignedTo * @return assignedTo **/ @javax.annotation.Nullable @ApiModelProperty(value = "") public IdentityRef getAssignedTo() { return assignedTo; } public void setAssignedTo(IdentityRef assignedTo) { this.assignedTo = assignedTo; } public AccountRecentActivityWorkItemModel2 activityDate(OffsetDateTime activityDate) { this.activityDate = activityDate; return this; } /** * Date of the last Activity by the user * @return activityDate **/ @javax.annotation.Nullable @ApiModelProperty(value = "Date of the last Activity by the user") public OffsetDateTime getActivityDate() { return activityDate; } public void setActivityDate(OffsetDateTime activityDate) { this.activityDate = activityDate; } public AccountRecentActivityWorkItemModel2 activityType(ActivityTypeEnum activityType) { this.activityType = activityType; return this; } /** * Type of the activity * @return activityType **/ @javax.annotation.Nullable @ApiModelProperty(value = "Type of the activity") public ActivityTypeEnum getActivityType() { return activityType; } public void setActivityType(ActivityTypeEnum activityType) { this.activityType = activityType; } public AccountRecentActivityWorkItemModel2 changedDate(OffsetDateTime changedDate) { this.changedDate = changedDate; return this; } /** * Last changed date of the work item * @return changedDate **/ @javax.annotation.Nullable @ApiModelProperty(value = "Last changed date of the work item") public OffsetDateTime getChangedDate() { return changedDate; } public void setChangedDate(OffsetDateTime changedDate) { this.changedDate = changedDate; } public AccountRecentActivityWorkItemModel2 id(Integer id) { this.id = id; return this; } /** * Work Item Id * @return id **/ @javax.annotation.Nullable @ApiModelProperty(value = "Work Item Id") public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public AccountRecentActivityWorkItemModel2 identityId(UUID identityId) { this.identityId = identityId; return this; } /** * TeamFoundationId of the user this activity belongs to * @return identityId **/ @javax.annotation.Nullable @ApiModelProperty(value = "TeamFoundationId of the user this activity belongs to") public UUID getIdentityId() { return identityId; } public void setIdentityId(UUID identityId) { this.identityId = identityId; } public AccountRecentActivityWorkItemModel2 state(String state) { this.state = state; return this; } /** * State of the work item * @return state **/ @javax.annotation.Nullable @ApiModelProperty(value = "State of the work item") public String getState() { return state; } public void setState(String state) { this.state = state; } public AccountRecentActivityWorkItemModel2 teamProject(String teamProject) { this.teamProject = teamProject; return this; } /** * Team project the work item belongs to * @return teamProject **/ @javax.annotation.Nullable @ApiModelProperty(value = "Team project the work item belongs to") public String getTeamProject() { return teamProject; } public void setTeamProject(String teamProject) { this.teamProject = teamProject; } public AccountRecentActivityWorkItemModel2 title(String title) { this.title = title; return this; } /** * Title of the work item * @return title **/ @javax.annotation.Nullable @ApiModelProperty(value = "Title of the work item") public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public AccountRecentActivityWorkItemModel2 workItemType(String workItemType) { this.workItemType = workItemType; return this; } /** * Type of Work Item * @return workItemType **/ @javax.annotation.Nullable @ApiModelProperty(value = "Type of Work Item") public String getWorkItemType() { return workItemType; } public void setWorkItemType(String workItemType) { this.workItemType = workItemType; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AccountRecentActivityWorkItemModel2 accountRecentActivityWorkItemModel2 = (AccountRecentActivityWorkItemModel2) o; return Objects.equals(this.assignedTo, accountRecentActivityWorkItemModel2.assignedTo) && Objects.equals(this.activityDate, accountRecentActivityWorkItemModel2.activityDate) && Objects.equals(this.activityType, accountRecentActivityWorkItemModel2.activityType) && Objects.equals(this.changedDate, accountRecentActivityWorkItemModel2.changedDate) && Objects.equals(this.id, accountRecentActivityWorkItemModel2.id) && Objects.equals(this.identityId, accountRecentActivityWorkItemModel2.identityId) && Objects.equals(this.state, accountRecentActivityWorkItemModel2.state) && Objects.equals(this.teamProject, accountRecentActivityWorkItemModel2.teamProject) && Objects.equals(this.title, accountRecentActivityWorkItemModel2.title) && Objects.equals(this.workItemType, accountRecentActivityWorkItemModel2.workItemType); } @Override public int hashCode() { return Objects.hash(assignedTo, activityDate, activityType, changedDate, id, identityId, state, teamProject, title, workItemType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class AccountRecentActivityWorkItemModel2 {\n"); sb.append(" assignedTo: ").append(toIndentedString(assignedTo)).append("\n"); sb.append(" activityDate: ").append(toIndentedString(activityDate)).append("\n"); sb.append(" activityType: ").append(toIndentedString(activityType)).append("\n"); sb.append(" changedDate: ").append(toIndentedString(changedDate)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" identityId: ").append(toIndentedString(identityId)).append("\n"); sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" teamProject: ").append(toIndentedString(teamProject)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" workItemType: ").append(toIndentedString(workItemType)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "Thomas.Worm@Studium.FernUni-Hagen.de" ]
Thomas.Worm@Studium.FernUni-Hagen.de
4e1b4ebfee361ecf3d9ce87b77d40f9ab2cbb8c5
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/15/15_f62f8277c2abbfe2b95ca05e3d0c8259a1c5322f/LogEntry/15_f62f8277c2abbfe2b95ca05e3d0c8259a1c5322f_LogEntry_t.java
d114103475fcf5fbe40c751bf0b489c1350be7bd
[]
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
6,518
java
package main; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import GUI.Driver; import com.mongodb.BasicDBList; import com.mongodb.BasicDBObject; import com.mongodb.DB; import com.mongodb.DBCollection; import com.mongodb.DBCursor; import com.mongodb.DBObject; public class LogEntry { private int ID; private String cwid; private User user; private ArrayList<Machine> machinesUsed; private ArrayList<Tool> toolsCheckedOut; private Date timeOut; private Date timeIn; private ArrayList<Tool> toolsReturned; private Calendar calendar; private DB database; public LogEntry() { calendar = Calendar.getInstance(); timeOut = null; database = Driver.getAccessTracker().getDatabase(); } public LogEntry(int iD, String cwid, ArrayList<Machine> machinesUsed, ArrayList<Tool> toolsCheckedOut, Date timeOut, Date timeIn, ArrayList<Tool> toolsReturned) { super(); ID = iD; this.cwid = cwid; this.machinesUsed = machinesUsed; this.toolsCheckedOut = toolsCheckedOut; this.timeOut = timeOut; this.timeIn = timeIn; this.toolsReturned = toolsReturned; calendar = Calendar.getInstance(); database = Driver.getAccessTracker().getDatabase(); } // FOR TESTING PURPOSES ONLY public void startEntry(User user, ArrayList<Machine> machinesUsed, ArrayList<Tool> toolsCheckedOut, ArrayList<Tool> toolsReturned) { // AUTO-GENERATE ID this.ID = Log.getNumEntries(); this.timeIn = calendar.getTime(); this.user = user; cwid = user.getCWID(); this.machinesUsed = new ArrayList<Machine>(); this.toolsCheckedOut = new ArrayList<Tool>(); this.toolsReturned = new ArrayList<Tool>(); Log.incrementNumEntries(); user.setCurrentEntry(this); BasicDBObject logEntry = new BasicDBObject(); logEntry.put("ID", ID); logEntry.put("timeIn", timeIn); logEntry.put("userCWID", user.getCWID()); DBCollection logEntries = database.getCollection("LogEntries"); logEntries.insert(logEntry); addMachinesUsed(machinesUsed); addToolsCheckedOut(toolsCheckedOut); addToolsReturned(toolsReturned); } public void startEntry(User user) { // AUTO-GENERATE ID this.ID = Log.getNumEntries(); this.timeIn = calendar.getTime(); this.user = user; cwid = user.getCWID(); this.machinesUsed = new ArrayList<Machine>(); this.toolsCheckedOut = new ArrayList<Tool>(); this.toolsReturned = new ArrayList<Tool>(); Log.incrementNumEntries(); this.user.setCurrentEntry(this); BasicDBObject logEntry = new BasicDBObject(); logEntry.put("ID", ID); logEntry.put("timeIn", timeIn); logEntry.put("userCWID", user.getCWID()); DBCollection logEntries = database.getCollection("LogEntries"); logEntries.insert(logEntry); } public String getCwid() { return cwid; } public void addMachinesUsed(ArrayList<Machine> used) { for (Machine m : used){ machinesUsed.add(m); } DBCollection logEntries = database.getCollection("LogEntries"); DBCursor cursor = logEntries.find(new BasicDBObject("ID", ID)); DBObject result = cursor.next(); BasicDBList machines = new BasicDBList(); for(Machine m : machinesUsed) { machines.add(new BasicDBObject("id", m.getID())); } result.put("machinesUsed", machines); logEntries.update(new BasicDBObject("ID", ID), result); } public void addToolsCheckedOut(ArrayList<Tool> checkedOut) { for (Tool t : checkedOut){ toolsCheckedOut.add(t); } DBCollection logEntries = database.getCollection("LogEntries"); DBCursor cursor = logEntries.find(new BasicDBObject("ID", ID)); DBObject result = cursor.next(); BasicDBList tools = new BasicDBList(); for(Tool t : toolsCheckedOut) { tools.add(new BasicDBObject("upc", t.getUPC())); } result.put("toolsCheckedOut", tools); logEntries.update(new BasicDBObject("ID", ID), result); } public void addToolsReturned( ArrayList<Tool> returned) { for (Tool t : returned){ toolsReturned.add(t); } DBCollection logEntries = database.getCollection("LogEntries"); DBCursor cursor = logEntries.find(new BasicDBObject("ID", ID)); DBObject result = cursor.next(); BasicDBList tools = new BasicDBList(); for(Tool t : toolsReturned) { tools.add(new BasicDBObject("upc", t.getUPC())); } result.put("toolsReturned", tools); logEntries.update(new BasicDBObject("ID", ID), result); } public void finishEntry() { this.timeOut = Calendar.getInstance().getTime(); DBCollection logEntries = database.getCollection("LogEntries"); DBCursor cursor = logEntries.find(new BasicDBObject("ID", ID)); DBObject result = cursor.next(); result.put("timeOut", timeOut); logEntries.update(new BasicDBObject("ID", ID), result); } public Date getTimeIn() { return timeIn; } public Date getTimeOut() { return timeOut; } public void setTimeOut(Date timeOut) { this.timeOut = timeOut; } @Override public boolean equals(Object o) { if (!(o instanceof LogEntry)) return false; LogEntry obj = (LogEntry) o; return (this.ID == obj.getID()); } public int getID() { return ID; } public void print() { System.out.println("Log Entry: " + ID); System.out.println("User: " + user); System.out.println("Time In: " + timeIn); System.out.println("Time Out: " + timeOut); System.out.println("Machines Used: " + machinesUsed); System.out.println("Tools Checked Out: " + toolsCheckedOut); System.out.println("Tools Returned: " + toolsReturned); } public User getUser() { return user; } public ArrayList<Machine> getMachinesUsed() { return machinesUsed; } public ArrayList<Tool> getToolsCheckedOut() { return toolsCheckedOut; } public ArrayList<Tool> getToolsReturned() { return toolsReturned; } public String toString() { return String.format("%5d%20s%30s%30s%30s%30s%30s", ID, user, timeIn, timeOut, machinesUsed, toolsCheckedOut, toolsReturned); } public void printTable() { System.out.format("%5d%20s%30s%30s%30s%30s%30s", ID, user, timeIn, timeOut, machinesUsed, toolsCheckedOut, toolsReturned); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
dd25887830ac1654d4e6eca97ebed058de60c241
434d770864339f31101bf0206bbbb69220f59c14
/BootMysqlSwaggerMockito-1/src/main/java/com/example/demo/controller/EmployeeController.java
50c27f73cfd15faa441b0a298d5047ed5bdfba61
[]
no_license
Shbhitraj/SpringBootRestServecies
c83e335e29ec7772c80e07f902655eef5af29a86
5acaea7f4e37a507ff2f467e30b7b77efb934a19
refs/heads/master
2022-12-24T12:03:08.427071
2020-10-12T17:00:38
2020-10-12T17:00:38
303,455,585
0
0
null
null
null
null
UTF-8
Java
false
false
1,700
java
package com.example.demo.controller; import java.util.List; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.example.demo.daoimpl.EmployeeDaoImpl; import com.example.demo.model.Employee; @RestController @RequestMapping("/emp") public class EmployeeController { @Autowired private EmployeeDaoImpl impl; @PostMapping("/save") public ResponseEntity<String> saveData(@RequestBody Employee employee) { ResponseEntity<String> resp = null; try { Integer id = impl.saveData(employee); resp = new ResponseEntity<String>(id + "saved", HttpStatus.OK); } catch (Exception e) { resp = new ResponseEntity<String>("Unable To Save The Data", HttpStatus.INTERNAL_SERVER_ERROR); e.printStackTrace(); } return resp; } @GetMapping("/all") public List<Employee> GetAll() { return impl.getAll(); } @GetMapping("/get") public String getData() { return "registrtion"; } @GetMapping("/jsp") public String getHomeJspPage() { return "<h1>home</h1>"; } @GetMapping("/one/{id}") public Optional<Employee> ById(Integer id) { return impl.fetchById(id); } // public ResponseEntity<String> generateTokens() { // // return ResponseEntity<String>.ok() // } }
[ "Shobhit@DESKTOP-8CRIC4B" ]
Shobhit@DESKTOP-8CRIC4B
1c9803338abed8edcf39f42170a84b16609aa1d0
bf14561400dd3ead5213dd2729eae67e008d41ad
/src/main/java/org/springframework/ioc/enjoy/cap9/bean/Light.java
d3f866e11f265c6a49e78b4de057f2fbd3a39d8f
[]
no_license
masterzz/spring-mvc-showcase
fc288dab99dbe4f01849a17760c43a40784256a4
82190883fa28192220264c89106107192c236bdd
refs/heads/master
2020-03-16T00:08:21.733317
2020-01-29T10:59:06
2020-01-29T10:59:06
132,408,562
0
0
null
2018-05-07T04:51:02
2018-05-07T04:51:02
null
UTF-8
Java
false
false
1,217
java
package org.springframework.ioc.enjoy.cap9.bean; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanNameAware; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.context.EmbeddedValueResolverAware; import org.springframework.stereotype.Component; import org.springframework.util.StringValueResolver; //ๅฎž็Žฐ BeanNameAware ไธŽ ApplicationContextAwareๆŽฅๅฃ @Component public class Light implements ApplicationContextAware, BeanNameAware, EmbeddedValueResolverAware { private ApplicationContext applicationContext; @Override public void setBeanName(String name) { System.out.println("ๅฝ“ๅ‰bean็š„ๅๅญ—:"+name); } @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { System.out.println("ไผ ๅ…ฅ็š„IOCๅฎนๅ™จ: "+applicationContext); this.applicationContext = applicationContext; } @Override public void setEmbeddedValueResolver(StringValueResolver resolver) { String result = resolver.resolveStringValue("ไฝ ๅฅฝ${os.name}, ่ฎก็ฎ—#{3*8}"); System.out.println("่งฃๆž็š„ๅญ—็ฌฆไธฒไธบ---"+result); } }
[ "545724476@qq.com" ]
545724476@qq.com
e7d630dc60d46e20dd0bdc0299619f01f85121bb
4ae0f956f1b3d33de0d31147ba876f4eebfad249
/.svn/pristine/e7/e7d630dc60d46e20dd0bdc0299619f01f85121bb.svn-base
52ce34576cb26167defd3ef328b2e50b9666a498
[ "Apache-2.0" ]
permissive
dongdong-2009/ylxny-zhy
cc0a18637940c3126f317ad15f06f69db06e2648
812be51bac99266bd444d0d3cac71c2d5ff382a5
refs/heads/master
2021-09-23T03:32:49.737554
2018-09-20T10:38:40
2018-09-20T10:38:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,252
package com.zhy.modules.dict.controller; import java.util.Arrays; import java.util.Map; import com.zhy.common.validator.ValidatorUtils; import com.zhy.modules.dict.entity.LineEntity; import org.apache.shiro.authz.annotation.RequiresPermissions; 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.zhy.modules.dict.service.LineService; import com.zhy.common.utils.PageUtils; import com.zhy.common.utils.R; /** * ๅ›ž่ทฏๅˆ—่กจ * * @author xtp * @email xtp1211@163.com * @date 2018-09-12 15:04:39 */ @RestController @RequestMapping("dict/line") public class LineController { @Autowired private LineService lineService; /** * ๅˆ—่กจ */ @RequestMapping("/list") @RequiresPermissions("dict:line:list") public R list(@RequestParam Map<String, Object> params){ PageUtils page = lineService.queryPage(params); return R.ok().put("page", page); } /** * ไฟกๆฏ */ @RequestMapping("/info/{id}") @RequiresPermissions("dict:line:info") public R info(@PathVariable("id") Long id){ LineEntity line = lineService.selectById(id); return R.ok().put("line", line); } /** * ไฟๅญ˜ */ @RequestMapping("/save") @RequiresPermissions("dict:line:save") public R save(@RequestBody LineEntity line){ lineService.insert(line); return R.ok(); } /** * ไฟฎๆ”น */ @RequestMapping("/update") @RequiresPermissions("dict:line:update") public R update(@RequestBody LineEntity line){ ValidatorUtils.validateEntity(line); lineService.updateAllColumnById(line);//ๅ…จ้ƒจๆ›ดๆ–ฐ return R.ok(); } /** * ๅˆ ้™ค */ @RequestMapping("/delete") @RequiresPermissions("dict:line:delete") public R delete(@RequestBody Long[] ids){ lineService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } }
[ "zengqiang724@163.com" ]
zengqiang724@163.com
79c20bfc39dbe111350e6142893d03cca239943b
c704bc72e21b3d2e6f3a9d4db21eaa4be41ad0b6
/consultacliente-web/src/main/java/com/bnpparibas/cardif/lam/schema/lifecycle/event/v1/ObjectFactory.java
0575058424af0a032ff8993ee2f185cdc24820bb
[]
no_license
alvaroquimbaya-strailsas-com/consultacliente-parent
74297c3a09339c18fb82ed1225621bd87f69b0c9
fed74797e7aeb924a424d2c6c58b19fb7a5f4c65
refs/heads/master
2020-12-25T11:05:37.899462
2016-07-07T22:15:25
2016-07-07T22:15:25
62,569,377
0
0
null
null
null
null
UTF-8
Java
false
false
1,755
java
package com.bnpparibas.cardif.lam.schema.lifecycle.event.v1; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the com.bnpparibas.cardif.lam.schema.lifecycle.event.v1 package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { private final static QName _Event_QNAME = new QName("http://cardif.bnpparibas.com/lam/schema/lifecycle/event/v1", "event"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.bnpparibas.cardif.lam.schema.lifecycle.event.v1 * */ public ObjectFactory() { } /** * Create an instance of {@link EventType } * */ public EventType createEventType() { return new EventType(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link EventType }{@code >}} * */ @XmlElementDecl(namespace = "http://cardif.bnpparibas.com/lam/schema/lifecycle/event/v1", name = "event") public JAXBElement<EventType> createEvent(EventType value) { return new JAXBElement<EventType>(_Event_QNAME, EventType.class, null, value); } }
[ "alvaroquimbaya@strailsas.com" ]
alvaroquimbaya@strailsas.com
e72c560bc3edd1ac07d6fe167a219be88e324f72
4fb375e9ccf2cb8b8db4f8ba6ab52e174d8206ab
/src/test/AbstractStockTest.java
63ddb5300b73f27177c4345b6dd3df3d14e3955d
[]
no_license
JimmuTenno/simpleStock
16438f29155061fb273484b7638308aa5d19b21c
708d03a3f7c97485ddab8ef8446eab30c8aaf99f
refs/heads/master
2016-09-03T07:37:14.457701
2015-08-12T21:42:47
2015-08-12T21:42:47
40,625,003
0
0
null
null
null
null
UTF-8
Java
false
false
1,891
java
package test; import java.util.LinkedList; import market.Index; import market.Stock; import market.StockExchange; import org.junit.Before; import quantity.Penny; import quantity.Quantity; import baseClasses.Fraction; import trading.Order; import trading.Trade; import constants.StockSymbols; import constants.StringConstants; /** * Initializing some basic values for the tests * @author domme * */ public class AbstractStockTest { protected StockExchange stockExchange; protected Stock gin; protected Stock tea; protected Stock pop; protected Stock ale; protected Stock joe; protected Index gbce; protected LinkedList<Trade> trades; @Before public void init() { stockExchange = new StockExchange(); trades = new LinkedList<Trade>(); tea = Stock.createNewCommonStock(StockSymbols.TEA, new Quantity(Fraction.parse("100"), Penny.getInstance())); Quantity quan1 = new Quantity(Fraction.parse("0"), Penny.getInstance()); tea.setDividend(quan1); pop = Stock.createNewCommonStock(StockSymbols.POP, new Quantity(Fraction.parse("100"), Penny.getInstance())); quan1 = new Quantity(Fraction.parse("8"), Penny.getInstance()); pop.setDividend(quan1); ale = Stock.createNewCommonStock(StockSymbols.ALE, new Quantity(Fraction.parse("60"), Penny.getInstance())); quan1 = new Quantity(Fraction.parse("23"), Penny.getInstance()); ale.setDividend(quan1); joe = Stock.createNewCommonStock(StockSymbols.JOE, new Quantity(Fraction.parse("250"), Penny.getInstance())); quan1 = new Quantity(Fraction.parse("13"), Penny.getInstance()); joe.setDividend(quan1); gin = Stock.createNewPreferredStock(StockSymbols.GIN, Fraction.parse("0.02"), new Quantity(Fraction.parse("100"), Penny.getInstance())); quan1 = new Quantity(Fraction.parse("8"), Penny.getInstance()); gin.setDividend(quan1); gbce = new Index(StringConstants.GBCE); } }
[ "dorademacher@gmx.net" ]
dorademacher@gmx.net
889d1191a53cfad311c5c5241248f89781bbe301
967e4a4fa33751b07f896352383b9c86e7fc0cf3
/newspro/src/test/java/com/java/base/thread/ThreadMain.java
6c907327805e06ab99675130b30dfd62bb2b81f6
[]
no_license
Gwntl/spring-web
a717af1656f8209ea8ec6f8a62200b8cc77d46e6
127c9c83865cbb75e124b733a282b3b6d17fe1a5
refs/heads/master
2022-12-22T02:33:19.273883
2022-11-19T16:52:33
2022-11-19T16:52:33
201,454,639
0
0
null
2022-12-16T11:35:02
2019-08-09T11:28:14
HTML
UTF-8
Java
false
false
2,370
java
package com.java.base.thread; import java.util.Date; import java.util.concurrent.TimeUnit; import org.mine.aplt.util.CommonUtils; import org.slf4j.MDC; public class ThreadMain { private static volatile boolean exitFlag = false; private static Object obj = new Object(); public static void main(String[] args) { // Service service = new Service(); // // ThreadA a = new ThreadA(service); // ThreadB b = new ThreadB(service); // new Thread(a).start(); // new Thread(b).start(); // System.out.println(Integer.MAX_VALUE >> 16); MDC.put("trade", "Y_TE"); try{ Thread thread = new Thread(){ @Override public void run() { super.run(); int i = 0; while(!isInterrupted()){ try{ System.out.println(i++); TimeUnit.SECONDS.sleep(2); }catch(InterruptedException e){ System.out.println("็ณŸไบ†,็ก็€ไบ†"); interrupt(); break; } } // try { // TimeUnit.SECONDS.sleep(10); // System.out.println(CommonUtils.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ": " + Thread.currentThread().getName() + "ๆ‰ง่กŒๅฎŒๆˆ-----"); // } catch (InterruptedException e) { // // TODO: handle exception // } } }; Thread aa = new Thread(new ThreadAA(thread)); thread.start(); aa.start(); TimeUnit.SECONDS.sleep(5); System.out.println(CommonUtils.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ": " + "thread็ญ‰ๅพ…ไธญ....."); synchronized (thread) { thread.wait(); } TimeUnit.SECONDS.sleep(3); System.out.println(CommonUtils.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ": " + "thread่ขซๅ”ค้†’ไบ†....."); // System.out.println("sleep็ป“ๆŸ,็ญ‰ๅพ…็บฟ็จ‹ๅฎŒๆˆไธญ......."); // thread.join(); // System.out.println(CommonUtils.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + ": " + Thread.currentThread().getName() + "ๆ‰ง่กŒๅฎŒๆˆ-----"); thread.interrupt(); }catch(InterruptedException e){ e.printStackTrace(); } } public static class ThreadAA implements Runnable{ Thread thread; public ThreadAA(Thread thread) { this.thread = thread; } @Override public void run() { try{ TimeUnit.SECONDS.sleep(10); System.out.println("------"); synchronized (thread) { thread.notifyAll(); } } catch(InterruptedException e){ e.printStackTrace(); } } } }
[ "1536183348@qq.com" ]
1536183348@qq.com
7414ae591ad541fd3dc41dc6cb08b85710dfac37
e720d874794761a53a2c3bbd3a4ea7a2189b6f27
/app/src/main/java/com/diandianguanjia/newrecycledemo3/adapter/TypeCategoryAdapter.java
b844f5f8e703e93b891c25235c4b2b5c0d11ae3c
[ "Apache-2.0" ]
permissive
caichengan/NewRecycleDemo3
753847e7f9cf718ecacc4a0321f3ef90fd53ac4b
861d98089fa5b9845d4e400b8f984e3423d7c7f2
refs/heads/master
2021-09-16T11:07:42.313459
2018-06-20T02:23:17
2018-06-20T02:23:17
103,505,391
1
0
null
null
null
null
UTF-8
Java
false
false
1,932
java
package com.diandianguanjia.newrecycledemo3.adapter; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.diandianguanjia.newrecycledemo3.R; import com.diandianguanjia.newrecycledemo3.mode.HomeCategory; import com.diandianguanjia.newrecycledemo3.view.AsImageTextView; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; /** * Created by 666 on 2017/1/3. * ้ฆ–้กตๅˆ†็ฑป */ public class TypeCategoryAdapter extends RecyclerView.Adapter<TypeCategoryAdapter.TypetypeHolder> { private Context mContext; private List<HomeCategory> mHomeCategory; private LayoutInflater inflater; public TypeCategoryAdapter(Context mContext, List<HomeCategory> mHomeCategory) { this.mContext = mContext; this.mHomeCategory = mHomeCategory; inflater = LayoutInflater.from(mContext); } @Override public TypetypeHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new TypetypeHolder(inflater.inflate(R.layout.item_homepageradapter_ivtv, null)); } @Override public void onBindViewHolder(TypetypeHolder holder, int position) { HomeCategory homeCategory = mHomeCategory.get(position); holder.asivtvHomepageradapter.setTvImagetext(homeCategory.getTypename()); holder.asivtvHomepageradapter.setIvImagetext(homeCategory.getImageid()); } @Override public int getItemCount() { return mHomeCategory == null ? 0 : mHomeCategory.size(); } //ไธญ้—ด็š„ๅ››ไธชtype public class TypetypeHolder extends RecyclerView.ViewHolder { @BindView(R.id.asivtv_homepageradapter) AsImageTextView asivtvHomepageradapter; public TypetypeHolder(View view) { super(view); ButterKnife.bind(this, view); } } }
[ "13531829360@163.com" ]
13531829360@163.com
7dc6d87ac3a1424eb78bfc425b226f1f17d62530
c1b0a2d9b47262cfe115172230503fa75a5f0068
/chp04/RunTreeMap.java
548f43f947ad55ca4d7a28e98e2416202186900c
[]
no_license
jailani-pb/NS4306-NWS01
a9f2e538ac8acf74efb0acf073d2b18ae2372423
37fb0bfa1d9ad970f61cc557b2dabe0315c183cf
refs/heads/master
2021-11-28T22:04:07.215956
2017-04-18T08:04:31
2017-04-18T08:04:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,128
java
package chp04; import java.util.TreeMap; public class RunTreeMap { public static void main(String[] args) { TreeMap<String, String> capitalList = new TreeMap<String, String>(); //Add element into TreeMap capitalList.put("Brunei", "Bandar Seri Begawan"); capitalList.put("Singapore", "Singapore City"); capitalList.put("Indonesia", "Jakarta"); capitalList.put("Malaysia", "Kuala Lumpur"); capitalList.put("Thailand", "Bangkok"); capitalList.put("Brunei", "Bangar"); System.out.println("(1) " + capitalList); //Remove element from TreeMap System.out.println("Removed: " + capitalList.remove("Brunei")); System.out.println("(2) " + capitalList); //Retrieve element from TreeMap System.out.println("Retrieved: " + capitalList.get("Thailand")); //Retrieve all keys from TreeMap System.out.println("Available Keys: " + capitalList.keySet()); //Retrieve all values from TreeMap System.out.println("Available Values: " + capitalList.values()); for(String country : capitalList.keySet()) { System.out.println("Country: " + country + ", Capital: " + capitalList.get(country)); } } }
[ "jailani.har@googlemail.com" ]
jailani.har@googlemail.com
ae69093fd8f293ddbabfbf0f14f44427cd887fe9
9efff28b6d9b249d1d70eb580ca1e3ba898c1ea4
/p1/src/main/java/com/yst/model/SysUserModel.java
91e26eae8ab6195e8f5aedff2df780431715bd9b
[]
no_license
yanshuantao/p1
4193515e1a25e9ab68ef473017ba2d40681aadfc
bc097201235edcfbd47dbf2e1d8894a7ff0be2c0
refs/heads/master
2019-05-14T18:24:17.379303
2017-10-20T05:08:35
2017-10-20T05:08:35
64,853,147
0
0
null
null
null
null
UTF-8
Java
false
false
580
java
package com.yst.model; import java.util.List; import com.yst.dto.SysModule; import com.yst.dto.SysUser; public class SysUserModel { //็”จๆˆทๅŸบๆœฌไฟกๆฏ private SysUser userInfo; //็”จๆˆท็š„่œๅ•ไฟกๆฏ private List<SysModule> moduleList; public SysUser getUserInfo() { return userInfo; } public void setUserInfo(SysUser userInfo) { this.userInfo = userInfo; } public List<SysModule> getModuleList() { return moduleList; } public void setModuleList(List<SysModule> moduleList) { this.moduleList = moduleList; } }
[ "447268487@qq.com" ]
447268487@qq.com
a12660c04285be48355fb676f32ab3f17cd728fc
b08aa50fd6fd078842eba95e46e1e2ba67a3da22
/app/src/main/java/com/didanadha/miripnike/Adapter/Holder.java
1f44ec1f4d5b1213c1ecc0bbc1dc1be7068b371a
[]
no_license
DidanAdha/WorkOutVideo
6ec15abb103d3d3986a4d8ac3777733d80f6eb5e
b83ac666cd1a916aad98264a9b17e66aed746a22
refs/heads/master
2020-04-26T09:23:51.533278
2019-03-19T06:53:56
2019-03-19T06:53:56
173,453,891
0
0
null
null
null
null
UTF-8
Java
false
false
669
java
package com.didanadha.miripnike.Adapter; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.ImageView; import android.widget.ProgressBar; import android.widget.SeekBar; import android.widget.TextView; import com.didanadha.miripnike.R; public class Holder extends RecyclerView.ViewHolder { TextView textView,time; public ProgressBar pro; public Holder(@NonNull View itemView) { super(itemView); time = itemView.findViewById(R.id.time); textView = itemView.findViewById(R.id.holder_title); pro = itemView.findViewById(R.id.pro); } }
[ "didanadha99@gmail.com" ]
didanadha99@gmail.com
9b5210dc2b9f03992d271aacc274f95950ade2ab
963c85bd278a2106bdf75cd4276853d51418e35a
/app/src/main/java/com/example/fragmentapp/MainActivity.java
66a1d74ccff203902c4cfc150a68e7d512fb3d2f
[]
no_license
OkiChandraO/tugaspromob5
5cb44770244b1b1c355e75082baf8ebf5cac9397
9afe11bae888969cb62d13e252a8a0db3408cc07
refs/heads/master
2023-04-22T08:13:35.096382
2021-04-25T16:21:11
2021-04-25T16:21:11
361,466,450
0
0
null
null
null
null
UTF-8
Java
false
false
1,704
java
package com.example.fragmentapp; import androidx.appcompat.app.AppCompatActivity; import android.app.AlertDialog; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity { EditText ID, password; Button login; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ID = (EditText) findViewById(R.id.ID); password = (EditText) findViewById(R.id.password); login = (Button) findViewById(R.id.login); login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String email = ID.getText().toString(); String pass = password.getText().toString(); if (email.equals("Admin") && pass.equals("123456789")) { Toast.makeText(getApplicationContext(), "Login Berhasil", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(MainActivity.this, MainActivity2.class); MainActivity.this.startActivity(intent); finish(); }else { AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setMessage(" ID dan Password Anda Salah").setNegativeButton("Coba Lagi", null).create().show(); ID.setText(""); password.setText(""); } } }); } }
[ "wawanjr44@gmail.com" ]
wawanjr44@gmail.com
8b295a2fe1fa4757b22900eaf29dc43457320cea
d2ed624ba8ad1877697555d4ecd3be064fa95641
/ex1/src/main/java/controller/BalanceController.java
e3b0df3265a960e1c1cc7f464abb9296c9616c1e
[]
no_license
vahidpi/Spring
61f7c295d4fcd1e776bb397860112bc2ea6ed6d8
9f4dcd056f37b8e71414692e6332e40048a00a51
refs/heads/master
2022-07-08T14:11:59.066132
2019-11-11T12:26:53
2019-11-11T12:26:53
139,626,491
0
0
null
2022-07-01T21:29:18
2018-07-03T19:00:52
Java
UTF-8
Java
false
false
1,775
java
package controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import model.Balance; import service.BalanceService; @RestController @RequestMapping("/balances") public class BalanceController { @Autowired BalanceService bs; /*** @RequestMapping("/all") public Hashtable<String, Balance> getAll(){ return bs.getAll(); } @RequestMapping("{id}") public Balance getBalance(@PathVariable("id") String id) { return bs.getBalance(id); } @RequestMapping("/balan") public String calculateBalance(@RequestParam String id,@RequestParam String username) { String output=username.substring(0, 1)+" - "+id; return output; } @RequestMapping("/bala") public Hashtable<String, Balance> calculateBalanceOut(@RequestParam String id,@RequestParam String username) { Hashtable<String, Balance> balances = new Hashtable<String, Balance>(); Balance b = new Balance(); b.setId(id); b.setUserName(username); b.setBalance(Integer.toString(Integer.parseInt(id)*Integer.parseInt(id))); b.setCurrency(username.substring(0, 1)); balances.put("1",b); //String output=username.substring(0, 1)+" - "+id; return balances; } ***/ @RequestMapping("/balaa") public Balance calculateBalaaOut(@RequestParam String id,@RequestParam String username) { Balance b = new Balance(id,username); ///b.setId(id); ///b.setUserName(username); ///b.setBalance(Integer.toString(Integer.parseInt(id)*Integer.parseInt(id))); ///b.setCurrency(username.substring(0, 1)); //String output=username.substring(0, 1)+" - "+id; return b; } }
[ "vpiroozbakht@gmail.com" ]
vpiroozbakht@gmail.com
43411f2a23f001b7805ed43cc6af4c23e2d12cb3
9b0e26f27ac431c0a90c8da4790eee077362d767
/app/src/main/java/me/garybaker/foodapp/Post.java
7db5bc11ed42281f516eb756b44be0381b45abb4
[]
no_license
garybaker94/DinnerSorted
e7e121c76c02700eff4b6925f12f7b90530af853
c82908dae686c551a96d555f689423bb1b24275c
refs/heads/master
2022-01-12T23:11:01.666489
2019-05-01T09:18:53
2019-05-01T09:18:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,201
java
package me.garybaker.foodapp; import com.google.firebase.database.Exclude; import com.google.firebase.database.IgnoreExtraProperties; import java.util.HashMap; import java.util.Map; @IgnoreExtraProperties public class Post { public String uid; public String author; public String title; public String imageURI; public String body; public int starCount = 0; public Map<String, Boolean> stars = new HashMap<>(); public Post() { // Default constructor required for calls to DataSnapshot.getValue(Post.class) } public Post(String uid, String author, String uriImage, String title, String body) { this.uid = uid; this.author = author; this.title = title; this.imageURI = uriImage; this.body = body; } @Exclude public Map<String, Object> toMap() { HashMap<String, Object> result = new HashMap<>(); result.put("uid", uid); result.put("author", author); result.put("title", title); result.put("imageURI", imageURI); result.put("body", body); result.put("starCount", starCount); result.put("stars", stars); return result; } }
[ "garybakerdev@gmail.com" ]
garybakerdev@gmail.com
c6f8d82759759cc1e42b669c2866c4d4fee29b60
2c9aa87cfc9b769c15a38b5d1e1be218a089e135
/tests/src/TermTest.java
c93dc52e525b1dddb85b2e441f3f5a6bf5a46c7a
[ "MIT" ]
permissive
glegris/LuaJVM
4aa7888ecefe754952af0f94b2ef6f8a82069033
fbd9b8fc035eb954b1b1dcf2673b38a87e1b4e3a
refs/heads/master
2021-01-15T21:24:09.641312
2014-10-02T13:34:26
2014-10-02T13:34:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
138
java
public class TermTest { public static void main(String[] args) { System.term.write("Terminal testing"); System.term.nextLine(0); } }
[ "gl@eeepc.(none)" ]
gl@eeepc.(none)
4f77c2d8832f189c1ecee7e07e191418b6d73b51
f08737fce4b0b18d12b0d7c1e6dd974f3b0da65c
/app/src/main/java/com/example/koseongmin/parksharing/JoinActivity.java
94d6d39394b0255f5d31c9eb238f86eae021a6f3
[]
no_license
KOSEONGMIN/ParkingLotSharingApp
ae0797f3ff657c127af6c21e2d358168e1cf1180
7e713685c91278fc0d67b496f2b20356ba61817f
refs/heads/master
2023-06-07T19:12:43.898920
2023-06-04T14:42:26
2023-06-04T14:42:26
186,786,049
0
0
null
null
null
null
UTF-8
Java
false
false
4,380
java
package com.example.koseongmin.parksharing; /** *ํšŒ์›๊ฐ€์ž…1 */ import android.content.Intent; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.telephony.PhoneNumberFormattingTextWatcher; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import java.util.regex.Pattern; public class JoinActivity extends AppCompatActivity { EditText idInput, passwordInput, passwordConfirmInput, nameInput, phoneInput; Button preButton, nextButton; final int JOIN2_REQUEST_CODE = 1003; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_join); idInput = (EditText)findViewById(R.id.idInput); passwordInput = (EditText)findViewById(R.id.passwordInput); passwordConfirmInput = (EditText)findViewById(R.id.passwordConfirmInput); nameInput = (EditText)findViewById(R.id.nameInput); phoneInput = (EditText)findViewById(R.id.phoneInput); phoneInput.addTextChangedListener(new PhoneNumberFormattingTextWatcher()); preButton = (Button)findViewById(R.id.preButton); preButton.setOnClickListener(new View.OnClickListener() { //์ด์ „ ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ๋ฉ”์ธํ™”๋ฉด์œผ๋กœ ๋Œ์•„๊ฐ @Override public void onClick(View v) { setResult(RESULT_CANCELED); finish(); } }); nextButton = (Button)findViewById(R.id.nextButton); nextButton.setOnClickListener(new View.OnClickListener() { //๋‹ค์Œ ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ํšŒ์›๊ฐ€์ž…2๋กœ ๋„˜์–ด๊ฐ @Override public void onClick(View v) { if(!android.util.Patterns.EMAIL_ADDRESS.matcher(idInput.getText()).matches()){ //์ด๋ฉ”์ผ ํ˜•์‹ ๊ฒ€์‚ฌ Toast.makeText(getApplicationContext(), "ID๊ฐ€ ์ด๋ฉ”์ผ ํ˜•์‹์ด ์•„๋‹™๋‹ˆ๋‹ค.", Toast.LENGTH_SHORT).show(); }else if(!Pattern.matches("[๊ฐ€-ํžฃ]{2,4}$",nameInput.getText().toString())){ //์ด๋ฆ„ ํ˜•์‹ ๊ฒ€์‚ฌ Toast.makeText(getApplicationContext(), "์ด๋ฆ„์„ ๋‹ค์‹œ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.", Toast.LENGTH_LONG).show(); }else if(!Pattern.matches("^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@$!%*#?&])[A-Za-z\\d$@$!%*#?&]{8,15}$", passwordInput.getText().toString())){ //๋น„๋ฐ€๋ฒˆํ˜ธ ํ˜•์‹๊ฒ€์‚ฌ Toast.makeText(getApplicationContext(), "8~15์ž์˜ ์˜๋ฌธ,์ˆซ์ž,ํŠน์ˆ˜๊ธฐํ˜ธ ์กฐํ•ฉ๋งŒ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.", Toast.LENGTH_LONG).show(); }else if(!passwordInput.getText().toString().equals(passwordConfirmInput.getText().toString())){ //๋น„๋ฐ€๋ฒˆํ˜ธ ์ผ์น˜ ๊ฒ€์‚ฌ Toast.makeText(getApplicationContext(), "๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ์ด ์ผ์น˜ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.", Toast.LENGTH_SHORT).show(); }else if(!Pattern.matches("^010-\\d{4}-\\d{4}$", phoneInput.getText().toString())){ //ํœด๋Œ€ํฐ๋ฒˆํ˜ธ ํ˜•์‹ ๊ฒ€์‚ฌ Toast.makeText(getApplicationContext(), "ํœด๋Œ€ํฐ ๋ฒˆํ˜ธ๋ฅผ ์ •ํ™•ํžˆ ์ž…๋ ฅํ•˜์‹œ์˜ค", Toast.LENGTH_SHORT).show(); }else { Intent intent = new Intent(JoinActivity.this, Join2Activity.class); //ํšŒ์›๊ฐ€์ž…2๋กœ ์ธํ…ํŠธ ์ „๋‹ฌ intent.putExtra("id", idInput.getText().toString()); intent.putExtra("password", passwordInput.getText().toString()); intent.putExtra("name", nameInput.getText().toString()); intent.putExtra("phone", phoneInput.getText().toString()); startActivityForResult(intent, JOIN2_REQUEST_CODE); } } }); } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); switch(requestCode){ case JOIN2_REQUEST_CODE: if(resultCode == RESULT_OK){ //ํšŒ์›๊ฐ€์ž…2 ๋ชจ๋‘ ์™„๋ฃŒ์‹œ ์ฝ”๋“œ //๋ฉ”์ธํ™”๋ฉด์œผ๋กœ ๋ฐ”๋กœ ์ด๋™ finish(); }else if(resultCode == RESULT_CANCELED){ //ํšŒ์›๊ฐ€์ž…2 ์ด์ „ ์‹œ ์ฝ”๋“œ } break; } } }
[ "50089205+jaesungryu96@users.noreply.github.com" ]
50089205+jaesungryu96@users.noreply.github.com
1cde8a47b1efce10f4a1ec5ec5483f4fe8b82c90
4a3ab0ac1d106330c556b80bd012d6648455993f
/kettle-ext/src/main/java/org/flhy/ext/job/JobHopMetaCodec.java
447ab4f3ea155986c1273d79ad8c7e24ca3e7eef
[]
no_license
Maxcj/KettleWeb
2e490e87103d14a069be4f1cf037d11423503d38
75be8f65584fe0880df6f6d637c72bcb1a66c4cd
refs/heads/master
2022-12-21T06:56:34.756989
2022-02-05T03:03:57
2022-02-05T03:03:57
192,645,149
13
10
null
2022-12-16T02:43:00
2019-06-19T02:36:43
JavaScript
UTF-8
Java
false
false
3,955
java
package org.flhy.ext.job; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import org.flhy.ext.core.PropsUI; import org.flhy.ext.utils.JSONArray; import org.flhy.ext.utils.SvgImageUrl; import org.pentaho.di.core.Const; import org.pentaho.di.core.exception.KettleXMLException; import org.pentaho.di.core.xml.XMLHandler; import org.pentaho.di.job.JobHopMeta; import org.pentaho.di.job.JobMeta; import org.pentaho.di.laf.BasePropertyHandler; import org.w3c.dom.DOMException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import com.mxgraph.model.mxCell; import com.mxgraph.util.mxUtils; public class JobHopMetaCodec { public static Element encode(JobHopMeta hop) throws JsonParseException, JsonMappingException, DOMException, IOException { Document doc = mxUtils.createDocument(); Element e = doc.createElement(PropsUI.JOB_HOP); e.setAttribute("from", hop.getFromEntry().getName()); e.setAttribute("from_nr", String.valueOf(hop.getFromEntry().getNr())); if(hop.getToEntry() != null) { e.setAttribute("to", hop.getToEntry().getName()); e.setAttribute("to_nr", String.valueOf(hop.getToEntry().getNr())); } e.setAttribute("enabled", hop.isEnabled() ? "Y" : "N"); e.setAttribute("evaluation", hop.getEvaluation() ? "Y" : "N"); e.setAttribute("unconditional", hop.isUnconditional() ? "Y" : "N"); ArrayList<String> list = new ArrayList<String>(); if(hop.isUnconditional()) list.add(SvgImageUrl.getSmallUrl(BasePropertyHandler.getProperty( "UnconditionalHop_image" ))); else if(hop.getEvaluation()) list.add(SvgImageUrl.getSmallUrl(BasePropertyHandler.getProperty( "True_image" ))); else list.add(SvgImageUrl.getSmallUrl(BasePropertyHandler.getProperty( "False_image" ))); if(hop.getFromEntry().isLaunchingInParallel()) list.add(SvgImageUrl.getSmallUrl(BasePropertyHandler.getProperty( "ParallelHop_image" ))); e.setAttribute("label", JSONArray.fromObject(list).toString()); return e; } public static JobHopMeta decode(JobMeta jobMeta, mxCell cell) throws ParserConfigurationException, SAXException, IOException, KettleXMLException { StringBuilder retval = new StringBuilder(); retval.append( " " ).append( XMLHandler.openTag( "hop" ) ).append( Const.CR ); retval.append( " " ).append( XMLHandler.addTagValue( "from", cell.getAttribute("from") ) ); retval.append( " " ).append( XMLHandler.addTagValue( "to", cell.getAttribute("to") ) ); retval.append( " " ).append( XMLHandler.addTagValue( "from_nr", cell.getAttribute("from_nr") ) ); retval.append( " " ).append( XMLHandler.addTagValue( "to_nr", cell.getAttribute("to_nr") ) ); retval.append( " " ).append( XMLHandler.addTagValue( "enabled", "Y".equalsIgnoreCase(cell.getAttribute("enabled")) ) ); retval.append( " " ).append( XMLHandler.addTagValue( "evaluation", "Y".equalsIgnoreCase(cell.getAttribute("evaluation"))) ); retval.append( " " ).append( XMLHandler.addTagValue( "unconditional", "Y".equalsIgnoreCase(cell.getAttribute("unconditional"))) ); retval.append( " " ).append( XMLHandler.closeTag( "hop" ) ).append( Const.CR ); StringReader sr = new StringReader(retval.toString()); InputSource is = new InputSource(sr); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder=factory.newDocumentBuilder(); Document doc = builder.parse(is); return new JobHopMeta(doc.getDocumentElement(), jobMeta); } }
[ "903283542@qq.com" ]
903283542@qq.com