blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b8daf0bc6fe06af8c79ec603b1f5128cf4334334 | 7de0ab2b1880b9e29d581a5e9da433c05d23e02c | /src/School.java | b1cd97c1fd050f2a1772dc43e15887a090e05bd2 | [] | no_license | swierka/zadanie-java-7 | c5959154701443ac938c697e5f48791b48edc43a | ee35b67aed5e6b9a773017a1a530bd2ca27f1150 | refs/heads/master | 2021-07-12T09:07:24.938351 | 2017-10-11T20:34:16 | 2017-10-11T20:34:16 | 105,679,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 597 | java | public class School {
public static void main(String[] args) {
Student student1 = new Student("Jan","Kowalski",728883,1);
Student student2 = new Student("Tomek","Nowak",728884,1);
Teacher teacher1 = new Teacher("Marek", "Keram","Fizyka kwantowa",16.5);
Teacher teacher2 = new Teacher ("Jan", "Matłoka","Inżynieria finansowa", 19.7);
System.out.println("Studenci:");
student1.show();
student2.show();
System.out.println();
System.out.println("Wykładowcy:");
teacher1.show();
teacher2.show();
}
}
| [
"[email protected]"
] | |
b206a98a9044246a97687bff609b970d7b416e98 | ae3d166f619f80101dbf5c7e69597f6edd5aedb5 | /app/src/main/java/org/hacktivity/strangechemicals/Chords/Chords.java | 3c52e5d57b308ff57a20f5347cd85c50977dbb2c | [] | no_license | graffitiplum/StrangeChemicals | 737d6eec0f058499593dbbf5fffeaf377c6e460d | f1bbaf31389eeff6939d09ec64b9e6b8cf88c6e0 | refs/heads/master | 2021-01-12T13:48:30.541749 | 2016-09-30T14:52:05 | 2016-09-30T14:52:05 | 69,608,088 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,201 | java | package org.hacktivity.strangechemicals.Chords;
import org.hacktivity.strangechemicals.Chords.chords_B_Minor;
public class Chords {
//public static double[][] chords_B_Minor = org.hacktivity.strangechemicals.Chords.chords_B_Minor.chords_B_Minor;
// Hz constants.
public static double C0 = 32.0000000000000000000000000000000000000000000000000000;
public static double Cs0 = 33.9028190194974428095520124770700931549072265625000000;
public static double D0 = 35.9187855458999436564226925838738679885864257812500000;
public static double Ds0 = 38.0546276800870728607151249889284372329711914062500000;
public static double E0 = 40.3174735966359349959020619280636310577392578125000000;
public static double F0 = 42.7148753334411068749432160984724760055541992187500000;
public static double Fs0 = 45.2548339959390446551878994796425104141235351562500000;
public static double G0 = 47.9458264600538015542952052783221006393432617187500000;
public static double Gs0 = 50.7968336629823937755645602010190486907958984375000000;
public static double A0 = 53.8173705762377281303088238928467035293579101562500000;
public static double As0 = 57.0175179609817064374510664492845535278320312500000000;
public static double B0 = 60.4079560116283929005476238671690225601196289062500000;
public static double C1 = 64.0000000000000000000000000000000000000000000000000000;
public static double Cs1 = 67.8056380389948856191040249541401863098144531250000000;
public static double D1 = 71.8375710917998873128453851677477359771728515625000000;
public static double Ds1 = 76.1092553601741457214302499778568744659423828125000000;
public static double E1 = 80.6349471932718699918041238561272621154785156250000000;
public static double F1 = 85.4297506668822137498864321969449520111083984375000000;
public static double Fs1 = 90.5096679918780893103757989592850208282470703125000000;
public static double G1 = 95.8916529201076031085904105566442012786865234375000000;
public static double Gs1 = 101.5936673259647875511291204020380973815917968750000000;
public static double A1 = 107.6347411524754562606176477856934070587158203125000000;
public static double As1 = 114.0350359219634128749021328985691070556640625000000000;
public static double B1 = 120.8159120232567858010952477343380451202392578125000000;
public static double C2 = 128.0000000000000000000000000000000000000000000000000000;
public static double Cs2 = 135.6112760779897712382080499082803726196289062500000000;
public static double D2 = 143.6751421835997746256907703354954719543457031250000000;
public static double Ds2 = 152.2185107203482914428604999557137489318847656250000000;
public static double E2 = 161.2698943865437399836082477122545242309570312500000000;
public static double F2 = 170.8595013337644274997728643938899040222167968750000000;
public static double Fs2 = 181.0193359837561786207515979185700416564941406250000000;
public static double G2 = 191.7833058402152062171808211132884025573730468750000000;
public static double Gs2 = 203.1873346519295751022582408040761947631835937500000000;
public static double A2 = 215.2694823049509125212352955713868141174316406250000000;
public static double As2 = 228.0700718439268257498042657971382141113281250000000000;
public static double B2 = 241.6318240465135716021904954686760902404785156250000000;
public static double C3 = 256.0000000000000000000000000000000000000000000000000000;
public static double Cs3 = 271.2225521559797130066726822406053543090820312500000000;
public static double D3 = 287.3502843671993787211249582469463348388671875000000000;
public static double Ds3 = 304.4370214406965828857209999114274978637695312500000000;
public static double E3 = 322.5397887730876504974730778485536575317382812500000000;
public static double F3 = 341.7190026675286844692891463637351989746093750000000000;
public static double Fs3 = 362.0386719675123572415031958371400833129882812500000000;
public static double G3 = 383.5666116804306398080370854586362838745117187500000000;
public static double Gs3 = 406.3746693038589228308410383760929107666015625000000000;
public static double A3 = 430.5389646099018250424705911427736282348632812500000000;
public static double As3 = 456.1401436878539357167028356343507766723632812500000000;
public static double B3 = 483.2636480930268589872866868972778320312500000000000000;
public static double C4 = 512.0000000000000000000000000000000000000000000000000000;
public static double Cs4 = 542.4451043119594260133453644812107086181640625000000000;
public static double D4 = 574.7005687343987574422499164938926696777343750000000000;
public static double Ds4 = 608.8740428813931657714419998228549957275390625000000000;
public static double E4 = 645.0795775461753009949461556971073150634765625000000000;
public static double F4 = 683.4380053350573689385782927274703979492187500000000000;
public static double Fs4 = 724.0773439350247144830063916742801666259765625000000000;
public static double G4 = 767.1332233608612796160741709172725677490234375000000000;
public static double Gs4 = 812.7493386077178456616820767521858215332031250000000000;
public static double A4 = 861.0779292198036500849411822855472564697265625000000000;
public static double As4 = 912.2802873757078714334056712687015533447265625000000000;
public static double B4 = 966.5272961860537179745733737945556640625000000000000000;
public static double C5 = 1024.0000000000000000000000000000000000000000000000000000;
public static double Cs5 = 1084.8902086239188520266907289624214172363281250000000000;
public static double D5 = 1149.4011374687975148844998329877853393554687500000000000;
public static double Ds5 = 1217.7480857627863315428839996457099914550781250000000000;
public static double E5 = 1290.1591550923506019898923113942146301269531250000000000;
public static double F5 = 1366.8760106701147378771565854549407958984375000000000000;
public static double Fs5 = 1448.1546878700494289660127833485603332519531250000000000;
public static double G5 = 1534.2664467217225592321483418345451354980468750000000000;
public static double Gs5 = 1625.4986772154356913233641535043716430664062500000000000;
public static double A5 = 1722.1558584396073001698823645710945129394531250000000000;
public static double As5 = 1824.5605747514157428668113425374031066894531250000000000;
public static double B5 = 1933.0545923721074359491467475891113281250000000000000000;
public static double C6 = 2048.0000000000000000000000000000000000000000000000000000;
public static double Cs6 = 2169.7804172478377040533814579248428344726562500000000000;
public static double D6 = 2298.8022749375950297689996659755706787109375000000000000;
public static double Ds6 = 2435.4961715255726630857679992914199829101562500000000000;
public static double E6 = 2580.3183101847012039797846227884292602539062500000000000;
public static double F6 = 2733.7520213402294757543131709098815917968750000000000000;
public static double Fs6 = 2896.3093757400988579320255666971206665039062500000000000;
public static double G6 = 3068.5328934434451184642966836690902709960937500000000000;
public static double Gs6 = 3250.9973544308713826467283070087432861328125000000000000;
public static double A6 = 3444.3117168792146003397647291421890258789062500000000000;
public static double As6 = 3649.1211495028314857336226850748062133789062500000000000;
public static double B6 = 3866.1091847442148718982934951782226562500000000000000000;
public static double C7 = 4096.0000000000000000000000000000000000000000000000000000;
public static double Cs7 = 4339.5608344956754081067629158496856689453125000000000000;
public static double D7 = 4597.6045498751900595379993319511413574218750000000000000;
public static double Ds7 = 4870.9923430511453261715359985828399658203125000000000000;
public static double E7 = 5160.6366203694024079595692455768585205078125000000000000;
public static double F7 = 5467.5040426804589515086263418197631835937500000000000000;
public static double Fs7 = 5792.6187514801977158640511333942413330078125000000000000;
public static double G7 = 6137.0657868868902369285933673381805419921875000000000000;
public static double Gs7 = 6501.9947088617427652934566140174865722656250000000000000;
public static double A7 = 6888.6234337584292006795294582843780517578125000000000000;
public static double As7 = 7298.2422990056629714672453701496124267578125000000000000;
public static double B7 = 7732.2183694884297437965869903564453125000000000000000000;
public static double C8 = 8192.0000000000000000000000000000000000000000000000000000;
public static double Cs8 = 8679.1216689913508162135258316993713378906250000000000000;
public static double D8 = 9195.2090997503801190759986639022827148437500000000000000;
public static double Ds8 = 9741.9846861022906523430719971656799316406250000000000000;
public static double E8 = 10321.2732407388048159191384911537170410156250000000000000;
public static double F8 = 10935.0080853609179030172526836395263671875000000000000000;
public static double Fs8 = 11585.2375029603954317281022667884826660156250000000000000;
public static double G8 = 12274.1315737737804738571867346763610839843750000000000000;
public static double Gs8 = 13003.9894177234855305869132280349731445312500000000000000;
public static double A8 = 13777.2468675168584013590589165687561035156250000000000000;
public static double As8 = 14596.4845980113259429344907402992248535156250000000000000;
public static double B8 = 15464.4367389768594875931739807128906250000000000000000000;
public static double C9 = 16384.0000000000000000000000000000000000000000000000000000;
// libchords constants
public static int NUM_CHORDS_C_Major = 3441;
public static int NUM_CHORDS_Cs_Major = 3279;
public static int NUM_CHORDS_D_Major = 3126;
public static int NUM_CHORDS_Ds_Major = 3126;
public static int NUM_CHORDS_E_Major = 2973;
public static int NUM_CHORDS_F_Major = 2973;
public static int NUM_CHORDS_Fs_Major = 2820;
public static int NUM_CHORDS_G_Major = 2820;
public static int NUM_CHORDS_Gs_Major = 2684;
public static int NUM_CHORDS_A_Major = 2548;
public static int NUM_CHORDS_As_Major = 2548;
public static int NUM_CHORDS_B_Major = 2420;
public static int NUM_CHORDS_C_Minor = 3441;
public static int NUM_CHORDS_Cs_Minor = 3279;
public static int NUM_CHORDS_D_Minor = 3126;
public static int NUM_CHORDS_Ds_Minor = 3126;
public static int NUM_CHORDS_E_Minor = 3126;
public static int NUM_CHORDS_F_Minor = 2973;
public static int NUM_CHORDS_Fs_Minor = 2820;
public static int NUM_CHORDS_G_Minor = 2820;
public static int NUM_CHORDS_Gs_Minor = 2684;
public static int NUM_CHORDS_A_Minor = 2684;
public static int NUM_CHORDS_As_Minor = 2548;
public static int NUM_CHORDS_B_Minor = 2420;
public Chords() {
}
}
| [
"[email protected]"
] | |
ecf2d8ad5bf08feb357b2e4b8a70fdc767f3f16c | 49db04acf33880a15f200e3d190c24d727c62c14 | /NyatProje/src/AgArayuzu.java | 2f231e51ab3c54339619fb343ad34fea4704ae85 | [] | no_license | mertsigirci11/NYAT-PROJE | 5bd4544b032dc786137a3481d4ba3c82ce8dea61 | c38155dd24d2fa0f50b7c013999a61c4dc29c28e | refs/heads/main | 2023-05-03T00:39:21.472589 | 2021-05-17T20:17:28 | 2021-05-17T20:17:28 | 368,311,276 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 723 | java | import java.util.Scanner;
public class AgArayuzu implements IAgArayuzu
{
private IEkran ekran;
private IAgArayuzu agArayuzu;
private ISicaklikAlgilayici sicaklikAlgilayici;
@Override
public int intVeriAl()
{
Scanner scan = new Scanner(System.in);
return scan.nextInt();
}
@Override
public String stringVeriAl()
{
Scanner scan = new Scanner(System.in);
return scan.nextLine();
}
@Override
public void sicaklikGetir(int sicaklik)
{
ekran.mesajGoruntule(String.valueOf(sicaklik));
}
@Override
public int sogutucuyuAc(int sicaklik)
{
return sicaklik-10;
}
}
| [
"[email protected]"
] | |
404af19eb915c55b9ca82bb6c7acea410bb532c2 | e6f396eb1c6d5eb0f01a40e8e5f74f5fd6376864 | /entity-registry/src/main/java/com/linkedin/metadata/models/DefaultEntitySpec.java | fee25c11431a87e21d1be75489cc5e3a74486e28 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause",
"MIT"
] | permissive | Echelon77/datahub | b612363efb1f63cd759be1bfcc0ff973a169d9da | 5cc923a56894a72871d706de75f6b5e6ae93687d | refs/heads/master | 2023-08-25T02:29:58.627864 | 2021-10-13T07:02:51 | 2021-10-13T07:02:51 | 404,210,407 | 1 | 0 | Apache-2.0 | 2021-09-08T04:37:41 | 2021-09-08T04:27:29 | null | UTF-8 | Java | false | false | 2,833 | java | package com.linkedin.metadata.models;
import com.linkedin.data.schema.RecordDataSchema;
import com.linkedin.data.schema.TyperefDataSchema;
import com.linkedin.metadata.models.annotation.EntityAnnotation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import lombok.ToString;
@ToString
public class DefaultEntitySpec implements EntitySpec {
private final EntityAnnotation _entityAnnotation;
private final Map<String, AspectSpec> _aspectSpecs;
// Classpath & Pegasus-specific: Temporary.
private final RecordDataSchema _snapshotSchema;
private final TyperefDataSchema _aspectTyperefSchema;
public DefaultEntitySpec(
@Nonnull final Collection<AspectSpec> aspectSpecs,
@Nonnull final EntityAnnotation entityAnnotation,
@Nonnull final RecordDataSchema snapshotSchema,
@Nullable final TyperefDataSchema aspectTyperefSchema) {
_aspectSpecs = aspectSpecs.stream().collect(Collectors.toMap(AspectSpec::getName, Function.identity()));
_entityAnnotation = entityAnnotation;
_snapshotSchema = snapshotSchema;
_aspectTyperefSchema = aspectTyperefSchema;
}
public DefaultEntitySpec(
@Nonnull final List<AspectSpec> aspectSpecs,
@Nonnull final EntityAnnotation entityAnnotation,
@Nonnull final RecordDataSchema snapshotSchema) {
this(aspectSpecs, entityAnnotation, snapshotSchema, null);
}
@Override
public String getName() {
return _entityAnnotation.getName();
}
@Override
public EntityAnnotation getEntityAnnotation() {
return _entityAnnotation;
}
@Override
public String getKeyAspectName() {
return _entityAnnotation.getKeyAspect();
}
@Override
public AspectSpec getKeyAspectSpec() {
return _aspectSpecs.get(_entityAnnotation.getKeyAspect());
}
@Override
public List<AspectSpec> getAspectSpecs() {
return new ArrayList<>(_aspectSpecs.values());
}
@Override
public Map<String, AspectSpec> getAspectSpecMap() {
return _aspectSpecs;
}
@Override
public Boolean hasAspect(final String name) {
return _aspectSpecs.containsKey(name);
}
@Override
public AspectSpec getAspectSpec(final String name) {
return _aspectSpecs.get(name);
}
@Override
public RecordDataSchema getSnapshotSchema() {
return _snapshotSchema;
}
@Override
public TyperefDataSchema getAspectTyperefSchema() {
return _aspectTyperefSchema;
}
@Override
public List<SearchableFieldSpec> getSearchableFieldSpecs() {
return _aspectSpecs.values()
.stream()
.map(AspectSpec::getSearchableFieldSpecs)
.flatMap(List::stream)
.collect(Collectors.toList());
}
}
| [
"[email protected]"
] | |
4d73190a2a33cef7c690f931e4b0969e2e042dfe | 8f92d13ecf71bc600861aaa282be1606779617f4 | /bundleFirst/src/test/java/com/zoom/firstbundle/ExampleUnitTest.java | f658c5269dd8636b5664fef622c49a2d4597208e | [] | no_license | ProZoom/AtlasDemo | 68e2805de98443d49e8b805718f316d597a3d1f9 | bc1b45ad2dc8294b1947417aa990960475a986a2 | refs/heads/master | 2021-01-01T04:31:48.204160 | 2017-07-14T03:28:32 | 2017-07-14T03:28:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package com.zoom.firstbundle;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
8e31e3abc297ae74e3af57f403f8b77945f373b1 | a3b4164d20b7c4afa785bc91f425a1b3e177f722 | /POO/1-Intro/Exercicio5.java | cd4530efde2e84f6a358970e474dbd7792bbc0ae | [] | no_license | hschuelter/uni-general | 8481f5190446cf2214ad126eb819a0a0d849d27a | 3f3ee2a10396222c24b1a5668bf8d1cfcb0bd34e | refs/heads/master | 2021-06-27T10:14:16.605302 | 2020-10-15T17:44:41 | 2020-10-15T17:44:41 | 171,874,569 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 280 | java | import java.util.*;
public class Exercicio5{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int n;
n = input.nextInt();
if(n%2 == 0)
System.out.printf("O número é par\n");
else
System.out.printf("O número é ímpar\n");
}
} | [
"[email protected]"
] | |
9585b7ec9dfde9edcff24bd708c783b3c54e6293 | c434f10490f6546f9af5dd67b0c43e776168fed1 | /src/main/java/com/yezi/jylframe/data/entity/User.java | f44b75ed4573a6e27fc04c28c223207c4e57b398 | [] | no_license | yehounan/LuFrameDemo | 68f82c95d2df265fec1ca836ccec0395b6e7658d | d63a9185564c6a962998312ca9d3c3659770f97a | refs/heads/master | 2021-09-20T22:47:57.606966 | 2018-08-16T03:40:26 | 2018-08-16T03:40:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 943 | java | package com.yezi.jylframe.data.entity;
import java.util.Date;
/**
* created by yezi on 2018/8/6
*/
public class User {
private Long id;
private String userName;
private String password;
private int age;
private Date birthday;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
}
| [
"[email protected]"
] | |
013beda889a1ee2719cc1abc07dd5b21f5c9eb06 | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /Mate20-9.0/src/main/java/com/huawei/nb/ai/AiModelAttributes$$Lambda$70.java | 37f7ef3dfcabcb7b3b89b3cbc7e81a54affc9371 | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 527 | java | package com.huawei.nb.ai;
import com.huawei.nb.model.aimodel.AiModel;
import java.util.function.Consumer;
final /* synthetic */ class AiModelAttributes$$Lambda$70 implements Consumer {
private final AiModel arg$1;
private AiModelAttributes$$Lambda$70(AiModel aiModel) {
this.arg$1 = aiModel;
}
static Consumer get$Lambda(AiModel aiModel) {
return new AiModelAttributes$$Lambda$70(aiModel);
}
public void accept(Object obj) {
this.arg$1.setCreate_user((String) obj);
}
}
| [
"[email protected]"
] | |
43adc3f6b1fd505d3a858a5d216814073af380fc | 3d510752ef6f1e55f75be92bbd174596bb0a919b | /fun/src/main/java/meh/fun/Problems_41_50/problem43.java | 8add35c1763b7183165319abc686ada579513c67 | [] | no_license | Pigalito/ProjectEulerRename | a3c80f97cc075b911222e7cd099a09224fe04f9e | 5990bbea18a5bed189a6bd744d5b9de1374d3163 | refs/heads/master | 2021-09-15T23:57:09.729536 | 2018-06-13T09:19:17 | 2018-06-13T09:19:17 | 62,316,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,340 | 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 meh.fun.Problems_41_50;
/**
*
* @author n439081
*/
public class problem43 {
/**
* The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.
Let d1 be the 1st digit, d2 be the 2nd digit, and so on. In this way, we note the following:
d2d3d4=406 is divisible by 2
d3d4d5=063 is divisible by 3
d4d5d6=635 is divisible by 5
d5d6d7=357 is divisible by 7
d6d7d8=572 is divisible by 11
d7d8d9=728 is divisible by 13
d8d9d10=289 is divisible by 17
Find the sum of all 0 to 9 pandigital numbers with this property.
*/
static int[] primes = {2,3,5,7,11,13,17};
static long i;
public static void main(String[] args) {
// has10DistinctNonZeroDigits(2394506810L);
long result = 0;
long timeStarted = System.currentTimeMillis();
for(i = 1023456789L; i<=9876543210L; i++){
if(i%100000000==0){
System.out.println(i);
System.out.println((System.currentTimeMillis() - timeStarted)/1000.0 + " seconds");
}
if(has10DistinctNonZeroDigits(i)){
if(System.currentTimeMillis() - timeStarted > 5000){
timeStarted = System.currentTimeMillis();
System.out.println("After another 5 seconds we're on: " + i);
}
// System.out.println(i);
boolean isSubStringDivisible = true;
for(int index = 0; index<primes.length; index++){
if(!is3DigitSubIntDivisibleByPrime(i,index)){
isSubStringDivisible = false;
break;
}
}
if(isSubStringDivisible){
System.out.println("Divisible sub string pandigital: " + i);
result += i;
}
}
}
System.out.println(result);
System.out.println(is3DigitSubIntDivisibleByPrime(1406357289,0));
}
public static boolean is3DigitSubIntDivisibleByPrime(long num, int index){
int subInt = (int) Long.parseLong(Long.toString(num).substring(index+1,index+4));
return subInt%primes[index] == 0;
}
private static boolean has10DistinctNonZeroDigits(long number){
long numMask = 0;
long numLength = Long.toString(number).length();
if(numLength != 10) return false;
long rightmostDuplicateIndex = -1;
boolean resultFlag = true;
for(long numIndex = numLength - 1; numIndex >= 0; numIndex--){
long curDigit = (long) (number/Math.pow(10,numIndex))%10;
long digitMask = (long) Math.pow(2,curDigit);
if((numMask & digitMask) > 0){
rightmostDuplicateIndex = numIndex;
resultFlag = false;
}
numMask = numMask | digitMask;
}
if(rightmostDuplicateIndex != -1)i += Math.pow(10,rightmostDuplicateIndex) - 1;
String binNum = Long.toBinaryString(numMask);
return resultFlag && binNum.equals("1111111111");
}
private static int digitAt(long num, int index){
return Integer.parseInt(Long.toString(num).substring(index, index+1));
}
}
| [
"[email protected]"
] | |
9c428dab0e7f5c40663c55345fb966a78aa302a1 | 5641b5ca471854b3d8670c650833043f75bce937 | /Algorithmen und Datenstrukturen/HA. 2/src/commands/list/actions/GetAction.java | 8211430211a0f6bfe009a0feeedc1c59a0cc05e2 | [] | no_license | Ktechen/Htw-Programmierung | 3c93477fee39ebee4adc99a69590e9ed05ded529 | e3b1ed954b4acb1f5f4c29307a38e9ea5d793ec2 | refs/heads/master | 2022-07-24T21:13:42.007622 | 2022-06-29T22:01:42 | 2022-06-29T22:01:42 | 253,598,206 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 838 | java | package commands.list.actions;
import cli.Console;
import commands.CommandFactory;
import commands.CommandOption;
import commands.ICommand;
import commands.list.DoublyLinkedListAction;
import commands.list.SinglyLinkedListAction;
import data.Student;
import list.Listable;
public class GetAction implements ICommand {
@Override
public void execute() {
Console console = new Console();
int index = console.readIntegerFromStdin("Please enter Index ", "Input is not valid");
Listable<Student> list = null;
if(CommandOption.isWhichList()) {
list = DoublyLinkedListAction.list;
}else {
list = SinglyLinkedListAction.list;
}
list.get(index);
}
@Override
public String toString() {
return "Returns the Student at the specified position in this list. (Tested? [x])";
}
}
| [
"[email protected]"
] | |
0580c44fde74b96c4d646639d09dd9dab7ec61f9 | 1c6c25c643231d4da9f88608c9b7c15631e1b345 | /service/kyg/src/com/it/service/VersionsService.java | f6b01777a8c3c79eb5be83cb3181c349f285a598 | [] | no_license | swd1119/kygWeb | 73fc769f7542f564ed97231093c34bd42d446239 | a9b64fb535ccade50bc2aecd1bafc961078947cd | refs/heads/master | 2021-03-11T03:37:21.387993 | 2018-06-10T06:46:25 | 2018-06-10T06:46:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 877 | java | package com.it.service;
import com.it.configs.ConfigValues;
import com.it.dao.VersionsManager;
/***
* 版本服务类
* @author Alex
*
*/
public class VersionsService {
public VersionsService() {
// TODO Auto-generated constructor stub
}
/******************单例模式**********************/
private static VersionsService versionsService=new VersionsService();
public static VersionsService getVersionsService() {
return versionsService;
}
/******************单例模式**********************/
/***
* 检查版本
* 版本旧的 则返回新版本APK下载地址
* @param versionid
* @return
*/
public String CheckVersion(int versionid){
int new_verid=VersionsManager.getVersionsManager().getVersions();
if(versionid<new_verid){
return ConfigValues.APK_URL;
}else{
return "";
}
}
}
| [
"[email protected]"
] | |
aa6629af028ea88bc435eb990450175a4144170f | 77f01a157eb3ae9bbbc587147580b19cfb5eef25 | /project_DT_20/src/project_DT_20/Discount.java | 16006490cf31a7b40dbc0f6f4d99f9879d04aea9 | [] | no_license | basheera-sulthana/Basics-Dt-5-20-2019- | 52564e7a6f756691dac0dc9fb25c8e1cf0bd18e4 | aff8205658f7d7bc8fa61838d9c5ca9fb3b40778 | refs/heads/master | 2020-06-03T18:57:24.409471 | 2019-06-13T04:36:23 | 2019-06-13T04:36:23 | 189,004,145 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 475 | java | package project_DT_20;
public class Discount
{
public static void main(String args[])
{
double discount,amount,markedprice,s;
markedprice=1000;
discount=25;
System.out.println("markedprice= "+markedprice);
System.out.println("discount rate="+discount);
s=100-discount;
amount= (s*markedprice)/100;
System.out.println("amount after discount="+amount);
}
}
| [
"Admin@Admin-PC"
] | Admin@Admin-PC |
ba24360272472e68ca3868cb0fe7d54a71451814 | 12aeb7d9582d1b34497b6ec18311c53953739f87 | /Character_Count.java | f5ad1daea9ba09bc4edcf25c5edbe644a7b07742 | [] | no_license | suraj2498/Letter-Probability- | e2b64ede19fcc7c41c600839b848f6884a5c22dc | 37fde98db7dd7fa63e5071cd6780c9c941359f98 | refs/heads/master | 2020-12-07T03:08:32.086386 | 2020-01-08T17:28:52 | 2020-01-08T17:28:52 | 232,618,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,127 | java | import java.io.*;
import java.util.*;
public class Character_Count {
private TreeMap<Character,Double> wordMap = new TreeMap<>();
private String pathName;
// TAKES A PATHNAME WHEN INSTANTIATED
public Character_Count(String pathName) {
this.pathName = pathName;
}
// READS THE FILE LINE BY LINE THEN READS EACH LINE CHAR BY CHAR AND IF CHARACTER IS A LETTER THEN
// CAPITALIZE THE CHARACTER AND ADD IT TO THE TREE MAP
public void characterCount() throws IOException {
//READ FILE
File file = new File(pathName);
Scanner scanner = new Scanner(file);
// ADD LETTER TO THE TREE MAP IF ITS THE FIRST OCCURRENCE OR INCREASE THE COUNT OF THE LETTER BY ONE IF ITS A
// LETTER THAT WAS ALREADY IN THE MAP
while (scanner.hasNextLine()) {
String currentLine = scanner.nextLine();
for(int i = 0; i < currentLine.length(); i++){
char character = currentLine.charAt(i);
if ((character >= 'A' && character <= 'Z') || (character >= 'a' && character <= 'z')) {
character = Character.toUpperCase(character);
if (wordMap.containsKey(character)) {
double count = wordMap.get(character) + 1;
wordMap.put(character, count);
} else {
wordMap.put(character, 1.0);
}
}
}
}
scanner.close();
// TREE MAP IS FILLED WITH ALL THE CHARACTERS THAT OCCUR AND HOW MANY TIMES THEY OCCUR
}
// PROVIDES A TOTAL COUNT OF ALL LETTERS BY ADDING VALUES IN THE TREE MAP
public double totalCount(){
double total = 0;
for (char ch = 'A'; ch <= 'Z'; ch++){
if (wordMap.containsKey(ch))
total += wordMap.get(ch);
}
return total;
}
// EXTRACTS THE VALUES FROM THE TREE MAP INTO AN ARRAY LIST THEN ORGANIZES THE LIST IN DESCENDING ORDER
public List<Double> valueSortedList(){
List<Double> list = new ArrayList<>(wordMap.values());
Collections.sort(list);
Collections.reverse(list);
return list;
}
// CYCLES THROUGH BOTH THE WORD MAP AND THE VALUE SORTED LIST AND LOOKS FOR THE CHARACTER KEY IN THE WORD MAP THAT
// HAS A CORRESPONDING VALUE IN THE LISTS 1ST POSITION, THEN 2ND AND SO ON, WHEN IT FINDS A CORRESPONDING CHAR IT
// ADDS IT TO A LIST OR CHARACTERS.
public List<Character> organizeChars(){
List<Character> charList = new ArrayList<>();
List<Double> list = valueSortedList();
for(int i = 0; i < wordMap.size(); i++){
for(char ch = 'A'; ch <= 'Z'; ch++){
if (wordMap.containsKey(ch)){
if (wordMap.get(ch).equals(list.get(i))) {
charList.add(ch);
}
}
}
}
return charList;
// AT THIS POINT WE HAVE TWO PARALLEL LISTS OF THE MOST OCCURRING CHARACTER AND THE NUMBER OF TIMES IT HAS
// OCCURRED
}
} | [
"[email protected]"
] | |
a5dc9554bca08764d4db52afaf536d50617d23c6 | 46e6a84689149620a93c42d741ffe42ec966127e | /exercicios/ascencio/cap08/java/EX3.java | eafaf855dbfe9cf16c21957884ea1e29c3f4f249 | [] | no_license | gilsonpcf/algoritmos | 0d59da8a909a98ea9d376ebfe20d40a64b4a42e2 | 8f6548fd4066c16c4cd13d2ac7f551948eb72b3b | refs/heads/master | 2023-08-21T13:13:35.596153 | 2023-08-04T20:00:23 | 2023-08-04T20:00:23 | 178,281,309 | 27 | 14 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | import java.util.Scanner;
public class EX3
{
public static void main(String args[])
{ Scanner entrada = new Scanner(System.in);
int a, b, c, result;
do
{ System.out.print("Digite o valor de a: ");
a = entrada.nextInt();
} while (a<=1);
System.out.print("Digite o valor de b: ");
b = entrada.nextInt();
System.out.print("Digite o valor de c: ");
c = entrada.nextInt();
result = divisores(a, b, c);
System.out.println("\nSoma dos inteiros = " + result);
}
public static int divisores(int a, int b, int c)
{ int i, s, r;
s = 0;
for (i=b;i<=c;i++)
{ r = (i % a);
if (r == 0)
s = s + i;
}
return s;
}
}
| [
"[email protected]"
] | |
2fbd2fc2e4ff4c07a5e49d64fb3dfbad21835f9d | 4665dade1a419fc140a2558cedc8ebb476c25db7 | /YuGuan/src/com/yuguan/mycomponents/SysmsgInfo.java | 1ec1820c6e0ce85038aa5bbc847917b686b470e6 | [] | no_license | chenxk/myapps | c3d0a29cd66e31b8390dd1cf08b87498c39ff97a | ebbb132c9a68a7c790d42741c6275079e770393f | refs/heads/master | 2016-09-01T20:09:19.654252 | 2014-07-15T08:56:28 | 2014-07-15T08:56:28 | 20,961,741 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 898 | java | package com.yuguan.mycomponents;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;
import cn.buaa.myweixin.R;
public class SysmsgInfo extends LinearLayout {
private TextView sysmsg;
private TextView sysSendTime;
public SysmsgInfo(Context context) {
super(context);
initView(context);
}
public SysmsgInfo(Context context, AttributeSet attrs) {
super(context, attrs);
initView(context);
}
private void initView(Context context) {
LayoutInflater.from(context).inflate(R.layout.sysmsginfo, this, true);
sysmsg = (TextView) findViewById(R.id.sysmsg);
sysSendTime = (TextView) findViewById(R.id.sysSendTime);
}
public void initValue(String msg, String time) {
sysmsg.setText(msg);
sysSendTime.setText(time);
}
}
| [
"[email protected]"
] | |
e7dee66e60a5bfaa0d075e52ac781ac9c24f6e5b | 3014556de22fcec3e285f38439dddd7fdac3fde9 | /Navigate.java | 8a6fb8d7ca71bfaa52886a2c5ebafb36c56aec9f | [] | no_license | rjmkhrj/RESTAPI-Robot-Based-Grid-Navigation- | 8d410d51035926e7bb3021b69fdba4cb95a6afd3 | 016b2b1bde893ac39ffa3d5166222b21ed20d57e | refs/heads/master | 2020-04-04T18:06:07.612833 | 2018-11-05T02:39:51 | 2018-11-05T02:39:51 | 156,149,828 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,893 | java | import java.util.Random;
import java.util.Scanner;
public class Navigate {
public static long startTime = System.currentTimeMillis();
public static int count=0;
public static void main(String[] args) {
System.out.println("Enter the dimension of the room;");
int nx;
Scanner s=new Scanner(System.in);
nx=s.nextInt();
if(nx<0)
System.exit(0);
int a[][]= new int[nx][nx];
System.out.println("Enter the starting position of scanning");
Scanner p=new Scanner(System.in);
int st1=p.nextInt();
Scanner q=new Scanner(System.in);
int st2=q.nextInt();
int ran=RandInt(st1, st2);
System.out.println("The number generated is " + ran);
int obs[][]= RandInt2( ran);
Calculate(obs, a, nx, st1, st2);
long sndTime= System.currentTimeMillis();
System.out.println("Execution time" + (sndTime-startTime));
}
private static int RandInt(int st1, int st2) {
Random rand = new Random();
int randomnum= rand.nextInt(st2-st1+10);
return randomnum;
}
private static int[][] RandInt2(int r1)
{
System.out.println("Enter the coordinates where the obstacles are present");
int st[][]= new int[r1][2];
for(int i=0; i<r1; i++)
{
for(int j=0; j<2; j++)
{
Scanner sc= new Scanner(System.in);
st[i][j]= sc.nextInt();
}
}
return st;
}
public static void Calculate(int xr[][], int original[][], int n1, int p1, int p2)
{
int i=0, j=0;
do{
if (p1==xr[i][j] && p2==xr[i][j+1])
{
count++;
}
i++;
p1++;
p2++;
}while(i==n1);
System.out.println("The number of obstacles in the room is" + " " + count + " " );
}
}
| [
"[email protected]"
] | |
e0e36de452599a72a5c392ac5d583e22ad1691d9 | ec258bb9d40a12bea24cefc206e9f0768e19a518 | /microbroker/src/main/java/org/eclipse/moquette/proto/messages/PubAckMessage.java | 7a9eb53e9c60ac867d5f2e80899caea1b7af052a | [] | no_license | lukazalves/cddl | cf0794ecda028281cd5d8dbc39ed67393720a77f | 671673ff584c2472a04d0e5822830e9df71a3b72 | refs/heads/master | 2023-06-15T02:45:16.483446 | 2021-07-06T22:39:37 | 2021-07-06T22:39:37 | 264,774,026 | 0 | 0 | null | 2020-11-19T20:15:09 | 2020-05-17T23:11:06 | Java | UTF-8 | Java | false | false | 848 | java | /*
* Copyright (c) 2012-2014 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* You may elect to redistribute this code under either of these licenses.
*/
package org.eclipse.moquette.proto.messages;
/**
* Placeholder for PUBACK message.
*
* @author andrea
*/
public class PubAckMessage extends MessageIDMessage {
public PubAckMessage() {
m_messageType = AbstractMessage.PUBACK;
}
}
| [
"="
] | = |
b66db5c1c0d3f6c26cdd465c206ce5721606a5ea | e3bd6db5a7827a1439eb351689f3f81f971a507d | /app/src/main/java/com/google/testairplaneencyclopedia/Tupolev142Activity.java | f3cd9fa5730108feef6ddc906f4beb724628337d | [] | no_license | faramarzaf/AirplaneEncyclopedia | 36b8e8a7d5ba826a14e3f5378d7f8fc652c5d90e | 3ad22f291777a06e765cd77ea626591338338340 | refs/heads/master | 2020-04-20T11:14:39.828212 | 2020-03-16T11:10:21 | 2020-03-16T11:10:21 | 168,810,573 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,463 | java | package com.google.testairplaneencyclopedia;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
public class Tupolev142Activity extends AppCompatActivity implements View.OnClickListener {
ImageView tu142_1;
ImageView tu142_2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tupolev142);
if (getSupportActionBar()!= null){
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
tu142_1 = (ImageView) findViewById(R.id.tu142_1);
tu142_2 = (ImageView) findViewById(R.id.tu142_2);
tu142_1.setOnClickListener(this);
tu142_2.setOnClickListener(this);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home)
finish();
return super.onOptionsItemSelected(item);
}
@Override
public void onClick(View view) {
if (view.getId() == tu142_1.getId()) {
fade();
} else if (view.getId() == tu142_2.getId()) {
fade();
}
}
private void fade() {
tu142_1.animate().alpha(1f - tu142_1.getAlpha()).setDuration(5);
tu142_2.animate().alpha(1f - tu142_2.getAlpha()).setDuration(5);
}
}
| [
"[email protected]"
] | |
8e1036a35a6ef34064d364def2553a9f9d6cd8ae | 6e79823944ab0151cb5bd73122f3dc87e9bd10b2 | /app/src/test/java/com/example/jinphy/stroke_view/ExampleUnitTest.java | 4970a86186d035f3d5e8f0e90d650d54bc317022 | [] | no_license | Jinphy/stroke-view | 40dd814dbbbf9cbf2cbc1379df455363cd8678eb | e3c502816db9919b52b5c47019d70c12c80c0e14 | refs/heads/master | 2020-03-28T07:21:23.734470 | 2018-09-08T09:50:46 | 2018-09-08T09:50:46 | 147,895,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 391 | java | package com.example.jinphy.stroke_view;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
e4be4ae99fb97dff77cdc948cfa06289a5704852 | 11dd9755165557a6016caef5b74ef90a2290d7cb | /src/main/java/com/rrong777/web/config/SmsCodeAuthenticationSecurityConfig.java | 7154285678dc2c1f2612f44908d77767f181e1b8 | [] | no_license | rrong777/demo-security | dad6e459cfea2f0acf6d3798fda157a0a4149482 | bca480e8ce2adb6d56c19909efa60486b1a34e51 | refs/heads/main | 2023-04-22T15:51:48.941677 | 2021-05-07T09:58:51 | 2021-05-07T09:58:51 | 333,373,972 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,084 | java | package com.rrong777.web.config;
import com.rrong777.web.security.authentication.mobile.SmsCodeAuthenticationFilter;
import com.rrong777.web.security.authentication.mobile.SmsCodeAuthenticationProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.SecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationManager;
import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter;
import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.web.DefaultSecurityFilterChain;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.stereotype.Component;
@Component
public class SmsCodeAuthenticationSecurityConfig extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> {
@Autowired
private AuthenticationSuccessHandler rrongAuthenticationSuccessHandler;
@Autowired
private AuthenticationFailureHandler rrongAuthenticationFailureHandler;
@Autowired
private UserDetailsService userDetailsService;
@Autowired
private TokenStore tokenStore;
@Override
public void configure(HttpSecurity http) throws Exception {
SmsCodeAuthenticationFilter smsCodeAuthenticationFilter = new SmsCodeAuthenticationFilter();
smsCodeAuthenticationFilter.setAuthenticationManager(http.getSharedObject(AuthenticationManager.class));
smsCodeAuthenticationFilter.setAuthenticationSuccessHandler(rrongAuthenticationSuccessHandler);
smsCodeAuthenticationFilter.setAuthenticationFailureHandler(rrongAuthenticationFailureHandler);
SmsCodeAuthenticationProvider smsCodeAuthenticationProvider = new SmsCodeAuthenticationProvider();
smsCodeAuthenticationProvider.setUserDetailsService(userDetailsService);
OAuth2AuthenticationProcessingFilter f = new OAuth2AuthenticationProcessingFilter();
OAuth2AuthenticationManager o = new OAuth2AuthenticationManager();
DefaultTokenServices defaultTokenServices = new DefaultTokenServices();
defaultTokenServices.setTokenStore(tokenStore);
o.setTokenServices(defaultTokenServices);
f.setAuthenticationManager(o);
http.addFilterBefore(f, UsernamePasswordAuthenticationFilter.class);
http.authenticationProvider(smsCodeAuthenticationProvider)
.addFilterAfter(smsCodeAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
}
}
| [
"[email protected]"
] | |
37089aa882b3231ea672e9ce01338f404c0732ff | cb6c022f9f5f55633ff778313550de13de4ca801 | /src/main/java/com/artineer/spring_lecture_week_2/vo/ApiCode.java | 43486e39caa7f6f789c5ed855c553d01e949be53 | [] | no_license | kidongYun/spring_lecture_week2 | cec159333d6ef51c75fa241567d328c725dce7c8 | 5e37b8c98af15583088c9d7fc61c6f17f2d0f6b3 | refs/heads/master | 2023-08-20T12:19:50.928940 | 2021-10-01T01:35:42 | 2021-10-01T01:35:42 | 409,771,583 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | package com.artineer.spring_lecture_week_2.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
@Getter
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum ApiCode {
/* COMMON */
SUCCESS("CM0000", "정상입니다")
;
private final String name;
private final String desc;
ApiCode(String name, String desc) {
this.name = name;
this.desc = desc;
}
}
| [
"[email protected]"
] | |
a2c395183c89747442b96d64b1b3e5398a4ec167 | a01b17f2ebdf76cbac0d38b2b4db2fc30c7a8079 | /Lecture_9_Lambda_Java8_Addition/src/test/java/com/data/lambda/part1/exercise/Lambdas03Exercise.java | 3c526192be4ac2e03fd4982e6d059af6dbc4e77a | [] | no_license | rusergei2010/GITLAB_v2 | f11a4ec7f2279f3312b2bf3fc623c16164e563c0 | 063091e774a2ca95cbabfc9410506c741e7c24b5 | refs/heads/master | 2023-01-19T06:28:08.419272 | 2023-01-08T13:28:50 | 2023-01-08T13:28:50 | 156,403,552 | 1 | 88 | null | 2023-03-10T09:41:53 | 2018-11-06T15:20:10 | Java | UTF-8 | Java | false | false | 1,283 | java | package com.data.lambda.part1.exercise;
import org.junit.Test;
import java.util.StringJoiner;
import static org.junit.Assert.assertEquals;
public class Lambdas03Exercise {
private interface GenericProduct<T> {
T prod(T a, int i);
default T twice(T t) {
return prod(t, 2);
}
}
@Test
public void generic0() {
final GenericProduct<Integer> prod = null; // TODO: Use anonymous class
assertEquals(prod.prod(3, 2), Integer.valueOf(6));
}
@Test
public void generic1() {
final GenericProduct<Integer> prod = null; // TODO: Use statement lambda
assertEquals(prod.prod(3, 2), Integer.valueOf(6));
}
@Test
public void generic2() {
final GenericProduct<Integer> prod = null; // TODO: Use expression lambda
assertEquals(prod.prod(3, 2), Integer.valueOf(6));
}
private static String stringProd(String s, int i) {
final StringBuilder sb = new StringBuilder();
for (int j = 0; j < i; j++) {
sb.append(s);
}
return sb.toString();
}
@Test
public void strSum() {
final GenericProduct<String> prod = null; // TODO: use convertion to str
assertEquals(prod.prod("a", 2), "aa");
}
}
| [
"[email protected]"
] | |
54e1b7d6cdfca0f04455db6e0f36cf6c0784b47f | e2b249e5b17c98bd1105cd58fa4c2e90386fccc6 | /src/main/java/com/service/GreetingService.java | 54bedb6e008969568ac83cb7ee79c7717912a711 | [] | no_license | lining79355504/springBoot-demo | 8145d38706e67bcf679d213fe3c84dedf86775e5 | fe25d564af34a8d19d28f6b003dad44d24cfdb38 | refs/heads/master | 2023-05-24T16:01:38.685940 | 2023-05-17T13:08:58 | 2023-05-17T13:08:58 | 196,551,169 | 0 | 0 | null | 2022-10-04T23:29:45 | 2019-07-12T09:32:40 | Java | UTF-8 | Java | false | false | 499 | java | package com.service;
import com.demo.dao.MobileTagValueMapper;
import com.demo.entity.MobileTagValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Author: lining17
* Date : 2019-07-10
*/
@Component
public class GreetingService {
@Autowired
private MobileTagValueMapper mobileTagValueMapper;
public MobileTagValue getById(Integer id) {
return mobileTagValueMapper.selectByPrimaryKey(id);
}
}
| [
"[email protected]"
] | |
9d49c91bee81b09db2bfff50d42deff6e0bd44a7 | 9500e5d6cfcd997db75a01720792a74d4c1e6b05 | /third-party-api-pay-chinaums-sdk/src/test/java/cn/shishuihao/thirdparty/api/pay/chinaums/sdk/request/ChinaumsV1NetPaySecureCancelRequestTest.java | 9326ced4be61ea4db753bed4e039da5df391c7a3 | [
"Apache-2.0"
] | permissive | BOTgogogo/third-party-api | 07ba7ce7817ca93bd12cdf433ccbe310d80bd25a | a1a89e08afd021ee8fb4c9d3ce1e263b88d8a420 | refs/heads/main | 2023-04-26T12:27:35.286850 | 2021-05-09T21:36:51 | 2021-05-09T21:36:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,621 | java | package cn.shishuihao.thirdparty.api.pay.chinaums.sdk.request;
import cn.shishuihao.thirdparty.api.commons.json.JacksonUtils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.HashMap;
/**
* @author shishuihao
* @version 1.0.0
*/
class ChinaumsV1NetPaySecureCancelRequestTest {
final String json = "{\n" +
" \"requestTimestamp\": \"2016-09-22 16:01:42\",\n" +
" \"msgId\": \"07S30609000023115850160142\",\n" +
" \"mid\": \"898340149000005\",\n" +
" \"tid\": \"12340042\",\n" +
" \"instMid\": \"YUEDANDEFAULT\",\n" +
" \"merOrderId\": \"20160922145952000023114819\"\n" +
"}";
@Test
void toJson() {
ChinaumsV1NetPaySecureCancelRequest request = ChinaumsV1NetPaySecureCancelRequest.builder()
.requestTimestamp("2016-09-22 16:01:42")
.msgId("07S30609000023115850160142")
.mid("898340149000005")
.tid("12340042")
.instMid("YUEDANDEFAULT")
.merOrderId("20160922145952000023114819")
.build();
Assertions.assertEquals(
JacksonUtils.fromJson(json, HashMap.class),
JacksonUtils.fromJson(JacksonUtils.toJson(request), HashMap.class)
);
Assertions.assertEquals(
JacksonUtils.fromJson(json, HashMap.class),
JacksonUtils.fromJson(JacksonUtils.toJson(JacksonUtils.fromJson(json,
ChinaumsV1NetPaySecureCancelRequest.class)), HashMap.class)
);
}
} | [
"[email protected]"
] | |
6d909add156e6479af1fa64b8c35109bec2effc1 | 03b3fc4a1bf91201c83c9326bbb69fb2feac774d | /src/dao/ShoppingCartDao.java | 9e5e616f07ce34d500f2fd29eb5c06221082b5a4 | [] | no_license | helloeverbody/shopping-around- | e61eea23c8d36d2c1895e36259cd34390ac91bfb | 0d2f0bd891fb9a506333682b7c5a64ff4072dcaa | refs/heads/master | 2020-04-23T05:48:25.064127 | 2019-02-17T01:54:53 | 2019-02-17T01:54:53 | 170,951,945 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 525 | java | package dao;
import java.util.List;
import pojo.ShoppingCart;
public interface ShoppingCartDao {
public List<ShoppingCart> productSelect(ShoppingCart shoppingCart);// 查询
public int productInsert(ShoppingCart shoppingCart); // 添加成功返回id,否则返回-1
public boolean shoppingCartDelete(ShoppingCart shoppingCart);// 删除
public boolean shoppingCartDeleteByCondition(ShoppingCart shoppingCart);// 删除通过condition
public boolean shoppingCartUpdate(ShoppingCart shoppingCart);// 修改
}
| [
"[email protected]"
] | |
68cf41832cec1f25b8f1069d7fe011f25d07af49 | 011965166bcc86b7e0d96659d5677aeaf0bde6a4 | /app/src/main/java/com/aolimpio/models/beans/CatBreedImages.java | 83c871d5032c6462998b37af9cc5edf3426433a1 | [] | no_license | AsafeOlimpio/CatBreedProject | 1ece09a0f49e916d974d9ba26cc4e4131e1495d0 | 772d4e52d8d8ab78a2febaaf130ca472edf48ced | refs/heads/master | 2020-05-21T09:02:17.144908 | 2019-05-10T12:59:48 | 2019-05-10T12:59:48 | 185,988,328 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package com.aolimpio.models.beans;
import com.google.gson.annotations.SerializedName;
public class CatBreedImages {
private String status;
@SerializedName("message")
private String [] images;
public String getStatus() { return status; }
public void setStatus(String status) { this.status = status; }
public String[] getImages() { return images; }
public void setImages(String[] images) { this.images = images; }
} | [
"asafesmc@gmailcom"
] | asafesmc@gmailcom |
84571ef53534a98d83deb6eea725e500d1b2b6e2 | 5e0519e6c1bd5c3b380ca5524994744b6a6fb937 | /src/main/java/org/redlich/factory/CarFactory.java | 254119419c4b7638ad2af7313af285e39f66fdf1 | [] | no_license | mpredli01/factory | 8ac1be702a6773bbc6dee314f7d4165ec8de5e33 | ea2f22fbc1cf54ba79ca874900745664e8cec371 | refs/heads/master | 2023-04-18T00:42:53.170623 | 2021-05-04T12:27:58 | 2021-05-04T12:27:58 | 364,246,527 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 631 | java | /*
* CarFactory.java
*
* "Manufacturing Java Objects with the Factory Method Design Pattern"
* Published August 14, 2006
* Java Boutique
* http://javaboutique.internet.com/tutorials/factory/
*
* Barry A. Burd and Michael P. Redlich
*/
package org.redlich.factory;
public abstract class CarFactory {
abstract Car createCar(String model);
public Car orderCar(String make,String model) {
Car car = createCar(model);
System.out.println("--- Fulfilling the order for a " + car.getMake() + " " + car.getModel() + " ---");
car.buildCar();
car.testCar();
car.shipCar();
System.out.println();
return car;
}
}
| [
"[email protected]"
] | |
a10c3ac49e0fa2b86c2d4e49b97a224da561cffd | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project137/src/main/java/org/gradle/test/performance/largejavamultiproject/project137/p686/Production13720.java | 07a72a312d355332ec324000dbe0f57c7164dc3a | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,241 | java | package org.gradle.test.performance.largejavamultiproject.project137.p686;
import org.gradle.test.performance.largejavamultiproject.project137.p685.Production13717;
import org.gradle.test.performance.largejavamultiproject.project137.p685.Production13718;
import org.gradle.test.performance.largejavamultiproject.project137.p685.Production13719;
public class Production13720 {
private Production13717 property0;
public Production13717 getProperty0() {
return property0;
}
public void setProperty0(Production13717 value) {
property0 = value;
}
private Production13718 property1;
public Production13718 getProperty1() {
return property1;
}
public void setProperty1(Production13718 value) {
property1 = value;
}
private Production13719 property2;
public Production13719 getProperty2() {
return property2;
}
public void setProperty2(Production13719 value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"[email protected]"
] | |
5aa738e3587d5fec1b6fef50a6d674af4ef7c57d | 82f272abc101e547b8e14789d5f624ef6c8b2311 | /Finding the Maximum Contiguous 1's/Main.java | 2e73c6a6508bf42f5a8ae9e0fc4e5f19f9f76e4e | [] | no_license | srisaineelam/Playground | f844bb31453dc82f11a51667530bd58f34813fa4 | 967d9722338be9bf8a0e8b47e6f2289dec9cf730 | refs/heads/master | 2020-04-27T05:08:31.964974 | 2019-08-06T15:43:11 | 2019-08-06T15:43:11 | 174,073,644 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,380 | java | import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
// type your code here
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int arr[] = new int[n];
for(int i = 0; i < n; i++)
{
arr[i] = sc.nextInt();
}
int freq[] = new int[n];
int idx = repeated_element(arr,n,freq);
int max = max_index(freq,n,idx);
System.out.print(max);
}
public static int repeated_element(int arr[], int n, int freq[])
{
int i;
int count=0;
int freq_idx = 0;
for(i = 0; i < n ; i++)
{
if(arr[i] == 1)
{
count++;
}
if((arr[i] == 0) || (i == n-1))
{
freq[freq_idx] = count;
count = 0;
freq_idx++;
}
}
return freq_idx-1;
}
public static int max_index(int freq[], int n, int idx)
{
int max_no = 0;
if((freq[0] > freq[1]) || (idx == 0))
{
max_no = freq[0];
}
else
{
max_no = freq[1];
}
for(int i = 2; i < idx ; i++)
{
if(max_no < freq[idx])
{
max_no = freq[idx];
}
}
return max_no;
}
} | [
"[email protected]"
] | |
cab4e3a8c1c2c60a613e45ef38c3ec0bf9d676ca | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Chart/5/org/jfree/chart/plot/SpiderWebPlot_setWebFilled_393.java | ce29a75b0257cfd3be8e94676cf1c0a3ac765be6 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 2,059 | java |
org jfree chart plot
plot displai data link categori dataset categorydataset form
spider web multipl seri plot axi
easi comparison plot support neg valu present
spider web plot spiderwebplot plot cloneabl serializ
set web fill webfil flag send link plot chang event plotchangeev
regist listen
param flag flag
web fill iswebfil
set web fill setwebfil flag
web fill webfil flag
fire chang event firechangeev
| [
"[email protected]"
] | |
2dd26489f222dc662664bcc3ed3d6ebfaf692a1a | bff30876bc9bf2d3851fb38507d002aefb0f9413 | /src/com/corejava/collectionframework/IdentityHashMapDemo.java | 99a00c10073018433d7a932ed2cfce94dba1134c | [] | no_license | qamanoj/DurgasoftCoreJava | ecbd6da3ea7fa98e5563eb1da017c23ab60697ef | 8411b71ff76f30426d47f11ff2cbd855a9d1d28d | refs/heads/master | 2020-05-01T05:36:03.711911 | 2019-03-23T15:30:51 | 2019-03-23T15:30:51 | 177,306,444 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 518 | java | package com.corejava.collectionframework;
import java.util.HashMap;
import java.util.IdentityHashMap;
public class IdentityHashMapDemo
{
public static void main(String[] args) {
HashMap h1=new HashMap();
Integer i=new Integer(10);
Integer j=new Integer(10);
h1.put(i, "manoj");
h1.put(j, "kumar");
System.out.println(h1);
IdentityHashMap h=new IdentityHashMap();
Integer i1=new Integer(10);
Integer i2=new Integer(10);
h.put(i1, "manoj");
h.put(i2, "kumar");
System.out.println(h);
}
}
| [
"[email protected]"
] | |
de3291fa8a77555d48c591c3e17be5c9b69bee6f | 2ac711b43e738a91ac98a30d81af4591df259c00 | /app/src/main/java/com/example/AssignmentDuAnMau/model/Sach.java | e35a90b697a61335179d17d1dded218bb9e59844 | [] | no_license | VanDaiN/QuanLySach | cd50d6c754b8fbf038054eb8d156230a993ac601 | d339085e6fdc9e5c8361dec4479b371c3ba82c90 | refs/heads/master | 2023-05-29T00:52:29.899178 | 2021-06-16T14:02:27 | 2021-06-16T14:02:27 | 377,515,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,039 | java | package com.example.AssignmentDuAnMau.model;
public class Sach {
private String maSach;
private String maTheLoai;
private String tenSach;
private String tacGia;
private String NXB;
private double giaBia;
private int soLuong;
public Sach() {
}
public Sach(String maSach, String maTheLoai, String tenSach, String tacGia, String NXB, double giaBia, int soLuong) {
this.maSach = maSach;
this.maTheLoai = maTheLoai;
this.tenSach = tenSach;
this.tacGia = tacGia;
this.NXB = NXB;
this.giaBia = giaBia;
this.soLuong = soLuong;
}
public String getMaSach() {
return maSach;
}
public void setMaSach(String maSach) {
this.maSach = maSach;
}
public String getMaTheLoai() {
return maTheLoai;
}
public void setMaTheLoai(String maTheLoai) {
this.maTheLoai = maTheLoai;
}
public String getTenSach() {
return tenSach;
}
public void setTenSach(String tenSach) {
this.tenSach = tenSach;
}
public String getTacGia() {
return tacGia;
}
public void setTacGia(String tacGia) {
this.tacGia = tacGia;
}
public String getNXB() {
return NXB;
}
public void setNXB(String NXB) {
this.NXB = NXB;
}
public double getGiaBia() {
return giaBia;
}
public void setGiaBia(double giaBia) {
this.giaBia = giaBia;
}
public int getSoLuong() {
return soLuong;
}
public void setSoLuong(int soLuong) {
this.soLuong = soLuong;
}
@Override
public String toString() {
return "Sach{" +
"maSach='" + maSach + '\'' +
", maTheLoai='" + maTheLoai + '\'' +
", tenSach='" + tenSach + '\'' +
", tacGia='" + tacGia + '\'' +
", NXB='" + NXB + '\'' +
", giaBia=" + giaBia +
", soLuong=" + soLuong +
'}';
}
}
| [
"[email protected]"
] | |
bfa51c83ef2620084db6ac8fd01b2185f9ae844e | ebf43bc58c1384f1b89a9de666fad6a8fcac0113 | /app/src/main/java/com/example/foodietoronto/db/AppDatabase.java | 52313e9418f7b200f162e38be6b90305e11c2791 | [] | no_license | altond/foodieToronto | 5b66281d5bd2dbd92c078d9ab0a2f234f65f0f10 | 31e1917603b62171de707f5a6ca24d800c247666 | refs/heads/master | 2023-03-01T04:31:45.590077 | 2021-02-08T05:29:49 | 2021-02-08T05:29:49 | 311,259,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 675 | java | package com.example.foodietoronto.db;
import android.content.Context;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
@Database(entities = {Post.class}, version = 1)
public abstract class AppDatabase extends RoomDatabase{
public abstract PostDAO userDao();
private static AppDatabase INSTANCE;
public static AppDatabase getDbInstance(Context context) {
if(INSTANCE == null) {
INSTANCE = Room.databaseBuilder(context.getApplicationContext(), AppDatabase.class, "DB_NAME")
.allowMainThreadQueries()
.build();
}
return INSTANCE;
}
}
| [
"[email protected]"
] | |
69c486377d0cd2be3bafab530867e3c83b6c10db | b5417814b67995ce84f86f63a96a4144aaa7f452 | /src/main/java/Acme/AcmeProject.java | e6f661a8a4358bd9eaf0f0e6fcf423c228585e0a | [] | no_license | PoojaRajkumar/AcmeProject | 5ed61311ebaf576a5b921fd6dee51f41eb1a53f0 | fb72b2f26e1b593b9ee253558db607870342fcc4 | refs/heads/master | 2020-04-26T13:08:34.521793 | 2019-03-03T12:30:36 | 2019-03-03T12:30:36 | 173,571,079 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,569 | java | package Acme;
import java.awt.Desktop.Action;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.interactions.Actions;
public class AcmeProject {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "./drivers/chromedriver.exe");
ChromeDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(3000, TimeUnit.SECONDS);
driver.get("https://acme-test.uipath.com/account/login");
driver.findElementById("email").sendKeys("[email protected]");
driver.findElementById("password").sendKeys("poojar@25");
driver.findElementById("buttonLogin").click();
Actions builder = new Actions(driver);
builder.moveToElement(driver.findElementByXPath("//i[@class='fa fa-truck']/..")).pause(3000).perform();
driver.findElementByLinkText("Search for Vendor").click();
driver.findElementById("vendorTaxID").sendKeys("DE767565");
driver.findElementById("buttonSearch").click();
System.out.println(driver.findElementByXPath("//table[@class='table']//tr[2]/td").getText());
/*List<WebElement> rows = table.findElements(By.tagName("tr"));
for (int i = 0; i < rows.size(); i++) {
WebElement eachRow = rows.get(i);
List<WebElement> columns = eachRow.findElements(By.tagName("td"));
String vendor = columns.get(1).getText();
System.out.println(vendor);
}*/
}
}
| [
"pooja@LAPTOP-T3E5G6UL"
] | pooja@LAPTOP-T3E5G6UL |
6d18aca981a639254486703b709b4994110c0879 | c3d8c6f45f1e5a1f6685d117f9d22ca4862773d8 | /rank/rank-core/src/main/java/org/hq/rank/core/AbLinkBase.java | b2167e1170ad4417a7b950dc03a544a0f9c402ac | [] | no_license | ihanfeng/BusPlat | 69cb18c01e1fbad81377569ea6f4395037e312fb | 83c950149d80aa24f33993295e7a039b481af1b7 | refs/heads/master | 2021-01-13T03:14:52.012643 | 2016-12-27T15:28:25 | 2016-12-27T15:28:25 | 77,612,272 | 1 | 1 | null | 2016-12-29T12:57:23 | 2016-12-29T12:57:22 | null | UTF-8 | Java | false | false | 564 | java | package org.hq.rank.core;
/**
* 所有处于链中的类都集成自该类,包括:
* {@code Node}
* {@code Element}
* {@code NodeStep}
* {@code NodeStepStep}
* {@code ElementStep}
* @author zhen
*
*/
public abstract class AbLinkBase {
protected AbLinkBase previous;
protected AbLinkBase next;
public AbLinkBase getPrevious() {
return previous;
}
public void setPrevious(AbLinkBase previous) {
this.previous = previous;
}
public AbLinkBase getNext() {
return next;
}
public void setNext(AbLinkBase next) {
this.next = next;
}
} | [
"[email protected]"
] | |
ff6c9041443aaea3362a251c304fdb4b701ac6a2 | e89d45f9e6831afc054468cc7a6ec675867cd3d7 | /src/main/java/com/microsoft/graph/requests/extensions/PrivilegedSignupStatusCollectionRequestBuilder.java | c5af5badcba42fc4255dba779fe6019240a45d1d | [
"MIT"
] | permissive | isabella232/msgraph-beta-sdk-java | 67d3b9251317f04a465042d273fe533ef1ace13e | 7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8 | refs/heads/dev | 2023-03-12T05:44:24.349020 | 2020-11-19T15:51:17 | 2020-11-19T15:51:17 | 318,158,544 | 0 | 0 | MIT | 2021-02-23T20:48:09 | 2020-12-03T10:37:46 | null | UTF-8 | Java | false | false | 4,299 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.extensions;
import com.microsoft.graph.http.IRequestBuilder;
import com.microsoft.graph.core.ClientException;
import com.microsoft.graph.concurrency.ICallback;
import com.microsoft.graph.models.extensions.PrivilegedSignupStatus;
import com.microsoft.graph.models.extensions.TenantSetupInfo;
import com.microsoft.graph.models.extensions.RoleSuccessStatistics;
import java.util.Arrays;
import java.util.EnumSet;
import com.microsoft.graph.requests.extensions.IPrivilegedSignupStatusCollectionRequestBuilder;
import com.microsoft.graph.requests.extensions.IPrivilegedSignupStatusRequestBuilder;
import com.microsoft.graph.requests.extensions.IPrivilegedSignupStatusCollectionRequest;
import com.microsoft.graph.requests.extensions.IPrivilegedSignupStatusCompleteSetupCollectionRequestBuilder;
import com.microsoft.graph.requests.extensions.IPrivilegedSignupStatusSignUpRequestBuilder;
import com.microsoft.graph.requests.extensions.IPrivilegedSignupStatusCanSignUpRequestBuilder;
import com.microsoft.graph.requests.extensions.IPrivilegedSignupStatusIsSignedUpRequestBuilder;
import com.microsoft.graph.http.BaseRequestBuilder;
import com.microsoft.graph.core.IBaseClient;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Privileged Signup Status Collection Request Builder.
*/
public class PrivilegedSignupStatusCollectionRequestBuilder extends BaseRequestBuilder implements IPrivilegedSignupStatusCollectionRequestBuilder {
/**
* The request builder for this collection of PrivilegedSignupStatus
*
* @param requestUrl the request URL
* @param client the service client
* @param requestOptions the options for this request
*/
public PrivilegedSignupStatusCollectionRequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
super(requestUrl, client, requestOptions);
}
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public IPrivilegedSignupStatusCollectionRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public IPrivilegedSignupStatusCollectionRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
return new PrivilegedSignupStatusCollectionRequest(getRequestUrl(), getClient(), requestOptions);
}
public IPrivilegedSignupStatusRequestBuilder byId(final String id) {
return new PrivilegedSignupStatusRequestBuilder(getRequestUrlWithAdditionalSegment(id), getClient(), getOptions());
}
public IPrivilegedSignupStatusCompleteSetupCollectionRequestBuilder completeSetup(final TenantSetupInfo tenantSetupInfo) {
return new PrivilegedSignupStatusCompleteSetupCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("microsoft.graph.completeSetup"), getClient(), null, tenantSetupInfo);
}
public IPrivilegedSignupStatusSignUpRequestBuilder signUp() {
return new PrivilegedSignupStatusSignUpRequestBuilder(getRequestUrlWithAdditionalSegment("microsoft.graph.signUp"), getClient(), null);
}
public IPrivilegedSignupStatusCanSignUpRequestBuilder canSignUp() {
return new PrivilegedSignupStatusCanSignUpRequestBuilder(getRequestUrlWithAdditionalSegment("microsoft.graph.canSignUp"), getClient(), null);
}
public IPrivilegedSignupStatusIsSignedUpRequestBuilder isSignedUp() {
return new PrivilegedSignupStatusIsSignedUpRequestBuilder(getRequestUrlWithAdditionalSegment("microsoft.graph.isSignedUp"), getClient(), null);
}
}
| [
"[email protected]"
] | |
14653fdce5eb0469bd99bf248f84faf90ff6091c | c9cf73543d7c81f8e87a58e051380e98e92f978a | /baseline/happy_trader/platform/client/clientHT/clientUI2/src/main/java/com/fin/httrader/eventplugins/ht_mt_bridge/mtstruct_db/HtMtPosition.java | d1a0a5821aceaccae49c73695af915d6edbae94b | [] | no_license | vit2000005/happy_trader | 0802d38b49d5313c09f79ee88407806778cb4623 | 471e9ca4a89db1b094e477d383c12edfff91d9d8 | refs/heads/master | 2021-01-01T19:46:10.038753 | 2015-08-23T10:29:57 | 2015-08-23T10:29:57 | 41,203,190 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,762 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.fin.httrader.eventplugins.ht_mt_bridge.mtstruct_db;
import com.fin.httrader.hlpstruct.OrderType;
import com.fin.httrader.hlpstruct.PosState;
import com.fin.httrader.hlpstruct.PosType;
import com.fin.httrader.hlpstruct.TradeDirection;
import com.fin.httrader.utils.Uid;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "position")
public class HtMtPosition {
private long positionUid = -1; // PK
private long accountMetainfoUid = -1; // ref to acc metainfo
//private long lastUpdateTime = -1;
//private long lastCreateTime = -1;
private String tradeSymbol;
private String ticket;
private String comment;
private long openTime = -1;
private long closeTime = -1;
private long openPrice = -1;
private long closePrice = -1;
private long initialStopLoss = -1;
private long initialTakeProfit = -1;
private long profit = -1;
private long expiration = -1; // date time expiration
// make sence for open orders
private int direction = TradeDirection.TD_NONE;
private int posState = PosState.STATE_DUMMY;
private int posType = PosType.POS_DUMMY; // if position is pending or not
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public long getPositionUid() {
return positionUid;
}
public void setPositionUid(long positionUid) {
this.positionUid = positionUid;
}
@Column(name = "pos_type", columnDefinition = "SMALLINT(6)")
public int getPosType() {
return this.posType;
}
public void setPosType(int posType) {
this.posType = posType;
}
@Column(name = "account_minfo_id")
public long getAccountMetainfoUid() {
return accountMetainfoUid;
}
/**
* @param accountMetainfoUid the accountMetainfoUid to set
*/
public void setAccountMetainfoUid(long accountMetainfoUid) {
this.accountMetainfoUid = accountMetainfoUid;
}
/*
public long getLastUpdateTime() {
return lastUpdateTime;
}
public void setLastUpdateTime(long lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
}
*/
@Column(name = "trade_symbol")
public String getTradeSymbol() {
return tradeSymbol;
}
public void setTradeSymbol(String tradeSymbol) {
this.tradeSymbol = tradeSymbol;
}
@Column(name = "ticket")
public String getTicket() {
return ticket;
}
public void setTicket(String ticket) {
this.ticket = ticket;
}
@Column(name = "comment")
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
@Column(name = "open_time")
public long getOpenTime() {
return openTime;
}
public void setOpenTime(long openTime) {
this.openTime = openTime;
}
@Column(name = "close_time")
public long getCloseTime() {
return closeTime;
}
public void setCloseTime(long closeTime) {
this.closeTime = closeTime;
}
@Column(name = "open_price")
public long getOpenPrice() {
return openPrice;
}
public void setOpenPrice(long openPrice) {
this.openPrice = openPrice;
}
@Column(name = "close_price")
public long getClosePrice() {
return closePrice;
}
public void setClosePrice(long closePrice) {
this.closePrice = closePrice;
}
@Column(name = "direction", columnDefinition = "SMALLINT(6)")
public int getDirection() {
return direction;
}
public void setDirection(int direction) {
this.direction = direction;
}
@Column(name = "pos_state", columnDefinition = "SMALLINT(6)")
public int getPosState() {
return posState;
}
public void setPosState(int posState) {
this.posState = posState;
}
@Column(name = "init_sl")
public long getInitialStopLoss() {
return initialStopLoss;
}
public void setInitialStopLoss(long initialStopLoss) {
this.initialStopLoss = initialStopLoss;
}
@Column(name = "init_tp")
public long getInitialTakeProfit() {
return initialTakeProfit;
}
public void setInitialTakeProfit(long initialTakeProfit) {
this.initialTakeProfit = initialTakeProfit;
}
@Column(name = "profit")
public long getProfit() {
return profit;
}
public void setProfit(long profit) {
this.profit = profit;
}
@Column(name = "expiration")
public long getExpiration() {
return expiration;
}
public void setExpiration(long expiration) {
this.expiration = expiration;
}
//just generates HtMtPositionUpdate
public HtMtPositionUpdate createUpdateObject() {
HtMtPositionUpdate update = new HtMtPositionUpdate();
update.setPositionUid(this.getPositionUid()); // init FK
update.setProfit(this.getProfit());
update.setStopLoss(this.getInitialStopLoss());
update.setTakeProfit(this.getInitialTakeProfit());
return update;
}
public HtMtPositionUpdate doWeHaveUpdateObject(HtMtPosition posupdate) {
// compares 2 objects and returns update object if exists
if (this.getInitialStopLoss() != posupdate.getInitialStopLoss()
|| this.getInitialTakeProfit() != posupdate.getInitialTakeProfit()
|| this.getProfit() != posupdate.getProfit()) {
return createUpdateObject();
}
return null;
}
public void assign(HtMtPosition src) {
accountMetainfoUid = src.accountMetainfoUid; // ref to acc metainfo
tradeSymbol = src.tradeSymbol;
ticket = src.ticket;
comment = src.comment;
openTime = src.openTime;
closeTime = src.closeTime;
openPrice = src.openPrice;
closePrice = src.closePrice;
initialStopLoss = src.initialStopLoss;
initialTakeProfit = src.initialTakeProfit;
profit = src.profit;
expiration = src.expiration; // date time expiration
// make sence for open orders
direction = src.direction;
posState = src.posState;
posType = src.posType;
}
public boolean equalTo(HtMtPosition src) {
// compares to existing object
return (ticket.equals(src.ticket)
&& comment.equals(src.comment)
&& openTime == src.openTime
&& openPrice == src.openPrice
&& closeTime == src.closeTime
&& closePrice == src.closePrice
&& initialStopLoss == src.initialStopLoss
&& initialTakeProfit == src.initialTakeProfit
&& profit == src.profit
&& expiration == src.expiration
&& direction == src.direction
&& posState == src.posState
&& posType == src.posType);
}
}
| [
"[email protected]"
] | |
cc3a9a364810ff5ae95c8b6f5bf34d856f6d94ba | 029927efeec0ec82db1926ae8d117aa88e836a0a | /src/main/java/creditcards/CreditCards.java | e4988a7741124823c9bd54e09e71ac4e6cf19139 | [] | no_license | arpithagurumurthy/CreditCardHandler | a272728cab5103883dfcf785ccfc7aa9a851ac39 | 267e7f022a9937e8916ed686112ad7f5bc1662a7 | refs/heads/master | 2023-07-22T16:46:44.335349 | 2021-09-08T07:13:08 | 2021-09-08T07:13:08 | 404,245,706 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 602 | java | package creditcards;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import java.util.List;
@XmlSeeAlso({MasterCC.class, VisaCC.class, AmExCC.class, DiscoverCC.class, InvalidCC.class})
@XmlRootElement(name = "creditcards")
public class CreditCards {
private List<CreditCard> creditCardList = null;
public List<CreditCard> getCreditCards() {
return creditCardList;
}
public void setCreditCards(List<CreditCard> creditCardList) {
this.creditCardList = creditCardList;
}
}
| [
"[email protected]"
] | |
6a4894cdd349da8615e7469b11e70f456abcee4d | a7bb6b268df073b89570d096efeb0aab3e4e683d | /engine/src/main/java/de/matthiasmann/twl/input/lwjgl/LWJGLInput.java | bb90a0b3fd6e6ccbf26f02afe13811306e9ed43b | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | dmitrykolesnikovich/twl | abf96f9d0a84b15e9d42b54804adb37ae3685162 | 39e88bc6b5338444d64424d1609f24c2be18a890 | refs/heads/master | 2021-07-01T03:57:07.280286 | 2017-09-22T13:12:15 | 2017-09-22T13:12:15 | 104,472,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,981 | java | /*
* Copyright (c) 2008-2010, Matthias Mann
*
* 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.
* * Neither the name of Matthias Mann nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* 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 OWNER 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.matthiasmann.twl.input.lwjgl;
import de.matthiasmann.twl.GUI;
import de.matthiasmann.twl.input.Input;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
/**
* Input handling based on LWJGL's Mouse & Keyboard classes.
*
* @author Matthias Mann
*/
public class LWJGLInput implements Input {
private boolean wasActive;
public boolean pollInput(GUI gui) {
boolean active = Display.isActive();
if (wasActive && !active) {
wasActive = false;
return false;
}
wasActive = active;
if (Keyboard.isCreated()) {
while (Keyboard.next()) {
gui.handleKey(
Keyboard.getEventKey(),
Keyboard.getEventCharacter(),
Keyboard.getEventKeyState());
}
}
if (Mouse.isCreated()) {
while (Mouse.next()) {
gui.handleMouse(
Mouse.getEventX(), gui.getHeight() - Mouse.getEventY() - 1,
Mouse.getEventButton(), Mouse.getEventButtonState());
int wheelDelta = Mouse.getEventDWheel();
if (wheelDelta != 0) {
gui.handleMouseWheel(wheelDelta / 120);
}
}
}
return true;
}
}
| [
"[email protected]"
] | |
21af5eb9ccd82cfcb372c10f5c2c6de8ce1c0277 | 73709f76271dc06b5f745eb4c733b72041306ced | /06_Thread/src/com/itheima/demo06/ThreadSafe/Demo01Ticket.java | c0534295a1b254d3f28f1411016220c3bd2bb873 | [] | no_license | lianshuailing/javase | c3ba4dd11f277da0c7998f92b3554b1664a14b75 | 79b0eaf65eff560617aebb240e3873dc4474cf6f | refs/heads/master | 2020-09-10T22:57:40.588797 | 2019-11-15T06:40:34 | 2019-11-15T06:40:34 | 221,858,659 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 608 | java | package com.itheima.demo06.ThreadSafe;
/*
模拟卖票案例
创建3个线程,同时开启,对共享的票进行出售
*/
public class Demo01Ticket {
public static void main(String[] args) {
//创建Runnable接口的实现类对象
RunnableImpl run = new RunnableImpl();
//创建Thread类对象,构造方法中传递Runnable接口的实现类对象
Thread t0 = new Thread(run);
Thread t1 = new Thread(run);
Thread t2 = new Thread(run);
//调用start方法开启多线程
t0.start();
t1.start();
t2.start();
}
}
| [
"[email protected]"
] | |
15df9097fa499db5628b0e9457d213ae72842e69 | b10683c84c7bab04424ee1b9e88bb447c10599a7 | /2016년/2016 실전코딩/실전코딩/TemplateMethod-ScalperExample-Java/src/java/com/industriallogic/example/Ticket.java | 5100e7d3b36d691dc58e9895128208d1a0e03a78 | [] | no_license | MS-Park/CNU | 824b5213a3b751e0f591539cbf5d509b63327f82 | bc7581e386a9f8dad274ecd600d33b8b1d37382c | refs/heads/master | 2020-12-24T18:42:15.644061 | 2016-10-17T19:54:52 | 2016-10-17T19:54:52 | 59,454,288 | 0 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,261 | java | /// ***************************************************************************
/// Copyright (c) 2008, Industrial Logic, Inc., All Rights Reserved.
///
/// This code is the exclusive property of Industrial Logic, Inc. It may ONLY be
/// used by students during Industrial Logic's workshops or by individuals
/// who are being coached by Industrial Logic on a project.
///
/// This code may NOT be copied or used for any other purpose without the prior
/// written consent of Industrial Logic, Inc.
/// ****************************************************************************
package com.industriallogic.example;
public class Ticket {
private double faceValue;
private double streetPrice;
private String concert;
private static Ticket soldOut = new Ticket("Sold Out", 0.00);
public static Ticket soldOut() {
return soldOut;
}
public Ticket(String concert, double faceValue) {
this.concert = concert;
this.faceValue = faceValue;
this.streetPrice = faceValue;
}
public double getStreetPrice() {
return streetPrice;
}
public String getConcert() {
return concert;
}
public void jackUpPriceBy(double amount) {
if (this != Ticket.soldOut())
streetPrice += amount;
}
public double getFaceValue() {
return faceValue;
}
}
| [
"[email protected]"
] | |
e090d1a33968771b1cb117332bf01a48ee2534a6 | 486777e96e176caf05fa99959fa4594711665ddc | /app/src/main/java/com/citemenu/mystash/helper/Utils.java | 2a3144252d0459019fff8c6c556c2311c06e3765 | [] | no_license | iArsalanshah/MyStash | 576cf04b30549e439a01297d759270b727225de7 | 9fa33ce6cec753b5c9d86de1d843cab91d65e36c | refs/heads/master | 2020-04-09T05:22:34.033184 | 2018-11-11T20:09:13 | 2018-11-11T20:09:13 | 160,061,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 208 | java | package com.citemenu.mystash.helper;
import android.net.Uri;
import java.io.File;
public class Utils {
public static Uri getImageUri(String path) {
return Uri.fromFile(new File(path));
}
} | [
"[email protected]"
] | |
2dc6e98a33976fc77ebbbfe04813bff0491198b7 | 87d51c17585e27ac54fdb7c90010486aa862144b | /src/main/java/com/cherlshall/wechat/config/WechatConfig.java | 364446fb5b0f3dd0efd46e6f04dfb5fa23f83002 | [] | no_license | JoinTiger/wechat | 02bf07281dc511ba0395741c72b637a30cb2a5b4 | 79f70b93383f23e50d21b2b27f28127ee850fe99 | refs/heads/master | 2023-03-21T04:34:40.846661 | 2019-03-27T09:51:14 | 2019-03-27T09:51:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package com.cherlshall.wechat.config;
/**
* 认证信息 前往微信公众号管理页面获取 并填写
*/
public class WechatConfig {
public static final String APP_ID = "appid";
public static final String APP_SECRET = "appsecret";
public static final String TOKEN = "your token";
}
| [
"[email protected]"
] | |
06447f1523635d7d1a6385541fcab213018379dc | afdc1096b0d6310f95082f15881f01124c76ecdd | /springRemoting/src/main/java/com/skytech/springRemoting/Booking.java | 158913a8d578c2735f9ab8b97ad3485162b41a0c | [] | no_license | skytech-rj/SpringRemoting | 1f01360ed94c6ab32757fea5052bbc4bee43df6d | f55a7f0911dc08f28297c032dfbe82dc8011cb03 | refs/heads/master | 2022-12-26T20:39:57.213689 | 2020-07-26T19:02:31 | 2020-07-26T19:02:31 | 282,699,575 | 0 | 0 | null | 2020-10-13T23:57:26 | 2020-07-26T17:28:51 | Java | UTF-8 | Java | false | false | 578 | java | package com.skytech.springRemoting;
import java.io.Serializable;
public class Booking implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private String bookingCode;
public Booking() {
super();
}
public Booking(String bookingCode) {
super();
this.bookingCode = bookingCode;
}
@Override
public String toString() {
return "Booking [bookingCode=" + bookingCode + "]";
}
public String getBookingCode() {
return bookingCode;
}
public void setBookingCode(String bookingCode) {
this.bookingCode = bookingCode;
}
}
| [
"[email protected]"
] | |
e444fce7eadf4313de9c028e3c9c462831522e2f | 96bc31a1e00d58db2486fcfa2babd1127b3acb48 | /exercises/Abstract/src/shine/Member.java | 5d9b09477fc044497dc2ebbcd539df6ed8f08011 | [] | no_license | ChiePro/java-practice | 3da4611745ae46c5d86445115f09476ed81f8bbd | 4f447bf9e6103de8f9444e63646baca9156cd974 | refs/heads/master | 2021-09-15T14:16:28.973042 | 2018-06-04T06:01:57 | 2018-06-04T06:01:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 97 | java | package shine;
public abstract class Member {
public abstract void dispName(String name); //
}
| [
"[email protected]"
] | |
49763b51382ffb4e4df4403a2b5b521bd42d30b0 | 68d146d09de30003e98fc7a196a3ff064567f62b | /MinecraftMod/main/resources/assets/elementalpets/renders/RenderElementalEarth.java | 302dd3b0dab8f7c86840d7141424cb1e5313bb08 | [] | no_license | FSorek/SmallProjects | f9dccc8f403a51ec266227c58b765d99039829fa | 659f14c7baaed17e0b27e2147c33c0acc94c909a | refs/heads/master | 2021-01-24T06:18:12.879570 | 2017-06-04T12:05:02 | 2017-06-04T12:05:02 | 93,310,086 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package assets.elementalpets.renders;
import assets.elementalpets.models.entities.ModelElementalEarth;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import okito122.elementalpets.entities.EntityElementalBase;
public class RenderElementalEarth extends RenderLiving<EntityElementalBase> {
public RenderElementalEarth(RenderManager rendermanagerIn) {
super(rendermanagerIn, new ModelElementalEarth(), 0.5f);
// TODO Auto-generated constructor stub
}
@Override
protected ResourceLocation getEntityTexture(EntityElementalBase elemental) {
// TODO Auto-generated method stub
return elemental.getTextureType();
}
}
| [
"[email protected]"
] | |
0192dd26882825c4b95921b16d6544d6b962dabe | 1c78010883af7e6f7710544d22470e9c19cdad39 | /core/src/it/randomtower/popsimulation/WorldBuilder.java | a3addc395e6ecac058e3695aa47ec0bf8ea9e2b9 | [] | no_license | Gornova/PopSimulation | 818f4523e94cc47106133dea11f8e7a441464f44 | e24e5af9655d0ebe1ad3fd0a8b19ea1f35ebd1f1 | refs/heads/master | 2020-03-29T23:33:48.669433 | 2018-09-26T19:36:11 | 2018-09-26T19:36:11 | 150,478,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package it.randomtower.popsimulation;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import it.randomtower.popsimulation.model.Population;
import it.randomtower.popsimulation.model.World;
public class WorldBuilder {
public static World build(int w, int h, TextureRegion grass, TextureRegion desert) {
World world = new World(10, 10);
for (int i = 0; i < w; i++) {
for (int j = 0; j < h; j++) {
world.map[i][j] = CellBuilder.build("", i, j, grass, desert);
}
}
int x = 5;
int y = 5;
Population rural = PopulationBuilder.buildRural(x, y, TecnologyLevel.NOMAD);
world.map[x][y].add(rural);
Population rural2 = PopulationBuilder.buildRural(x, y, TecnologyLevel.AGRICOLTURE);
world.map[x][y].add(rural2);
return world;
}
}
| [
"[email protected]"
] | |
af16bf02f3a3d3536cf1f4c15b506e841bdf5fe8 | bcbb44566186712716cbe8aef981e7f6c522192a | /src/test/java/io/jenkins/nodes/JobNodesOnDemandConfigurationTest.java | 6f54a2d2559fac9e0b264bf5b7d50b392620b017 | [] | no_license | fr123k/jenkins-plugin-job-agents-on-demand | 0e7d8d0f29294664110de0f5042f1b6855060fb1 | 6d709aa0afa197c617e017f0ed17a1a311e3298f | refs/heads/master | 2023-01-10T20:56:48.844011 | 2020-04-29T21:36:50 | 2020-04-29T21:38:08 | 260,051,015 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,359 | java | package io.jenkins.nodes;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Rule;
import org.jvnet.hudson.test.RestartableJenkinsRule;
public class JobNodesOnDemandConfigurationTest {
@Rule
public RestartableJenkinsRule rr = new RestartableJenkinsRule();
/**
* Tries to exercise enough code paths to catch common mistakes:
* <ul>
* <li>missing {@code load}
* <li>missing {@code save}
* <li>misnamed or absent getter/setter
* <li>misnamed {@code textbox}
* </ul>
*/
@Test
public void uiAndStorage() {
JobNodesOnDemandConfiguration config = JobNodesOnDemandConfiguration.get();
rr.then(r -> {
assertNull("Default value not assigned", config.getGitUrl());
HtmlForm htmlForm = r.createWebClient().goTo("configure").getFormByName("config");
HtmlTextInput textbox = htmlForm.getInputByName("_.gitUrl");
textbox.setText("hello");
r.submit(htmlForm);
assertEquals("global config page let us edit it", "hello", config.getGitUrl());
});
rr.then(r -> {
assertEquals("still there after restart of Jenkins", "hello", config.getGitUrl());
});
}
}
| [
"[email protected]"
] | |
d4705fedc0b53a0d8918ae5e184b45082995f431 | 3c625412d8191e255246522a3e7e03c51571fcf3 | /spring-annotation/AnnotationConfig/src/main/java/com/techment/model/MySQL.java | 61c45a985dd6ad95a27e1876211e1dfa5e055e47 | [] | no_license | ParulPaul/TechmentJavaTraining | 358352327dad1f217a5b49723ee39ba3de29eb6a | dda0411b073aa12787d326817c9810db2bacd5ea | refs/heads/master | 2023-08-14T07:00:00.552402 | 2021-09-13T12:57:22 | 2021-09-13T12:57:22 | 393,954,123 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package com.techment.model;
import org.springframework.stereotype.Repository;
@Repository
public class MySQL implements IDao {
public void databaseName() {
System.out.println("Oracle is connected");
}
}
| [
"[email protected]"
] | |
9f522fda2a49036780cc9b3b7d5cc4fd33009dea | 5803f9d29c107c4297ad9eb210e069dc0f82c97f | /app/src/test/java/com/boisneyphilippe/githubarchitecturecomponents/ExampleUnitTest.java | 95a1fbc47aa94e6bb0cf884355330e67b23cdb56 | [] | no_license | anisuzzamanbabla/GithubArchitectureComponents | e4d15e4bb07f2d104a3e63a83b740bc43cc76056 | 062c9dda3415ca3ff2eb71b07280638d2e7526d3 | refs/heads/master | 2022-12-19T13:14:53.495932 | 2020-09-23T20:46:29 | 2020-09-23T20:46:29 | 298,059,430 | 1 | 0 | null | 2020-09-23T18:27:00 | 2020-09-23T18:26:59 | null | UTF-8 | Java | false | false | 426 | java | package com.boisneyphilippe.githubarchitecturecomponents;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
91d4ae15a0bcc15bc1a1476acd8332aadb0135d9 | b6cad0a170fe5fdc42654a26f32ce60b7c9e0ef5 | /Request_Manager-master-4/app/src/main/java/com/qrofeus/requestmanager/Dialog_Mail.java | dfcf06a8ad599f9e131e9d548817712ad8ea8cb8 | [] | no_license | anuragdoshi-and/RequestManager | 64014579bdc3f4222cbef8e3d0ed85ae1b722139 | 5349a0397a4ab95aed887aeab8fc8289289c5013 | refs/heads/main | 2023-06-08T14:48:42.614564 | 2021-06-26T07:20:28 | 2021-06-26T07:20:28 | 380,440,029 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,852 | java | package com.qrofeus.requestmanager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDialogFragment;
public class Dialog_Mail extends AppCompatDialogFragment {
private InterfaceMail entryInterface;
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_mail, null);
final EditText editText1 = view.findViewById(R.id.login_edit1);
final EditText editText2 = view.findViewById(R.id.login_edit2);
final Button posButton = view.findViewById(R.id.login_button);
posButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final String userSubject = editText1.getText().toString();
final String passDetails = editText2.getText().toString();
entryInterface.sendMail(userSubject, passDetails);
}
});
builder.setView(view);
return builder.create();
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
try {
entryInterface = (InterfaceMail) context;
} catch (ClassCastException e) {
throw new ClassCastException(context.toString() + "Class must implement Interface_UserEntry");
}
}
public interface InterfaceMail {
void sendMail(String mailSubject, String mailDetails);
}
}
| [
"[email protected]"
] | |
b53785f16546dd6be742724cf686d46b6dfc1e6f | 9feb2d5919c61ac4dcac42ade4c86d3a33cfe21c | /common-library/src/main/java/com/dysen/common_library/utils/http/OkHttpUtils.java | 6af4b6e30041153514214404a846ab0e1e4fb2fd | [] | no_license | dysen2014/CommonTest | a48858eb1c3c058e1f1d421d6faf954979e637e6 | e2d414ff777de0891e21e3827208961422ecc65c | refs/heads/master | 2020-03-24T16:25:36.384207 | 2018-12-29T09:35:33 | 2018-12-29T09:35:33 | 142,824,228 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,771 | java | package com.dysen.common_library.utils.http;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.Xml;
import com.dysen.common_library.utils.LogUtils;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.xmlpull.v1.XmlPullParser;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* Created by lenovo on 2017/7/11.
*/
public class OkHttpUtils {
/**
* 线程池,所有请求都在线程池中
*/
private static ThreadPoolExecutor mThreadPool = (ThreadPoolExecutor) Executors.newCachedThreadPool();
private static final String TAG = "HttpThread";
public static String jsonData;
private static final MediaType MEDIA_TYPE_MARKDOWN = MediaType.parse("application/json; charset=utf-8");
/**
* intergrated get请求
* @param url
* @param params
* @param networkResponse
* @return
*/
public static Runnable sendRequestGet(final String url, final String params, final CommonInterface.NetworkResponse
networkResponse) {
if (networkResponse == null)
return null;
Runnable task = new Runnable() {
@Override
public void run() {
//创建okHttpClient对象
OkHttpClient mOkHttpClient = new OkHttpClient();
//创建一个Request
final Request request = new Request.Builder()
.url(url + params)
// .url("https://github.com/hongyangAndroid")
.build();
LogUtils.d("http", "sendRequest:" + url + params);
//new call
Call call = mOkHttpClient.newCall(request);
//请求加入调度
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
networkResponse.onFailure(e, "访问失败!");
}
@Override
public void onResponse(Call call, Response response) {
try {
integrated(response.body().toString(), networkResponse);//intergrated 方式
} catch (Exception e) {
e.printStackTrace();
networkResponse.onFailure(e, "响应请求数据处理异常!");
}
}
});
}
};
mThreadPool.execute(task);
return task;
}
/**
* http 请求
* @param url
* @param params
* @param networkResponse
* @param bl true xml转换 ||| false json 转换
* @return
*/
public static Runnable sendRequestGet(final String url, final String params, final boolean bl, final CommonInterface.NetworkResponse
networkResponse) {
if (networkResponse == null)
return null;
Runnable task = new Runnable() {
@Override
public void run() {
//创建okHttpClient对象
OkHttpClient mOkHttpClient = new OkHttpClient();
//创建一个Request
final Request request = new Request.Builder()
.url(url + params)
// .url("https://github.com/hongyangAndroid")
.build();
LogUtils.d("http", "sendRequest:" + url + params);
//new call
Call call = mOkHttpClient.newCall(request);
//请求加入调度
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
networkResponse.onFailure(e, "访问失败!");
}
@Override
public void onResponse(Call call, Response response) {
// LogUtils.d("http", "sendRequest:" + String.valueOf(response));
String tmpBody = null;
try {
if (bl) {//xml 格式
tmpBody = getJsonString(response.body().byteStream(), "UTF-8");
} else {//json 格式
tmpBody = response.body().string();
}
LogUtils.d("http", "Response completed: " + tmpBody);
networkResponse.onSuccess(0, tmpBody);
} catch (Exception e) {
e.printStackTrace();
networkResponse.onFailure(e, "响应请求数据处理异常!");
}
}
});
}
};
mThreadPool.execute(task);
return task;
}
private static void integrated(String tmpBody, CommonInterface.NetworkResponse networkResponse) throws JSONException {
int state = 0;
try {
state = getJsonObject(tmpBody).getInt("s");
} catch (JSONException e) {
e.printStackTrace();
}
if (state == 1)
networkResponse.onSuccess(0, tmpBody);
else if (state != 1) {
String str = "";
try {
JSONObject jsonObject = getJsonObject(tmpBody);
str = jsonObject.get("m").toString();
} catch (JSONException e1) {
e1.printStackTrace();
str = "Json 转换异常!";
}
networkResponse.onFailure(null, str);
}
}
/**
* 把 xml 格式转换成 json 格式
*
* @param inputStream 获得请求响应 转换成流 如response.body().byteStream()
* @param type 转换编码格式 如 utf-8
* @return
* @throws Exception
*/
public static String getJsonString(InputStream inputStream, String type) throws Exception {
XmlPullParser parser = Xml.newPullParser();
parser.setInput(inputStream, type);
int event = parser.getEventType();// 产生第一个事件
String tmpJsonString = null;
while (event != XmlPullParser.END_DOCUMENT) {
switch (event) {
case XmlPullParser.START_DOCUMENT:// 判断当前事件是否是文档开始事件
break;
case XmlPullParser.START_TAG:// 判断当前事件是否是标签元素开始事件
if ("getJSONReturn".equals(parser.getName())) {// 判断开始标签元素是否是student
tmpJsonString = parser.nextText();// 得到student标签的属性值,并设置student的id
}
break;
case XmlPullParser.END_TAG:// 判断当前事件是否是标签元素结束事件
break;
}
event = parser.next();// 进入下一个元素并触发相应事件
}
return tmpJsonString;
}
public static Runnable sendRequestWithOkHttp(final String url, final JSONObject obj, final
CommonInterface.NetworkResponse networkResponse) {
if (networkResponse == null)
return null;
Runnable task = new Runnable() {
@Override
public void run() {
try {
RequestBody body = RequestBody.create(MEDIA_TYPE_MARKDOWN, String.valueOf(obj));
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(url)//请求地址
.post(body)//post 请求参数
.build();
LogUtils.d("http", "sendRequest:" + url + obj.toString());
Response response = client.newCall(request).execute();
String responseData = response.body().string();
LogUtils.d("http", "Response completed: " + responseData);
networkResponse.onSuccess(0, responseData);
} catch (MalformedURLException e) {
e.printStackTrace();
networkResponse.onFailure(e, "MalformedURLException");
} catch (SocketTimeoutException e) {
e.printStackTrace();
networkResponse.onFailure(e, "SocketTimeoutException");
} catch (Exception e) {
e.printStackTrace();
networkResponse.onFailure(e, "IOException");
}
}
};
mThreadPool.execute(task);
return task;
}
public static Runnable sendRequestWithOkHttp(final String url, final String param, final
CommonInterface.NetworkResponse networkResponse) {
if (networkResponse == null)
return null;
Runnable task = new Runnable() {
@Override
public void run() {
try {
RequestBody body = RequestBody.create(MEDIA_TYPE_MARKDOWN, param);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(url)//请求地址
.post(body)//post 请求参数
.build();
LogUtils.d("http", "sendRequest:" + url + param);
Response response = client.newCall(request).execute();
String responseData = response.body().string();
LogUtils.d("http", "Response completed: " + responseData);
// networkResponse.onSuccess(0, responseData);
integrated(responseData, networkResponse);
} catch (MalformedURLException e) {
e.printStackTrace();
networkResponse.onFailure(e, "MalformedURLException");
} catch (SocketTimeoutException e) {
e.printStackTrace();
networkResponse.onFailure(e, "SocketTimeoutException");
} catch (Exception e) {
e.printStackTrace();
networkResponse.onFailure(e, "IOException");
}
}
};
mThreadPool.execute(task);
return task;
}
/**
* 取出字符串里某个json 对象 并返回这个对象
*
* @param jsonData
* @param name
* @return
* @throws JSONException
*/
public static JSONObject getJsonObject(String jsonData, String... name) throws JSONException {
if (!TextUtils.isEmpty(jsonData) && jsonData != null) {
JSONObject json = new JSONObject(jsonData);
if (name.length > 0) {
JSONObject jsonObject = json.optJSONObject(name[0]);
// LogUtils.d("http response parse", "jsonObject: " + json.toString());
return jsonObject;
} else
return json;
} else
return null;
}
public static JSONArray getJsonArray(JSONObject jsonObject, String name) throws JSONException {
if (jsonObject != null) {
JSONArray jsonArray = jsonObject.getJSONArray(name);
// LogUtils.d("http response parse", "jsonArray: " + jsonArray.toString());
return jsonArray;
} else
return null;
}
/**
* json字符串 转成实体类
*
* @param <T>
* @param jsonData
* @return
*/
public static <T> List<T> parseList(String jsonData, Class<T> cls) {
if (!TextUtils.isEmpty(jsonData) || jsonData != null) {
Gson gson = new Gson();
List<T> list = new ArrayList<T>();
JsonArray arry = new JsonParser().parse(jsonData).getAsJsonArray();
for (JsonElement jsonElement : arry) {
list.add(gson.fromJson(jsonElement, cls));
}
return list;
} else
return null;
}
public static <T> T parseObject(String jsonData, Class<T> cls) {
if (!TextUtils.isEmpty(jsonData) || jsonData != null) {
Gson gson = new Gson();
T t = gson.fromJson(jsonData, cls);
return t;
} else
return null;
}
/**
* 下载文件
* @param url 服务器地址
* @param filePath 文件地址
* @param networkResponse 回调
* @return 请求对象
*/
public static Runnable downloadFile(final String url, final String filePath, final CommonInterface.NetworkResponse
networkResponse) {
if ("".equals(url) || "".equals(filePath) || networkResponse == null)
return null;
Runnable task = new Runnable() {
@Override
public void run() {
//创建okHttpClient对象
OkHttpClient mOkHttpClient = new OkHttpClient();
//创建一个Request
final Request request = new Request.Builder()
.url(url)
// .url("https://github.com/hongyangAndroid")
.build();
LogUtils.d("http", "sendRequest:" + url);
//new call
Call call = mOkHttpClient.newCall(request);
//请求加入调度
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
networkResponse.onFailure(e, "访问失败!");
}
@Override
public void onResponse(Call call, Response response) {
// LogUtils.d("http", "sendRequest:" + String.valueOf(response));
String tmpBody = null;
BufferedOutputStream outputStream = null;
try {
File file = new File(filePath);
if (!file.getParentFile().exists())
file.getParentFile().mkdirs();
int readFileCount = 0;
byte[] buffer = new byte[1024];
while ((readFileCount = response.body().byteStream().read(buffer, 0, 1024)) != -1){
outputStream.write(buffer, 0, readFileCount);
}
outputStream.flush();
networkResponse.onSuccess(200, filePath);
} catch (MalformedURLException e) {
e.printStackTrace();
networkResponse.onFailure(e, "MalformedURLException");
} catch (IOException e) {
e.printStackTrace();
networkResponse.onFailure(e, "IOException");
} catch (JSONException e1) {
e1.printStackTrace();
} finally {
try {
if (outputStream != null)
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
});
}
};
mThreadPool.execute(task);
return task;
}
/**
* 上传文件
* @param url 服务器地址
* @param params 参数
* @param file 文件
* @param networkResponse 回调
* @return 请求对象
*/
public static Runnable uploadFile(final String url, @Nullable String params,
final File file, final CommonInterface.NetworkResponse
networkResponse) {
if ("".equals(url) || file == null || networkResponse == null)
return null;
Runnable task = new Runnable() {
@Override
public void run() {
OkHttpClient client = new OkHttpClient();
// 构建请求 Body
MultipartBody.Builder builder = new MultipartBody.Builder()
.setType(MultipartBody.FORM);
builder.addFormDataPart("platform", "Android");
builder.addFormDataPart("File", file.getName(),
RequestBody.create(MediaType.parse("application/octet-stream"), file));
// 构建一个请求
Request request = new Request.Builder()
.url(url)//请求地址
.post(builder.build()).build();//post 请求参数
// Response response = client.newCall(request).execute();
// new RealCall 发起请求
Call call = client.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
networkResponse.onFailure(e, "");
}
@Override
public void onResponse(Call call, Response response) throws IOException {
response.body().string();
try {
networkResponse.onSuccess(call.hashCode(), response.body().string());
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
};
mThreadPool.execute(task);
return task;
}
public static boolean stopRequest(Runnable task) {
return mThreadPool.remove(task);
}
}
| [
"[email protected]"
] | |
d291d2912b19450251f9cd859662d8b24a08831b | 370e5c8742ae735478c88f112508262e042135a1 | /java-io/src/jame/product_management/ProductManagement.java | d8db0b182e847639173d5ddbf85c8e5f3cdcfce3 | [] | no_license | thanhtran6916/new-module2 | 6a74d9ee50fb8e13a3d47b1142b6bef7deab8e2c | 82dfdbee2967511135ea505db7fee08463488640 | refs/heads/master | 2023-07-21T06:00:16.032294 | 2021-09-06T02:15:59 | 2021-09-06T02:15:59 | 397,500,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java | package jame.product_management;
import java.io.Serializable;
import java.util.ArrayList;
public class ProductManagement implements Serializable {
private ArrayList<Product> products = new ArrayList<>();
public ArrayList<Product> getProducts() {
return products;
}
public void setProducts(ArrayList<Product> products) {
this.products = products;
}
public void add(Product product) {
products.add(product);
}
public void show() {
for (Product product : products) {
System.out.println(product);
}
}
private int searchIndexProduct(int id) {
int index = -1;
for (int i = 0; i < products.size(); i++) {
if (products.get(i).getId() == id) {
index = i;
break;
}
}
return index;
}
public void search(int id) {
int index = searchIndexProduct(id);
if (index == -1) {
System.out.println("Không có");
} else {
System.out.println(products.get(index));
}
}
}
| [
"[email protected]"
] | |
2f52af58a4cc851d5ec2ad9b658b4e794d43f205 | 45ce60d84634def9fae2263d5d01baf4a049e4a1 | /youlexuan-manager-web/src/main/java/com/youlexuan/manager/controller/UploadController.java | 839827e926b21440b427bdae6b3c19b87e2b7bd7 | [] | no_license | zgl19960907/youlexuan-parent | e8cd6e1b0d29fa5b0832d2f66040fd019e7a90f4 | 7d7b58fb702284836306014ab7d03a5c5aa0a9d1 | refs/heads/master | 2022-12-22T17:51:41.648644 | 2019-10-24T09:02:43 | 2019-10-24T09:02:43 | 217,255,750 | 0 | 0 | null | 2022-12-16T07:15:52 | 2019-10-24T08:58:16 | JavaScript | UTF-8 | Java | false | false | 1,476 | java | package com.youlexuan.manager.controller;
import com.youlexuan.entity.Result;
import com.youlexuan.util.FastDFSClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
public class UploadController {
@Value("${FILE_SERVER_URL}")
private String FILE_SERVER_URL;//文件服务器地址
/**
* Result 前台需要得到上传后的图片的地址作为回显
* @param file
* @return
*/
@RequestMapping("/upload")
public Result upload(MultipartFile file){
//1、取文件的扩展名
String originalFilename = file.getOriginalFilename();
String extName = originalFilename.substring(originalFilename.lastIndexOf(".") + 1);
try {
//2、创建一个 FastDFS 的客户端
FastDFSClient fastDFSClient = new FastDFSClient("classpath:config/fdfs_client.conf");
//3、执行上传处理
String path = fastDFSClient.uploadFile(file.getBytes(), extName);
//4、拼接返回的 url 和 ip 地址,拼装成完整的 url
String url = FILE_SERVER_URL + path;
return new Result(true,url);
} catch (Exception e) {
e.printStackTrace();
return new Result(false, "上传失败");
}
}
}
| [
"[email protected]"
] | |
745e312e90bf199ca31d5463751244c2935d71bf | e1fd211d259a6a202f839116f0c9f93ce31c1bb6 | /wrappers/java/java/src/main/java/cloud/puccini/TOSCA.java | ea1f7c0e6658bb0038d4c091a5b8bc509e87bf75 | [
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] | permissive | ganesh19881030/puccini | 1180ee046bd4782a65bccb71fd822c697da91688 | 81e61596c97cfcd9ec3a90331f7bcadc6858aeee | refs/heads/master | 2022-05-26T08:59:11.921712 | 2020-04-30T17:51:44 | 2020-04-30T17:52:59 | 261,089,086 | 0 | 0 | Apache-2.0 | 2023-08-30T13:54:25 | 2020-05-04T05:33:57 | Go | UTF-8 | Java | false | false | 524 | java | package cloud.puccini;
import org.snakeyaml.engine.v2.api.Load;
import org.snakeyaml.engine.v2.api.LoadSettings;
import java.util.Map;
public class TOSCA
{
public static Map<Object, Object> Compile( String url ) throws Exception
{
Load load = new SnakeYAML.Load( LoadSettings.builder().build() );
Map<Object, Object> clout = (Map<Object, Object>) load.loadFromString( _Compile( url ) );
return clout;
}
static
{
System.loadLibrary( "puccinijni" );
}
public static native String _Compile( String url );
}
| [
"[email protected]"
] | |
ecfc20cc92a647f01b7267e8324ebdac0f42ea7c | 5449bc3d089fad701ac632da7628413d7c7ba7fd | /demo02/src/test/java/cn/hzh/demo02/ExampleUnitTest.java | 267dad75cad845c989b74c71064a19d73550d8ce | [] | no_license | cshzhang/ViewDragHelperDemo | 451fb9783fc0ac71871130daa4dd1820c4150d3a | e8d13da00eeb4dd5138eb81498fa3be5112d2f1f | refs/heads/master | 2021-01-10T13:16:34.588565 | 2015-10-23T08:50:25 | 2015-10-23T08:50:25 | 44,741,645 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 310 | java | package cn.hzh.demo02;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest
{
@Test
public void addition_isCorrect() throws Exception
{
assertEquals(4, 2 + 2);
}
} | [
"[email protected]"
] | |
9be08c14478e27fdfd94f44d9862ee847db40aae | 7633eda4b6995243379859cb61895180961095ce | /GameOfLife.java | e98df186505bc49cbb83330d2a8197d847c21718 | [] | no_license | cxim/Hyper_game_of_life_gui_swing | 0e8d62559f10698cc389d255e68d2540cd8869da | 8662087d9844ecba4268f661012fb2bb6b16d7e9 | refs/heads/master | 2022-11-24T10:20:45.570742 | 2020-08-03T03:33:54 | 2020-08-03T03:33:54 | 284,594,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,530 | java | package life;
import javax.swing.*;
import java.awt.*;
import java.util.Scanner;
public class GameOfLife extends JFrame {
JLabel generationLabel;
JLabel aliveLabel;
JPanel infoPanel;
JPanel cellsFieldPanel;
JButton rerol;
JToggleButton start;
public void showCurrentGeneration(boolean[][] currentGeneration) {
JPanel cellsFieldPanel = new JPanel();
cellsFieldPanel.setLayout(new GridLayout(currentGeneration.length, currentGeneration.length, 1, 1));
drawCellsFieldWithPanels(currentGeneration, cellsFieldPanel);
this.cellsFieldPanel = cellsFieldPanel;
add(cellsFieldPanel, BorderLayout.CENTER);
}
void drawCellsFieldWithPanels(boolean[][] currentGeneration, JPanel cellsField) {
for (int row = 0; row < currentGeneration.length; row++) {
for (int column = 0; column < currentGeneration[row].length; column++) {
JPanel cell = new JPanel();
cell.setBackground(currentGeneration[row][column] ? Color.BLACK : Color.WHITE);
cellsField.add(cell);
}
}
}
JButton buildButton(String text, String name) {
JButton button = new JButton();
button.setText(text);
button.setName(name);
button.setBounds(20, 10 , 40, 30);
return button;
}
JToggleButton buildButton1(String text, String name) {
JToggleButton button = new JToggleButton();
button.setText(text);
button.setName(name);
button.setBounds(20, 10 , 40, 30);
return button;
}
JLabel buildLabel(String text, String name) {
JLabel label = new JLabel();
label.setText(text);
label.setName(name);
label.setBounds(40, 20, 100, 30);
return label;
}
JPanel buildInfoPanel() {
JPanel infoPanel = new JPanel();
infoPanel.setBounds(40,150,220,70);
infoPanel.setLayout(new BoxLayout(infoPanel, BoxLayout.Y_AXIS));
return infoPanel;
}
JLabel buildGenerationLabel(String generationNumber) {
return buildLabel("Generation #" + generationNumber, "GenerationLabel");
}
JLabel buildAliveLabel(String aliveNumber) {
return buildLabel("Alive : " + aliveNumber, "AliveLabel");
}
JToggleButton buildJButoon(String name) {
return buildButton1("" + name, "PlayToggleButton");
}
void setStart(String name) {
start.setText(name);
}
void setGenerationLabel(String generationNumber) {
generationLabel.setText("Generation #" + generationNumber);
}
void setAliveLabel(String generationNumber) {
aliveLabel.setText("Alive : " + generationNumber);
}
public GameOfLife() throws InterruptedException {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setTitle("Game of Life");
setSize(500, 500);
setLayout(new BorderLayout());
generationLabel = buildGenerationLabel("1");
aliveLabel = buildAliveLabel("0");
start = buildJButoon("PlayToggleButton");
rerol = buildButton("ResetButton", "ResetButton");
boolean[][] ar = new boolean[20][20];
infoPanel = buildInfoPanel();
infoPanel.add(start);
infoPanel.add(rerol);
infoPanel.add(generationLabel);
infoPanel.add(aliveLabel);
add(infoPanel, BorderLayout.WEST);
Universe universe = new Universe(20);
universe.play();
showCurrentGeneration(ar);
setVisible(true);
for (int i = 0; i < 20; i++) {
universe.getGeneration(i);
setGenerationLabel(universe.generation + "");
setAliveLabel(universe.alive + "");
start.addActionListener(e -> {
setStart("start");
});
showCurrentGeneration(universe.arr);
setVisible(true);
}
}
}
| [
"[email protected]"
] | |
49e9500a842af54c37623b295070cd1cab02cd71 | 627506a447837908f3f512a36a1f2958bbe74c0a | /spring-boot-04-web-restfulcrud/src/main/java/com/atguigu/springboot/SpringBoot04WebRestfulcrudApplication.java | e82ee303c19aa846e49f5fde3f548bc4fe9e9464 | [] | no_license | nangongpushe/springboot | e10b18a60179853e0a03c2a12bdb7936ecd91074 | 77933e31d301031baecdb4ad782ee9c71965b47f | refs/heads/master | 2022-06-23T07:09:46.723455 | 2019-11-22T16:33:26 | 2019-11-22T16:33:26 | 223,442,435 | 0 | 0 | null | 2022-06-21T02:17:54 | 2019-11-22T16:24:46 | HTML | UTF-8 | Java | false | false | 1,373 | java | package com.atguigu.springboot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;
import java.util.Locale;
@SpringBootApplication
public class SpringBoot04WebRestfulcrudApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBoot04WebRestfulcrudApplication.class, args);
}
/**
* 访问当前项目的任何资源(静态资源的文件夹)
* classpath:/META-INF/resources/
* classpath:/resources/
* classpath:/static/
* classpath:/public/
* "/":当前项目的根路径
*
* localhost:8080/abc === 去静态资源文件夹里面找abc
* 欢迎页:态资源文件夹下的所有index.html页面;都被"/**"映射
* localhost:8080/ 找index页面
*
*
*/
//所有的**/favicon.ico都是在静态资源文件夹下面找
@Bean
public ViewResolver myViewResolver(){
return new MyViewResolver();
}
private static class MyViewResolver implements ViewResolver{
@Override
public View resolveViewName(String s, Locale locale) throws Exception {
return null;
}
}
}
| [
"[email protected]"
] | |
23861a69483572e4792927e4de9bdab5ea19ba55 | 077aee9e809bd85340ca17e1c9b7f3514bdd1d38 | /src/immunehistory/TestController.java | 7be95ce4b77d5c843913b903d7bc2fcbbff66f83 | [] | no_license | astro05/ImmuneHistory | f357186ad0c590dad1335b11af154d04f881d389 | 20dc98721744bffc8a8fb2e98929dfab99c6991e | refs/heads/main | 2023-06-01T03:08:07.313004 | 2021-06-10T04:26:47 | 2021-06-10T04:26:47 | 375,450,707 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 575 | 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 immunehistory;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.Initializable;
/**
* FXML Controller class
*
* @author joyultimates
*/
public class TestController implements Initializable {
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
}
| [
"[email protected]"
] | |
d4ea191cd2cd0dad60742d3f6893d16dfa5921ed | b45f346d6e59bb86b9f0a30ab650b89468170305 | /51CTO/04/microservice-simple-provider-user/src/main/java/com/itmuch/cloud/microservicesimpleprovideruser/entity/User.java | 6b45ca20862cc5d1880eb745c7339af48a0299c9 | [] | no_license | shendejun/springcloud | 2c123fb46afa69707874316d08ba875737348f39 | b445eee32378e014903c5f35dd79287d976c9f8f | refs/heads/master | 2020-07-07T00:43:29.538578 | 2019-12-16T09:27:16 | 2019-12-16T09:27:16 | 203,189,336 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,066 | java | package com.itmuch.cloud.microservicesimpleprovideruser.entity;
import javax.persistence.*;
import java.math.BigDecimal;
@Entity
public class User{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column
private String username;
@Column
private String name;
@Column
private Short age;
@Column
private BigDecimal balance;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Short getAge() {
return age;
}
public void setAge(Short age) {
this.age = age;
}
public BigDecimal getBalance() {
return balance;
}
public void setBalance(BigDecimal balance) {
this.balance = balance;
}
}
| [
"[email protected]"
] | |
9f069e41065c0c1ebbf9fb71310f5f2bc4eedce1 | c98eaf2a59e39bc83bcf17e5c6dadbde4e9ee340 | /common_lib/src/main/java/com/leap/common_lib/crash/QuitUnexitCrash.java | 6575fd9065aa8b3c9597762011dbe8bd6549a031 | [] | no_license | wj1203/latte | 8a21b6948d7ad4c9fea5045de6c03728e3410e25 | ba763b4ba6e802e37a5ba5a452e3c680af72d4f2 | refs/heads/master | 2021-07-07T07:15:06.032342 | 2020-12-03T14:55:35 | 2020-12-03T14:55:35 | 207,770,507 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.leap.common_lib.crash;
/**
* <p>退出自动捕获异常</p>
*
* @author zhh
* @version 1.0
* @creation 2018/5/8 8:59
* @see QuitUnexitCrash
* @since Android API 25
*/
final class QuitUnexitCrash extends RuntimeException {
public QuitUnexitCrash(String message) {
super(message);
}
}
| [
"[email protected]"
] | |
51673a81bec60f81cba0a41489861ae636b08113 | 4b2c4c5fae8bc1ac9b0e36a8d5fbeaae0ca3aeed | /src/main/java/org/destiny/jvm/model/command/ByteCodeCmd.java | 2f637550855cd5145db0fa1b45906cc755936b32 | [] | no_license | Language-Research/mini-jvm-1 | 1bb8ed067b2a1ec935209ef6d908d8ea169dcea5 | 9baed874b323ef98c8f86db480db946a09a3a0a5 | refs/heads/master | 2022-11-24T06:52:52.699385 | 2019-02-15T10:52:03 | 2019-02-15T10:52:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 822 | java | package org.destiny.jvm.model.command;
import org.destiny.jvm.model.runtime.ExecutionResult;
import org.destiny.jvm.model.runtime.StackFrame;
/**
* @author 王康
* [email protected]
* ------------------------------------------------------------------
* <p></p>
* ------------------------------------------------------------------
* Corpright 2017 Destiny, Org. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
* @version JDK 1.8.0_101
* @since 2017/8/22 16:38
*/
public abstract class ByteCodeCmd {
private int offset;
public int getOffset() {
return offset;
}
public void setOffset(int offset) {
this.offset = offset;
}
abstract void execute(StackFrame stackFrame, ExecutionResult result);
abstract int getLength();
}
| [
"[email protected]"
] | |
539e29021f4a0c1ce49f6c529fd3f96b717fad71 | 95a7a2f5fa456b5375901f856e5721f804dd3470 | /chap03/src/chap03_01/Main.java | 9844496d9f4486adf04355c268ddd36fd560020d | [] | no_license | ichiro03249/workspace2 | 1983f6b61e91a31543f1af72aa217c12762f944e | 3e3ec2f59677f0b9b5f52e891411ae8f09f035b7 | refs/heads/main | 2023-03-18T22:32:11.111624 | 2021-03-16T05:12:43 | 2021-03-16T05:12:43 | 348,216,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package chap03_01;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
boolean tenki = false;
if(tenki == true) {
System.out.println("洗濯そします");
System.out.println("散歩に行きます");
}
else {
System.out.println("DVDを見ます");
}
}
}
| [
"[email protected]"
] | |
fa3d106adc14923f6d0abf74c17581221fdb614b | b155d0f41fbda883878598dd8e5c41dbe27524ab | /iuriMorari/src/main/java/AdminUser.java | 6328b1320f5f28b530c07ab223c113b1a1066d68 | [] | no_license | asecu/Edition_1_SOA | 2fb6c556fb449a158435fb6920facc0249c71fee | 9d03670c16799d458b7ae1d5978fa629c79a1200 | refs/heads/master | 2021-04-16T16:47:44.705108 | 2020-04-24T10:28:51 | 2020-05-03T16:08:17 | 249,370,977 | 0 | 1 | null | 2020-10-13T21:22:47 | 2020-03-23T08:09:40 | Java | UTF-8 | Java | false | false | 476 | java | import java.util.Map;
public class AdminUser extends AbstractUser {
public AdminUser(String username, Map<String, Address> addresses) {
super(username, addresses);
}
public void approveOrder(AbstractOrder abstractOrder) {
System.out.println("Order " + abstractOrder.getID() + " is approved");
}
public void rejectOrder(AbstractOrder abstractOrder) {
System.out.println("Order " + abstractOrder.getID() + " is rejected");
}
}
| [
"[email protected]"
] | |
ef22a136e080e6d932aacad0a3897f926f4eaea5 | df02b56e9438c87559cce458d7c0b756665c5696 | /src/NestedTwo.java | d2ade50b06265c65a877dd8569c81827cd193f8a | [] | no_license | btes0384/vivek02 | 7082af50ff2da60c11a21a228f6383afa0a39607 | a5e9992d247206d6fd164e58cd5a46c307d720f5 | refs/heads/master | 2021-04-28T09:44:22.252087 | 2018-02-19T10:47:03 | 2018-02-19T10:47:03 | 122,049,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 249 | java |
public class NestedTwo {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i=1;i<=5;i++)
{
for(int j=5;j>=i;j--)
{
System.out.print(j );
}
System.out.println();
}
}
}
| [
"[email protected]"
] | |
96d1968baf1afe899b6fe206dc27d21a74d9476e | d514bead313f1bc272a52f7440437a69ad44d77b | /app/src/main/java/com/guozhe/android/http/login/login/login/model/IUser.java | 98550230a2d9a96b300234b4b18b1b506a6d4f97 | [] | no_license | KwakIron/LoginMVP | 24de2724761a4d1db51f8e99acf67a84a0761a5e | 6a06fd16c35a2e5aa35fd6b6ce15223ed5918581 | refs/heads/master | 2021-07-14T10:03:23.499486 | 2017-10-07T11:42:49 | 2017-10-07T11:42:49 | 106,093,312 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package com.guozhe.android.http.login.login.login.model;
/**
* Created by guozhe on 2017. 10. 5..
*/
public interface IUser {
String getName();
String getPasswd();
int checkUserValidity(String name, String passwd);
}
| [
"[email protected]"
] | |
c0e927bf78ede5fbddc308e064eec9f9434b2800 | e0ce3633c879b16e956c0bd1c7bab2f089aa6fb0 | /src/socket/msg/war/rsp/GuildWarEncourageInfoRsp.java | cc12bd129a6c95cd601131253483f21592399f9e | [] | no_license | minghuijiang/XwyCore | 3d9f7e48ab6e188b5384cc97bd83605d82f81a23 | 88a1d6ddd2180c84f3c2da5bcd9219fd1d198671 | refs/heads/master | 2021-01-10T06:42:44.364641 | 2016-02-01T15:40:40 | 2016-02-01T15:40:40 | 50,793,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,316 | java | package socket.msg.war.rsp;
import socket.util.ByteArray;
import socket.util.ReadUtils;
import socket.util.WritingBuffer;
import component.User;
public class GuildWarEncourageInfoRsp extends socket.msg.basic.Respond {
public int encourage;
public GuildWarEncourageInfoRsp(User user) {
super(user);
// TODO Auto-generated constructor stub
}
@Override
protected void readFromBuffer(ByteArray buff, int limit) {
int _loc_4 = 0;
int _loc_3 = 0;
while (buff.remaining() > limit) {
_loc_4 = ReadUtils.read$TYPE_UINT32(buff);
switch (_loc_4 >> 3) {
case 1: {
if (_loc_3 != 0) {
show("Bad data format: GuildWarEncourageInfoRsp.encourage cannot be set twice.");
}
_loc_3 = _loc_3 + 1;
this.encourage = ReadUtils.read$TYPE_INT32(buff);
break;
}
default:
error("unknown data", buff);
return;
}
}
}
@Override
protected void action() {
// TODO Auto-generated method stub
}
@Override
public void writeToBuffer(WritingBuffer buff) {
// TODO Auto-generated method stub
}
}
| [
"[email protected]"
] | |
6f3900fc477153e0a4ffa7018763d2e7f930f7f3 | 7fa1a19b8bd2e4c2ecd565f3728f90df71b76c0a | /src/main/java/codes/nttuan/controllers/common/ForbiddenHandler.java | 7391f657fe4bd68639da83eb31299e1b3eeb48dd | [] | no_license | ngthotuan/Java-News-Servlet | 2a253752a862ccc44790e9e15d6092a57a46cc14 | b219976bf435dab59ce98a9fdef18ae50d22545d | refs/heads/master | 2023-03-12T23:04:44.975637 | 2021-03-02T08:47:47 | 2021-03-02T08:47:47 | 294,657,376 | 0 | 0 | null | 2021-03-02T08:47:57 | 2020-09-11T09:53:44 | HTML | UTF-8 | Java | false | false | 598 | java | package codes.nttuan.controllers.common;
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 java.io.IOException;
@WebServlet(urlPatterns = {"/forbidden"})
public class ForbiddenHandler extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
request.getRequestDispatcher("/common/error_403.jsp").forward(request, response);
}
}
| [
"[email protected]"
] | |
5a46458ebe48c92d3c7f8a09b738c86004b5dd38 | 21a8e37f528013fa25751db10239c498eadebd83 | /src/CalcInterface.java | ba0ea1d542e8827ee1c67aae3fb85f74a0f9ba14 | [] | no_license | iainrwolfheart/tdd-calculator-interface-exercise | af96b1ab70458ff318f2356d78cae7ecb77c7996 | 5b666dd9d0939dfe5410d0a18450edc83c2aed5b | refs/heads/master | 2021-03-11T21:31:48.139864 | 2020-03-11T16:01:35 | 2020-03-11T16:01:35 | 246,560,767 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 212 | java |
public interface CalcInterface {
public int addFunction(int i, int j);
public int subtractFunction(int i, int j);
public int multiplyFunction(int i, int j);
public int divideFunction(int i, int j);
}
| [
"[email protected]"
] | |
7a2dadad85ac06e6ea701bc1d8c55b406b893eaf | 415728b3433766b31dd809e1f29e0594fd64eb7e | /DesignPatternAssignment/templatePattern/src/templatePattern/VillaHouse.java | 2535326d3a5fc10dddf669aa12bed8d4eccc4771 | [] | no_license | saurabhchalke/SpringAU18 | 6cfd01a85f9f2eb437a7f9f32e65a6d64d1350ad | 36c6b5128b73d029c62d6a58166a01c50e870984 | refs/heads/master | 2021-09-05T19:09:05.392728 | 2018-01-30T12:25:54 | 2018-01-30T12:25:54 | 117,103,225 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 587 | java | package templatePattern;
public class VillaHouse extends HomeDesigner {
@Override
public void designStructure() {
System.out.println("Design structure of villa");
}
@Override
public void designWalls() {
System.out.println("Design walls of villa");
}
@Override
public void designDoors() {
System.out.println("Design doors of villa");
}
@Override
public void designWindows() {
System.out.println("Design windows of villa");
}
@Override
public void designFurnishing() {
System.out.println("Design furnishing of villa");
}
}
| [
"[email protected]"
] | |
2fed36782a03e1605f7766c309e7ddc06983ef8d | e1b66aa38fe9ba1016d8618ab6f27e5d54694817 | /src/main/java/edu/dk/asj/dpm/ui/actions/EmptyResultSetAction.java | d9b1fb3ba1b42d618cb8c5d257eb8f7def6a26ae | [
"MIT"
] | permissive | denDAY04/thesis-code | a755034c8b3ae27eec646245e592422619db9c72 | b083480b4d7fd3f9c095c8f1a67df126c06c0b79 | refs/heads/master | 2021-08-28T06:30:54.933007 | 2019-12-19T18:59:47 | 2019-12-19T18:59:47 | 219,211,479 | 0 | 0 | MIT | 2021-08-15T14:35:02 | 2019-11-02T20:42:44 | Java | UTF-8 | Java | false | false | 332 | java | package edu.dk.asj.dpm.ui.actions;
/**
* Available UI actions when presenting empty result set.
*/
public enum EmptyResultSetAction {
Back("Go back");
private String name;
EmptyResultSetAction(String name) {
this.name = name;
}
@Override
public String toString() {
return name;
}
}
| [
"[email protected]"
] | |
271fdab94983f5087ff2e6bf37034b256363a272 | ab0429696a2b0365080a1e5cd4539da6bbfcc2ca | /src/com/cht/training/Main53.java | 95cf2323ed02dbd6ec9d6d2d97fd6c76b297efe5 | [] | no_license | dotswatt520/JavaLab0411 | 2dc9378a1536665e90b873731cd568a987fd1007 | 356dae947b601dc0441c065e5447943a2324a703 | refs/heads/master | 2020-05-07T21:44:24.473785 | 2019-04-19T09:22:21 | 2019-04-19T09:22:21 | 180,916,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,213 | java | package com.cht.training;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
public class Main53 {
public static void main(String[] args) {
List<String> items = new ArrayList<>();
items.add("ios");
items.add("android");
items.add("blackberry");
System.out.println("items="+items);
String[] itemsArray = {"iso","android","blackberry"};
System.out.println("[not so pretty]item array="+itemsArray);
System.out.println("[prettu]item array="+ Arrays.toString(itemsArray));
for (String item:items){
System.out.println("[L]item="+item);
}
for (String item:itemsArray){
System.out.println("[A]item"+item);
}
for (int i = 0 ;i< items.size();i++){
System.out.println("[L2]item"+items.get(i));
}
for (int i = 0 ;i< itemsArray.length;i++){
System.out.println("[A2]item"+itemsArray[i]);
}
for (Iterator<String> iterator = items.iterator();iterator.hasNext();){
String item=iterator.next();
System.out.println("using iterator,item="+item);
}
}
}
| [
"tzungje"
] | tzungje |
dea5b4978d7d42e5796212153f80ec8b454ba018 | 3fe1dd6c732bd5c0335c68facb5c7aade4cd149d | /src/main/java/com/qunar/qtalk/ss/sift/dao/CsrDao.java | 77513650847f6fb57974745cf0851f4a33d2cd24 | [
"MIT"
] | permissive | fengfengmalin/qchat_admin_open | 26614693792f1fce58f771231cb8beeb4ae69333 | 5d3e21d594c47e4dfa01772aa50419ffca0dc180 | refs/heads/master | 2020-04-26T16:55:43.439550 | 2019-08-26T09:08:28 | 2019-08-26T09:08:30 | 173,696,406 | 0 | 0 | MIT | 2019-03-04T07:36:26 | 2019-03-04T07:36:26 | null | UTF-8 | Java | false | false | 1,334 | java | package com.qunar.qtalk.ss.sift.dao;
import com.qunar.qchat.admin.model.Seat;
import com.qunar.qtalk.ss.sift.entity.CSR;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface CsrDao {
List<CSR> selectCsrsByCsrIDs(List<Long> seatIDs);
List<CSR> selectOnlineCsrsByShopID(@Param("shopId") long shopId, @Param("host") String host);
List<CSR> selectCsrsByShopIdWithoutCarName(@Param("shopId")long shopID, @Param("csrName")String csrName, @Param("host") String host);
List<CSR> selectCsrsByCsrName(@Param("qunarName")String qunarName, @Param("host") String host);
List<CSR> selectCsrsByGroupIDs(@Param("list")List<Long> list , @Param("host") String host);
List<CSR> selectCsrByCsrNameAndShopId(@Param("qunarName") String qunarName, @Param("shopId") long shopId, @Param("host") String host);
List<CSR> selectCsrsByCsrBusiIdAndHost(@Param("busiId") int busiId, @Param("host") String host);
int saveSeat(Seat seat);
int updateSeatByShopId(@Param("shopId")long shopId);
int updateSeatStatusByShopIdAndName(@Param("shopId")long shopId, @Param("qunarName") String qunarName);
List<CSR> selectCsrByCsrNameAndShopIdWithoutStatus(@Param("qunarName") String qunarName, @Param("shopId") long shopId);
}
| [
"[email protected]"
] | |
1832a50f4cce3836b74385fa95d1ee9ef5db93c8 | a1ce8ecf4301bef383733f0f103d09617a904cfb | /src/factory/simple_factory/ClamPizza.java | 6ebda8e2ff504e180b7773d4ca9f42a6da4236b4 | [] | no_license | berzing/design_patterns | f307c99bf41f2df5a30eb88fd634c12ecfbb7669 | f5552e0e768479fccc8ad534649ca19eded5df64 | refs/heads/master | 2020-03-14T09:57:12.428000 | 2018-06-17T08:52:54 | 2018-06-17T08:52:54 | 131,555,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package factory.simple_factory;
/**
* 蛤蜊比萨
*/
public class ClamPizza extends Pizza {
public ClamPizza() {
name = "Clam Pizza";
dough = "Thin Crust";//薄皮
sauce = "White garlic sauce";//大蒜酱
toppings.add("Clams");//蛤蜊
toppings.add("Grated parmesan cheese");//碎parmesan芝士
}
}
| [
"[email protected]"
] | |
a2b64ad010621a35b644926545313ae3d14f905d | d1c2764c40eacb3b3b6c7985f617e066f0094fc4 | /src/test/java/co/com/choucair/certification/proyectbase/runners/RunnerTags.java | 2e5830fd02b98aff9efd84f7abeea18fac8e092b | [] | no_license | Leyston/ChoucairPruebaTecnica | b8f6be298321e892c3465ae406c5e9d6025fcc99 | e4adedeae84b37d291b669efcdbcb4456338be34 | refs/heads/main | 2023-02-28T20:55:17.416060 | 2021-02-08T15:20:42 | 2021-02-08T15:20:42 | 336,319,718 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 626 | java | package co.com.choucair.certification.proyectbase.runners;
import io.cucumber.junit.CucumberOptions;
import net.serenitybdd.cucumber.CucumberWithSerenity;
import org.junit.runner.RunWith;
@RunWith(CucumberWithSerenity.class)
@CucumberOptions(features = "src/test/resources/features/academyChoucair.feature",
tags = "@stories",
glue = {"co.com.choucair.certification.proyectbase.stepdefinitions",
"co.com.choucair.certification.proyectbase.model"},
snippets = CucumberOptions.SnippetType.CAMELCASE)
public class RunnerTags {
}
| [
"[email protected]"
] | |
736f8d60282f62c12960556717e02a0a132a868b | 07b620487755715b1ef688966640643c5e630c01 | /library/src/main/java/com/pengrad/telegrambot/request/UnpinAllChatMessages.java | adf2d725f82578ab20c967a551015be1cc61b8a5 | [
"Apache-2.0"
] | permissive | pengrad/java-telegram-bot-api | 71f1c02b75036e0ede42d147043a80d9f4fd54ab | 6e5fa4a6298cdfd613ef6bb02cbe6b039b08c3a9 | refs/heads/master | 2023-09-01T22:01:58.459608 | 2023-08-27T17:07:01 | 2023-08-27T17:07:01 | 40,182,023 | 1,792 | 456 | Apache-2.0 | 2023-08-27T14:58:01 | 2015-08-04T11:58:56 | Java | UTF-8 | Java | false | false | 358 | java | package com.pengrad.telegrambot.request;
import com.pengrad.telegrambot.response.BaseResponse;
/**
* Stas Parshin
* 05 November 2020
*/
public class UnpinAllChatMessages extends BaseRequest<UnpinAllChatMessages, BaseResponse> {
public UnpinAllChatMessages(Object chatId) {
super(BaseResponse.class);
add("chat_id", chatId);
}
}
| [
"[email protected]"
] | |
a397058a0620343e0428e2fa79f291c2693dd1dd | 4f42079d9303a9638ec6567d79bb6a4e5591790a | /Java_Core_lesson-04/src/ua/lviv/lgs/task2/Body.java | c196f9ac252c4acc808590a1781374ac0e734003 | [] | no_license | Splash001/Java_Core_lesson-4 | b4fcc66cbc74619644eae1c6b2e421eef871be3f | 1692fa9f21f2104e504f0300ea256376e955897b | refs/heads/master | 2020-07-07T15:36:56.995457 | 2019-08-20T14:23:10 | 2019-08-20T14:23:10 | 203,391,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 882 | java | package ua.lviv.lgs.task2;
public class Body {
private int amountYear;
private String color;
private int weight;
public Body(int amountYear, String color, int weight) {
this.amountYear = amountYear;
this.color = color;
this.weight = weight;
}
private int getAmountYear() {
return amountYear;
}
private void setAmountYear(int amountYear) {
this.amountYear = amountYear;
}
private String getColor() {
return color;
}
private void setColor(String color) {
this.color = color;
}
private int getWeight() {
return weight;
}
private void setWeight(int weight) {
this.weight = weight;
}
public int increaseBody() {
return weight = weight - 10;
}
@Override
public String toString() {
return "Body [amountYear=" + amountYear + ", color=" + color + ", weight=" + weight + "]";
}
}
| [
"[email protected]"
] | |
81b325d5fbafd3e4faa8b456f1a5720a9b92949e | 08e39005b52852435c53fadd0a9adcf89690e93c | /Analyzer.java | 91a2a2b43808766fb38bea6fb822cb0c084f77b9 | [] | no_license | irshadbhat/Network_traffic_monitor | 8f1310c63f2007009673ff91c0f521fbb43baf06 | a79858467867546b2a96eee811322f01a738920b | refs/heads/master | 2021-01-18T09:12:18.098974 | 2014-03-09T00:12:23 | 2014-03-09T00:12:23 | 42,264,728 | 1 | 0 | null | 2015-09-10T19:05:23 | 2015-09-10T19:05:23 | null | UTF-8 | Java | false | false | 2,328 | java | import java.io.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import jpcap.*;
import jpcap.packet.*;
import java.awt.*;
import java.awt.event.AWTEventListener.*;
import javax.swing.*;
public class Analyzer extends JFrame
{
ArrayList<Packet> ar=new ArrayList();
float p,p2,p3,p4,p5;
Packet pkt;
float c,c1,c2,c3,c4,c5;
panel pn;
int k;
public Analyzer(ArrayList<Packet> ar)
{
setLayout(null);
this.ar =ar;
panel pn=new panel();
pn.setBounds(100,100,500,600);
add(pn);
setVisible(true);
setSize(500,500);
for(k=0;k<ar.size()-1;k++)
{
pkt =ar.get(k) ;
c++;
if(pkt instanceof UDPPacket)
{
c1++;
}
else if(pkt instanceof ARPPacket)
{
c3++;
}
else if(pkt instanceof ICMPPacket)
{
c2++;
}
else if(pkt instanceof TCPPacket)
{
c4++;
}
else
c5++;
}
p=(c1*100)/c;
p2=(c2*100)/c;
p3=(c3*100)/c;
p4=(c4*100)/c;
p5=(c5*100)/c;
}
class panel extends JPanel
{
public void paint(Graphics g)
{
g.setColor(Color.LIGHT_GRAY);
g.fillRect(100,100,500,500);
g.setColor(Color.BLACK);
g.drawLine(100,400,500,400);
g.drawString("UDP",120,420);
g.drawString("ICMP",190,420);
g.drawString("ARP",280,420);
g.drawString("TCP",360,420);
g.drawString("OTHERS",420,420);
g.setColor(Color.red);
g.fillRect(100,400-(int)p,60,(int)p);
g.setColor(Color.BLUE);
g.fillRect(180,400-(int)p2,60,(int)p2);
g.setColor(Color.green);
g.fillRect(260,400-(int)p3,60,(int)p3);
g.setColor(Color.MAGENTA);
g.fillRect(340,400-(int)p4,60,(int)p4);
g.setColor(Color.YELLOW);
g.fillRect(420,400-(int)p5,60,(int)p5);
}
}
public static void main(String args[])
{
}
}
| [
"[email protected]"
] | |
1d02a35964e9cad63ffc320966e9f59ffe54c92a | 4df9f131404c4e3100040f651a571b998ea206b4 | /test22/src/main/java/com/min/www/util/TimeUtil.java | caaac878aece7e9db4e1c607415b0e7dc08814c9 | [] | no_license | DaeAkin/WebPj | efdd35411b77bcda04fedd2e552bb37f86efff2a | 27fd8eac627d2c0e3cdb609407db47a930299d15 | refs/heads/master | 2020-03-11T09:59:56.092617 | 2018-05-26T01:01:47 | 2018-05-26T01:01:47 | 129,928,917 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,253 | java | package com.min.www.util;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.min.www.Service.BoardService;
import com.min.www.dao.BoardDao;
import com.min.www.dto.BoardDto;
import com.min.www.dto.BoardReplyDto;
import com.mysql.fabric.xmlrpc.base.Data;
/*
*
* 시간에 관련된 클래스
*
*
*
System.out.println("연도만 :" +currentTime.substring(0, 4));
System.out.println("월만 :" +currentTime.substring(5, 7));
System.out.println("일만 :" +currentTime.substring(8, 10));
System.out.println("시간만 :" +currentTime.substring(11, 13));
System.out.println("분만 :" +currentTime.substring(14, 16));
System.out.println("초만 :" +currentTime.substring(17, 19));
*/
@Service
public class TimeUtil {
/*
* 게시물 시간 출력 함수 만약 오늘 날짜면 시간만 출력 된다. 오늘 날짜가 아니면 날짜만 출력 되기.
*
*/
public static List<BoardDto> TimeUtilChanger(List<BoardDto> resultDto) {
System.out.println("시간 씻기기.");
// 시간 가져오기.
Data data = new Data();
SimpleDateFormat dataFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
String today = getToday();
// mysql 게시물 오늘날짜이면 시간으로 표시, 아니면 날짜로만 표시.
for (int i = 0; i < resultDto.size(); i++) {
if (resultDto.get(i).getWritertime().substring(0, 10).equals(today)) {
System.out.println("시간 변환.");
resultDto.get(i).setWritertime(resultDto.get(i).getWritertime().substring(11, 16));
} else {
resultDto.get(i).setWritertime(resultDto.get(i).getWritertime().substring(5, 10));
}
}
/*
* while(itrresultDto.hasNext()){
* System.out.println(itrresultDto.next().getWritertime().substring(0,
* 10).equals(today)); if(itrresultDto.next().getWritertime().substring(0,
* 10).equals(today)) { //만약 게시글이 오늘 날짜에 쓰어진거라면.
* itrresultDto.next().setWritertime(
* itrresultDto.next().getWritertime().substring(11, 16));
* System.out.println("오늘 날자의 게시물 날짜 " + itrresultDto.next().getWritertime());
*
* System.out.println(itrresultDto.next().getWritertime());
* System.out.println("시간 변환작업완료!!"); }else { itrresultDto.next().setWritertime(
* itrresultDto.next().getWritertime().substring(5, 10)); }
*
* }
*/
return resultDto;
}
// 현재날짜 가져오기.
public static String getToday() {
Date today = new Date();
SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String currentTime = time.format(today);
System.out.println("현재 시간 : " + currentTime);
System.out.println(" DB 조회를 위해 자를 시간 :" + currentTime.substring(0, 10));
currentTime = currentTime.substring(0, 10);
return currentTime;
}
/*
* 현재 년도,월,일,시간,분,초 가져옴.
*/
public static String getCurrentTime() {
Date today = new Date();
SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String currentTime = time.format(today);
return currentTime;
}
/*
* http://blog.naver.com/PostView.nhn?blogId=minilove717&logNo=220686303157&
* parentCategoryNo=&categoryNo=28&viewDate=&isShowPopularPosts=false&from=
* postView
*/
/*
* 댓글 실시간 알림을 위한 시간메소드 .
*
*/
public static int timeComparison(Map<String, Object> paramMap,List<BoardReplyDto> boardReplyDtos) {
// boolean yearFlag = false;
// boolean monthFlag = false;
// boolean dateFlag = false;
// boolean timeFlag = false;
// boolean minuteFlag = false;
// boolean secondFlag = false;
try {
System.out.println("###### timeComparision() #######");
//로그아웃한 시간이 들어갈것임.
String currentTIme = getCurrentTime();
// 게시물 댓글 dto 가쟈오고 ,
int count =boardReplyDtos.size();
System.out.println("까운트 ? :" +count);
// 로그아웃한 시점의시간을 가져오기 지금은 테스트용 변수 넣음.
String logoutDateTime = "2018-02-03 13:01:01";
// 시간을 잘라서 비교하기 .
//현재 시간
int year = Integer.parseInt(currentTIme.substring(0, 4));
int month = Integer.parseInt(currentTIme.substring(5, 7));
int date = Integer.parseInt(currentTIme.substring(8, 10));
int time = Integer.parseInt(currentTIme.substring(11, 13));
int minute = Integer.parseInt(currentTIme.substring(14, 16));
int second = Integer.parseInt(currentTIme.substring(17, 19));
// 로그아웃한 시간
int pYear = Integer.parseInt(logoutDateTime.substring(0, 4));
int pMonth = Integer.parseInt(logoutDateTime.substring(5, 7));
int pDate = Integer.parseInt(logoutDateTime.substring(8, 10));
int pTime = Integer.parseInt(logoutDateTime.substring(11, 13));
int pMinute = Integer.parseInt(logoutDateTime.substring(14, 16));
int pSecond = Integer.parseInt(logoutDateTime.substring(17, 19));
/*
*
*
* for문을 통해서 List에서 한개씩 지우는 것보다
* 새로운 List에서 넣어주는게 더 빠를듯 하다.
*
*/
List<BoardReplyDto> newReplyDto = new ArrayList<>();
for(int i=0; i<count; i++) {
System.out.println("for문 동작");
Date regDate = boardReplyDtos.get(i).getRegister_datetime();
System.out.println("######### regDate출력 ##########");
System.out.println(boardReplyDtos.get(i).getRegister_datetime());
System.out.println("######### regDate 끝 ##########");
SimpleDateFormat time1 = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String dbRegDate = time1.format(regDate);
year = Integer.parseInt(dbRegDate.substring(0, 4));
month = Integer.parseInt(dbRegDate.substring(5, 7));
date = Integer.parseInt(dbRegDate.substring(8, 10));
time = Integer.parseInt(dbRegDate.substring(11, 13));
minute = Integer.parseInt(dbRegDate.substring(14, 16));
second = Integer.parseInt(dbRegDate.substring(17, 19));
System.out.println("ㅇㄷ?");
if(year>pYear || month>pMonth || date>pDate || time>pTime || minute>pMinute || second>pSecond ) {
newReplyDto.add(boardReplyDtos.get(i));
}
// if(month>pMonth) {
// newReplyDto.add(boardReplyDtos.get(i));
// break;
// }
// if(date>pDate) {
// newReplyDto.add(boardReplyDtos.get(i));
// break;
// }
// if(time>pTime) {
// newReplyDto.add(boardReplyDtos.get(i));
// break;
// }
// if(minute>pMinute) {
// newReplyDto.add(boardReplyDtos.get(i));
// break;
// }
// if(second>pSecond) {
// newReplyDto.add(boardReplyDtos.get(i));
// break;
// }
}
int result = newReplyDto.size(); // 새로운 알림 갯수.
System.out.println("새로운 알림 갯수 : " + result);
for(int i=0; i<newReplyDto.size(); i++) {
System.out.print(newReplyDto.get(i).getRegister_datetime());
}
return result;
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
return 0;
}
}
}
| [
"[email protected]"
] | |
19a06c360d58f3a8a949572221c43454c320556e | 6d33782746fce0da16b0707e11676ac4a16274ca | /mybatis01/src/test/java/com/feng/mybatis/service/GroupServiceTest.java | c53b2a0a3cafab203c60cad530e3b3d0ddcb2d17 | [] | no_license | bradypod1990/mybatis | 1d2397812390f3dc92394b3049dab539d3f344bf | e37e12e114d4b110205841ee3cbc487b32279b42 | refs/heads/master | 2016-08-11T20:03:37.036603 | 2016-03-29T02:29:55 | 2016-03-29T02:29:55 | 48,464,377 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,081 | java | package com.feng.mybatis.service;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Transactional;
import com.feng.mybatis.model.Group;
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional
@ContextConfiguration(locations={"classpath:spring-mybatis.xml"})
@TransactionConfiguration(transactionManager="transactionManager",defaultRollback=false)
public class GroupServiceTest {
@Autowired
private GroupService groupService;
@Test
public void testFindAll() {
List<Group> list = groupService.findAll();
if(list != null) {
for(Group group : list) {
System.out.println(group.getId() + ", name:" + group.getName() + ":students:" + group.getListStudent());
}
}
}
}
| [
"[email protected]"
] | |
b90f23a7f590b51649f83a528264a1bdf1a03948 | a1a0112148784cad0edb2853ad342b16498ed01f | /HelloWorld.java | 743a92763a9670a8691f90199b7ea21071a2afb1 | [
"Apache-2.0"
] | permissive | tackline/hello-world | efb49d10edecaf93aa52f30d259af3f734875d4f | dd6586fc83df2fc83b6885628fbd973f79677e0d | refs/heads/master | 2020-03-30T19:50:33.741134 | 2018-10-04T11:43:10 | 2018-10-04T11:43:10 | 151,561,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,512 | java | /*
Copyright 2018 Thomas Hawtin
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
*/
interface HelloWorld {
static void main(String[] args) {
System.out.println("hello, world!");
}
}
| [
"[email protected]"
] | |
55a057bbbe7ecd8bec011ff1dd94ea388f1c7a4b | 52ee4484597e6d33a9b58240693b1b688a05433c | /Java/Hackerrank Homework/src/Solution.java | af37b318d984080af256a7f87260979a5db0e823 | [] | no_license | rizkiprayoga/Programming-Journey | b78a8507f4f4e3bd92f075396d36d819cb914bb2 | 63f90f85eaa5b7ca0376365654616b6cf76dcc69 | refs/heads/master | 2021-01-17T08:15:07.896489 | 2016-08-18T06:09:51 | 2016-08-18T06:09:51 | 64,098,046 | 0 | 0 | null | 2016-07-31T14:00:52 | 2016-07-25T02:37:22 | Java | UTF-8 | Java | false | false | 801 | java |
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt() % 11;
String[] s = new String[T];
for ( int i = 0; i < T; i++ ){
s[i] = scanner.next();
}
for ( int x = 0; x < T; x++){
for ( int y = 0; y < s[x].length(); y = y + 2){
System.out.print(s[x].charAt(y));
}
System.out.print(" ");
for ( int y = 1; y < s[x].length(); y = y + 2){
System.out.print(s[x].charAt(y));
}
System.out.println();
}
scanner.close();
}
}
| [
"[email protected]"
] | |
5fbce324a22cb55338b40a0968cf507808f7b1dc | 572793f845166c034723db28505d360383e49fab | /service-a/src/main/java/com/example/servicea/dto/PersonDto.java | da8162fb10f440ad7065200cd49fdffd3a0a53eb | [] | no_license | ok213/spring-jaeger | 8d717c00bdc39750dc9257519c2b43ddc740c54c | 25515b7815435de20036a97825ca0dde6821680f | refs/heads/master | 2022-07-02T02:19:59.955747 | 2020-05-08T09:02:15 | 2020-05-08T09:02:15 | 262,275,727 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 654 | java | package com.example.servicea.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class PersonDto implements Serializable {
private Long personId;
private String firstName;
private String lastName;
private String email;
// public Person( String firstName, String lastName, String email) {
// this.firstName = firstName;
// this.lastName = lastName;
// this.email = email;
// }
}
| [
"[email protected]"
] | |
b129513535cfbfa4c759d6fa9fd6965615cd5bee | 3c3ab0c6317c058bd27d2c47a73dd2c485eeba65 | /gevat/test/test/models/ProteinTest.java | ae7926587cf4cabbb6787fce1eddf9979fa98d09 | [] | no_license | wjglerum/programminglife | 2529d00dd76db8b8cc9705d6a00a4d449e2cdd6b | 840046002663cf11c4295121260fd62f6e5b7257 | refs/heads/master | 2022-10-14T13:55:01.439725 | 2014-06-26T18:36:04 | 2014-06-26T18:36:04 | 34,052,029 | 0 | 0 | null | 2022-09-22T19:26:12 | 2015-04-16T11:30:20 | Perl | UTF-8 | Java | false | false | 1,971 | java | package test.models;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.sql.SQLException;
import java.util.ArrayList;
import models.protein.Protein;
import models.protein.ProteinRepository;
import models.protein.ProteinService;
import org.junit.Before;
import org.junit.Test;
public class ProteinTest {
private Protein p;
private final String name = "name";
private final String disease = "disease";
private final ProteinRepository repositoryMock = mock(ProteinRepository.class);
private final ProteinService proteinService = new ProteinService(
repositoryMock);
@Before
public void setUp() {
ArrayList<String> list = new ArrayList<String>();
list.add(disease);
p = new Protein(name, list);
}
/**
* Tests the constructor of protein.
*/
@Test
public void testConstructor() {
assertEquals(name, p.getName());
assertEquals(disease, p.getDisease());
}
/**
* Tests the equals function of protein.
*/
@Test
public void testEquals() {
ArrayList<String> list = new ArrayList<String>();
Protein p = new Protein("name", list);
Protein p2 = new Protein("name", list);
Protein q = new Protein("othername", list);
assertTrue(p.equals(p));
assertTrue(p.equals(p2));
assertFalse(p.equals(q));
assertTrue(p.equals("name"));
assertFalse(p.equals("othername"));
assertFalse(p.equals(0));
}
@Test
public void testAddConnection() {
// TODO
}
@Test
public void testHasConnection() {
// TODO
}
@Test
public void testGetAnnotations() throws SQLException {
String annotation = "annotation";
when(repositoryMock.getAnnotations(name)).thenReturn(annotation);
String res = proteinService.getAnnotations(name);
assertEquals(res, annotation);
verify(repositoryMock).getAnnotations(name);
}
}
| [
"[email protected]"
] | |
e03f9cc05874d7e2e0c7506223a2a138d0b1b907 | 56e2c1151ef27210b3ba16fcb6a6bddb591ed179 | /src/de/sgoral/darkestalmanac/data/dataobjects/Experiment.java | c66d5d4e7c00fc7b7530e5d24536c7d2ba422bc8 | [] | no_license | Elge/DarkestAlmanac | aee65356874440344b7e7909be592e50661b38e8 | a585c6a924cfabf46d274110865942dfd8afae6e | refs/heads/master | 2020-12-02T08:08:10.132132 | 2017-08-04T07:24:50 | 2017-08-04T07:24:50 | 96,772,655 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,524 | java | package de.sgoral.darkestalmanac.data.dataobjects;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* An experiment is the action of using a consumable (or none at all) on a curio to see what happens.
*/
public class Experiment implements Serializable {
private Integer id;
private int consumableId;
private transient Consumable consumable;
private List<Result> results = new ArrayList<>();
public Experiment(int id, Consumable consumable) {
this(id, consumable, null);
}
public Experiment(int id, Result result) {
this(id, null, result);
}
public Experiment(int id, Consumable consumable, Result result) {
this.id = id;
this.consumable = consumable;
this.results.add(result);
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getConsumableId() {
return consumableId;
}
public void setConsumableId(int consumableId) {
this.consumableId = consumableId;
}
public Consumable getConsumable() {
return consumable;
}
public void setConsumable(Consumable consumable) {
this.consumable = consumable;
}
public List<Result> getResults() {
return results;
}
public void setResults(List<Result> results) {
this.results = results;
}
public boolean addResult(Result result) {
return this.results.add(result);
}
}
| [
"[email protected]"
] | |
310d604023cfbab84d6591d87f8ccd096d1e9077 | e4407fd351449857fc3ff9c932f7eca3f839a9ec | /myjingdong/src/main/java/bwei/com/myjd/mvp/presenter/LoginActivitysPresenter.java | a65fc7b8fab4adaf853963b0341bf1ee459bcff8 | [] | no_license | xuewei666/- | fb4ecca781d37e4cbc7f76a68e55b34faf00f672 | 88fb4190f0cd5cffee24ff28869d828547852acf | refs/heads/master | 2020-03-29T16:07:56.711100 | 2018-09-24T12:37:43 | 2018-09-24T12:37:43 | 150,098,970 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,823 | java | package bwei.com.myjd.mvp.presenter;
import android.app.Application;
import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.http.imageloader.ImageLoader;
import java.util.Map;
import bwei.com.myjd.mvp.data.LoginBean;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import javax.inject.Inject;
import bwei.com.myjd.mvp.contract.LoginActivitysContract;
@ActivityScope
public class LoginActivitysPresenter extends BasePresenter<LoginActivitysContract.Model, LoginActivitysContract.View> {
@Inject
RxErrorHandler mErrorHandler;
@Inject
Application mApplication;
@Inject
ImageLoader mImageLoader;
@Inject
AppManager mAppManager;
@Inject
public LoginActivitysPresenter(LoginActivitysContract.Model model, LoginActivitysContract.View rootView) {
super(model, rootView);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mErrorHandler = null;
this.mAppManager = null;
this.mImageLoader = null;
this.mApplication = null;
}
public void getData(Map<String, String> map){
Observable<LoginBean> observable = mModel.getLoginData(map);
observable.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<LoginBean>() {
@Override
public void accept(LoginBean loginBean) throws Exception {
mRootView.responseLoginData(loginBean);
}
});
}
}
| [
"[email protected]"
] | |
78a840b5971f6fce3ed4e1f95a7db16c415d3e82 | 129f58086770fc74c171e9c1edfd63b4257210f3 | /src/testcases/CWE83_XSS_Attribute/CWE83_XSS_Attribute__Servlet_File_54c.java | 89557b3dcccbed16fa02bc150136782f11b0a34d | [] | no_license | glopezGitHub/Android23 | 1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba | 6215d0684c4fbdc7217ccfbedfccfca69824cc5e | refs/heads/master | 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 | Java | UTF-8 | Java | false | false | 1,440 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE83_XSS_Attribute__Servlet_File_54c.java
Label Definition File: CWE83_XSS_Attribute__Servlet.label.xml
Template File: sources-sink-54c.tmpl.java
*/
/*
* @description
* CWE: 83 Cross Site Scripting (XSS) in attributes; Examples(replace QUOTE with an actual double quote): ?img_loc=http://www.google.comQUOTE%20onerror=QUOTEalert(1) and ?img_loc=http://www.google.comQUOTE%20onerror=QUOTEjavascript:alert(1)
* BadSource: File Read data from file (named c:\data.txt)
* GoodSource: A hardcoded string
* Sinks: printlnServlet
* BadSink : XSS in img src attribute
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
package testcases.CWE83_XSS_Attribute;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE83_XSS_Attribute__Servlet_File_54c
{
public void bad_sink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
(new CWE83_XSS_Attribute__Servlet_File_54d()).bad_sink(data , request, response);
}
/* goodG2B() - use goodsource and badsink */
public void goodG2B_sink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable
{
(new CWE83_XSS_Attribute__Servlet_File_54d()).goodG2B_sink(data , request, response);
}
}
| [
"[email protected]"
] | |
af43c0f74ca152e7ea378df7b49e918567f55740 | 64fe26edfd1c225e92eedf8850bd6e4feb2f5407 | /app/src/androidTest/java/com/wordpress/connectingemotions/connectingemotions/ExampleInstrumentedTest.java | 70d1a88baff91a650dd650d5b90e214dc6abe614 | [] | no_license | premraval010/Connecting_Emotions_webview | 8795d0bf58efbced3b526c060a345ec53262e080 | 9404ed8a512e555f0dd8e3b030447417061e8cd6 | refs/heads/master | 2021-01-23T09:38:24.751616 | 2017-09-06T08:57:59 | 2017-09-06T08:57:59 | 102,585,959 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 806 | java | package com.wordpress.connectingemotions.connectingemotions;
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.wordpress.connectingemotions.connectingemotions", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
b8ff682bef3ce453a2ba6ee4e0164a4890b3c695 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/20/20_2d11b6ca00e37ab52ed3e4749c3e75f63788277e/DirectoryScanner/20_2d11b6ca00e37ab52ed3e4749c3e75f63788277e_DirectoryScanner_s.java | 36ebabb19eb0dd0b0c377caec1e632da2684e946 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,916 | java | package org.openintents.filemanager;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.openintents.filemanager.util.FileUtils;
import org.openintents.filemanager.util.MimeTypes;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
import android.util.Log;
public class DirectoryScanner extends Thread {
private static final String TAG = "OIFM_DirScanner";
private File currentDirectory;
boolean cancel;
private String mSdCardPath;
private Context context;
private MimeTypes mMimeTypes;
private Handler handler;
private long operationStartTime;
private boolean mWriteableOnly;
private boolean mDirectoriesOnly;
// Update progress bar every n files
static final private int PROGRESS_STEPS = 50;
// Cupcake-specific methods
static Method formatter_formatFileSize;
static {
initializeCupcakeInterface();
}
DirectoryScanner(File directory, Context context, Handler handler, MimeTypes mimeTypes, String sdCardPath, boolean writeableOnly, boolean directoriesOnly) {
super("Directory Scanner");
currentDirectory = directory;
this.context = context;
this.handler = handler;
this.mMimeTypes = mimeTypes;
this.mSdCardPath = sdCardPath;
this.mWriteableOnly = writeableOnly;
this.mDirectoriesOnly = directoriesOnly;
}
private void clearData() {
// Remove all references so we don't delay the garbage collection.
context = null;
mMimeTypes = null;
handler = null;
}
public void run() {
Log.v(TAG, "Scanning directory " + currentDirectory);
File[] files = currentDirectory.listFiles();
int fileCount = 0;
int dirCount = 0;
int sdCount = 0;
int totalCount = 0;
if (cancel) {
Log.v(TAG, "Scan aborted");
clearData();
return;
}
if (files == null) {
Log.v(TAG, "Returned null - inaccessible directory?");
totalCount = 0;
} else {
totalCount = files.length;
}
operationStartTime = SystemClock.uptimeMillis();
Log.v(TAG, "Counting files... (total count=" + totalCount + ")");
int progress = 0;
/** Dir separate for sorting */
List<IconifiedText> listDir = new ArrayList<IconifiedText>(totalCount);
/** Files separate for sorting */
List<IconifiedText> listFile = new ArrayList<IconifiedText>(totalCount);
/** SD card separate for sorting */
List<IconifiedText> listSdCard = new ArrayList<IconifiedText>(3);
boolean noMedia = false;
// Cache some commonly used icons.
Drawable sdIcon = context.getResources().getDrawable(R.drawable.icon_sdcard);
Drawable folderIcon = context.getResources().getDrawable(R.drawable.ic_launcher_folder);
Drawable genericFileIcon = context.getResources().getDrawable(R.drawable.icon_file);
Drawable currentIcon = null;
if (files != null) {
for (File currentFile : files){
if (cancel) {
// Abort!
Log.v(TAG, "Scan aborted while checking files");
clearData();
return;
}
progress++;
updateProgress(progress, totalCount);
/*
if (currentFile.isHidden()) {
continue;
}
*/
if (currentFile.isDirectory()) {
if (currentFile.getAbsolutePath().equals(mSdCardPath)) {
currentIcon = sdIcon;
listSdCard.add(new IconifiedText(
currentFile.getName(), "", currentIcon));
} else {
currentIcon = folderIcon;
if (!mWriteableOnly || currentFile.canWrite()){
listDir.add(new IconifiedText(
currentFile.getName(), "", currentIcon));
}
}
}else{
String fileName = currentFile.getName();
// Is this the ".nomedia" file?
if (!noMedia) {
if (fileName.equalsIgnoreCase(".nomedia")) {
// It is!
noMedia = true;
}
}
String mimetype = mMimeTypes.getMimeType(fileName);
currentIcon = getDrawableForMimetype(currentFile, mimetype);
if (currentIcon == null) {
currentIcon = genericFileIcon;
}
String size = "";
try {
size = (String) formatter_formatFileSize.invoke(null, context, currentFile.length());
} catch (Exception e) {
// The file size method is probably null (this is most
// likely not a Cupcake phone), or something else went wrong.
// Let's fall back to something primitive, like just the number
// of KB.
size = Long.toString(currentFile.length() / 1024);
size +=" KB";
// Technically "KB" should come from a string resource,
// but this is just a Cupcake 1.1 fallback, and KB is universal
// enough.
}
if (!mDirectoriesOnly){
listFile.add(new IconifiedText(
currentFile.getName(), size, currentIcon));
}
}
}
}
Log.v(TAG, "Sorting results...");
//Collections.sort(mListSdCard);
Collections.sort(listDir);
Collections.sort(listFile);
if (!cancel) {
Log.v(TAG, "Sending data back to main thread");
DirectoryContents contents = new DirectoryContents();
contents.listDir = listDir;
contents.listFile = listFile;
contents.listSdCard = listSdCard;
contents.noMedia = noMedia;
Message msg = handler.obtainMessage(FileManagerActivity.MESSAGE_SHOW_DIRECTORY_CONTENTS);
msg.obj = contents;
msg.sendToTarget();
}
clearData();
}
private void updateProgress(int progress, int maxProgress) {
// Only update the progress bar every n steps...
if ((progress % PROGRESS_STEPS) == 0) {
// Also don't update for the first second.
long curTime = SystemClock.uptimeMillis();
if (curTime - operationStartTime < 1000L) {
return;
}
// Okay, send an update.
Message msg = handler.obtainMessage(FileManagerActivity.MESSAGE_SET_PROGRESS);
msg.arg1 = progress;
msg.arg2 = maxProgress;
msg.sendToTarget();
}
}
/**
* Return the Drawable that is associated with a specific mime type
* for the VIEW action.
*
* @param mimetype
* @return
*/
Drawable getDrawableForMimetype(File file, String mimetype) {
if (mimetype == null) {
return null;
}
PackageManager pm = context.getPackageManager();
Uri data = FileUtils.getUri(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
//intent.setType(mimetype);
// Let's probe the intent exactly in the same way as the VIEW action
// is performed in FileManagerActivity.openFile(..)
intent.setDataAndType(data, mimetype);
final List<ResolveInfo> lri = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
if (lri != null && lri.size() > 0) {
//Log.i(TAG, "lri.size()" + lri.size());
// return first element
int index = 0;
// Actually first element should be "best match",
// but it seems that more recently installed applications
// could be even better match.
index = lri.size()-1;
final ResolveInfo ri = lri.get(index);
return ri.loadIcon(pm);
}
return null;
}
private static void initializeCupcakeInterface() {
try {
formatter_formatFileSize = Class.forName("android.text.format.Formatter").getMethod("formatFileSize", Context.class, long.class);
} catch (Exception ex) {
// This is not cupcake.
return;
}
}
}
| [
"[email protected]"
] | |
fbc398cc9caa99ea7d353f5fc9901604e7e1bc91 | ab618fe68526abc9e54fe1fd6a45b1c87f268fa6 | /src/main/java/Java_study/Patterns/Composite/BaseShape.java | d6fe370cb20af2d409e9f1e0a8b6ddcb7b22587a | [] | no_license | Elvolver/Java_study | 1c3caea0fd8d96b727bd5a669c55e8a3d24f79d9 | f4cec8f9c43d32f11ef67edf1c68065e87ba2861 | refs/heads/master | 2020-04-15T18:39:51.536479 | 2019-02-04T20:25:35 | 2019-02-04T20:25:35 | 164,919,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,768 | java | package Java_study.Patterns.Composite;
import java.awt.*;
abstract class BaseShape implements Shape {
public int x;
public int y;
public Color color;
private boolean selected = false;
BaseShape(int x, int y, Color color) {
this.x = x;
this.y = y;
this.color = color;
}
@Override
public int getX() {
return x;
}
@Override
public int getY() {
return y;
}
@Override
public int getWidth() {
return 0;
}
@Override
public int getHeight() {
return 0;
}
@Override
public void move(int x, int y) {
this.x += x;
this.y += y;
}
@Override
public boolean isInsideBounds(int x, int y) {
return x > getX() && x < (getX() + getWidth()) && y > getY() && y < (getY() + getHeight());
}
@Override
public void select() {
selected = true;
}
@Override
public void unSelect() {
selected = false;
}
@Override
public boolean isSelected() {
return selected;
}
void enableSelectionStyle (Graphics graphics) {
graphics.setColor(Color.LIGHT_GRAY);
Graphics2D g2 = (Graphics2D) graphics;
float dash1[] = {2.0f};
g2.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 2.0f, dash1, 0.0f));
}
void disableSelectionStyle(Graphics graphics) {
graphics.setColor(color);
Graphics2D g2 = (Graphics2D) graphics;
g2.setStroke(new BasicStroke());
}
@Override
public void paint(Graphics graphics) {
if (isSelected()) {
enableSelectionStyle(graphics);
} else {
disableSelectionStyle(graphics);
}
}
}
| [
"[email protected]"
] | |
24dcd8ca46287a5410ffd09a5ca2ff53b3e826dc | b5639b98531c2da943876074883148cc2087e1b5 | /LibrarySpringBoot/src/main/java/persistence/entitites/Person.java | ca2366651115b18a4916049f532d9902aa3e979f | [] | no_license | Codrut19/ExercitiiJavaFundamentals-1 | 3ad460690808558f0ea6132052ea4cb0d22c9210 | a1fddace0da10b3b591aa4ab8f44c4e1b8b73ad2 | refs/heads/master | 2023-02-25T23:10:46.747933 | 2021-01-25T05:38:23 | 2021-01-25T05:38:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,104 | java | package persistence.entitites;
import javax.persistence.*;
import java.util.Set;
@Entity
@Table(name = "persons")
@NamedQueries({@NamedQuery(name = "SelectPersonByName", query = "select person from Person person where person.name=:name"),
@NamedQuery(name = "DeletePersonByYearOfBirth", query = "delete Person where yearOfBirth=:yearOfBirth"),
@NamedQuery(name = "UpdatePersonByAddress", query = "update Person set address=:address where name=:name")})
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Column(name = "name")
private String name;
@Column(name = "surname")
private String surname;
@Column(name = "address")
private String address;
@Column(name = "year_of_birth")
private int yearOfBirth;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "persons_books", joinColumns = {@JoinColumn(name = "persons_id")}, inverseJoinColumns = {@JoinColumn(name = "books_id")})
private Set<Book> bookSet;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinTable(name = "persons_sections", joinColumns = {@JoinColumn(name = "persons_id")}, inverseJoinColumns = {@JoinColumn(name = "sections_id")})
private Set<Section> sectionSet;
public Person() {
}
public Person(String name, String surname, String address, int yearOfBirth) {
this.name = name;
this.surname = surname;
this.address = address;
this.yearOfBirth = yearOfBirth;
}
public Person(String name, String surname, String address, int yearOfBirth, Set<Book> bookSet, Set<Section> sectionSet) {
this.name = name;
this.surname = surname;
this.address = address;
this.yearOfBirth = yearOfBirth;
this.bookSet = bookSet;
this.sectionSet = sectionSet;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getYearOfBirth() {
return yearOfBirth;
}
public void setYearOfBirth(int yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
public Set<Book> getBookSet() {
return bookSet;
}
public void setBookSet(Set<Book> bookSet) {
this.bookSet = bookSet;
}
public Set<Section> getSectionSet() {
return sectionSet;
}
public void setSectionSet(Set<Section> sectionSet) {
this.sectionSet = sectionSet;
}
@Override
public String toString() {
return "Person{" +
"name='" + name + '\'' +
", surname='" + surname + '\'' +
", address='" + address + '\'' +
", yearOfBirth=" + yearOfBirth +
'}';
}
}
| [
"[email protected]"
] | |
c10df546114074ef7cd3c11a072ffdad8157e2ed | 3e534aad07468ad9f691e28bd03a814802c641b0 | /src/test/java/com/github/kurkov/kafkatestcontainers/AbstractTest.java | f886371c9653cc92830e0c6439dcb905a11046ca | [] | no_license | kurkov/kafka-test-containers | 5731c2f5701e189317411b334a02c9b283b923bb | 725c3b4664c07b345867f9604b623bf7799be05d | refs/heads/master | 2021-01-14T19:02:33.666310 | 2020-02-24T11:45:41 | 2020-02-24T11:45:41 | 242,722,439 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,300 | java | package com.github.kurkov.kafkatestcontainers;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.util.TestPropertyValues;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.KafkaContainer;
import org.testcontainers.containers.Network;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@SpringBootTest(classes = Application.class)
@ContextConfiguration(initializers = {AbstractTest.ContextInitializer.class})
public abstract class AbstractTest {
protected static Logger logger = LoggerFactory.getLogger(AbstractTest.class);
protected static GenericContainer zookeeper;
protected static KafkaContainer kafka;
@BeforeClass
public static void startContainers() {
Network network = Network.newNetwork();
kafka = new KafkaContainer()
.withNetwork(network)
.withNetworkAliases("kafka")
.withExternalZookeeper("zookeeper:2181");
zookeeper = new GenericContainer<>("confluentinc/cp-zookeeper:4.0.0")
.withNetwork(network)
.withNetworkAliases("zookeeper")
.withEnv("ZOOKEEPER_CLIENT_PORT", "2181")
.withExposedPorts(2181);
logger.info("Starting local Zookeeper in docker container...");
zookeeper.start();
assertTrue(zookeeper.isRunning());
logger.info("Zookeeper has been started!");
String zookeeperAddress = zookeeper.getContainerIpAddress() + ":" + zookeeper.getFirstMappedPort();
logger.info("Zookeeper address: " + zookeeperAddress);
logger.info("Starting local Kafka in docker container...");
kafka.start();
assertTrue(kafka.isRunning());
logger.info("Kafka has been started!");
String kafkaAddress = kafka.getContainerIpAddress() + ":" + kafka.getFirstMappedPort();
logger.info("Kafka address: " + kafkaAddress);
String bootstrapServers = kafka.getBootstrapServers();
logger.info("Broker address (bootstrap-servers): " + bootstrapServers);
}
static class ContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
@Override
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
TestPropertyValues.of(
"kafka.server=" + kafka.getBootstrapServers()
).applyTo(configurableApplicationContext.getEnvironment());
}
}
@AfterClass
public static void stopContainers() {
logger.info("Stopping Kafka docker container...");
kafka.stop();
assertFalse(kafka.isRunning());
logger.info("Kafka has been stopped!");
logger.info("Stopping Zookeeper docker container...");
zookeeper.stop();
assertFalse(zookeeper.isRunning());
logger.info("Zookeeper has been stopped!");
}
}
| [
"[email protected]"
] | |
23b5897937d041cb71374238b0a24244ea6bb346 | fa93e152f1c514692a4ff8da2b009e49c7fa7ae1 | /CKISSHUG.java | 30c732337c37b1def6f75627243908135fb7b303 | [] | no_license | saikiranreka/CodeChef | e03849cd0ea05b48e0e99b5a2eed32d6e5463900 | 59bfc386cff6315e1fc6e735382a22e093ef282a | refs/heads/master | 2021-01-15T10:14:13.227273 | 2016-02-24T06:50:25 | 2016-02-24T06:50:25 | 33,224,722 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,040 | java | package easy;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
class CKISSHUG {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
int n = Integer.parseInt(br.readLine().trim());
for (int i = 0; i < n; i++) {
int k = Integer.parseInt(br.readLine().trim());
int s1 = findpower(2, (int) Math.ceil((k + 1) / 2.0));
int s2 = findpower(2, (int) Math.floor((k + 1) / 2.0));
int res = (s1 + s2) % 1000000007 - 2;
out.println(res);
}
out.close();
}
private static int findpower(int n, int ceil) {
if (ceil == 0) {
return 1;
} else if (ceil == 1) {
return n;
} else if (ceil % 2 == 0) {
return findpower((n * n) % 1000000007, ceil / 2);
} else {
return (n * findpower((n * n) % 1000000007, (ceil - 1) / 2))% 1000000007;
}
}
}
| [
"[email protected]"
] | |
29dc70b988a4a39ba471f46fa051bb40e7f88a57 | ffb502ca591023cb8a4f3c5f4dae9e60433f6394 | /src/com/moe365/moepi/net/channel/DataChannelClient.java | 3cc109c62cea7267f92e2d335d3bcfa12e03a5e1 | [] | no_license | KHS-Robotics/MoePi | 9c7e620977dcb670d276c77dfabd80da3adeb01a | b2debfed0f22c92a1c7a6a87e0c374d3727b0ac3 | refs/heads/master | 2020-04-18T06:58:09.278085 | 2019-04-17T06:29:33 | 2019-04-17T06:29:33 | 167,343,708 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 232 | java | package com.moe365.moepi.net.channel;
import java.util.concurrent.CompletableFuture;
import com.moe365.moepi.net.packet.DataPacket;
public interface DataChannelClient {
public CompletableFuture<Void> write(DataPacket packet);
}
| [
"[email protected]"
] | |
5773785402ce962a9f7bf850294e6060364b092a | e85f7af40f8aad1306b12387f44a6dbbadd5d612 | /src/main/java/com/test/rule/bean/PRH.java | 09844a7f25e7a3184e89b0adb6848140698d07be | [] | no_license | 372579561/rule | d3af66632f4a7e4f6b6a3ad8b82fbc795bda2631 | d45f3a22ce54102b379ecffc09aac2baba7d5dae | refs/heads/master | 2022-11-21T09:28:55.662121 | 2020-01-14T05:05:15 | 2020-01-14T05:05:15 | 233,540,698 | 0 | 0 | null | 2022-11-16T12:28:06 | 2020-01-13T07:52:34 | Java | UTF-8 | Java | false | false | 1,381 | java |
package com.test.rule.bean;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>anonymous complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{}PA01"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"pa01"
})
@XmlRootElement(name = "PRH")
public class PRH {
@XmlElement(name = "PA01", required = true)
protected PA01 pa01;
/**
* 获取pa01属性的值。
*
* @return
* possible object is
* {@link PA01 }
*
*/
public PA01 getPA01() {
return pa01;
}
/**
* 设置pa01属性的值。
*
* @param value
* allowed object is
* {@link PA01 }
*
*/
public void setPA01(PA01 value) {
this.pa01 = value;
}
}
| [
"[email protected]"
] | |
9abe9cf9f79451ba70a9718100da54767c119cca | 87f7cf0e68a1c428678a292ae2cd102f62ca2c28 | /walkinggroupapp/app/src/main/java/com/teal/a276/walkinggroup/activities/map/DashBoard.java | 0fb34859ea2ddcf33a3514919f4c3e543fb958a2 | [] | no_license | jamiejann/The-Walking-Schoolbus | 4109ba4e931d4edc60f8c90b73a6692ca9204029 | 4658716765916c11eba69a9b45f158c50946437d | refs/heads/master | 2020-03-12T03:42:06.230043 | 2018-05-11T06:26:11 | 2018-05-11T06:26:11 | 130,429,471 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,397 | java | package com.teal.a276.walkinggroup.activities.map;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.Button;
import com.google.android.gms.maps.model.Marker;
import com.teal.a276.walkinggroup.R;
import com.teal.a276.walkinggroup.activities.message.Messages;
import com.teal.a276.walkinggroup.model.ModelFacade;
import com.teal.a276.walkinggroup.model.dataobjects.Message;
import com.teal.a276.walkinggroup.model.dataobjects.User;
import com.teal.a276.walkinggroup.model.dataobjects.UserLocation;
import com.teal.a276.walkinggroup.model.serverproxy.RequestConstant;
import com.teal.a276.walkinggroup.model.serverproxy.ServerManager;
import com.teal.a276.walkinggroup.model.serverproxy.ServerProxy;
import com.teal.a276.walkinggroup.model.serverrequest.requestimplementation.DashboardLocationRequest;
import com.teal.a276.walkinggroup.model.serverrequest.requestimplementation.MessageUpdater;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Observable;
import java.util.Observer;
import java.util.concurrent.TimeUnit;
import retrofit2.Call;
/**
* Dashboard Activity for parents to check location of their children
* and the location of the leader.
*
*/
public class DashBoard extends AbstractMapActivity implements Observer{
private final long MAP_UPDATE_RATE = 30000;
private User user;
private String messageCount;
private Button msgButton;
private MessageUpdater messageUpdater;
private DashboardLocationRequest locationRequest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dash_board);
initializeMap(R.id.dashboardMap, MAP_UPDATE_RATE, MAP_UPDATE_RATE);
user = ModelFacade.getInstance().getCurrentUser();
messageCount = getString(R.string.dashboard_unread_message);
}
@Override
public void onConnected(@Nullable Bundle bundle) {
super.onConnected(bundle);
setUpMsgButton();
placeCurrentLocationMarker();
// First call to populate pins before timer starts
DashboardLocationRequest initialLocationRequest = new DashboardLocationRequest(user, 0, this::error);
initialLocationRequest.addObserver(this);
locationRequest = new DashboardLocationRequest(user, MAP_UPDATE_RATE, this::error);
locationRequest.addObserver(this);
}
@Override
public void onPause() {
super.onPause();
messageUpdater.unsubscribeFromUpdates();
messageUpdater.deleteObserver(this);
locationRequest.unsubscribeFromUpdates();
locationRequest.deleteObserver(this);
}
@Override
public void onResume() {
super.onResume();
messageUpdater = new MessageUpdater(user, this::error);
messageUpdater.addObserver(this);
locationRequest = new DashboardLocationRequest(user, MAP_UPDATE_RATE, this::error);
locationRequest.addObserver(this);
}
private void setUpMsgButton() {
msgButton = findViewById(R.id.dashMsgBtn);
getServerMessageCount();
msgButton.setOnClickListener(v -> startActivity(new Intent(this, Messages.class)));
}
private void getServerMessageCount(){
HashMap<String, Object> requestParameters = new HashMap<>();
requestParameters.put(RequestConstant.STATUS, RequestConstant.UNREAD);
requestParameters.put(RequestConstant.FOR_USER, user.getId());
ServerProxy proxy = ServerManager.getServerProxy();
Call<List<Message>> call = proxy.getMessages(requestParameters);
ServerManager.serverRequest(call, this::updateUnreadMsg, this::error);
}
private void updateUnreadMsg(List<Message> messages){
String unreadCount = String.valueOf(messages.size());
messageCount = getString(R.string.dashboard_unread_message) + unreadCount;
msgButton.setText(messageCount);
}
@Override
public boolean onMarkerClick(Marker marker) {
return false;
}
public static Intent makeIntent(Context context){
return new Intent(context, DashBoard.class);
}
protected void error(String error){
super.error(error);
}
private String generateMarkerTitle(UserLocation location, String name) {
String timeStamp = "";
try {
timeStamp = generateTimeCode(location.getTimestamp());
} catch (ParseException e) {
e.printStackTrace();
}
return name + getString(R.string.last_time_update) + timeStamp;
}
private void placeDashBoardMarker(UserLocation location, String name, MarkerColor color) {
if(location.getLat() == null) {
return;
}
String markerTitle = generateMarkerTitle(location, name);
placeMarker(locationToLatLng(location) ,markerTitle, color);
}
private String generateTimeCode(String timestamp) throws ParseException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault());
Date date = format.parse(timestamp);
Long timeSince = System.currentTimeMillis() - date.getTime();
return String.format(Locale.getDefault(), getString(R.string.time_format),
TimeUnit.MILLISECONDS.toMinutes(timeSince),
TimeUnit.MILLISECONDS.toSeconds(timeSince) -
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(timeSince))
);
}
@Override
public void update(Observable o, Object arg) {
if(o == messageUpdater) {
updateUnreadMsg((List<Message>) arg);
}
else {
addMarkersForUsers((List<User>) arg);
}
}
private void addMarkersForUsers(List<User> users) {
map.clear();
for(User user : users) {
placeDashBoardMarker(user.getLocation(), user.getName(),
user.isLeader() ? MarkerColor.VIOLET : MarkerColor.CYAN);
}
}
} | [
"[email protected]"
] | |
3a5a1cd36e93abd260e3fc7c2faacad0e2de2c9c | f41f362b88e118dcace37c5ae1a1bf85005c9ce3 | /eng-preprocessor/src/main/java/org/swtk/eng/preprocess/PopulateCliches.java | 6ab46a7f5e8c4610bee1a2735b7bbb741f95b7f8 | [
"Apache-2.0"
] | permissive | torrances/swtk-eng | 60238e10c41b4fb1f77ad7fb1332fc878cece3b7 | 1b89f9975fb7a15fffa86e18cbb860df8c39d64e | refs/heads/master | 2021-01-20T18:24:33.022928 | 2016-01-27T19:20:18 | 2016-01-27T19:20:18 | 25,320,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package org.swtk.eng.preprocess;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import com.trimc.blogger.commons.utils.CollectionUtils;
public class PopulateCliches {
public static Map<String, String> map = new HashMap<String, String>();
static {
/* a cliche is defined as a phrase that adds no value to a sentence
* each phrase can be removed without 'damaging' the sentence */
/* a */
map.put("an example of", "");
map.put("a form of", "");
map.put("as described earlier", "");
map.put("are required to", "");
/* b */
map.put("usually (but not always)", "often");
/* c */
map.put("consequently, ", "");
map.put("can be used to", "can");
map.put("can also", "can");
/* d */
map.put("developed specifically", "used");
/* f */
map.put("for this reason", "");
/* g */
map.put("generally classified as either", "");
map.put("generally classified in", "in");
map.put("generally results", "results");
/* h */
map.put("has previously been defined as", "is");
map.put("however, ", "");
map.put("have occurred in conjunction with", "occurs in");
/* i */
map.put("in many respects", "");
map.put("a good example of", "");
map.put("is used, however, as a", "is a");
map.put("in some cases", "");
map.put("indeed,", "");
map.put("in general, ", "");
map.put("it has been observed that", "");
map.put("is able to", "can");
map.put("is actually considered", "is");
/* m */
map.put("more or less", "");
map.put("many factors including", "");
/* n */
map.put("nevertheless, ", "");
/* o */
map.put("of which ", "");
/* s */
map.put("should be considered to be", "are");
/* t */
map.put("tend to", "");
map.put("that can be applied", "");
map.put("this is however not a problem as", "");
map.put("typically used for", "for");
map.put("the pitfall, however, is that", "");
map.put("that subsequently provide", "causing");
/* w */
map.put("will result in", "causes");
}
public static Collection<String> sorted() {
Map<Integer, List<String>> sorted = new TreeMap<Integer, List<String>>();
for (String key : map.keySet()) {
List<String> inner = sorted.containsKey(key.length()) ? sorted.get(key.length()) : new ArrayList<String>();
inner.add(key);
sorted.put(key.length(), inner);
}
return CollectionUtils.reverse(CollectionUtils.toList2(sorted.values()));
}
public static void main(String... args) throws Throwable {
for (String s : sorted())
System.err.println(s);
}
}
| [
"[email protected]"
] | |
7862cdbedf2609d5b9dbdba27daa113a9f17233a | 1b724896d7983bfdceed767204c938970e3ccafa | /src/model/dao/SellerDAO.java | 5ec9f73fee06362928eeb097f2e86e355d95f48c | [] | no_license | AlexisCesar/workshop-javafx-jdbc | 7a7ecd91b33ff57530e68be6baa71111951506c8 | 92533adb34ae87dc3894193323008c907f0973fc | refs/heads/master | 2023-05-08T10:29:01.615946 | 2021-05-28T17:23:38 | 2021-05-28T17:23:38 | 368,212,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package model.dao;
import java.util.List;
import model.entities.Department;
import model.entities.Seller;
public interface SellerDAO {
void insert(Seller obj);
void update(Seller obj);
void deleteById(Integer id);
Seller findById(Integer id);
List<Seller> findAll();
List<Seller> findByDepartment(Department department);
}
| [
"[email protected]"
] | |
fe560be2ee0d31fc14e1f667c23dd23d9ac31b3b | f577eb1bbc98a6363e81d0b637e03626e226f104 | /Auxiliary/RecipeManagers/CastingRecipes/Blocks/RelayFilterRecipe.java | 0cdec20fe4b1853bd2e05c9b2f9128dacec033bb | [] | no_license | RedNicStone/ChromatiCraft | d75227fff74ed4e824c5ab4e0c2c7a6e6b7ffe58 | 0376a3d4ade3b5eca6041ae213ef0e49725cf755 | refs/heads/master | 2020-03-09T18:06:47.041957 | 2017-11-14T04:48:21 | 2017-11-14T04:48:21 | 128,923,799 | 1 | 0 | null | 2018-04-10T11:43:34 | 2018-04-10T11:43:34 | null | UTF-8 | Java | false | false | 2,037 | java | /*******************************************************************************
* @author Reika Kalseki
*
* Copyright 2017
*
* All rights reserved.
* Distribution of the software in any form is only allowed with
* explicit, prior permission from the owner.
******************************************************************************/
package Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Blocks;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import Reika.ChromatiCraft.Auxiliary.ChromaStacks;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipe.MultiBlockCastingRecipe;
public class RelayFilterRecipe extends MultiBlockCastingRecipe {
public RelayFilterRecipe(ItemStack out, ItemStack main) {
super(out, main);
this.addAuxItem(ChromaStacks.focusDust, -2, 0);
this.addAuxItem(ChromaStacks.focusDust, 2, 0);
this.addAuxItem(ChromaStacks.focusDust, 0, 2);
this.addAuxItem(ChromaStacks.focusDust, 0, -2);
this.addAuxItem(ChromaStacks.beaconDust, -4, 2);
this.addAuxItem(ChromaStacks.beaconDust, -4, -2);
this.addAuxItem(ChromaStacks.beaconDust, 4, 2);
this.addAuxItem(ChromaStacks.beaconDust, 4, -2);
this.addAuxItem(ChromaStacks.beaconDust, 2, 4);
this.addAuxItem(ChromaStacks.beaconDust, -2, 4);
this.addAuxItem(ChromaStacks.beaconDust, 2, -4);
this.addAuxItem(ChromaStacks.beaconDust, -2, -4);
this.addAuxItem(Items.iron_ingot, -4, -4);
this.addAuxItem(Items.iron_ingot, 4, -4);
this.addAuxItem(Items.iron_ingot, -4, 4);
this.addAuxItem(Items.iron_ingot, 4, 4);
this.addAuxItem(ChromaStacks.beaconDust, -2, -2);
this.addAuxItem(ChromaStacks.beaconDust, 2, -2);
this.addAuxItem(ChromaStacks.beaconDust, -2, 2);
this.addAuxItem(ChromaStacks.beaconDust, 2, 2);
this.addAuxItem(Blocks.glass, -4, 0);
this.addAuxItem(Blocks.glass, 4, 0);
this.addAuxItem(Blocks.glass, 0, 4);
this.addAuxItem(Blocks.glass, 0, -4);
}
@Override
public int getNumberProduced() {
return 2;
}
}
| [
"[email protected]"
] | |
f7897179ca5a92f4c4bf52608f922a9dbc0d804e | a39bda0b9af72dc3e1f1f73aad8d577c9ed57328 | /src/main/java/com/example/usermanagement/controller/dto/ExceptionMessageDto.java | a11109e8d05a29b9cb1d7e21f39b17cda49a5aa4 | [] | no_license | malibinYun/Stove-project2 | e18af58070ffa82f399a7236e813e74f502ff3a8 | f5bbea4647575dce1e23e908c3b07041d9568867 | refs/heads/master | 2023-02-01T20:46:14.897410 | 2020-12-18T09:15:07 | 2020-12-18T09:15:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 242 | java | package com.example.usermanagement.controller.dto;
import lombok.Getter;
@Getter
public class ExceptionMessageDto {
private final String message;
public ExceptionMessageDto(String message) {
this.message = message;
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.