blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 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 684M ⌀ | 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 132
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 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ae226e4555e78051012e791755ac0577adc7f78d | e83c10eafc0f8e7ecb477771cf5080e6c4dd0020 | /relection_example_1/relection example 1/src/com/avgeeks/reflection/packageB/MyBclassUnMarked.java | a6a85ad96b1a1f641fd747674c60c448c50d7cf2 | [] | no_license | codeScriber/reflectionExamples | 0f2e72c98e3cd3caa9e2afcba345a5e1be8911c7 | 236e5e5de6f84ca9be19551387a320ee08fbf6df | refs/heads/master | 2021-01-23T13:47:56.430002 | 2013-07-06T17:43:00 | 2013-07-06T17:43:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package com.avgeeks.reflection.packageB;
public class MyBclassUnMarked {
public MyBclassUnMarked(){
System.out.println("created class instance of:" + this.getClass().getCanonicalName());
}
}
| [
"eyaltgray@gmail.com"
] | eyaltgray@gmail.com |
dd380682ae705bdf08a3893766b5d0db7477b222 | 8c4a4d3902d860ff698415b936ccbc68188959b1 | /springcloud-02-shopping-orders-provider/src/main/java/com/springcloud/service/OrderDetailsService.java | 0053b6d6b73e2300dc60efadbfa8269029117ce4 | [] | no_license | WZMWY/gmd-shopping | faf00257533936852e707bf997608475175de968 | 4582983e6bdb7ce7efb03af0e1b4bb79b4e7ea6e | refs/heads/master | 2020-06-05T00:54:05.226122 | 2019-06-19T08:50:33 | 2019-06-19T08:50:33 | 192,257,955 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 611 | java | package com.springcloud.service;
import com.github.pagehelper.PageInfo;
import com.springcloud.entity.OrderDetail;
/**
* 订单明细模块的模型层,用于定义订单明细模块的方法
*
* @author ET55
*
*/
public interface OrderDetailsService {
/**
* 查询指定订单编号的订单明细信息(分页功能)
*
* @param orderId 订单编号
* @param pageNumber 页数
* @return 成功返回com.github.pagehelper.PageInfo<OrderDetail>类型的实例
*/
public abstract PageInfo<OrderDetail> selectByOrderId(Integer orderId, Integer pageNumber);
}
| [
"51819674+WZMWY@users.noreply.github.com"
] | 51819674+WZMWY@users.noreply.github.com |
571ffc1755d448ad60081c149aed07a9aeeca8a4 | 893107d6ef33076e9ca90c1c5204f1fad1160169 | /src/com/bridgelabz/library/StdRandom.java | cc7b142b6e5d49ed56022e7c89a8f8014d03a695 | [] | no_license | DeepaliKalagate/Section-B | 03441e9dc9d98d1f606403e4336b665a396a38b3 | b70e10036f1f7bc79916b35a1aceddaa9e23c21a | refs/heads/master | 2020-07-05T07:54:05.669794 | 2019-08-20T21:35:43 | 2019-08-20T21:35:43 | 202,578,682 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,262 | java | package com.bridgelabz.library;
import java.util.Scanner;
import com.bridgelabz.utility.Utility;
public class StdRandom
{
public static void main(String[] args)
{
Scanner scanner=new Scanner(System.in);
System.out.println("Enter number: ");
int n=scanner.nextInt();
if (n == 2)
BLRandom.StdRandom.setSeed(Long.parseLong(args[1]));
double[] probabilities = { 0.5, 0.3, 0.1, 0.1 };
int[] frequencies = { 5, 3, 1, 1 };
String[] a = "A B C D E F G".split(" ");
//System.out.println("seed = " + BLRandom.StdRandom.getSeed());
for (int i = 0; i < n; i++)
{
System.out.printf("%2d ", BLRandom.StdRandom.uniform(100));
System.out.printf("%8.5f ", BLRandom.StdRandom.uniform(10.0, 99.0));
System.out.printf("%5b ", BLRandom.StdRandom.bernoulli(0.5));
System.out.printf("%7.5f ", BLRandom.StdRandom.gaussian(9.0, 0.2));
System.out.printf("%1d ", BLRandom.StdRandom.discrete(probabilities));
BLRandom.StdRandom.shuffle(a);
for (String s : a)
System.out.print(s);
System.out.println();
scanner.close();
}
}
}
| [
"dipakalagate1991@gmail.com"
] | dipakalagate1991@gmail.com |
c452c28f6438d47cda003d4206452a1ea4dee756 | 72430ef66245dc3e07f37acdf2f7ea87c7f47f60 | /Backup/linmodel.model/src/linroad/LinroadPackage.java | 066c5915628c4d3d437e196d30b59d12eb0375ef | [] | no_license | swheen/linroad | af37dccbbdb1d5b01c9c3a27ed235db3b8bdc4c5 | e45c1e5ce456c5dd01ff09087b509d967cb5a3fe | refs/heads/master | 2016-09-08T01:12:58.477116 | 2015-05-18T22:14:29 | 2015-05-18T22:14:29 | 35,844,305 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,135 | java | /**
*/
package linroad;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
/**
* <!-- begin-user-doc -->
* The <b>Package</b> for the model.
* It contains accessors for the meta objects to represent
* <ul>
* <li>each class,</li>
* <li>each feature of each class,</li>
* <li>each operation of each class,</li>
* <li>each enum,</li>
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
* @see linroad.LinroadFactory
* @model kind="package"
* @generated
*/
public interface LinroadPackage extends EPackage {
/**
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNAME = "linroad";
/**
* The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_URI = "linroad.meta";
/**
* The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_PREFIX = "hazi.linroad";
/**
* The singleton instance of the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
LinroadPackage eINSTANCE = linroad.impl.LinroadPackageImpl.init();
/**
* The meta object id for the '{@link linroad.impl.XWayImpl <em>XWay</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.impl.XWayImpl
* @see linroad.impl.LinroadPackageImpl#getXWay()
* @generated
*/
int XWAY = 0;
/**
* The feature id for the '<em><b>New EReference</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int XWAY__NEW_EREFERENCE = 0;
/**
* The feature id for the '<em><b>ID</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int XWAY__ID = 1;
/**
* The number of structural features of the '<em>XWay</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int XWAY_FEATURE_COUNT = 2;
/**
* The number of operations of the '<em>XWay</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int XWAY_OPERATION_COUNT = 0;
/**
* The meta object id for the '{@link linroad.impl.SegmentImpl <em>Segment</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.impl.SegmentImpl
* @see linroad.impl.LinroadPackageImpl#getSegment()
* @generated
*/
int SEGMENT = 1;
/**
* The feature id for the '<em><b>New EReference</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SEGMENT__NEW_EREFERENCE = 0;
/**
* The feature id for the '<em><b>ID</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SEGMENT__ID = 1;
/**
* The number of structural features of the '<em>Segment</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SEGMENT_FEATURE_COUNT = 2;
/**
* The number of operations of the '<em>Segment</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int SEGMENT_OPERATION_COUNT = 0;
/**
* The meta object id for the '{@link linroad.impl.CarImpl <em>Car</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.impl.CarImpl
* @see linroad.impl.LinroadPackageImpl#getCar()
* @generated
*/
int CAR = 2;
/**
* The feature id for the '<em><b>ID</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CAR__ID = 0;
/**
* The feature id for the '<em><b>Direction</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CAR__DIRECTION = 1;
/**
* The feature id for the '<em><b>Line</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CAR__LINE = 2;
/**
* The feature id for the '<em><b>Speed</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CAR__SPEED = 3;
/**
* The number of structural features of the '<em>Car</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CAR_FEATURE_COUNT = 4;
/**
* The number of operations of the '<em>Car</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int CAR_OPERATION_COUNT = 0;
/**
* The meta object id for the '{@link linroad.HeadingDir <em>Heading Dir</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.HeadingDir
* @see linroad.impl.LinroadPackageImpl#getHeadingDir()
* @generated
*/
int HEADING_DIR = 3;
/**
* The meta object id for the '{@link linroad.Line <em>Line</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.Line
* @see linroad.impl.LinroadPackageImpl#getLine()
* @generated
*/
int LINE = 4;
/**
* Returns the meta object for class '{@link linroad.XWay <em>XWay</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>XWay</em>'.
* @see linroad.XWay
* @generated
*/
EClass getXWay();
/**
* Returns the meta object for the containment reference list '{@link linroad.XWay#getNewEReference <em>New EReference</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>New EReference</em>'.
* @see linroad.XWay#getNewEReference()
* @see #getXWay()
* @generated
*/
EReference getXWay_NewEReference();
/**
* Returns the meta object for the attribute '{@link linroad.XWay#getID <em>ID</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>ID</em>'.
* @see linroad.XWay#getID()
* @see #getXWay()
* @generated
*/
EAttribute getXWay_ID();
/**
* Returns the meta object for class '{@link linroad.Segment <em>Segment</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Segment</em>'.
* @see linroad.Segment
* @generated
*/
EClass getSegment();
/**
* Returns the meta object for the containment reference list '{@link linroad.Segment#getNewEReference <em>New EReference</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference list '<em>New EReference</em>'.
* @see linroad.Segment#getNewEReference()
* @see #getSegment()
* @generated
*/
EReference getSegment_NewEReference();
/**
* Returns the meta object for the attribute '{@link linroad.Segment#getID <em>ID</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>ID</em>'.
* @see linroad.Segment#getID()
* @see #getSegment()
* @generated
*/
EAttribute getSegment_ID();
/**
* Returns the meta object for class '{@link linroad.Car <em>Car</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Car</em>'.
* @see linroad.Car
* @generated
*/
EClass getCar();
/**
* Returns the meta object for the attribute '{@link linroad.Car#getID <em>ID</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>ID</em>'.
* @see linroad.Car#getID()
* @see #getCar()
* @generated
*/
EAttribute getCar_ID();
/**
* Returns the meta object for the attribute '{@link linroad.Car#getDirection <em>Direction</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Direction</em>'.
* @see linroad.Car#getDirection()
* @see #getCar()
* @generated
*/
EAttribute getCar_Direction();
/**
* Returns the meta object for the attribute '{@link linroad.Car#getLine <em>Line</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Line</em>'.
* @see linroad.Car#getLine()
* @see #getCar()
* @generated
*/
EAttribute getCar_Line();
/**
* Returns the meta object for the attribute '{@link linroad.Car#getSpeed <em>Speed</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Speed</em>'.
* @see linroad.Car#getSpeed()
* @see #getCar()
* @generated
*/
EAttribute getCar_Speed();
/**
* Returns the meta object for enum '{@link linroad.HeadingDir <em>Heading Dir</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for enum '<em>Heading Dir</em>'.
* @see linroad.HeadingDir
* @generated
*/
EEnum getHeadingDir();
/**
* Returns the meta object for enum '{@link linroad.Line <em>Line</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for enum '<em>Line</em>'.
* @see linroad.Line
* @generated
*/
EEnum getLine();
/**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the factory that creates the instances of the model.
* @generated
*/
LinroadFactory getLinroadFactory();
/**
* <!-- begin-user-doc -->
* Defines literals for the meta objects that represent
* <ul>
* <li>each class,</li>
* <li>each feature of each class,</li>
* <li>each operation of each class,</li>
* <li>each enum,</li>
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
* @generated
*/
interface Literals {
/**
* The meta object literal for the '{@link linroad.impl.XWayImpl <em>XWay</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.impl.XWayImpl
* @see linroad.impl.LinroadPackageImpl#getXWay()
* @generated
*/
EClass XWAY = eINSTANCE.getXWay();
/**
* The meta object literal for the '<em><b>New EReference</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference XWAY__NEW_EREFERENCE = eINSTANCE.getXWay_NewEReference();
/**
* The meta object literal for the '<em><b>ID</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute XWAY__ID = eINSTANCE.getXWay_ID();
/**
* The meta object literal for the '{@link linroad.impl.SegmentImpl <em>Segment</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.impl.SegmentImpl
* @see linroad.impl.LinroadPackageImpl#getSegment()
* @generated
*/
EClass SEGMENT = eINSTANCE.getSegment();
/**
* The meta object literal for the '<em><b>New EReference</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EReference SEGMENT__NEW_EREFERENCE = eINSTANCE.getSegment_NewEReference();
/**
* The meta object literal for the '<em><b>ID</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute SEGMENT__ID = eINSTANCE.getSegment_ID();
/**
* The meta object literal for the '{@link linroad.impl.CarImpl <em>Car</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.impl.CarImpl
* @see linroad.impl.LinroadPackageImpl#getCar()
* @generated
*/
EClass CAR = eINSTANCE.getCar();
/**
* The meta object literal for the '<em><b>ID</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute CAR__ID = eINSTANCE.getCar_ID();
/**
* The meta object literal for the '<em><b>Direction</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute CAR__DIRECTION = eINSTANCE.getCar_Direction();
/**
* The meta object literal for the '<em><b>Line</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute CAR__LINE = eINSTANCE.getCar_Line();
/**
* The meta object literal for the '<em><b>Speed</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
EAttribute CAR__SPEED = eINSTANCE.getCar_Speed();
/**
* The meta object literal for the '{@link linroad.HeadingDir <em>Heading Dir</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.HeadingDir
* @see linroad.impl.LinroadPackageImpl#getHeadingDir()
* @generated
*/
EEnum HEADING_DIR = eINSTANCE.getHeadingDir();
/**
* The meta object literal for the '{@link linroad.Line <em>Line</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see linroad.Line
* @see linroad.impl.LinroadPackageImpl#getLine()
* @generated
*/
EEnum LINE = eINSTANCE.getLine();
}
} //LinroadPackage
| [
"swheen@gmail.com"
] | swheen@gmail.com |
96c5106ccf6c390c5ac1768e9f60ca4088b0228a | 79fe91eec149c256191e6e4ab06d816ea128b53a | /src/main/java/de/heinemann/domain/Match.java | e0684693db34f6c3fa423ac8485ac7aa60007909 | [] | no_license | Pianoking1988/StormpathNFL | d72dbb127bb35098af1d3263613b404c8a7ff755 | 71cb9521d7c4074b74ac76228ed7098734f5b7e2 | refs/heads/master | 2021-01-11T04:55:45.963926 | 2016-12-29T07:23:04 | 2016-12-29T07:23:04 | 77,270,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,440 | java | package de.heinemann.domain;
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.persistence.Transient;
@Entity
@Table(name = "match")
public class Match {
private long id;
private int season;
private int week;
private boolean finished;
private Team homeTeam;
private Team roadTeam;
private int homeScore;
private int roadScore;
private boolean overtime;
public boolean isInvolving(Team team) {
return homeTeam.equals(team) || roadTeam.equals(team);
}
public Record getRecordFor(Team team) {
if (!isInvolving(team) || !isFinished()) {
return new Record();
}
if (isTie()) {
return new Record(0, 0, 1, homeScore, roadScore);
}
return getWinnerTeam().equals(team)
? new Record(1, 0, 0, getWinnerScore(), getLoserScore())
: new Record(0, 1, 0, getLoserScore(), getWinnerScore());
}
@Transient
public Team getWinnerTeam() {
if (isTie() || !isFinished()) {
return null;
}
return homeScore > roadScore ? homeTeam : roadTeam;
}
@Transient
public Team getLoserTeam() {
if (isTie() || !isFinished()) {
return null;
}
return homeScore < roadScore ? homeTeam : roadTeam;
}
@Transient
public int getWinnerScore() {
Team winnerTeam = getWinnerTeam();
if (winnerTeam == null) {
return homeScore;
}
return winnerTeam.equals(homeTeam) ? homeScore : roadScore;
}
@Transient
public int getLoserScore() {
Team loserTeam = getLoserTeam();
if (loserTeam == null) {
return homeScore;
}
return loserTeam.equals(homeTeam) ? homeScore : roadScore;
}
@Transient
public boolean isTie() {
return homeScore == roadScore;
}
public Team getOpponentOf(Team team) {
if (!isInvolving(team)) {
return null;
}
return homeTeam.equals(team) ? roadTeam : homeTeam;
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public int getSeason() {
return season;
}
public void setSeason(int season) {
this.season = season;
}
public int getWeek() {
return week;
}
public void setWeek(int week) {
this.week = week;
}
public boolean isFinished() {
return finished;
}
public void setFinished(boolean finished) {
this.finished = finished;
}
@ManyToOne
@JoinColumn(name = "hometeam")
public Team getHomeTeam() {
return homeTeam;
}
public void setHomeTeam(Team homeTeam) {
this.homeTeam = homeTeam;
}
@ManyToOne
@JoinColumn(name = "roadteam")
public Team getRoadTeam() {
return roadTeam;
}
public void setRoadTeam(Team roadTeam) {
this.roadTeam = roadTeam;
}
@Column(name = "homescore")
public int getHomeScore() {
return homeScore;
}
public void setHomeScore(int homeScore) {
this.homeScore = homeScore;
}
@Column(name = "roadscore")
public int getRoadScore() {
return roadScore;
}
public void setRoadScore(int roadScore) {
this.roadScore = roadScore;
}
public boolean isOvertime() {
return overtime;
}
public void setOvertime(boolean overtime) {
this.overtime = overtime;
}
} | [
"oliver.schmitz.informatik+github@googlemail.com"
] | oliver.schmitz.informatik+github@googlemail.com |
834989cea434f96216c661de1ad4251d0ea648b3 | 0802d3c82fc9db72abb6d233ff4da432b5ac4bd6 | /app/src/main/java/ehu/isad/controllers/db/DBKudeatzaileMySQL.java | a208d71fbd6dc5a3fa3f0a418a23df5e43a4af7a | [] | no_license | JulenGom/Oinarria | 840bb3ba1607ad323be8895434ed430d6732098f | 788145b015b4d73fdd363e008b70caa13987c68c | refs/heads/main | 2023-05-29T16:17:58.372652 | 2021-01-03T19:46:23 | 2021-01-03T19:46:23 | 376,569,338 | 0 | 0 | null | 2021-06-13T14:52:56 | 2021-06-13T14:52:56 | null | UTF-8 | Java | false | false | 2,147 | java | package ehu.isad.controllers.db;
import ehu.isad.utils.Utils;
import java.lang.reflect.InvocationTargetException;
import java.sql.*;
import java.util.Properties;
public class DBKudeatzaileMySQL {
Connection conn = null;
private void conOpen() {
Properties properties = Utils.lortuEzarpenak();
try {
Class.forName("com.mysql.cj.jdbc.Driver").getConstructor().newInstance();
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/", properties);
conn.setCatalog(properties.getProperty("dbname"));
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
} catch (ClassNotFoundException | InvocationTargetException | IllegalAccessException | InstantiationException | NoSuchMethodException e) {
e.printStackTrace();
}
}
private ResultSet query(Statement s, String query) {
ResultSet rs = null;
try {
s.executeQuery(query);
rs = s.getResultSet();
} catch (SQLException e) {
e.printStackTrace();
}
return rs;
}
// singleton patroia
private static DBKudeatzaileMySQL instantzia = new DBKudeatzaileMySQL();
private DBKudeatzaileMySQL() {
this.conOpen();
}
public static DBKudeatzaileMySQL getInstantzia() {
return instantzia;
}
public ResultSet execSQL(String query) {
int count = 0;
Statement s = null;
ResultSet rs = null;
try {
s = (Statement) conn.createStatement();
if (query.toLowerCase().indexOf("select") == 0) {
// select agindu bat
rs = this.query(s, query);
} else {
// update, delete, create agindu bat
count = s.executeUpdate(query);
}
} catch (SQLException e) {
e.printStackTrace();
}
return rs;
}
}
| [
"emmamanna00@gmail.com"
] | emmamanna00@gmail.com |
2d600090969a61b5694a93d42d48f1d580c0e788 | d0c977aa046765b6b5a7126b3801087f35f8206d | /petweb/src/main/java/com/onedob/util/push/XiaoMiPushHelper.java | dce22ab9b147f066cdb272e6145866fe9fd1ad16 | [] | no_license | huangchanghuan/onedob | 62721060ebd7cad832d8ecfe08c75ae478d6e940 | 72d2bac7a3f7724f47983c18d933b3d012ba1145 | refs/heads/master | 2020-12-03T07:55:38.424950 | 2017-06-30T01:30:36 | 2017-06-30T01:30:36 | 95,639,178 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,582 | java | package com.onedob.util.push;
import com.onedob.constants.Constants;
import com.xiaomi.xmpush.server.Message;
import com.xiaomi.xmpush.server.Message.IOSBuilder;
import com.xiaomi.xmpush.server.Result;
import com.xiaomi.xmpush.server.Sender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
//import org.json.simple.parser.ParseException;
public class XiaoMiPushHelper {
private static final Logger logger = LoggerFactory
.getLogger(XiaoMiPushHelper.class.getName());
private static XiaoMiPushHelper instance = new XiaoMiPushHelper();
private final int PUSH_RETRIES=3;//�ظ����ʹ���
private XiaoMiPushHelper(){
}
public static XiaoMiPushHelper getInstance(){
return instance;
}
/**
* �����ݱ�������
* @param messagePayload
* ����Ҫ���͵���Ϣ����
* @param title
* ������֪ͨ��չʾ��֪ͨ�ı���
* @param description
* ������֪ͨ��չʾ��֪ͨ������
*/
public void sendPushMsg(String regId, String messagePayload, String title,
String description, String jsonStr
// ,String actName
) {
//��������
com.xiaomi.xmpush.server.Constants.useOfficial();
//���Ի���
// com.xiaomi.xmpush.server.Constants.useSandbox();
Sender sender = new Sender(Constants.XIAOMI_USERAPP_SEC);
System.out.println("1--------->"+Constants.XIAOMI_USERAPP_SEC+":"+Constants.XIAOMI_USER_PAK_NAME);
Message message = new Message.Builder().title(title)
.description(description).payload(messagePayload)
.restrictedPackageName(Constants.XIAOMI_USER_PAK_NAME)
.notifyType(1) // ʹ��Ĭ����ʾ����ʾ
.passThrough(0)// ������Ϣ�Ƿ�ͨ�����ķ�ʽ��app��1��ʾ����Ϣ��0��ʾ֪ͨ����Ϣ��
// .extra(com.xiaomi.xmpush.server.Constants.EXTRA_PARAM_NOTIFY_EFFECT,
// com.xiaomi.xmpush.server.Constants.NOTIFY_ACTIVITY)
// .extra(com.xiaomi.xmpush.server.Constants.EXTRA_PARAM_INTENT_URI,
// "intent:#Intent;component="+Constants.XIAOMI_PAK_NAME+"/."+actName+";end")
.extra(com.xiaomi.xmpush.server.Constants.EXTRA_PARAM_NOTIFY_FOREGROUND, "1")
.extra("content", jsonStr) // �Զ����ֵ��
.build();
try {
// Result result = sender.sendToAlias(message, alias, PUSH_RETRIES);
Result result =sender.send(message, regId, PUSH_RETRIES);
logger.info("push regId:"+regId+",Server response: " + "MessageId: "
+ result.getMessageId() + " ErrorCode: "
+ result.getErrorCode().getValue()+","+result.getErrorCode().getName()+","+result.getErrorCode().getFullDescription() + " Reason: "
+ result.getReason());
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* ios�����豸�ŵ������Ͷ���
* @param regId�����͵��豸id
* @param description��������֪ͨ��չʾ��֪ͨ������
* @param jsonStr��Ҫ���ε�json�ַ���
*/
public void sendIosPushMsgByReg(String regId, String description, String jsonStr) throws Exception {
List<String> regIds=new ArrayList<String>();
regIds.add(regId);
sendIosPushMsgByReg(regIds, description, jsonStr);
}
/**
* ios�����豸�Ŷ�����Ͷ���
* @param regIds�����͵��豸id
* @param description��������֪ͨ��չʾ��֪ͨ������
* @param jsonStr��Ҫ���ε�json�ַ���
*/
public void sendIosPushMsgByReg(List<String> regIds, String description, String jsonStr) throws Exception {
sendIosPushMsgByReg(regIds, description, jsonStr, null, null, null, null, null);
}
/**
* ios�����豸�Ŷ�����Ͷ���
* @param regIds�����͵��豸id����
* @param description��������֪ͨ��չʾ��֪ͨ������
* @param jsonStr������app����������
* @param badge����ѡ���null����Ĭ�ϡ��Զ���֪ͨ���ֽDZꡣ
* @param soundUrl����ѡ���null����Ĭ�ϡ��Զ�����Ϣ������
* @param timeToLive����ѡ���null����Ĭ�ϡ�����û����ߣ�������Ϣ�ڷ����������ʱ�䣬��λ��ms�����������Ĭ����������ܡ�
* @param timeToSend����ѡ���null����Ĭ�ϡ���ʱ������Ϣ��timeToSend������1970��1��1������00:00:00.0 UTCʱ���ʾ���Ժ���Ϊ��λ��ʱ�䣩��ע����֧�������ڵĶ�ʱ��Ϣ��
* @param flowControl����ѡ���null����ƽ�����͡�ƽ�����ͣ������֧�����1000/s��qps�����100000/s
*/
public void sendIosPushMsgByReg(List<String> regIds, String description, String jsonStr, Integer badge, String soundUrl
, Integer timeToLive, Long timeToSend, Integer flowControl) throws Exception {
if(regIds==null||regIds.size()<0||description==null||jsonStr==null){
throw new RuntimeException("regIds|description|jsonStr��ʽ���Ϸ����������ֵ");
}
//��������
com.xiaomi.xmpush.server.Constants.useOfficial();
//���Ի���
//com.xiaomi.xmpush.server.Constants.useSandbox();
Sender sender = new Sender(Constants.XIAOMI_APP_IOS_SEC);
logger.info("1--------->"+Constants.XIAOMI_APP_SEC+":"+Constants.XIAOMI_PAK_NAME);
IOSBuilder builder=new Message.IOSBuilder()
.description(description)
//.soundURL("default") // ��Ϣ����
.category("action") // ���ٻظ����
.extra("content", jsonStr); // �Զ����ֵ��
if(badge!=null)builder.badge(badge);
if(soundUrl!=null)builder.soundURL(soundUrl);
if(timeToLive!=null)builder.timeToLive(timeToLive);
if(timeToSend!=null)builder.timeToSend(timeToSend);
if(flowControl!=null)builder.extra("flow_control", flowControl+"");
Message message = builder.build();
Result result =sender.send(message, regIds, PUSH_RETRIES);
logger.info("push alias:"+regIds+",Server response: " + "MessageId: "
+ result.getMessageId() + " ErrorCode: "
+ result.getErrorCode().getValue()+","+result.getErrorCode().getName()+","+result.getErrorCode().getFullDescription() + " Reason: "
+ result.getReason());
}
public void sendMessage() throws Exception {
com.xiaomi.xmpush.server.Constants.useOfficial();
Sender sender = new Sender(Constants.XIAOMI_USERAPP_SEC);
System.out.println("1--------->"+Constants.XIAOMI_USERAPP_SEC+":"+Constants.XIAOMI_USER_PAK_NAME);
Message message = new Message.Builder()
.title("����")
.description("����description").payload("����payload")
.restrictedPackageName(Constants.XIAOMI_USER_PAK_NAME)
.notifyType(1) // ʹ��Ĭ����ʾ����ʾ
.build();
Result result =sender.send(message, "VCDio2xIlyLS5loeyYzqicpBm5rUGfRAenzkD2C/SJk=", 0); //����regID��������Ϣ��ָ���豸�ϣ������ԡ�
System.out.println(result.toString());
logger.info("push regId:"+",Server response: " + "MessageId: "
+ result.getMessageId() + " ErrorCode: "
+ result.getErrorCode().getValue()+","+result.getErrorCode().getName()+","+result.getErrorCode().getFullDescription() + " Reason: "
+ result.getReason());
}
public static void main(String[] args) {
try {
new XiaoMiPushHelper().sendIosPushMsgByReg("TwXwnf73+L7tELHcByQDiJSLQ+1ZUPBDAuUEWT1K240=", "����4",
"{\"msgtype\":\"0\",\"actiontype\":\"0\",\"businesstype\":\"3\",\"info\":{\"cpid\":\"1094\"}}");
// new XiaoMiPushHelper().sendPushMsg("VCDio2xIlyLS5loeyYzqicpBm5rUGfRAenzkD2C/SJk=", "", "���Ա���", "��������","{\"msgtype\":\"0\",\"actiontype\":\"0\",\"businesstype\":\"1\",\"tel\":\"15915922588\",\"info\":{\"cpid\":\"1094\"}}");
// new XiaoMiPushHelper().sendMessage();
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"2464375449@qq.com"
] | 2464375449@qq.com |
086c58dbcb8035835295250b34c2be14e118caef | 9226939a77b5d3f5eeace155ffb36fbeaeae0d34 | /src/main/java/com/epam/composite/component/CharacterLeaf.java | c04e9aee5f536aaa5ad7c101a0f76d2a63413664 | [] | no_license | Peachex/Composite | 41823b8f4ca9c3eb993b604f4d87f18626d48fc1 | 552e86674a1ef573cc1a72136b9371acf423f52e | refs/heads/master | 2023-02-15T07:22:16.550537 | 2021-01-17T08:02:45 | 2021-01-17T08:02:45 | 324,917,872 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,696 | java | package com.epam.composite.component;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class CharacterLeaf implements TextComponent {
private final static Logger logger = LogManager.getLogger();
private final Layer layer;
private char character;
public CharacterLeaf(char character, Layer layer) {
this.layer = layer;
this.character = character;
}
public char getCharacter() {
return this.character;
}
public void setCharacter(char character) {
this.character = character;
}
@Override
public void add(TextComponent component) {
logger.log(Level.ERROR, "Not implemented for this component.");
throw new UnsupportedOperationException("Not implemented");
}
@Override
public TextComponent getChild(int index) {
logger.log(Level.ERROR, "Not implemented for this component.");
throw new UnsupportedOperationException("Not implemented");
}
@Override
public void remove(TextComponent component) {
logger.log(Level.ERROR, "Not implemented for this component.");
throw new UnsupportedOperationException("Not implemented");
}
@Override
public int size() {
return 1;
}
@Override
public boolean isWord() {
logger.log(Level.ERROR, "Not implemented for this component.");
throw new UnsupportedOperationException("Not implemented");
}
@Override
public Layer getCurrentLayer() {
return this.layer;
}
@Override
public String toString() {
return String.valueOf(this.character);
}
}
| [
"klevolex@gmail.com"
] | klevolex@gmail.com |
126bb92d785f341c7526c8433aa3ecb5581f7a6b | 17ec1f2ecd3a3637f92684629fb8c59f828f023f | /KirChatServer/src/main/java/com/chat/mobile/service/RoomService.java | 1ffc3b15e496fba33dad7517eb8b4c30652c5be0 | [] | no_license | kirsong/KirChat | a10b84588e4063529b61ac4b1481aa505917ea8c | ccf999169cfd9158ae8593e534a8cc4a983aa775 | refs/heads/master | 2020-03-12T20:06:54.290811 | 2018-05-09T07:29:35 | 2018-05-09T07:29:35 | 130,783,087 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,396 | java | package com.chat.mobile.service;
import com.chat.mobile.dao.RoomDao;
import com.chat.mobile.mapper.RoomMapper;
import com.chat.mobile.model.ResultInDataModel;
import com.chat.mobile.vo.RoomListVO;
import com.chat.mobile.vo.RoomVO;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
@Service
public class RoomService {
@Autowired
public RoomDao roomDao;
//방 만들기
public RoomVO createRoom(RoomVO roomVO){
if (roomVO!=null){
roomVO.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()));
}
return roomDao.createRoom(roomVO);
}
/**
* 룸 리스트 검색.
* -방 만든 사용자 ID,상대방 사용자 ID
* 두 사용자간의 방을 검색하고 싶다면 targetUserId까지 사용하면 되고.
* 만약 사용자 ID별로 검색하고 싶다면 createUserId로 검색 하면 된다.
* @param createUserId:방 만든 사용자 ID
* @param targetUserId:상대방(타겟) 사용자 ID
* @return
*/
public RoomListVO roomList(String createUserId,String targetUserId){
return roomDao.roomList(createUserId,targetUserId);
}
}
| [
"794522712@qq.com"
] | 794522712@qq.com |
326a9f418718afeeeda73b8bd2349ab709228d7c | 7ffedd41ca400f06a7466e1d1e828564960910dd | /src/main/java/cubix/vis/slider/DefaultDoubleBoundedRangeModel.java | 76f869a0a12c7c9fd95b4df023a44e64b732d730 | [] | no_license | ValentinaIvanova/AlignmentCubes | ffc25a77c29bf35b0e524653818b69514536cb2e | acbff8e9485bea12342ae107c381fa7a82f1d923 | refs/heads/master | 2023-03-31T13:09:24.322953 | 2021-04-06T19:25:01 | 2021-04-06T19:25:01 | 349,541,505 | 1 | 1 | null | 2021-04-06T19:25:02 | 2021-03-19T19:59:43 | Java | UTF-8 | Java | false | false | 6,514 | java | package cubix.vis.slider;
/*****************************************************************************
* Copyright (C) 2003-2005 Jean-Daniel Fekete and INRIA, France *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the X11 Software License *
* a copy of which has been included with this distribution in the *
* license-infovis.txt file. *
*****************************************************************************/
import javax.swing.event.*;
/**
* Defaut implementation of BoundedRangeModel for double.
*
* @author Jean-Daniel Fekete
* @version $Revision: 1.11 $
*/
public class DefaultDoubleBoundedRangeModel implements DoubleBoundedRangeModel {
protected transient ChangeEvent changeEvent;
protected EventListenerList listenerList = new EventListenerList();
private double value = 0;
private double extent = 0;
private double min = 0;
private double max = 100;
private boolean isAdjusting = false;
/**
* Creates a new DefaultDoubleBoundedRangeModel object.
*/
public DefaultDoubleBoundedRangeModel() {
}
/**
* Creates a new DefaultDoubleBoundedRangeModel object.
*
* Maintains min <= value <= (value+extent) <= max
*
* @param value
* the current value
* @param extent
* the current extent
* @param min
* the minimum value
* @param max
* the maximum value
*/
public DefaultDoubleBoundedRangeModel(
double value,
double extent,
double min,
double max) {
if ((max >= min) && (value >= min) && (value + extent) >= value
&& (value + extent) <= max) {
this.value = value;
this.extent = extent;
this.min = min;
this.max = max;
}
else {
throw new IllegalArgumentException("invalid range properties");
}
}
/**
* {@inheritDoc}
*/
public double getValue() {
return value;
}
/**
* {@inheritDoc}
*/
public double getExtent() {
return extent;
}
/**
* {@inheritDoc}
*/
public double getMinimum() {
return min;
}
/**
* {@inheritDoc}
*/
public double getMaximum() {
return max;
}
/**
* {@inheritDoc}
*/
public void setValue(double n) {
double newValue = Math.max(n, min);
if ((newValue + extent) > max) {
newValue = max - extent;
}
setRangeProperties(newValue, extent, min, max, isAdjusting);
}
/**
* {@inheritDoc}
*/
public void setExtent(double n) {
double newExtent = Math.max(0, n);
if ((value + newExtent) > max) {
newExtent = max - value;
}
setRangeProperties(value, newExtent, min, max, isAdjusting);
}
/**
* {@inheritDoc}
*/
public void setMinimum(double n) {
double newMax = Math.max(n, max);
double newValue = Math.max(n, value);
double newExtent = Math.min(newMax - newValue, extent);
setRangeProperties(newValue, newExtent, n, newMax, isAdjusting);
}
/**
* {@inheritDoc}
*/
public void setMaximum(double n) {
double newMin = Math.min(n, min);
double newExtent = Math.min(n - newMin, extent);
double newValue = Math.min(n - newExtent, value);
setRangeProperties(newValue, newExtent, newMin, n, isAdjusting);
}
/**
* {@inheritDoc}
*/
public void setValueIsAdjusting(boolean b) {
setRangeProperties(value, extent, min, max, b);
}
/**
* {@inheritDoc}
*/
public boolean getValueIsAdjusting() {
return isAdjusting;
}
/**
* {@inheritDoc}
*/
public void setRangeProperties(
double newValue,
double newExtent,
double newMin,
double newMax,
boolean adjusting) {
if (newMin > newMax) {
newMin = newMax;
}
if (newValue > newMax) {
newMax = newValue;
}
if (newValue < newMin) {
newMin = newValue;
}
if ((newExtent + newValue) > newMax) {
newExtent = newMax - newValue;
}
if (newExtent < 0) {
newExtent = 0;
}
if ((newValue != value)
|| (newExtent != extent)
|| (newMin != min)
|| (newMax != max)
|| (adjusting != isAdjusting)) {
value = newValue;
extent = newExtent;
min = newMin;
max = newMax;
isAdjusting = adjusting;
fireStateChanged();
}
}
/**
* {@inheritDoc}
*/
public void addChangeListener(ChangeListener l) {
listenerList.add(ChangeListener.class, l);
}
/**
* {@inheritDoc}
*/
public void removeChangeListener(ChangeListener l) {
listenerList.remove(ChangeListener.class, l);
}
/**
* Returns an array of all the change listeners registered on this
* <code>DefaultDoubleBoundedRangeModel</code>.
*
* @return all of this sizeModel's <code>ChangeListener</code>s or an
* empty array if no change listeners are currently registered
*
* @see #addChangeListener
* @see #removeChangeListener
*/
public ChangeListener[] getChangeListeners() {
return (ChangeListener[]) listenerList
.getListeners(ChangeListener.class);
}
/**
* Runs each <code>ChangeListener</code>'s <code>stateChanged</code>
* method.
*
* @see #setRangeProperties
* @see EventListenerList
*/
protected void fireStateChanged() {
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ChangeListener.class) {
if (changeEvent == null) {
changeEvent = new ChangeEvent(this);
}
((ChangeListener) listeners[i + 1]).stateChanged(changeEvent);
}
}
}
}
| [
"valentina.ivanova@ri.se"
] | valentina.ivanova@ri.se |
85a21665f913325619e77d419d7d5df60e4291ba | c4e0a7cefe6b69b948cda23e0e85533c21c8dfd9 | /src/nuevo.java | 4c83f1f143ec94f01d532620b713ca54588d9ca4 | [] | no_license | crtituana/Calculadora- | f7f9012569b6077bf435c65a92e30ef9eb450c2b | 2036bc4cd9950a698e950b6c31f13c87eb900210 | refs/heads/master | 2020-06-05T16:44:49.055690 | 2019-06-18T07:48:44 | 2019-06-18T07:48:44 | 192,486,994 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,684 | java | import javax.swing.*;
import java.awt.*;
public class nuevo extends JFrame{
private JTextField visor;
public nuevo (){
super("Calculadora");
this.setSize(350,350);
JButton[] btNums = new JButton[10];
for (byte i=0;i<btNums.length;i++){
final byte c=i;
btNums[i]=new JButton(""+i);
btNums[i].addActionListener(
actionEvent -> visor.setText(RnCalculadoraKt.mostrar(c))
);
}
JButton[]btAcoes =new JButton[6];
final char []acoes={'+','-','X','=','C','/'};
for (int i=0; i<btAcoes.length;i++){
final char c=acoes[i];
btAcoes[i]=new JButton(""+acoes[i]);
btAcoes[i].addActionListener(
actionEvent -> visor.setText(RnCalculadoraKt.calcular(c))
);
}
JPanel pnCentral=new JPanel();
pnCentral.setLayout(new GridLayout(4,4));
final byte[][] num ={
{7,8,9,0,4,5,6,1,1,2,3,2,0,3,4,5},
{0,0,0,1,0,0,0,1,0,0,0,1,0,1,1,1}
};
for (int i=0;i<num[0].length;i++){
if(num[1][i]==0){
pnCentral.add(btNums[num[0][i]]);
}else {
pnCentral.add(btAcoes[num[0][i]]);
}
}
Font font =new Font(" Font Squirrel",Font.BOLD,20);
visor=new JTextField("0.0");
visor.setFont(font);
visor.setHorizontalAlignment(JTextField.RIGHT);
visor.setEnabled(false);
visor.setDisabledTextColor(Color.blue);
this.add(pnCentral);
this.add(visor,BorderLayout.NORTH);
this.setVisible(true);
}
} | [
"crtituana@gmail.com"
] | crtituana@gmail.com |
75ecbd4f4f9de380f5012fcd8bdbeccb3897813c | 4a6db964971a9a59905fac9783a834be857a9676 | /com/packethammer/vaquero/parser/events/server/numeric/reply/NamesReply.java | 76b0b7236eea865401d441b5b0e3589af44ba44d | [] | no_license | IntractableQuery/vaquero-irc | da1172ff569de3b00d7e63be5d87ae3b6d9cde61 | ac2e9ef9b312879a903431db6a734c90dfdf45d0 | refs/heads/master | 2021-01-16T17:47:43.785830 | 2010-07-30T21:10:29 | 2010-07-30T21:10:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,864 | java | /**
* RPL_NAMREPLY
* "['=' / '*' / '@'] <channel> :<names...>"
*
* This is the NAMES reply for a channel. The NAMES list is given to you when
* you join a channel, although the NAMES command can be sent to retrieve it.
*
* There is a difference between RFC1459 and RFC2812's RPL_NAMREPLY, so I've
* sort of created a mix between the two. This class ignores the character
* located between the channel name and the names list, since it is
* fairly useless. If you really want it for usage, let me know.
*/
package com.packethammer.vaquero.parser.events.server.numeric.reply;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Map;
import com.packethammer.vaquero.parser.events.server.numeric.IRCNumericEvent;
import com.packethammer.vaquero.parser.tracking.IRCServerISupport;
import com.packethammer.vaquero.parser.tracking.definitions.ChannelNickPrefixModeDefinition;
public class NamesReply extends IRCNumericEvent {
private ArrayList<String> nicknames;
public NamesReply() {
nicknames = new ArrayList();
}
/**
* Returns the name of the channel that this reply is for.
*/
public String getChannel() {
if(this.isRFC2812())
return this.getNumericArg(1);
else
return this.getNumericArg(0);
}
/**
* Determines if this NAMES reply was in RFC2812 format (it has additional
* information as the first parameter).
*/
public boolean isRFC2812() {
if(this.getNumericArg(0).equals("=") || this.getNumericArg(0).equals("*") || this.getNumericArg(0).equals("@"))
return true;
else
return false;
}
/**
* Returns the nicknames list with the mode prefix intact (that is, these
* nicknames are not quite 'clean' yet).
*/
public String[] getUncleanNicknames() {
if(this.isRFC2812())
return this.getNumericArg(2).split(" ");
else
return this.getNumericArg(1).split(" ");
}
/**
* Given the ISUPPORT information tracker, this will return a map with
* nicknames as the key, and nickname mode prefix definitions.
*
* @param iSupport The parser's ISUPPORT information.
* @return A non-empty map of nicknames mapped to their respective nickname prefix modes (this may be null if the user has no prefix)
*/
public Map<String,ChannelNickPrefixModeDefinition> getNicknames(IRCServerISupport iSupport) {
Map<String,ChannelNickPrefixModeDefinition> map = new LinkedHashMap();
for(String rawNick : this.getUncleanNicknames()) {
for(ChannelNickPrefixModeDefinition def : iSupport.getNickPrefixModes()) {
if(new Character(rawNick.charAt(0)).equals(def.getPrefix())) {
map.put(rawNick.substring(1), def);
break;
}
map.put(rawNick, null);
}
}
return map;
}
public boolean validate() {
if(this.numericArgumentCount() >= 2) {
// pre-parse the list...
int x = 1; // should be first nickname's index
if(this.isRFC2812())
x++; // we were at the channel name, so hop ahead
// pull names
for( ; x < this.numericArgumentCount(); x++) {
nicknames.add(this.getNumericArg(x));
}
return true;
} else {
return false;
}
}
public int getHandledNumeric() {
return this.RPL_NAMREPLY;
}
public String toString() {
String names = "";
for(String nick : this.getUncleanNicknames())
names += nick + " ";
return super.toString() + ", CHAN:" + this.getChannel() + ", NAMES:" + names;
}
}
| [
"ds@lambda.(none)"
] | ds@lambda.(none) |
49fd898b8f32de5a368d23d68613e956e894f3ea | 95c9fbdfbe81691a7ee1f3dcb887e296923cdbc9 | /app/src/main/java/com/example/android/takei/findibeacontest/MainActivity.java | ad8d554dc76bd3f62a4bc631136eb8d80753c057 | [] | no_license | kout08/FindiBeaconTest | d099f037630d8baaa5cb28bd5370348e5d18c004 | 4cb480da793cb759d3877f549bf03937c61e3eed | refs/heads/master | 2020-05-23T06:24:44.710723 | 2016-10-07T03:35:40 | 2016-10-07T03:35:40 | 68,436,296 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 354 | java | package com.example.android.takei.findibeacontest;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"kout08@users.noreply.github.com"
] | kout08@users.noreply.github.com |
28c2ff668b892e601091600a31975bc3eae87a05 | b0c5ebfecf55e72cb5d910bdb9b605ca8a6525a2 | /ifbrain-website/src/main/java/com/jzeen/travel/openctc/bean/RandcodeIdentifier.java | 2e2588385297f2f064c9e23090cf2386c1d1d320 | [] | no_license | sy-eternal/ifbrain | 930f114739a4888f16e0aad6531635202b078a4d | 9d92fe097c3d6ad50a3ff8e0e8a5220d038c3390 | refs/heads/master | 2020-05-31T00:08:07.865120 | 2016-09-21T07:34:49 | 2016-09-21T07:34:49 | 68,777,316 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,010 | java | package com.jzeen.travel.openctc.bean;
/**
* Title: X2OUR_TRAVEL
* Description:
* Date: 2015年 09月 01日
* CopyRight (c) 2015 X2OUR
*
* @Author limin.tony@x2our.com
*/
public class RandcodeIdentifier {
private String resCode;
private String identifier;
private String createAt;
public RandcodeIdentifier() {
}
public RandcodeIdentifier(String resCode, String identifier, String createAt) {
this.resCode = resCode;
this.identifier = identifier;
this.createAt = createAt;
}
public String getResCode() {
return resCode;
}
public void setResCode(String resCode) {
this.resCode = resCode;
}
public String getCreateAt() {
return createAt;
}
public void setCreateAt(String createAt) {
this.createAt = createAt;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
} | [
"1378668816@qq.com"
] | 1378668816@qq.com |
cba039c870257f6215456b8153e69b1074566eb1 | bccdc3e076a3473edfc2347cd70723d2af514b9b | /concurrency-basic/src/test/io/hedwig/concurrence/concurrentCF/map/SingletonTest.java | c8285f53a75f170cdfef575fb9e9958541eacdc8 | [] | no_license | qdriven/meet-concurrence | 6a5870a0e002ef2ef6dd0876a33c91e997dd79ad | f2afc8fd9803bbcbe6b5a4ef0116b959323399f6 | refs/heads/master | 2021-06-28T21:51:33.692154 | 2019-07-26T04:45:51 | 2019-07-26T04:45:51 | 179,921,196 | 0 | 0 | null | 2020-10-13T12:44:30 | 2019-04-07T05:15:19 | Java | UTF-8 | Java | false | false | 773 | java | package io.hedwig.concurrence.concurrentCF.map;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class SingletonTest {
private static Singleton singleton;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
singleton = Singleton.getInstance();
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void testLockResource() {
int i1 = singleton.lockResource();
assertTrue(i1==0);
}
@Test
public void testUnlockResource() {
singleton.unlockResource(0);
}
}
| [
"patrickwuke@163.com"
] | patrickwuke@163.com |
e8927333cd3bfad89da3e2c5e55529c0a8ccfa2c | 26d258187d60a6b2ea0d70c997dd074756e5a9c4 | /Assignment-mvc/Assignment1/durgesh.spring.mvc/src/main/java/com/springmvc/HomeController.java | cfb0b1080cd80c399a75be29c6b10f074ac22e6a | [] | no_license | iqbalaasim/coursera-test | a5293dbe858cdc6f2f7f5713417bf2b0a85461c5 | 720e5090465ba1494be8c8cd533ef35f5d12b0cf | refs/heads/master | 2023-06-11T00:29:51.278373 | 2021-07-03T14:38:14 | 2021-07-03T14:38:14 | 370,623,055 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 486 | java | package com.springmvc;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
@RequestMapping("/home")
public String home() {
System.out.println("Hello World");
return "index";
}
@RequestMapping("/diff")
public String foo(Model m) {
m.addAttribute("name","Aasim");
m.addAttribute("Roll",6574);
return "hello";
}
}
| [
"aasimqiqbalcoder47@gmail.com"
] | aasimqiqbalcoder47@gmail.com |
a0f5e4b67fba1a1c7a5ddf253944736c440db36b | 00ce68b4b9fc4a956dd9416637b95782aff0914b | /src/aulas/LacoForAvancado.java | f1af997c69e99391c0f4f2bb632c52cc3d9b6af2 | [] | no_license | Kakaroto446/introducao | 4aed5d6dd393418e7b6110556abdc126711a6970 | 5e7b1c64fa0c2d5160d1afbf34af73c66e047d7f | refs/heads/master | 2021-04-26T22:19:23.233544 | 2018-03-09T14:06:07 | 2018-03-09T14:06:07 | 124,071,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 170 | java | package aulas;
public class LacoForAvancado {
public static void main(String[] args) {
for( String s : args){
System.out.println( "Argumento: " + s );
}
}
} | [
"srpauzao@gmail.om"
] | srpauzao@gmail.om |
4a285762d0f3a816d21562ee4a838e2757bba5a3 | 66263b288533924ac4b0ae23e6cece113a0ef78c | /contractManagement/src/com/gd/websocket/vo/equipmentadd/EquipmentAdd.java | 574aba58d6d6a14281a91ab64c64a94b8684a23c | [] | no_license | allenjiao/HTSys | 8c9717b6ee768404319229dc24039996b30404c2 | 7bc3a4fb6536d902e00c9cf3628b54326d6c8300 | refs/heads/master | 2020-07-12T23:40:22.204033 | 2016-11-18T07:26:47 | 2016-11-18T07:26:47 | 73,896,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,804 | java | package com.gd.websocket.vo.equipmentadd;
/**
* 添加的设备信息
*
* @author tyutNo4<br>
* 创建时间:2015-1-20下午4:02:29
*/
public class EquipmentAdd {
private String equipmentId;
private String x2d;
private String y2d;
private String z2d;
private String x2dSize;
private String y2dSize;
private String shortName2d;
private String equipmentType;
private String rowId;
private String alarmStatus;
public String getAlarmStatus() {
return alarmStatus;
}
public void setAlarmStatus(String alarmStatus) {
this.alarmStatus = alarmStatus;
}
public String getEquipmentId() {
return equipmentId;
}
public void setEquipmentId(String equipmentId) {
this.equipmentId = equipmentId;
}
public String getX2d() {
return x2d;
}
public void setX2d(String x2d) {
this.x2d = x2d;
}
public String getY2d() {
return y2d;
}
public void setY2d(String y2d) {
this.y2d = y2d;
}
public String getZ2d() {
return z2d;
}
public void setZ2d(String z2d) {
this.z2d = z2d;
}
public String getX2dSize() {
return x2dSize;
}
public void setX2dSize(String x2dSize) {
this.x2dSize = x2dSize;
}
public String getY2dSize() {
return y2dSize;
}
public void setY2dSize(String y2dSize) {
this.y2dSize = y2dSize;
}
public String getShortName2d() {
return shortName2d;
}
public void setShortName2d(String shortName2d) {
this.shortName2d = shortName2d;
}
public String getEquipmentType() {
return equipmentType;
}
public void setEquipmentType(String equipmentType) {
this.equipmentType = equipmentType;
}
public String getRowId() {
return rowId;
}
public void setRowId(String rowId) {
this.rowId = rowId;
}
}
| [
"zzzzx01@163.com"
] | zzzzx01@163.com |
9bdd202b05d83723c8fdc70f6326bf9ef15a7e3e | 1a06b41f97464b22d203fc07978d4221b6938390 | /src/main/java/com/yd/ydbi/tools/AnyTrend.java | 08dabe4654de582b51397f8386aa008a1d341f61 | [] | no_license | un-knower/ydbigdata | 5e1849ad1f7aa5534e0ed8084d919b8195f7a6f9 | ac3cd1b8f68d859dbeff3999111e391d7503f99a | refs/heads/master | 2020-03-17T23:15:29.000521 | 2017-09-27T06:36:55 | 2017-09-27T06:36:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,698 | java | package com.yd.ydbi.tools;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.FastDateFormat;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Map;
/**
* 计算趋势工具类
*
* @author Administrator
*/
public class AnyTrend {
private static final Calendar c = Calendar.getInstance();
private static final FastDateFormat d = FastDateFormat.getInstance("yyyy-MM-dd");
public static final String YYYYMMDD = "yyyy-MM-dd";
public static final String YYYYMMDD_ZH = "yyyy年MM月dd日";
public static final int FIRST_DAY_OF_WEEK = Calendar.MONDAY; // 中国周一是一周的第一天
/**
* 月日期转换
*
* @param paramsMap
* @param i
*/
public static void SeasonTransform(Map<String, String> paramsMap, int i) {
if (i == 0) {
String date_time = paramsMap.get("date_time");
String today = formatDate(new Date());
String fday = AnyTrend.firstDayOfSeason(date_time);
//paramsMap.put("date_first", fday);
//paramsMap.put("date_final", date_time);
if (today.equals(date_time)) {
paramsMap.put("date_first", fday);
paramsMap.put("date_final", date_time);
} else if (parseDate(fday).getTime() <= parseDate(today).getTime()) {
paramsMap.put("date_first", fday);
paramsMap.put("date_final", today);
} else if (parseDate(fday).getTime() > parseDate(today).getTime()) {
String[] strs = AnyTrend.lastSeasonBetweenDate(date_time);
paramsMap.put("date_first", strs[0]);
paramsMap.put("date_final", strs[1]);
}
} else {
if (StringUtils.isNotEmpty(paramsMap.get("date_time"))) {
String date_time = paramsMap.get("date_time");
String[] strs = AnyTrend.lastSeasonBetweenDate(date_time);
paramsMap.put("date_first", strs[0]);
paramsMap.put("date_final", strs[1]);
paramsMap.put("date_time", strs[0]);
}
}
}
/**
* 月日期转换
*
* @param paramsMap
* @param i
*/
public static void MonTransform(Map<String, String> paramsMap, int i) {
if (i == 0) {
String date_time = paramsMap.get("date_time");
String today = formatDate(new Date());
String fday = AnyTrend.firstDayOfMonth(date_time);
if (today.equals(date_time)) {
paramsMap.put("date_first", fday);
paramsMap.put("date_final", date_time);
} else if (parseDate(fday).getTime() <= parseDate(today).getTime()) {
paramsMap.put("date_first", fday);
paramsMap.put("date_final", today);
} else if (parseDate(fday).getTime() > parseDate(today).getTime()) {
String[] strs = AnyTrend.lastMonthBetweenDate(date_time);
paramsMap.put("date_first", strs[0]);
paramsMap.put("date_final", strs[1]);
}
} else {
if (StringUtils.isNotEmpty(paramsMap.get("date_time"))) {
String date_time = paramsMap.get("date_time");
String[] strs = AnyTrend.lastMonthBetweenDate(date_time);
paramsMap.put("date_first", strs[0]);
paramsMap.put("date_final", strs[1]);
paramsMap.put("date_time", strs[0]);
}
}
}
/**
* 周日起转换
*
* @param paramsMap
* @param i
*/
public static void WeekTransform(Map<String, String> paramsMap, int i) {
if (i == 0) {
String date_time = paramsMap.get("date_time");
String today = formatDate(new Date());
String fday = AnyTrend.firstDayOfWeek(date_time);
// paramsMap.put("date_first", fday);
// paramsMap.put("date_final", date_time);
if (today.equals(date_time)) {
paramsMap.put("date_first", fday);
paramsMap.put("date_final", date_time);
} else if (parseDate(fday).getTime() <= parseDate(today).getTime()) {
paramsMap.put("date_first", fday);
paramsMap.put("date_final", today);
} else if (parseDate(fday).getTime() > parseDate(today).getTime()) {
String[] strs = AnyTrend.lastWeekBetweenDate(date_time);
paramsMap.put("date_first", strs[0]);
paramsMap.put("date_final", strs[1]);
}
} else {
String date_time = paramsMap.get("date_time");
String[] strs = AnyTrend.lastWeekBetweenDate(date_time);
paramsMap.put("date_first", strs[0]);
paramsMap.put("date_final", strs[1]);
paramsMap.put("date_time", strs[0]);
}
}
/**
* 日期减去一天
*
* @param dateStr
* @return
*/
public static String getDateDec1(String dateStr, Integer num) {
if (StringUtils.isEmpty(dateStr)) {
return null;
}
try {
c.setTime(d.parse(dateStr));
} catch (ParseException e) {
e.printStackTrace();
}
c.set(Calendar.DATE, c.get(Calendar.DATE) - num);
String t = d.format(c.getTime());
return t;
}
/**
* 日期减去一周
*
* @param dateStr
* @return
*/
public static String getDateDec1w(String dateStr, Integer num) {
if (StringUtils.isEmpty(dateStr)) {
return null;
}
try {
c.setTime(d.parse(dateStr));
} catch (ParseException e) {
e.printStackTrace();
}
c.set(Calendar.WEEK_OF_YEAR, c.get(Calendar.WEEK_OF_YEAR) - num);
String t = d.format(c.getTime());
return t;
}
/**
* 日期减去一月
*
* @param dateStr
* @return
*/
public static String getDateDec1m(String dateStr, Integer num) {
if (StringUtils.isEmpty(dateStr)) {
return null;
}
try {
c.setTime(d.parse(dateStr));
} catch (ParseException e) {
e.printStackTrace();
}
c.set(Calendar.MONTH, c.get(Calendar.MONTH) - num);
String t = d.format(c.getTime());
return t;
}
/**
* 求百分数保留n位小数(乘了100)
*
* @param fz
* @param fm
* @param xiaoshu
* @return
*/
public static String getRate(String fz, String fm, int xiaoshu) {
float fenzi = Float.parseFloat(fz);
float fenmu = Float.parseFloat(fm);
if (fenmu == 0) {
return "0";
}
BigDecimal bg = new BigDecimal(fenzi / fenmu);
bg = bg.multiply(new BigDecimal("100"));
double result2 = bg.setScale(xiaoshu, BigDecimal.ROUND_HALF_UP).doubleValue();
String rt = String.valueOf(result2);
return rt;
}
/**
* 分子除以分母
*
* @param fz
* @param fm
* @param xiaoshu
* @return
*/
public static String getRate2(String fz, String fm, int xiaoshu) {
float fenzi = Float.parseFloat(fz);
float fenmu = Float.parseFloat(fm);
if (fenmu == 0) {
return "0";
}
BigDecimal bg = new BigDecimal(fenzi / fenmu);
double result2 = bg.setScale(xiaoshu, BigDecimal.ROUND_HALF_UP).doubleValue();
String rt = String.valueOf(result2);
return rt;
}
/**
* 传入日期到当月1日的天数
*
* @param strDate
* @return
*/
public static int strDayOfDays(String strDate) {
Calendar dayc1 = new GregorianCalendar();
Date daystart = null;
try {
daystart = d.parse(strDate);
} catch (ParseException e) {
e.printStackTrace();
}
dayc1.setTime(daystart); // 得到的dayc1就是你需要的calendar了
dayc1.set(Calendar.DAY_OF_MONTH, 1);// 设置为1号,当前日期既为本月第一天
Date time = dayc1.getTime();
int daysOfTwo = daysOfTwo(daystart, time);
return daysOfTwo + 1;
}
/**
* 两个日期相差天数
*
* @param fDate
* @param oDate
* @return
*/
public static int daysOfTwo(Date fDate, Date oDate) {
c.setTime(fDate);
int day1 = c.get(Calendar.DAY_OF_YEAR);
c.setTime(oDate);
int day2 = c.get(Calendar.DAY_OF_YEAR);
return Math.abs(day2 - day1);
}
/**
* 返回当月第一天
*
* @param
* @return
*/
public static String firstDayOfMonth(String dateStr) {
if (StringUtils.isEmpty(dateStr)) {
return null;
}
try {
c.setTime(d.parse(dateStr));
} catch (ParseException e) {
e.printStackTrace();
}
c.set(Calendar.DAY_OF_MONTH, 1);//设置为1号,当前日期既为本月第一天
String t = d.format(c.getTime());
return t;
}
/**
* 获取上个月的第一天和最后一天
*
* @param dateStr
* @return
*/
public static String[] lastMonthBetweenDate(String dateStr) {
if (StringUtils.isEmpty(dateStr)) {
return null;
}
try {
c.setTime(d.parse(dateStr));
} catch (ParseException e) {
e.printStackTrace();
}
c.set(Calendar.MONTH, c.get(Calendar.MONTH) - 1);
c.set(Calendar.DAY_OF_MONTH, 1);//设置为1号,当前日期既为本月第一天
String firstDay = d.format(c.getTime());
c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
String finalDay = d.format(c.getTime());
return new String[]{firstDay, finalDay};
}
/**
* 获取传入日期季度第一天
*
* @param dateStr
* @return
*/
public static String firstDayOfSeason(String dateStr) {
if (StringUtils.isEmpty(dateStr)) {
return null;
}
Date date = parseDate(dateStr);
Date firstDateOfSeason = getFirstDateOfSeason(date);
return d.format(firstDateOfSeason);
}
/**
* 获取上个季度的第一天和最后一天
*
* @param dateStr
* @return
*/
public static String[] lastSeasonBetweenDate(String dateStr) {
String s = firstDayOfSeason(dateStr);
String dateDec1 = getDateDec1(s, 33);
String firstDate = firstDayOfSeason(dateDec1);
Date lastDateOfSeason = getLastDateOfSeason(parseDate(firstDate));
String finalDate = d.format(lastDateOfSeason);
return new String[]{firstDate, finalDate};
}
/**
* 获取传入日期星期的第一天
*
* @param dateStr
* @return
*/
public static String firstDayOfWeek(String dateStr) {
if (StringUtils.isEmpty(dateStr)) {
return null;
}
Date date = parseDate(dateStr);
Date mondayOfWeek = getMondayOfWeek(date);
return d.format(mondayOfWeek);
}
/**
* 获取传入日期上个星期的第一天和最后一天
*
* @param dateStr
* @return
*/
public static String[] lastWeekBetweenDate(String dateStr) {
String s = firstDayOfWeek(dateStr);
String dateDec1 = getDateDec1(s, 7);
String firstDate = firstDayOfWeek(dateDec1);
Date sundayOfWeek = getSundayOfWeek(parseDate(dateDec1));
String finalDate = d.format(sundayOfWeek);
return new String[]{firstDate, finalDate};
}
/**
* @param strDate
* @return
*/
public static Date parseDate(String strDate) {
return parseDate(strDate, null);
}
/**
* parseDate
*
* @param strDate
* @param pattern
* @return
*/
public static Date parseDate(String strDate, String pattern) {
Date date = null;
try {
if (pattern == null) {
pattern = YYYYMMDD;
}
SimpleDateFormat format = new SimpleDateFormat(pattern);
date = format.parse(strDate);
} catch (Exception e) {
e.printStackTrace();
}
return date;
}
/**
* format date
*
* @param date
* @return
*/
public static String formatDate(Date date) {
return formatDate(date, null);
}
/**
* format date
*
* @param date
* @param pattern
* @return
*/
public static String formatDate(Date date, String pattern) {
String strDate = null;
try {
if (pattern == null) {
pattern = YYYYMMDD;
}
SimpleDateFormat format = new SimpleDateFormat(pattern);
strDate = format.format(date);
} catch (Exception e) {
e.printStackTrace();
}
return strDate;
}
/**
* 取得日期:年
*
* @param date
* @return
*/
public static int getYear(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
int year = c.get(Calendar.YEAR);
return year;
}
/**
* 取得日期:年
*
* @param date
* @return
*/
public static int getMonth(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
int month = c.get(Calendar.MONTH);
return month + 1;
}
/**
* 取得日期:年
*
* @param date
* @return
*/
public static int getDay(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
int da = c.get(Calendar.DAY_OF_MONTH);
return da;
}
/**
* 取得当天日期是周几
*
* @param date
* @return
*/
public static int getWeekDay(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
int week_of_year = c.get(Calendar.DAY_OF_WEEK);
return week_of_year - 1;
}
/**
* 取得一年的第几周
*
* @param date
* @return
*/
public static int getWeekOfYear(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
int week_of_year = c.get(Calendar.WEEK_OF_YEAR);
return week_of_year;
}
/**
* getWeekBeginAndEndDate
*
* @param date
* @param pattern
* @return
*/
public static String getWeekBeginAndEndDate(Date date, String pattern) {
Date monday = getMondayOfWeek(date);
Date sunday = getSundayOfWeek(date);
return formatDate(monday, pattern) + " - "
+ formatDate(sunday, pattern);
}
/**
* 根据日期取得对应周周一日期
*
* @param date
* @return
*/
public static Date getMondayOfWeek(Date date) {
Calendar monday = Calendar.getInstance();
monday.setTime(date);
monday.setFirstDayOfWeek(FIRST_DAY_OF_WEEK);
monday.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
return monday.getTime();
}
/**
* 根据日期取得对应周周日日期
*
* @param date
* @return
*/
public static Date getSundayOfWeek(Date date) {
Calendar sunday = Calendar.getInstance();
sunday.setTime(date);
sunday.setFirstDayOfWeek(FIRST_DAY_OF_WEEK);
sunday.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
return sunday.getTime();
}
/**
* 取得月的剩余天数
*
* @param date
* @return
*/
public static int getRemainDayOfMonth(Date date) {
int dayOfMonth = getDayOfMonth(date);
int day = getPassDayOfMonth(date);
return dayOfMonth - day;
}
/**
* 取得月已经过的天数
*
* @param date
* @return
*/
public static int getPassDayOfMonth(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.DAY_OF_MONTH);
}
/**
* 取得月天数
*
* @param date
* @return
*/
public static int getDayOfMonth(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.getActualMaximum(Calendar.DAY_OF_MONTH);
}
/**
* 取得月第一天
*
* @param date
* @return
*/
public static Date getFirstDateOfMonth(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
c.set(Calendar.DAY_OF_MONTH, c.getActualMinimum(Calendar.DAY_OF_MONTH));
return c.getTime();
}
/**
* 取得月最后一天
*
* @param date
* @return
*/
public static Date getLastDateOfMonth(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
return c.getTime();
}
/**
* 取得季度第一天
*
* @param date
* @return
*/
public static Date getFirstDateOfSeason(Date date) {
return getFirstDateOfMonth(getSeasonDate(date)[0]);
}
/**
* 取得季度最后一天
*
* @param date
* @return
*/
public static Date getLastDateOfSeason(Date date) {
return getLastDateOfMonth(getSeasonDate(date)[2]);
}
/**
* 取得季度天数
*
* @param date
* @return
*/
public static int getDayOfSeason(Date date) {
int day = 0;
Date[] seasonDates = getSeasonDate(date);
for (Date date2 : seasonDates) {
day += getDayOfMonth(date2);
}
return day;
}
/**
* 取得季度剩余天数
*
* @param date
* @return
*/
public static int getRemainDayOfSeason(Date date) {
return getDayOfSeason(date) - getPassDayOfSeason(date);
}
/**
* 取得季度已过天数
*
* @param date
* @return
*/
public static int getPassDayOfSeason(Date date) {
int day = 0;
Date[] seasonDates = getSeasonDate(date);
Calendar c = Calendar.getInstance();
c.setTime(date);
int month = c.get(Calendar.MONTH);
if (month == Calendar.JANUARY || month == Calendar.APRIL
|| month == Calendar.JULY || month == Calendar.OCTOBER) {// 季度第一个月
day = getPassDayOfMonth(seasonDates[0]);
} else if (month == Calendar.FEBRUARY || month == Calendar.MAY
|| month == Calendar.AUGUST || month == Calendar.NOVEMBER) {// 季度第二个月
day = getDayOfMonth(seasonDates[0])
+ getPassDayOfMonth(seasonDates[1]);
} else if (month == Calendar.MARCH || month == Calendar.JUNE
|| month == Calendar.SEPTEMBER || month == Calendar.DECEMBER) {// 季度第三个月
day = getDayOfMonth(seasonDates[0]) + getDayOfMonth(seasonDates[1])
+ getPassDayOfMonth(seasonDates[2]);
}
return day;
}
/**
* 取得季度月
*
* @param date
* @return
*/
public static Date[] getSeasonDate(Date date) {
Date[] season = new Date[3];
Calendar c = Calendar.getInstance();
c.setTime(date);
int nSeason = getSeason(date);
if (nSeason == 1) {// 第一季度
c.set(Calendar.MONTH, Calendar.JANUARY);
season[0] = c.getTime();
c.set(Calendar.MONTH, Calendar.FEBRUARY);
season[1] = c.getTime();
c.set(Calendar.MONTH, Calendar.MARCH);
season[2] = c.getTime();
} else if (nSeason == 2) {// 第二季度
c.set(Calendar.MONTH, Calendar.APRIL);
season[0] = c.getTime();
c.set(Calendar.MONTH, Calendar.MAY);
season[1] = c.getTime();
c.set(Calendar.MONTH, Calendar.JUNE);
season[2] = c.getTime();
} else if (nSeason == 3) {// 第三季度
c.set(Calendar.MONTH, Calendar.JULY);
season[0] = c.getTime();
c.set(Calendar.MONTH, Calendar.AUGUST);
season[1] = c.getTime();
c.set(Calendar.MONTH, Calendar.SEPTEMBER);
season[2] = c.getTime();
} else if (nSeason == 4) {// 第四季度
c.set(Calendar.MONTH, Calendar.OCTOBER);
season[0] = c.getTime();
c.set(Calendar.MONTH, Calendar.NOVEMBER);
season[1] = c.getTime();
c.set(Calendar.MONTH, Calendar.DECEMBER);
season[2] = c.getTime();
}
return season;
}
/**
* 1 第一季度 2 第二季度 3 第三季度 4 第四季度
*
* @param date
* @return
*/
public static int getSeason(Date date) {
int season = 0;
Calendar c = Calendar.getInstance();
c.setTime(date);
int month = c.get(Calendar.MONTH);
switch (month) {
case Calendar.JANUARY:
case Calendar.FEBRUARY:
case Calendar.MARCH:
season = 1;
break;
case Calendar.APRIL:
case Calendar.MAY:
case Calendar.JUNE:
season = 2;
break;
case Calendar.JULY:
case Calendar.AUGUST:
case Calendar.SEPTEMBER:
season = 3;
break;
case Calendar.OCTOBER:
case Calendar.NOVEMBER:
case Calendar.DECEMBER:
season = 4;
break;
default:
break;
}
return season;
}
public static void main(String[] args) {
String strDate = "2017-07-23";
Date date = parseDate(strDate);
System.out.println(strDate + " 今天是哪一年?" + getYear(date));
System.out.println(strDate + " 今天是哪个月?" + getMonth(date));
System.out.println(strDate + " 今天是几号?" + getDay(date));
System.out.println(strDate + " 今天是周几?" + getWeekDay(date));
System.out.println(strDate + " 是一年的第几周?" + getWeekOfYear(date));
System.out.println(strDate + " 所在周起始结束日期?"
+ getWeekBeginAndEndDate(date, "yyyy年MM月dd日"));
System.out.println(strDate + " 所在周周一是?"
+ formatDate(getMondayOfWeek(date)));
System.out.println(strDate + " 所在周周日是?"
+ formatDate(getSundayOfWeek(date)));
System.out.println(strDate + " 当月第一天日期?"
+ formatDate(getFirstDateOfMonth(date)));
System.out.println(strDate + " 当月最后一天日期?"
+ formatDate(getLastDateOfMonth(date)));
System.out.println(strDate + " 当月天数?" + getDayOfMonth(date));
System.out.println(strDate + " 当月已过多少天?" + getPassDayOfMonth(date));
System.out.println(strDate + " 当月剩余多少天?" + getRemainDayOfMonth(date));
System.out.println(strDate + " 所在季度第一天日期?"
+ formatDate(getFirstDateOfSeason(date)));
System.out.println(strDate + " 所在季度最后一天日期?"
+ formatDate(getLastDateOfSeason(date)));
System.out.println(strDate + " 所在季度天数?" + getDayOfSeason(date));
System.out.println(strDate + " 所在季度已过多少天?" + getPassDayOfSeason(date));
System.out
.println(strDate + " 所在季度剩余多少天?" + getRemainDayOfSeason(date));
System.out.println(strDate + " 是第几季度?" + getSeason(date));
System.out.println(strDate + " 所在季度月份?"
+ formatDate(getSeasonDate(date)[0], "yyyy年MM月") + "/"
+ formatDate(getSeasonDate(date)[1], "yyyy年MM月") + "/"
+ formatDate(getSeasonDate(date)[2], "yyyy年MM月"));
System.out.println(firstDayOfSeason("2017-08-23"));
System.out.println(lastSeasonBetweenDate("2017-08-23")[0]);
System.out.println(lastSeasonBetweenDate("2017-08-23")[1]);
System.out.println(lastWeekBetweenDate("2017-08-23")[0]);
System.out.println(lastWeekBetweenDate("2017-08-23")[1]);
System.out.println("当天时间:" + formatDate(new Date()));
}
}
| [
"13122163363@163.com"
] | 13122163363@163.com |
7711a8594cebdbd5123fccddcc12163248e9bac8 | c22e280d576474dd73b2e6212a1c415b2ff96561 | /app/src/main/java/com/example/sistema/ProfessorActivity.java | 2bf6d362c0014e1a7ebbbdd7ebd2554fc9e909ba | [] | no_license | leofreitas2289/Sistema | bcc9c8ec1afee3c007b436936743e0595e4e1071 | a724c566ca29997dcb3467e4114132c9d5e1d6ca | refs/heads/master | 2023-05-15T14:50:06.436691 | 2021-06-14T00:57:12 | 2021-06-14T00:57:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package com.example.sistema;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
public class ProfessorActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_professor);
String id = null;
Bundle bundle = getIntent().getExtras();
if (bundle != null) {
id = bundle.getString("id");
}
Toast.makeText(this,id,Toast.LENGTH_SHORT).show();
}
} | [
"dapporcellis@gmail.com"
] | dapporcellis@gmail.com |
4890826ed05cdc14e60c64f800b3da23124a5f74 | e7beed69c03b104241ca8426f95eca7f10656c17 | /im/qqclient/src/main/java/com/qq/button/SessionFrameButtonFactory.java | 55aad1ac88e1a9980af82be7ab6e5c942fc77fda | [] | no_license | houk1987/im | 01bbf068cc23521331faa84ddc8b2f001fabf9e4 | 2b3db02d25db8483cffefc910e9212046e01e1b0 | refs/heads/master | 2016-09-06T04:11:28.576349 | 2014-11-14T02:46:19 | 2014-11-14T02:46:19 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 708 | java | package com.qq.button;
import com.ui.button.ImageButton;
import javax.swing.*;
/**
* 登陆窗口中按钮工厂类
* 提供登陆窗口中按钮创建
* Created by lenovo on 2014/10/16.
*/
public class SessionFrameButtonFactory extends ButtonFactory{
private final String imagePath = "resources/images/session/button/";
public final static String MIN_WINDOW = "minWindow.png";
public final static String CLOSE_WINDOW = "closeWindow.png";
public final static String SEND = "send.png";
public final static String ClOSE_SESSION_FRAME = "closeSessionFrame.png";
@Override
public ImageButton createButton(String type) {
return new ImageButton(imagePath,type);
}
}
| [
"598470593@qq.com"
] | 598470593@qq.com |
9c0a1ce4a8f17ccdff50dd872da38e1fe48802aa | 3ff3f754dff8812b8255de71ddf44180af65e047 | /libUnzipped/de/jtem/numericalMethods/geometry/bounding/BoundingBox.java | 14ee7c23aa9d6e36f876035122da6fbc2b1b6dda | [
"BSD-3-Clause",
"BSD-2-Clause-Views",
"BSD-2-Clause"
] | permissive | jupsal/schmies-jTEM | 80c14559163ebcd814686fa033f4d06a550dda81 | 565696dbabc70adb50aaaab8f61fad0f91f123c0 | refs/heads/master | 2021-01-01T05:22:04.311103 | 2016-05-24T23:25:22 | 2016-05-24T23:25:22 | 56,116,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,311 | java | /**
This file is part of a jTEM project.
All jTEM projects are licensed under the FreeBSD license
or 2-clause BSD license (see http://www.opensource.org/licenses/bsd-license.php).
Copyright (c) 2002-2009, Technische Universität Berlin, jTEM
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
**/
package de.jtem.numericalMethods.geometry.bounding;
/** Provides static method for computing bounding box for point clouds.
** @version 1.0
** @author Markus Schmies
*/
public class BoundingBox {
/** Protect constructor since it is static only class. */
protected BoundingBox() {
}
final static double EPS = 1e-14;
private static void resultIsPoint( double [] point, int dim,
double [][] transform,
double [] min, double [] max ) {
System.arraycopy( point, 0, min, 0, dim );
System.arraycopy( point, 0, max, 0, dim );
for( int i=0; i<dim; i++ )
for( int j=0; j<dim; j++ )
transform[i][j] = i == j ? 1 : 0;
}
/** Completes orthonoormal basis. */
private static void gramSchmitt( double [][] basis, int k ) {
final int dim = basis.length;
final double [] n = basis[k];
for( int l=0; l<dim; l++ )
n[l] = 1 + Math.random();
for( int j=0; j<k; j++ ) {
final double [] m = basis[j];
double product = 0;
for( int l=0; l<dim; l++ )
product += m[l] * n[l];
for( int l=0; l<dim; l++ )
n[l] -= product * m[l];
}
double lengthSqr = 0;
for( int l=0; l<dim; l++ )
lengthSqr += n[l] * n[l];
final double length = Math.sqrt( lengthSqr );
if( length < EPS )
throw new RuntimeException( "gram schmitt failed" );
for( int l=0; l<dim; l++ )
n[l] /= length;
}
/** Computes bounding box for point cloud in arbitrary dimension.
** The coordinates are given pointwise, therefore must the length
** of the <code>point</code> array be a multiple of <code>dim</code>
** which is the dimension of the surrounding space.
** On output the content of <code>point</code> will be destroyed.
** The bounding box is given as an interval
** <code>[min[0],max[0]x...x[min[dim-1],max[dim-1]</code> which is
** transformed by the orthonormal <code>dim</code> by <code>dim</code>
** matrix which is return in <code>transform</code>.
** In other words, the inverse tramsformation, which is
** is given by the transposed of <code>transform</code>, maps the points
** into the above interval.
** The length of the interval are sorted starting with the the largest.
** The routine supports degenerated cases, where the points lay in a subspace.
** The algorithm does not find the smallest bound and delivers the
** worst results in the cases of generalized cubes.
** @param point array with length which must be multiple of dim, data is destroyed on output
** @param dim dimension of space
** @param transform orthonormal matrix (first index rows)
** @param lower bound of interval
** @param upper bound of interval */
public static void compute( double [] point, int dim,
double [][] transform,
double [] min, double [] max ) {
if( point.length % dim != 0 )
throw new IllegalArgumentException("length of point array is not multiple of dim" );
final int numOfPoints = point.length / dim ;
for( int k=0; k<dim; k++ ) {
// compute biggest deviation in subspace
double maxProduct = 0;
int maxI = 0;
int maxJ = 1;
for( int i=0; i<numOfPoints-1; i++ ) {
final int I = dim * i;
for( int j=i+1, J=j*dim; j<numOfPoints; j++, J+=dim ) {
double product = 0;
for( int l=0; l<dim; l++ )
product += ( point[I+l] - point[J+l] )
* ( point[I+l] - point[J+l] );
if( maxProduct < product ) {
maxProduct = product;
maxI = I;
maxJ = J;
}
}
}
final double [] n = transform[k];
if( maxProduct < EPS ) {
if( k == 0 ) {
resultIsPoint( point, dim, transform, min, max );
return;
}
gramSchmitt( transform, k );
double maxProjection = -Double.MAX_VALUE;
double minProjection = Double.MAX_VALUE;
for( int i=0, I=0; i<numOfPoints; i++, I+=dim ) {
double product = 0;
for( int l=0; l<dim; l++ )
product += point[I+l] * n[l];
if( product < minProjection )
minProjection = product;
if( product > maxProjection )
maxProjection = product;
}
min[k] = minProjection;
max[k] = maxProjection;
} else {
final double length = Math.sqrt( maxProduct );
for( int l=0; l<dim; l++ )
n[l] = ( point[ maxI + l ] - point[ maxJ + l ] ) / length;
min[k] = 0;
max[k] = 0;
for( int l=0; l<dim; l++ ) {
min[k] += point[ maxJ + l ] * n[l];
max[k] += point[ maxI + l ] * n[l];
}
}
// project points to subspace
for( int i=0, I=0; i<numOfPoints; i++ ) {
double product = 0;
for( int l=0; l<dim; l++ )
product += point[ I + l ] * n[l];
for( int l=0; l<dim; l++ )
point[I++] -= product * n[l];
}
}
}
}
| [
"jupsal@u.washington.edu"
] | jupsal@u.washington.edu |
36083bf62f3e15bce089ac389c2d7be13da0f9c7 | d480ee1f267c4dd3dfa84a4469f33e8341ab5339 | /src/main/java/rs/filmoteka/emf/EMF.java | f7dd3358b92f926a49d5dade3e80f3a38294f163 | [] | no_license | StefanBgd/Filmoteka | f8ec75d8daf54a4a6377c4bdca3fed1ace64a8cd | e95f2ae5219b0fafe605b8b3999d24f803782310 | refs/heads/master | 2021-01-17T06:55:10.085509 | 2016-07-09T13:42:31 | 2016-07-09T13:42:31 | 52,159,839 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,114 | 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 rs.filmoteka.emf;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
/**
*
* @author stefan
*/
@WebListener
public class EMF implements ServletContextListener{
private static EntityManagerFactory emf;
@Override
public void contextInitialized(ServletContextEvent sce) {
emf = Persistence.createEntityManagerFactory("rs_Filmoteka_war_1.0-SNAPSHOTPU");
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
emf.close();
}
public static EntityManager createEntityManager(){
if (emf == null) {
throw new IllegalStateException("Context is not initialized yet.");
}
return emf.createEntityManager();
}
}
| [
"stefan@stefan-PC"
] | stefan@stefan-PC |
3a4359fe00e22a8e0e7b8506225440604771ab2b | 06eb59d91495a2b9568d21019e4dcb61ff236b7a | /izpack-src/tags/3.10.2/src/lib/com/izforge/izpack/util/os/WrappedNativeLibException.java | 2de5f5fbfdac0edcc9b2b8ba9085e738ca57cbd4 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | jponge/izpack-full-svn-history-copy | 8fa773fb3f9f4004e762d29f708273533ba0ff1f | 7a521ccd6ce0dd1a0664eaae12fd5bba5571d231 | refs/heads/master | 2016-09-01T18:24:14.656773 | 2010-03-01T07:38:22 | 2010-03-01T07:38:22 | 551,191 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,004 | java | /*
* IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
*
* http://izpack.org/
* http://developer.berlios.de/projects/izpack/
*
* Copyright 2005 Klaus Bartz
*
* 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.izforge.izpack.util.os;
import com.coi.tools.os.win.NativeLibException;
import com.izforge.izpack.LocaleDatabase;
/**
* This class allows it to define error messages for <code>NativeLibException</code> s in the
* IzPack locale files. The getMessage methode searches in the current langpack for entries which
* are corresponding to that one which are received from native part. If the langpack do not contain
* the entry, the resource boundle is used.
*
* @author Klaus Bartz
*
*/
public class WrappedNativeLibException extends Exception
{
private static final long serialVersionUID = 3257562893309720112L;
/** The packs locale database. */
protected static LocaleDatabase langpack = null;
/**
* Default constructor.
*/
public WrappedNativeLibException()
{
super();
}
/**
* @param message
*/
public WrappedNativeLibException(String message)
{
super(message);
}
/**
* @param cause
*/
public WrappedNativeLibException(Throwable cause)
{
super(cause);
}
/**
* @param message
* @param cause
*/
public WrappedNativeLibException(String message, Throwable cause)
{
super(message, cause);
}
/*
* (non-Javadoc)
*
* @see java.lang.Throwable#getMessage()
*/
public String getMessage()
{
StringBuffer retval = new StringBuffer();
boolean next = false;
boolean ok = false;
if (getCause() instanceof NativeLibException)
{
NativeLibException nle = (NativeLibException) getCause();
if (langpack != null)
{
while (true)
{
if (nle.getLibMessage() != null)
{
String val = (String) langpack.get("NativeLibException."
+ nle.getLibMessage());
if (val == null) break;
retval.append(val);
next = true;
}
else if (nle.getLibErr() != 0)
{
String val = (String) langpack.get("NativeLibException.libErrNumber."
+ Integer.toString(nle.getLibErr()));
if (val == null) break;
if (next) retval.append("\n");
next = true;
retval.append(val);
}
if (nle.getOsErr() != 0)
{
String val = (String) langpack
.get("NativeLibException.libInternal.OsErrNumPraefix")
+ Integer.toString(nle.getOsErr());
if (val == null) break;
if (next) retval.append("\n");
next = true;
retval.append(val);
}
if (nle.getOsMessage() != null)
{
String val = (String) langpack
.get("NativeLibException.libInternal.OsErrStringPraefix")
+ nle.getOsMessage();
if (val == null) break;
if (next) retval.append("\n");
next = true;
retval.append(val);
}
ok = true;
break;
}
}
if (ok && retval.length() > 0)
return (nle.reviseMsgWithArgs(retval.toString()));
else
return (nle.getMessage());
}
else
return (super.getMessage());
}
/**
* Returns the langpack.
*
* @return Returns the langpack.
*/
public static LocaleDatabase getLangpack()
{
return langpack;
}
/**
* Sets the langpack to the given locale database.
*
* @param langpack the langpack to set.
*/
public static void setLangpack(LocaleDatabase langpack)
{
WrappedNativeLibException.langpack = langpack;
}
}
| [
"jponge@7d736ef5-cfd4-0310-9c9a-b52d5c14b761"
] | jponge@7d736ef5-cfd4-0310-9c9a-b52d5c14b761 |
f393e409cef66501f60a6721939866e0944a9d0d | 64f84e6df66c7208643108a0d39ea5daa567ab70 | /ClaseAbstracta/src/com/curso/Operacion.java | 2059edae29f164373095fb8e80505c312e086f61 | [] | no_license | mrugerio/myHelloWorldJava | 4b5846f1fc97f8e67f0f26aa461d86f1c672a50b | 4f099f34ef2133beba7edc7c7aa119a9a5c52cf4 | refs/heads/master | 2022-06-08T02:36:14.710747 | 2022-03-11T01:36:39 | 2022-03-11T01:36:39 | 253,350,182 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 298 | java | package com.curso;
public abstract class Operacion {
int x;
int y;
public Operacion(int x, int y) {
super();
this.x = x;
this.y = y;
}
abstract int ejecuta();
@Override
public String toString() {
return this.getClass().getSimpleName()+
" [x=" + x + ", y=" + y + "]";
}
}
| [
"mrugerio@gmail.com"
] | mrugerio@gmail.com |
1dfc9faf2e65cfaaa4a81016bdda71b3be54063e | f751ae296fee58a5e42969703f7ceae96c5da192 | /src/poofazenda/Animais.java | 671d941f3b26e6755ebabf078ffcd551084c2157 | [] | no_license | LucasCAN/POOFazenda | ac84d40289a8c24e55afa2ea252e30c474c1a276 | fbbec3dfec8ce032354eb1edc4c9ca7c05ca037b | refs/heads/master | 2021-04-24T13:22:39.801507 | 2020-03-26T00:44:33 | 2020-03-26T00:44:33 | 250,123,498 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 718 | java | package poofazenda;
/**
* @author Lucas Carvalho Alves Nogueira
*/
public class Animais {
public int idade;
public double tamanho;
/**
* Construtor Animais
*
* @param idade - Idade do animal
* @param tamanho - Tamanho do animal
*/
public Animais(int idade, double tamanho) {
this.idade = idade;
this.tamanho = tamanho;
}
/**
* Sets e Gets
*
*/
public int getIdade() {
return idade;
}
public void setIdade(int idade) {
this.idade = idade;
}
public double getTamanho() {
return tamanho;
}
public void setTamanho(double tamanho) {
this.tamanho = tamanho;
}
}
| [
"luca.can29@gmail.com"
] | luca.can29@gmail.com |
601324551fb097ba7e1b8c8599fcd5be8db962ca | 967f9cc106170aba35b4bd1a3c8c9ac1f56928ce | /app/src/main/java/app/rasendriya/cintamasjid/prays/Util.java | afaf49e7dca979743855f4672245ce635740b037 | [] | no_license | arizkyana/cintamasjid | 86f182ede3dd380a58dc29fc9c38dc080e066790 | 1c6c217dab3e11d80da0c0f7c04173bb9d998037 | refs/heads/master | 2016-09-05T16:50:33.115036 | 2015-07-14T06:14:27 | 2015-07-14T06:14:27 | 39,053,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,368 | java | package app.rasendriya.cintamasjid.prays;
import java.text.DecimalFormat;
/**
* Helper class based on <a href="http://praytimes.org">PrayTimes.js</a>.
*
* @author <a href="mailto:ichsan@gmail.com">Muhammad Ichsan</a>
*
*/
public class Util {
private Util() {
}
/**
* Convert hours to 24h format
*
* @param time
* Time to convert
* @return Time in 24h format
*/
public static String toTime24(double time) {
DayTime dt = toDayTime(time, true);
DecimalFormat f = new DecimalFormat("00");
return f.format(dt.hours) + ":" + f.format(dt.minutes);
}
public static String toTime24Minus15m(double time, int minus) {
DayTime dt = toDayTime(time, true);
DecimalFormat f = new DecimalFormat("00");
return f.format(dt.hours) + ":" + f.format(dt.minutes - minus);
}
/**
* Convert hours to 12h format
*
* @param time
* Time to convert
* @param noSuffix
* If false, then "pm" or "am" is added
* @return Time in 12h format
*/
public static String toTime12(double time, boolean noSuffix) {
DayTime dt = toDayTime(time, true);
String suffix;
if (dt.hours >= 12) {
suffix = "pm";
} else {
suffix = "am";
}
int hours = (dt.hours + 12 - 1) % 12 + 1;
DecimalFormat f = new DecimalFormat("00");
return f.format(hours) + ":" + f.format(dt.minutes) + (noSuffix ? "" : " " + suffix);
}
/**
* Get day time
*
* @param time
* Time to convert
* @param ignoreSeconds
* If true then time will be added half minute.
* @return Day time
*/
public static DayTime toDayTime(double time, boolean ignoreSeconds) {
// add 0.5 minutes to round
time = DMath.fixHour(time + (ignoreSeconds ? 0.5 / 60 : 0));
int hours = (int) Math.floor(time); // 2
int minutes = (int) Math.floor((time - hours) * 60);
int seconds = 0;
if (!ignoreSeconds) {
seconds = (int) Math.floor(((time - hours) * 60 - minutes) * 60);
}
return new DayTime(hours, minutes, seconds);
}
public static class DayTime {
private final int hours, minutes, seconds;
public DayTime(int hours, int minutes, int seconds) {
this.hours = hours;
this.minutes = minutes;
this.seconds = seconds;
}
public int getHours() {
return hours;
}
public int getMinutes() {
return minutes;
}
public int getSeconds() {
return seconds;
}
}
}
| [
"agung.rizkyana@gmail.com"
] | agung.rizkyana@gmail.com |
d40bfcc4346f4ad9c7eda82e6a02712cfd6f7713 | 74a9eb3d38edbb4da1255f382d8c6258ec6923bf | /webgoat-lessons/webwolf-introduction/src/main/java/org/owasp/webgoat/plugin/MailAssignment.java | 2f247fa709137bc58a651227eeec50898b395052 | [] | no_license | shizzz477/WebGoat | 14fab67c63828ab6c94846cd8adba39644a927ad | 50543a9b5585ca6f1d9128f98ca6fc85d7c52801 | refs/heads/develop | 2021-01-22T21:46:00.358354 | 2017-10-13T21:14:47 | 2017-10-13T21:14:47 | 92,738,017 | 1 | 0 | null | 2017-05-29T12:29:48 | 2017-05-29T12:29:47 | null | UTF-8 | Java | false | false | 2,131 | java | package org.owasp.webgoat.plugin;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.owasp.webgoat.assignments.AssignmentEndpoint;
import org.owasp.webgoat.assignments.AssignmentPath;
import org.owasp.webgoat.assignments.AttackResult;
import org.owasp.webgoat.mail.IncomingMailEvent;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.time.LocalDateTime;
/**
* @author nbaars
* @since 8/20/17.
*/
@AssignmentPath("/WebWolf/mail")
@AllArgsConstructor
public class MailAssignment extends AssignmentEndpoint {
private JmsTemplate jmsTemplate;
@PostMapping("send")
@ResponseBody
public AttackResult sendEmail(@RequestParam String email) {
String username = email.substring(0, email.indexOf("@"));
if (username.equals(getWebSession().getUserName())) {
IncomingMailEvent mailEvent = IncomingMailEvent.builder()
.recipient(username)
.title("Test messages from WebWolf")
.time(LocalDateTime.now())
.contents("This is a test message from WebWolf, your unique code is" + StringUtils.reverse(username))
.sender("webgoat@owasp.org")
.build();
jmsTemplate.convertAndSend("mailbox", mailEvent);
return informationMessage().feedback("webwolf.email_send").feedbackArgs(email).build();
} else {
return informationMessage().feedback("webwolf.email_mismatch").feedbackArgs(username).build();
}
}
@PostMapping
@ResponseBody
public AttackResult completed(@RequestParam String uniqueCode) {
if (uniqueCode.equals(StringUtils.reverse(getWebSession().getUserName()))) {
return trackProgress(success().build());
} else {
return trackProgress(failed().feedbackArgs("webwolf.code_incorrect").feedbackArgs(uniqueCode).build());
}
}
}
| [
"nanne.baars@owasp.org"
] | nanne.baars@owasp.org |
5a740928bcf872048154baf1d6fc0e1721c3eda7 | 88e4e4a1ae9bb2d144ffaa5da9795b869e7a88f1 | /src/stupid0min/study06.java | 64b3d1d01d87e9dffa4a79f07c1ddd5b6dc601a2 | [] | no_license | simsungyong/algorithm | 2ea75671c8009a47a5b68fc6c75614940177a9c2 | 749261fbacfab0b1e06b855fdf6c59a9a4b32739 | refs/heads/master | 2023-02-10T11:35:21.023136 | 2021-01-08T09:27:42 | 2021-01-08T09:27:42 | 276,836,659 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 98 | java | package stupid0min;
public class study06 {
public static void main(String[] args) {
}
}
| [
"ssy332972@gmail.com"
] | ssy332972@gmail.com |
2871692944940d2bc5169b4cb547b46d7777d321 | 29b6a856a81a47ebab7bfdba7fe8a7b845123c9e | /dingtalk/java/src/main/java/com/aliyun/dingtalkworkflow_1_0/models/InstallAppResponseBody.java | b65cf090e4308e5c17370a3986187367cd4e4ada | [
"Apache-2.0"
] | permissive | aliyun/dingtalk-sdk | f2362b6963c4dbacd82a83eeebc223c21f143beb | 586874df48466d968adf0441b3086a2841892935 | refs/heads/master | 2023-08-31T08:21:14.042410 | 2023-08-30T08:18:22 | 2023-08-30T08:18:22 | 290,671,707 | 22 | 9 | null | 2021-08-12T09:55:44 | 2020-08-27T04:05:39 | PHP | UTF-8 | Java | false | false | 1,946 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.dingtalkworkflow_1_0.models;
import com.aliyun.tea.*;
public class InstallAppResponseBody extends TeaModel {
@NameInMap("result")
public java.util.List<InstallAppResponseBodyResult> result;
public static InstallAppResponseBody build(java.util.Map<String, ?> map) throws Exception {
InstallAppResponseBody self = new InstallAppResponseBody();
return TeaModel.build(map, self);
}
public InstallAppResponseBody setResult(java.util.List<InstallAppResponseBodyResult> result) {
this.result = result;
return this;
}
public java.util.List<InstallAppResponseBodyResult> getResult() {
return this.result;
}
public static class InstallAppResponseBodyResult extends TeaModel {
@NameInMap("bizType")
public String bizType;
@NameInMap("name")
public String name;
@NameInMap("processCode")
public String processCode;
public static InstallAppResponseBodyResult build(java.util.Map<String, ?> map) throws Exception {
InstallAppResponseBodyResult self = new InstallAppResponseBodyResult();
return TeaModel.build(map, self);
}
public InstallAppResponseBodyResult setBizType(String bizType) {
this.bizType = bizType;
return this;
}
public String getBizType() {
return this.bizType;
}
public InstallAppResponseBodyResult setName(String name) {
this.name = name;
return this;
}
public String getName() {
return this.name;
}
public InstallAppResponseBodyResult setProcessCode(String processCode) {
this.processCode = processCode;
return this;
}
public String getProcessCode() {
return this.processCode;
}
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
079c29f0cf7475838409787a25c19e109bc3901b | 3b0aa865c2c2d40285a85c110a1737bf0b67dd8f | /mycar/withmycar/src/main/java/com/qf/withmycar/mapper/MessageSendlogMapper.java | e757ddd66c78cab6b0658417225f9f42235cca72 | [] | no_license | pengfei8923/withcar | 5fb7f19c93203a761a467e37e2e104b511f99f13 | 158f3b7a8faabbbf728cee6a46536d9d67039f2a | refs/heads/master | 2020-05-16T16:41:08.853652 | 2019-04-24T07:19:49 | 2019-04-24T07:19:49 | 183,170,513 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,417 | java | package com.qf.withmycar.mapper;
import com.qf.withmycar.pojo.MessageSendlog;
public interface MessageSendlogMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_sendlog
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_sendlog
*
* @mbggenerated
*/
int insert(MessageSendlog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_sendlog
*
* @mbggenerated
*/
int insertSelective(MessageSendlog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_sendlog
*
* @mbggenerated
*/
MessageSendlog selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_sendlog
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(MessageSendlog record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table message_sendlog
*
* @mbggenerated
*/
int updateByPrimaryKey(MessageSendlog record);
} | [
"pengfei8923@163.com"
] | pengfei8923@163.com |
f1c78154a4f621321f8b6f7ae712ee4c19f99d5e | c57e3f777dc65354ba03c12612c52baee4e8189b | /FinalProject/MVC/src/delPro.java | d8c97fdbbec5e109a806f8783eb359a51725a164 | [] | no_license | anujsoni10001/JSP-Servlet | 2a87471945d3cfaa4b236b912b2608c60e463f1b | a212da0edc08535b1863181c9e9df04624eb7dc6 | refs/heads/main | 2023-05-26T10:25:03.100392 | 2021-06-12T15:20:16 | 2021-06-12T15:20:16 | 376,290,948 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,309 | java |
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pp.ProductBean;
/**
* Servlet implementation class delPro
*/
@WebServlet("/delPro")
public class delPro extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public delPro() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
*/
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
PrintWriter out=response.getWriter();
String id=request.getParameter("id");
ProductBean pb=new ProductBean();
pb.setId(id);
pp.RegisteredDao rd=new pp.RegisteredDao();
try {
int i=rd.delete(pb);
if(i!=0)
{
out.println(i+" Deletion Succesful.. ");
}
else
{
out.println(i+"Deletion Not Succesful.. ");
}
}
catch (Exception e) {
// TODO Auto-generated catch block
out.println(e);
}
}
}
| [
"anujsoni10001@gmail.com"
] | anujsoni10001@gmail.com |
199e7e6fc5746bf99668a602196e1f99e9fdced5 | eafd55a4ba0950fb8aad0369a00a8ebf9efd8ab0 | /src/SeleniumSessions/WebDriverBasics.java | 38c5ef97cb24bb9a3a72e15eae2a7525890333f7 | [] | no_license | santiagoolveramx/SeleniumCourseSantiago | 467208a59cedbb9676abbddf060d8ab398be44a0 | e44458a5df5d1b3c0ebba50b07259202dc2e4bdf | refs/heads/master | 2020-06-18T00:46:56.428290 | 2019-07-10T02:13:39 | 2019-07-10T02:13:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 986 | java | package SeleniumSessions;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class WebDriverBasics {
public static void main(String[] args) throws InterruptedException{
ChromeN();
}
public static void ChromeN(){
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("http://www.facebook.com");
String title = driver.getTitle();
System.out.println("All was done succefully, title of web is:\n"+title);
if(title.equals("Facebook - Inicia sesión o regístrate")){
System.out.println("Tille of the page is correct");
}else{
System.out.println("Tille of the page is wrong");
}
System.out.println(driver.getCurrentUrl());
//System.out.println(driver.getPageSource());
driver.quit();
}
}
| [
"39777122+santiago-olvera88@users.noreply.github.com"
] | 39777122+santiago-olvera88@users.noreply.github.com |
d4c36599dc65c8c056aeab19874babdae144af6d | 848271617c9f0b677e3e517a3642cf18b72e55ed | /app/src/main/java/com/cpigeon/cpigeonhelper/modular/usercenter/model/bean/UserLoginEntity.java | d7d52ace7c9364cb8107a55786c448f4cb7cc322 | [] | no_license | xiaohl-902/CHelperAndroid | 77e9c406e8b385bfadb1454395d215d5b7392e25 | 9a9c4262424d1b8bcb552720bbe8d48f1fa451df | refs/heads/master | 2020-04-06T13:08:34.183892 | 2019-01-25T08:31:18 | 2019-01-25T08:31:18 | 157,485,914 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 873 | java | package com.cpigeon.cpigeonhelper.modular.usercenter.model.bean;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
/**
* Created by Administrator on 2018/3/5.
*/
public class UserLoginEntity extends RealmObject {
@PrimaryKey
private int id;
private String userName; //用户名
private String userPasword;//用户密码
public UserLoginEntity(){
}
public UserLoginEntity(String userName, String userPasword) {
this.userName = userName;
this.userPasword = userPasword;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPasword() {
return userPasword;
}
public void setUserPasword(String userPasword) {
this.userPasword = userPasword;
}
}
| [
"656452024@qq.com"
] | 656452024@qq.com |
e3c1d6b9e9ccaedd6f725c76ddbbd56a515f4b85 | a2e7df56375f8367934651f74af9422cd26dd6cc | /project/XianWanService/src/com/xianwan/home/controller/DetailImageOperate.java | ad45ba9e8a4a7d6879e5790414c023e2d2361d08 | [] | no_license | lvxueqi666/eagleTeam | c84c59689d8a749bfad4a275232032d7a05d5bd3 | 6c7aea0f76132ea0b0c9fcb5f3874e55eda7b0b2 | refs/heads/master | 2020-07-17T15:44:48.719583 | 2020-06-01T14:57:10 | 2020-06-01T14:57:10 | 206,046,931 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,835 | java | package com.xianwan.home.controller;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.xianwan.home.service.DetailImageService;
import net.sf.json.JSONArray;
/**
* Servlet implementation class DetailImageOperate
*/
@WebServlet("/DetailImageOperate")
public class DetailImageOperate extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public DetailImageOperate() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
String userAccount = request.getParameter("userAccount");
String firstUrl = request.getParameter("firstUrl");
DetailImageService dis = new DetailImageService();
List<String> images = new ArrayList<>();
if(userAccount != null) {
images = dis.queryImageUrl(userAccount, firstUrl);
JSONArray jsonArray = JSONArray.fromObject( images );
System.out.println(jsonArray.toString());
response.getWriter().print(jsonArray.toString());
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"1254343464@qq.com"
] | 1254343464@qq.com |
b25c7e7fa430ac4858959981cb19a796895ba8ae | 89e92d7a6a1c6efeac4c2a771d57c53154b74512 | /src/com/inexisconsulting/service/CEO_AppraisalService.java | 7b5e67955143cb25b076fa02e7423069e2d44dad | [] | no_license | kasibkismath/InexisHR | fb5804e4ef4928ba7af99cb6eadbadd6be805268 | 538d0345f2a3145c5130690d6ff78fd6ed0c6ae2 | refs/heads/master | 2021-01-23T14:05:17.100191 | 2016-11-06T03:28:02 | 2016-11-06T03:28:02 | 55,955,802 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,263 | java | package com.inexisconsulting.service;
import java.text.ParseException;
import java.util.List;
import org.hibernate.HibernateException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.inexisconsulting.dao.CEO_Appraisal;
import com.inexisconsulting.dao.CEO_AppraisalDAO;
@Service("ceoAppraisalService")
public class CEO_AppraisalService {
@Autowired
private CEO_AppraisalDAO ceoAppraisalDao;
public void addCEOAppraisal(CEO_Appraisal ceo_appraisal) {
ceoAppraisalDao.addCEOAppraisal(ceo_appraisal);
}
public Long checkDuplicateCEOAppraisal(CEO_Appraisal ceo_appraisal) throws HibernateException, ParseException {
return ceoAppraisalDao.checkDuplicateCEOExists(ceo_appraisal);
}
public List<CEO_Appraisal> getCEOAppraisals() {
return ceoAppraisalDao.getCEOAppraisals();
}
public CEO_Appraisal getCEOAppraisalByAppraisalId(CEO_Appraisal ceoAppraisal) {
return ceoAppraisalDao.getCEOAppraisalByAppraisalId(ceoAppraisal);
}
public void updateCEOAppraisal(CEO_Appraisal ceo_Appraisal) {
ceoAppraisalDao.updateCEOAppraisal(ceo_Appraisal);
}
public void deleteCEOAppraisal(CEO_Appraisal ceo_Appraisal) {
ceoAppraisalDao.deleteCEOAppraisal(ceo_Appraisal);
}
}
| [
"kasibkismath@gmail.com"
] | kasibkismath@gmail.com |
8f9cac6b7e7168085af453c8e429118b05740a96 | e829a30f1ffe88086ec5d6e3dad205dbd3e56c1c | /src/emil/magerramov/expression/ParenthesizedPrimary.java | 26bade9e20340a3dbddb60f3be8e515193f98fda | [] | no_license | lemhell/IntroCalculator | 303cfd2c95e2417b0280ce9300966ce3f0fa8636 | 5efc5a5aec3a21e6ca40c9959a5e0a2d14f0738a | refs/heads/master | 2020-09-27T02:27:14.783966 | 2016-09-14T15:21:16 | 2016-09-14T15:21:16 | 67,311,258 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 950 | java | package emil.magerramov.expression;
import emil.magerramov.evaluation.Result;
import emil.magerramov.exception.EvaluationException;
import emil.magerramov.util.Util;
/**
* Created by lemhell on 02.09.16.
*/
public class ParenthesizedPrimary extends Primary {
private Expression expression;
public ParenthesizedPrimary(Expression expression) {
this.expression = expression;
}
public Expression getExpression() {
return expression;
}
public Result eval() throws EvaluationException {
return expression.eval();
}
public String toString() {
return "Parens(" + expression + ")";
}
@Override
public String serialize(int level) {
String tab = Util.tab(level);
return "{\n" +
tab + "\"type\": \"Parens\",\n" +
tab + "\"value\": " + expression.serialize(level + 1) +
"\n" + Util.tab(level - 1) + "}";
}
}
| [
"lemhell@gmail.com"
] | lemhell@gmail.com |
d0e3a3b92abcfa518c8366f8a079b96cdba15487 | 6c446fdf8f776e3b4ec9ad2bf894588edc750c6b | /Swing/app/src/main/java/com/kidsdynamic/swing/presenter/DashboardRequestFragment.java | 58fda550a28fed997577ca8e1ab28123b9093f3e | [] | no_license | ucicloud/AndroidSwing | 34275b21d9858f3ee3e365c750ab2d28b0bac4fb | 14f0a2f1e04c5802b4732ec3280de09b27f79bd7 | refs/heads/master | 2021-09-10T10:05:05.906062 | 2018-03-24T08:18:08 | 2018-03-24T08:18:08 | 106,516,205 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,081 | java | package com.kidsdynamic.swing.presenter;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.kidsdynamic.swing.R;
import java.util.Random;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* DashboardRequestFragment
* <p>
* Created by Stefan on 2017/11/7.
*/
public class DashboardRequestFragment extends DashboardBaseFragment {
@BindView(R.id.dashboard_request_message)
TextView tvMessage;
@BindView(R.id.dashboard_request_access)
TextView tvAccess;
public static DashboardRequestFragment newInstance() {
Bundle args = new Bundle();
DashboardRequestFragment fragment = new DashboardRequestFragment();
fragment.setArguments(args);
return fragment;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View layout = inflater.inflate(R.layout.fragment_dashboard_request, container, false);
ButterKnife.bind(this, layout);
return layout;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
tv_title.setTextColor(getResources().getColor(R.color.colorAccent));
tv_title.setText(R.string.title_dashboard);
// view_left_action.setImageResource(R.drawable.icon_left);
// just test
int random = new Random().nextInt();
if (random % 2 == 0) {
tvMessage.setText(R.string.dashboard_request_no_data);
tvAccess.setVisibility(View.VISIBLE);
} else {
tvMessage.setText(R.string.dashboard_request_pending);
}
}
@OnClick(R.id.dashboard_request_access)
public void request() {
}
@OnClick(R.id.dashboard_request_profile)
public void goToProfile() {
}
}
| [
"zsfenggy@126.com"
] | zsfenggy@126.com |
f39325dcb81cd21ddf1c63bbe867785ac87e20fe | 6f7ebc484c4c5c37c2e6072ffb12678bb060d6cf | /app/src/main/java/th/co/thiensurat/ecatalog/api/result/AllItemResult.java | 8479151e3c2cb990159e55584fc72595ec542a3b | [] | no_license | tsrmobile/ECatalog | 8e6a4173709ed3c924d630cbf73352b66d74f9ba | f2a17a2f86c8b57b36e5496aae1dae1bba11c477 | refs/heads/master | 2021-09-12T15:26:26.630477 | 2018-04-18T01:48:41 | 2018-04-18T01:48:45 | 111,789,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,278 | java | package th.co.thiensurat.ecatalog.api.result;
import java.util.Date;
/**
* Created by teerayut.k on 11/8/2017.
*/
public class AllItemResult {
private String orderid;
private String productname;
private String title;
private String firstname;
private String lastname;
private String province;
private String orderstatus;
private String statusdetail;
private String checkdate;
private String canceldate;
private String closedate;
public AllItemResult() {
}
public String getOrderid() {
return orderid;
}
public void setOrderid(String orderid) {
this.orderid = orderid;
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getOrderstatus() {
return orderstatus;
}
public void setOrderstatus(String orderstatus) {
this.orderstatus = orderstatus;
}
public String getStatusdetail() {
return statusdetail;
}
public void setStatusdetail(String statusdetail) {
this.statusdetail = statusdetail;
}
public String getCheckdate() {
return checkdate;
}
public void setCheckdate(String checkdate) {
this.checkdate = checkdate;
}
public String getCanceldate() {
return canceldate;
}
public void setCanceldate(String canceldate) {
this.canceldate = canceldate;
}
public String getClosedate() {
return closedate;
}
public void setClosedate(String closedate) {
this.closedate = closedate;
}
}
| [
"teerayut.k@thiensurat.co.th"
] | teerayut.k@thiensurat.co.th |
fa266d49a8c520c89247f90f7edd9f9cc0dd2cab | 1370675cb828abbd80e0b7eada370242d9143373 | /src/com/jyami/leetCode/problem/Solution824.java | ae0f15cd3bb5e9366ba833e7a31d46d7ba5db367 | [] | no_license | mihabin/Algorithm | c8574bd4a841792c7a76c3d01acb0b1cc0faf0be | d0ad2be2fadadd2a7b5778a014d723dd09f1e32e | refs/heads/master | 2022-12-04T09:57:04.366108 | 2020-08-29T07:12:35 | 2020-08-29T07:12:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 995 | java | package com.jyami.leetCode.problem;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by jyami on 2020/08/19
*/
public class Solution824 {
List<Character> letter = Arrays.asList('A', 'E', 'I', 'O', 'U', 'a', 'e', 'i', 'o', 'u');
public String toGoatLatin(String S) {
String[] sentence = S.split(" ");
for (int i = 0; i < sentence.length; i++) {
char first = sentence[i].charAt(0);
if (!letter.contains(first)) {
sentence[i] = sentence[i].substring(1) + first;
}
sentence[i] = sentence[i] + iterateStringA(i + 1);
}
return Arrays.stream(sentence).collect(Collectors.joining(" "));
}
private String iterateStringA(int iterateNum) {
StringBuilder sb = new StringBuilder();
sb.append("ma");
for (int i = 0; i < iterateNum; i++) {
sb.append("a");
}
return sb.toString();
}
}
| [
"mor2222@naver.com"
] | mor2222@naver.com |
d3155579f90f4084b0e1a2284f93e88d0bb58778 | cec0c2fa585c3f788fc8becf24365e56bce94368 | /net/minecraft/server/commands/ScoreboardCommand.java | f6e49fd49024b88bffb3ab21f6c245e5af902706 | [] | no_license | maksym-pasichnyk/Server-1.16.3-Remapped | 358f3c4816cbf41e137947329389edf24e9c6910 | 4d992e2d9d4ada3ecf7cecc039c4aa0083bc461e | refs/heads/master | 2022-12-15T08:54:21.236174 | 2020-09-19T16:13:43 | 2020-09-19T16:13:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 32,238 | java | /* */ package net.minecraft.server.commands;
/* */
/* */ import com.google.common.collect.Lists;
/* */ import com.mojang.brigadier.CommandDispatcher;
/* */ import com.mojang.brigadier.Message;
/* */ import com.mojang.brigadier.arguments.ArgumentType;
/* */ import com.mojang.brigadier.arguments.IntegerArgumentType;
/* */ import com.mojang.brigadier.arguments.StringArgumentType;
/* */ import com.mojang.brigadier.builder.ArgumentBuilder;
/* */ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
/* */ import com.mojang.brigadier.builder.RequiredArgumentBuilder;
/* */ import com.mojang.brigadier.context.CommandContext;
/* */ import com.mojang.brigadier.exceptions.CommandSyntaxException;
/* */ import com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType;
/* */ import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
/* */ import com.mojang.brigadier.suggestion.Suggestions;
/* */ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
/* */ import java.util.Collection;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import java.util.concurrent.CompletableFuture;
/* */ import net.minecraft.commands.CommandSourceStack;
/* */ import net.minecraft.commands.Commands;
/* */ import net.minecraft.commands.SharedSuggestionProvider;
/* */ import net.minecraft.commands.arguments.ComponentArgument;
/* */ import net.minecraft.commands.arguments.ObjectiveArgument;
/* */ import net.minecraft.commands.arguments.ObjectiveCriteriaArgument;
/* */ import net.minecraft.commands.arguments.OperationArgument;
/* */ import net.minecraft.commands.arguments.ScoreHolderArgument;
/* */ import net.minecraft.commands.arguments.ScoreboardSlotArgument;
/* */ import net.minecraft.network.chat.Component;
/* */ import net.minecraft.network.chat.ComponentUtils;
/* */ import net.minecraft.network.chat.TextComponent;
/* */ import net.minecraft.network.chat.TranslatableComponent;
/* */ import net.minecraft.server.ServerScoreboard;
/* */ import net.minecraft.world.scores.Objective;
/* */ import net.minecraft.world.scores.Score;
/* */ import net.minecraft.world.scores.Scoreboard;
/* */ import net.minecraft.world.scores.criteria.ObjectiveCriteria;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ScoreboardCommand
/* */ {
/* 54 */ private static final SimpleCommandExceptionType ERROR_OBJECTIVE_ALREADY_EXISTS = new SimpleCommandExceptionType((Message)new TranslatableComponent("commands.scoreboard.objectives.add.duplicate"));
/* 55 */ private static final SimpleCommandExceptionType ERROR_DISPLAY_SLOT_ALREADY_EMPTY = new SimpleCommandExceptionType((Message)new TranslatableComponent("commands.scoreboard.objectives.display.alreadyEmpty"));
/* 56 */ private static final SimpleCommandExceptionType ERROR_DISPLAY_SLOT_ALREADY_SET = new SimpleCommandExceptionType((Message)new TranslatableComponent("commands.scoreboard.objectives.display.alreadySet"));
/* 57 */ private static final SimpleCommandExceptionType ERROR_TRIGGER_ALREADY_ENABLED = new SimpleCommandExceptionType((Message)new TranslatableComponent("commands.scoreboard.players.enable.failed")); private static final Dynamic2CommandExceptionType ERROR_NO_VALUE;
/* 58 */ private static final SimpleCommandExceptionType ERROR_NOT_TRIGGER = new SimpleCommandExceptionType((Message)new TranslatableComponent("commands.scoreboard.players.enable.invalid")); static {
/* 59 */ ERROR_NO_VALUE = new Dynamic2CommandExceptionType((debug0, debug1) -> new TranslatableComponent("commands.scoreboard.players.get.null", new Object[] { debug0, debug1 }));
/* */ }
/* */ public static void register(CommandDispatcher<CommandSourceStack> debug0) {
/* 62 */ debug0.register(
/* 63 */ (LiteralArgumentBuilder)((LiteralArgumentBuilder)((LiteralArgumentBuilder)Commands.literal("scoreboard")
/* 64 */ .requires(debug0 -> debug0.hasPermission(2)))
/* 65 */ .then((
/* 66 */ (LiteralArgumentBuilder)((LiteralArgumentBuilder)((LiteralArgumentBuilder)((LiteralArgumentBuilder)Commands.literal("objectives")
/* 67 */ .then(
/* 68 */ Commands.literal("list")
/* 69 */ .executes(debug0 -> listObjectives((CommandSourceStack)debug0.getSource()))))
/* */
/* 71 */ .then(
/* 72 */ Commands.literal("add")
/* 73 */ .then(
/* 74 */ Commands.argument("objective", (ArgumentType)StringArgumentType.word())
/* 75 */ .then((
/* 76 */ (RequiredArgumentBuilder)Commands.argument("criteria", (ArgumentType)ObjectiveCriteriaArgument.criteria())
/* 77 */ .executes(debug0 -> addObjective((CommandSourceStack)debug0.getSource(), StringArgumentType.getString(debug0, "objective"), ObjectiveCriteriaArgument.getCriteria(debug0, "criteria"), (Component)new TextComponent(StringArgumentType.getString(debug0, "objective")))))
/* 78 */ .then(
/* 79 */ Commands.argument("displayName", (ArgumentType)ComponentArgument.textComponent())
/* 80 */ .executes(debug0 -> addObjective((CommandSourceStack)debug0.getSource(), StringArgumentType.getString(debug0, "objective"), ObjectiveCriteriaArgument.getCriteria(debug0, "criteria"), ComponentArgument.getComponent(debug0, "displayName"))))))))
/* */
/* */
/* */
/* */
/* 85 */ .then(
/* 86 */ Commands.literal("modify")
/* 87 */ .then((
/* 88 */ (RequiredArgumentBuilder)Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 89 */ .then(
/* 90 */ Commands.literal("displayname")
/* 91 */ .then(
/* 92 */ Commands.argument("displayName", (ArgumentType)ComponentArgument.textComponent())
/* 93 */ .executes(debug0 -> setDisplayName((CommandSourceStack)debug0.getSource(), ObjectiveArgument.getObjective(debug0, "objective"), ComponentArgument.getComponent(debug0, "displayName"))))))
/* */
/* 95 */ .then((ArgumentBuilder)createRenderTypeModify()))))
/* */
/* */
/* 98 */ .then(
/* 99 */ Commands.literal("remove")
/* 100 */ .then(
/* 101 */ Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 102 */ .executes(debug0 -> removeObjective((CommandSourceStack)debug0.getSource(), ObjectiveArgument.getObjective(debug0, "objective"))))))
/* */
/* */
/* 105 */ .then(
/* 106 */ Commands.literal("setdisplay")
/* 107 */ .then((
/* 108 */ (RequiredArgumentBuilder)Commands.argument("slot", (ArgumentType)ScoreboardSlotArgument.displaySlot())
/* 109 */ .executes(debug0 -> clearDisplaySlot((CommandSourceStack)debug0.getSource(), ScoreboardSlotArgument.getDisplaySlot(debug0, "slot"))))
/* 110 */ .then(
/* 111 */ Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 112 */ .executes(debug0 -> setDisplaySlot((CommandSourceStack)debug0.getSource(), ScoreboardSlotArgument.getDisplaySlot(debug0, "slot"), ObjectiveArgument.getObjective(debug0, "objective"))))))))
/* */
/* */
/* */
/* */
/* 117 */ .then((
/* 118 */ (LiteralArgumentBuilder)((LiteralArgumentBuilder)((LiteralArgumentBuilder)((LiteralArgumentBuilder)((LiteralArgumentBuilder)((LiteralArgumentBuilder)((LiteralArgumentBuilder)Commands.literal("players")
/* 119 */ .then((
/* 120 */ (LiteralArgumentBuilder)Commands.literal("list")
/* 121 */ .executes(debug0 -> listTrackedPlayers((CommandSourceStack)debug0.getSource())))
/* 122 */ .then(
/* 123 */ Commands.argument("target", (ArgumentType)ScoreHolderArgument.scoreHolder())
/* 124 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 125 */ .executes(debug0 -> listTrackedPlayerScores((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getName(debug0, "target"))))))
/* */
/* */
/* 128 */ .then(
/* 129 */ Commands.literal("set")
/* 130 */ .then(
/* 131 */ Commands.argument("targets", (ArgumentType)ScoreHolderArgument.scoreHolders())
/* 132 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 133 */ .then(
/* 134 */ Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 135 */ .then(
/* 136 */ Commands.argument("score", (ArgumentType)IntegerArgumentType.integer())
/* 137 */ .executes(debug0 -> setScore((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "targets"), ObjectiveArgument.getWritableObjective(debug0, "objective"), IntegerArgumentType.getInteger(debug0, "score"))))))))
/* */
/* */
/* */
/* */
/* 142 */ .then(
/* 143 */ Commands.literal("get")
/* 144 */ .then(
/* 145 */ Commands.argument("target", (ArgumentType)ScoreHolderArgument.scoreHolder())
/* 146 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 147 */ .then(
/* 148 */ Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 149 */ .executes(debug0 -> getScore((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getName(debug0, "target"), ObjectiveArgument.getObjective(debug0, "objective")))))))
/* */
/* */
/* */
/* 153 */ .then(
/* 154 */ Commands.literal("add")
/* 155 */ .then(
/* 156 */ Commands.argument("targets", (ArgumentType)ScoreHolderArgument.scoreHolders())
/* 157 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 158 */ .then(
/* 159 */ Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 160 */ .then(
/* 161 */ Commands.argument("score", (ArgumentType)IntegerArgumentType.integer(0))
/* 162 */ .executes(debug0 -> addScore((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "targets"), ObjectiveArgument.getWritableObjective(debug0, "objective"), IntegerArgumentType.getInteger(debug0, "score"))))))))
/* */
/* */
/* */
/* */
/* 167 */ .then(
/* 168 */ Commands.literal("remove")
/* 169 */ .then(
/* 170 */ Commands.argument("targets", (ArgumentType)ScoreHolderArgument.scoreHolders())
/* 171 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 172 */ .then(
/* 173 */ Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 174 */ .then(
/* 175 */ Commands.argument("score", (ArgumentType)IntegerArgumentType.integer(0))
/* 176 */ .executes(debug0 -> removeScore((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "targets"), ObjectiveArgument.getWritableObjective(debug0, "objective"), IntegerArgumentType.getInteger(debug0, "score"))))))))
/* */
/* */
/* */
/* */
/* 181 */ .then(
/* 182 */ Commands.literal("reset")
/* 183 */ .then((
/* 184 */ (RequiredArgumentBuilder)Commands.argument("targets", (ArgumentType)ScoreHolderArgument.scoreHolders())
/* 185 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 186 */ .executes(debug0 -> resetScores((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "targets"))))
/* 187 */ .then(
/* 188 */ Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 189 */ .executes(debug0 -> resetScore((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "targets"), ObjectiveArgument.getObjective(debug0, "objective")))))))
/* */
/* */
/* */
/* 193 */ .then(
/* 194 */ Commands.literal("enable")
/* 195 */ .then(
/* 196 */ Commands.argument("targets", (ArgumentType)ScoreHolderArgument.scoreHolders())
/* 197 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 198 */ .then(
/* 199 */ Commands.argument("objective", (ArgumentType)ObjectiveArgument.objective())
/* 200 */ .suggests((debug0, debug1) -> suggestTriggers((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "targets"), debug1))
/* 201 */ .executes(debug0 -> enableTrigger((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "targets"), ObjectiveArgument.getObjective(debug0, "objective")))))))
/* */
/* */
/* */
/* 205 */ .then(
/* 206 */ Commands.literal("operation")
/* 207 */ .then(
/* 208 */ Commands.argument("targets", (ArgumentType)ScoreHolderArgument.scoreHolders())
/* 209 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 210 */ .then(
/* 211 */ Commands.argument("targetObjective", (ArgumentType)ObjectiveArgument.objective())
/* 212 */ .then(
/* 213 */ Commands.argument("operation", (ArgumentType)OperationArgument.operation())
/* 214 */ .then(
/* 215 */ Commands.argument("source", (ArgumentType)ScoreHolderArgument.scoreHolders())
/* 216 */ .suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)
/* 217 */ .then(
/* 218 */ Commands.argument("sourceObjective", (ArgumentType)ObjectiveArgument.objective())
/* 219 */ .executes(debug0 -> performOperation((CommandSourceStack)debug0.getSource(), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "targets"), ObjectiveArgument.getWritableObjective(debug0, "targetObjective"), OperationArgument.getOperation(debug0, "operation"), ScoreHolderArgument.getNamesWithDefaultWildcard(debug0, "source"), ObjectiveArgument.getObjective(debug0, "sourceObjective")))))))))));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private static LiteralArgumentBuilder<CommandSourceStack> createRenderTypeModify() {
/* 231 */ LiteralArgumentBuilder<CommandSourceStack> debug0 = Commands.literal("rendertype");
/* */
/* 233 */ for (ObjectiveCriteria.RenderType debug4 : ObjectiveCriteria.RenderType.values()) {
/* 234 */ debug0.then(Commands.literal(debug4.getId())
/* 235 */ .executes(debug1 -> setRenderType((CommandSourceStack)debug1.getSource(), ObjectiveArgument.getObjective(debug1, "objective"), debug0)));
/* */ }
/* */
/* 238 */ return debug0;
/* */ }
/* */
/* */ private static CompletableFuture<Suggestions> suggestTriggers(CommandSourceStack debug0, Collection<String> debug1, SuggestionsBuilder debug2) {
/* 242 */ List<String> debug3 = Lists.newArrayList();
/* 243 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* */
/* 245 */ for (Objective debug6 : serverScoreboard.getObjectives()) {
/* 246 */ if (debug6.getCriteria() == ObjectiveCriteria.TRIGGER) {
/* 247 */ boolean debug7 = false;
/* 248 */ for (String debug9 : debug1) {
/* 249 */ if (!serverScoreboard.hasPlayerScore(debug9, debug6) || serverScoreboard.getOrCreatePlayerScore(debug9, debug6).isLocked()) {
/* 250 */ debug7 = true;
/* */ break;
/* */ }
/* */ }
/* 254 */ if (debug7) {
/* 255 */ debug3.add(debug6.getName());
/* */ }
/* */ }
/* */ }
/* */
/* 260 */ return SharedSuggestionProvider.suggest(debug3, debug2);
/* */ }
/* */
/* */ private static int getScore(CommandSourceStack debug0, String debug1, Objective debug2) throws CommandSyntaxException {
/* 264 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* 265 */ if (!serverScoreboard.hasPlayerScore(debug1, debug2)) {
/* 266 */ throw ERROR_NO_VALUE.create(debug2.getName(), debug1);
/* */ }
/* */
/* 269 */ Score debug4 = serverScoreboard.getOrCreatePlayerScore(debug1, debug2);
/* 270 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.get.success", new Object[] { debug1, Integer.valueOf(debug4.getScore()), debug2.getFormattedDisplayName() }), false);
/* */
/* 272 */ return debug4.getScore();
/* */ }
/* */
/* */ private static int performOperation(CommandSourceStack debug0, Collection<String> debug1, Objective debug2, OperationArgument.Operation debug3, Collection<String> debug4, Objective debug5) throws CommandSyntaxException {
/* 276 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* 277 */ int debug7 = 0;
/* */
/* 279 */ for (String debug9 : debug1) {
/* 280 */ Score debug10 = serverScoreboard.getOrCreatePlayerScore(debug9, debug2);
/* 281 */ for (String debug12 : debug4) {
/* 282 */ Score debug13 = serverScoreboard.getOrCreatePlayerScore(debug12, debug5);
/* 283 */ debug3.apply(debug10, debug13);
/* */ }
/* 285 */ debug7 += debug10.getScore();
/* */ }
/* */
/* 288 */ if (debug1.size() == 1) {
/* 289 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.operation.success.single", new Object[] { debug2.getFormattedDisplayName(), debug1.iterator().next(), Integer.valueOf(debug7) }), true);
/* */ } else {
/* 291 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.operation.success.multiple", new Object[] { debug2.getFormattedDisplayName(), Integer.valueOf(debug1.size()) }), true);
/* */ }
/* */
/* 294 */ return debug7;
/* */ }
/* */
/* */ private static int enableTrigger(CommandSourceStack debug0, Collection<String> debug1, Objective debug2) throws CommandSyntaxException {
/* 298 */ if (debug2.getCriteria() != ObjectiveCriteria.TRIGGER) {
/* 299 */ throw ERROR_NOT_TRIGGER.create();
/* */ }
/* 301 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* */
/* 303 */ int debug4 = 0;
/* */
/* 305 */ for (String debug6 : debug1) {
/* 306 */ Score debug7 = serverScoreboard.getOrCreatePlayerScore(debug6, debug2);
/* 307 */ if (debug7.isLocked()) {
/* 308 */ debug7.setLocked(false);
/* 309 */ debug4++;
/* */ }
/* */ }
/* */
/* 313 */ if (debug4 == 0) {
/* 314 */ throw ERROR_TRIGGER_ALREADY_ENABLED.create();
/* */ }
/* */
/* 317 */ if (debug1.size() == 1) {
/* 318 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.enable.success.single", new Object[] { debug2.getFormattedDisplayName(), debug1.iterator().next() }), true);
/* */ } else {
/* 320 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.enable.success.multiple", new Object[] { debug2.getFormattedDisplayName(), Integer.valueOf(debug1.size()) }), true);
/* */ }
/* */
/* 323 */ return debug4;
/* */ }
/* */
/* */ private static int resetScores(CommandSourceStack debug0, Collection<String> debug1) {
/* 327 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* */
/* 329 */ for (String debug4 : debug1) {
/* 330 */ serverScoreboard.resetPlayerScore(debug4, null);
/* */ }
/* */
/* 333 */ if (debug1.size() == 1) {
/* 334 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.reset.all.single", new Object[] { debug1.iterator().next() }), true);
/* */ } else {
/* 336 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.reset.all.multiple", new Object[] { Integer.valueOf(debug1.size()) }), true);
/* */ }
/* */
/* 339 */ return debug1.size();
/* */ }
/* */
/* */ private static int resetScore(CommandSourceStack debug0, Collection<String> debug1, Objective debug2) {
/* 343 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* */
/* 345 */ for (String debug5 : debug1) {
/* 346 */ serverScoreboard.resetPlayerScore(debug5, debug2);
/* */ }
/* */
/* 349 */ if (debug1.size() == 1) {
/* 350 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.reset.specific.single", new Object[] { debug2.getFormattedDisplayName(), debug1.iterator().next() }), true);
/* */ } else {
/* 352 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.reset.specific.multiple", new Object[] { debug2.getFormattedDisplayName(), Integer.valueOf(debug1.size()) }), true);
/* */ }
/* */
/* 355 */ return debug1.size();
/* */ }
/* */
/* */ private static int setScore(CommandSourceStack debug0, Collection<String> debug1, Objective debug2, int debug3) {
/* 359 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* */
/* 361 */ for (String debug6 : debug1) {
/* 362 */ Score debug7 = serverScoreboard.getOrCreatePlayerScore(debug6, debug2);
/* 363 */ debug7.setScore(debug3);
/* */ }
/* */
/* 366 */ if (debug1.size() == 1) {
/* 367 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.set.success.single", new Object[] { debug2.getFormattedDisplayName(), debug1.iterator().next(), Integer.valueOf(debug3) }), true);
/* */ } else {
/* 369 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.set.success.multiple", new Object[] { debug2.getFormattedDisplayName(), Integer.valueOf(debug1.size()), Integer.valueOf(debug3) }), true);
/* */ }
/* */
/* 372 */ return debug3 * debug1.size();
/* */ }
/* */
/* */ private static int addScore(CommandSourceStack debug0, Collection<String> debug1, Objective debug2, int debug3) {
/* 376 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* 377 */ int debug5 = 0;
/* */
/* 379 */ for (String debug7 : debug1) {
/* 380 */ Score debug8 = serverScoreboard.getOrCreatePlayerScore(debug7, debug2);
/* 381 */ debug8.setScore(debug8.getScore() + debug3);
/* 382 */ debug5 += debug8.getScore();
/* */ }
/* */
/* 385 */ if (debug1.size() == 1) {
/* 386 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.add.success.single", new Object[] { Integer.valueOf(debug3), debug2.getFormattedDisplayName(), debug1.iterator().next(), Integer.valueOf(debug5) }), true);
/* */ } else {
/* 388 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.add.success.multiple", new Object[] { Integer.valueOf(debug3), debug2.getFormattedDisplayName(), Integer.valueOf(debug1.size()) }), true);
/* */ }
/* */
/* 391 */ return debug5;
/* */ }
/* */
/* */ private static int removeScore(CommandSourceStack debug0, Collection<String> debug1, Objective debug2, int debug3) {
/* 395 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* 396 */ int debug5 = 0;
/* */
/* 398 */ for (String debug7 : debug1) {
/* 399 */ Score debug8 = serverScoreboard.getOrCreatePlayerScore(debug7, debug2);
/* 400 */ debug8.setScore(debug8.getScore() - debug3);
/* 401 */ debug5 += debug8.getScore();
/* */ }
/* */
/* 404 */ if (debug1.size() == 1) {
/* 405 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.remove.success.single", new Object[] { Integer.valueOf(debug3), debug2.getFormattedDisplayName(), debug1.iterator().next(), Integer.valueOf(debug5) }), true);
/* */ } else {
/* 407 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.remove.success.multiple", new Object[] { Integer.valueOf(debug3), debug2.getFormattedDisplayName(), Integer.valueOf(debug1.size()) }), true);
/* */ }
/* */
/* 410 */ return debug5;
/* */ }
/* */
/* */ private static int listTrackedPlayers(CommandSourceStack debug0) {
/* 414 */ Collection<String> debug1 = debug0.getServer().getScoreboard().getTrackedPlayers();
/* */
/* 416 */ if (debug1.isEmpty()) {
/* 417 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.list.empty"), false);
/* */ } else {
/* 419 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.list.success", new Object[] { Integer.valueOf(debug1.size()), ComponentUtils.formatList(debug1) }), false);
/* */ }
/* */
/* 422 */ return debug1.size();
/* */ }
/* */
/* */ private static int listTrackedPlayerScores(CommandSourceStack debug0, String debug1) {
/* 426 */ Map<Objective, Score> debug2 = debug0.getServer().getScoreboard().getPlayerScores(debug1);
/* */
/* 428 */ if (debug2.isEmpty()) {
/* 429 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.list.entity.empty", new Object[] { debug1 }), false);
/* */ } else {
/* 431 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.list.entity.success", new Object[] { debug1, Integer.valueOf(debug2.size()) }), false);
/* 432 */ for (Map.Entry<Objective, Score> debug4 : debug2.entrySet()) {
/* 433 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.players.list.entity.entry", new Object[] { ((Objective)debug4.getKey()).getFormattedDisplayName(), Integer.valueOf(((Score)debug4.getValue()).getScore()) }), false);
/* */ }
/* */ }
/* */
/* 437 */ return debug2.size();
/* */ }
/* */
/* */ private static int clearDisplaySlot(CommandSourceStack debug0, int debug1) throws CommandSyntaxException {
/* 441 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* */
/* 443 */ if (serverScoreboard.getDisplayObjective(debug1) == null) {
/* 444 */ throw ERROR_DISPLAY_SLOT_ALREADY_EMPTY.create();
/* */ }
/* */
/* 447 */ serverScoreboard.setDisplayObjective(debug1, null);
/* 448 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.objectives.display.cleared", new Object[] { Scoreboard.getDisplaySlotNames()[debug1] }), true);
/* */
/* 450 */ return 0;
/* */ }
/* */
/* */ private static int setDisplaySlot(CommandSourceStack debug0, int debug1, Objective debug2) throws CommandSyntaxException {
/* 454 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* */
/* 456 */ if (serverScoreboard.getDisplayObjective(debug1) == debug2) {
/* 457 */ throw ERROR_DISPLAY_SLOT_ALREADY_SET.create();
/* */ }
/* */
/* 460 */ serverScoreboard.setDisplayObjective(debug1, debug2);
/* 461 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.objectives.display.set", new Object[] { Scoreboard.getDisplaySlotNames()[debug1], debug2.getDisplayName() }), true);
/* */
/* 463 */ return 0;
/* */ }
/* */
/* */ private static int setDisplayName(CommandSourceStack debug0, Objective debug1, Component debug2) {
/* 467 */ if (!debug1.getDisplayName().equals(debug2)) {
/* 468 */ debug1.setDisplayName(debug2);
/* 469 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.objectives.modify.displayname", new Object[] { debug1.getName(), debug1.getFormattedDisplayName() }), true);
/* */ }
/* */
/* 472 */ return 0;
/* */ }
/* */
/* */ private static int setRenderType(CommandSourceStack debug0, Objective debug1, ObjectiveCriteria.RenderType debug2) {
/* 476 */ if (debug1.getRenderType() != debug2) {
/* 477 */ debug1.setRenderType(debug2);
/* 478 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.objectives.modify.rendertype", new Object[] { debug1.getFormattedDisplayName() }), true);
/* */ }
/* */
/* 481 */ return 0;
/* */ }
/* */
/* */ private static int removeObjective(CommandSourceStack debug0, Objective debug1) {
/* 485 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* 486 */ serverScoreboard.removeObjective(debug1);
/* 487 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.objectives.remove.success", new Object[] { debug1.getFormattedDisplayName() }), true);
/* 488 */ return serverScoreboard.getObjectives().size();
/* */ }
/* */
/* */ private static int addObjective(CommandSourceStack debug0, String debug1, ObjectiveCriteria debug2, Component debug3) throws CommandSyntaxException {
/* 492 */ ServerScoreboard serverScoreboard = debug0.getServer().getScoreboard();
/* */
/* 494 */ if (serverScoreboard.getObjective(debug1) != null) {
/* 495 */ throw ERROR_OBJECTIVE_ALREADY_EXISTS.create();
/* */ }
/* 497 */ if (debug1.length() > 16) {
/* 498 */ throw ObjectiveArgument.ERROR_OBJECTIVE_NAME_TOO_LONG.create(Integer.valueOf(16));
/* */ }
/* */
/* 501 */ serverScoreboard.addObjective(debug1, debug2, debug3, debug2.getDefaultRenderType());
/* 502 */ Objective debug5 = serverScoreboard.getObjective(debug1);
/* */
/* 504 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.objectives.add.success", new Object[] { debug5.getFormattedDisplayName() }), true);
/* */
/* 506 */ return serverScoreboard.getObjectives().size();
/* */ }
/* */
/* */ private static int listObjectives(CommandSourceStack debug0) {
/* 510 */ Collection<Objective> debug1 = debug0.getServer().getScoreboard().getObjectives();
/* */
/* 512 */ if (debug1.isEmpty()) {
/* 513 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.objectives.list.empty"), false);
/* */ } else {
/* 515 */ debug0.sendSuccess((Component)new TranslatableComponent("commands.scoreboard.objectives.list.success", new Object[] { Integer.valueOf(debug1.size()), ComponentUtils.formatList(debug1, Objective::getFormattedDisplayName) }), false);
/* */ }
/* */
/* 518 */ return debug1.size();
/* */ }
/* */ }
/* Location: C:\Users\Josep\Downloads\Decompile Minecraft\deobfuscated.jar!\net\minecraft\server\commands\ScoreboardCommand.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"tanksherman27@gmail.com"
] | tanksherman27@gmail.com |
82583d73cd76060291a0a80273cb87570cce4e70 | 297635ee26b144aef19412b8f82cf25cf039d0a9 | /src/main/java/middleware/org/models/LogoutRes.java | 70c943412bf84fc9e630ad269a3d9ec3d93ed868 | [] | no_license | shaikmaju/LoginUpdate | 6bde7c99ea48cc634bb2c2ab5b8d20214db9a7b1 | d2e49471a5529c6aad29fa069b98c0cfc28c8121 | refs/heads/master | 2020-03-27T18:20:22.682292 | 2018-09-17T11:59:06 | 2018-09-17T11:59:06 | 146,915,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,281 | java |
package middleware.org.models;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"modelId",
"transactionId",
"channel",
"errorCode",
"responseCode",
"logoutDateTime"
})
public class LogoutRes {
@JsonProperty("modelId")
private Integer modelId;
@JsonProperty("transactionId")
private String transactionId;
@JsonProperty("channel")
private String channel;
@JsonProperty("errorCode")
private Integer errorCode;
@JsonProperty("responseCode")
private Integer responseCode;
@JsonProperty("logoutDateTime")
private String logoutDateTime;
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("modelId")
public Integer getModelId() {
return modelId;
}
@JsonProperty("modelId")
public void setModelId(Integer modelId) {
this.modelId = modelId;
}
@JsonProperty("transactionId")
public String getTransactionId() {
return transactionId;
}
@JsonProperty("transactionId")
public void setTransactionId(String transactionId) {
this.transactionId = transactionId;
}
@JsonProperty("channel")
public String getChannel() {
return channel;
}
@JsonProperty("channel")
public void setChannel(String channel) {
this.channel = channel;
}
@JsonProperty("errorCode")
public Integer getErrorCode() {
return errorCode;
}
@JsonProperty("errorCode")
public void setErrorCode(Integer errorCode) {
this.errorCode = errorCode;
}
@JsonProperty("responseCode")
public Integer getResponseCode() {
return responseCode;
}
@JsonProperty("responseCode")
public void setResponseCode(Integer responseCode) {
this.responseCode = responseCode;
}
@JsonProperty("logoutDateTime")
public String getLogoutDateTime() {
return logoutDateTime;
}
@JsonProperty("logoutDateTime")
public void setLogoutDateTime(String logoutDateTime) {
this.logoutDateTime = logoutDateTime;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public boolean equals(Object other) {
return EqualsBuilder.reflectionEquals(this, other);
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
| [
"maju.chinnakonda@mrcubes.com"
] | maju.chinnakonda@mrcubes.com |
4c0bbef30ad5a1238ea3c9f75a86d26e4a764477 | b0f609de6f501afa685b767439e112d4aeefb28d | /cli/src/main/java/cloudeventbus/cli/AbstractClientOptions.java | c1d63644e5aa3834fabf8f70ba2ef7a873169c32 | [
"Apache-2.0"
] | permissive | cloudeventbus/cloudeventbus | f6a8fba21b5c63d29bc9318f8894bff5254499a3 | af4265ea062f02adb22943cd27198a0af12aff37 | refs/heads/master | 2021-03-12T19:38:43.154022 | 2013-08-08T17:46:02 | 2013-08-08T17:46:02 | 7,291,080 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,583 | java | /*
* Copyright (c) 2013 Mike Heath. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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 cloudeventbus.cli;
import cloudeventbus.client.Connector;
import cloudeventbus.pki.CertificateUtils;
import cloudeventbus.pki.TrustStore;
import com.beust.jcommander.Parameter;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
/**
* @author Mike Heath <elcapo@gmail.com>
*/
abstract class AbstractClientOptions extends DefaultOptions {
@Parameter(names = "-host", description = "Ths host the server is running on.")
String host = "localhost";
@Parameter(names = "-port", description = "The port the server will listen on.")
int port = 4223;
@Parameter(names = "-certificate", description = "The file containing the certificate used to identify the client.")
String certificate;
@Parameter(names = "-privateKey", description = "The file containing the private key for the client's certificate.")
String privateKey;
static Connector configureConnector(AbstractClientOptions options) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException {
final Connector connector = new Connector();
final TrustStore trustStore = CertificateUtils.loadTrustStore(options.trustStore);
if (trustStore != null && trustStore.size() > 0) {
System.out.println("Using trust store at: " + options.trustStore);
connector.trustStore(trustStore);
}
connector.addServer(options.host, options.port);
if (options.certificate != null) {
connector.certificateChain(CertificateUtils.loadCertificateChain(options.certificate));
System.out.println("Using certificate at: " + options.certificate);
if (options.privateKey == null) {
System.err.print("You must specify a private key when using a certificate.");
System.exit(1);
} else {
connector.privateKey(CertificateUtils.loadPrivateKey(options.privateKey));
System.out.println("Using private key at: " + options.privateKey);
}
}
return connector;
}
}
| [
"elcapo@gmail.com"
] | elcapo@gmail.com |
84c24475814ae691e86f10728dde496749ec9837 | 373293dce13b2b9b4a2efabda6c2e01173bcebdc | /module3/case_study_jsp_servlet_gradle/src/main/java/model/service/impl/EmployeeServiceImpl.java | 8ab911a97e27ac35f1ad57826e08f48295ee2465 | [] | no_license | haqh310/C0221G1-LeKhanhHa | e5a609923ffda07d152cfb6a80bc9bd92dc79309 | 04f7397e63570c7a6011421c59e829ade263a97b | refs/heads/main | 2023-06-27T21:21:25.119576 | 2021-08-02T01:32:12 | 2021-08-02T01:32:12 | 342,118,093 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,194 | java | package model.service.impl;
import model.bean.User.User;
import model.bean.employee.*;
import model.repository.EmployeeRepository;
import model.service.Interface.IEmployeeService;
import model.service.common.Validate;
import java.util.ArrayList;
import java.util.List;
public class EmployeeServiceImpl implements IEmployeeService {
EmployeeRepository employeeRepository = new EmployeeRepository();
Validate validate = new Validate();
@Override
public List<Employee> findAll() {
return employeeRepository.findAll();
}
@Override
public Employee findById(int employee_id) {
return employeeRepository.findById(employee_id);
}
@Override
public List<Employee> findByName(String name) {
return employeeRepository.findByName(name);
}
@Override
public List<String> insert(Employee employee) {
List<String> messages = new ArrayList<>();
boolean check=false;
messages.add(validate.validateDate(employee.getEmployee_birthday()));
messages.add(validate.validateIdCard(employee.getEmployee_id_card()));
messages.add(validate.validateTypeDouble(employee.getEmployee_salary()));
messages.add(validate.validatePhone(employee.getEmployee_phone()));
messages.add(validate.validateEmail(employee.getEmployee_email()));
for (String message: messages) {
if(message != null){
check=true;
break;
}
}
if(!check){
if( employeeRepository.insert(employee)){
messages.add("New employee was created");
}
}
return messages;
}
@Override
public List<String> update(int employee_id, Employee employee) {
List<String> messages = new ArrayList<>();
boolean check=false;
messages.add(validate.validateDate(employee.getEmployee_birthday()));
messages.add(validate.validateIdCard(employee.getEmployee_id_card()));
messages.add(validate.validateTypeDouble(employee.getEmployee_salary()));
messages.add(validate.validatePhone(employee.getEmployee_phone()));
messages.add(validate.validateEmail(employee.getEmployee_email()));
for (String message: messages) {
if(message != null){
check=true;
break;
}
}
if(!check){
if( employeeRepository.update(employee_id,employee)){
messages.add("Employee information was updated");
}
}
return messages;
}
@Override
public boolean remove(int employee_id) {
return employeeRepository.delete(employee_id);
}
@Override
public List<Position> findAllPosition() {
return employeeRepository.findAllPosition();
}
@Override
public List<EducationDegree> findAllEducationDegree() {
return employeeRepository.findAllEducationDegree();
}
@Override
public List<Division> findAllDivision() {
return employeeRepository.findAllDivision();
}
@Override
public List<User> findAllUser() {
return employeeRepository.findUser();
}
}
| [
"haqh310@gmail.com"
] | haqh310@gmail.com |
81d2fdd1c6d8490b4949f2fcfe92b088e96f629f | e8c0bd5abe4e4f8785d2e3a61dae085eca16b93b | /src/s300/P323.java | c3f1252137059dc869eaf474cb1092bee28b38d4 | [] | no_license | bigbluemachine/projecteuler | bd77dddbb710d6dad2fde023c333594bc647eb9d | a2bf8633c356f9c258b9282b501b61232ab5453d | refs/heads/master | 2021-05-16T02:25:36.307500 | 2016-11-23T20:47:18 | 2016-11-23T20:47:18 | 28,010,038 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 803 | java | package s300;
import java.util.Arrays;
import core.MathLib;
public class P323 {
static long c(int n, int k) {
return MathLib.fac(n).divide(MathLib.fac(k)).divide(MathLib.fac(n - k)).longValue();
}
static long w(int n, int z, int y) {
return c(z, z - y) * (1L << (n - z));
}
static double f(int n, int z, double[][] T) {
if (T[n][z] >= 0) {
return T[n][z];
}
if (z == 0) {
return T[n][z] = 0;
}
double s = 0;
double d = Math.pow(2.0, n);
for (int y = 0; y < z; y++) {
s += w(n, z, y) * f(n, y, T);
}
return T[n][z] = (1.0 + s / d) / (1.0 - w(n, z, z) / d);
}
public static void main(String[] args) {
int n = 32;
double[][] T = new double[n + 1][n + 1];
for (double[] TT : T) {
Arrays.fill(TT, -1);
}
System.out.printf("%.10f\n", f(n, n, T));
}
}
| [
"jeromeli89@gmail.com"
] | jeromeli89@gmail.com |
3c144d8cb2daf43cb95f1900c1e481d96b84f1e1 | 14cd2d0d0b003b53a13fb1b2358e5de034633544 | /app/src/main/java/com/kd/player/utils/ToastUtils.java | eebb83232b70d7869932ac002134353b027b293d | [] | no_license | CimZzz/player | 7aed4c13d80b4e06bbdd8fe8e4d130690171ccda | 957423eff23a0100d1c9d69c6149de3e801cc1b6 | refs/heads/master | 2022-09-10T21:16:57.536443 | 2020-05-20T03:30:19 | 2020-05-20T03:30:19 | 264,179,657 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 557 | java | package com.kd.player.utils;
import android.widget.Toast;
import com.kd.player.CustomApplication;
/**
* Anchor : Create by CimZzz
* Time : 2020/05/17 12:53:45
* Project : rtsp_android
* Since Version : Alpha
*/
public final class ToastUtils {
private static Toast toast;
public static void sendToast(Object message) {
if(toast != null) {
toast.cancel();
}
toast = Toast.makeText(CustomApplication.context, message != null ? message.toString() : "null", Toast.LENGTH_SHORT);
toast.show();
}
}
| [
"1152564696@qq.com"
] | 1152564696@qq.com |
a34c1a0cbcee8ae68c3b8f4c32a1661eafec3768 | 2dce1d353d064b9f4c6765a4b6460c38b8d20264 | /src/fractalzoomer/core/iteration_algorithm/FractalIterationAlgorithm.java | 7556b5fa41a8d83c24a175bee5fe201d4deb7e51 | [] | no_license | hrkalona/Fractal-Zoomer | 1fa30c531c46e4b25f8bfb33f70888f3b366771c | bcc3e1298b13e84b0730c67ffd6332e4e6575353 | refs/heads/master | 2023-08-30T08:54:46.594168 | 2023-08-15T11:41:26 | 2023-08-15T11:41:26 | 2,676,588 | 17 | 3 | null | 2023-08-15T11:41:27 | 2011-10-30T19:18:07 | Java | UTF-8 | Java | false | false | 1,809 | java | /*
* Fractal Zoomer, Copyright (C) 2020 hrkalona2
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fractalzoomer.core.iteration_algorithm;
import fractalzoomer.core.Complex;
import fractalzoomer.core.GenericComplex;
import fractalzoomer.functions.Fractal;
/**
*
* @author hrkalona2
*/
public class FractalIterationAlgorithm extends IterationAlgorithm {
public FractalIterationAlgorithm(Fractal fractal) {
super(fractal);
}
@Override
public double calculate(GenericComplex number) {
return fractal.calculateFractal(number);
}
@Override
public Complex calculateDomain(GenericComplex number) {
return fractal.calculateFractalDomain((Complex)number);
}
@Override
public void calculateOrbit() {
fractal.calculateFractalOrbit();
}
@Override
public double[] calculate3D(GenericComplex number) {
double value = fractal.calculateFractal(number);
return new double[] {fractal.getFractal3DHeight(value), value};
}
@Override
public boolean isJulia() {
return false;
}
}
| [
"hrkalona@gmail.com"
] | hrkalona@gmail.com |
825b5c496f0c43fc25bfc33612207147ee21f616 | 6f868f16b082d1d541a56c39b23b365436d62e8b | /Simulacion/src/edb/alggen/Resultado.java | aeac29fb2ffb0d9e976504b501a6a9e32463f20d | [] | no_license | sergioahv15/regresion-simbolica | d402703a6f5d930f2998a50e4a056aa41fcb5f7e | 51d1262fad58d70666de934c8acde666399e6cfe | refs/heads/master | 2021-01-10T04:57:34.373719 | 2011-04-26T00:08:47 | 2011-04-26T00:08:47 | 49,383,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edb.alggen;
/**
*
* @author Diego
*/
public class Resultado {
public String res;
public double error;
public Resultado(String r,double e){
res=r;
error=e;
}
}
| [
"dlchapetonm@00113ebc-45a7-e1cb-9a4a-ba52b35c2f78"
] | dlchapetonm@00113ebc-45a7-e1cb-9a4a-ba52b35c2f78 |
5c37edd3b94b824c5502eb327b9276f4c9efe8fa | 607f1ed64c9963090646c4906a4103ba28302b8d | /src/test/java/Runner/TestRunner.java | 2c364df5bdd3c1c06b011ebc54d6c306afbe6991 | [] | no_license | dhimasadiyasapro/mobile-test-v2 | 13d2c64af4ab2f8f24f7fecea6e747f4b75934b8 | 9c51dcae5bc87ff2fb9d5a303ab884cc88ec7e66 | refs/heads/master | 2020-04-12T08:19:00.979160 | 2018-11-22T21:14:50 | 2018-11-22T21:14:50 | 162,380,191 | 1 | 0 | null | 2018-12-19T03:55:10 | 2018-12-19T03:55:10 | null | UTF-8 | Java | false | false | 920 | java | package Runner;
import com.vimalselvam.cucumber.listener.Reporter;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.AfterClass;
import org.junit.runner.RunWith;
import java.io.File;
/**
* Cucumber test runner
*/
@RunWith(Cucumber.class) //JUnit
@CucumberOptions(
features = {"src/test/resources/Features"},
glue = {"steps", "hooks"},
tags = {"@smoke"},
format = {"json:target/reports/cucumber.json"},
plugin = {"com.vimalselvam.cucumber.listener.ExtentCucumberFormatter:output/report.html"}
)
public class TestRunner {
@AfterClass
public static void teardown() {
Reporter.loadXMLConfig(new File("src/test/resources/extent-config.xml"));
Reporter.setSystemInfo("user", System.getProperty("user.name"));
Reporter.setSystemInfo("os", "Mac OSX");
Reporter.setTestRunnerOutput("sample test");
}
}
| [
"aleksejs.trescalins@gmail.com"
] | aleksejs.trescalins@gmail.com |
fd502e0a4c6e16edc76a98d830cdf475d62f20a9 | 83a482f595c62eaf8d0776ff010df7041686e5df | /GetFields.java | 792197d8cdb8bb8ec5940e9277ae8b6e02ffff8e | [] | no_license | RuzannaAvetisyan/Reflection | aaa3e53f5956ad3ae664a80b28838a9ed1a33155 | 696583e6ed4ecfcdcbbc36b93497d7cb2d94b95d | refs/heads/master | 2020-04-05T16:33:03.486196 | 2018-11-11T23:24:01 | 2018-11-11T23:24:01 | 157,017,628 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 723 | java |
import java.lang.reflect.Field;
public class GetFields{
public static String toJson(Object o)throws IllegalAccessException{
Class<?> sc = o.getClass();
Field[] fields = sc.getDeclaredFields();
int l = fields.length;
String jsonString = new String("{");
for (int i = 0; i < l; ++i){
if(fields[i].isAnnotationPresent(Transient.class)){
continue;
}
fields[i].setAccessible(true);
String fieldName = fields[i].getName();
Object fieldValue = fields[i].get(o);
String s = new String("\t\"" + fieldName + "\" : \"" + fieldValue + "\"");
jsonString += s;
if(i != l - 1){
jsonString += ",\n";
}else{
jsonString += "\n";
}
}
jsonString +="}";
return jsonString;
}
} | [
"gsanmey@gmail.com"
] | gsanmey@gmail.com |
917e0735d360f3f037c115aea20321e8621519c5 | f3aec68bc48dc52e76f276fd3b47c3260c01b2a4 | /core/referencebook/src/main/java/ru/korus/tmis/pix/DataTypeUncertainNarrativeConceptDescriptor.java | 06a9be9b78f43daf049a5d4fc0e84f45abb71c99 | [] | no_license | MarsStirner/core | c9a383799a92e485e2395d81a0bc95d51ada5fa5 | 6fbf37af989aa48fabb9c4c2566195aafd2b16ab | refs/heads/master | 2020-12-03T00:39:51.407573 | 2016-04-29T12:28:32 | 2016-04-29T12:28:32 | 96,041,573 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,273 | java |
package ru.korus.tmis.pix;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for DataTypeUncertainNarrativeConceptDescriptor.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="DataTypeUncertainNarrativeConceptDescriptor">
* <restriction base="{urn:hl7-org:v3}cs">
* <enumeration value="UVN<CD>"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "DataTypeUncertainNarrativeConceptDescriptor")
@XmlEnum
public enum DataTypeUncertainNarrativeConceptDescriptor {
@XmlEnumValue("UVN<CD>")
UVN_CD("UVN<CD>");
private final String value;
DataTypeUncertainNarrativeConceptDescriptor(String v) {
value = v;
}
public String value() {
return value;
}
public static DataTypeUncertainNarrativeConceptDescriptor fromValue(String v) {
for (DataTypeUncertainNarrativeConceptDescriptor c: DataTypeUncertainNarrativeConceptDescriptor.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| [
"szgrebelny@korusconsulting.ru"
] | szgrebelny@korusconsulting.ru |
3cc0a093fadf0523e2ff67ee3e5032d69f225ba7 | d53fecbf033b1e3fc476deb8da7573dc2c515e97 | /src/test/java/gov/nist/healthcare/hl7tools/service/util/DBDiffUtil.java | 38816f0e3996063dd2469bbebd7826f3d094603d | [] | no_license | usnistgov/igamt-hl7Tools-service | 9abf67b25fc0084f3a61a4148fc870f5e6116e7a | 83322dffdac18cb129a1bd80149f5439cf5686fd | refs/heads/master | 2021-01-10T23:21:06.562378 | 2019-03-15T14:34:44 | 2019-03-15T14:34:44 | 70,596,043 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,914 | java | package gov.nist.healthcare.hl7tools.service.util;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
public class DBDiffUtil {
public final static String OLD_DIR = "src/main/resources/hl7db2-old";
public final static String NEW_DIR = "src/main/resources/hl7db-new";
public final static String DIFF_DIR = "src/main/resources/hl7db-diff";
public static void main(String[] versions) throws JsonProcessingException, IOException{
diffMessasges(versions);
}
private static void diffMessasges(String[] versions) throws JsonProcessingException, IOException{
if(versions !=null && versions.length > 0){
for(String version: versions){
sortMessasge(OLD_DIR + "/" + version + "/messages.json");
sortMessasge(NEW_DIR + "/" + version + "/messages.json");
//generateDiff(version, "message");
}
}
}
private static void generateDiff(String version,String type) throws IOException{
String diffPath = DIFF_DIR + "/"+ version + "/"+ type + "s.txt";
File diffFolder = new File(DIFF_DIR + "/"+ version );
if(!diffFolder.exists()){
diffFolder.mkdirs();
}
File diffFile = new File(diffPath);
if(!diffFile.exists())
diffFile.createNewFile();
String cmd = "/usr/local/bin/json-diff " + OLD_DIR + "/" + version + "/"+ type + "s.json " + NEW_DIR + "/"+ version + "/"+ type + "s.json"+ "> " + diffPath;
System.out.println(cmd);
Runtime.getRuntime().exec(cmd);
}
private static void sortMessasge(String path) throws JsonProcessingException, IOException{
ObjectMapper mapper = new ObjectMapper();
JsonNode root = mapper.readTree(new File(path));
Iterator<JsonNode> it= root.elements();
List<JsonNode> nodes = new ArrayList<JsonNode>();
while(it.hasNext()){
nodes.add(it.next());
}
Comparator<JsonNode> cmp = new Comparator<JsonNode>(){
@Override
public int compare(JsonNode o1, JsonNode o2) {
// TODO Auto-generated method stub
return o1.findValue("id").asText().compareTo(o2.findValue("id").asText());
}
};
Collections.sort(nodes, cmp);
writeTo(path, nodes);
}
private static void writeTo(String path, List<JsonNode> nodes) throws JsonGenerationException, JsonMappingException, IOException{
ObjectMapper mapper = new ObjectMapper();
System.out.println("Writing to file...");
mapper.writerWithDefaultPrettyPrinter().writeValue(new File(path), nodes);
}
}
| [
"haffo@nist.gov"
] | haffo@nist.gov |
224f46edc32192d5de209ce68e1b802d167de93e | a871fce4af32ca173c72a3e9fb19b3645aae3089 | /app/src/androidTest/java/com/avantari/dictionary/ExampleInstrumentedTest.java | 87142ae401227585a5b263e3f08f7edf8cb91ff6 | [] | no_license | patelkirtann/Dictionary | b4db68f58b3a1a4868289ddba597dc01c942e7b6 | 27d23c3c503e1e15b595979afaff5edf033c3ec4 | refs/heads/master | 2021-01-20T14:22:40.009158 | 2017-05-08T22:33:58 | 2017-05-08T22:33:58 | 90,595,660 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 750 | java | package com.avantari.dictionary;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.avantari.dictionary", appContext.getPackageName());
}
}
| [
"patelkirtann@gmail.com"
] | patelkirtann@gmail.com |
3ee008f0ae94df0e50af79b7c0ad5b4ebd703c90 | fdb05c6c84b23c270db83187e95129274b4eef1a | /src/logisticRegression/LogisticRegressionWeights.java | e816b9db00387a8232b5f8e9c4602a4c63e5711f | [] | no_license | DarioBernardo/MachineLearning | 36c06da49732cfa45ef29cc969710ac0f5cbab4c | c8ce1d24aa8668ce51966a4ba53c5208c9030e0e | refs/heads/master | 2021-01-17T12:33:46.833683 | 2015-08-04T12:55:31 | 2015-08-04T12:55:31 | 25,928,718 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 591 | java | package logisticRegression;
import linearAlgebra.Matrix;
import optimisationAlgorithms.Weights;
/**
* Created by dario on 09/04/15.
*/
public class LogisticRegressionWeights implements Weights<LogisticRegressionWeights> {
Matrix thetas;
public LogisticRegressionWeights(Matrix thetas) {
this.thetas = thetas;
}
public Matrix getThetas() {
return thetas;
}
@Override
public void updateWeights(LogisticRegressionWeights gradient, double alpha) {
thetas = thetas.subtract((gradient.getThetas().transpose().multiply(alpha)));
}
}
| [
"dario@logicalglue.com"
] | dario@logicalglue.com |
f803db1b6ae1c97754eb79d68645083c48f55913 | 7e4f2ae711ec7f1389eb7db23e263a6a11e6119c | /src/test/java/io/swagger/model/StoreItemTest.java | 4e340f0d095ad4dc7f0b4dfaf37a7a2e489b1249 | [] | no_license | yejeelee/Pizza-Ordering-System-API | cc95c02197e0bf4bf46ba74fd84be9f14a78d334 | d02788cba2581b092502b4625686103594d17726 | refs/heads/master | 2022-06-03T00:15:32.043191 | 2020-05-04T11:48:25 | 2020-05-04T11:48:25 | 243,216,556 | 0 | 0 | null | 2022-05-20T21:27:29 | 2020-02-26T08:58:24 | HTML | UTF-8 | Java | false | false | 3,997 | java | package io.swagger.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import io.swagger.DBStoreItems;
import org.junit.Test;
public class StoreItemTest {
private StoreItem storeItem = DBStoreItems.BROOKLYN_STORE;
private StoreItem sameObject = DBStoreItems.BROOKLYN_STORE;
private StoreItem differentObject = DBStoreItems.EASTLAKE_STORE;
@Test
public void testGetId() {
assertEquals("brooklyn", storeItem.getId());
}
@Test
public void testSetId() {
storeItem.setId("sunshine");
assertEquals("sunshine", storeItem.getId());
}
@Test
public void testGetStreetNumAndName() {
assertEquals("555 Sunshine Ave", storeItem.getStreetNumAndName());
}
@Test
public void testSetStreetNumAndName() {
storeItem.setStreetNumAndName("555 Sunshine Ave");
assertEquals("555 Sunshine Ave", storeItem.getStreetNumAndName());
}
@Test
public void testGetCity() {
assertEquals("Seattle", storeItem.getCity());
}
@Test
public void testSetCity() {
storeItem.setCity("Clam Gulch");
assertEquals("Clam Gulch", storeItem.getCity());
}
@Test
public void testGetState() {
assertEquals("Washington", storeItem.getState());
}
@Test
public void testSetState() {
storeItem.setState("California");
assertEquals("California", storeItem.getState());
}
@Test
public void testGetZipCode() {
assertEquals("98105", storeItem.getZipCode());
}
@Test
public void testSetZipCode() {
storeItem.setZipCode("70806");
assertEquals("70806", storeItem.getZipCode());
}
@Test
public void testGetOffersGlutenFree() {
assertFalse(storeItem.getOffersGlutenFree());
}
@Test
public void testSetOffersGlutenFree() {
storeItem.setOffersGlutenFree(true);
assertTrue(storeItem.getOffersGlutenFree());
}
@Test
public void testEquals() {
assertEquals(sameObject, storeItem);
assertNotEquals(differentObject, storeItem);
assertNotEquals(2, storeItem);
assertNotEquals(storeItem, null);
SpecialItem special = new SpecialItem("2", "Buy1Get1Free", "BuyOneGetOne description");
assertNotEquals(storeItem, special);
StoreItem store2 =
new StoreItem("gulf1", "555 Gulf Blvd", "Clam Gulch", "Alaska", "94608", false);
assertNotEquals(store2, storeItem);
StoreItem store3 =
new StoreItem("gulf", "555 Gulf Blvd1", "Clam Gulch", "Alaska", "94608", false);
assertNotEquals(store3, storeItem);
StoreItem store4 =
new StoreItem("gulf", "555 Gulf Blvd", "Clam Gulch1", "Alaska", "94608", false);
assertNotEquals(store4, storeItem);
StoreItem store5 =
new StoreItem("gulf", "555 Gulf Blvd", "Clam Gulch", "Alaska1", "94608", false);
assertNotEquals(store5, storeItem);
StoreItem store6 =
new StoreItem("gulf", "555 Gulf Blvd", "Clam Gulch", "Alaska", "946081", false);
assertNotEquals(store6, storeItem);
StoreItem store7 =
new StoreItem("gulf", "555 Gulf Blvd", "Clam Gulch", "Alaska", "94608", true);
assertNotEquals(store7, storeItem);
}
@Test
public void testHashCode() {
assertEquals(sameObject.hashCode(), storeItem.hashCode());
assertNotEquals(differentObject.hashCode(), storeItem.hashCode());
}
@Test
public void testToString() {
final String STORE_ITEM_AS_STRING =
"StoreItem{"
+ "id='"
+ "sunshine"
+ '\''
+ ", streetNumAndName='"
+ "555 Sunshine Ave"
+ '\''
+ ", city='"
+ "Seattle"
+ '\''
+ ", state='"
+ "Washington"
+ '\''
+ ", zipCode='"
+ "98105"
+ '\''
+ ", offersGlutenFree='"
+ false
+ '\''
+ '}';
assertEquals(STORE_ITEM_AS_STRING, storeItem.toString());
}
}
| [
"lee.yej@husky.neu.edu"
] | lee.yej@husky.neu.edu |
e8480fdd75d0a09e45df90b32c61c4581ff39831 | 99211fffcc66f0bb4f51e02db425ccc900eb73ef | /src/com/civilization/control/MainController.java | 6ec7277ee9bd861909c1fde55e526eb7a8e77de1 | [] | no_license | CivilizationByJava/Civilization | 59da1a80514943c1f44211c35b38dbb06136114e | 2b953c743baf91d95322aa3b6d131797e18dae72 | refs/heads/master | 2021-08-24T10:01:50.451919 | 2017-12-09T04:51:48 | 2017-12-09T04:51:48 | 111,498,375 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | package com.civilization.control;
//主控制器,用于控制其他的控制器
public class MainController {
BackgroundController backgroundController;
//初始化游戏
public void initGame() {
backgroundController=new BackgroundController();
backgroundController.initBackGroundControler();
}
}
| [
"Administrator@CyIce"
] | Administrator@CyIce |
6a726da4f9b63322cb1df8351dd65270d184732b | 50e2ac120eaf4a75b586616ebc8314cdef34e663 | /src/test/java/com/j256/testcheckpublisher/lambda/CommonsLogTest.java | 5b27c0cc2b29b8e41e17d2f3caf8c511302042e5 | [
"ISC"
] | permissive | j256/test-check-publisher-lambda | 5835f0bec5e7538ecb330fc1b0eead13259b963f | 92c540caaa5dad86759776dd00e2b769190e5878 | refs/heads/master | 2023-03-06T23:13:03.041149 | 2021-02-20T21:46:22 | 2021-02-20T21:46:22 | 330,529,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | package com.j256.testcheckpublisher.lambda;
import org.junit.Test;
public class CommonsLogTest {
@Test
public void testStuff() {
CommonsLog log = new CommonsLog("name");
log.setLevel(0);
log.trace("trace");
log.trace("trace", new Exception());
log.debug("debug");
log.debug("debug", new Exception());
log.info("info");
log.info("info", new Exception());
log.warn("warn");
log.warn("warn", new Exception());
log.error("error");
log.error("error", new Exception());
log.fatal("fatal");
log.fatal("fatal", new Exception());
}
}
| [
"gray.github@mailnull.com"
] | gray.github@mailnull.com |
3bea0f3ec95bb6f143e5799c372e01475140f084 | d5a27224657b2ad1696ab6140ce7a380d10848f5 | /src/test/java/br/com/riotalks/mogodb/ApplicationTests.java | dad72a32822a27fdc7ce94f57487b431f40b0ac5 | [] | no_license | josesd-ciandt/mongodb-spring-data-rio-talks-projeto | 61ef763ede49773c44fab146a647360666e44e24 | 58922796c709764ea9060695823bab53c6dddf4a | refs/heads/master | 2023-08-03T20:52:48.628018 | 2021-09-16T06:57:14 | 2021-09-16T06:57:14 | 407,021,840 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 217 | java | package br.com.riotalks.mogodb;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ApplicationTests {
@Test
void contextLoads() {
}
}
| [
"josericardodainese@gmail.com"
] | josericardodainese@gmail.com |
45c361548c53f960bf0470a532338862678c21f9 | 598421694a36392dc54d6d09ec2a2ecc5c590a37 | /src/jp/co/e2/givelog/dialog/PresentDetailDialog.java | 9a5ceb77aa1ae1bf947ab8f79f83b64c9717e53c | [] | no_license | gon5on/givelog | d4da087123bbbcc144de4b8f88cb1ed05b3c87c0 | a9016a0caafac316de3c0c80cdf9add7d4712948 | refs/heads/master | 2016-09-10T20:46:58.927072 | 2014-04-20T10:45:34 | 2014-04-20T10:45:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,202 | java | package jp.co.e2.givelog.dialog;
import jp.co.e2.givelog.R;
import jp.co.e2.givelog.common.ImgUtils;
import jp.co.e2.givelog.model.Present;
import android.app.Dialog;
import android.content.Context;
import android.content.res.Resources;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
/**
* プレゼント詳細ダイアログ
*
* @access public
*/
public class PresentDetailDialog extends Dialog
{
private Context context; //コンテキスト
private String file_dir; //写真保存パス
/**
* コンストラクタ
*
* @param Context context コンテキスト
* @param String file_dir
* @access public
*/
public PresentDetailDialog(Context context, String file_dir)
{
super(context);
this.context = context;
this.file_dir = file_dir;
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.dialog_present_detail);
//閉じるボタン
Button buttonClose = (Button) findViewById(R.id.buttonClose);
buttonClose.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dismiss();
}
});
}
/**
* プレゼント情報を画面にセットする
*
* @param Present present プレゼントクラス
* @return void
* @access public
*/
public void setContent(final Present present)
{
//日付とイベント
TextView textViewDate = (TextView) findViewById(R.id.textViewDate);
textViewDate.setText(present.getDate() + " " + present.getEvent());
//だれから
TextView textViewFrom = (TextView) findViewById(R.id.textViewFrom);
textViewFrom.setText(present.getGiveFull());
//だれへ
TextView textViewTo = (TextView) findViewById(R.id.textViewTo);
textViewTo.setText(present.getGaveFull());
//プレゼント
TextView textViewPresent = (TextView) findViewById(R.id.textViewPresent);
textViewPresent.setText(present.getPresent() + present.getPriceUnit(1));
//メモ
TextView textViewMemo = (TextView) findViewById(R.id.textViewMemo);
TextView textViewMemoLabel = (TextView) findViewById(R.id.textViewMemoLabel);
if (present.getMemo().length() != 0) {
textViewMemo.setText(present.getMemo());
textViewMemo.setVisibility(View.VISIBLE);
textViewMemoLabel.setVisibility(View.VISIBLE);
} else {
textViewMemo.setVisibility(View.GONE);
textViewMemoLabel.setVisibility(View.GONE);
}
//写真
ImageView imageViewPhoto = (ImageView) findViewById(R.id.imageViewPhoto);
if (present.getPhoto() != null) {
imageViewPhoto.setVisibility(View.VISIBLE);
Resources res = context.getResources();
Integer height = res.getDimensionPixelSize(R.dimen.present_photo_height);
Integer width = res.getDimensionPixelSize(R.dimen.present_photo_width);
String img_path = file_dir + "/" + present.getPhoto();
ImgUtils imgUtils = new ImgUtils(context, img_path);
imageViewPhoto.setImageBitmap(imgUtils.getResizeImg(height, width));
imageViewPhoto.setEnabled(true);
} else {
imageViewPhoto.setVisibility(View.GONE);
}
}
} | [
"lastspurt5050@yahoo.co.jp"
] | lastspurt5050@yahoo.co.jp |
af8c1ccd97e84cd0cc144a005d1041dbb0cbf484 | 9973b7f66a0388763d1c4d472672fd304d46ed62 | /app/src/main/java/com/yunyou/yike/dagger2/XinxiCompcoent.java | 41c6422f56bdddb51dba640700cf064576c5ead3 | [] | no_license | githubwangjunqiang/yike | ee65ac15cd67e2604876081341f9eaa9e9e3399e | 7a5ff8fd641aec03b29503d8503b403691c1d674 | refs/heads/master | 2021-01-19T21:21:45.568319 | 2017-12-02T05:42:47 | 2017-12-02T05:44:34 | 88,646,626 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package com.yunyou.yike.dagger2;
import com.yunyou.yike.activity.XinxiGuanliActivity;
import dagger.Component;
/**
* Created by ${王俊强} on 2017/6/9.
*/
@ActivityScope
@Component(modules = PresenterMobule.class, dependencies = AppCompcoent.class)
public interface XinxiCompcoent {
void inject(XinxiGuanliActivity xinxiGuanliActivity);
}
| [
"980766134@qq.com"
] | 980766134@qq.com |
c16b7eef5938fb9498f176c41f1978149b30dff3 | 582bd0152049f6bb5cdfde37bc804a3447f47645 | /ftisp-web/src/main/java/com/ygjt/gdn/ftisp/model/vo/po/GoodInfoPrintErrorMode.java | 07d311bc99163607cec79df520bcea635662e759 | [] | no_license | liyuguanguan/TEST | 2e86a74c2d7bf6feaa109a1a9207a8b6d73ce191 | e3282e7b5914ea37cfb1bf243148b54a5850042d | refs/heads/master | 2021-01-25T06:44:52.395249 | 2017-06-07T07:41:49 | 2017-06-07T07:41:49 | 93,600,998 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 959 | java | package com.ygjt.gdn.ftisp.model.vo.po;
import com.ygjt.gdn.ftisp.utils.excel.Excel;
import javax.validation.constraints.NotNull;
/**
* Created by wyh on 2016/12/16.
*/
public class GoodInfoPrintErrorMode {
@Excel(exportName = "*商品编码")
@NotNull(message = "{crm.goodinfoprinterrormode.check.code.notnull}")
private String code;
@Excel(exportName = "*数量")
@NotNull(message = "{crm.goodinfoprinterrormode.check.num.notnull}")
private String num;
@Excel(exportName = "errorMsg")
private String errorMsg;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}
| [
"woquyingpin@163.com"
] | woquyingpin@163.com |
fcdcaf852e7dd89dd5076489a8572e631d95591f | a2440dbe95b034784aa940ddc0ee0faae7869e76 | /modules/lwjgl/glfw/src/generated/java/org/lwjgl/glfw/GLFWCharModsCallback.java | 423f7897e17fff9b11a83ec747a0b4bb8ea73d97 | [
"LGPL-2.0-or-later",
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"Zlib"
] | permissive | LWJGL/lwjgl3 | 8972338303520c5880d4a705ddeef60472a3d8e5 | 67b64ad33bdeece7c09b0f533effffb278c3ecf7 | refs/heads/master | 2023-08-26T16:21:38.090410 | 2023-08-26T16:05:52 | 2023-08-26T16:05:52 | 7,296,244 | 4,835 | 1,004 | BSD-3-Clause | 2023-09-10T12:03:24 | 2012-12-23T15:40:04 | Java | UTF-8 | Java | false | false | 2,699 | java | /*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.glfw;
import javax.annotation.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.glfw.GLFW.*;
/**
* Instances of this class may be passed to the {@link GLFW#glfwSetCharModsCallback SetCharModsCallback} method.
*
* <p>Deprecared: scheduled for removal in version 4.0.</p>
*
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* GLFWwindow *window,
* unsigned int codepoint,
* int mods
* )</code></pre>
*
* @since version 3.1
*/
public abstract class GLFWCharModsCallback extends Callback implements GLFWCharModsCallbackI {
/**
* Creates a {@code GLFWCharModsCallback} instance from the specified function pointer.
*
* @return the new {@code GLFWCharModsCallback}
*/
public static GLFWCharModsCallback create(long functionPointer) {
GLFWCharModsCallbackI instance = Callback.get(functionPointer);
return instance instanceof GLFWCharModsCallback
? (GLFWCharModsCallback)instance
: new Container(functionPointer, instance);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */
@Nullable
public static GLFWCharModsCallback createSafe(long functionPointer) {
return functionPointer == NULL ? null : create(functionPointer);
}
/** Creates a {@code GLFWCharModsCallback} instance that delegates to the specified {@code GLFWCharModsCallbackI} instance. */
public static GLFWCharModsCallback create(GLFWCharModsCallbackI instance) {
return instance instanceof GLFWCharModsCallback
? (GLFWCharModsCallback)instance
: new Container(instance.address(), instance);
}
protected GLFWCharModsCallback() {
super(CIF);
}
GLFWCharModsCallback(long functionPointer) {
super(functionPointer);
}
/** See {@link GLFW#glfwSetCharModsCallback SetCharModsCallback}. */
public GLFWCharModsCallback set(long window) {
glfwSetCharModsCallback(window, this);
return this;
}
private static final class Container extends GLFWCharModsCallback {
private final GLFWCharModsCallbackI delegate;
Container(long functionPointer, GLFWCharModsCallbackI delegate) {
super(functionPointer);
this.delegate = delegate;
}
@Override
public void invoke(long window, int codepoint, int mods) {
delegate.invoke(window, codepoint, mods);
}
}
} | [
"iotsakp@gmail.com"
] | iotsakp@gmail.com |
936a708896faa788e45b7fde7f269c09e9537259 | 9ddc6d13681de32f641bad88626cdf2dcf6c65b9 | /MST_Shortest Path/EdgeList.java | 941187f44e8abf0ed9c33fd74a2987c9f8534ea7 | [] | no_license | jbaek7023/JavaAlgorithms | a32351cb3627bb3f62e7fef5a2d273900c6009a5 | 66b78a021b7e1023a6a309b42f696bb1af28ef74 | refs/heads/master | 2020-04-06T04:54:02.924736 | 2017-03-13T03:58:09 | 2017-03-13T03:58:09 | 73,892,553 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,769 | java | import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;
/**
* This class represents a graph that uses an edge list for it's representation
*
* @author robertwaters
*
*/
public class EdgeList {
/**
* The list of edges in the graph
*/
private Collection<Edge> edges;
/**
* The set of vertexes in the graph
*/
private Set<Vertex> vertexes;
private int size=0;
/**
* Construct an EdgeList from a given file
*
* @param filename the name of the file
* @throws IOException Any of the exceptions that might occur while we process the file
*/
public EdgeList(String filename) throws IOException {
// TODO Open/read/parse the file
edges = new PriorityQueue<Edge>();
Scanner scanner = new Scanner(new File(filename));
while (scanner.hasNextLine()){
String line= scanner.nextLine();
String[] splits=line.split("," , 100);
//
Vertex vertex1 = new Vertex(splits[0]);
Vertex vertex2 = new Vertex(splits[1]);
int weight = Integer.parseInt(splits[2]);
edges.add(new Edge(vertex1,vertex2,weight));
//
size++;
}
}
@Override
public String toString() {
String result = "";
for (Edge edge:edges){
result = result+edge+"\n";
}
return result;
/*
// TODO Extra Credit
*/ }
/**
*
* @return all the edges in the graph
*/
public Collection<Edge> getEdges() {
return edges;
}
public Set<Vertex> getVertexes() {
return vertexes;
}
public int getSize(){
return size;
}
}
| [
"jbaek7023@gmail.com"
] | jbaek7023@gmail.com |
acfefcd2b2ed13c392dcbbbed846352b4fb32bd3 | cded08c92cd17d66eaf5c412eaa4ce0f11f4c54a | /inference-framework/checker-framework/checkers/jdk/reimN/src/java/lang/Readable.java | 77ffb6ffdd05de9970882e051d2eea4fc1599bfd | [
"Apache-2.0"
] | permissive | ANter-xidian/type-inference | 77aa54f5fa93abc8dfcdbc93be4654cfebaa5ad9 | 90d002a1e2d0a3d160ab204084da9d5be5fdd971 | refs/heads/master | 2020-09-27T14:53:33.530140 | 2019-01-22T21:26:11 | 2019-01-22T21:26:11 | 226,540,844 | 1 | 0 | NOASSERTION | 2019-12-07T16:12:36 | 2019-12-07T16:12:35 | null | UTF-8 | Java | false | false | 186 | java | package java.lang;
import checkers.inference2.reimN.quals.*;
import java.io.IOException;
public interface Readable {
public int read(java.nio.CharBuffer cb) throws IOException;
}
| [
"dongyao83@gmail.com@e039eaa7-eea3-5927-096b-721137851c37"
] | dongyao83@gmail.com@e039eaa7-eea3-5927-096b-721137851c37 |
51f4c0c90facb2082d41c9e03a0ea87951dfbd5a | 906aed3e4f1a3710fcb6ff2241bb28621bfe2cab | /src/main/java/primenumberprinter/PrimeNumberCheckerMain.java | 3cb51c68b999e4377a255f8a999ab183b690269d | [] | no_license | jvasi/Prime-Number-Checker | 6a7426c271938d944ee4643aa107f08d3ec7a618 | 892d3f4f72441745005899bf70f4cbd8bd247d52 | refs/heads/master | 2023-01-27T21:30:03.193650 | 2020-12-09T16:55:01 | 2020-12-09T16:55:01 | 320,019,820 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,557 | java | package primenumberprinter;
import primenumberprinter.factory.DefaultRpnsFactory;
import primenumberprinter.factory.DefaultPrimeNumberHandlerFactory;
import primenumberprinter.api.IPrimeNumberHandlerFactory;
import primenumberprinter.api.IRpnsFactory;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Main class.
*/
public class PrimeNumberCheckerMain {
/**
* Default logger.
*/
private static final Logger sLogger = Logger.getLogger(PrimeNumberCheckerMain.class.getName());
/**
* Array for the threads that will check for prime numbers.
*/
private final ArrayList<PrimeNumberCheckerThread> threadsArray = new ArrayList<PrimeNumberCheckerThread>();
/**
* Main method.
* @param args the program arguments. Expected format: <remote_host_1> <remote_port_1> <remote_host_2> <remote_port_2> ...
*/
public static void main(String args[]) {
if (args.length == 0) {
sLogger.log(Level.INFO, "Usage: java -jar <application_jar> <remote_host_1> <remote_port_1> " +
"<remote_host_2> <remote_port_2>");
}
PrimeNumberCheckerMain primeNumberChecker = new PrimeNumberCheckerMain(args,
new DefaultRpnsFactory(),
new DefaultPrimeNumberHandlerFactory());
primeNumberChecker.start();
}
/**
* Creates instance of this class. Also initializes the threads that will check for prime numbers.
* @param args the arguments passed in on the console.
* @param rpnsFactory the remote prime number service factory.
* @param primeNumberHandlerFactort the prime number handler.
*/
public PrimeNumberCheckerMain(String[] args, IRpnsFactory rpnsFactory,
IPrimeNumberHandlerFactory primeNumberHandlerFactort) {
NumberGenerator numberGenerator = new NumberGenerator();
numberGenerator.setInitial(PrimeNumberPersistentStorage.getInstance().getLastPersistedPrime());
for (int i = 0; i < args.length ; i += 2) {
threadsArray.add(
new PrimeNumberCheckerThread(
rpnsFactory.getInstance(args[i], Integer.parseInt(args[i+1])),
primeNumberHandlerFactort.createInstance(), numberGenerator));
}
}
/**
* Starts the threads that will check for prime numbers.
*/
public void start() {
for (PrimeNumberCheckerThread thread: threadsArray) {
thread.start();
}
}
}
| [
"krasimir.milchev@gmail.com"
] | krasimir.milchev@gmail.com |
6aa26a1f46ddc4b8d59e94ab4e6f84ac77cadce1 | 4c34208bc0a32682e1d15388c19afb32067b949d | /src/com/neomentis/feelalive/window/BufferedImageLoader.java | 8106dc0e2061b45d9e8ff7a69ed33510ee00b93d | [] | no_license | bslink26/feelalive | a7a76f1dc13c976d9d42cbb9dc0aa7c14a5ba0e5 | f63c25dee49a1eaf4231faa393855bd0d36bf4b9 | refs/heads/master | 2021-01-22T04:53:50.373468 | 2014-05-11T23:36:34 | 2014-05-11T23:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package com.neomentis.feelalive.window;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;
public class BufferedImageLoader {
private BufferedImage image;
public BufferedImage loadImage(String path) {
try {
image = ImageIO.read(getClass().getResource(path));
} catch (IOException e) {
e.printStackTrace();
}
return image;
}
}
| [
"bslink26@gmail.com"
] | bslink26@gmail.com |
ec4713860940b2c58541d330cf1b2748561486f2 | 3e6439850f5ae4fe1204f98bbd2861f2b3093656 | /api/src/main/java/org/openmrs/module/iedea/api/db/IeDEAEastAfricaDAO.java | 7f36d8732df2cab50dda5c804580efbfdfed1f2c | [] | no_license | IeDEA-EA/openmrs-module-iedea | 39459158a8dd3eaaf87748014bfc81fa2c596902 | 96536d5ae59e3243f16cb892be845ad6a6468d55 | refs/heads/master | 2020-04-22T18:33:29.680736 | 2013-03-29T19:08:31 | 2013-03-29T19:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,097 | 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.iedea.api.db;
import java.util.List;
import org.openmrs.module.iedea.ImportLogItem;
import org.openmrs.module.iedea.api.IeDEAEastAfricaService;
/**
* Database methods for {@link IeDEAEastAfricaService}.
*/
public interface IeDEAEastAfricaDAO {
/* ODK Import Methods Below */
public int getImportLogCount();
public void saveOrUpdate(ImportLogItem item);
public List<ImportLogItem> getAllLogs();
public ImportLogItem getLogItemByUUID(String uuid);
public ImportLogItem getLotItemById(int id);
} | [
"swgithen@mtu.edu"
] | swgithen@mtu.edu |
a7bf2249a93f2eb31596cebd55659da0423fa6e5 | be5ac69d35442763fdd441e0e1f5e6bb0106ef76 | /collections/src/com/java/collections/list/arraylist/ArrayListWithEnumeration.java | b0f557fbb456517de32af226fba3619e8561e5a0 | [] | no_license | SrujanKumarPinamwar/CoreJava | 3a6ade7cf545678132f44a053e0f33ca6d3c1b70 | edd7efbd3279b9e6c7c7624bbc0aab6c858e1260 | refs/heads/master | 2021-01-09T20:52:38.654634 | 2016-12-13T18:12:23 | 2016-12-13T18:12:23 | 59,545,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 658 | java | package com.java.collections.list.arraylist;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
public class ArrayListWithEnumeration {
public static void main(String args[]){
ArrayList<String> arrlist = new ArrayList<String>();
arrlist.add("C");
arrlist.add("C++");
arrlist.add("JAVA");
arrlist.add("SQL");
arrlist.add("DOTNET");
Enumeration<String> enumeration = Collections.enumeration(arrlist);
while(enumeration.hasMoreElements())
System.out.println(enumeration.nextElement());
System.out.println("\n"+"Size: "+ arrlist.size());
}
}
| [
"srujankumarpinamwar@gmail.com"
] | srujankumarpinamwar@gmail.com |
a94694943331ada6a9d67858324f4d014520b89a | 0a03d83d75c0a73caa193e62fe205c43abf72b29 | /src/com/modusgo/dd/requests/BasicAsyncTask.java | c945ff020eba92cd070c6c038dd9fb452d5a5cff | [] | no_license | lwllovewf2010/TWG_Android | 4f4f2dd22a54e82845707cce84e4d5e81f29ba8f | 1c84a28136db915dcd0846dd6b8981be39c34f83 | refs/heads/master | 2021-01-18T10:26:03.119198 | 2015-02-12T19:40:28 | 2015-02-12T19:40:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package com.modusgo.dd.requests;
import android.os.AsyncTask;
public abstract class BasicAsyncTask extends AsyncTask<Void, String, String[]>{
@Override
protected void onPostExecute(String[] result) {
super.onPostExecute(result);
if(!result[0].equals("error")){
onPostExecuteSuccess(result[0],result[1],result[2]);
}
else{
onPostExecuteError(result[1],result[2]);
}
}
protected void onPostExecuteSuccess(String arg0, String arg1, String arg2) {
}
protected void onPostExecuteError(String errorCode, String errorMessage) {
}
}
| [
"yaturner@Jims-MacBook-Pro.local"
] | yaturner@Jims-MacBook-Pro.local |
7a198ab3426be99710f3fdf83c80f317b6147a1d | 4da553ae3d0b4a276d5f0e4d5d73f8104253e8bb | /codecs/g729/src/main/java/ua/mobius/media/server/impl/dsp/audio/g729/CorFunc.java | ae90bb3ad3297b43cbc704ecc0a7bc7219b32172 | [] | no_license | oifayulian/sipme-media-server | d4c437d8a4953948ac036378e76f603522fd232d | d8e9c4be4d584ee7fd7c18be8b4ea9a4445b1989 | refs/heads/master | 2021-01-10T05:51:59.795489 | 2014-04-30T12:22:53 | 2014-04-30T12:22:53 | 52,670,868 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,086 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
/*
* 15/07/13 - Change notice:
* This file has been modified by Mobius Software Ltd.
* For more information please visit http://www.mobius.ua
*/
package ua.mobius.media.server.impl.dsp.audio.g729;
public class CorFunc {
/*----------------------------------------------------------------------------
* corr_xy2 - compute the correlation products needed for gain computation
*----------------------------------------------------------------------------
*/
public static void corr_xy2(
float xn[], /* input : target vector x[0:l_subfr] */
float y1[], /* input : filtered adaptive codebook vector */
float y2[], /* input : filtered 1st codebook innovation */
float g_coeff[] /* output: <y2,y2> , -2<xn,y2> , and 2<y1,y2>*/
)
{
float y2y2, xny2, y1y2;
int i;
y2y2= (float)0.01;
for (i = 0; i < LD8KConstants.L_SUBFR; i++) y2y2 += y2[i]*y2[i];
g_coeff[2] = y2y2 ;
xny2 = (float)0.01;
for (i = 0; i < LD8KConstants.L_SUBFR; i++) xny2+= xn[i]*y2[i];
g_coeff[3] = (float)-2.0* xny2;
y1y2 = (float)0.01;
for (i = 0; i < LD8KConstants.L_SUBFR; i++) y1y2 += y1[i]*y2[i];
g_coeff[4] = (float)2.0* y1y2 ;
return;
}
/*--------------------------------------------------------------------------*
* Function cor_h_x() *
* ~~~~~~~~~~~~~~~~~~~~ *
* Compute correlations of input response h[] with the target vector X[]. *
*--------------------------------------------------------------------------*/
public static void cor_h_x(
float h[], /* (i) :Impulse response of filters */
float x[], /* (i) :Target vector */
float d[] /* (o) :Correlations between h[] and x[] */
)
{
int i, j;
float s;
for (i = 0; i < LD8KConstants.L_SUBFR; i++)
{
s = (float)0.0;
for (j = i; j < LD8KConstants.L_SUBFR; j++)
s += x[j] * h[j-i];
d[i] = s;
}
return;
}
}
| [
"yulian@Venera.(none)"
] | yulian@Venera.(none) |
9f3b7cb86d6e180b6832ed68a0659a46b9158b50 | eae6300133e52d3d2db4142427fb58cd1a9eb089 | /jOOQ/src/main/java/org/jooq/MergeNotMatchedValuesStep4.java | e76d75fd0a0993d10bac0bca249ce76ab16c7893 | [
"Apache-2.0"
] | permissive | arashi01/jOOQ | 1a420fc2fa14fb40b03381ec4004a90b8d0522fb | e210b1a7ee2b5eadc240d9fdf64e6a7ff7b6b7aa | refs/heads/main | 2023-02-01T11:56:00.983906 | 2020-12-15T14:33:10 | 2020-12-15T14:33:10 | 321,770,901 | 0 | 0 | NOASSERTION | 2020-12-15T19:38:36 | 2020-12-15T19:38:35 | null | UTF-8 | Java | false | false | 2,820 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;
import static org.jooq.SQLDialect.CUBRID;
// ...
import static org.jooq.SQLDialect.DERBY;
import static org.jooq.SQLDialect.FIREBIRD;
import static org.jooq.SQLDialect.H2;
// ...
import static org.jooq.SQLDialect.HSQLDB;
// ...
// ...
// ...
// ...
// ...
// ...
import java.util.Collection;
import org.jetbrains.annotations.NotNull;
/**
* This type is used for the {@link Merge}'s DSL API.
* <p>
* Example: <code><pre>
* DSLContext create = DSL.using(configuration);
*
* create.mergeInto(table)
* .using(select)
* .on(condition)
* .whenMatchedThenUpdate()
* .set(field1, value1)
* .set(field2, value2)
* .whenNotMatchedThenInsert(field1, field2)
* .values(value1, value2)
* .execute();
* </pre></code>
*
* @author Lukas Eder
*/
public interface MergeNotMatchedValuesStep4<R extends Record, T1, T2, T3, T4> {
/**
* Set <code>VALUES</code> for <code>INSERT</code> in the <code>MERGE</code>
* statement's <code>WHEN NOT MATCHED THEN INSERT</code> clause.
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB })
MergeNotMatchedWhereStep<R> values(T1 value1, T2 value2, T3 value3, T4 value4);
/**
* Set <code>VALUES</code> for <code>INSERT</code> in the <code>MERGE</code>
* statement's <code>WHEN NOT MATCHED THEN INSERT</code> clause.
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB })
MergeNotMatchedWhereStep<R> values(Field<T1> value1, Field<T2> value2, Field<T3> value3, Field<T4> value4);
/**
* Set <code>VALUES</code> for <code>INSERT</code> in the <code>MERGE</code>
* statement's <code>WHEN NOT MATCHED THEN INSERT</code> clause.
*/
@NotNull
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB })
MergeNotMatchedWhereStep<R> values(Collection<?> values);
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
289b4f8e5fb0847f9231505e31a1e18afd7045cc | 1c5e8605c1a4821bc2a759da670add762d0a94a2 | /src/dahua/fdc/aimcost/prjdynamiccostbill/ProjectDynamicCostEntryFactory.java | 5dfd1189cf7a665c9f332bf41efc26a5541ef0dc | [] | no_license | shxr/NJG | 8195cfebfbda1e000c30081399c5fbafc61bb7be | 1b60a4a7458da48991de4c2d04407c26ccf2f277 | refs/heads/master | 2020-12-24T06:51:18.392426 | 2016-04-25T03:09:27 | 2016-04-25T03:09:27 | 19,804,797 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,802 | java | package com.kingdee.eas.fdc.aimcost.prjdynamiccostbill;
import com.kingdee.bos.BOSException;
import com.kingdee.bos.BOSObjectFactory;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.Context;
public class ProjectDynamicCostEntryFactory
{
private ProjectDynamicCostEntryFactory()
{
}
public static com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry getRemoteInstance() throws BOSException
{
return (com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry)BOSObjectFactory.createRemoteBOSObject(new BOSObjectType("BF1D2179") ,com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry.class);
}
public static com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry getRemoteInstanceWithObjectContext(Context objectCtx) throws BOSException
{
return (com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry)BOSObjectFactory.createRemoteBOSObjectWithObjectContext(new BOSObjectType("BF1D2179") ,com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry.class, objectCtx);
}
public static com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry getLocalInstance(Context ctx) throws BOSException
{
return (com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry)BOSObjectFactory.createBOSObject(ctx, new BOSObjectType("BF1D2179"));
}
public static com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry getLocalInstance(String sessionID) throws BOSException
{
return (com.kingdee.eas.fdc.aimcost.prjdynamiccostbill.IProjectDynamicCostEntry)BOSObjectFactory.createBOSObject(sessionID, new BOSObjectType("BF1D2179"));
}
} | [
"shxr_code@126.com"
] | shxr_code@126.com |
99f46c83e95b8e46bbb9bb2993e0811d91559faa | 7458a1d07da8580a946de72a7028dc61fb1811f9 | /spring-redis/src/com/faye/TestJedis.java | cedd0607ab136258750e9034b0f6e9c06f499ba7 | [] | no_license | fayehe/Tools_Middlewares_Practice | 43e25212397b9a658d7bc83cdedd07716e433812 | e5c29d263e69a058f80dbedc2c4593b141549fa6 | refs/heads/master | 2022-06-24T06:59:10.030512 | 2020-02-29T07:37:28 | 2020-02-29T07:37:28 | 188,543,185 | 0 | 0 | null | 2022-06-21T01:10:10 | 2019-05-25T08:53:01 | Java | UTF-8 | Java | false | false | 6,271 | java | package com.faye;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
public class TestJedis {
JedisPool pool;
Jedis jedis;
@Before
public void setUp() {
jedis = new Jedis("localhost");
}
/**
* Redis存储初级的字符串
* CRUD
*/
@org.junit.Test
public void testBasicString(){
//-----添加数据----------
jedis.set("name","meepo");//向key-->name中放入了value-->meepo
System.out.println(jedis.get("name"));//执行结果:meepo
//-----修改数据-----------
//1、在原来基础上修改
jedis.append("name","dota"); //很直观,类似map 将dota append到已经有的value之后
System.out.println(jedis.get("name"));//执行结果:meepodota
//2、直接覆盖原来的数据
jedis.set("name","poofu");
System.out.println(jedis.get("name"));//执行结果:poofu
//删除key对应的记录
jedis.del("name");
System.out.println(jedis.get("name"));//执行结果:null
/**
* mset相当于
* jedis.set("name","meepo");
* jedis.set("dota","poofu");
*/
jedis.mset("name","meepo","dota","poofu");
System.out.println(jedis.mget("name","dota"));
}
/**
* jedis操作Map
*/
@org.junit.Test
public void testMap(){
Map<String,String> user=new HashMap<String,String>();
user.put("name","meepo");
user.put("pwd","password");
jedis.hmset("user",user);
//取出user中的name,执行结果:[meepo]-->注意结果是一个泛型的List
//第一个参数是存入redis中map对象的key,后面跟的是放入map中的对象的key,后面的key可以跟多个,是可变参数
List<String> rsmap = jedis.hmget("user", "name");
System.out.println(rsmap);
//删除map中的某个键值
// jedis.hdel("user","pwd");
System.out.println(jedis.hmget("user", "pwd")); //因为删除了,所以返回的是null
System.out.println(jedis.hlen("user")); //返回key为user的键中存放的值的个数1
System.out.println(jedis.exists("user"));//是否存在key为user的记录 返回true
System.out.println(jedis.hkeys("user"));//返回map对象中的所有key [pwd, name]
System.out.println(jedis.hvals("user"));//返回map对象中的所有value [meepo, password]
Iterator<String> iter=jedis.hkeys("user").iterator();
while (iter.hasNext()){
String key = iter.next();
System.out.println(key+":"+jedis.hmget("user",key));
}
}
/**
* jedis操作List
*/
@org.junit.Test
public void testList(){
//开始前,先移除所有的内容
jedis.del("java framework");
// 第一个是key,第二个是起始位置,第三个是结束位置,jedis.llen获取长度 -1表示取得所有
System.out.println(jedis.lrange("java framework",0,-1));
//先向key java framework中存放三条数据
jedis.lpush("java framework","spring");
jedis.lpush("java framework","struts");
jedis.lpush("java framework","hibernate");
//再取出所有数据jedis.lrange是按范围取出,
// 第一个是key,第二个是起始位置,第三个是结束位置,jedis.llen获取长度 -1表示取得所有
System.out.println(jedis.lrange("java framework",0,-1));
}
/**
* jedis操作Set
*/
@org.junit.Test
public void testSet(){
//添加
jedis.sadd("sname","meepo");
jedis.sadd("sname","dota");
jedis.sadd("sname","poofu");
jedis.sadd("sanme","noname");
//移除noname
jedis.srem("sname","noname");
System.out.println(jedis.smembers("sname"));//获取所有加入的value
System.out.println(jedis.sismember("sname", "meepo"));//判断 meepo 是否是sname集合的元素
System.out.println(jedis.srandmember("sname"));
System.out.println(jedis.scard("sname"));//返回集合的元素个数
}
@org.junit.Test
public void test() throws InterruptedException {
//keys中传入的可以用通配符
System.out.println(jedis.keys("*")); //返回当前库中所有的key [sose, sanme, name, dota, foo, sname, java framework, user, braand]
System.out.println(jedis.keys("*name"));//返回的sname [sname, name]
System.out.println(jedis.del("sanmdde"));//删除key为sanmdde的对象 删除成功返回1 删除失败(或者不存在)返回 0
System.out.println(jedis.ttl("sname"));//返回给定key的有效时间,如果是-1则表示永远有效
jedis.setex("timekey", 10, "min");//通过此方法,可以指定key的存活(有效时间) 时间为秒
Thread.sleep(5000);//睡眠5秒后,剩余时间将为<=5
System.out.println(jedis.ttl("timekey")); //输出结果为5
jedis.setex("timekey", 1, "min"); //设为1后,下面再看剩余时间就是1了
System.out.println(jedis.ttl("timekey")); //输出结果为1
System.out.println(jedis.exists("key"));//检查key是否存在
System.out.println(jedis.rename("timekey","time"));
System.out.println(jedis.get("timekey"));//因为移除,返回为null
System.out.println(jedis.get("time")); //因为将timekey 重命名为time 所以可以取得值 min
//jedis 排序
//注意,此处的rpush和lpush是List的操作。是一个双向链表(但从表现来看的)
jedis.del("a");//先清除数据,再加入数据进行测试
jedis.rpush("a", "1");
jedis.lpush("a","6");
jedis.lpush("a","3");
jedis.lpush("a","9");
System.out.println(jedis.lrange("a",0,-1));// [9, 3, 6, 1]
System.out.println(jedis.sort("a")); //[1, 3, 6, 9] //输入排序后结果
System.out.println(jedis.lrange("a",0,-1));
}
} | [
"hefeifei1120@163.com"
] | hefeifei1120@163.com |
0e329abcf45742658039a1758e38e40890d6f4f1 | c1ca105b921024988784668c950cdd63a535894e | /app/src/androidTest/java/jp/ac/titech/itpro/sdl/greetings/ExampleInstrumentedTest.java | ca94dc83a5792ea18e59a7e3749301ea926e080f | [] | no_license | itspsdl/sdl.Greetings | fbdad9fe4167fe2cb2f1d8d10240f16ec0ed3d05 | b1431a79c2a319c5156545875c9dc24cd07037f6 | refs/heads/master | 2022-05-09T01:00:09.178051 | 2021-04-23T05:22:47 | 2022-04-22T02:52:28 | 182,054,834 | 0 | 4 | null | null | null | null | UTF-8 | Java | false | false | 778 | java | package jp.ac.titech.itpro.sdl.greetings;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("jp.ac.titech.itpro.sdl.greetings", appContext.getPackageName());
}
} | [
"hayashi@c.titech.ac.jp"
] | hayashi@c.titech.ac.jp |
11d2930dc89f410fb2519877a5d5f4820c93bbe0 | ba47896b28aa59932efa87e46593f11393254fcd | /src/test/java/controller/gestioneSegnalazioni/VisualizzaSegnalazioniChiuseTest.java | ff6d4969434ee26b4432c8c113e4dd83b1d627e8 | [] | no_license | SerNick18/CityZen | 844b469f849b348c0e8d7861fa354e343d21c0d7 | 49eef1fcb0b33e9d07b1c270a8989ca41c9ac7cd | refs/heads/master | 2023-02-19T13:51:14.573372 | 2021-01-21T21:31:03 | 2021-01-21T21:31:03 | 321,023,633 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,078 | java | package controller.gestioneSegnalazioni;
import controller.gestioneUtenza.MyServletException;
import model.gestioneDati.facadeDataAccess.FacadeDAO;
import model.gestioneDati.modelObjects.Cittadino;
import model.gestioneDati.modelObjects.Impiegato;
import model.gestioneDati.modelObjects.Segnalazione;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import java.util.Date;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
public class VisualizzaSegnalazioniChiuseTest extends VisualizzaSegnalazioniChiuse{
VisualizzaSegnalazioniChiuse servlet;
MockHttpServletRequest request;
MockHttpServletResponse response;
static Segnalazione segnalazione;
static FacadeDAO service;
static Cittadino cittadino;
@BeforeEach
void setUpEach () {
servlet = new VisualizzaSegnalazioniChiuse();
response = new MockHttpServletResponse();
request = new MockHttpServletRequest();
}
@BeforeAll
static void setUpAll() {
service = new FacadeDAO();
cittadino = new Cittadino("CPNLLD11S19A489D", "Giuseppe", "Cattaneo", "32ca9fc1a0f5b6330e3f4c8c1bbecde9bedb9573",
"via roma",3,"Fisciano","cattaneo@gmail.com",0,0);
service.registraCittadino(cittadino);
segnalazione = new Segnalazione();
segnalazione.setVia("roma");
segnalazione.setCivico(3);
segnalazione.setPriorita(0);
segnalazione.setNumSolleciti(0);
segnalazione.setStato("inoltrata");
segnalazione.setDataSegnalazione(new Date());
segnalazione.setDescrizione("grossa fuoriuscita d'acqua");
segnalazione.setOggetto("Perdita d'acqua");
segnalazione.setFoto("immagine.png");
segnalazione.setRiaperta(0);
segnalazione.setCittadino(cittadino);
service.inserisciSegnalazione(segnalazione);
}
@Test
void testCittadinoImpiegatoNull() {
request.setParameter("id", segnalazione.getId()+"");
assertDoesNotThrow(() -> {servlet.doGet(request, response);});
}
@Test
void testCittadinoPass() {
request.getSession().setAttribute("Cittadino", cittadino);
request.setParameter("id", segnalazione.getId()+"");
assertDoesNotThrow(() -> {servlet.doGet(request, response);});
}
@Test
void testImpiegatoPass() {
request.setParameter("id", segnalazione.getId()+"");
request.getSession().removeAttribute("Cittadino");
request.getSession().setAttribute("Impiegato", new Impiegato());
assertDoesNotThrow(() -> {servlet.doGet(request, response);});
}
@AfterAll
public static void clearDB(){
try {
service.eliminaCittadino(cittadino.getCF());
} catch (MyServletException myServletException) {
myServletException.printStackTrace();
}
}
}
| [
"Quadrelle1"
] | Quadrelle1 |
cd29a7d99e7cb998ba765f4c0b1853d4ab4f3505 | e36cf93c4297e19d51c03bbbf1fc9b45a44111f3 | /src/Muluneh/Main.java | cc9b3893cb673cd4c43bd8ec2fb0ee9426dc3a94 | [] | no_license | Xmuluneh/MIu_Solutio | c9a236633a2bb89a060f9f56fd5c9c645300d80f | 989e4465f135d2ec2fc44c89ccc0e23727eea710 | refs/heads/master | 2023-06-12T21:22:38.239649 | 2021-06-17T20:10:03 | 2021-06-17T20:10:03 | 377,949,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package Muluneh;
public class Main {
public static void main(String[] args) {
System.out.println(nextPerfect(6));
System.out.println(nextPerfect(36));
System.out.println(nextPerfect(0));
System.out.println(nextPerfect(15));
}
static int nextPerfect(int n) {
if (n < 0) {
return 0;
} else if (n == 1||n==0) {
return n;
}
int nextPerfect=1 ;
for (int i = 0; i < n; i++) {
if (Math.pow(i,2) > n) {
nextPerfect = (int) Math.pow(i, 2);
break;
}
}
return nextPerfect;
}
}
| [
"mulabr673@gmail.com"
] | mulabr673@gmail.com |
d6a6294abe30d2843c8a021559dd13b9cd58807b | 714788c8f457b89d533e113c5190d07e66b72a6e | /src/com/company/lru.java | 928a6eaa3644836684e88d126c2a74466b7389dd | [] | no_license | sharmashrey/DailyCode | 2cd24ed45e335507ee424e562d5687717993f63d | 13650d97fea2806f7da2b650d76378b1e4f41bb1 | refs/heads/master | 2020-03-11T21:41:42.729387 | 2020-03-09T18:40:42 | 2020-03-09T18:40:42 | 130,272,656 | 0 | 0 | null | 2020-03-09T18:40:44 | 2018-04-19T21:06:44 | Java | UTF-8 | Java | false | false | 1,660 | java | import java.util.HashMap;
/*
public class LRUCache {
private class Node {
Node prev;
Node next;
int key;
int value;
public Node(int key, int value) {
this.key = key;
this.value = value;
this.prev = null;
this.next = null;
}
}
private int capacity;
private HashMap<Integer, Node> hs = new HashMap<Integer, Node>();
private Node head = new Node(-1, -1);
private Node tail = new Node(-1, -1);
public LRUCache(int capacity) {
this.capacity = capacity;
tail.prev = head;
head.next = tail;
}
public int get(int key) {
if (!hs.containsKey(key)) {
return -1;
}
// remove current
Node current = hs.get(key);
current.prev.next = current.next;
current.next.prev = current.prev;
// move current to tail
move_to_tail(current);
return hs.get(key).value;
}
public void put(int key, int value) {
if (get(key) != -1) {
hs.get(key).value = value;
return;
}
if (hs.size() == capacity) {
hs.remove(head.next.key);
head.next = head.next.next;
head.next.prev = head;
}
Node insert = new Node(key, value);
hs.put(key, insert);
move_to_tail(insert);
}
private void move_to_tail(Node current) {
current.prev = tail.prev;
tail.prev = current;
current.prev.next = current;
current.next = tail;
}
}
*/ | [
"shreyasdsharma@gmail.com"
] | shreyasdsharma@gmail.com |
9381e016a1dfea246affeb66c57dc0a4f5a9da60 | 6510effb0e84f1cce5c7b7baa249e89ae507978e | /burrowlib/src/main/java/com/example/base/fun/Fun1.java | de9aeba7cd3216ba1fca22f74f1ff90df9c0ea10 | [] | no_license | ygx4zh/Burrow | 9f9a6d2e3406748667e609fab6b14de1e2b83988 | 758c40eebc113d8d8a9b3579eed37e245d343b3e | refs/heads/master | 2021-08-30T16:25:16.370852 | 2017-12-18T16:28:50 | 2017-12-18T16:28:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 126 | java | package com.example.base.fun;
/**
* @author YGX
*
* <p> 功能接口 </p>
*/
public interface Fun1 {
void run();
} | [
"sinsyet@163.com"
] | sinsyet@163.com |
ed9dacbd611cfdabd19a54d315f5a8510f337757 | c06a3fb05d9f27ec37eff46d7b104c758449b202 | /hwadee-司法局管理系统/src/src/com/xd/cdsifaju/sys/dao/impl/OutsideuserDAO.java | c96be4034b91ac3c328f08168ab9cbc4e995b535 | [] | no_license | xumenger/xumenger.github.shit | ceabdf1da3ad19c9e1583d36d40f2729562d8af6 | dfb691bcbb10695368522324d6429b7f69f11333 | refs/heads/master | 2020-12-26T00:26:34.034917 | 2016-07-27T15:21:53 | 2016-07-27T15:21:53 | 35,945,793 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,989 | java | package com.xd.cdsifaju.sys.dao.impl;
import java.util.Date;
import java.util.List;
import org.hibernate.LockMode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Repository;
import com.xd.cdsifaju.common.dao.BasicSupportDao;
import com.xd.cdsifaju.entities.Insideuser;
import com.xd.cdsifaju.entities.Outsideuser;
import com.xd.cdsifaju.sys.dao.interfaces.IOutsideuserDAO;
/**
* A data access object (DAO) providing persistence and search support for
* Outsideuser entities. Transaction control of the save(), update() and
* delete() operations can directly support Spring container-managed
* transactions or they can be augmented to handle user-managed Spring
* transactions. Each of these methods provides additional information for how
* to configure it for the desired type of transaction control.
*
* @see com.justice.entity.Outsideuser
* @author MyEclipse Persistence Tools
*/
@Repository("outsideuserdao")
public class OutsideuserDAO extends BasicSupportDao implements IOutsideuserDAO{
private static final long serialVersionUID = 1L;
private static final Logger log = LoggerFactory
.getLogger(OutsideuserDAO.class);
// property constants
public static final String ROLE = "role";
public static final String OUTSIDE_USER_NAME = "outsideUserName";
public static final String OUTSIDE_USER_STATUS = "outsideUserStatus";
public static final String USER_SEX = "userSex";
public static final String CURRENT_ADDR = "currentAddr";
public static final String MOBILE = "mobile";
public static final String QQ = "qq";
public static final String MSN = "msn";
public static final String PHONE = "phone";
public static final String ZIP_CODE = "zipCode";
public static final String ADDRESS = "address";
public static final String PASSWORD = "password";
public static final Outsideuser user = null;
protected void initDao() {
// do nothing
}
public void save(Outsideuser transientInstance) {
log.debug("saving Outsideuser instance");
try {
getHibernateTemplate().save(transientInstance);
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
@SuppressWarnings("unchecked")
public void delete(Outsideuser persistentInstance) {
log.debug("deleting Outsideuser instance");
try {
getHibernateTemplate().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
public Outsideuser findById(java.lang.Integer id) {
log.debug("getting Outsideuser instance with id: " + id);
try {
Outsideuser instance = (Outsideuser) getHibernateTemplate().get(
Outsideuser.class, id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public Outsideuser findByOutsideUserName(String OutsideUserName) {
log.debug("finding Outsideuser instance by OutsideUserName");
try {
Outsideuser instance = (Outsideuser) getHibernateTemplate().get(
Outsideuser.class, OutsideUserName);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List findByExample(Outsideuser instance) {
log.debug("finding Outsideuser instance by example");
try {
List results = getHibernateTemplate().findByExample(instance);
log.debug("find by example successful, result size: "
+ results.size());
return results;
} catch (RuntimeException re) {
log.error("find by example failed", re);
throw re;
}
}
public List findByProperty(String propertyName, Object value) {
log.debug("finding Outsideuser instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from Outsideuser as model where model."
+ propertyName + "= ?";
return getHibernateTemplate().find(queryString, value);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
public List findByProperty(String propertyName, Object value,List user) {
log.debug("finding Outsideuser instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from "+ user +" where"
+ propertyName + "=?";
return getHibernateTemplate().find("queryString, value");
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
public List findByRole(Object role) {
return findByProperty(ROLE, role);
}
public List findByRole(Object role,List user) {
return findByProperty(ROLE, role,user);
}
public List findByOutsideUserName(Object outsideUserName) {
return findByProperty(OUTSIDE_USER_NAME, outsideUserName);
}
public List findByOutsideUserName(Object outsideUserName,List user) {
return findByProperty(OUTSIDE_USER_NAME, outsideUserName,user);
}
public List findByOutsideUserStatus(Object outsideUserStatus) {
return findByProperty(OUTSIDE_USER_STATUS, outsideUserStatus);
}
public List findByOutsideUserStatus(Object outsideUserStatus,List user) {
return findByProperty(OUTSIDE_USER_STATUS, outsideUserStatus,user);
}
public List findByUserSex(Object userSex) {
return findByProperty(USER_SEX, userSex);
}
public List findByUserSex(Object userSex,List user) {
return findByProperty(USER_SEX, userSex,user);
}
public List findByCurrentAddr(Object currentAddr) {
return findByProperty(CURRENT_ADDR, currentAddr);
}
public List findByCurrentAddr(Object currentAddr,List user) {
return findByProperty(CURRENT_ADDR, currentAddr,user);
}
public List findByMobile(Object mobile) {
return findByProperty(MOBILE, mobile);
}
public List findByMobile(Object mobile,List user) {
return findByProperty(MOBILE, mobile,user);
}
public List findByQq(Object qq) {
return findByProperty(QQ, qq);
}
public List findByQq(Object qq,List user) {
return findByProperty(QQ, qq,user);
}
public List findByMsn(Object msn) {
return findByProperty(MSN, msn);
}
public List findByMsn(Object msn,List user) {
return findByProperty(MSN, msn,user);
}
public List findByPhone(Object phone) {
return findByProperty(PHONE, phone);
}
public List findByPhone(Object phone,List user) {
return findByProperty(PHONE, phone, user);
}
public List findByZipCode(Object zipCode) {
return findByProperty(ZIP_CODE, zipCode);
}
public List findByZipCode(Object zipCode,List user) {
return findByProperty(ZIP_CODE, zipCode,user);
}
public List findByAddress(Object address) {
return findByProperty(ADDRESS, address);
}
public List findByAddress(Object address,List user) {
return findByProperty(ADDRESS, address, user);
}
public List findByPassword(Object password) {
return findByProperty(PASSWORD, password);
}
public List findByPassword(Object password,List user) {
return findByProperty(PASSWORD, password, user);
}
@SuppressWarnings("unchecked")
public List <Outsideuser>findAll() {
return this.getHibernateTemplate().find("from Outsideuser");
}
public Outsideuser merge(Outsideuser detachedInstance) {
log.debug("merging Outsideuser instance");
try {
Outsideuser result = (Outsideuser) getHibernateTemplate().merge(
detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public void attachDirty(Outsideuser instance) {
log.debug("attaching dirty Outsideuser instance");
try {
getHibernateTemplate().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public void attachClean(Outsideuser instance) {
log.debug("attaching clean Outsideuser instance");
try {
getHibernateTemplate().lock(instance, LockMode.NONE);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public Boolean login(Outsideuser outsideuser) {
StringBuffer hql = new StringBuffer();
hql.append("select a from Outsideuser a where a.password = ? and a.outsideUserName = ? and a.outsideUserStatus = 'on'");
if(this.getHibernateTemplate().find(hql.toString(),outsideuser.getPassword(),outsideuser.getOutsideUserName()).isEmpty())
return false;
else
return true;
}
public void update(Outsideuser transientInstance) {
log.debug("updating Insideuser instance");
try{
this.getHibernateTemplate().saveOrUpdate(transientInstance);
log.debug("update successful");
}catch(RuntimeException re){
log.error("update failed",re);
throw re;
}
}
public Boolean adduser(Outsideuser outsideuser) {
StringBuffer hql = new StringBuffer();
hql.append("select a from Outsideuser a where a.outsideUserName = ? ");
if(this.getHibernateTemplate().find(hql.toString(),outsideuser.getOutsideUserName()).isEmpty())
return true;
else
return false;
}
} | [
"xumenger@126.com"
] | xumenger@126.com |
77cbc4372b21690273cc9ab38fcb46f152c9901b | 5e3708628a43f95d470cf95a563cbe2a294170bc | /src/main/java/vindbrein/domain/model/PostulanteIdiomaPK.java | 6f6c4740cf1533d1effbeb56efbc6a00e8b49e07 | [] | no_license | deoxyseia/vindbrein-java | be31df5654fbad2caf6744b6387c4cae569f601f | 43bb44938ba192791746c1c6d8df837ceba498ab | refs/heads/master | 2020-03-28T01:02:42.143525 | 2014-07-09T21:45:17 | 2014-07-09T21:45:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,655 | java | package vindbrein.domain.model;
import java.io.Serializable;
import javax.persistence.*;
/**
* The primary key class for the postulante_idioma database table.
*
*/
@Embeddable
public class PostulanteIdiomaPK implements Serializable {
//default serial version id, required for serializable classes.
private static final long serialVersionUID = 1L;
private int fkIdioId;
private int fkPostId;
private int fkNiidId;
public PostulanteIdiomaPK() {
}
@Column(name="fk_idio_id", insertable=false, updatable=false)
public int getFkIdioId() {
return this.fkIdioId;
}
public void setFkIdioId(int fkIdioId) {
this.fkIdioId = fkIdioId;
}
@Column(name="fk_post_id", insertable=false, updatable=false)
public int getFkPostId() {
return this.fkPostId;
}
public void setFkPostId(int fkPostId) {
this.fkPostId = fkPostId;
}
@Column(name="fk_niid_id", insertable=false, updatable=false)
public int getFkNiidId() {
return this.fkNiidId;
}
public void setFkNiidId(int fkNiidId) {
this.fkNiidId = fkNiidId;
}
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof PostulanteIdiomaPK)) {
return false;
}
PostulanteIdiomaPK castOther = (PostulanteIdiomaPK)other;
return
(this.fkIdioId == castOther.fkIdioId)
&& (this.fkPostId == castOther.fkPostId)
&& (this.fkNiidId == castOther.fkNiidId);
}
public int hashCode() {
final int prime = 31;
int hash = 17;
hash = hash * prime + this.fkIdioId;
hash = hash * prime + this.fkPostId;
hash = hash * prime + this.fkNiidId;
return hash;
}
} | [
"deoxyseia@gmail.com"
] | deoxyseia@gmail.com |
54f5808bf7f33d3f8c3da783e7fc7ff042c7bde5 | e6880a1d20e2da4eee24d2c4bb49df5a538eccba | /faster-opm/src/main/java/org/faster/opm/Property.java | 2a48db14124bd49c72795aa1aa2cc044e909b294 | [] | no_license | wensq/faster | 4ba1b68cd7c62b162e986c2db8aa97370110c5da | 51950150975d5f29d713dc100a0d045b07700af2 | refs/heads/master | 2021-01-22T04:57:03.959231 | 2014-08-07T01:06:37 | 2014-08-07T01:06:37 | 7,832,663 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,501 | java | /*
* Copyright (c) 2013 @iSQWEN. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.faster.opm;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import static org.apache.commons.lang3.StringUtils.isBlank;
/**
* @author sqwen
* @date 2012-4-22
*/
@XmlRootElement(name = "property")
@XmlAccessorType(XmlAccessType.FIELD)
public class Property implements Serializable, Cloneable {
private static final long serialVersionUID = -6078213559490052059L;
@XmlAttribute
private String id;
@XmlAttribute
private String name;
@XmlAttribute
private String value;
@XmlAttribute
private String group;
private transient Set<String> groupNames;
private transient boolean changed = false;
// --------------------
// feature methods
// --------------------
public Property() {}
public Property(String id, String name, String value) {
this.id = id;
this.name = name;
this.value = value;
}
public Property(String id, String name, String value, String group) {
this(id, name, value);
this.group = group;
}
public boolean hasGroup(String groupName) {
if (isBlank(groupName)) {
return isBlank(group);
}
if (isBlank(group)) {
return false;
}
if (groupNames == null || changed) {
groupNames = new HashSet<String>();
String[] arr = group.split(",");
for (String gn : arr) {
groupNames.add(gn.trim());
}
changed = false;
}
return groupNames.contains(groupName.trim());
}
public void setGroup(String group) {
this.group = group;
changed = true;
}
public void filterAttribute(Set<String> attributeFilterValues) {
if (!attributeFilterValues.contains("id")) {
id = null;
}
if (!attributeFilterValues.contains("name")) {
name = null;
}
if (!attributeFilterValues.contains("value")) {
value = null;
}
if (!attributeFilterValues.contains("group")) {
group = null;
}
}
@Override
public Property clone() {
try {
return (Property) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalArgumentException("Can't clone " + this, e);
}
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this,
ToStringStyle.SHORT_PREFIX_STYLE);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (group == null ? 0 : group.hashCode());
result = prime * result + (id == null ? 0 : id.hashCode());
result = prime * result + (name == null ? 0 : name.hashCode());
result = prime * result + (value == null ? 0 : value.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;
}
Property other = (Property) obj;
if (group == null) {
if (other.group != null) {
return false;
}
} else if (!group.equals(other.group)) {
return false;
}
if (id == null) {
if (other.id != null) {
return false;
}
} else if (!id.equals(other.id)) {
return false;
}
if (name == null) {
if (other.name != null) {
return false;
}
} else if (!name.equals(other.name)) {
return false;
}
if (value == null) {
if (other.value != null) {
return false;
}
} else if (!value.equals(other.value)) {
return false;
}
return true;
}
// --------------------
// getter/setter
// --------------------
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getGroup() {
return group;
}
}
| [
"faster.wen@gmail.com"
] | faster.wen@gmail.com |
1d8330282cc72e6e1e8cd0da9c4db0f951904591 | a41544231c57edb8170956e75476ce198bef6dd3 | /src/core/at/tuwien/ifs/somtoolbox/apps/viewer/controls/VisualizationControl.java | e54c445b52f1c56f271efda6fccb523dd54bf9a1 | [] | no_license | TaylorPeer/somtooolbox-dendrograms | c7d915b2ec509c3c55e0704bd80671b4ba52e3eb | 36094e8ab20e3bffe2df333d055f59f7384fed4b | refs/heads/master | 2021-01-01T05:50:45.307287 | 2015-02-08T20:41:16 | 2015-02-08T20:41:16 | 30,176,715 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,299 | java | /*
* Copyright 2004-2010 Information & Software Engineering Group (188/1)
* Institute of Software Technology and Interactive Systems
* Vienna University of Technology, Austria
*
* 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.ifs.tuwien.ac.at/dm/somtoolbox/license.html
*
* 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 at.tuwien.ifs.somtoolbox.apps.viewer.controls;
import java.awt.Dimension;
import java.awt.GridLayout;
import javax.swing.JLabel;
import at.tuwien.ifs.somtoolbox.apps.viewer.CommonSOMViewerStateData;
import at.tuwien.ifs.somtoolbox.apps.viewer.SOMPane;
import at.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer.VisualizationControlPanel;
import at.tuwien.ifs.somtoolbox.visualization.VisualizationUpdateListener;
/**
* @author Rudolf Mayer
* @version $Id: VisualizationControl.java 3873 2010-10-28 09:29:58Z frank $
*/
public class VisualizationControl extends AbstractViewerControl implements VisualizationUpdateListener {
private static final long serialVersionUID = 1L;
private SOMPane mapPane;
private final String initialTitle;
private final JLabel noVisLabel = new JLabel("No visualisation loaded");
public VisualizationControl(String title, CommonSOMViewerStateData state, SOMPane mapPane) {
super(title, state, new GridLayout(1, 1));
initialTitle = title;
this.mapPane = mapPane;
// setContentBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
updateVisualisationControl();
setVisible(true);
}
@Override
public void updateVisualization() {
mapPane.updateVisualization();
mapPane.repaint();
if (getPanel() != null) {
getPanel().revalidate();
getPanel().repaint();
}
}
@Override
public Dimension getMinimumSize() {
return getPreferredSize();
}
public void updateVisualisationControl() {
if (getContentPane().getComponentCount() > 0) {
getContentPane().removeAll();
}
VisualizationControlPanel panel = getPanel();
if (panel != null) {
getContentPane().add(panel);
mapPane.getCurrentVisualization().setVisualizationUpdateListener(this);
panel.updateSwitchControls();
setTitle(panel.getName());
} else {
getContentPane().add(noVisLabel);
// setCollapsed(true);
setTitle(initialTitle);
}
revalidate();
// getContentPane().repaint();
// updateVisualization();
}
private VisualizationControlPanel getPanel() {
if (mapPane != null && mapPane.getCurrentVisualization() != null) {
return mapPane.getCurrentVisualization().getControlPanel();
} else {
return null;
}
}
}
| [
"t.peer@cortical.io"
] | t.peer@cortical.io |
7c3fe74ea4ffd7795aae4c2617123cd46dbdda46 | f19c37686b511505b5ee2f2e99682918058f59ae | /Source_Program/Shopping_System_Online/src/Dao/ShopcarDAO.java | 56c6674897c1203cb48ea86aee6f90a9e8f609f6 | [] | no_license | JulianZY/Shopping-System-Online | 93c5839a8085a539ade1ecccb16bddec1a185ed3 | 19ac43603bae8431d3c486ee2227bb58cd8a0b7a | refs/heads/master | 2021-01-10T16:40:20.117185 | 2016-03-04T13:15:16 | 2016-03-04T13:15:16 | 53,136,233 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,301 | java | package Dao;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import Model.Shop;
import Model.Shopcar;
import Model.User;
import Action.HibernateUtils;
public class ShopcarDAO {
public Boolean create(Shopcar shopcar){
Session session=HibernateUtils.getSession();
Transaction tx=session.beginTransaction();
session.save(shopcar);
tx.commit();
session.close();
return true;
}
public Boolean delete(Shopcar shopcar){
Session session=HibernateUtils.getSession();
String command="delete Shopcar where id=:id";
Transaction tx=session.beginTransaction();
//session.delete(shopcar);
Query query=session.createQuery(command);
query.setParameter("id", shopcar.getId());
query.executeUpdate();
tx.commit();
session.close();
return true;
}
public Boolean update(Shopcar shopcar){
Session session=HibernateUtils.getSession();
Transaction tx=session.beginTransaction();
session.update(shopcar);
session.close();
return true;
}
public Shopcar queryById(Integer id){
//String command="from User as u where u.id='";
Session session=HibernateUtils.getSession();
Transaction tx=session.beginTransaction();
//session.createQuery(command+id+"'");
Shopcar shopcar=(Shopcar)session.get(Shopcar.class, id);
tx.commit();
session.close();
return shopcar;
}
/////////////////////////
public Shopcar queryByUser(User user){
//String command="from User as u where u.id='";
String command="from Shopcar as sc where sc.user=:user";
Session session=HibernateUtils.getSession();
Transaction tx=session.beginTransaction();
//session.createQuery(command+id+"'");
Query query=session.createQuery(command);
query.setParameter("user", user);
List<Shopcar> shopcars=query.list();
tx.commit();
session.close();
if(shopcars.isEmpty())
return null;
return shopcars.get(0);
}
/////////////////////////
public List<Shopcar> queryAll(){
String command="from Shopcar sc";
Session session=HibernateUtils.getSession();
Transaction tx=session.beginTransaction();
Query query=session.createQuery(command);
List<Shopcar> shopcars=query.list();
//User user=(User)session.get(User.class, id);
tx.commit();
session.close();
return shopcars;
}
} | [
"zhuyong_zyz@yeah.net"
] | zhuyong_zyz@yeah.net |
1bc1c9ef16d113d413a766924654542c890b4b7d | f2d85e3f5d6dcac0a7b18cbfef6d6b7c62ab570a | /i2am-app/dynamic-tagcloud/dynamic-tagcloud-storm/src/main/java/i2am/team1/WordCountBinder.java | ea792aff960adf934da9629238734b64906290e5 | [
"Apache-2.0"
] | permissive | dke-knu/i2am | 82bb3cf07845819960f1537a18155541a1eb79eb | 0548696b08ef0104b0c4e6dec79c25300639df04 | refs/heads/master | 2023-07-20T01:30:07.029252 | 2023-07-07T02:00:59 | 2023-07-07T02:00:59 | 71,136,202 | 8 | 14 | Apache-2.0 | 2023-07-07T02:00:31 | 2016-10-17T12:29:48 | Java | UTF-8 | Java | false | false | 656 | java | package i2am.team1;
import java.util.ArrayList;
import java.util.List;
import org.apache.storm.trident.operation.ReducerAggregator;
import org.apache.storm.trident.tuple.TridentTuple;
public class WordCountBinder implements ReducerAggregator<List<WordCountElement>>{
@Override
public List<WordCountElement> init() {
// TODO Auto-generated method stub
return new ArrayList<WordCountElement>();
}
@Override
public List<WordCountElement> reduce(List<WordCountElement> curr, TridentTuple tuple) {
// TODO Auto-generated method stub
curr.add(new WordCountElement(tuple.getString(0), tuple.getLong(1), tuple.getString(2)));
return curr;
}
}
| [
"wnghd9999@naver.com"
] | wnghd9999@naver.com |
858630d76108858d1dd1ea884537ae1af97ede8f | 5b2c5563568736afd0cc5ff06af32b47e5942755 | /xcjy-dao/src/test/java/com/xcjy/dao/test/config/spring/DataConfig.java | b8c7536717de053a0318fa52ac25e423e91a0511 | [] | no_license | strangerML/yonghegong | 1c2c7d32c87a048a048acc79cbd0e7f089dd27ed | 3d92be379b15d9d185cbcd34a7201322b1ebbcee | refs/heads/master | 2020-03-22T03:53:53.925201 | 2018-07-03T02:20:57 | 2018-07-03T02:20:57 | 139,458,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,089 | java | package com.xcjy.dao.test.config.spring;
import java.beans.PropertyVetoException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import javax.sql.DataSource;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.xcjy.entity.common.orm.annotation.Column;
import com.xcjy.entity.common.orm.annotation.EnableOrm;
import com.xcjy.entity.common.orm.annotation.Entity;
import com.xcjy.entity.common.orm.annotation.Id;
import com.xcjy.entity.common.orm.annotation.Vender;
import com.xcjy.entity.common.orm.enumeration.VenderType;
import com.xcjy.entity.common.orm.mapper.ORMapper;
import com.xcjy.entity.common.orm.mapper.TableMapper;
import com.xcjy.infra.exception.SystemException;
import com.xcjy.infra.utils.clazz.ClassFilter;
import com.xcjy.infra.utils.clazz.PackageUtil;
@Configuration
@ComponentScan(basePackages = "com.denet")
@EnableOrm(basePackages = "com.denet")
@Vender(VenderType.MYSQL)
public class DataConfig {
private static final Logger logger = LoggerFactory.getLogger(DataConfig.class);
// 注入数据库连接信息
// @Value("#{configProperties['db.driverClass']}")
private String driverClass = "com.mysql.jdbc.Driver";
// @Value("#{configProperties['db.url']}")
private String url = "jdbc:mysql://192.168.1.128:3306/denet-framework?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true";
// @Value("#{configProperties['db.userName']}")
private String userName = "root";
// @Value("#{configProperties['db.password']}")
private String password = "root";
/**
* 数据库连接池
*
* @return c3p0的数据库连接池
* @throws PropertyVetoException
*/
@Bean(destroyMethod = "close")
public DataSource dataSource() {
ComboPooledDataSource dataSource = new ComboPooledDataSource();
try {
dataSource.setDriverClass(driverClass);
dataSource.setJdbcUrl(url);
dataSource.setUser(userName);
dataSource.setPassword(password);
} catch (PropertyVetoException e) {
e.printStackTrace();
}
return dataSource;
}
/**
* JdbcTemplate
*
* @return
*/
@Bean
public JdbcTemplate jdbcTemplate() {
JdbcTemplate template = new JdbcTemplate();
template.setDataSource(dataSource());
return template;
}
/**
* namedTemplate
*
* @return
*/
@Bean
public NamedParameterJdbcTemplate namedTemplate() {
return new NamedParameterJdbcTemplate(jdbcTemplate());
}
/**
* 事务管理器
*
* @return
*/
@Bean
@Qualifier("defaultTm")
public DataSourceTransactionManager transactionManager() {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
transactionManager.setDataSource(dataSource());
return transactionManager;
}
@Bean
public ORMapper mapper() {
// 判断是否启用ORM
boolean isOrm = DataConfig.class.isAnnotationPresent(EnableOrm.class);
if (!isOrm) {
logger.warn("missing EnableOrm annotation on DataConfig.class");
throw new SystemException("ORM config is not open");
}
// 获取注解扫描包
String[] basePackages = DataConfig.class.getAnnotation(EnableOrm.class).basePackages();
if (basePackages == null || basePackages.length == 0) {
logger.warn("EnableOrm.basePackages is not set value");
throw new SystemException("EnableOrm.basePackages is not set value");
}
// 判断是否指定数据库类型
boolean isVender = DataConfig.class.isAnnotationPresent(Vender.class);
if (!isVender) {
logger.warn("missing Vender annotation on DataConfig.class");
throw new SystemException("missing Vender annotation on DataConfig.class");
}
// 获取数据库类型
VenderType venderType = DataConfig.class.getAnnotation(Vender.class).value();
// 扫描该包及其子包下的所有实体类,并放入list
List<Class<?>> entities = new ArrayList<Class<?>>();
for (String basePackage : basePackages) {
entities = PackageUtil.getClasses(basePackage, new ClassFilter() {
@Override
public boolean adopt(Class<?> clazz) {
if (clazz.isAnnotationPresent(Entity.class)) {
return true;
}
return false;
}
});
}
// 获取实体类元数据信息
LinkedHashMap<String, TableMapper> entityMeta = new LinkedHashMap<String, TableMapper>();
for (Class<?> entity : entities) {
String className = entity.getName();
String tableName = "";
String pkProperty = "";
LinkedHashMap<String, String> columnMapper = new LinkedHashMap<String, String>();
// @Entity注解
tableName = entity.getAnnotation(Entity.class).table();
if (StringUtils.isEmpty(tableName)) {
tableName = entity.getSimpleName();
}
Field[] fields = entity.getDeclaredFields();
for (Field field : fields) {
// @Column注解
if (field.isAnnotationPresent(Column.class)) {
String propertyName = field.getName();
String columnName = field.getAnnotation(Column.class).value();
// 如果value为空,则列名=属性名
if (StringUtils.isEmpty(columnName)) {
columnName = propertyName;
}
columnMapper.put(propertyName, columnName);
// @Id注解
if (field.isAnnotationPresent(Id.class)) {
pkProperty = field.getName();
}
}
}
TableMapper tableMapper = new TableMapper(tableName, pkProperty, columnMapper);
entityMeta.put(className, tableMapper);
}
ORMapper mapper = new ORMapper(true, venderType, entityMeta);
logger.info("ORMapper building finished");
return mapper;
}
}
| [
"756842118@qq.com"
] | 756842118@qq.com |
2753f1772d13cbfcad68a9019fe50d4a3b35eb19 | 497e1b81a0b549c8102f28d44e6f5eeb2aefba2c | /operapi-spirng-boot-starter/src/main/java/com/application/boot/operapi/core/api/hive/HiveConfigProperties.java | ca876d1a22d1e2012624c71883c1a3033643378b | [] | no_license | luckysoftgo/base-spring-boot-starter | 16c2476af824b662bd2ae204fcfd2af536385994 | 39f33f55c3355334feadae14d8e969d4b8103b32 | refs/heads/master | 2023-06-08T07:37:52.331939 | 2020-03-16T08:03:36 | 2020-03-16T08:03:36 | 225,787,849 | 0 | 0 | null | 2023-05-26T22:16:02 | 2019-12-04T05:37:59 | Java | UTF-8 | Java | false | false | 1,364 | java | package com.application.boot.operapi.core.api.hive;
import com.application.boot.operapi.common.GenericPool;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* @author : 孤狼
* @NAME: HiveConfigProperties
* @DESC: HbaseConfigProperties类设计
**/
@ConfigurationProperties(prefix = "hive")
public class HiveConfigProperties {
/**
* 连接池对象
*/
private GenericPool pool =new GenericPool();
/**
* 请求的用户名.
*/
private String userName;
/**
* 请求的密码.
*/
private String userPass;
/**
* driver名称.
*/
private String hiveDriver="org.apache.hive.jdbc.HiveDriver";
/**
* hive的连接地址.
*/
private String hiveUrl;
public GenericPool getPool() {
return pool;
}
public void setPool(GenericPool pool) {
this.pool = pool;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserPass() {
return userPass;
}
public void setUserPass(String userPass) {
this.userPass = userPass;
}
public String getHiveDriver() {
return hiveDriver;
}
public void setHiveDriver(String hiveDriver) {
this.hiveDriver = hiveDriver;
}
public String getHiveUrl() {
return hiveUrl;
}
public void setHiveUrl(String hiveUrl) {
this.hiveUrl = hiveUrl;
}
}
| [
"supingemail@126.com"
] | supingemail@126.com |
ad8cc896a81dedb13b040dd715f04280f7b1ac51 | eb6382729f50822f9b5539df2e2a5c5d75c534c9 | /src/pl/coderslab/model/Solution.java | 536f70fc8e228b2a25040e789300cb6b71a8fd03 | [] | no_license | PiotrekBa/workshop-3 | 15108fb23f205003464489b751b752507c1b8246 | 2b7d305fce9eefe2ad73aaf6e59542813f1def78 | refs/heads/master | 2021-09-06T22:28:06.517101 | 2018-02-12T15:55:16 | 2018-02-12T15:55:16 | 113,577,630 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,671 | java | package pl.coderslab.model;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import pl.coderslab.utils.DbUtil;
public class Solution {
private int id;
private Date created;
private Date updated;
private int exercise_id;
private int user_id;
private String description;
public Solution(Date created, Date updated, String description) {
this.created = created;
this.updated = updated;
this.description = description;
}
public Solution() {
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public int getId() {
return id;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getUpdated() {
return updated;
}
public void setUpdated(Date updated) {
this.updated = updated;
}
public int getExercise_id() {
return exercise_id;
}
public void setExercise_id(int exercise_id) {
this.exercise_id = exercise_id;
}
public int getUser_id() {
return user_id;
}
public void setUser_id(int user_id) {
this.user_id = user_id;
}
public User getUser() {
Connection conn;
User user = null;
try {
conn = DbUtil.getConn();
user = User.loadUserById(conn, this.user_id);
} catch (SQLException e) {
e.printStackTrace();
}
return user;
}
public Exercise getExercise() {
Connection conn;
Exercise exercise = null;
try {
conn = DbUtil.getConn();
exercise = Exercise.loadExerciseById(conn, this.exercise_id);
} catch (SQLException e) {
e.printStackTrace();
}
return exercise;
}
static public Solution[] loadAllSolutions(Connection conn) throws SQLException {
ArrayList<Solution> solutions = new ArrayList<Solution>();
String sql = "SELECT * FROM solutions";
PreparedStatement preparedStatement;
preparedStatement = conn.prepareStatement(sql);
ResultSet resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
Solution loadedSolutions = new Solution();
loadedSolutions.id = resultSet.getInt("id");
loadedSolutions.created = resultSet.getDate("created");
loadedSolutions.updated = resultSet.getDate("updated");
loadedSolutions.exercise_id = resultSet.getInt("exercise_id");
loadedSolutions.user_id = resultSet.getInt("user_id");
loadedSolutions.description = resultSet.getString("description");
solutions.add(loadedSolutions);
}
Solution[] sArray = new Solution[solutions.size()];
sArray = solutions.toArray(sArray);
return sArray;
}
static public Solution[] loadAllSolutions(Connection conn, int limit) throws SQLException {
ArrayList<Solution> solutions = new ArrayList<Solution>();
String sql = "SELECT * FROM solutions ORDER BY created DESC LIMIT ?;";
PreparedStatement preparedStatement;
preparedStatement = conn.prepareStatement(sql);
preparedStatement.setInt(1, limit);
ResultSet resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
Solution loadedSolutions = new Solution();
loadedSolutions.id = resultSet.getInt("id");
loadedSolutions.created = resultSet.getDate("created");
loadedSolutions.updated = resultSet.getDate("updated");
loadedSolutions.exercise_id = resultSet.getInt("exercise_id");
loadedSolutions.user_id = resultSet.getInt("user_id");
loadedSolutions.description = resultSet.getString("description");
solutions.add(loadedSolutions);
}
Solution[] sArray = new Solution[solutions.size()];
sArray = solutions.toArray(sArray);
return sArray;
}
static public Solution loadSolutionById(Connection conn, int id) throws SQLException {
String sql = "SELECT * FROM solutions where id=?";
PreparedStatement preparedStatement;
preparedStatement = conn.prepareStatement(sql);
preparedStatement.setInt(1, id);
ResultSet resultSet = preparedStatement.executeQuery();
if (resultSet.next()) {
Solution loadedSolution = new Solution();
loadedSolution.id = resultSet.getInt("id");
loadedSolution.created = resultSet.getDate("created");
loadedSolution.updated = resultSet.getDate("updated");
loadedSolution.exercise_id = resultSet.getInt("exercise_id");
loadedSolution.user_id = resultSet.getInt("user_id");
loadedSolution.description = resultSet.getString("description");
return loadedSolution;
}
return null;
}
public void delete(Connection conn) throws SQLException {
if (this.id != 0) {
String sql = "DELETE FROM solutions WHERE id= ?";
PreparedStatement preparedStatement;
preparedStatement = conn.prepareStatement(sql);
preparedStatement.setInt(1, this.id);
preparedStatement.executeUpdate();
this.id = 0;
}
}
public void saveToDB(Connection conn) throws SQLException {
if (this.id == 0) {
String sql = "INSERT INTO solutions(created, exercise_id, user_id, description) VALUES (NOW(), ?, ?, ?)";
String generatedColumns[] = { "ID" };
PreparedStatement preparedStatement;
preparedStatement = conn.prepareStatement(sql, generatedColumns);
preparedStatement.setInt(1, this.exercise_id);
preparedStatement.setInt(2, this.user_id);
preparedStatement.setString(3, this.description);
preparedStatement.executeUpdate();
ResultSet rs = preparedStatement.getGeneratedKeys();
if (rs.next()) {
this.id = rs.getInt(1);
}
} else {
String sql = "UPDATE solutions SET updated=NOW(), exercise_id=?, user_id=?, description=? where id = ?";
PreparedStatement preparedStatement;
preparedStatement = conn.prepareStatement(sql);
preparedStatement.setInt(1, this.exercise_id);
preparedStatement.setInt(2, this.user_id);
preparedStatement.setString(3, this.description);
preparedStatement.setInt(4, this.id);
preparedStatement.executeUpdate();
}
}
public static Solution[] loadAllByUserId(int id, Connection conn) throws SQLException {
String sql = "select * from solutions S join exercises E on S.exercise_id = E.id where S.user_id = ?";
PreparedStatement preparedStatement;
preparedStatement = conn.prepareStatement(sql);
preparedStatement.setInt(1, id);
ResultSet rs = preparedStatement.executeQuery();
List<Solution> solutions = new ArrayList<>();
while (rs.next()) {
Solution solution = new Solution(rs.getDate("S.created"), rs.getDate("S.updated"), rs.getString("S.description"));
solution.id = rs.getInt("S.id");
solution.exercise_id = rs.getInt("exercise_id");
solution.user_id = rs.getInt("S.user_id");
solutions.add(solution);
}
Solution[] loadedSolutions = new Solution[solutions.size()];
loadedSolutions = solutions.toArray(loadedSolutions);
return loadedSolutions;
}
public static Solution[] loadAllByExerciseId(int id, Connection conn) throws SQLException {
String sql = "select * from solutions S join exercises E on S.exercise_id = E.id where S.exercise_id = ?";
PreparedStatement preparedStatement;
preparedStatement = conn.prepareStatement(sql);
preparedStatement.setInt(1, id);
ResultSet rs = preparedStatement.executeQuery();
List<Solution> solutions = new ArrayList<>();
while (rs.next()) {
Solution solution = new Solution(rs.getDate("S.created"), rs.getDate("S.updated"), rs.getString("S.description"));
solution.id = rs.getInt("S.id");
solution.exercise_id = rs.getInt("exercise_id");
solution.user_id = rs.getInt("S.user_id");
solutions.add(solution);
}
Solution[] loadedSolutions = new Solution[solutions.size()];
loadedSolutions = solutions.toArray(loadedSolutions);
return loadedSolutions;
}
}
| [
"p_bartoszak@wp.pl"
] | p_bartoszak@wp.pl |
b7a9cd100681c14202be4f0a51345224a8495b32 | f67e19c46883fb4cffb631265ff0db8f46116384 | /idol/src/test/java/com/hp/autonomy/searchcomponents/idol/typeahead/IdolTypeAheadServiceTest.java | 22aae80b3c1bc4e48003da437ef2c3b31bc20b61 | [
"MIT"
] | permissive | joesoc/haven-search-components | 14509b46e2f9637717aaa5ad7e1d7d488a339e3e | e865b52b05cfb29ab5dd8aa292b7616f173e666b | refs/heads/master | 2021-01-21T00:36:23.129342 | 2016-06-23T16:34:53 | 2016-06-23T16:34:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,118 | java | /*
* Copyright 2015 Hewlett-Packard Development Company, L.P.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
*/
package com.hp.autonomy.searchcomponents.idol.typeahead;
import com.autonomy.aci.client.services.AciErrorException;
import com.hp.autonomy.frontend.configuration.ConfigService;
import com.hp.autonomy.searchcomponents.core.typeahead.TypeAheadService;
import com.hp.autonomy.searchcomponents.idol.configuration.IdolSearchCapable;
import com.hp.autonomy.searchcomponents.idol.configuration.QueryManipulation;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class IdolTypeAheadServiceTest {
@Mock
private ConfigService<? extends IdolSearchCapable> configService;
@Mock
private TypeAheadService<AciErrorException> termExpandTypeAheadService;
@Mock
private TypeAheadService<AciErrorException> qmsTypeAheadService;
@Mock
private IdolSearchCapable config;
private TypeAheadService<AciErrorException> typeAheadService;
@Before
public void setUp() {
typeAheadService = new IdolTypeAheadService(configService, termExpandTypeAheadService, qmsTypeAheadService);
when(configService.getConfig()).thenReturn(config);
}
@Test
public void getQmsSuggestions() {
when(config.getQueryManipulation()).thenReturn(new QueryManipulation.Builder().setEnabled(true).build());
final String text = "A";
typeAheadService.getSuggestions(text);
verify(qmsTypeAheadService).getSuggestions(text);
}
@Test
public void getContentSuggestions() {
when(config.getQueryManipulation()).thenReturn(new QueryManipulation.Builder().setEnabled(false).build());
final String text = "A";
typeAheadService.getSuggestions(text);
verify(termExpandTypeAheadService).getSuggestions(text);
}
}
| [
"ivo.miller@hpe.com"
] | ivo.miller@hpe.com |
758a47654a4f3a0972488204064738c5525f7058 | b312ba97eec1f108ef8584c5e88ee6bc4675d57f | /代码/ReviewUDP/src/Host2.java | fb6d38b5753ef9bb4f2fa0500e36ff262788aae9 | [] | no_license | Beteasy/JAVA-GRADE2SEMESTER2- | 5fb873ae311650840aba2e8ef67e8d373fba3697 | 38cdaf6a53c9b866dbc8bd04113fe5624b00bd20 | refs/heads/master | 2020-06-20T16:46:21.181792 | 2019-07-16T11:43:49 | 2019-07-16T11:43:49 | 197,182,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,020 | java | import java.io.*;
import java.net.*;
import java.util.*;
public class Host2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
byte[] dataOut = null;
DatagramPacket dataPackSend = null;
DatagramSocket mailOut = null;
Scanner scanner = new Scanner(System.in);
String IP = new String("127.0.0.1");
int sendPort = 6666;
Host2Class hostClass = new Host2Class();
Thread thread =new Thread(hostClass);
thread.start();
System.out.println("*************running**********");
while(true) {
dataOut = scanner.nextLine().getBytes();
try {
dataPackSend = new DatagramPacket(dataOut,dataOut.length,InetAddress.getByName(IP),6666);
mailOut = new DatagramSocket();
mailOut.send(dataPackSend);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
class Host2Class implements Runnable{
byte[] dataOut = null;
byte[] dataIn = null;
DatagramPacket dataPackSend = null;
DatagramPacket dataPackReceive = null;
DatagramSocket mailOut = null;
DatagramSocket mailReceive = null;
Scanner scanner = new Scanner(System.in);
String IP = new String("127.0.0.1");
int receivePort = 2333;
@Override
public void run() {
// TODO Auto-generated method stub
dataIn = new byte[8192];
String str= "";
try {
dataPackReceive = new DatagramPacket(dataIn,dataIn.length);
mailReceive = new DatagramSocket(receivePort);
} catch (SocketException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
while(true) {
try {
if(mailReceive == null) {
System.out.println("mailReceive failed");
mailReceive = new DatagramSocket(2333);
break;
}
else {
mailReceive.receive(dataPackReceive);
//how to get the data
str = new String(dataPackReceive.getData(),0,dataPackReceive.getLength());
System.out.println(str);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
} | [
"1402308343@qq.com"
] | 1402308343@qq.com |
699c1473b2d4c5119e77f9b0ae06414a18d63f88 | ea08265d7690aa6456ae1c9144018e1dc8a17a93 | /src/main/java/com/mzl/reuse/SprinklerSystem.java | a0a163155e5542bdff34add84cddb55e36cd9714 | [] | no_license | huagenlike/java8 | eb97b455f60cc22fb0eefac41e5f21c28470fce5 | c76531e807a634ea33bb961dad0638b65393384e | refs/heads/master | 2023-02-27T19:38:01.279679 | 2021-02-09T09:10:22 | 2021-02-09T09:10:22 | 277,754,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,374 | java | package com.mzl.reuse;
/**
* @description: 组合
* @author: lhg
* @date: Created in 2020/7/8 16:10
* @version:
* @modified By:
*/
class WaterSource {
private String s;
WaterSource() {
System.out.println("WaterSource()");
s = "Constructed";
}
@Override
public String toString() { return s; }
}
// 在 [1] 中,编译器看到你试图“添加”一个 WaterSource 类型的字符串对象 。因为字符串只能拼接另一个字符串,所以它就先会调用 toString() 将 source 转换成一个字符串。
// 然后,它可以拼接这两个字符串并将结果字符串传递给 System.out.println()。
public class SprinklerSystem {
private String valve1, valve2, valve3, valve4;
private WaterSource source = new WaterSource();
private int i;
private float f;
@Override
public String toString() {
return
"valve1 = " + valve1 + " " +
"valve2 = " + valve2 + " " +
"valve3 = " + valve3 + " " +
"valve4 = " + valve4 + "\n" +
"i = " + i + " " + "f = " + f + " " +
"source = " + source; // [1]
}
public static void main(String[] args) {
SprinklerSystem sprinklers = new SprinklerSystem();
System.out.println(sprinklers);
}
}
| [
"34886711@qq.com"
] | 34886711@qq.com |
2e5db21421a485f65a93f680135fa6413ed1174c | 49fe3d43ab90b4e241795f4c3f43bb53f4cb0e32 | /src/com/company/Lesson40/Test02.java | 27858a535e6e678ce26b2676de444692e7aec62f | [] | no_license | aierko/dev | a0e8a6b8ceaa61f6842cf02a4443fcc9ea6a3cf7 | ea52685dd0a70e4bd578369cf417f6c6a2f7a5c9 | refs/heads/master | 2021-09-03T10:08:45.436562 | 2017-10-20T12:53:43 | 2017-10-20T12:53:43 | 106,323,994 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,827 | java | package com.company.Lesson40;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/**
* Created by user on 21.12.2016.
*//* Новая задача: Программа вводит строки, пока пользователь не введёт пустую строку (нажав enter).
Потом программа строит новый список. Если в строке чётное число букв, строка удваивается, если нечётное – утраивается.
Программа выводит содержимое нового списка на экран.
Пример ввода:
Кот
Коты
Я
Пример вывода:
Кот Кот Кот
Коты Коты
Я Я Я
*/
public class Test02 {
public static void main(String[] args) throws IOException {
List<String> list = stroki();
System.out.println(fix(list));
}
public static List<String> stroki() throws IOException {
List<String> arr3 = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while (true) {
String a = reader.readLine();
if (a.isEmpty()) break;
else arr3.add(a);
}
return arr3;
}
public static List<String> fix(List<String> list) {
List<String> arr1 = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
if (list.get(i).length() % 2 == 0) {
arr1.add(list.get(i));
arr1.add(list.get(i));
} else {
arr1.add(list.get(i));
arr1.add(list.get(i));
arr1.add(list.get(i));
}
}
return arr1;
}
} | [
"vtldtl80"
] | vtldtl80 |
365696b25f83e9fd7f265cf7e11e5ca1f5ba008a | 217d96db536ff284fc1b168bf640104f00ba1ad5 | /rifidi/tags/org.rifidi.jmeswt/1.0.0/src/org/rifidi/utilities/swt/FileBrowser.java | e799d0737af6b9b1b07e164daad55b2181ee61f0 | [] | no_license | TranscendsLLC/emulator | d5b94965b8ebd894707c093334c51aabf30d0075 | a46c42cd2e86aafc213df7585dc923895a589446 | refs/heads/master | 2021-01-14T12:31:10.876450 | 2010-10-01T21:28:07 | 2010-10-01T21:28:07 | 43,608,652 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,987 | java | /**
*
*/
package org.rifidi.utilities.swt;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
/**
* @author dan
*/
public class FileBrowser {
private int browserStyle;
private Text fileEntry;
public FileBrowser( String labeltext, String dialogText, Composite parent, int browserStyle ) {
createWidget(labeltext,dialogText,parent);
this.browserStyle = browserStyle;
}
private void createWidget( String labeltext, final String dialogText, Composite parent ) {
Composite comp = new Composite(parent,SWT.NONE);
GridLayout gl = new GridLayout();
gl.numColumns = 3;
comp.setLayout( gl );
comp.setLayoutData( new GridData(SWT.FILL,SWT.CENTER,true,true));
// create label
Label label = new Label(comp,SWT.NONE);
label.setText(labeltext);
// create text entry box
fileEntry = new Text(comp,SWT.BORDER);
fileEntry.setLayoutData( new GridData(SWT.FILL,SWT.CENTER,true,false) );
// create browse button
Button browseButton = new Button(comp,SWT.NONE);
browseButton.setText("Browse...");
browseButton.addSelectionListener( new SelectionAdapter() {
/* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
FileDialog fd = new FileDialog(new Shell(),browserStyle);
fd.setText(dialogText);
String result = fd.open();
if ( result != null ) {
fileEntry.setText(result);
}
}
});
}
public String getFile() {
return fileEntry.getText();
}
public Text getTextbox() {
return fileEntry;
}
} | [
"jochen@70ba6d20-ffbb-44b8-b480-e27427137dba"
] | jochen@70ba6d20-ffbb-44b8-b480-e27427137dba |
0d91e5bfccfe36a8b3843fb4f7364ee2a8058215 | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes11.dex_source_from_JADX/com/facebook/composer/location/controller/ImplicitLocationPillControllerProvider.java | 6f06d6c986ab8710767c97351f0afb21504542b7 | [] | 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 | 258 | java | package com.facebook.composer.location.controller;
import com.facebook.inject.AbstractAssistedProvider;
/* compiled from: from_step */
public class ImplicitLocationPillControllerProvider extends AbstractAssistedProvider<ImplicitLocationPillController> {
}
| [
"son.pham@jmango360.com"
] | son.pham@jmango360.com |
2ca2aecd68daa7c83c5ccf6fd4cb19d2f5e6d005 | 8712499459bae47a2add523fc6e7793a3edbe903 | /tech-compass/四則演算/task1.java | 81d84dab08fc5b8d399e5d355eb8209b5b4cb22d | [] | no_license | YuTaka2018/YuTaka2018 | 5c047d5668bf63ec13f9b57e04bede1ca943941a | e3e7627b63995ddcffdf059e5c815e6be7a76259 | refs/heads/master | 2021-01-05T17:34:29.548133 | 2020-02-26T11:58:17 | 2020-02-26T11:58:17 | 241,090,886 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 241 | java | public class task1 {
public static void main(String[] args) {
System.out.println("修正前: " + (3 + 2 * 6 + 5));
System.out.println("修正後: " + ((3 + 2) * 6 + 5));
System.out.println("24/3の余り: " + 24 % 3);
}
}
| [
"voca39chan@gmail.com"
] | voca39chan@gmail.com |
69476ef0d3a16a80c4c694dd33d4a8e80d83b639 | cd7672c80e969ec74ca793c458c240aad67abd9b | /Hill/src/hill/HillApp.java | 588916e6add93fa6cd6ad662f3358c419cca4d45 | [] | no_license | miguelrohdez/HILL | 6f58b644a47af93f76dea72d6606d1aa610d0c17 | 4dfbd95390700ede610ad3c75c1bf58e8edab59b | refs/heads/master | 2020-04-27T17:04:04.737896 | 2009-11-09T20:46:13 | 2009-11-09T20:46:13 | 174,503,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,100 | java | /*
* HillApp.java
*/
package hill;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
/**
* The main class of the application.
*/
public class HillApp extends SingleFrameApplication {
/**
* At startup create and show the main frame of the application.
*/
@Override protected void startup() {
show(new HillView(this));
}
/**
* This method is to initialize the specified window by injecting resources.
* Windows shown in our application come fully initialized from the GUI
* builder, so this additional configuration is not needed.
*/
@Override protected void configureWindow(java.awt.Window root) {
}
/**
* A convenient static getter for the application instance.
* @return the instance of HillApp
*/
public static HillApp getApplication() {
return Application.getInstance(HillApp.class);
}
/**
* Main method launching the application.
*/
public static void main(String[] args) {
launch(HillApp.class, args);
}
}
| [
"fabioanh@aebbe55f-5efe-4b08-81bb-bc1a90311555"
] | fabioanh@aebbe55f-5efe-4b08-81bb-bc1a90311555 |
2b28d0e1e5091f37400425836e01a604fb847acc | d699c37b4fbfbcee0d8be703f6553d81e9b437c8 | /app/src/main/java/com/joinpa/joinpa/joinpa/MyJoinedEvent/MyJoinedEventCustomAdapter.java | 56e0beeb2c5f7675551e253b1f8111e5f3c72c60 | [] | no_license | nottpty/JoinPa_Android | 18de4da6db2d9b3bdec4a2b4e48997cb5bd8fafc | d80db5bfa14cf10403e73641c4a56b4927b59ec3 | refs/heads/master | 2021-01-12T00:30:29.937482 | 2015-05-30T13:17:21 | 2015-05-30T13:17:21 | 78,734,505 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,398 | java | package com.joinpa.joinpa.joinpa.MyJoinedEvent;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.joinpa.joinpa.joinpa.InvitedList.InvitedListCustomAdapter;
import com.joinpa.joinpa.joinpa.Library.JoiningEvent;
import com.joinpa.joinpa.joinpa.Library.Resources;
import com.joinpa.joinpa.joinpa.Library.User;
import com.joinpa.joinpa.joinpa.R;
import java.util.List;
import java.util.Map;
/**
* My Joined event custom adapter.
* Created on 4/5/2558.
* Created by TAWEERAT CHAIMAN 5710546259, PATINYA YONGYAI 5710547204
*/
public class MyJoinedEventCustomAdapter extends BaseExpandableListAdapter{
private Activity activity;
private List<List<Map<User,Integer>>> childView;
private List<JoiningEvent> parentView;
private InvitedListCustomAdapter invitedListCustomAdapter;
/**
* Constructor.
* @param activity
* @param parentView
* @param childView
*/
public MyJoinedEventCustomAdapter(Activity activity,List<JoiningEvent> parentView, List<List<Map<User,Integer>>> childView){
this.parentView = parentView;
this.childView = childView;
this.activity = activity;
}
@Override
public int getGroupCount() {
return parentView.size();
}
@Override
public int getChildrenCount(int groupPosition) {
return childView.get(groupPosition).size();
}
@Override
public Object getGroup(int groupPosition) {
return null;
}
@Override
public Object getChild(int groupPosition, int childPosition) {
return null;
}
@Override
public long getGroupId(int groupPosition) {
return 0;
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return 0;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
/*Initialize components.*/
JoiningEvent event = parentView.get(groupPosition);
if(convertView == null)
convertView = LayoutInflater.from(activity).inflate(R.layout.my_joined_event_view,parent,false);
LinearLayout layout_note = (LinearLayout)convertView.findViewById(R.id.layout_note);
TextView txt_note = (TextView)convertView.findViewById(R.id.txt_note);
TextView txt_eventName = (TextView)convertView.findViewById(R.id.txt_eventName);
TextView txt_ownerName = (TextView)convertView.findViewById(R.id.txt_ownerName);
TextView txt_date = (TextView)convertView.findViewById(R.id.txt_date);
TextView txt_time = (TextView)convertView.findViewById(R.id.txt_time);
ImageView img_iconBig = (ImageView)convertView.findViewById(R.id.img_iconBig);
TextView txt_joined = (TextView)convertView.findViewById(R.id.txt_joined);
TextView txt_waiting = (TextView)convertView.findViewById(R.id.txt_waiting);
TextView txt_decline = (TextView)convertView.findViewById(R.id.txt_decline);
/*Initialize data.*/
if(event.getNote().equals(""))
layout_note.setVisibility(View.GONE);
else
txt_note.setText(event.getNote());
txt_joined.setText(event.getJoinedNumber()+"");
txt_waiting.setText(event.getWaitingNumber()+"");
txt_decline.setText(event.getDeclineNumber()+"");
txt_eventName.setText(event.getTopic());
txt_ownerName.setText(event.getEventOwner().getUsername());
txt_date.setText(event.getDateStr());
txt_time.setText(event.getTimeStr());
img_iconBig.setImageResource(Resources.icons.get(event.getIconID()));
return convertView;
}
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
invitedListCustomAdapter = new InvitedListCustomAdapter(activity,childView.get(groupPosition));
return invitedListCustomAdapter.getView(childPosition,convertView,parent);
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return false;
}
}
| [
"taweesoft@gmail.com"
] | taweesoft@gmail.com |
514f50c5d82129443311fe4259049e8c2fc3aa83 | f85ad02d2c6ae528d8f01969dade48d0af2d9d7c | /charon-tests/charon-netty/src/test/java/com/pancm/netty/reconnect/server/NettyServerHandler.java | d96d9eab95394de529fac4214056ca7a4af7ad06 | [
"Apache-2.0"
] | permissive | dream0708/charon | dd009964d751366b67a421d672a15b610ec8dc44 | 3fc14a6a68b647b7126ad180791a042535d31611 | refs/heads/master | 2023-03-31T11:42:11.546434 | 2021-04-06T16:45:42 | 2021-04-06T16:45:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,124 | java | package com.pancm.netty.reconnect.server;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;
/**
*
* Title: HelloServerHandler
* Description: 服务端业务逻辑
* Version:1.0.0
* @author pancm
* @date 2017年10月8日
*/
public class NettyServerHandler extends ChannelInboundHandlerAdapter {
/** 空闲次数 */
private int idle_count =1;
/** 发送次数 */
private int count = 1;
/**
* 超时处理
* 如果5秒没有接受客户端的心跳,就触发;
* 如果超过两次,则直接关闭;
*/
@Override
public void userEventTriggered(ChannelHandlerContext ctx, Object obj) throws Exception {
if (obj instanceof IdleStateEvent) {
IdleStateEvent event = (IdleStateEvent) obj;
if (IdleState.READER_IDLE.equals(event.state())) { //如果读通道处于空闲状态,说明没有接收到心跳命令
System.out.println("已经5秒没有接收到客户端的信息了");
if (idle_count > 1) {
System.out.println("关闭这个不活跃的channel");
ctx.channel().close();
}
idle_count++;
}
} else {
super.userEventTriggered(ctx, obj);
}
}
/**
* 业务逻辑处理
*/
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
System.out.println("第"+count+"次"+",服务端接受的消息:"+msg);
String message = (String) msg;
if ("hb_request".equals(message)) { //如果是心跳命令,则发送给客户端;否则什么都不做
ctx.write("服务端成功收到心跳信息");
ctx.flush();
}
count++;
}
/**
* 异常处理
*/
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
cause.printStackTrace();
ctx.close();
}
}
| [
"delverjw@gmail.com"
] | delverjw@gmail.com |
d58c4cac60730d3ac57ddee22921f84422ab16c3 | 7181c9ea0ff840016984ee5ac3ce91d3e93fbfb2 | /assignment-4/app/src/main/java/com/example/android/sqliteweather/data/SavedLocationName.java | 3d39b359f9b81ff3afa7515d9a42a0896768b1f9 | [] | no_license | bullocgr/mobile-app-dev | f0a8f4012574193deefabd5d85bb689207b83f46 | 7ef99ece41be5cb40b5fc36a0d002f872d693209 | refs/heads/master | 2023-02-18T15:42:05.595026 | 2021-01-24T23:54:49 | 2021-01-24T23:54:49 | 332,580,856 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package com.example.android.sqliteweather.data;
import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import java.io.Serializable;
@Entity(tableName = "locations")
public class SavedLocationName implements Serializable {
@PrimaryKey
@NonNull
public String location_name;
}
| [
"bullocgr@oregonstate.edu"
] | bullocgr@oregonstate.edu |
7b87dc9a21db9b0c5c141169247fe90bf6218f24 | acca1e9e6be8585ab6241b0fbdc2b5ac11e4db33 | /FinalProjectVar2/src/weatherAPI/domain/tasks/task5/SortingByTempAndHumidity.java | 5d9f8d08205eb31aad0a476b270f013eb3e27640 | [] | no_license | BigSerj/Java_HomeWorks | 276f5f968e2140748b821902b465e4c26615f37a | 35be6a07812897eaeb7813608d40a0f6bf762683 | refs/heads/master | 2021-06-19T19:49:40.197812 | 2017-07-26T10:25:23 | 2017-07-26T10:25:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,386 | java | package weatherAPI.domain.tasks.task5;
import weatherAPI.data.parse.parsed.Weather;
import weatherAPI.domain.tasks.sorting.SortingCore;
import weatherAPI.domain.tasks.superTask.SuperTask;
import java.util.ArrayList;
import static weatherAPI.data.constants.TagsConst.*;
import static weatherAPI.domain.checks.ScannerIn.scannerToString;
import static weatherAPI.presentation.constants.MessagesConst.*;
import static weatherAPI.presentation.menu.ControlCentreMenu.showCurrentMenu;
public class SortingByTempAndHumidity extends SuperTask{
// метод для сортировки по температуре
public ArrayList<Weather> setSomeScannerTask1Task5() {
System.out.println(showCurrentMenu(MENU_SORTING_BY_TEMP_AND_HUMIDITY_TAG));
int i=scannerToString();
System.out.println(showCurrentMenu(MENU_SORTING_BY_TEMP_AND_HUMIDITY_DIRECTION));
int ii=scannerToString();
Boolean isSortUp = ii == 1; // если ii==1 ->true
switch (i){
case 1: // сортировка по максТемп возрастание
return SortingCore.sortingMethod(TEMP_MAX_TAG,isSortUp);
case 2:
return SortingCore.sortingMethod(TEMP_MIN_TAG,isSortUp);
case 3:
return SortingCore.sortingMethod(HUMIDITY_TAG,isSortUp);
}
return null;
}
} | [
"sergeyconvent@gmail.com"
] | sergeyconvent@gmail.com |
401e0d0a08416a7db59e6385667e5c287d3eaab0 | f3fa656dec6b0eb19a284d7feb73afc9f3a38f28 | /Chp. 02 - Linked Lists/_2_5_Sum_Lists/Pair.java | d9cb50c3037683d18bbf157c9131f428ddb82462 | [] | no_license | venukolla/Cracking-the-Coding-Interview_solutions | c70dd69d5436bad6b4dddf6ef1839f893de55263 | 722e19cf0d857c3abe083cc1d7d5277d3ce73474 | refs/heads/master | 2020-06-01T20:41:43.304708 | 2019-06-04T05:45:59 | 2019-06-04T05:45:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 185 | java | package _2_5_Sum_Lists;
import common.Node;
class Pair {
Node node;
int carry;
Pair(Node node, int carry) {
this.node = node;
this.carry = carry;
}
}
| [
"9rodney@gmail.com"
] | 9rodney@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.