blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
0d6cfe9982e0732da0fd2f185191397d8ad59914
4916768f7c1ec68aa59f497ccc2df935d11809a5
/cloud-api-commons/src/main/java/com/fly/springcloud/entity/CommonResult.java
c9c5936a1facd86ae96d6b1a933a04005e4292ee
[]
no_license
zychappy/springcloud
44b2630097f50e0e7fe8ba1e5facf3b305b97a98
c74d5b866a8b75f2ddf2a75fa018198586ebf535
refs/heads/main
2023-06-03T06:01:31.411906
2021-06-24T02:10:14
2021-06-24T02:10:14
324,517,469
0
0
null
null
null
null
UTF-8
Java
false
false
458
java
package com.fly.springcloud.entity; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * @author flyer * @date */ @Data @NoArgsConstructor @AllArgsConstructor public class CommonResult<T> { private Integer code; private String message; private T data; public CommonResult(Integer code, String message) { this.code = code; this.message = message; this.data = null; } }
[ "50730756@qq.com" ]
50730756@qq.com
31797ceabd0a5aac7c3d75e44380f0e4583250d1
b6da5de37d7441e38ca80d561d0a7401b24648bc
/test/com/test/ICustomerService.java
3787356dfc0ebbb093836073360cf459d09eb0c0
[]
no_license
a1179953981/Demo02
4050e5ce16fb03ad89c20343c236671c61a63526
c659942977ed3019654b283a2a4db29d9b58b13e
refs/heads/master
2021-05-18T12:20:52.880665
2020-05-15T08:20:05
2020-05-15T08:20:05
251,241,178
1
0
null
null
null
null
UTF-8
Java
false
false
120
java
package com.test; import java.util.List; public interface ICustomerService { public List<Customer> findAll(); }
[ "1179953981@qq.com" ]
1179953981@qq.com
ad5af9d4b58f022161f456752fb29d0035eb9021
3d1d9d95947092174a1d7b294838d956f5d97e57
/src/main/java/com/crs4/sem/model/Document.java
b21a1a3882289baaa1a1b3cba29526b60405be1f
[]
no_license
natcrs4/semantic-engine
d3219f2ebbb0b471d048d05e08fcbfe14071aa06
060f5643301b55083c35349f208b3a00b4f31c4d
refs/heads/master
2020-07-17T12:25:10.831089
2020-05-19T09:31:14
2020-05-19T09:31:14
206,019,591
0
1
null
2019-09-03T07:47:39
2019-09-03T07:47:39
null
UTF-8
Java
false
false
6,460
java
package com.crs4.sem.model; import java.util.Date; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToMany; import org.apache.lucene.analysis.core.WhitespaceAnalyzer; import org.apache.lucene.analysis.it.ItalianAnalyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.hibernate.annotations.DynamicUpdate; import org.hibernate.search.annotations.Analyze; import org.hibernate.search.annotations.Analyzer; import org.hibernate.search.annotations.Field; import org.hibernate.search.annotations.Index; import org.hibernate.search.annotations.Indexed; import org.hibernate.search.annotations.IndexedEmbedded; import org.hibernate.search.annotations.Store; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; @Data @Builder @Entity @Indexed @NoArgsConstructor @AllArgsConstructor //@DynamicUpdate @Analyzer(impl=ItalianAnalyzer.class) public class Document implements Documentable{ @Id @GeneratedValue private Long id; @Column(columnDefinition="text") @Analyzer(impl=StandardAnalyzer.class) @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) public String url; @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) public String title; //@Lob //@Column( length = 100000 ) @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) public String description; @Column(columnDefinition="text") @Analyzer(impl=StandardAnalyzer.class) @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) public String authors; // @Analyzer(impl=StandardAnalyzer.class) // @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) // public String authors; @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) @Analyzer(impl=WhitespaceAnalyzer.class) public String type; @Column(columnDefinition="text") @Analyzer(impl=StandardAnalyzer.class) @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) public String image; // @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) public String source_id; @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) public String internal_id; @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) @IndexedEmbedded public Date publishDate; @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) @IndexedEmbedded @Analyzer(impl=StandardAnalyzer.class) public String [] links; @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) @IndexedEmbedded @Analyzer(impl=StandardAnalyzer.class) public String [] movies; @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) @IndexedEmbedded @Analyzer(impl=StandardAnalyzer.class) public String [] gallery; @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) @IndexedEmbedded @Analyzer(impl=StandardAnalyzer.class) public String [] attachments; @Column(columnDefinition="text") @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) @IndexedEmbedded @Analyzer(impl=StandardAnalyzer.class) public String [] podcasts; @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) public Float score; @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) public Long neoid; @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) @IndexedEmbedded public Date timestamp; @Column(columnDefinition="text") @IndexedEmbedded @Field(index=Index.YES, analyze=Analyze.YES, store=Store.YES) @Analyzer(impl=StandardAnalyzer.class) public String [] entities; @Column(columnDefinition="text") @IndexedEmbedded @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) //@Analyzer(impl=StandardAnalyzer.class) public String [] categories; //@Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) @Column(columnDefinition="boolean default false") @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) public Boolean trainable=false; @Override public String text() { String aux=""; aux= (this.getTitle()!=null?this.getTitle():"")+" "+(this.getDescription()!=null?this.getDescription():""); return aux; } // @Column(columnDefinition="text") @IndexedEmbedded @Field(index=Index.YES, analyze=Analyze.NO, store=Store.YES) public String [] keywords; public void copyFields(Document doc) { this.setAttachments(doc.getAttachments()); this.setAuthors(doc.getAuthors()); this.setCategories(doc.getCategories()); this.setDescription(doc.getDescription()); this.setEntities(doc.getEntities()); this.setGallery(doc.getGallery()); this.setTitle(doc.getTitle()); this.setInternal_id(doc.getInternal_id()); this.setLinks(doc.getLinks()); this.setMovies(doc.getMovies()); this.setNeoid(doc.getNeoid()); this.setPodcasts(doc.getPodcasts()); this.setPublishDate(doc.getPublishDate()); this.setSource_id(doc.getSource_id()); this.setScore(doc.getScore()); this.setTrainable(doc.getTrainable()); this.setType(doc.getType()); this.setUrl(doc.getUrl()); this.setKeywords(doc.getKeywords()); this.setTimestamp(doc.getTimestamp()); this.setSource_id(doc.getSource_id()); this.setImage(doc.getImage()); // Class<Document> yourClass = Document.class; // for (Method method : yourClass.getMethods()){ // //String getmethod; // if(method.getName().startsWith("set")) { // String getmethodname=method.getName().replace("set", "get"); // Method getmethod = yourClass.getMethod(getmethodname); // Object value = getmethod.invoke(doc); // method.invoke(this, value); // } // } } public static Document toDocument(NewDocument doc) { Document d= new Document(); return d; } // public Document(){} // public static DocumentBuilder builder(){ // return new DocumentBuilder(); // } // }
[ "mariolocci@bronzino.crs4.it" ]
mariolocci@bronzino.crs4.it
57afb0153c727c70519507b5cf9cdac3c2a370a8
c92dda5013ad28a090452ab70bfb8e888fa2a300
/src/Class348_Sub40_Sub22.java
86cf9bee1768143cf13f0daf28e38b287f468f0d
[]
no_license
EvelusDevelopment/634-Deob
ee7cdd327ba3ef08dbdbbe76372846651d1ade73
ef3e1ddbafb06b5f4ac7376e6870384c526d549d
refs/heads/master
2021-01-19T07:03:39.850614
2012-02-21T06:43:11
2012-02-21T06:43:11
3,501,454
0
0
null
null
null
null
UTF-8
Java
false
false
7,531
java
/* Class348_Sub40_Sub22 - Decompiled by JODE * Visit http://jode.sourceforge.net/ */ import java.util.Random; final class Class348_Sub40_Sub22 extends Class348_Sub40 { private int anInt9284 = 1024; static IncomingPacket aClass114_9285 = new IncomingPacket(104, 1); private int[][] anIntArrayArray9286; private int[][] anIntArrayArray9287; private int anInt9288 = 1024; static int anInt9289; static int anInt9290; private int anInt9291; static int anInt9292; private int anInt9293 = 0; private int anInt9294; static int anInt9295; static int anInt9296; private int[] anIntArray9297; private int anInt9298; private int anInt9299 = 4; private int anInt9300; private int anInt9301; private int anInt9302; static Class304 aClass304_9303 = new Class304(1); static OutgoingPacket aClass351_9304 = new OutgoingPacket(20, -1); private int anInt9305; private final void method3109(byte i) { anInt9289++; Random random = new Random((long) anInt9301); anInt9298 = anInt9294 / 2; anInt9291 = 4096 / anInt9299; anInt9300 = 4096 / anInt9301; int i_0_ = anInt9291 / 2; anIntArray9297 = new int[anInt9301 + 1]; int i_1_ = anInt9300 / 2; anIntArrayArray9287 = new int[anInt9301][1 + anInt9299]; anIntArrayArray9286 = new int[anInt9301][anInt9299]; anIntArray9297[0] = 0; if (i >= -111) method3109((byte) 67); for (int i_2_ = 0; i_2_ < anInt9301; i_2_++) { if ((i_2_ ^ 0xffffffff) < -1) { int i_3_ = anInt9300; int i_4_ = ((Model.method1097((byte) 90, 4096, random) - 2048) * anInt9305 >> -1633784916); i_3_ += i_4_ * i_1_ >> 48155276; anIntArray9297[i_2_] = i_3_ + anIntArray9297[-1 + i_2_]; } anIntArrayArray9287[i_2_][0] = 0; for (int i_5_ = 0; anInt9299 > i_5_; i_5_++) { if ((i_5_ ^ 0xffffffff) < -1) { int i_6_ = anInt9291; int i_7_ = ((Model.method1097((byte) 117, 4096, random) - 2048) * anInt9302 >> -1511824500); i_6_ += i_0_ * i_7_ >> -176195412; anIntArrayArray9287[i_2_][i_5_] = anIntArrayArray9287[i_2_][i_5_ + -1] + i_6_; } anIntArrayArray9286[i_2_][i_5_] = (anInt9284 <= 0 ? 4096 : (-Model.method1097((byte) 124, anInt9284, random) + 4096)); } anIntArrayArray9287[i_2_][anInt9299] = 4096; } anIntArray9297[anInt9301] = 4096; } public Class348_Sub40_Sub22() { super(0, true); anInt9294 = 81; anInt9302 = 409; anInt9305 = 204; anInt9301 = 8; } public static void method3110(int i) { aClass351_9304 = null; aClass304_9303 = null; if (i != -1633784916) aClass304_9303 = null; aClass114_9285 = null; } final void method3049(ByteBuffer class348_sub49, int i, int i_8_) { anInt9292++; if (i_8_ != 31015) method3111(106, 16); int i_9_ = i; while_189_: do { while_188_: do { while_187_: do { while_186_: do { while_185_: do { while_184_: do { do { if ((i_9_ ^ 0xffffffff) != -1) { if (i_9_ != 1) { if ((i_9_ ^ 0xffffffff) != -3) { if ((i_9_ ^ 0xffffffff) != -4) { if (i_9_ != 4) { if (i_9_ != 5) { if ((i_9_ ^ 0xffffffff) != -7) { if ((i_9_ ^ 0xffffffff) != -8) break while_189_; } else break while_187_; break while_188_; } } else break while_185_; break while_186_; } } else break; break while_184_; } } else { anInt9299 = class348_sub49.getUByte(); return; } anInt9301 = class348_sub49.getUByte(); return; } while (false); anInt9302 = class348_sub49.getShort(); return; } while (false); anInt9305 = class348_sub49.getShort(); return; } while (false); anInt9288 = class348_sub49.getShort(); return; } while (false); anInt9293 = class348_sub49.getShort(); return; } while (false); anInt9294 = class348_sub49.getShort(); return; } while (false); anInt9284 = class348_sub49.getShort(); } while (false); } final int[] method3042(int i, int i_10_) { anInt9296++; int[] is = ((Class348_Sub40) this).aClass191_7032.method1433(0, i); if (((Class191) ((Class348_Sub40) this).aClass191_7032).aBoolean2570) { int i_11_ = 0; int i_12_; for (i_12_ = anInt9293 + Class239_Sub18.anIntArray6035[i]; i_12_ < 0; i_12_ += 4096) { /* empty */ } for (/**/; i_12_ > 4096; i_12_ -= 4096) { /* empty */ } for (/**/; (anInt9301 ^ 0xffffffff) < (i_11_ ^ 0xffffffff); i_11_++) { if (i_12_ < anIntArray9297[i_11_]) break; } int i_13_ = -1 + i_11_; boolean bool = (0x1 & i_11_ ^ 0xffffffff) == -1; int i_14_ = anIntArray9297[i_11_]; int i_15_ = anIntArray9297[i_11_ - 1]; if (anInt9298 + i_15_ < i_12_ && (i_14_ - anInt9298 ^ 0xffffffff) < (i_12_ ^ 0xffffffff)) { for (int i_16_ = 0; Class348_Sub40_Sub6.anInt9139 > i_16_; i_16_++) { int i_17_ = 0; int i_18_ = !bool ? -anInt9288 : anInt9288; int i_19_; for (i_19_ = (Class318_Sub6.anIntArray6432[i_16_] + (i_18_ * anInt9291 >> -742925460)); (i_19_ ^ 0xffffffff) > -1; i_19_ += 4096) { /* empty */ } for (/**/; i_19_ > 4096; i_19_ -= 4096) { /* empty */ } for (/**/; (anInt9299 ^ 0xffffffff) < (i_17_ ^ 0xffffffff); i_17_++) { if ((i_19_ ^ 0xffffffff) > (anIntArrayArray9287[i_13_][i_17_] ^ 0xffffffff)) break; } int i_20_ = i_17_ - 1; int i_21_ = anIntArrayArray9287[i_13_][i_20_]; int i_22_ = anIntArrayArray9287[i_13_][i_17_]; if ((i_19_ ^ 0xffffffff) >= (anInt9298 + i_21_ ^ 0xffffffff) || i_19_ >= -anInt9298 + i_22_) is[i_16_] = 0; else is[i_16_] = anIntArrayArray9286[i_13_][i_20_]; } } else Class214.method1579(is, 0, Class348_Sub40_Sub6.anInt9139, 0); } if (i_10_ != 255) method3110(44); return is; } static final void method3111(int i, int i_23_) { anInt9290++; if (i_23_ != Class348_Sub15.anInt6769) { if (i < 18) aClass304_9303 = null; Class367_Sub4.anInt7319 = Class348_Sub40_Sub3.anInt9109 = FileArchiveTracker.anIntArray4780[i_23_]; Class290.method2196((byte) -9); Class62.anIntArrayArrayArray1116 = (new int[4][Class367_Sub4.anInt7319 >> 629360931] [Class348_Sub40_Sub3.anInt9109 >> -1129488413]); Class239_Sub8.anIntArrayArray5921 = (new int[Class367_Sub4.anInt7319] [Class348_Sub40_Sub3.anInt9109]); Class348_Sub42_Sub17.anIntArrayArray9678 = (new int[Class367_Sub4.anInt7319] [Class348_Sub40_Sub3.anInt9109]); for (int i_24_ = 0; i_24_ < 4; i_24_++) MouseEventNode.aClass361Array7108[i_24_] = NativeRaster.method988(Class348_Sub40_Sub3.anInt9109, 1, Class367_Sub4.anInt7319); Class289.aByteArrayArrayArray3700 = (new byte[4][Class367_Sub4.anInt7319] [Class348_Sub40_Sub3.anInt9109]); Class239.method1717(19278, Class348_Sub40_Sub3.anInt9109, Class367_Sub4.anInt7319, 4); Class97.method873(Class367_Sub4.anInt7319 >> 1025673859, 21719, Class348_Sub8.currentToolkit, Class348_Sub40_Sub3.anInt9109 >> -184361181); Class348_Sub15.anInt6769 = i_23_; } } final void method3044(int i) { if (i <= 108) method3111(-110, -119); anInt9295++; method3109((byte) -125); } }
[ "sinisoul@gmail.com" ]
sinisoul@gmail.com
8fafc7b2c84dd071dd124bd22542ecce281d0759
f462279be5d733f1d1a27af4be6d28528f5a0020
/src/main/java/com/SportClub/services/Impl/cricketServiceImpl/batsmanGamesPlayedServiceImpl.java
0c3478c7285f74d2e14621bfe11e859b8f162495
[]
no_license
romanRafiq/WebSportClub
57a58d17e4da7ba6fff6ec402b159a4be182a60a
0da8abd0b50aa79327c181d58a6089be30b811d0
refs/heads/master
2021-01-23T08:56:47.587199
2014-05-04T21:37:27
2014-05-04T21:37:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,213
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.sportsClub.services.Impl.cricketServiceImpl; import com.Model.classes.ImmutableClasses.PlayerRecords.Batsman_runs; import com.sportsClub.repository.BatsmanRepository; import com.sportsClub.services.cricketServices.BatsmansGamesPlayedService; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * * @author Roman */ @Service public class batsmanGamesPlayedServiceImpl implements BatsmansGamesPlayedService{ @Autowired private BatsmanRepository batsmanRepository; @Override public List<Batsman_runs> getPlayersGamesPlayedAbove(int above) { List<Batsman_runs> batsmans = new ArrayList<>(); List<Batsman_runs> allBatsmans = batsmanRepository.findAll(); for(Batsman_runs batsman :allBatsmans ) { if(batsman.getaGamesPlayed() > above) { batsmans.add(batsman); } } return batsmans; } }
[ "Roman@10.0.0.7" ]
Roman@10.0.0.7
869a8c9385a4629e2501d0b708ebd97f643916d5
b2446a8b3dc2d417878d5aa454445690de24a415
/src/main/java/com/example/demo/QrTiendasApplication.java
93e34ae3201ae48044e24c910ca67c6058281e18
[]
no_license
csrtr94/qrCodeRipley
bb1bc3b124a6daf162d279eeb35dde3686f6995a
1915734059fc74bd6936a91264e77175ca735ee9
refs/heads/master
2023-04-29T11:25:48.989023
2020-02-27T20:17:24
2020-02-27T20:17:24
239,863,896
0
0
null
2023-04-14T17:43:19
2020-02-11T21:02:42
Java
UTF-8
Java
false
false
315
java
package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class QrTiendasApplication { public static void main(String[] args) { SpringApplication.run(QrTiendasApplication.class, args); } }
[ "csrtr94@gmail.com" ]
csrtr94@gmail.com
77320b66b8fd0fb33b0cd25f569568aef80cd2b4
d57176af406c4acc60155baa5e141225113e172d
/src/java/com/tsp/sct/dao/exceptions/CronometroDaoException.java
0e82896902b10f2c84e2eb41791f42efa51840a7
[]
no_license
njmube/SGFENS_BAFAR
8aa2bcf5312355efa46b84ab8533169df23a8cc9
4141ee825294246ca4703f7a4441f5a1b06fe0cb
refs/heads/master
2021-01-11T11:58:48.354602
2016-07-28T02:39:23
2016-07-28T02:39:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
662
java
/* * This source file was generated by FireStorm/DAO. * * If you purchase a full license for FireStorm/DAO you can customize this header file. * * For more information please visit http://www.codefutures.com/products/firestorm */ package com.tsp.sct.dao.exceptions; public class CronometroDaoException extends DaoException { /** * Method 'CronometroDaoException' * * @param message */ public CronometroDaoException(String message) { super(message); } /** * Method 'CronometroDaoException' * * @param message * @param cause */ public CronometroDaoException(String message, Throwable cause) { super(message, cause); } }
[ "nelly.gonzalez@vincoorbis.com" ]
nelly.gonzalez@vincoorbis.com
bd9a85f210f0b872fe2479b3af8bf7e67be3a019
918bc52ff045a5b268bca231ee68f6e06298c27d
/src/main/java/zis/rs/zis/domain/entities/Pregled.java
9253bfe4273c76f53ba7627071ed45754ef66160
[]
no_license
FilipBaturan/Zdravstveni-informacioni-sistem
ce8ee8a2b79ae86d1ed0deb5b8fe353881930073
0ea9cbe0a0abc951922d5cec39087137130864f0
refs/heads/master
2020-04-07T14:11:35.138230
2019-02-08T06:19:19
2019-02-08T06:19:19
158,437,346
0
0
null
null
null
null
UTF-8
Java
false
false
5,231
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0 // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2019.01.17 at 10:33:15 PM CET // package zis.rs.zis.domain.entities; import javax.xml.bind.annotation.*; import javax.xml.datatype.XMLGregorianCalendar; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="lekar"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;attribute ref="{http://zis.rs/zis/seme/pregled}indentifikator use="required""/&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;element name="datum" type="{http://www.w3.org/2001/XMLSchema}date"/&gt; * &lt;/sequence&gt; * &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" /&gt; * &lt;attribute name="aktivan" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "lekar", "datum" }) @XmlRootElement(name = "pregled", namespace = "http://zis.rs/zis/seme/pregled") public class Pregled { @XmlElement(namespace = "http://zis.rs/zis/seme/pregled", required = true) protected Pregled.Lekar lekar; @XmlElement(namespace = "http://zis.rs/zis/seme/pregled", required = true) @XmlSchemaType(name = "date") protected XMLGregorianCalendar datum; @XmlAttribute(name = "id", required = true) @XmlSchemaType(name = "anyURI") protected String id; @XmlAttribute(name = "aktivan", required = true) protected boolean aktivan; /** * Gets the value of the lekar property. * * @return possible object is * {@link Pregled.Lekar } */ public Pregled.Lekar getLekar() { return lekar; } /** * Sets the value of the lekar property. * * @param value allowed object is * {@link Pregled.Lekar } */ public void setLekar(Pregled.Lekar value) { this.lekar = value; } /** * Gets the value of the datum property. * * @return possible object is * {@link XMLGregorianCalendar } */ public XMLGregorianCalendar getDatum() { return datum; } /** * Sets the value of the datum property. * * @param value allowed object is * {@link XMLGregorianCalendar } */ public void setDatum(XMLGregorianCalendar value) { this.datum = value; } /** * Gets the value of the id property. * * @return possible object is * {@link String } */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value allowed object is * {@link String } */ public void setId(String value) { this.id = value; } /** * Gets the value of the aktivan property. */ public boolean isAktivan() { return aktivan; } /** * Sets the value of the aktivan property. */ public void setAktivan(boolean value) { this.aktivan = value; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;attribute ref="{http://zis.rs/zis/seme/pregled}indentifikator use="required""/&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") public static class Lekar { @XmlAttribute(name = "indentifikator", namespace = "http://zis.rs/zis/seme/pregled", required = true) @XmlSchemaType(name = "anyURI") protected String indentifikator; /** * Gets the value of the indentifikator property. * * @return possible object is * {@link String } */ public String getIndentifikator() { return indentifikator; } /** * Sets the value of the indentifikator property. * * @param value allowed object is * {@link String } */ public void setIndentifikator(String value) { this.indentifikator = value; } } }
[ "danijelradakovic1996@gmail.com" ]
danijelradakovic1996@gmail.com
f2d5950cd651dbfaaa2d1db23cfb2e9cc905c21e
a3bd3b51694c78649560a40f91241fda62865b18
/src/test/java/com/alibaba/druid/bvt/sql/oracle/select/OracleSelectTest64_with_recursive.java
0cbadb01a69dd573672a797b31f77ece66aec253
[ "Apache-2.0" ]
permissive
kerry8899/druid
e96d7ccbd03353e47a97bea8388d46b2fe173f61
a7cd07aac11c49d4d7d3e1312c97b6513efd2daa
refs/heads/master
2021-01-23T02:00:33.500852
2019-03-29T10:14:34
2019-03-29T10:14:34
85,957,671
0
0
null
2017-03-23T14:14:01
2017-03-23T14:14:01
null
UTF-8
Java
false
false
5,112
java
/* * Copyright 1999-2018 Alibaba Group Holding Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.druid.bvt.sql.oracle.select; import com.alibaba.druid.sql.OracleTest; import com.alibaba.druid.sql.SQLUtils; import com.alibaba.druid.sql.ast.SQLStatement; import com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser; import com.alibaba.druid.sql.dialect.oracle.visitor.OracleSchemaStatVisitor; import org.junit.Assert; import java.util.List; public class OracleSelectTest64_with_recursive extends OracleTest { public void test_0() throws Exception { String sql = // "WITH t1(id, parent_id, lvl) AS (\n" + " -- Anchor member.\n" + " SELECT id,\n" + " parent_id,\n" + " 1 AS lvl\n" + " FROM tab1\n" + " WHERE parent_id IS NULL\n" + " UNION ALL\n" + " -- Recursive member.\n" + " SELECT t2.id,\n" + " t2.parent_id,\n" + " lvl+1\n" + " FROM tab1 t2, t1\n" + " WHERE t2.parent_id = t1.id\n" + ")\n" + "SEARCH DEPTH FIRST BY id SET order1\n" + "SELECT id,\n" + " parent_id,\n" + " RPAD('.', (lvl-1)*2, '.') || id AS tree,\n" + " lvl\n" + "FROM t1\n" + "ORDER BY order1;"; // OracleStatementParser parser = new OracleStatementParser(sql); List<SQLStatement> statementList = parser.parseStatementList(); SQLStatement stmt = statementList.get(0); print(statementList); Assert.assertEquals(1, statementList.size()); OracleSchemaStatVisitor visitor = new OracleSchemaStatVisitor(); stmt.accept(visitor); System.out.println("Tables : " + visitor.getTables()); System.out.println("fields : " + visitor.getColumns()); System.out.println("coditions : " + visitor.getConditions()); System.out.println("relationships : " + visitor.getRelationships()); System.out.println("orderBy : " + visitor.getOrderByColumns()); Assert.assertEquals(1, visitor.getTables().size()); Assert.assertEquals(2, visitor.getColumns().size()); { String text = SQLUtils.toOracleString(stmt); assertEquals("WITH t1 (id, parent_id, lvl) AS (\n" + "\t\t-- Anchor member.\n" + "\t\tSELECT id, parent_id, 1 AS lvl\n" + "\t\tFROM tab1\n" + "\t\tWHERE parent_id IS NULL\n" + "\t\tUNION ALL\n" + "\t\t-- Recursive member.\n" + "\t\tSELECT t2.id, t2.parent_id, lvl + 1\n" + "\t\tFROM tab1 t2, t1\n" + "\t\tWHERE t2.parent_id = t1.id\n" + "\t)\n" + "\tSEARCH DEPTH FIRST BY id SET order1\n" + "SELECT id, parent_id\n" + "\t, RPAD('.', (lvl - 1) * 2, '.') || id AS tree\n" + "\t, lvl\n" + "FROM t1\n" + "ORDER BY order1;", text); } { String text = SQLUtils.toOracleString(stmt, SQLUtils.DEFAULT_LCASE_FORMAT_OPTION); assertEquals("with t1 (id, parent_id, lvl) as (\n" + "\t\t-- Anchor member.\n" + "\t\tselect id, parent_id, 1 as lvl\n" + "\t\tfrom tab1\n" + "\t\twhere parent_id is null\n" + "\t\tunion all\n" + "\t\t-- Recursive member.\n" + "\t\tselect t2.id, t2.parent_id, lvl + 1\n" + "\t\tfrom tab1 t2, t1\n" + "\t\twhere t2.parent_id = t1.id\n" + "\t)\n" + "\tsearch DEPTH first by id set order1\n" + "select id, parent_id\n" + "\t, RPAD('.', (lvl - 1) * 2, '.') || id as tree\n" + "\t, lvl\n" + "from t1\n" + "order by order1;", text); } } }
[ "372822716@qq.com" ]
372822716@qq.com
ad82a6fadc1bd4a70e8dacdf0b3a0250b04d907e
8136209b36c10908613aef25a2845234a5a7c839
/src/test/java/CSE564_Project_Spring2020/sim/ExperimentGyroDataListener.java
d6e69cd067e8c2cb1cba1f8058846b8ba9441df5
[]
no_license
gtscherer/CSE564_Project_Spring2020
1ea0194538710852bc0b96ef98e48ac33bf9de2c
c80588a42c0de752df5ace23586f6c0fab5cdbb4
refs/heads/master
2021-03-10T10:31:59.151340
2020-04-27T18:50:04
2020-04-27T18:50:04
246,445,509
1
1
null
2020-04-21T02:35:20
2020-03-11T01:24:20
Java
UTF-8
Java
false
false
1,803
java
package CSE564_Project_Spring2020.sim; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class ExperimentGyroDataListener implements DataListener { private List<ExperimentGyroData> gyroTable; private long time; private Boolean[] valuesSet; public ExperimentGyroDataListener() { gyroTable = new ArrayList<ExperimentGyroData>(); time = 0l; valuesSet = new Boolean[]{false, false, false}; } @Override public void dataChanged(DataChangeEvent e) { final DataType type = e.getType(); final ExperimentGyroData previousRow = gyroTable.isEmpty() ? new ExperimentGyroData() : gyroTable.get(gyroTable.size() - 1); if (type == DataType.WorldTime) { if (!allSet() && gyroTable.size() > 1) { final ExperimentGyroData rowBeforePrevious = gyroTable.get(gyroTable.size() - 2); if (!valuesSet[0]) previousRow.roll = rowBeforePrevious.roll; if (!valuesSet[1]) previousRow.pitch = rowBeforePrevious.pitch; if (!valuesSet[2]) previousRow.yaw = rowBeforePrevious.yaw; } ExperimentGyroData newRow = new ExperimentGyroData(); newRow.time = ++time; gyroTable.add(newRow); Arrays.fill(valuesSet, Boolean.FALSE); } else if (type == DataType.GyroRoll) { previousRow.roll = Double.parseDouble(e.getValue()); valuesSet[0] = Boolean.TRUE; } else if (type == DataType.GyroPitch) { previousRow.pitch = Double.parseDouble(e.getValue()); valuesSet[1] = Boolean.TRUE; } else if (type == DataType.GyroYaw) { previousRow.yaw = Double.parseDouble(e.getValue()); valuesSet[2] = Boolean.TRUE; } } public List<ExperimentGyroData> getTable() { return gyroTable; } private Boolean allSet() { return Arrays.stream(valuesSet).reduce((Boolean lhs, Boolean rhs) -> Boolean.logicalAnd(lhs, rhs)).get(); } }
[ "gtscherer@gmail.com" ]
gtscherer@gmail.com
3ff481433e40808d9a9ddebf1d2f6acca9f4d03d
ef0c1514e9af6de3ba4a20e0d01de7cc3a915188
/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/guava25/collect/Multimap.java
d09ab83b7fc5b7d6b34574506a1281870cbdb654
[ "MIT", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-or-later", "CC0-1.0", "BSD-3-Clause", "UPL-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-generic-cla" ]
permissive
Azure/azure-sdk-for-java
0902d584b42d3654b4ce65b1dad8409f18ddf4bc
789bdc6c065dc44ce9b8b630e2f2e5896b2a7616
refs/heads/main
2023-09-04T09:36:35.821969
2023-09-02T01:53:56
2023-09-02T01:53:56
2,928,948
2,027
2,084
MIT
2023-09-14T21:37:15
2011-12-06T23:33:56
Java
UTF-8
Java
false
false
15,668
java
/* * Copyright (C) 2007 The Guava Authors * * 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. */ /* * Portions Copyright (c) Microsoft Corporation */ package com.azure.cosmos.implementation.guava25.collect; import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.function.BiConsumer; /** * A collection that maps keys to values, similar to {@link Map}, but in which each key may be * associated with <i>multiple</i> values. You can visualize the contents of a multimap either as a * map from keys to <i>nonempty</i> collections of values: * * <ul> * <li>a → 1, 2 * <li>b → 3 * </ul> * * ... or as a single "flattened" collection of key-value pairs: * * <ul> * <li>a → 1 * <li>a → 2 * <li>b → 3 * </ul> * * <p><b>Important:</b> although the first interpretation resembles how most multimaps are * <i>implemented</i>, the design of the {@code Multimap} API is based on the <i>second</i> form. * So, using the multimap shown above as an example, the {@link #size} is {@code 3}, not {@code 2}, * and the {@link #values} collection is {@code [1, 2, 3]}, not {@code [[1, 2], [3]]}. For those * times when the first style is more useful, use the multimap's {@link #asMap} view (or create a * {@code Map<K, Collection<V>>} in the first place). * * <h3>Example</h3> * * <p>The following code: * * <pre>{@code * ListMultimap<String, String> multimap = ArrayListMultimap.create(); * for (President pres : US_PRESIDENTS_IN_ORDER) { * multimap.put(pres.firstName(), pres.lastName()); * } * for (String firstName : multimap.keySet()) { * List<String> lastNames = multimap.get(firstName); * out.println(firstName + ": " + lastNames); * } * }</pre> * * ... produces output such as: * * <pre>{@code * Zachary: [Taylor] * John: [Adams, Adams, Tyler, Kennedy] // Remember, Quincy! * George: [Washington, Bush, Bush] * Grover: [Cleveland, Cleveland] // Two, non-consecutive terms, rep'ing NJ! * ... * }</pre> * * <h3>Views</h3> * * <p>Much of the power of the multimap API comes from the <i>view collections</i> it provides. * These always reflect the latest state of the multimap itself. When they support modification, the * changes are <i>write-through</i> (they automatically update the backing multimap). These view * collections are: * * <ul> * <li>{@link #asMap}, mentioned above * <li>{@link #keys}, {@link #keySet}, {@link #values}, {@link #entries}, which are similar to the * corresponding view collections of {@link Map} * <li>and, notably, even the collection returned by {@link #get get(key)} is an active view of * the values corresponding to {@code key} * </ul> * * <p>The collections returned by the {@link #replaceValues replaceValues} and {@link #removeAll * removeAll} methods, which contain values that have just been removed from the multimap, are * naturally <i>not</i> views. * * <h3>Subinterfaces</h3> * * <p>Instead of using the {@code Multimap} interface directly, prefer the subinterfaces {@link * ListMultimap} and {@link SetMultimap}. These take their names from the fact that the collections * they return from {@code get} behave like (and, of course, implement) {@link List} and {@link * Set}, respectively. * * <p>For example, the "presidents" code snippet above used a {@code ListMultimap}; if it had used a * {@code SetMultimap} instead, two presidents would have vanished, and last names might or might * not appear in chronological order. * * <p><b>Warning:</b> instances of type {@code Multimap} may not implement {@link Object#equals} in * the way you expect. Multimaps containing the same key-value pairs, even in the same order, may or * may not be equal and may or may not have the same {@code hashCode}. The recommended subinterfaces * provide much stronger guarantees. * * <h3>Comparison to a map of collections</h3> * * <p>Multimaps are commonly used in places where a {@code Map<K, Collection<V>>} would otherwise * have appeared. The differences include: * * <ul> * <li>There is no need to populate an empty collection before adding an entry with {@link #put * put}. * <li>{@code get} never returns {@code null}, only an empty collection. * <li>A key is contained in the multimap if and only if it maps to at least one value. Any * operation that causes a key to have zero associated values has the effect of * <i>removing</i> that key from the multimap. * <li>The total entry count is available as {@link #size}. * <li>Many complex operations become easier; for example, {@code * Collections.min(multimap.values())} finds the smallest value across all keys. * </ul> * * <h3>Implementations</h3> * * <p>As always, prefer the immutable implementations, {@link ImmutableListMultimap} and {@link * ImmutableSetMultimap}. General-purpose mutable implementations are listed above under "All Known * Implementing Classes". You can also create a <i>custom</i> multimap, backed by any {@code Map} * and {@link Collection} types, using the {@link Multimaps#newMultimap Multimaps.newMultimap} * family of methods. Finally, another popular way to obtain a multimap is using {@link * Multimaps#index Multimaps.index}. See the {@link Multimaps} class for these and other static * utilities related to multimaps. * * <h3>Other Notes</h3> * * <p>As with {@code Map}, the behavior of a {@code Multimap} is not specified if key objects * already present in the multimap change in a manner that affects {@code equals} comparisons. Use * caution if mutable objects are used as keys in a {@code Multimap}. * * <p>All methods that modify the multimap are optional. The view collections returned by the * multimap may or may not be modifiable. Any modification method that is not supported will throw * {@link UnsupportedOperationException}. * * <p>See the Guava User Guide article on <a href= * "https://github.com/google/guava/wiki/NewCollectionTypesExplained#multimap"> {@code * Multimap}</a>. * * @author Jared Levy * @since 2.0 */ public interface Multimap<K, V> { // Query Operations /** * Returns the number of key-value pairs in this multimap. * * <p><b>Note:</b> this method does not return the number of <i>distinct keys</i> in the multimap, * which is given by {@code keySet().size()} or {@code asMap().size()}. See the opening section of * the {@link Multimap} class documentation for clarification. */ int size(); /** * Returns {@code true} if this multimap contains no key-value pairs. Equivalent to {@code size() * == 0}, but can in some cases be more efficient. */ boolean isEmpty(); /** * Returns {@code true} if this multimap contains at least one key-value pair with the key {@code * key}. */ boolean containsKey(/*@CompatibleWith("K")*/ Object key); /** * Returns {@code true} if this multimap contains at least one key-value pair with the value * {@code value}. */ boolean containsValue(/*@CompatibleWith("V")*/ Object value); /** * Returns {@code true} if this multimap contains at least one key-value pair with the key {@code * key} and the value {@code value}. */ boolean containsEntry( /*@CompatibleWith("K")*/ Object key, /*@CompatibleWith("V")*/ Object value); // Modification Operations /** * Stores a key-value pair in this multimap. * * <p>Some multimap implementations allow duplicate key-value pairs, in which case {@code put} * always adds a new key-value pair and increases the multimap size by 1. Other implementations * prohibit duplicates, and storing a key-value pair that's already in the multimap has no effect. * * @return {@code true} if the method increased the size of the multimap, or {@code false} if the * multimap already contained the key-value pair and doesn't allow duplicates */ boolean put(K key, V value); /** * Removes a single key-value pair with the key {@code key} and the value {@code value} from this * multimap, if such exists. If multiple key-value pairs in the multimap fit this description, * which one is removed is unspecified. * * @return {@code true} if the multimap changed */ boolean remove( /*@CompatibleWith("K")*/ Object key, /*@CompatibleWith("V")*/ Object value); // Bulk Operations /** * Stores a key-value pair in this multimap for each of {@code values}, all using the same key, * {@code key}. Equivalent to (but expected to be more efficient than): * * <pre>{@code * for (V value : values) { * put(key, value); * } * }</pre> * * <p>In particular, this is a no-op if {@code values} is empty. * * @return {@code true} if the multimap changed */ boolean putAll(K key, Iterable<? extends V> values); /** * Stores all key-value pairs of {@code multimap} in this multimap, in the order returned by * {@code multimap.entries()}. * * @return {@code true} if the multimap changed */ boolean putAll(Multimap<? extends K, ? extends V> multimap); /** * Stores a collection of values with the same key, replacing any existing values for that key. * * <p>If {@code values} is empty, this is equivalent to {@link #removeAll(Object) removeAll(key)}. * * @return the collection of replaced values, or an empty collection if no values were previously * associated with the key. The collection <i>may</i> be modifiable, but updating it will have * no effect on the multimap. */ Collection<V> replaceValues(K key, Iterable<? extends V> values); /** * Removes all values associated with the key {@code key}. * * <p>Once this method returns, {@code key} will not be mapped to any values, so it will not * appear in {@link #keySet()}, {@link #asMap()}, or any other views. * * @return the values that were removed (possibly empty). The returned collection <i>may</i> be * modifiable, but updating it will have no effect on the multimap. */ Collection<V> removeAll(/*@CompatibleWith("K")*/ Object key); /** Removes all key-value pairs from the multimap, leaving it {@linkplain #isEmpty empty}. */ void clear(); // Views /** * Returns a view collection of the values associated with {@code key} in this multimap, if any. * Note that when {@code containsKey(key)} is false, this returns an empty collection, not {@code * null}. * * <p>Changes to the returned collection will update the underlying multimap, and vice versa. */ Collection<V> get(K key); /** * Returns a view collection of all <i>distinct</i> keys contained in this multimap. Note that the * key set contains a key if and only if this multimap maps that key to at least one value. * * <p>Changes to the returned set will update the underlying multimap, and vice versa. However, * <i>adding</i> to the returned set is not possible. */ Set<K> keySet(); /** * Returns a view collection containing the key from each key-value pair in this multimap, * <i>without</i> collapsing duplicates. This collection has the same size as this multimap, and * {@code keys().count(k) == get(k).size()} for all {@code k}. * * <p>Changes to the returned multiset will update the underlying multimap, and vice versa. * However, <i>adding</i> to the returned collection is not possible. */ Multiset<K> keys(); /** * Returns a view collection containing the <i>value</i> from each key-value pair contained in * this multimap, without collapsing duplicates (so {@code values().size() == size()}). * * <p>Changes to the returned collection will update the underlying multimap, and vice versa. * However, <i>adding</i> to the returned collection is not possible. */ Collection<V> values(); /** * Returns a view collection of all key-value pairs contained in this multimap, as {@link Entry} * instances. * * <p>Changes to the returned collection or the entries it contains will update the underlying * multimap, and vice versa. However, <i>adding</i> to the returned collection is not possible. */ Collection<Entry<K, V>> entries(); /** * Performs the given action for all key-value pairs contained in this multimap. If an ordering is * specified by the {@code Multimap} implementation, actions will be performed in the order of * iteration of {@link #entries()}. Exceptions thrown by the action are relayed to the caller. * * <p>To loop over all keys and their associated value collections, write {@code * Multimaps.asMap(multimap).forEach((key, valueCollection) -> action())}. * * @since 21.0 */ default void forEach(BiConsumer<? super K, ? super V> action) { checkNotNull(action); entries().forEach(entry -> action.accept(entry.getKey(), entry.getValue())); } /** * Returns a view of this multimap as a {@code Map} from each distinct key to the nonempty * collection of that key's associated values. Note that {@code this.asMap().get(k)} is equivalent * to {@code this.get(k)} only when {@code k} is a key contained in the multimap; otherwise it * returns {@code null} as opposed to an empty collection. * * <p>Changes to the returned map or the collections that serve as its values will update the * underlying multimap, and vice versa. The map does not support {@code put} or {@code putAll}, * nor do its entries support {@link Entry#setValue setValue}. */ Map<K, Collection<V>> asMap(); // Comparison and hashing /** * Compares the specified object with this multimap for equality. Two multimaps are equal when * their map views, as returned by {@link #asMap}, are also equal. * * <p>In general, two multimaps with identical key-value mappings may or may not be equal, * depending on the implementation. For example, two {@link SetMultimap} instances with the same * key-value mappings are equal, but equality of two {@link ListMultimap} instances depends on the * ordering of the values for each key. * * <p>A non-empty {@link SetMultimap} cannot be equal to a non-empty {@link ListMultimap}, since * their {@link #asMap} views contain unequal collections as values. However, any two empty * multimaps are equal, because they both have empty {@link #asMap} views. */ @Override boolean equals(Object obj); /** * Returns the hash code for this multimap. * * <p>The hash code of a multimap is defined as the hash code of the map view, as returned by * {@link Multimap#asMap}. * * <p>In general, two multimaps with identical key-value mappings may or may not have the same * hash codes, depending on the implementation. For example, two {@link SetMultimap} instances * with the same key-value mappings will have the same {@code hashCode}, but the {@code hashCode} * of {@link ListMultimap} instances depends on the ordering of the values for each key. */ @Override int hashCode(); }
[ "noreply@github.com" ]
Azure.noreply@github.com
91f3f9818bf06a632a2555226ef96cfa8402bd45
bf0a59f9e364e6d6d11e77581f58e8dfac8b6e8e
/src/main/java/org/speakingcs/corejava/overloading/OverloadingTest.java
ad8850accf4504156b4525b74897345804bd3a4d
[]
no_license
ulasalasreenath/corejava
fd2f4d3220c2eb8dd47126ebe4dc78815c6fa20f
45b9ba83de1c3e3eb0179a326c85027604637efe
refs/heads/master
2021-01-23T06:25:17.403565
2018-10-23T09:18:41
2018-10-23T09:18:41
86,365,376
0
0
null
null
null
null
UTF-8
Java
false
false
453
java
package org.speakingcs.corejava.overloading; public class OverloadingTest { public static void main(String[] args) { print(5); byte b = 10; print(b); } static void print(Integer i) { System.out.println("It's integer " + i); } static void print(Long l) { System.out.println("It's long " + l); } static void print(byte c) { System.out.println("It's byte " + c); } }
[ "Ulasala.Sreenath@altisource.com" ]
Ulasala.Sreenath@altisource.com
df8c44fd22f3433da3ac8e47bf0a945690e1828e
528fefaf685c0be974bcdf5e633ca0c936e50a65
/MultiThreading/src/Paralelismo/VentanaDemora.java
f3f74b39a6a11fa7d0a810b5c1bf6f007cfb39b1
[]
no_license
satfail/JavaUcamWorkspace
2890ec521fc1315da59b292214b27143c765244a
b85a0ef5e5ed504bc4e4db7f39e5bbcdd67f4578
refs/heads/master
2020-12-28T08:40:26.255984
2020-02-07T12:05:33
2020-02-07T12:05:33
238,249,590
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
1,166
java
package Paralelismo; import java.awt.*; import java.awt.event.*; //Con esta demostracion vemos que si no separamos en un Thread la ejecucion de lo que realiza el boton // La ventana parecerá congelada hasta que se termine la ejecucion lineal que realiza el boton public class VentanaDemora extends Frame { private Button boton; private Choice combo; public VentanaDemora() { setLayout(new FlowLayout()); add(boton = new Button ("Esto va a demorar...")); boton.addActionListener(new EscuchaBoton()); //Acion que va a realizar el boton add ( combo = new Choice() ); //boton tipo choice, con lista de elementos combo.addItem("Item 1"); combo.addItem("Item 2"); combo.addItem("Item 3"); setSize(300, 300); setVisible(true); } class EscuchaBoton implements ActionListener{ public void actionPerformed (ActionEvent e) { //Lo que hacemos al pulsar el boton try { Thread.sleep(10000); System.out.println("Termino la espera...!"); } catch(Exception ex){ ex.printStackTrace(); throw new RuntimeException(ex); } } } public static void main(String[] args) { new VentanaDemora(); } }
[ "satfail@gmail.com" ]
satfail@gmail.com
fef8144c4d6973e68e0a123257215187aff9cca6
93cdf8af0037ad8cf8646e3f6b128db41e4b7788
/src/project/engine/data/VOEnvironment.java
9a67a6a2806336a380674cd36beb725c5a5d6bf4
[]
no_license
dmieter/mimapr-old
6b9bc657de29a66611ba946587c84c86deede36a
ef1796c16fb04fcc5f784327f13547d292167549
refs/heads/master
2022-03-18T13:44:40.557812
2017-10-14T08:58:29
2017-10-14T08:58:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,343
java
package project.engine.data; import java.io.Serializable; import project.engine.data.environmentGenerator.EnvironmentPricingSettings; import java.util.ArrayList; import java.util.Random; import project.math.distributions.GaussianFacade; import project.math.distributions.GaussianSettings; /** * Created by IntelliJ IDEA. * User: Rookie * Date: 07.04.2010 * Time: 2:00:42 * To change this template use File | Settings | File Templates. */ public class VOEnvironment implements Serializable { public ArrayList<ResourceLine> resourceLines; public EnvironmentPricingSettings pcSettings; public VOEnvironment() { resourceLines = new ArrayList<ResourceLine>(); } public double getTotalOccupancy() { double s = 0; for (ResourceLine rLine: resourceLines) { s += rLine.getTotalOccupancyTime(); } return s; } private void calculateNLConsts() { if (pcSettings != null && pcSettings.lengthLevels != null && pcSettings.lengthLevels.length > 1 && pcSettings.lengthPriceQuotients != null && pcSettings.lengthPriceQuotients.length == pcSettings.lengthLevels.length) { pcSettings.lengthConsts = new double[pcSettings.lengthLevels.length]; pcSettings.lengthConsts[0] = 0.0; for (int i=1; i< pcSettings.lengthConsts.length; i++) { pcSettings.lengthConsts[i] = -pcSettings.lengthLevels[i]*pcSettings.lengthPriceQuotients[i] + pcSettings.lengthLevels[i]*pcSettings.lengthPriceQuotients[i-1] + pcSettings.lengthConsts[i-1]; } } } public void applyPricing(EnvironmentPricingSettings pcSettings) { for (ResourceLine rline: resourceLines) { GaussianSettings gs = new GaussianSettings(-pcSettings.priceMutationFactor, 0, pcSettings.priceMutationFactor); GaussianFacade generator = new GaussianFacade(gs); //double mutationPriceCoef = pcSettings.priceMutationFactor*(1 - 2*(new Random().nextDouble())) + 1; double mutationPriceCoef = 1 + generator.getRandom(); if(mutationPriceCoef<0) mutationPriceCoef=0; if (pcSettings != null && pcSettings.speedLevels != null && pcSettings.speedLevels.length > 1 && pcSettings.speedPriceQuotients != null && pcSettings.speedPriceQuotients.length == pcSettings.speedLevels.length) { for (int i=pcSettings.speedLevels.length - 1; i>=0; i--) { if (rline.getSpeed()>= pcSettings.speedLevels[i]) { mutationPriceCoef = pcSettings.speedPriceQuotients[i]; rline.price = rline.getSpeed()*mutationPriceCoef; break; } } } else{ //rline.price = rline.getSpeed()*pcSettings.priceQuotient*mutationPriceCoef; //rline.price*= (1+(rline.getSpeed()*pcSettings.speedExtraCharge)/100); rline.price = rline.getSpeed()*Math.exp(pcSettings.speedExtraCharge*(rline.getSpeed()-1)); rline.price *= pcSettings.priceQuotient*mutationPriceCoef; int b = 0; } } this.pcSettings = pcSettings; calculateNLConsts(); } public double getSlotCost(double price, double length) { if (pcSettings != null && pcSettings.lengthLevels != null && pcSettings.lengthLevels.length > 1 && pcSettings.lengthPriceQuotients != null && pcSettings.lengthPriceQuotients.length == pcSettings.lengthLevels.length) { for (int i=pcSettings.lengthLevels.length -1; i>=0; i--) { if (length >= pcSettings.lengthLevels[i]) { return (price*pcSettings.lengthPriceQuotients[i] + pcSettings.lengthConsts[i])*length; } } } return price*length; } public void debugInfo() { for (ResourceLine rline: resourceLines) System.out.println(rline.debugInfo()); } }
[ "dmieter@yahoo.com" ]
dmieter@yahoo.com
654a116405f4ac7bc22a7000c533490d4fcd1bb5
ee562671c918c96183a77bce5bb19225f7dfc20c
/test/org/ayaseeli/someday/lib/cron/WeekFieldTest.java
2324ffde0e65daa4d8f08b3bd1c9dd3dd7bed65d
[]
no_license
MisumiRize/someday-cronparser
11ec2f0ab5046512362deb14c758b0badc4566bf
053655378fb9883f0461b013690e13a917274087
refs/heads/master
2016-09-05T17:30:11.002993
2014-04-29T06:44:30
2014-04-29T06:44:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,001
java
package org.ayaseeli.someday.lib.cron; import static org.junit.Assert.*; import java.util.Calendar; import org.junit.Before; import org.junit.Test; public class WeekFieldTest { Calendar now; @Before public void setUp() throws Exception { now = Calendar.getInstance(); now.set(2014, 3, 26, 10, 24, 15); } @Test public void testPostpone_willReturnSunday_whenCandidateIs0() { WeekField field = new WeekField(new Operator("0")); Calendar postponed = field.postpone(now); assertEquals(postponed.get(Calendar.DATE), 27); assertEquals(postponed.get(Calendar.DAY_OF_WEEK), Calendar.SUNDAY); } @Test public void testPostpone_willReturnSunday_whenCandidateIs7() { WeekField field = new WeekField(new Operator("7")); Calendar postponed = field.postpone(now); assertEquals(postponed.get(Calendar.DATE), 27); assertEquals(postponed.get(Calendar.DAY_OF_WEEK), Calendar.SUNDAY); } }
[ "r@ayase-e.li" ]
r@ayase-e.li
045f0a81958606740af6249c287ea75409c7346e
5ed87d7f04886d78c806494a22bc296212755650
/Example01/src/main/java/com/opdar/fullstack/framework/RequestObject.java
5d6f558f127292a9607e523e429a889f870a4156
[ "Apache-2.0" ]
permissive
framework4j/fullstack
89610b977dddeb9d7a8e5baf30219e510606bd12
5edad15c72e1a9b1c85cfe3cb33668d79776c796
refs/heads/master
2021-01-10T11:45:02.569263
2015-11-30T06:23:36
2015-11-30T06:23:36
47,098,757
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
package com.opdar.fullstack.framework; import java.util.HashMap; import java.util.Map; public class RequestObject { private Map<String, String> values = new HashMap<String, String>(); private String routerName = null; public void setValues(Map<String, String> values) { if(values != null) this.values.putAll(values); } public Map<String, String> getValues() { return values; } public Integer getIntValue(String key){ String value = null; if(values.containsKey(key)){ value = values.get(key); } if(value != null){ return Integer.valueOf(value); } return null; } public Double getDoubleValue(String key){ String value = null; if(values.containsKey(key)){ value = values.get(key); } if(value != null){ return Double.valueOf(value); } return null; } public String getStringValue(String key){ String value = null; if(values.containsKey(key)){ value = values.get(key); } return value; } public String getRouterName() { return routerName; } public void setRouterName(String routerName) { this.routerName = routerName; } @Override public String toString() { return "RequestObject [values=" + values + ", routerName=" + routerName + "]"; } }
[ "shijunfan@gmail.com" ]
shijunfan@gmail.com
5eb2230abd1ac2c5633792478260aa34d05a1869
f1702690c90553a8498b25d99a4b450401827a6e
/java/src/main/tdanford/db/CostModel.java
14ad43592155b8b97a5c6e985b14bcf2fc56308a
[]
no_license
tdanford/rdf-utils
61f3d35b5e621f8d27e79c64031ea0b65d1888f8
baf3253d3c649934781d02c8b35de313ffb59ad7
refs/heads/master
2021-01-25T05:16:23.767617
2010-12-22T12:28:29
2010-12-22T12:28:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
120
java
package tdanford.db; import java.util.*; public interface CostModel { public int scan(); public int throughput(); }
[ "tdanford@gmail.com" ]
tdanford@gmail.com
0b1ee81ff1101dc5f180fc481c2e0bcca36f881a
361eaa7c307793e7c66d8450710d394c6e8f5d13
/JJshopProject/src/board/BoardFactory.java
64cd5ec44464a2506b3f886865beee0d6a39d812
[]
no_license
kjc4028/JJProject
16c0fecf7e139f825d6f12fd2e9cd63dcec836ba
493eb6a29836a22f2ae081b7deb972ff7df74897
refs/heads/master
2020-12-30T10:37:31.699358
2017-07-31T05:35:57
2017-07-31T05:35:57
98,851,463
0
0
null
null
null
null
UTF-8
Java
false
false
938
java
package board; public class BoardFactory { private BoardFactory(){} private static BoardFactory instance = new BoardFactory(); public static BoardFactory getInstance(){ return instance; } public CommandIf createCommand(String cmd){ CommandIf cmdIf = null; if (cmd.equals("/list.board")){ cmdIf = new ListCommand(); }else if (cmd.equals("/write_form.board")){ cmdIf = new WriteFormCommand(); }else if (cmd.equals("/write_pro.board")){ cmdIf = new WriteProCommand(); }else if (cmd.equals("/content.board")){ cmdIf = new ContentCommand(); }else if (cmd.equals("/delete_form.board")){ cmdIf = new DeleteFormCommand(); }else if (cmd.equals("/delete_pro.board")){ cmdIf = new DeleteProCommand(); }else if (cmd.equals("/update_form.board")){ cmdIf = new UpdateFormCommand(); }else if (cmd.equals("/update_pro.board")){ cmdIf = new UpdateProCommand(); } return cmdIf; } }
[ "whd4028@gmail.com" ]
whd4028@gmail.com
2ba9cc5e50ca3ef89377b5b475c65569b6cf5dcc
e95afc5aee67895f8f53744f0c28671dfb4ff03d
/SITURBB/src/main/java/br/ufrn/imd/controllers/CadastrarEmpresaMBean.java
121e09e4cd34471fcc61780fec94f0eca9be1b7f
[ "MIT" ]
permissive
heloisaldanha/SITURB
1cc06cd9d8afb35f1b9e7ce4c8be3458400b295b
f1a8c809c05dddc95d181a25e098aa8741f3712d
refs/heads/main
2023-02-01T18:02:34.476249
2020-12-10T14:14:06
2020-12-10T14:14:06
320,283,911
1
0
null
null
null
null
UTF-8
Java
false
false
1,317
java
package br.ufrn.imd.controllers; import java.util.ArrayList; import java.util.List; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.context.FacesContext; import br.ufrn.imd.model.Empresa; /** * Controller para cadastro das empresas. * @author heloisasaldanha * */ @SessionScoped @ManagedBean (name = "Empresa") public class CadastrarEmpresaMBean { private Empresa empresa; private List<Empresa> empresas; public CadastrarEmpresaMBean() { empresa = new Empresa(); empresas = new ArrayList<Empresa>(); } public String entrarCadastro() { return "/form_empresa.xhtml"; } public String voltar() { return "/index.xhtml"; } public String cadastrar() { empresas.add(empresa); empresa = new Empresa(); FacesMessage msg = new FacesMessage("Empresa cadastrada com sucesso!"); msg.setSeverity(FacesMessage.SEVERITY_INFO); FacesContext.getCurrentInstance().addMessage("", msg); return "/form_empresa.xhtml"; } public Empresa getEmpresa() { return empresa; } public void setEmpresa(Empresa empresa) { this.empresa = empresa; } public List<Empresa> getEmpresas() { return empresas; } public void setEmpresas(List<Empresa> empresas) { this.empresas = empresas; } }
[ "noreply@github.com" ]
heloisaldanha.noreply@github.com
ac09a8ffafa5d896b4eee2ef2f815fb598261a91
132c54e20e51e800ed8d66be302644c0b7e5107a
/src/main/java/com/dawang/introjava/comprehensive/fx/DawangArc.java
29c9111adaad5f6d6f2790195b7a5ce1ed3be0e5
[]
no_license
wdq007/dawang
c411d784a694f426ea6dce9bbc1e1df298aabb2e
5ff0f02625b13e1cc5ab98175a2b8c7457ac451c
refs/heads/main
2021-06-24T08:44:21.125119
2021-03-03T15:09:34
2021-03-03T15:09:34
204,094,615
0
0
null
null
null
null
UTF-8
Java
false
false
1,462
java
package com.dawang.introjava.comprehensive.fx; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.shape.Arc; import javafx.scene.shape.ArcType; import javafx.scene.text.Text; import javafx.stage.Stage; public class DawangArc extends Application { @Override public void start(Stage primaryStage){ Pane pane = new Pane(); Arc r1 = new Arc(150,100,80,80,30,50); r1.setFill(Color.RED); r1.setType(ArcType.ROUND); pane.getChildren().addAll(new Text(210,40,"arc1:round"),r1); Arc r2 = new Arc(150,100,80,80,30+90,50); r2.setFill(Color.WHITE); r2.setType(ArcType.OPEN); r2.setStroke(Color.BLACK); pane.getChildren().addAll(new Text(20,40,"arc2:open"),r2); Arc r3 = new Arc(150,100,80,80,30+180,50); r3.setFill(Color.GREEN); r3.setType(ArcType.CHORD); r3.setStroke(Color.BLUE); pane.getChildren().addAll(new Text(20,170,"arc3:chord"),r3); Arc r4 = new Arc(150,100,80,80,30+270,50); r4.setFill(Color.YELLOW); r4.setType(ArcType.CHORD); r4.setStroke(Color.BLACK); pane.getChildren().addAll(new Text(210,170,"arc4:chord"),r4); Scene scene = new Scene(pane,300,300); primaryStage.setTitle("DawangArc"); primaryStage.setScene(scene); primaryStage.show(); } }
[ "wdq007@icloud.com" ]
wdq007@icloud.com
6f67f589fc27dbe94d81a56ebc6311a703c40a61
4cd761ffeda87edd78ccd18df4e735c9916beaea
/app/src/main/java/com/app/barber/models/response/ResponseAvailableSlotsModel.java
625bf346b3fffa1fe37fcd3aa9c102098d2dc130
[ "MIT" ]
permissive
ArisChoice/AppUser
df845e0b42806f4cc3f27d3b21ccafc2af5c7d9b
186e6085e3f40897701c147bf64971325c757c70
refs/heads/master
2020-04-27T10:52:58.289238
2019-03-07T04:53:07
2019-03-07T04:53:07
174,273,512
0
0
null
null
null
null
UTF-8
Java
false
false
1,070
java
package com.app.barber.models.response; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; import java.util.List; /** * Created by harish on 17/12/18. */ public class ResponseAvailableSlotsModel { /** * Message : TimeSlotList * Status : 201 * List : ["09:00 AM-09:50 AM","09:50 AM-10:40 AM","10:40 AM-11:30 AM","11:30 AM-12:20 PM","03:40 PM-04:30 PM","04:30 PM-05:20 PM","05:20 PM-06:10 PM"] */ @SerializedName("Message") private String Message; @SerializedName("Status") private int Status; @SerializedName("List") private ArrayList<String> List; public String getMessage() { return Message; } public void setMessage(String Message) { this.Message = Message; } public int getStatus() { return Status; } public void setStatus(int Status) { this.Status = Status; } public ArrayList<String> getList() { return List; } public void setList(ArrayList<String> List) { this.List = List; } }
[ "harish@xicom.biz" ]
harish@xicom.biz
4254b0bfaabbfcf667ddce746299411ef6f1e794
c9811ffae682022267d1e7cbf906ac6201c3c296
/ghealth-mgmt/src/main/java/com/todaysoft/ghealth/model/item/TestingItemSearcher.java
d245614ba5d81b1a75c72ae6b1a64d420e04cdd8
[]
no_license
youlangzuishuai/ghealth-aggregator
cfd3f7912ff185cb5a11c50dd1ac965c595ea964
90ac4b689435b9d92965cf4663af070887a8a689
refs/heads/master
2021-04-18T18:53:25.255387
2018-03-26T08:11:46
2018-03-26T08:12:23
104,460,975
0
0
null
null
null
null
UTF-8
Java
false
false
427
java
package com.todaysoft.ghealth.model.item; public class TestingItemSearcher { private String code; private String name; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "1021609209@qq.com" ]
1021609209@qq.com
1693f0d1b2646c940d2ed8ad907ebf193af036ad
5d2091918b8542b149e60672aff074fd7cce66be
/core/src/com/quadrolord/epicbattle/logic/tower/TowerUnitHeapNode.java
ef76aac6f08a243af58805e488428c084992a824
[]
no_license
quadrowin/epic-battle
aeeb9d2716a746ebaa805560862901fbd2f95e5a
df264ab4fe919357fdb8ac26c1ae72450eb352c2
refs/heads/master
2021-03-24T12:12:07.944166
2016-10-30T16:53:20
2016-10-30T16:53:20
49,290,919
2
3
null
null
null
null
UTF-8
Java
false
false
540
java
package com.quadrolord.epicbattle.logic.tower; import com.badlogic.gdx.utils.BinaryHeap; import com.quadrolord.epicbattle.logic.bullet.worker.AbstractBullet; /** * Created by Goorus on 02.08.2016. */ public class TowerUnitHeapNode { public float value; public int index; private GameUnit mUnit; public TowerUnitHeapNode(GameUnit unit) { value = unit.getX(); mUnit = unit; } public GameUnit getUnit() { return mUnit; } public float getValue() { return value; } }
[ "quadrowin@gmail.com" ]
quadrowin@gmail.com
99db192eb1bbe8f42feb479583ca9b3cbb28bbb4
57a752e694253b4b1e3f7b8211aef991d187251c
/piccolo2d.java/tags/release-1.3.1-rc1/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java
4342f4f5cb0e9dbfea55b1e7855914c7335de8d5
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
tmpkus/piccolo2d
e8a1861cd666d2622825a63a5c91acfae9b812b8
fe86bb2ebc6d44a2f40c39a4ac6fb1b4204494b8
refs/heads/master
2020-06-05T17:18:45.675572
2015-04-15T15:29:37
2015-04-15T15:29:37
35,679,848
0
0
null
null
null
null
UTF-8
Java
false
false
29,581
java
/* * Copyright (c) 2008, Piccolo2D project, http://piccolo2d.org * Copyright (c) 1998-2008, University of Maryland * 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. * * None of the name of the University of Maryland, the name of the Piccolo2D project, or 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 edu.umd.cs.piccolox.pswing; import edu.umd.cs.piccolo.PCamera; import edu.umd.cs.piccolo.PLayer; import edu.umd.cs.piccolo.PNode; import edu.umd.cs.piccolo.util.PBounds; import edu.umd.cs.piccolo.util.PPaintContext; import javax.swing.JComponent; import javax.swing.RepaintManager; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Font; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.event.ContainerAdapter; import java.awt.event.ContainerEvent; import java.awt.event.ContainerListener; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; /* This message was sent to Sun on August 27, 1999 ----------------------------------------------- We are currently developing Piccolo, a "scenegraph" for use in 2D graphics. One of our ultimate goals is to support Swing lightweight components within Piccolo, whose graphical space supports arbitray affine transforms. The challenge in this pursuit is getting the components to respond and render properly though not actually displayed in a standard Java component hierarchy. The first issues involved making the Swing components focusable and showing. This was accomplished by adding the Swing components to a 0x0 JComponent which was in turn added to our main Piccolo application component. To our good fortune, a Java component is showing merely if it and its ancestors are showing and not based on whether it is ACTUALLY visible. Likewise, focus in a JComponent depends merely on the component's containing window having focus. The second issue involved capturing the repaint calls on a Swing component. Normally, for a repaint and the consequent call to paintImmediately, a Swing component obtains the Graphics object necessary to render itself through the Java component heirarchy. However, for Piccolo we would like the component to render using a Graphics object that Piccolo may have arbitrarily transformed in some way. By capturing in the RepaintManager the repaint calls made on our special Swing components, we are able to redirect the repaint requests through the Piccolo architecture to put the Graphics in its proper context. Unfortunately, this means that if the Swing component contains other Swing components, then any repaint requests made by one of these nested components must go through the Piccolo architecture then through the top level Swing component down to the nested Swing component. This normally doesn't cause a problem. However, if calling paint on one of these nested children causes a call to repaint then an infinite loop ensues. This does in fact happen in the Swing components that use cell renderers. Before the cell renderer is painted, it is invalidated and consequently repainted. We solved this problem by putting a lock on repaint calls for a component while that component is painting. (A similar problem faced the Swing team over this same issue. They solved it by inserting a CellRendererPane to capture the renderer's invalidate calls.) Another issue arose over the forwarding of mouse events to the Swing components. Since our Swing components are not actually displayed on screen in the standard manner, we must manually dispatch any MouseEvents we want the component to receive. Hence, we needed to find the deepest visible component at a particular location that accepts MouseEvents. Finding the deepest visible component at a point was achieved with the "findComponentAt" method in java.awt.Container. With the "getListeners(Class listenerType)" method added in JDK1.3 Beta we are able to determine if the component has any Mouse Listeners. However, we haven't yet found a way to determine if MouseEvents have been specifically enabled for a component. The package private method "eventEnabled" in java.awt.Component does exactly what we want but is, of course, inaccessible. In order to dispatch events correctly we would need a public accessor to the method "boolean eventEnabled(AWTEvent)" in java.awt.Component. Still another issue involves the management of cursors when the mouse is over a Swing component in our application. To the Java mechanisms, the mouse never appears to enter the bounds of the Swing components since they are contained by a 0x0 JComponent. Hence, we must manually change the cursor when the mouse enters one of the Swing components in our application. This generally works but becomes a problem if the Swing component's cursor changes while we are over that Swing component (for instance, if you resize a Table Column). In order to manage cursors properly, we would need setCursor to fire property change events. With the above fixes, most Swing components work. The only Swing components that are definitely broken are ToolTips and those that rely on JPopupMenu. In order to implement ToolTips properly, we would need to have a method in ToolTipManager that allows us to set the current manager, as is possible with RepaintManager. In order to implement JPopupMenu, we will likely need to re-implement JPopupMenu to function in Piccolo2d with a transformed Graphics and to insert itself in the proper place in the Piccolo2d scenegraph. */ /** * <b>PSwing</b> is used to add Swing Components to a Piccolo2D canvas. * <p> * Example: adding a swing JButton to a PCanvas: * * <pre> * PSwingCanvas canvas = new PSwingCanvas(); * JButton button = new JButton(&quot;Button&quot;); * swing = new PSwing(canvas, button); * canvas.getLayer().addChild(swing); * </pre> * * <p> * NOTE: PSwing has the current limitation that it does not listen for Container * events. This is only an issue if you create a PSwing and later add Swing * components to the PSwing's component hierarchy that do not have double * buffering turned off or have a smaller font size than the minimum font size * of the original PSwing's component hierarchy. * </p> * <p> * For instance, the following bit of code will give unexpected results: * * <pre> * JPanel panel = new JPanel(); * PSwing swing = new PSwing(panel); * JPanel newChild = new JPanel(); * newChild.setDoubleBuffered(true); * panel.add(newChild); * </pre> * * </p> * <p> * NOTE: PSwing cannot be correctly interacted with through multiple cameras. * There is no support for it yet. * </p> * <p> * NOTE: PSwing is java.io.Serializable. * </p> * <p> * <b>Warning:</b> Serialized objects of this class will not be compatible with * future Piccolo releases. The current serialization support is appropriate for * short term storage or RMI between applications running the same version of * Piccolo. A future release of Piccolo will provide support for long term * persistence. * </p> * * @author Sam R. Reid * @author Chris Malley (cmalley@pixelzoom.com) * @author Benjamin B. Bederson * @author Lance E. Good * */ public class PSwing extends PNode implements Serializable, PropertyChangeListener { /** Default serial version UID. */ private static final long serialVersionUID = 1L; /** Key for this object in the Swing component's client properties. */ public static final String PSWING_PROPERTY = "PSwing"; /** Temporary repaint bounds. */ private static final PBounds TEMP_REPAINT_BOUNDS2 = new PBounds(); /** For use when buffered painting is enabled. */ private static final Color BUFFER_BACKGROUND_COLOR = new Color(0, 0, 0, 0); private static final AffineTransform IDENTITY_TRANSFORM = new AffineTransform(); /** Default Greek threshold, <code>0.3d</code>. */ private static final double DEFAULT_GREEK_THRESHOLD = 0.3d; /** The cutoff at which the Swing component is rendered greek. */ private double greekThreshold = DEFAULT_GREEK_THRESHOLD; /** Swing component for this Swing node. */ private JComponent component = null; /** * Whether or not to use buffered painting. * @see {@link #paint(java.awt.Graphics2D)} */ private boolean useBufferedPainting = false; /** Used when buffered painting is enabled. */ private BufferedImage buffer; /** Minimum font size. */ private double minFontSize = Double.MAX_VALUE; /** * Default stroke, <code>new BasicStroke()</code>. Cannot be made static * because BasicStroke is not serializable. Should not be null. */ private Stroke defaultStroke = new BasicStroke(); /** * Default font, 12 point <code>"SansSerif"</code>. Will be made final in * version 2.0. */ // public static final Font DEFAULT_FONT = new Font(Font.SANS_SERIF, // Font.PLAIN, 12); jdk 1.6+ private static final Font DEFAULT_FONT = new Font("Serif", Font.PLAIN, 12); /** Swing canvas for this swing node. */ private PSwingCanvas canvas; /** * Used to keep track of which nodes we've attached listeners to since no * built in support in PNode. */ private final ArrayList listeningTo = new ArrayList(); /** The parent listener for camera/canvas changes. */ private final PropertyChangeListener parentListener = new PropertyChangeListener() { /** {@inheritDoc} */ public void propertyChange(final PropertyChangeEvent evt) { final PNode parent = (PNode) evt.getNewValue(); clearListeners((PNode) evt.getOldValue()); if (parent == null) { updateCanvas(null); } else { listenForCanvas(parent); } } /** * Clear out all the listeners registered to make sure there are no * stray references. * * @param fromParent Parent to start with for clearing listeners */ private void clearListeners(final PNode fromParent) { if (fromParent != null && isListeningTo(fromParent)) { fromParent.removePropertyChangeListener(PNode.PROPERTY_PARENT, parentListener); listeningTo.remove(fromParent); clearListeners(fromParent.getParent()); } } }; /** * Listens to container nodes for changes to its contents. Any additions * will automatically have double buffering turned off. */ private final ContainerListener doubleBufferRemover = new ContainerAdapter() { public void componentAdded(final ContainerEvent event) { Component childComponent = event.getChild(); if (childComponent != null && childComponent instanceof JComponent) { disableDoubleBuffering(((JComponent) childComponent)); } }; /** * Disables double buffering on every component in the hierarchy of the * targetComponent. * * I'm assuming that the intent of the is method is that it should be * called explicitly by anyone making changes to the hierarchy of the * Swing component graph. */ private void disableDoubleBuffering(final JComponent targetComponent) { targetComponent.setDoubleBuffered(false); for (int i = 0; i < targetComponent.getComponentCount(); i++) { final Component c = targetComponent.getComponent(i); if (c instanceof JComponent) { disableDoubleBuffering((JComponent) c); } } } }; /** * Create a new visual component wrapper for the specified Swing component. * * @param component Swing component to be wrapped */ public PSwing(final JComponent component) { this.component = component; component.putClientProperty(PSWING_PROPERTY, this); initializeComponent(component); component.revalidate(); updateBounds(); listenForCanvas(this); } /** * @deprecated by {@link #PSwing(JComponent)} * * @param swingCanvas canvas on which the PSwing node will be embedded * @param component not used */ public PSwing(final PSwingCanvas swingCanvas, final JComponent component) { this(component); } /** * If true {@link PSwing} will paint the {@link JComponent} to a buffer with no graphics * transformations applied and then paint the buffer to the target transformed * graphics context. On some platforms (such as Mac OS X) rendering {@link JComponent}s to * a transformed context is slow. Enabling buffered painting gives a significant performance * boost on these platforms; however, at the expense of a lower-quality drawing result at larger * scales. * @since 1.3.1 * @param useBufferedPainting true if this {@link PSwing} should use buffered painting */ public void setUseBufferedPainting(final boolean useBufferedPainting) { this.useBufferedPainting = useBufferedPainting; } public boolean isUseBufferedPainting() { return this.useBufferedPainting; } /** * Ensures the bounds of the underlying component are accurate, and sets the * bounds of this PNode. */ public void updateBounds() { /* * Need to explicitly set the component's bounds because * the component's parent (PSwingCanvas.ChildWrapper) has no layout manager. */ if (componentNeedsResizing()) { updateComponentSize(); } setBounds(0, 0, component.getPreferredSize().width, component.getPreferredSize().height); } /** * Since the parent ChildWrapper has no layout manager, it is the responsibility of this PSwing * to make sure the component has its bounds set properly, otherwise it will not be drawn properly. * This method sets the bounds of the component to be equal to its preferred size. */ private void updateComponentSize() { component.setBounds(0, 0, component.getPreferredSize().width, component.getPreferredSize().height); } /** * Determines whether the component should be resized, based on whether its actual width and height * differ from its preferred width and height. * @return true if the component should be resized. */ private boolean componentNeedsResizing() { return component.getWidth() != component.getPreferredSize().width || component.getHeight() != component.getPreferredSize().height; } /** * Paints the PSwing on the specified renderContext. Also determines if * the Swing component should be rendered normally or as a filled rectangle (greeking). * <p/> * The transform, clip, and composite will be set appropriately when this * object is rendered. It is up to this object to restore the transform, * clip, and composite of the Graphics2D if this node changes any of them. * However, the color, font, and stroke are unspecified by Piccolo. This * object should set those things if they are used, but they do not need to * be restored. * * @param renderContext Contains information about current render. */ public void paint(final PPaintContext renderContext) { if (componentNeedsResizing()) { updateComponentSize(); component.validate(); } final Graphics2D g2 = renderContext.getGraphics(); //Save Stroke and Font for restoring. Stroke originalStroke = g2.getStroke(); Font originalFont = g2.getFont(); g2.setStroke(defaultStroke); g2.setFont(DEFAULT_FONT); if (shouldRenderGreek(renderContext)) { paintAsGreek(g2); } else { paint(g2); } //Restore the stroke and font on the Graphics2D g2.setStroke(originalStroke); g2.setFont(originalFont); } /** * Return true if this Swing node should render as greek given the specified * paint context. * * @param paintContext paint context * @return true if this Swing node should render as greek given the * specified paint context */ protected boolean shouldRenderGreek(final PPaintContext paintContext) { return paintContext.getScale() < greekThreshold || minFontSize * paintContext.getScale() < 0.5; } /** * Paints the Swing component as greek. This method assumes that the stroke has been set beforehand. * * @param g2 The graphics used to render the filled rectangle */ public void paintAsGreek(final Graphics2D g2) { //Save original color for restoring painting as greek. Color originalColor = g2.getColor(); if (component.getBackground() != null) { g2.setColor(component.getBackground()); } g2.fill(getBounds()); if (component.getForeground() != null) { g2.setColor(component.getForeground()); } g2.draw(getBounds()); //Restore original color on the Graphics2D g2.setColor(originalColor); } /** {@inheritDoc} */ public void setVisible(final boolean visible) { super.setVisible(visible); if (component.isVisible() != visible) { component.setVisible(visible); } } /** * Remove from the SwingWrapper; throws an exception if no canvas is * associated with this PSwing. */ public void removeFromSwingWrapper() { if (canvas != null && isComponentSwingWrapped()) { canvas.getSwingWrapper().remove(component); } } private boolean isComponentSwingWrapped() { return Arrays.asList(canvas.getSwingWrapper().getComponents()).contains(component); } /** * Renders the wrapped component to the graphics context provided. * * @param g2 graphics context for rendering the JComponent */ public void paint(final Graphics2D g2) { if (component.getBounds().isEmpty()) { // The component has not been initialized yet. return; } final PSwingRepaintManager manager = (PSwingRepaintManager) RepaintManager.currentManager(component); manager.lockRepaint(component); final RenderingHints oldHints = g2.getRenderingHints(); if (useBufferedPainting) { Graphics2D bufferedGraphics = getBufferedGraphics(g2); component.paint(bufferedGraphics); g2.drawRenderedImage(buffer, IDENTITY_TRANSFORM); } else { g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF); component.paint(g2); } g2.setRenderingHints(oldHints); manager.unlockRepaint(component); } private Graphics2D getBufferedGraphics(Graphics2D source) { final Graphics2D bufferedGraphics; if(!isBufferValid()) { // Get the graphics context associated with a new buffered image. // Use TYPE_INT_ARGB_PRE so that transparent components look good on Windows. buffer = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE); bufferedGraphics = buffer.createGraphics(); } else { // Use the graphics context associated with the existing buffered image bufferedGraphics = buffer.createGraphics(); // Clear the buffered image to prevent artifacts on Macintosh bufferedGraphics.setBackground(BUFFER_BACKGROUND_COLOR); bufferedGraphics.clearRect(0, 0, component.getWidth(), component.getHeight()); } bufferedGraphics.setRenderingHints(source.getRenderingHints()); return bufferedGraphics; } /** * Tells whether the buffer for the image of the Swing components * is currently valid. * * @return true if the buffer is currently valid */ private boolean isBufferValid() { return !(buffer == null || buffer.getWidth() != component.getWidth() || buffer.getHeight() != component.getHeight()); } /** * Repaints the specified portion of this visual component. Note that the * input parameter may be modified as a result of this call. * * @param repaintBounds bounds that need repainting */ public void repaint(final PBounds repaintBounds) { final Shape sh = getTransform().createTransformedShape(repaintBounds); TEMP_REPAINT_BOUNDS2.setRect(sh.getBounds2D()); repaintFrom(TEMP_REPAINT_BOUNDS2, this); } /** * Returns the Swing component that this visual component wraps. * * @return The Swing component wrapped by this PSwing node */ public JComponent getComponent() { return component; } /** * We need to turn off double buffering of Swing components within Piccolo * since all components contained within a native container use the same * buffer for double buffering. With normal Swing widgets this is fine, but * for Swing components within Piccolo this causes problems. This function * recurses the component tree rooted at c, and turns off any double * buffering in use. It also updates the minimum font size based on the font * size of c and adds a property change listener to listen for changes to * the font. * * @param c The Component to be recursively unDoubleBuffered */ private void initializeComponent(final Component c) { if (c.getFont() != null) { minFontSize = Math.min(minFontSize, c.getFont().getSize()); } c.addPropertyChangeListener("font", this); if (c instanceof Container) { initializeChildren((Container) c); ((Container) c).addContainerListener(doubleBufferRemover); } if (c instanceof JComponent) { ((JComponent) c).setDoubleBuffered(false); } } private void initializeChildren(final Container c) { final Component[] children = c.getComponents(); if (children != null) { for (int j = 0; j < children.length; j++) { initializeComponent(children[j]); } } } /** * Listens for changes in font on components rooted at this PSwing. * * @param evt property change event representing the change in font */ public void propertyChange(final PropertyChangeEvent evt) { final Component source = (Component) evt.getSource(); if (source.getFont() != null && component.isAncestorOf(source)) { minFontSize = Math.min(minFontSize, source.getFont().getSize()); } } private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); initializeComponent(component); } /** * Attaches a listener to the specified node and all its parents to listen * for a change in the PSwingCanvas. Only PROPERTY_PARENT listeners are * added so this code wouldn't handle if a PLayer were viewed by a different * PCamera since that constitutes a child change. * * @param node The child node at which to begin a parent-based traversal for * adding listeners. */ private void listenForCanvas(final PNode node) { // need to get the full tree for this node PNode p = node; while (p != null) { listenToNode(p); final PNode parent = p; // System.out.println( "parent = " + parent.getClass() ); if (parent instanceof PLayer) { final PLayer player = (PLayer) parent; // System.out.println( "Found player: with " + // player.getCameraCount() + " cameras" ); for (int i = 0; i < player.getCameraCount(); i++) { final PCamera cam = player.getCamera(i); if (cam.getComponent() instanceof PSwingCanvas) { updateCanvas((PSwingCanvas) cam.getComponent()); break; } } } p = p.getParent(); } } /** * Attach a property change listener to the specified node, if one has not * already been attached. * * @param node the node to listen to for parent/pcamera/pcanvas changes */ private void listenToNode(final PNode node) { if (!isListeningTo(node)) { listeningTo.add(node); node.addPropertyChangeListener(PNode.PROPERTY_PARENT, parentListener); } } /** * Determine whether this PSwing is already listening to the specified node * for camera/canvas changes. * * @param node the node to check * @return true if this PSwing is already listening to the specified node * for camera/canvas changes */ private boolean isListeningTo(final PNode node) { for (int i = 0; i < listeningTo.size(); i++) { final PNode pNode = (PNode) listeningTo.get(i); if (pNode == node) { return true; } } return false; } /** * Removes this PSwing from previous PSwingCanvas (if any), and ensure that * this PSwing is attached to the new PSwingCanvas. * * @param newCanvas the new PSwingCanvas (may be null) */ private void updateCanvas(final PSwingCanvas newCanvas) { if (newCanvas == canvas) { return; } if (canvas != null) { canvas.removePSwing(this); } if (newCanvas == null) { canvas = null; } else { canvas = newCanvas; canvas.addPSwing(this); updateBounds(); repaint(); canvas.invalidate(); canvas.revalidate(); canvas.repaint(); } } /** * Return the Greek threshold scale. When the scale will be below this * threshold the Swing component is rendered as 'Greek' instead of painting * the Swing component. Defaults to {@link #DEFAULT_GREEK_THRESHOLD}. * * @see PSwing#paintAsGreek(Graphics2D) * @return the current Greek threshold scale */ public double getGreekThreshold() { return greekThreshold; } /** * Set the Greek threshold in scale to <code>greekThreshold</code>. When the * scale will be below this threshold the Swing component is rendered as * 'Greek' instead of painting the Swing component.. * * @see PSwing#paintAsGreek(Graphics2D) * @param greekThreshold Greek threshold in scale */ public void setGreekThreshold(final double greekThreshold) { this.greekThreshold = greekThreshold; invalidatePaint(); } }
[ "atdixon@aadc08cf-1350-0410-9b51-cf97fce99a1b" ]
atdixon@aadc08cf-1350-0410-9b51-cf97fce99a1b
e71351c46a27950369dfbf3b5c0e68f9a1cc82da
f79da196839e38f24c19ecbd09546febd4c53f2c
/src/main/java/com/misiak/autoexpense/entity/FuelExpense.java
ede66aa42f2c2c23b8f8fccf7b847c50b871c601
[]
no_license
HiImMishu/AutoExpense_SpringRestAPI
245cda4c050bd4bcabbd3c2de4961729268a12f7
2a99f1f3df171ec974c597bb82be9c7b9d77a2d7
refs/heads/master
2023-04-07T12:21:11.996236
2021-04-11T16:25:01
2021-04-11T16:25:01
296,018,422
0
0
null
2021-04-11T16:25:07
2020-09-16T11:56:21
Java
UTF-8
Java
false
false
866
java
package com.misiak.autoexpense.entity; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.*; import java.math.BigDecimal; import java.sql.Timestamp; @NoArgsConstructor @AllArgsConstructor @Getter @Setter @Entity @Table(name = "fuel_expense") public class FuelExpense { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; private BigDecimal price; private double litres; private double milage; @Column(name = "average_cost") private BigDecimal averageCost; @Column(name = "average_consumption") private BigDecimal averageConsumption; @ManyToOne @JsonIgnore private Car car; @Column(name = "expense_date") private Timestamp expenseDate; }
[ "michal.misiak@op.pl" ]
michal.misiak@op.pl
c7640f673cb81152dea232fc9f250453c6be96c8
0d8021921976bb5c258041211ada6658aea72e0f
/task4/src/main/java/spring/Reader.java
2db7d1cb87fd50e65fb9cdec41862ab9874a8981
[]
no_license
sbansal3096/Arcesium
c4f5ad8e303189913c756142420d16daedef7630
9996aedd6c3ceacb60e25f25f1b55f7a82cfb522
refs/heads/master
2021-04-09T12:58:00.255869
2018-04-16T11:12:54
2018-04-16T11:12:54
125,613,408
0
0
null
null
null
null
UTF-8
Java
false
false
66
java
package spring; public interface Reader { String readString(); }
[ "sbansal3096@gmail.com" ]
sbansal3096@gmail.com
98798ee21e878a9fee9589b08448dda3bbbf120d
1117cf1f9cb58133790f421feb1e25105078dab9
/Android_C6_Hard/c6_03_bluetooth_03_data/src/main/java/com/win16/c6_02_bluetoothdata/connect/AcceptThread.java
cdc0dafa563029fbf74b25aeda1552baa30738cb
[ "Apache-2.0" ]
permissive
wapalxj/Android_C6_Hard
2cc45700e11a7c6e01cf2358cf2e1796e6b4035f
0e824d583997a1b34a350072481b38d27ab4fbbf
refs/heads/master
2020-06-09T21:53:07.735381
2017-01-20T14:18:09
2017-01-20T14:18:09
76,104,609
0
0
null
null
null
null
UTF-8
Java
false
false
3,317
java
package com.win16.c6_02_bluetoothdata.connect; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothServerSocket; import android.bluetooth.BluetoothSocket; import android.os.Handler; import java.io.IOException; import java.util.UUID; /** * Created by Rex on 2015/5/30. * //服务器端使用的 */ public class AcceptThread extends Thread { private static final String NAME = "BlueToothClass"; //基础常量,必须是这个值 private static final UUID MY_UUID = UUID.fromString(Constant.CONNECTTION_UUID); private final BluetoothServerSocket mmServerSocket; private final BluetoothAdapter mBluetoothAdapter; private final Handler mHandler;//主要用于UI更新 private ConnectedThread mConnectedThread;//新建线程用于数据传输 public AcceptThread(BluetoothAdapter adapter, Handler handler) { // Use a temporary object that is later assigned to mmServerSocket, // because mmServerSocket is final mBluetoothAdapter = adapter; mHandler = handler; BluetoothServerSocket tmp = null; try { // MY_UUID is the app's UUID string, also used by the client code //socket的创建 tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID); } catch (IOException e) { } mmServerSocket = tmp; } public void run() { BluetoothSocket socket = null; // Keep listening until exception occurs or a socket is returned while (true) { try { //监听客户端连接进来,并且启动等待UI mHandler.sendEmptyMessage(Constant.MSG_START_LISTENING); //进行监听 socket = mmServerSocket.accept(); } catch (IOException e) { mHandler.sendMessage(mHandler.obtainMessage(Constant.MSG_ERROR, e)); break; } // If a connection was accepted if (socket != null) { // Do work to manage the connection (in a separate thread) //监听到有客户端请求连接 manageConnectedSocket(socket); try { mmServerSocket.close(); mHandler.sendEmptyMessage(Constant.MSG_FINISH_LISTENING); } catch (IOException e) { e.printStackTrace(); } break; } } } private void manageConnectedSocket(BluetoothSocket socket) { //本DEMO中简单起见:只支持同时处理一个连接 if( mConnectedThread != null) { mConnectedThread.cancel(); } mHandler.sendEmptyMessage(Constant.MSG_GOT_A_CLINET); //开启线程读取数据 mConnectedThread = new ConnectedThread(socket, mHandler); mConnectedThread.start(); } /** Will cancel the listening socket, and cause the thread to finish */ public void cancel() { try { mmServerSocket.close(); mHandler.sendEmptyMessage(Constant.MSG_FINISH_LISTENING); } catch (IOException e) { } } public void sendData(byte[] data) { if( mConnectedThread!=null){ mConnectedThread.write(data); } } }
[ "waplaxj@163.com" ]
waplaxj@163.com
1cf1072c8fbc8b3f678daa12f06207be26fae1ec
ed179ce93b73c2f554dbf838e9bbd8bd2c3423cf
/SinglePageApp/src/main/java/com/projectmgmt/SinglePageApp/model/ParentTask.java
7e295021fc75173ae8c1d1c5865414caf1abb5bb
[]
no_license
VijayalakshmiKumar02/singlepageapp
d936cf0abdf0e0b2e725dcbe2008eac7296378b5
9818c4b1436e9d3798ea4448947c8a9237eebff4
refs/heads/master
2021-09-01T13:05:34.087197
2017-12-27T05:19:34
2017-12-27T05:19:34
115,482,684
0
0
null
null
null
null
UTF-8
Java
false
false
830
java
package com.projectmgmt.SinglePageApp.model; import java.util.HashSet; import java.util.Set; import javax.persistence.*; import org.hibernate.validator.constraints.NotBlank; //import org.springframework.data.annotation.Id; import javax.persistence.Id; @Entity @Table(name="ParentTask") public class ParentTask { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long Id; @NotBlank private String parentTask; /* @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "parentTask") private Set<Task> tasks = new HashSet<Task>();*/ public Long getParentId() { return Id; } public void setParentId(Long Id) { this.Id = Id; } public String getParentTask() { return parentTask; } public void setParentTask(String parentTask) { this.parentTask = parentTask; } }
[ "563379@cognizant.com" ]
563379@cognizant.com
1dddc2046cfa2f858c7a71c1be31bbed29393ccd
57097c9f32536bffe741700e60b160f56ebec30d
/src/ru/vsu/cs/kozjutenko/pixel_lines/WuLineDrawer.java
12960c2004398b3142bee41c1b1f1474efd4b6c4
[]
no_license
LaraxInc/KG2020_G22_Task2
988eec4dad283ddba80d54f8893f5d9d52d0c016
adf28733dba63f42a4b184e4a2ce6beaf3d54be0
refs/heads/main
2023-01-06T04:05:04.053376
2020-10-31T09:03:18
2020-10-31T09:03:18
308,815,489
0
0
null
null
null
null
UTF-8
Java
false
false
2,400
java
package ru.vsu.cs.kozjutenko.pixel_lines; import ru.vsu.cs.kozjutenko.LineDrower; import ru.vsu.cs.kozjutenko.PixelDrawer; import java.awt.*; public class WuLineDrawer implements LineDrower { private PixelDrawer pd; public WuLineDrawer(PixelDrawer pd) { this.pd = pd; } @Override public void drawLine(int x1, int y1, int x2, int y2) { int sign = 1; if (x1 > x2) { int c = x1; x1 = x2; x2 = c; c = y1; y1 = y2; y2 = c; } if (y1 > y2) { sign *= -1; } int x = x1; int y = y1; int Dx = x2 - x1; int Dy = y2 - y1; float tg; if (Dx != 0) { tg= Math.abs((float) Dy / Dx); } else { tg = Dy; } Color b1, b2; float y_line = tg * sign + y1; float x_line = 1 / tg + x1; if (Math.abs(Dy) <= Math.abs(Dx)) { pd.colorPixel(x1, y1, Color.BLACK); x++; for (int i = 1; i <= Dx; i++) { b1 = SetColor(y_line - (int) (y_line)); b2 = SetColor(1 - (y_line - (int) (y_line))); if (sign < 0) { Color c = b1; b1 = b2; b2 = c; } pd.colorPixel(x, (int) y_line + sign, b2); pd.colorPixel(x, (int) y_line, b1); System.out.println("y_line"); System.out.println(y_line); y_line += tg * sign; x++; } } else { pd.colorPixel(x1, y1, Color.PINK); y += sign; for (int i = 1; i <= Math.abs(Dy); i++) { b1 = SetColor(x_line - (int) (x_line)); b2 = SetColor(1 - (x_line - (int) (x_line))); pd.colorPixel((int) x_line + 1, y, b2); pd.colorPixel((int) x_line, y, b1); System.out.println("xline"); System.out.println(x_line); x_line += 1 / tg; y += sign; } } } private Color SetColor(float t) { int c = (int) (255 * t); Color res = new Color(c, c, c); return res; } @Override public void drawLine(int x1, int y1, int x2, int y2, Color color) { } }
[ "nikita.kozytenko@mail.ru" ]
nikita.kozytenko@mail.ru
9730aacb68772fc688a384c263b087d4a0eac9e3
20469946948aad19978c1d9bc25e05fbb9c2a137
/app/src/main/java/cn/zheteng123/hducreditstatistics/main/MainActivity.java
9b5da50ac70089bbdb5c4f2891a4ffb6c2b0cdca
[]
no_license
learner1999/HDU-Credit-Statistic
c752af1bf898ff6ce07aa51dc7c73bbf57b0e3d5
88c7c59fcfda57e85a858155d1ac9372059a4a19
refs/heads/master
2020-05-25T18:35:19.808384
2017-03-25T10:36:45
2017-03-25T10:36:45
84,953,813
3
0
null
null
null
null
UTF-8
Java
false
false
5,531
java
package cn.zheteng123.hducreditstatistics.main; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.widget.TextView; import java.util.List; import java.util.Locale; import butterknife.BindView; import cn.zheteng123.hducreditstatistics.R; import cn.zheteng123.hducreditstatistics.base.BaseActivity; import cn.zheteng123.hducreditstatistics.entity.SubjectScore; import cn.zheteng123.hducreditstatistics.entity.TrainingPlanSubject; public class MainActivity extends BaseActivity implements MainView { private static final String TAG = "MainActivity"; private MainPresenter mMainPresenter; private String mStrXh; private ProgressDialog mProgressDialog; @BindView(R.id.tv_result) TextView mTvResult; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mMainPresenter = new MainPresenter(this); mMainPresenter.bindView(this); Intent intent = getIntent(); mStrXh = intent.getStringExtra("xh"); initData(); } private void initData() { Log.d(TAG, "initData: " + mStrXh); mMainPresenter.getSubjectScore(mStrXh); } /** * 启动主界面 * @param context 上下文 * @param xh 学号 */ public static void actionStart(Context context, String xh) { Intent intent = new Intent(context, MainActivity.class); intent.putExtra("xh", xh); context.startActivity(intent); } @Override public int getLayoutResID() { return R.layout.activity_main; } @Override public void showCompareResult(List<SubjectScore> subjectScoreList, List<TrainingPlanSubject> trainingPlanSubjectList, double requiredCredit, double practiceCredit, double optionalCredit, double limitedOptionalCredit, double arbitrarilyOptionalCredit) { mProgressDialog.dismiss(); // 隐藏进度条对话框 double gainRequiredCredit = 0; double gainPracticeCredit = 0; double gainOptionalCredit = 0; double gainLimitedOptionalCredit = 0; double gainArbitrarilyOptionalCredit = 0; String strNotGainRequired = "\n未获得的必修及实践学分如下:\n"; for (TrainingPlanSubject subject : trainingPlanSubjectList) { String strCategory = subject.category; if (subject.isPass) { if (strCategory.contains("必修")) { gainRequiredCredit += subject.credit; } else if (strCategory.contains("实践")) { gainPracticeCredit += subject.credit; } else if (strCategory.contains("选修")) { gainOptionalCredit += subject.credit; } else if (strCategory.contains("限选")) { gainLimitedOptionalCredit += subject.credit; } else if (strCategory.contains("任选")) { gainArbitrarilyOptionalCredit += subject.credit; } } else if(strCategory.contains("实践") || strCategory.contains("必修")) { strNotGainRequired += subject.code + " " + subject.name + " " + subject.credit + " " + subject.category + "\n"; } } String strNotMatchSubject = "\n未匹配的课程如下:\n"; for (SubjectScore subjectScore : subjectScoreList) { if (subjectScore.code.startsWith("C")) { gainArbitrarilyOptionalCredit += subjectScore.credit; } else { strNotMatchSubject += subjectScore.code + " " + subjectScore.name + " " + subjectScore.credit + "\n"; } } String strResult = "必修已修学分 " + String.format(Locale.CHINA, "%.1f", gainRequiredCredit) + ",要求总分 " + String.format(Locale.CHINA, "%.1f", requiredCredit) + "\n" + "实践已修学分 " + String.format(Locale.CHINA, "%.1f", gainPracticeCredit) + ",要求总分 " + String.format(Locale.CHINA, "%.1f", practiceCredit) + "\n" + "选修已修学分 " + String.format(Locale.CHINA, "%.1f", gainOptionalCredit) + ",要求总分 " + String.format(Locale.CHINA, "%.1f", optionalCredit) + "\n" + "限选已修学分 " + String.format(Locale.CHINA, "%.1f", gainLimitedOptionalCredit) + ",要求总分 " + String.format(Locale.CHINA, "%.1f", limitedOptionalCredit) + "\n" + "任选已修学分 " + String.format(Locale.CHINA, "%.1f", gainArbitrarilyOptionalCredit) + ",要求总分 " + String.format(Locale.CHINA, "%.1f", arbitrarilyOptionalCredit) + "\n"; mTvResult.setText(strResult + strNotMatchSubject + strNotGainRequired); } @Override public void showProgressDialog() { mProgressDialog = new ProgressDialog(this); mProgressDialog.setTitle("爬取数据中,请耐心等待……"); mProgressDialog.setMessage("开始爬取数据……"); mProgressDialog.setCancelable(false); mProgressDialog.show(); } @Override public void changeDialogMessage(String message) { mProgressDialog.setMessage(message); } }
[ "roadoflearning@live.com" ]
roadoflearning@live.com
9adb7724ef095e347133710cb5e65d236c1e4f92
78c2b0b2da2ed51c79633e0ec59784fac7b94599
/udacity-other/ud851-Exercises/Lesson08-Quiz-Example/T08.02-Exercise-AddAsyncTaskToRetrieveCursor/app/src/main/java/com/udacity/example/quizexample/MainActivity.java
b98f8a008b8bccfe5e1eeeed8f9c0b5c877fee02
[ "Apache-2.0" ]
permissive
narko/udacity-android-course
2b86f22918ee5bb857f263381c35f49d11fb37b9
2696f9e64d35963c1f9043042d1da7aba1dfb405
refs/heads/master
2021-01-10T11:33:56.969140
2020-02-22T17:49:12
2020-02-22T17:49:12
80,307,240
4
0
null
null
null
null
UTF-8
Java
false
false
3,682
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.udacity.example.quizexample; import android.content.ContentResolver; import android.database.Cursor; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import com.udacity.example.droidtermsprovider.DroidTermsExampleContract; /** * Gets the data from the ContentProvider and shows a series of flash cards. */ public class MainActivity extends AppCompatActivity { // The current state of the app private int mCurrentState; // (3) Create an instance variable storing a Cursor called mData private Cursor mData; private Button mButton; // This state is when the word definition is hidden and clicking the button will therefore // show the definition private final int STATE_HIDDEN = 0; // This state is when the word definition is shown and clicking the button will therefore // advance the app to the next word private final int STATE_SHOWN = 1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Get the views mButton = (Button) findViewById(R.id.button_next); // (5) Create and execute your AsyncTask here new DataAsyncTask().execute(); } /** * This is called from the layout when the button is clicked and switches between the * two app states. * @param view The view that was clicked */ public void onButtonClick(View view) { // Either show the definition of the current word, or if the definition is currently // showing, move to the next word. switch (mCurrentState) { case STATE_HIDDEN: showDefinition(); break; case STATE_SHOWN: nextWord(); break; } } public void nextWord() { // Change button text mButton.setText(getString(R.string.show_definition)); mCurrentState = STATE_HIDDEN; } public void showDefinition() { // Change button text mButton.setText(getString(R.string.next_word)); mCurrentState = STATE_SHOWN; } // (1) Create AsyncTask with the following generic types <Void, Void, Cursor> // (2) In the doInBackground method, write the code to access the DroidTermsExample // provider and return the Cursor object // (4) In the onPostExecute method, store the Cursor object in mData private class DataAsyncTask extends AsyncTask<Void, Void, Cursor> { @Override protected Cursor doInBackground(Void... params) { ContentResolver contentResolver = getContentResolver(); return contentResolver.query(DroidTermsExampleContract.CONTENT_URI, null, null, null, null); } @Override protected void onPostExecute(Cursor cursor) { super.onPostExecute(cursor); mData = cursor; } } }
[ "6020peaks@gmail.com" ]
6020peaks@gmail.com
31d49e66a8d8886845594b789b54e3ec475bf8b6
b3a2a368f390c025ddf7b6395fb128fa08ad1fc8
/src/com/test/Demo18.java
b974bafd48b8cd57cdb2420891f9da664685342d
[]
no_license
tianxintian22/learning-java
f6363fc2163b279e095e24f238464fb755150fd7
83debb6d088475da0d74ca9766dbb239e0fc9fbe
refs/heads/master
2021-01-20T03:40:17.152526
2017-07-02T14:36:08
2017-07-02T14:36:08
89,572,155
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package com.test; public class Demo18 { public static void main(String[] args) { String str = "a"; String str2 = "B" + str; String s1 = new Demo18().toString(); String s2 = new Demo18().toString(); System.out.println(s1 == s2); } public String toString(){ String a = "a"; String b = "b"; //return a + " " + b; //return "a" + "b"; //return a; String s = "a" + "b"; return s; } }
[ "1247016369@qq.com" ]
1247016369@qq.com
46fa3c1e8f158daab9ccae106b996320a9a36d13
5f34fd1fb533bf06b642dbf9ba458882ddee902b
/src/main/java/io/renren/modules/app/form/LoginForm.java
8bd16c5c52bd4235ef4d873632fda99f76655276
[ "Apache-2.0" ]
permissive
kcwxzqby/repo1
8e47852661ec23720c881bc2c40aa03ea6d5a235
b7ad9eca57c0623cb45483c164dbcbd4dc1bc9a2
refs/heads/master
2022-07-24T17:19:54.987307
2019-10-12T23:46:52
2019-10-12T23:46:52
215,792,307
5
0
Apache-2.0
2022-07-06T20:43:18
2019-10-17T12:55:26
JavaScript
UTF-8
Java
false
false
691
java
/** * Copyright (c) 2016-2019 人人开源 All rights reserved. * * https://www.renren.io * * 版权所有,侵权必究! */ package io.renren.modules.app.form; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; /** * 登录表单 * * @author Mark sunlightcs@gmail.com */ @Data @ApiModel(value = "登录表单") public class LoginForm { @ApiModelProperty(value = "手机号") @NotBlank(message="手机号不能为空") private String mobile; @ApiModelProperty(value = "密码") @NotBlank(message="密码不能为空") private String password; }
[ "sunlightcs@gmail.com" ]
sunlightcs@gmail.com
d0ffbc0d1d592dc6f3e6b0aa6000c4be419d3f30
51aaa3596d0399c712074fcf741ab32de44b5bca
/java7/concurrency/semaphore/ThreadTestJavaSemaphore.java
689722b3c71c47d296c2ba0931953f9b0675035d
[ "Apache-2.0" ]
permissive
Alung-0/design-2
e1c1c01a3f3d20346aec73865b162a73146993a6
bab5f1760c731e8f5e9739b23c14de320ddf56fb
refs/heads/master
2021-07-11T20:10:49.322068
2017-10-15T01:09:28
2017-10-15T01:09:28
107,242,352
1
0
null
2017-10-17T08:50:32
2017-10-17T08:50:31
null
UTF-8
Java
false
false
735
java
public class ThreadTestJavaSemaphore extends Thread { private java.util.concurrent.Semaphore sem ; public ThreadTestJavaSemaphore( String n, java.util.concurrent.Semaphore s ) { super(n) ; this.sem = s ; } public void run() { for ( int i=0; i<5; i++) { try { sem.acquire() ; System.out.println( Thread.currentThread() + " Running Task # " + i + "..." ) ; sleep(5000) ; // simulate busy work... (sleep for 5 seconds) sem.release() ; } catch (Exception e) { System.out.println( e.getMessage() ) ; } } } }
[ "paul.nguyen@sjsu.edu" ]
paul.nguyen@sjsu.edu
a49e4a9231c141da55b9b67e811cb2fa4087719e
ff42601ba08f73841456e117109ee5865c63f1ab
/Arrays/Best Time to Buy and Sell Stock.java
97d55305ffac630f227e18eac2ccc44d21b4273d
[]
no_license
alifshits/java_problems
b3e25c762f4b421f208c68230a01aa4af67c2d97
4e44ae53886b1bc61da0e0c4694220163a023a80
refs/heads/master
2023-02-01T01:22:29.863648
2020-12-17T09:22:23
2020-12-17T09:22:23
277,281,703
0
0
null
null
null
null
UTF-8
Java
false
false
440
java
class Solution { public int maxProfit(int[] prices) { if (prices.length < 2) return 0; var p = 0; var buy = prices[0]; for (var i = 1; i < prices.length; ++i) { if (prices[i] > buy) { p = Math.max(p, prices[i] - buy); } else { buy = Math.min(buy, prices[i]); } } return p; } }
[ "alifshits@oneincsystems.com" ]
alifshits@oneincsystems.com
d2251695c981288fb11b042fea1dc9275c1fa2a5
d01aa77bcb1c20bd4f44c298ec96066c188d57f8
/crop-me/src/main/java/com/mikelau/croperino/CropImage.java
fe481e2557633580efd8c075938c720c9aca33cf
[ "MIT" ]
permissive
ashutoshchauhan13/croperino
c599fb4d813d3aae6e01f3da85cb1a3b874bda12
d9cba266d55698290131fd8db95afbf73547bbe0
refs/heads/master
2020-05-30T19:39:51.446128
2017-03-01T04:40:55
2017-03-01T04:40:55
83,673,930
0
0
null
2017-03-02T12:12:28
2017-03-02T12:12:28
null
UTF-8
Java
false
false
21,175
java
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.mikelau.croperino; import android.app.Activity; import android.content.ContentResolver; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Path; import android.graphics.PointF; import android.graphics.PorterDuff; import android.graphics.Rect; import android.graphics.RectF; import android.graphics.Region; import android.media.FaceDetector; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.os.StatFs; import android.util.Log; import android.view.View; import android.view.Window; import android.view.WindowManager; import com.mikelau.magictoast.MagicToast; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.concurrent.CountDownLatch; public class CropImage extends MonitoredActivity { final int IMAGE_MAX_SIZE = 1024; private static final String TAG = "CropImage"; public static final String IMAGE_PATH = "image-path"; public static final String SCALE = "scale"; public static final String ORIENTATION_IN_DEGREES = "orientation_in_degrees"; public static final String ASPECT_X = "aspectX"; public static final String ASPECT_Y = "aspectY"; public static final String OUTPUT_X = "outputX"; public static final String OUTPUT_Y = "outputY"; public static final String SCALE_UP_IF_NEEDED = "scaleUpIfNeeded"; public static final String CIRCLE_CROP = "circleCrop"; public static final String RETURN_DATA = "return-data"; public static final String RETURN_DATA_AS_BITMAP = "data"; public static final String ACTION_INLINE_DATA = "inline-data"; private Bitmap.CompressFormat mOutputFormat = Bitmap.CompressFormat.JPEG; public static Uri mSaveUri = null; private boolean mDoFaceDetection = true; private boolean mCircleCrop = false; private final Handler mHandler = new Handler(); private int mAspectX; private int mAspectY; private int mOutputX; private int mOutputY; private boolean mScale; private CropImageView mImageView; private ContentResolver mContentResolver; private Bitmap mBitmap; private String mImagePath; boolean mWaitingToPick; boolean mSaving; HighlightView mCrop; private boolean mScaleUp = true; private final BitmapManager.ThreadSet mDecodingThreads = new BitmapManager.ThreadSet(); @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); mContentResolver = getContentResolver(); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.cropimage); mImageView = (CropImageView) findViewById(R.id.image); showStorageToast(this); Intent intent = getIntent(); Bundle extras = intent.getExtras(); if (extras != null) { if (extras.getString(CIRCLE_CROP) != null) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) { mImageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); } mCircleCrop = true; mAspectX = 1; mAspectY = 1; } mImagePath = extras.getString(IMAGE_PATH); mSaveUri = getImageUri(mImagePath); mBitmap = getBitmap(mImagePath); if (extras.containsKey(ASPECT_X) && extras.get(ASPECT_X) instanceof Integer) { mAspectX = extras.getInt(ASPECT_X); } else { throw new IllegalArgumentException("aspect_x must be integer"); } if (extras.containsKey(ASPECT_Y) && extras.get(ASPECT_Y) instanceof Integer) { mAspectY = extras.getInt(ASPECT_Y); } else { throw new IllegalArgumentException("aspect_y must be integer"); } mOutputX = extras.getInt(OUTPUT_X); mOutputY = extras.getInt(OUTPUT_Y); mScale = extras.getBoolean(SCALE, true); mScaleUp = extras.getBoolean(SCALE_UP_IF_NEEDED, true); } if (mBitmap == null) { finish(); return; } assert extras != null; if(extras.getInt("color") != 0) { findViewById(R.id.discard).setBackgroundColor(extras.getInt("color")); findViewById(R.id.save).setBackgroundColor(extras.getInt("color")); findViewById(R.id.rotateLeft).setBackgroundColor(extras.getInt("color")); findViewById(R.id.rotateRight).setBackgroundColor(extras.getInt("color")); findViewById(R.id.rl_main).setBackgroundColor(extras.getInt("color")); } if(extras.getInt("bgColor") != 0) { mImageView.setBackgroundColor(extras.getInt("bgColor")); } // Make UI fullscreen. getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); findViewById(R.id.discard).setOnClickListener( new View.OnClickListener() { public void onClick(View v) { setResult(RESULT_CANCELED); finish(); } }); findViewById(R.id.save).setOnClickListener( new View.OnClickListener() { public void onClick(View v) { try { onSaveClicked(); } catch (Exception e) { finish(); } } }); findViewById(R.id.rotateLeft).setOnClickListener( new View.OnClickListener() { public void onClick(View v) { mBitmap = CropUtil.rotateImage(mBitmap, -90); RotateBitmap rotateBitmap = new RotateBitmap(mBitmap); mImageView.setImageRotateBitmapResetBase(rotateBitmap, true); mRunFaceDetection.run(); } }); findViewById(R.id.rotateRight).setOnClickListener( new View.OnClickListener() { public void onClick(View v) { mBitmap = CropUtil.rotateImage(mBitmap, 90); RotateBitmap rotateBitmap = new RotateBitmap(mBitmap); mImageView.setImageRotateBitmapResetBase(rotateBitmap, true); mRunFaceDetection.run(); } }); startFaceDetection(); } private Uri getImageUri(String path) { return Uri.fromFile(new File(path)); } private Bitmap getBitmap(String path) { Uri uri = getImageUri(path); InputStream in = null; try { in = mContentResolver.openInputStream(uri); //Decode image size BitmapFactory.Options o = new BitmapFactory.Options(); o.inJustDecodeBounds = true; BitmapFactory.decodeStream(in, null, o); in.close(); int scale = 1; if (o.outHeight > IMAGE_MAX_SIZE || o.outWidth > IMAGE_MAX_SIZE) { scale = (int) Math.pow(2, (int) Math.round(Math.log(IMAGE_MAX_SIZE / (double) Math.max(o.outHeight, o.outWidth)) / Math.log(0.5))); } BitmapFactory.Options o2 = new BitmapFactory.Options(); o2.inSampleSize = scale; in = mContentResolver.openInputStream(uri); Bitmap b = BitmapFactory.decodeStream(in, null, o2); in.close(); return b; } catch (FileNotFoundException e) { Log.e(TAG, "file " + path + " not found"); } catch (IOException e) { Log.e(TAG, "file " + path + " not found"); } return null; } private void startFaceDetection() { if (isFinishing()) { return; } mImageView.setImageBitmapResetBase(mBitmap, true); CropUtil.startBackgroundJob(this, null, "Please wait\u2026", new Runnable() { public void run() { final CountDownLatch latch = new CountDownLatch(1); final Bitmap b = mBitmap; mHandler.post(new Runnable() { public void run() { if (b != mBitmap && b != null) { mImageView.setImageBitmapResetBase(b, true); mBitmap.recycle(); mBitmap = b; } if (mImageView.getScale() == 1F) { mImageView.center(true, true); } latch.countDown(); } }); try { latch.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } mRunFaceDetection.run(); } }, mHandler); } private void onSaveClicked() throws Exception { if (mSaving) return; if (mCrop == null) { return; } mSaving = true; Rect r = mCrop.getCropRect(); int width = r.width(); int height = r.height(); Bitmap croppedImage; try { croppedImage = Bitmap.createBitmap(width, height, mCircleCrop ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565); } catch (Exception e) { throw e; } if (croppedImage == null) { return; } { Canvas canvas = new Canvas(croppedImage); Rect dstRect = new Rect(0, 0, width, height); canvas.drawBitmap(mBitmap, r, dstRect, null); } if (mCircleCrop) { Canvas c = new Canvas(croppedImage); Path p = new Path(); p.addCircle(width / 2F, height / 2F, width / 2F, Path.Direction.CW); c.clipPath(p, Region.Op.DIFFERENCE); c.drawColor(0x00000000, PorterDuff.Mode.CLEAR); } if (mOutputX != 0 && mOutputY != 0) { if (mScale) { Bitmap old = croppedImage; croppedImage = CropUtil.transform(new Matrix(), croppedImage, mOutputX, mOutputY, mScaleUp); if (old != croppedImage) { old.recycle(); } } else { Bitmap b = Bitmap.createBitmap(mOutputX, mOutputY, Bitmap.Config.RGB_565); Canvas canvas = new Canvas(b); Rect srcRect = mCrop.getCropRect(); Rect dstRect = new Rect(0, 0, mOutputX, mOutputY); int dx = (srcRect.width() - dstRect.width()) / 2; int dy = (srcRect.height() - dstRect.height()) / 2; srcRect.inset(Math.max(0, dx), Math.max(0, dy)); dstRect.inset(Math.max(0, -dx), Math.max(0, -dy)); canvas.drawBitmap(mBitmap, srcRect, dstRect, null); croppedImage.recycle(); croppedImage = b; } } Bundle myExtras = getIntent().getExtras(); if (myExtras != null && (myExtras.getParcelable("data") != null || myExtras.getBoolean(RETURN_DATA))) { Bundle extras = new Bundle(); extras.putParcelable(RETURN_DATA_AS_BITMAP, croppedImage); setResult(RESULT_OK, (new Intent()).setAction(ACTION_INLINE_DATA).putExtras(extras)); finish(); } else { final Bitmap b = croppedImage; CropUtil.startBackgroundJob(this, null, getString(R.string.saving_image), new Runnable() { public void run() { saveOutput(b); } }, mHandler); } } private void saveOutput(Bitmap croppedImage) { if (mSaveUri != null) { OutputStream outputStream = null; try { outputStream = mContentResolver.openOutputStream(mSaveUri); if (outputStream != null) { croppedImage.compress(mOutputFormat, 80, outputStream); } } catch (IOException ex) { Log.e(TAG, "Cannot open file: " + mSaveUri, ex); runOnUiThread(new Runnable() { public void run() { MagicToast.showError(CropImage.this, "Cannot access file due to app storage encryption, Please use camera or other apps to open gallery."); } }); setResult(RESULT_CANCELED); finish(); return; } finally { CropUtil.closeSilently(outputStream); } Bundle extras = new Bundle(); Intent intent = new Intent(mSaveUri.toString()); intent.putExtras(extras); intent.putExtra(IMAGE_PATH, mImagePath); intent.putExtra(ORIENTATION_IN_DEGREES, CropUtil.getOrientationInDegree(this)); setResult(RESULT_OK, intent); } else { runOnUiThread(new Runnable() { public void run() { MagicToast.showError(CropImage.this, "Image URL does not exist please try again."); } }); } croppedImage.recycle(); finish(); } @Override protected void onPause() { super.onPause(); BitmapManager.instance().cancelThreadDecoding(mDecodingThreads); } @Override protected void onDestroy() { super.onDestroy(); if (mBitmap != null) { mBitmap.recycle(); } } Runnable mRunFaceDetection = new Runnable() { @SuppressWarnings("hiding") float mScale = 1F; Matrix mImageMatrix; FaceDetector.Face[] mFaces = new FaceDetector.Face[3]; int mNumFaces; private void handleFace(FaceDetector.Face f) { PointF midPoint = new PointF(); int r = ((int) (f.eyesDistance() * mScale)) * 2; f.getMidPoint(midPoint); midPoint.x *= mScale; midPoint.y *= mScale; int midX = (int) midPoint.x; int midY = (int) midPoint.y; HighlightView hv = new HighlightView(mImageView); int width = mBitmap.getWidth(); int height = mBitmap.getHeight(); Rect imageRect = new Rect(0, 0, width, height); RectF faceRect = new RectF(midX, midY, midX, midY); faceRect.inset(-r, -r); if (faceRect.left < 0) { faceRect.inset(-faceRect.left, -faceRect.left); } if (faceRect.top < 0) { faceRect.inset(-faceRect.top, -faceRect.top); } if (faceRect.right > imageRect.right) { faceRect.inset(faceRect.right - imageRect.right, faceRect.right - imageRect.right); } if (faceRect.bottom > imageRect.bottom) { faceRect.inset(faceRect.bottom - imageRect.bottom, faceRect.bottom - imageRect.bottom); } hv.setup(mImageMatrix, imageRect, faceRect, mCircleCrop, mAspectX != 0 && mAspectY != 0); mImageView.add(hv); } private void makeDefault() { HighlightView hv = new HighlightView(mImageView); int width = mBitmap.getWidth(); int height = mBitmap.getHeight(); Rect imageRect = new Rect(0, 0, width, height); int cropWidth = Math.min(width, height) * 4 / 5; int cropHeight = cropWidth; if (mAspectX != 0 && mAspectY != 0) { if (mAspectX > mAspectY) { cropHeight = cropWidth * mAspectY / mAspectX; } else { cropWidth = cropHeight * mAspectX / mAspectY; } } int x = (width - cropWidth) / 2; int y = (height - cropHeight) / 2; RectF cropRect = new RectF(x, y, x + cropWidth, y + cropHeight); hv.setup(mImageMatrix, imageRect, cropRect, mCircleCrop, mAspectX != 0 && mAspectY != 0); mImageView.mHighlightViews.clear(); mImageView.add(hv); } private Bitmap prepareBitmap() { if (mBitmap == null) { return null; } if (mBitmap.getWidth() > 256) { mScale = 256.0F / mBitmap.getWidth(); } Matrix matrix = new Matrix(); matrix.setScale(mScale, mScale); return Bitmap.createBitmap(mBitmap, 0, 0, mBitmap.getWidth(), mBitmap.getHeight(), matrix, true); } public void run() { mImageMatrix = mImageView.getImageMatrix(); Bitmap faceBitmap = prepareBitmap(); mScale = 1.0F / mScale; if (faceBitmap != null && mDoFaceDetection) { FaceDetector detector = new FaceDetector(faceBitmap.getWidth(), faceBitmap.getHeight(), mFaces.length); mNumFaces = detector.findFaces(faceBitmap, mFaces); } if (faceBitmap != null && faceBitmap != mBitmap) { faceBitmap.recycle(); } mHandler.post(new Runnable() { public void run() { mWaitingToPick = mNumFaces > 1; if (mNumFaces > 0) { for (int i = 0; i < mNumFaces; i++) { handleFace(mFaces[i]); } } else { makeDefault(); } mImageView.invalidate(); if (mImageView.mHighlightViews.size() == 1) { mCrop = mImageView.mHighlightViews.get(0); mCrop.setFocus(true); } if (mNumFaces > 1) { MagicToast.showInfo(CropImage.this, "Multi face crop help"); } } }); } }; public static final int NO_STORAGE_ERROR = -1; public static final int CANNOT_STAT_ERROR = -2; public static void showStorageToast(Activity activity) { showStorageToast(activity, calculatePicturesRemaining(activity)); } public static void showStorageToast(Activity activity, int remaining) { String noStorageText = null; if (remaining == NO_STORAGE_ERROR) { String state = Environment.getExternalStorageState(); if (state.equals(Environment.MEDIA_CHECKING)) { noStorageText = activity.getString(R.string.preparing_card); } else { noStorageText = activity.getString(R.string.no_storage_card); } } else if (remaining < 1) { noStorageText = activity.getString(R.string.not_enough_space); } if (noStorageText != null) { MagicToast.showError(activity, noStorageText); } } public static int calculatePicturesRemaining(Activity activity) { try { String storageDirectory = ""; String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { storageDirectory = Environment.getExternalStorageDirectory().toString(); } else { storageDirectory = activity.getFilesDir().toString(); } StatFs stat = new StatFs(storageDirectory); float remaining = ((float) stat.getAvailableBlocks() * (float) stat.getBlockSize()) / 400000F; return (int) remaining; } catch (Exception ex) { return CANNOT_STAT_ERROR; } } }
[ "lau@mclinica.com" ]
lau@mclinica.com
ab4409f7fbe15e5ee62ce5594826e42f35cbfebd
f6175d3666249ebce28d80a3cd4044acea3b4396
/3.JavaMultithreading/src/com/javarush/task/task27/task2709/TransferObject.java
0146fd440bdd1734382e67761af7f44e2b4338d6
[]
no_license
phbzr/JavaRush
2fa83ab377c0868dc8593d9fcf90601ab40159ab
97c1c478d5a67ba798b733b4f86ed426b52800ff
refs/heads/master
2020-05-20T10:17:15.817465
2019-05-16T01:43:14
2019-05-16T01:43:14
185,521,813
0
0
null
2019-05-16T00:48:41
2019-05-08T03:32:24
Java
UTF-8
Java
false
false
899
java
package com.javarush.task.task27.task2709; public class TransferObject { private int value; protected volatile boolean isValuePresent = false; //use this variable public synchronized int get() { while (!isValuePresent) { try { this.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.println("Got: " + value); isValuePresent = false; this.notifyAll(); return value; } public synchronized void put(int value) { while (isValuePresent){ try { this.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } this.value = value; System.out.println("Put: " + value); isValuePresent = true; this.notify(); } }
[ "stlkdvc@yandex.ru" ]
stlkdvc@yandex.ru
9e5204657533243001237edc2411dc35d0fe89a8
6d338704ba861bde856e8a527598284eca45d58c
/src/main/java/com/java/cube/security/jwt/TokenProvider.java
cd750e7bcc1427d6546b48b7b1422155aea86b6f
[]
no_license
asdgithub870/jhipster-sample-application
1e17c07a042e2e6094d8d10d38d4ec33f607d003
413c1ab93c1c5042c09b2b7006fafd9ab8e937a2
refs/heads/master
2022-12-08T08:10:24.205125
2020-08-06T14:51:47
2020-08-06T14:51:47
285,587,289
0
0
null
2020-08-27T00:01:16
2020-08-06T14:06:24
Java
UTF-8
Java
false
false
4,140
java
package com.java.cube.security.jwt; import io.github.jhipster.config.JHipsterProperties; import io.jsonwebtoken.*; import io.jsonwebtoken.io.Decoders; import io.jsonwebtoken.security.Keys; import java.nio.charset.StandardCharsets; import java.security.Key; import java.util.*; import java.util.stream.Collectors; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.User; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; @Component public class TokenProvider { private final Logger log = LoggerFactory.getLogger(TokenProvider.class); private static final String AUTHORITIES_KEY = "auth"; private Key key; private long tokenValidityInMilliseconds; private long tokenValidityInMillisecondsForRememberMe; private final JHipsterProperties jHipsterProperties; public TokenProvider(JHipsterProperties jHipsterProperties) { this.jHipsterProperties = jHipsterProperties; } @PostConstruct public void init() { byte[] keyBytes; String secret = jHipsterProperties.getSecurity().getAuthentication().getJwt().getSecret(); if (!StringUtils.isEmpty(secret)) { log.warn( "Warning: the JWT key used is not Base64-encoded. " + "We recommend using the `jhipster.security.authentication.jwt.base64-secret` key for optimum security." ); keyBytes = secret.getBytes(StandardCharsets.UTF_8); } else { log.debug("Using a Base64-encoded JWT secret key"); keyBytes = Decoders.BASE64.decode(jHipsterProperties.getSecurity().getAuthentication().getJwt().getBase64Secret()); } this.key = Keys.hmacShaKeyFor(keyBytes); this.tokenValidityInMilliseconds = 1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSeconds(); this.tokenValidityInMillisecondsForRememberMe = 1000 * jHipsterProperties.getSecurity().getAuthentication().getJwt().getTokenValidityInSecondsForRememberMe(); } public String createToken(Authentication authentication, boolean rememberMe) { String authorities = authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority).collect(Collectors.joining(",")); long now = (new Date()).getTime(); Date validity; if (rememberMe) { validity = new Date(now + this.tokenValidityInMillisecondsForRememberMe); } else { validity = new Date(now + this.tokenValidityInMilliseconds); } return Jwts .builder() .setSubject(authentication.getName()) .claim(AUTHORITIES_KEY, authorities) .signWith(key, SignatureAlgorithm.HS512) .setExpiration(validity) .compact(); } public Authentication getAuthentication(String token) { Claims claims = Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(token).getBody(); Collection<? extends GrantedAuthority> authorities = Arrays .stream(claims.get(AUTHORITIES_KEY).toString().split(",")) .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); User principal = new User(claims.getSubject(), "", authorities); return new UsernamePasswordAuthenticationToken(principal, token, authorities); } public boolean validateToken(String authToken) { try { Jwts.parserBuilder().setSigningKey(key).build().parseClaimsJws(authToken); return true; } catch (JwtException | IllegalArgumentException e) { log.info("Invalid JWT token."); log.trace("Invalid JWT token trace.", e); } return false; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
7f440720ebb33f3fceb30b2c43e5912025624f43
9fe0327d2eaab577cc73eb33f711a28fc0c2fedc
/CompSci/CallingFunctionsFromOtherFiles.java
b446ebf850553483ecfa0c838a8872781d84a430
[]
no_license
yugimon/SchoolCode
10249d52ee9564f277aa595a3062424a950c3168
57babbffca21eb4843d59c50ed3ec8b627f868a2
refs/heads/master
2021-01-09T21:48:49.122805
2015-06-03T15:30:49
2015-06-03T15:30:49
36,812,973
0
0
null
null
null
null
UTF-8
Java
false
false
1,871
java
import java.util.Scanner; public class CallingFunctionsFromOtherFiles { public static void main( String[] args ) { Scanner keyboard = new Scanner(System.in); System.out.println("Welcome to Mr. Mitchell's fantastic birth-o-meter!"); System.out.println(); System.out.println("All you have to do is enter your birth date, and it will"); System.out.println("tell you the day of the week on which you were born."); System.out.println(); System.out.println("Some automatic tests...."); System.out.println("12 10 2003 => " + weekday(12,10,2003)); System.out.println(" 2 13 1976 => " + weekday(2,13,1976)); System.out.println(" 2 13 1977 => " + weekday(2,13,1977)); System.out.println(" 7 2 1974 => " + weekday(7,2,1974)); System.out.println(" 1 15 2003 => " + weekday(1,15,2003)); System.out.println("10 13 2000 => " + weekday(10,13,2000)); System.out.println(); System.out.println("Now it's your turn! What's your birthday?"); System.out.print("Birth date (mm dd yyyy): "); int mm = keyboard.nextInt(); int dd = keyboard.nextInt(); int yyyy = keyboard.nextInt(); // put a function call for weekday() here System.out.println("You were born on " + weekday(mm, dd, yyyy) ); } public static String weekday( int mm, int dd, int yyyy ) { int yy, total, il; String date = ""; // bunch of calculations go here yy = yyyy - 1900; total = yy / 4; total = total + yy; total = total + dd; total = total + MonthOffset.month_offset(mm); if ( WeekdayCalculator.is_leap(yyyy) == true && (mm == 1 || mm == 2)) il = 1; else il = 0; total = total - il; total = total % 7; WeekdayName.weekday_name(total); date = WeekdayName.weekday_name(total) + ", " + MonthName.month_name(mm) + " " + dd + ", " + yyyy; return date; } // paste your functions from MonthName, WeekdayName, and MonthOffset here }
[ "yugimon8@yahoo.com" ]
yugimon8@yahoo.com
645c8c89b01cbd16315d1141e4f42b8bc441eed8
cfee3155d7da89f5b8989717c677c46a531c9f23
/app/src/main/java/com/example/musicapplication/Activity/MainActivity.java
90b0330121af3c002ae826298207cac4d9ecd414
[]
no_license
congson199333/MusicApplication
4475039e9560a5610333a4b9b168fb9cca066570
b3e662f790e99bc57914a6f9397c6a927e7a86e6
refs/heads/main
2023-02-17T04:55:26.219080
2021-01-16T17:34:53
2021-01-16T17:34:53
330,199,454
0
0
null
null
null
null
UTF-8
Java
false
false
1,477
java
package com.example.musicapplication.Activity; import androidx.appcompat.app.AppCompatActivity; import androidx.viewpager.widget.ViewPager; import android.os.Bundle; import com.example.musicapplication.Adapter.MainViewPagerAdapter; import com.example.musicapplication.Fragment.Fragment_Tim_Kiem; import com.example.musicapplication.Fragment.Fragment_Trang_Chu; import com.example.musicapplication.R; import com.google.android.material.tabs.TabLayout; public class MainActivity extends AppCompatActivity { TabLayout tabLayout; ViewPager viewPager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); anhxa(); init(); } private void init() { MainViewPagerAdapter mainViewPagerAdapter = new MainViewPagerAdapter(getSupportFragmentManager()); mainViewPagerAdapter.addFragment(new Fragment_Trang_Chu(),"Trang Chủ"); mainViewPagerAdapter.addFragment(new Fragment_Tim_Kiem(), "Tìm Kiếm"); viewPager.setAdapter(mainViewPagerAdapter); tabLayout.setupWithViewPager(viewPager); tabLayout.getTabAt(0).setIcon(R.drawable.icontrangchu); tabLayout.getTabAt(1).setIcon(R.drawable.iconsearch); } private void anhxa() { tabLayout = findViewById(R.id.myTabLayout); viewPager = findViewById(R.id.myViewPager); } }
[ "congsonhl1999@gmail.com" ]
congsonhl1999@gmail.com
26aaa285799f5e65766380f3b8a3831104593e08
1f19aec2ecfd756934898cf0ad2758ee18d9eca2
/u-1/u-11/u-11-111/u-11-111-1112/u-11-111-1112-11113-111111/u-11-111-1112-11113-111111-f4311.java
506977160193783237978f4f23a2329264b33217
[]
no_license
apertureatf/perftest
f6c6e69efad59265197f43af5072aa7af8393a34
584257a0c1ada22e5486052c11395858a87b20d5
refs/heads/master
2020-06-07T17:52:51.172890
2019-06-21T18:53:01
2019-06-21T18:53:01
193,039,805
0
0
null
null
null
null
UTF-8
Java
false
false
106
java
mastercard 5555555555554444 4012888888881881 4222222222222 378282246310005 6011111111111117 4903628257744
[ "jenkins@khan.paloaltonetworks.local" ]
jenkins@khan.paloaltonetworks.local
22c0f83ec43b7a55403f850783e7bff0f0e6d52c
ce9b2aa0052207700094ed7c397c6d1cf4ab74c5
/src/main/java/com/portfolio/renter/controller/ApartmentController.java
0faf3b196fc6dea7c8d90c375df835521e6ed85c
[]
no_license
dekisaa/Renter
922147e389e2b1d7f2340bd5fd166b41469bfd18
6f72d4b295555d4862b6e3d62b350a62c0a85382
refs/heads/master
2023-01-02T06:19:30.142751
2020-10-27T21:57:20
2020-10-27T21:57:20
297,925,378
0
0
null
null
null
null
UTF-8
Java
false
false
78
java
package com.portfolio.renter.controller; public class ApartmentController {}
[ "dexi.spin@gmail.com" ]
dexi.spin@gmail.com
93b4e2a55dc3abdb89b84ee7e58b5bc309b5bca8
66b5a9803000b765a610dc2ae82fa9c1c4682504
/src/main/java/clockworkmod/actions/SmithsMalletAction.java
75483fddc2bb8de6f87d325673289b1a22435b47
[]
no_license
HypoSoc/ClockworkMod
15abeb2b79ea1d1e4dcc8d2de5f1f7db53a6118b
7b57e3a0bd129f682d0fd15f8c00ebfee75f68d7
refs/heads/master
2020-04-10T02:34:15.492168
2019-02-05T00:06:16
2019-02-05T00:06:16
160,747,418
1
0
null
null
null
null
UTF-8
Java
false
false
3,327
java
package clockworkmod.actions; import com.evacipated.cardcrawl.mod.stslib.StSLib; import com.megacrit.cardcrawl.actions.AbstractGameAction; import com.megacrit.cardcrawl.cards.AbstractCard; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.core.Settings; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.helpers.GetAllInBattleInstances; import java.util.ArrayList; public class SmithsMalletAction extends AbstractGameAction { private static String[] TEXT = {"permanently Upgrade."}; private AbstractPlayer p; private ArrayList<AbstractCard> cannotUpgrade = new ArrayList(); public SmithsMalletAction() { this.actionType = AbstractGameAction.ActionType.CARD_MANIPULATION; this.p = AbstractDungeon.player; this.duration = Settings.ACTION_DUR_FAST; } public void update() { if (this.duration == Settings.ACTION_DUR_FAST) { for (AbstractCard c : this.p.hand.group) { if (!c.canUpgrade()) { this.cannotUpgrade.add(c); } } if (this.cannotUpgrade.size() == this.p.hand.group.size()) { this.isDone = true; return; } if (this.p.hand.group.size() - this.cannotUpgrade.size() == 1) { for (AbstractCard c : this.p.hand.group) { if (c.canUpgrade()) { applyEffect(c); this.isDone = true; return; } } } this.p.hand.group.removeAll(this.cannotUpgrade); if (this.p.hand.group.size() > 1) { AbstractDungeon.handCardSelectScreen.open(TEXT[0], 1, false, false, false, true); tickDuration(); return; } if (this.p.hand.group.size() == 1) { applyEffect(this.p.hand.getTopCard()); returnCards(); this.isDone = true; } } if (!AbstractDungeon.handCardSelectScreen.wereCardsRetrieved) { for (AbstractCard c : AbstractDungeon.handCardSelectScreen.selectedCards.group) { applyEffect(c); this.p.hand.addToTop(c); } returnCards(); AbstractDungeon.handCardSelectScreen.wereCardsRetrieved = true; AbstractDungeon.handCardSelectScreen.selectedCards.group.clear(); this.isDone = true; } tickDuration(); } private void returnCards() { for (AbstractCard c : this.cannotUpgrade) { this.p.hand.addToTop(c); } this.p.hand.refreshHandLayout(); } private void applyEffect(AbstractCard card){ card.upgrade(); card.superFlash(); for (AbstractCard c : GetAllInBattleInstances.get(card.uuid)) { if(c != card) { c.upgrade(); c.superFlash(); } } AbstractCard masterCard = StSLib.getMasterDeckEquivalent(card); if(masterCard != null){ masterCard.upgrade(); } } }
[ "hyposoc1@gmail.com" ]
hyposoc1@gmail.com
d57c4817c521e606d1e092e89c17d3591b1adad1
5902a1935ad4c2156d0826cfa92ce1d6449da2c1
/src/ncu/sw/UDPSM/UdpServerThread.java
a7d936f056275f47f4096d82f11d981b40d943d9
[]
no_license
KV6895/only87-server
d3d0dbea4160d9ed2b67965988591bd203d43e85
1adf3dc15719c3e9d833fc6d91f99f3810fc9837
refs/heads/master
2020-08-04T02:02:00.098423
2016-12-28T10:06:03
2016-12-28T10:06:03
73,530,342
0
0
null
2016-11-12T03:58:00
2016-11-12T03:58:00
null
UTF-8
Java
false
false
2,144
java
package ncu.sw.UDPSM; import ncu.sw.gameServer.ServerGameController; import ncu.sw.gameUtility.Cmd; import ncu.sw.gameUtility.Coin; import ncu.sw.gameUtility.Player; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.net.*; import java.util.ArrayList; import java.util.ConcurrentModificationException; import java.util.HashMap; import java.util.TimerTask; public class UdpServerThread extends TimerTask { private Cmd cmd; private InetAddress address; private int port; private DatagramSocket socket; private DatagramPacket packet; public UdpServerThread(DatagramSocket socket) throws IOException { this.cmd = ServerGameController.getInstance().getCmd(); this.socket = socket; } public synchronized void run() { HashMap map = UDPBroadCastClient.getInstance().getUDPTable(); try { for (Object key : map.keySet()) { address = UDPBroadCastClient.getInstance().getUDPTable().get(key).getAddress(); port = UDPBroadCastClient.getInstance().getUDPTable().get(key).getPort(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); //這邊應該算 encode 我們不採用message 的方式存取 , 我們送整個資料給client ObjectOutputStream os = new ObjectOutputStream(outputStream); os.writeObject( ServerGameController.getInstance().getCmd() ); os.flush(); byte[] data = outputStream.toByteArray(); packet = new DatagramPacket(data, //這邊在送 data.length, address, port); if(socket != null ) { socket.send(packet); } } } catch (SocketException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); }catch (ConcurrentModificationException e){ System.out.println( " ConcurrentModificationException : " + e ); } } }
[ "sk97616@gmail.com" ]
sk97616@gmail.com
8b44dbb2afe8dfc7171dfb7d1edac93337d339b7
ffa627892a15dc2961852aad1fca3b1e38246687
/src/test/java/com/kavinschool/examples/utils/VerifyUtils.java
43d1c497db119269b2b863a4db4b0bc6493e6a6e
[]
no_license
Levistras/CucumberPlayground
f60f1357134504c2221c507ef9d27f011b6472e4
fa9a7fcbf8b2dd5867883a3e46628537930041d9
refs/heads/master
2023-06-18T13:32:19.399792
2021-07-15T04:56:04
2021-07-15T04:56:04
386,291,108
0
0
null
null
null
null
UTF-8
Java
false
false
1,255
java
/* * Kangeyan Passoubady * Version 1.0 */ package com.kavinschool.examples.utils; import org.junit.Assert; import org.openqa.selenium.WebDriver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; public class VerifyUtils { private WebDriver driver; private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); public VerifyUtils(WebDriver driver) { this.driver = driver; } public void verifyPageHeader(String pageHeader) { String actualHeaderText = new LocatorUtils(driver).waitForHeaderWithText(pageHeader, "h1").getText(); Assert.assertEquals(actualHeaderText, pageHeader); log.info("Page Header:{}", pageHeader); } public void verifyTitle(final String titlePrefix, final String titleMiddle, final String titleSuffix) { String actualTitle = driver.getTitle(); Assert.assertEquals(titlePrefix + " " + titleMiddle + " " + titleSuffix, actualTitle); log.info("Actual Title:{}", actualTitle); } public void verifyURL(String urlText) { String url = driver.getCurrentUrl(); new DriverUtils(driver).waitForPageToLoad(10); log.info("Current URL:{}", url); Assert.assertTrue("URL does not contain " + urlText, url.contains(urlText)); } }
[ "kpassoubady@gmail.com" ]
kpassoubady@gmail.com
651b1f7a38d7c6df679754a9f54bb5befc12492e
d044df3cb7ee5f03ffcd6df6c68c55d033f38dfd
/cloud-consumerconsul-order80/src/main/java/com/atom/springcloud/controller/OrderConsulController.java
974f633459c0916b719455cc6d0b286634bf1846
[]
no_license
wqjTest/cloud2020
bdfba7fd6e0c7ab5ecb5315c66bda50ded744ecf
dec1c27c61a24fe3457ac8caf429ac5e3617206b
refs/heads/master
2022-12-18T11:33:27.810339
2020-10-07T15:26:11
2020-10-07T15:26:11
286,517,529
0
0
null
null
null
null
UTF-8
Java
false
false
689
java
package com.atom.springcloud.controller; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; import javax.annotation.Resource; @RestController @Slf4j public class OrderConsulController { public static final String INVOKE_URL="http://consul-provider-payment"; @Resource private RestTemplate restTemplate; @GetMapping(value = "/consumer/payment/consul") public String paymentInfo(){ String result = restTemplate.getForObject(INVOKE_URL+"/payment/consul",String.class); return result; } }
[ "991575842@qq.com" ]
991575842@qq.com
493d8736416aa131528018f237019852a0b5983f
13581056ecb4cb56e0c2fc3c7f2441c14d227f67
/src/main/java/com/example/labksp/User/UserRepo.java
1e8e7527047462094311d4574763dd9585f3a842
[]
no_license
NikG777/labksp3
c2e2a67221222742d8503f0d47a4640bb5c3fdb3
49b6f3db0bf0b90ef21ac8fa07e9dbf96979ecfe
refs/heads/master
2022-11-23T06:05:11.195507
2020-10-01T08:49:09
2020-10-01T08:49:09
226,292,198
0
0
null
2022-11-15T23:33:02
2019-12-06T09:26:44
CSS
UTF-8
Java
false
false
239
java
package com.example.labksp.User; import com.example.labksp.User.User; import org.springframework.data.jpa.repository.JpaRepository; public interface UserRepo extends JpaRepository<User,Long> { User findByUsername(String username); }
[ "nik23225@gmail.com" ]
nik23225@gmail.com
c48a82117b26a6ad7db2fa9acd4f97e86aed6e5f
5636224b6d977623fa829f0785661e5c1db6a283
/ESP_Fractalizador/src/utils/Patron.java
12306a67cb6300e9a0a927532d7aa1e0844f6f38
[]
no_license
koldogontzal/General
4bf77bba0596cf4f7af7ad66495d83ae4b698d08
0b64f1cb3f787b8382e7814c45240503f66b4f3f
refs/heads/master
2021-09-23T07:43:19.150133
2021-09-11T16:29:00
2021-09-11T16:29:00
32,067,490
0
0
null
null
null
null
UTF-8
Java
false
false
2,063
java
package utils; import java.util.ArrayList; public class Patron { // Es una lista de vectores que definen el patrón que luego se repetirá para // cada vector private ArrayList<VectorFrac> lista; public Patron() { this.lista = new ArrayList<VectorFrac>(5); } public Patron(int elementos) { this.lista = new ArrayList<VectorFrac>(elementos); } public void addVector(VectorFrac elemento) { this.lista.add(elemento); } public int getNumeroVectores() { return this.lista.size(); } public VectorFrac getVector(int posicion) { return this.lista.get(posicion); } @Override public String toString() { String cadenaFinal = ""; for (int i = 0; i < this.getNumeroVectores(); i++) { cadenaFinal = cadenaFinal + this.getVector(i) + "\n"; } return cadenaFinal; } public VectorFrac[] recalcularConNuevoVector(VectorFrac vectorParaTransformar) { VectorFrac[] listaNueva = new VectorFrac[this.getNumeroVectores()]; for (int i = 0; i < this.getNumeroVectores(); i++) { Punto desplazamiento = vectorParaTransformar.getPuntoOrigen(); double rotacion = vectorParaTransformar.getAngulo(); double escalado = vectorParaTransformar.getLongitud(); //suponemos que el original vale 1 //Primero hay que aplicar un escalado, luego una rotación y por ultimo un desplazamiento // Tiene que ser en ese orden, si no, sale mal. Y tiene que hacerse de los puntos de origen // y de extremo por separado // Escalado Punto pOrigenEscalado = this.getVector(i).getPuntoOrigen().multiplicacionEscalar(escalado); Punto pExtremoEscalado = this.getVector(i).getPuntoExtremo().multiplicacionEscalar(escalado); // Rotación Punto pOrigenRotado = pOrigenEscalado.girarAngulo(rotacion); Punto pExtremoRotado = pExtremoEscalado.girarAngulo(rotacion); VectorFrac vectorRotado = new VectorFrac(pOrigenRotado, pExtremoRotado); // Desplazamiento VectorFrac vectorDesplazado = vectorRotado.desplazamientoVector(desplazamiento); listaNueva[i] = new VectorFrac(vectorDesplazado); } return listaNueva; } }
[ "luis.castellano@inap.es" ]
luis.castellano@inap.es
4eb9deeb001450bfe7ff0c67af35c236c8c1a043
37eaaebb016ff1063554e75b17dda708870f767b
/src/Robot.java
394f6f6158b1eec82acf6fb0eb2054e80b886f1c
[]
no_license
alibeylan/marsRedRover
cf618f48207ce89ee2fea567b510461d31510e96
e2d52b4c5970375ef7a566fb0e819ff96ae9a791
refs/heads/master
2021-06-01T01:11:09.639521
2015-12-13T08:10:56
2015-12-13T08:10:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,309
java
import java.util.ArrayList; public class Robot { //Orientation and Position of the robot private Orientation orientation; private int locX; private int locY; //Using the planet class to tell the robot's planet. private Planet planet = null; private boolean lost = false; // mission statement private ArrayList<Main.Instructions> instructions = null; //Initialise robot's position with orientation public Robot(Orientation orientation, int locX, int locY) { this.orientation = orientation; this.locX = locX; this.locY = locY; } //Tells the that is living in a planet that the user set before using the planet class. public void setPlanet(Planet planet) { this.planet = planet; } public void setInstructions(ArrayList<Main.Instructions> commands) { this.instructions = commands; } // Execute the main class to process the robot and evaluate position. public void executeMain() { // Verify if the robot is already on a planet. if (planet == null) { System.out.println("The robot is not on a planet."); return; } // Verify if we received instructions as an input for that robot. if (instructions == null || instructions.isEmpty()) { System.out.println("No instructions given to the robot."); return; } // run through the mission for (Main.Instructions i : instructions) { executeInstructions(i); if (lost) break; } } //Execute the instructions determined on the bottom. private void executeInstructions(Main.Instructions instructions) { switch (instructions) { case L: turnLeft(); break; case R: turnRight(); break; case F: moveForwards(); break; } } /*Describe the moves that the robot has to make to turn or go forward */ // Turn left move private void turnLeft() { switch (orientation) { case N: orientation = Orientation.W; break; case E: orientation = Orientation.N; break; case S: orientation = Orientation.E; break; case W: orientation = Orientation.S; break; } } // Turn right move private void turnRight() { switch (orientation) { case N: orientation = Orientation.E; break; case E: orientation = Orientation.S; break; case S: orientation = Orientation.W; break; case W: orientation = Orientation.N; break; } } // Go forward move private void moveForwards() { // store the old location int oldX = locX; int oldY = locY; // go to the new position switch (orientation) { case N: ++locY; break; case E: ++locX; break; case S: --locY; break; case W: --locX; break; } //Check if the robot is on the edge. if (planet.checkOutOfBounds(locX, locY)) { // was there a scent here previously? if (planet.hasScent(oldX, oldY)) { // ignore the command and go back to our previous position locX = oldX; locY = oldY; } else { // uh-oh, we're lost! lost = true; // store our last location locX = oldX; locY = oldY; // leave a scent so that no one follows us planet.leaveScent(oldX, oldY); } } } public String toString() { return locX + " " + locY + " " + orientation.toString() + (lost ? " LOST" : ""); } public enum Orientation { N, E, S, W } }
[ "alix_1995@live.com.mx" ]
alix_1995@live.com.mx
b7baae48ec5b60e44d38526bbd4ddcf78f3e48c5
479678a89200ba715305855bc485df827202b16e
/src/main/java/com/nasdaq/nasdaghiringchallenge/model/dto/SellerDTO.java
dba99210a9f8842c3486b300d5932a0ed60039e2
[]
no_license
altimetrik2019/nasdag-hiring-challenge
d1347d3d82f37c9d17f4e100b31d59393fdfa9a7
b359df8c9521819a7adf8a8ff39359002b56ad44
refs/heads/master
2021-02-15T10:36:32.744752
2020-03-04T12:31:27
2020-03-04T12:31:27
244,890,031
0
0
null
null
null
null
UTF-8
Java
false
false
326
java
package com.nasdaq.nasdaghiringchallenge.model.dto; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; @NoArgsConstructor public class SellerDTO { @Getter @Setter private int id; @Getter @Setter private String name; @Getter @Setter private ItemDTO item; }
[ "madhan2007.psgtech@gmail.com" ]
madhan2007.psgtech@gmail.com
42f1a90226375aca58fb824fd36b15b9cbc52f27
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_5e5dd6c3ad0a4b7580eb58486c5cea75224b05c5/DbHelper/2_5e5dd6c3ad0a4b7580eb58486c5cea75224b05c5_DbHelper_t.java
5893c855b62252067a2a81b0bd81a7062a7d9a8b
[]
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
10,320
java
/* Copyright 2012-2013 Claudio Tesoriero - c.tesoriero-at-baasbox.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.baasbox.db; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.List; import org.apache.commons.io.IOUtils; import play.Logger; import play.Play; import play.mvc.Http; import com.baasbox.BBConfiguration; import com.baasbox.dao.DefaultRoles; import com.baasbox.db.hook.HooksManager; import com.baasbox.exception.SqlInjectionException; import com.baasbox.service.user.UserService; import com.baasbox.util.QueryParams; import com.orientechnologies.orient.core.command.OCommandRequest; import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal; import com.orientechnologies.orient.core.db.graph.OGraphDatabase; import com.orientechnologies.orient.core.db.record.ODatabaseRecordTx; import com.orientechnologies.orient.core.metadata.OMetadata; import com.orientechnologies.orient.core.metadata.security.ODatabaseSecurityResources; import com.orientechnologies.orient.core.metadata.security.ORole; import com.orientechnologies.orient.core.metadata.security.OUser; import com.orientechnologies.orient.core.record.impl.ODocument; import com.orientechnologies.orient.core.sql.OCommandSQL; import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; import com.orientechnologies.orient.core.tx.OTransactionNoTx; public class DbHelper { private static final String SCRIPT_FILE_NAME="db.sql"; private static final String fetchPlan = "*:?"; public static boolean isInTransaction(){ OGraphDatabase db = getConnection(); return !(db.getTransaction() instanceof OTransactionNoTx); } public static void requestTransaction(){ OGraphDatabase db = getConnection(); if (!isInTransaction()){ Logger.trace("Begin transaction"); db.begin(); } } public static void commitTransaction(){ OGraphDatabase db = getConnection(); if (isInTransaction()){ Logger.trace("Commit transaction"); db.commit(); } } public static void rollbackTransaction(){ OGraphDatabase db = getConnection(); if (isInTransaction()){ Logger.trace("Rollback transaction"); db.rollback(); } } public static String selectQueryBuilder (String from, boolean count, QueryParams criteria){ String ret; if (count) ret = "select count(*) from "; else ret = "select from "; ret += from; if (criteria.getWhere()!=null && !criteria.getWhere().equals("")){ ret += " where ( " + criteria.getWhere() + " )"; } if (!count && criteria.getOrderBy()!=null && !criteria.getOrderBy().equals("")){ ret += " order by " + criteria.getOrderBy(); } if (!count && (criteria.getPage()!=null && criteria.getPage()!=-1)){ ret += " skip " + (criteria.getPage() * criteria.getRecordPerPage()) + " limit " + criteria.getRecordPerPage(); } Logger.debug("queryBuilder: " + ret); return ret; } public static OCommandRequest selectCommandBuilder(String from, boolean count, QueryParams criteria) throws SqlInjectionException{ OGraphDatabase db = DbHelper.getConnection(); OCommandRequest command = db.command(new OSQLSynchQuery<ODocument>( selectQueryBuilder(from, count, criteria) ).setFetchPlan(fetchPlan.replace("?", criteria.getDepth().toString()))); if (!command.isIdempotent()) throw new SqlInjectionException(); Logger.debug("commandBuilder: "); Logger.debug(" " + criteria.toString()); Logger.debug(" " + command.toString()); return command; } public static List<ODocument> commandExecute(OCommandRequest command, String[] params){ List<ODocument> queryResult = command.execute((Object[])params); return queryResult; } public static OGraphDatabase open(String username,String password){ OGraphDatabase db=new OGraphDatabase("local:db/baasbox").open(username, password); HooksManager.registerAll(db); return db; } public static OGraphDatabase getConnection(){ return new OGraphDatabase ((ODatabaseRecordTx)ODatabaseRecordThreadLocal.INSTANCE.get()); } public static String getCurrentHTTPPassword(){ return (String) Http.Context.current().args.get("password"); } public static String getCurrentHTTPUsername(){ return (String) Http.Context.current().args.get("username"); } public static String getCurrentUserName(){ return getConnection().getUser().getName(); } public static boolean isConnectedLikeBaasBox(){ return getCurrentHTTPUsername().equalsIgnoreCase(BBConfiguration.getBaasBoxUsername()); } public static void createDefaultRoles(){ Logger.trace("Method Start"); OGraphDatabase db = DbHelper.getConnection(); final ORole anonymousUserRole = db.getMetadata().getSecurity().createRole(DefaultRoles.ANONYMOUS_USER.toString(), ORole.ALLOW_MODES.DENY_ALL_BUT); anonymousUserRole.save(); final ORole registeredUserRole = db.getMetadata().getSecurity().createRole(DefaultRoles.REGISTERED_USER.toString(), ORole.ALLOW_MODES.DENY_ALL_BUT); registeredUserRole.save(); final ORole backOfficeRole = db.getMetadata().getSecurity().createRole(DefaultRoles.BACKOFFICE_USER.toString(),ORole.ALLOW_MODES.DENY_ALL_BUT); backOfficeRole.save(); registeredUserRole.addRule(ODatabaseSecurityResources.DATABASE, ORole.PERMISSION_READ); registeredUserRole.addRule(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_READ + ORole.PERMISSION_CREATE + ORole.PERMISSION_UPDATE); registeredUserRole.addRule(ODatabaseSecurityResources.CLUSTER + "." + OMetadata.CLUSTER_INTERNAL_NAME, ORole.PERMISSION_READ); registeredUserRole.addRule(ODatabaseSecurityResources.CLUSTER + ".orole", ORole.PERMISSION_READ); registeredUserRole.addRule(ODatabaseSecurityResources.CLUSTER + ".ouser", ORole.PERMISSION_READ); registeredUserRole.addRule(ODatabaseSecurityResources.ALL_CLASSES, ORole.PERMISSION_ALL); registeredUserRole.addRule(ODatabaseSecurityResources.ALL_CLUSTERS, ORole.PERMISSION_ALL); registeredUserRole.addRule(ODatabaseSecurityResources.COMMAND, ORole.PERMISSION_ALL); registeredUserRole.addRule(ODatabaseSecurityResources.RECORD_HOOK, ORole.PERMISSION_ALL); backOfficeRole.addRule(ODatabaseSecurityResources.DATABASE, ORole.PERMISSION_READ); backOfficeRole.addRule(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_READ + ORole.PERMISSION_CREATE + ORole.PERMISSION_UPDATE); backOfficeRole.addRule(ODatabaseSecurityResources.CLUSTER + "." + OMetadata.CLUSTER_INTERNAL_NAME, ORole.PERMISSION_READ); backOfficeRole.addRule(ODatabaseSecurityResources.CLUSTER + ".orole", ORole.PERMISSION_READ); backOfficeRole.addRule(ODatabaseSecurityResources.CLUSTER + ".ouser", ORole.PERMISSION_READ); backOfficeRole.addRule(ODatabaseSecurityResources.ALL_CLASSES, ORole.PERMISSION_ALL); backOfficeRole.addRule(ODatabaseSecurityResources.ALL_CLUSTERS, ORole.PERMISSION_ALL); backOfficeRole.addRule(ODatabaseSecurityResources.COMMAND, ORole.PERMISSION_ALL); backOfficeRole.addRule(ODatabaseSecurityResources.RECORD_HOOK, ORole.PERMISSION_ALL); backOfficeRole.addRule(ODatabaseSecurityResources.BYPASS_RESTRICTED,ORole.PERMISSION_ALL); //the backoffice users can access and manipulate all records anonymousUserRole.addRule(ODatabaseSecurityResources.DATABASE, ORole.PERMISSION_READ); anonymousUserRole.addRule(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_READ); anonymousUserRole.addRule(ODatabaseSecurityResources.CLUSTER + "." + OMetadata.CLUSTER_INTERNAL_NAME, ORole.PERMISSION_READ); anonymousUserRole.addRule(ODatabaseSecurityResources.CLUSTER + ".orole", ORole.PERMISSION_READ); anonymousUserRole.addRule(ODatabaseSecurityResources.CLUSTER + ".ouser", ORole.PERMISSION_READ); anonymousUserRole.addRule(ODatabaseSecurityResources.ALL_CLASSES, ORole.PERMISSION_READ); anonymousUserRole.addRule(ODatabaseSecurityResources.ALL_CLUSTERS, ORole.PERMISSION_READ); anonymousUserRole.addRule(ODatabaseSecurityResources.COMMAND, ORole.PERMISSION_READ); anonymousUserRole.addRule(ODatabaseSecurityResources.RECORD_HOOK, ORole.PERMISSION_READ); anonymousUserRole.save(); registeredUserRole.save(); Logger.trace("Method End"); } public static void createDefaultUsers() throws Exception{ Logger.trace("Method Start"); //the baasbox default user used to connect to the DB like anonymous user String username=BBConfiguration.getBaasBoxUsername(); String password=BBConfiguration.getBaasBoxPassword(); UserService.signUp(username, password,DefaultRoles.ANONYMOUS_USER.toString(), null,null,null,null); Logger.trace("Method End"); } public static void dropOrientDefault(){ Logger.trace("Method Start"); OGraphDatabase db = DbHelper.getConnection(); db.getMetadata().getSecurity().dropUser("reader"); db.getMetadata().getSecurity().dropUser("writer"); db.getMetadata().getSecurity().dropRole("reader"); db.getMetadata().getSecurity().dropRole("writer"); Logger.trace("Method End"); } public static void populateDB(OGraphDatabase db) throws IOException{ Logger.info("Populating the db..."); InputStream is; if (Play.application().isProd()) is =Play.application().resourceAsStream(SCRIPT_FILE_NAME); else is = new FileInputStream(Play.application().getFile("conf/"+SCRIPT_FILE_NAME)); List<String> script=IOUtils.readLines(is, "UTF-8"); for (String line:script){ Logger.debug(line); if (!line.startsWith("--") && !line.trim().isEmpty()){ //skip comments db.command(new OCommandSQL(line.replace(';', ' '))).execute(); } } Logger.info("...done"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
fd903284aac99b0a69157432bb6d7a7348727ad9
f89849c20b64de16288588cdf4907588d0d30635
/SavannaPredatorPreySimulation/src/SavannaPredatorPreySimulation/SavannaAnimal.java
d5431eb3986cfe4b3441ae026662a2ac3feb57ce
[]
no_license
dkolley/Savanna-Simulation
8a7f5c922d7f681b54dc5c4de883bb62d1a7487d
1cbd573a94c725ad4250f3a800b1088de882e474
refs/heads/master
2023-05-24T21:20:32.476435
2021-06-07T13:03:48
2021-06-07T13:03:48
374,206,881
0
0
null
null
null
null
UTF-8
Java
false
false
5,965
java
package SavannaPredatorPreySimulation; import java.util.Collections; import java.util.LinkedList; import java.util.List; /** * Represent a rectangular grid of savanna positions. * Each position is able to store a single animal. * * @author Dennis Kolley * @version 2021.03.01 */ public class SavannaAnimal extends Savanna { // Storage for the animals. private Object[][] savanna; /** * Constructor for objects of class SavannaAnimal. * @param depth The depth of the savanna. * @param width The width of the savanna. */ public SavannaAnimal(int depth, int width) { super(depth, width); savanna = new Object[depth][width]; } /** * Empty the savanna. */ public void clear() { for(int row = 0; row < depth; row++) { for(int col = 0; col < width; col++) { savanna[row][col] = null; } } } /** * Clear the given location. * @param location The location to clear. */ public void clear(Location location) { savanna[location.getRow()][location.getCol()] = null; } /** * Place an animal at the given location. * If there is already an animal at the location it will * be lost. * @param animal The animal to be placed. * @param row Row coordinate of the location. * @param col Column coordinate of the location. */ public void place(Object animal, int row, int col) { place(animal, new Location(row, col)); } /** * Place an animal at the given location. * If there is already an animal at the location it will * be lost. * @param animal The animal to be placed. * @param location Where to place the animal. */ public void place(Object animal, Location location) { savanna[location.getRow()][location.getCol()] = animal; } /** * Return the animal at the given location, if any. * @param location Where in the savanna. * @return The animal at the given location, or null if there is none. */ public Object getObjectAt(Location location) { return getObjectAt(location.getRow(), location.getCol()); } /** * Return the animal at the given location, if any. * @param row The desired row. * @param col The desired column. * @return The animal at the given location, or null if there is none. */ public Object getObjectAt(int row, int col) { return savanna[row][col]; } /** * Generate a random location that is adjacent to the * given location, or is the same location. * The returned location will be within the valid bounds * of the savanna. * @param location The location from which to generate an adjacency. * @return A valid location within the grid area. */ public Location randomAdjacentLocation(Location location) { List<Location> adjacent = adjacentLocations(location); return adjacent.get(0); } /** * Get a shuffled list of the free adjacent locations. * @param location Get locations adjacent to this. * @return A list of free adjacent locations. */ public List<Location> getFreeAdjacentLocations(Location location) { List<Location> free = new LinkedList<>(); List<Location> adjacent = adjacentLocations(location); for(Location next : adjacent) { if(getObjectAt(next) == null) { free.add(next); } } return free; } /** * Try to find a free location that is adjacent to the * given location. If there is none, return null. * The returned location will be within the valid bounds * of the savanna. * @param location The location from which to generate an adjacency. * @return A valid location within the grid area. */ public Location freeAdjacentLocation(Location location) { // The available free ones. List<Location> free = getFreeAdjacentLocations(location); if(free.size() > 0) { return free.get(0); } else { return null; } } /** * Return a shuffled list of locations adjacent to the given one. * The list will not include the location itself. * All locations will lie within the grid. * @param location The location from which to generate adjacencies. * @return A list of locations adjacent to that given. */ public List<Location> adjacentLocations(Location location) { assert location != null : "Null location passed to adjacentLocations"; // The list of locations to be returned. List<Location> locations = new LinkedList<>(); if(location != null) { int row = location.getRow(); int col = location.getCol(); for(int roffset = -1; roffset <= 1; roffset++) { int nextRow = row + roffset; if(nextRow >= 0 && nextRow < depth) { for(int coffset = -1; coffset <= 1; coffset++) { int nextCol = col + coffset; // Exclude invalid locations and the original location. if(nextCol >= 0 && nextCol < width && (roffset != 0 || coffset != 0)) { locations.add(new Location(nextRow, nextCol)); } } } } // Shuffle the list. Several other methods rely on the list // being in a random order. Collections.shuffle(locations, rand); } return locations; } }
[ "78429974+dkolley@users.noreply.github.com" ]
78429974+dkolley@users.noreply.github.com
25a8a614176e36ba2afe24da8329b39241ef84f1
618dc72a06d9e242d3c544380f49c4b79cd554b6
/app/src/androidTest/java/com/example/grocerydeliverysystem/ExampleInstrumentedTest.java
c48d908584385935c01b16fca3793bb8fecda1dc
[]
no_license
Diana-Kalema/Grocery-Delivery-System
5d87a486729140446e5290cfc8b6fde31b83cc8d
de9ba4a1903788a7ae37f515786efc421638bf58
refs/heads/master
2023-01-27T13:15:01.786532
2020-12-08T13:01:58
2020-12-08T13:01:58
319,635,702
0
1
null
null
null
null
UTF-8
Java
false
false
779
java
package com.example.grocerydeliverysystem; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.example.grocerydeliverysystem", appContext.getPackageName()); } }
[ "diana.kalema@strathmore.edu" ]
diana.kalema@strathmore.edu
910730e1cc78328d7a91fa01b4ba96ca5d3084bb
11ba6df8fb9c2d8f0528f39f864187f8576169b9
/src/main/java/com/firefly/conoche/web/rest/errors/ExceptionTranslator.java
f101d3df5107f9eb0a8ad283175fd99daa1d66a4
[]
no_license
Sergiocr16/conoche
fd54ddf6464596789fa6369306ae5bf254c173a7
9ac3d88aeb8679b626393b7557eea673a06249c3
refs/heads/master
2021-01-21T11:00:21.171019
2017-03-01T05:01:18
2017-03-01T05:01:18
83,513,574
0
0
null
null
null
null
UTF-8
Java
false
false
3,444
java
package com.firefly.conoche.web.rest.errors; import java.util.List; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity.BodyBuilder; import org.springframework.security.access.AccessDeniedException; import org.springframework.validation.BindingResult; import org.springframework.validation.FieldError; import org.springframework.web.HttpRequestMethodNotSupportedException; import org.springframework.web.bind.MethodArgumentNotValidException; import org.springframework.web.bind.annotation.*; /** * Controller advice to translate the server side exceptions to client-friendly json structures. */ @ControllerAdvice public class ExceptionTranslator { @ExceptionHandler(ConcurrencyFailureException.class) @ResponseStatus(HttpStatus.CONFLICT) @ResponseBody public ErrorVM processConcurencyError(ConcurrencyFailureException ex) { return new ErrorVM(ErrorConstants.ERR_CONCURRENCY_FAILURE); } @ExceptionHandler(MethodArgumentNotValidException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) @ResponseBody public ErrorVM processValidationError(MethodArgumentNotValidException ex) { BindingResult result = ex.getBindingResult(); List<FieldError> fieldErrors = result.getFieldErrors(); return processFieldErrors(fieldErrors); } @ExceptionHandler(CustomParameterizedException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) @ResponseBody public ParameterizedErrorVM processParameterizedValidationError(CustomParameterizedException ex) { return ex.getErrorVM(); } @ExceptionHandler(AccessDeniedException.class) @ResponseStatus(HttpStatus.FORBIDDEN) @ResponseBody public ErrorVM processAccessDeniedException(AccessDeniedException e) { return new ErrorVM(ErrorConstants.ERR_ACCESS_DENIED, e.getMessage()); } private ErrorVM processFieldErrors(List<FieldError> fieldErrors) { ErrorVM dto = new ErrorVM(ErrorConstants.ERR_VALIDATION); for (FieldError fieldError : fieldErrors) { dto.add(fieldError.getObjectName(), fieldError.getField(), fieldError.getCode()); } return dto; } @ExceptionHandler(HttpRequestMethodNotSupportedException.class) @ResponseBody @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) public ErrorVM processMethodNotSupportedException(HttpRequestMethodNotSupportedException exception) { return new ErrorVM(ErrorConstants.ERR_METHOD_NOT_SUPPORTED, exception.getMessage()); } @ExceptionHandler(Exception.class) public ResponseEntity<ErrorVM> processRuntimeException(Exception ex) { BodyBuilder builder; ErrorVM errorVM; ResponseStatus responseStatus = AnnotationUtils.findAnnotation(ex.getClass(), ResponseStatus.class); if (responseStatus != null) { builder = ResponseEntity.status(responseStatus.value()); errorVM = new ErrorVM("error." + responseStatus.value().value(), responseStatus.reason()); } else { builder = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR); errorVM = new ErrorVM(ErrorConstants.ERR_INTERNAL_SERVER_ERROR, "Internal server error"); } return builder.body(errorVM); } }
[ "sergiojcr16@gmail.com" ]
sergiojcr16@gmail.com
c903915dc391599fd63cda176940ad2a86a760d0
c9c8750171750aa3c3f590d80c7626ae2d862f92
/com.m2yazilim.tracker/com.m2yazilim.tracker.util/src/main/java/com/m2yazilim/tracker/dataaccess/model/obj/tracker/iface/ITrackerListVersion.java
5aaa9a77475482b54e06bd1424e63bff82e01e31
[]
no_license
raskolnikov/tracker
d1a45bf20f4eb55de2eede80da244e37d81512ac
66529ef7d43b58704d45538097126fb2b415c88d
refs/heads/master
2020-06-08T05:14:58.033313
2015-02-21T22:24:25
2015-02-21T22:24:25
31,143,533
0
0
null
null
null
null
UTF-8
Java
false
false
3,430
java
package com.m2yazilim.tracker.dataaccess.model.obj.tracker.iface; import com.m2yazilim.tracker.dataaccess.model.obj.tracker.TrackerProjects; import com.m2yazilim.tracker.dataaccess.model.obj.tracker.TrackerTasks; import java.util.Set; import javax.persistence.Basic; /** * Object interface mapping for hibernate-handled table: tracker_list_version. * @author autogenerated */ public interface ITrackerListVersion { /** * Return the value associated with the column: id. * @return A Integer object (this.id) */ Integer getId(); /** * Set the value related to the column: id. * @param id the id value you wish to set */ void setId(final Integer id); /** * Return the value associated with the column: listPosition. * @return A Integer object (this.listPosition) */ Integer getListPosition(); /** * Set the value related to the column: listPosition. * @param listPosition the listPosition value you wish to set */ void setListPosition(final Integer listPosition); /** * Return the value associated with the column: project. * @return A TrackerProjects object (this.project) */ TrackerProjects getProject(); /** * Set the value related to the column: project. * @param project the project value you wish to set */ void setProject(final TrackerProjects project); /** * Return the value associated with the column: showInList. * @return A Integer object (this.showInList) */ Integer getShowInList(); /** * Set the value related to the column: showInList. * @param showInList the showInList value you wish to set */ void setShowInList(final Integer showInList); /** * Return the value associated with the column: trackerTasks. * @return A Set&lt;TrackerTasks&gt; object (this.trackerTasks) */ Set<TrackerTasks> getTrackerTaskss(); /** * Adds a bi-directional link of type TrackerTasks to the trackerTaskss set. * @param trackerTasks item to add */ void addTrackerTasks(TrackerTasks trackerTasks); /** * Set the value related to the column: trackerTasks. * @param trackerTasks the trackerTasks value you wish to set */ void setTrackerTaskss(final Set<TrackerTasks> trackerTasks); /** * Return the value associated with the column: version. * @return A Integer object (this.version) */ Integer getVersion(); /** * Set the value related to the column: version. * @param version the version value you wish to set */ void setVersion(final Integer version); /** * Return the value associated with the column: versionName. * @return A String object (this.versionName) */ String getVersionName(); /** * Set the value related to the column: versionName. * @param versionName the versionName value you wish to set */ void setVersionName(final String versionName); /** * Return the value associated with the column: versionTense. * @return A Integer object (this.versionTense) */ Integer getVersionTense(); /** * Set the value related to the column: versionTense. * @param versionTense the versionTense value you wish to set */ void setVersionTense(final Integer versionTense); // end of interface }
[ "mehmet2aktas@gmail.com" ]
mehmet2aktas@gmail.com
b356529c6ea1084a9c14d384fb73df98169a97bd
4b1958019c442c386f90d585feec60ead1fe1ebc
/src/main/java/br/com/felipe/soapcustomclient/services/DataBaseService.java
475967633c26b586b8b3a60c86d94c298adeb573
[]
no_license
rodrigues882013/readcsv
d74434f14410ec2c75dbc9bd5b278b3b2ed076f1
e25f38a1fb3e6e6cf5bc995aaff7d92d1d7c3f81
refs/heads/master
2021-08-10T17:50:31.331401
2017-11-12T21:24:05
2017-11-12T21:24:05
110,470,060
0
0
null
null
null
null
UTF-8
Java
false
false
550
java
package br.com.felipe.soapcustomclient.services; import br.com.felipe.soapcustomclient.dao.UserDAO; import br.com.felipe.soapcustomclient.models.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service("DATABASE_SERVICE") public class DataBaseService{ @Autowired private UserDAO userDao; public void read(){ List<User> users = (List<User>) userDao.findAll(); users.forEach( u -> System.out.println(u.getUsername())); } }
[ "rodrigues882007@gmail.com" ]
rodrigues882007@gmail.com
02a197b20cf216bae92c7e1a8529df81ab74e178
1aaebf8b58a1057ac7ba82e39c39aa34f3bfcef4
/app/src/main/java/gmoo/com/gmudevelopers/edu/gmoo/ui/staggeredgrid/model/FlickrResponsePhotos.java
b594c71b950b45fe84c77c022482ecd0c8e9d1c0
[]
no_license
gmudevelopers/GMOO_APP
842550b8922a869416e1659107b3933ea0895fff
10de1b4a5f81980ec038d99aff4c980a519a85fe
refs/heads/master
2021-09-08T01:17:50.309171
2018-01-11T23:01:32
2018-01-11T23:01:32
116,182,999
2
0
null
null
null
null
UTF-8
Java
false
false
293
java
package gmoo.com.gmudevelopers.edu.gmoo.ui.staggeredgrid.model; public class FlickrResponsePhotos { FlickrGetImagesResponse photos; public FlickrGetImagesResponse getPhotos() { return photos; } public void setPhotos(FlickrGetImagesResponse photos) { this.photos = photos; } }
[ "boatengfrankenstein@gmail.com" ]
boatengfrankenstein@gmail.com
26079a7f113ff91153c09a4a7550932762b837ab
a1a194a0325ba37123da7b5cb38ddc13aba23a93
/src/main/java/net/ptidej/seodin/service/dto/package-info.java
23c44a38e446e7f0a9d7287366a5b90fa1666ca5
[]
no_license
singhsatnam/seodin-demo
2b03afc4c09c61989df046c084007582c5f1769f
f4c52369e556d0013a321650f4b911248fd9f6d2
refs/heads/master
2020-03-23T11:02:02.958914
2018-07-18T19:31:40
2018-07-18T19:31:40
141,478,521
0
0
null
null
null
null
UTF-8
Java
false
false
73
java
/** * Data Transfer Objects. */ package net.ptidej.seodin.service.dto;
[ "forsatnam@gmail.com" ]
forsatnam@gmail.com
057bb469e43f33cac71d803f3dad27a889065769
7c1737b3572d227579209fb6e0715747e12e48fc
/src/com/owera/xaps/shell/output/LineComparator.java
d2fb1091e73b970c2487bbb187d849bd14f4d50f
[ "MIT" ]
permissive
tanyhuan02/shell
5f59acfb0353047400d728d5b0ee0eaf88d072a9
a0ad8d5a29987a8a1dec65e8b9524fd2130e101f
refs/heads/master
2020-07-01T12:43:38.077123
2014-11-23T13:55:50
2014-11-23T13:55:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,952
java
package com.owera.xaps.shell.output; import java.util.Comparator; import java.util.List; public class LineComparator implements Comparator<Line> { private List<LineComparatorColumn> columnsToSort; public LineComparator(List<LineComparatorColumn> columnsToSort) { this.columnsToSort = columnsToSort; } private int compareImpl(String s1, String s2, LineComparatorColumn lcc) { if (s1 == null && s2 == null) return 0; if (s1 == null && s2 != null) return -1; if (s1 != null && s2 == null) return 1; if (s1.equals("NULL") && s2.equals("NULL")) return 0; if (s1.equals("NULL") && !s2.equals("NULL")) return 1; if (!s1.equals("NULL") && s2.equals("NULL")) return -1; if (lcc.getSortType().equals(LineComparatorColumn.SORT_NUM)) { try { int i1 = new Integer(s1); int i2 = new Integer(s2); return i1 - i2; } catch (NumberFormatException nfe) { throw new IllegalArgumentException("Column " + (lcc.getColumnIndex() + 1) + " could not be sorted as numbers."); } } else { return s1.compareTo(s2); } } @Override public int compare(Line o1, Line o2) { // if (o1 == null && o2 == null) // return 0; // if (o1 == null && o2 != null) // return -1; // if (o1 != null && o2 == null) // return 1; LineComparatorColumn decidingColumn = null; int compareVal = 0; for (LineComparatorColumn lcc : columnsToSort) { decidingColumn = lcc; if (o1.getValues().size() > lcc.getColumnIndex() && o2.getValues().size() > lcc.getColumnIndex()) { String val1 = o1.getValues().get(lcc.getColumnIndex()); String val2 = o2.getValues().get(lcc.getColumnIndex()); compareVal = compareImpl(val1, val2, lcc); if (compareVal != 0) break; } } if (!decidingColumn.getOrder().equals(LineComparatorColumn.ASCENDING)) { if (compareVal > 0) return -1; if (compareVal < 0) return 1; return compareVal; } else { return compareVal; } } }
[ "mortensimon@gmail.com" ]
mortensimon@gmail.com
38d066d018dd0c3b3e4758962095b877733546fb
bd8cd01b70643443e98bb862f7de4003718a3a8f
/hw10/src/main/java/repository/StudentRepository.java
f54973765dc1a263a53bad68925d30a397bbe995
[]
no_license
gilga1ad/D_Galimov_HW
4eda4fe6e8ca25f7c6d8e9834cc113c303d4c8aa
5cd25a94b06d0e7ea1bacfc7f97d8896762b7ed7
refs/heads/master
2020-12-24T09:38:14.454364
2016-12-01T23:03:15
2016-12-01T23:28:42
73,277,210
0
0
null
null
null
null
UTF-8
Java
false
false
162
java
package repository; import model.Student; public interface StudentRepository { boolean add(Student student); Student findOne(int id); }
[ "ozimandiya@gmail.com" ]
ozimandiya@gmail.com
3c487ce2d542027292b9004b93c90bffbbab9031
5099fe91f92750ea67f077fb8816cadc8ddc254f
/app/src/main/java/ua/kh/em/appa/base/BaseActivity.java
fd9c66f8c38339a055436269b51cb2a477494662
[]
no_license
eserikpaev/registration
1952f90b436565ced34284686e3b7d3f95882f2d
c7b99aa4962dbd223c966c667d3378007eea5eab
refs/heads/master
2020-04-25T17:59:00.327663
2019-02-27T18:32:34
2019-02-27T18:32:34
172,968,540
0
0
null
null
null
null
UTF-8
Java
false
false
713
java
package ua.kh.em.appa.base; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.widget.Toast; import butterknife.ButterKnife; public abstract class BaseActivity extends AppCompatActivity{ @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(getLayoutId()); ButterKnife.bind(this); setView(); } protected abstract int getLayoutId(); public void setView(){} public void showMessageToast(String message){ Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show(); } }
[ "erik__1999@mail.ru" ]
erik__1999@mail.ru
c962d587ae737fe412b3fea248f894624d7d9df3
c642e8a2aa8a0e77de118923a0852219f845cc3d
/src/utils/QueryFilm.java
bef27a7b7a8ed4ef2912a2198450bdbcbfa6c8f2
[]
no_license
o1zhs/FilmWeb
cb9bca85edc6df6b37b39e5ec4b28562009b5df2
c0cf337fd16d57245b773715f78bfa504519111c
refs/heads/master
2020-03-21T10:19:15.407781
2018-06-24T01:46:19
2018-06-24T01:46:19
138,445,096
1
0
null
null
null
null
UTF-8
Java
false
false
1,762
java
package utils; import Bean.Film; import Bean.Firm; import database.DBOperator; import java.util.ArrayList; import java.util.List; public class QueryFilm { private Boolean isName; private String sql="select Film.*,Firm.FirmName from Film,Firm "; private List<Film> filmList = new ArrayList<>(); //电影名称查询构造函数 public QueryFilm(String filmString,Boolean isName){ this.isName = isName; //连接查询,直接查出电影基本信息和出品公司名字 if(isName) this.sql = this.sql + " where FilmName='" + filmString + "' and Film.FirmID=Firm.FirmID ;"; else //连接查询,直接查出指定类别的电影基本信息和出品公司名字 this.sql = "select Film.*,Firm.FirmName from Film,Category,Firm " + "where Film.FirmID=Firm.FirmID and Film.FilmID=Category.FilmID and Category.DYLB_LB='" + filmString + "' ;" ; //System.out.println(this.sql); } public void executeQuery(){ String username = "film"; String password = "123456"; DBOperator dbOperator = new DBOperator(username, password,"film"); dbOperator.query(this.sql); System.out.println(this.sql); this.filmList = dbOperator.getFilmList(); } public List<Film> getFilmList() { for(Film film:this.filmList){ System.out.println("名称:" + film.getFilmName()); System.out.println("时长:" + film.getLength()+" min"); System.out.println("发行年份:" + film.getPublishYear()); System.out.println("情节:" + film.getPlot()); } return this.filmList; } public Boolean getName() { return isName; } }
[ "1343489838@qq.com" ]
1343489838@qq.com
c3e2039e4fd877222348753bc85c63f5bbf20ffb
5ca9351e6732e02f8971c04122ea3fd85d488e75
/src/main/java/tn/grp3DL1/banque/entities/Nature_taux.java
1bc02489a267137280cda734113c0e4ad8ad5598
[]
no_license
sihemsouli/Gestion-banque
d63a1a8bf8d4eb5fec1add5903490f86630bca70
c076eec14aea34bb4e17e5d31bf7c4363c1bfe23
refs/heads/master
2023-06-26T16:07:42.644963
2021-07-29T10:26:56
2021-07-29T10:26:56
388,091,787
2
1
null
null
null
null
UTF-8
Java
false
false
92
java
package tn.grp3DL1.banque.entities; public enum Nature_taux { taux_fixe,taux_variable; }
[ "sihem.souli@esprit.tn" ]
sihem.souli@esprit.tn
4016ba462f8da1e971c08333e4b203e48d167944
54b96ec8ac1ab80a63f3a65e40ce2ccc3866d6fd
/src/my/project/ConsoleReader.java
9bcdd50ef43deaef117a089498627b12b63ef88a
[]
no_license
NikolayNN/SqlCmd
9394f8ef546267a2859a20d9dd0cfe6add567013
cf8c696db433c6667d97255a7ef692858a0b5a1e
refs/heads/master
2021-01-10T15:02:17.222104
2016-04-06T06:02:04
2016-04-06T06:02:04
55,470,195
0
0
null
null
null
null
UTF-8
Java
false
false
400
java
package my.project; import java.util.Scanner; /** * Created by Nikol on 4/5/2016. */ public class ConsoleReader { public String getString () { Scanner sc = new Scanner(System.in); return sc.nextLine(); } public static void main(String[] args) { ConsoleReader consoleReader = new ConsoleReader(); System.out.println(consoleReader.getString()); } }
[ "Horushko.Nikolay@gmail.com" ]
Horushko.Nikolay@gmail.com
4769faf7af267c4319d208896a3edffa8b17cd06
92bacb652f4a6698acafcf512ce790f2c354de97
/callback/src/com/gj/CallBack.java
a6dcaf98a838a564374c1b8b8774c528e89b9f71
[]
no_license
gj452652749/native
c7ac88737b41ceeda2c53be13617ee0f94f54962
983c0ec9bce6e0c80b7faae2a2a6fa97293704ed
refs/heads/master
2021-01-20T18:45:16.085346
2016-07-04T01:50:37
2016-07-04T01:50:37
62,521,612
0
0
null
null
null
null
UTF-8
Java
false
false
83
java
package com.gj; public interface CallBack { public void solve(String result); }
[ "1285803721@qq.com" ]
1285803721@qq.com
f27383c54ea9db09f4b5b1012cc722d14e0fc11e
b5a93d03a4ae2d3928e09d6d2e7079a486a627b2
/Downloads/AgentWeb-master/library/src/main/java/com/just/library/ChromeClientCallbackManager.java
ebc002f560f4482900055683637a83f7aa00fc00
[ "Apache-2.0" ]
permissive
GuolinYao/AgentWeb-master
5670822a413f106ae45f6d9414fe8ca3b136d89f
7a284ba4e7e6c2b2069e445205e53bfd1bdab197
refs/heads/master
2020-12-03T07:54:28.361135
2017-06-28T07:40:03
2017-06-28T07:40:04
95,638,904
1
1
null
null
null
null
UTF-8
Java
false
false
1,724
java
package com.just.library; import android.webkit.JsPromptResult; import android.webkit.WebView; /** * Created by cenxiaozhong on 2017/5/14. * source CODE https://github.com/Justson/AgentWeb */ public class ChromeClientCallbackManager { private ReceivedTitleCallback mReceivedTitleCallback; private GeoLocation mGeoLocation; public ReceivedTitleCallback getReceivedTitleCallback() { return mReceivedTitleCallback; } public ChromeClientCallbackManager setReceivedTitleCallback(ReceivedTitleCallback receivedTitleCallback) { mReceivedTitleCallback = receivedTitleCallback; return this; } public ChromeClientCallbackManager setGeoLocation(GeoLocation geoLocation){ this.mGeoLocation=geoLocation; return this; } public interface ReceivedTitleCallback{ void onReceivedTitle(WebView view, String title); } public AgentWebCompatInterface mAgentWebCompatInterface; public AgentWebCompatInterface getAgentWebCompatInterface(){ return mAgentWebCompatInterface; } public void setAgentWebCompatInterface(AgentWebCompatInterface agentWebCompatInterface){ this.mAgentWebCompatInterface=agentWebCompatInterface; LogUtils.i("Info","agent:"+agentWebCompatInterface); } interface AgentWebCompatInterface{ public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result); public void onReceivedTitle(WebView view, String title); public void onProgressChanged(WebView view, int newProgress); } public static class GeoLocation { /*1 表示定位开启, 0 表示关闭*/ public int tag=1; } }
[ "635142285@qq.com" ]
635142285@qq.com
2d39eb01a87c2480b81645827b778b82a3c0660c
768a5d76f8d2c8c7f2b84e436ba4e4d1963171ed
/wildfly-11.0.0.CR1-quickstarts/wicket-war/src/main/java/org/jboss/as/quickstarts/wicketWar/pages/ListContacts.java
be0570dc9974d47de2de8eecdf222f4b534ac218
[ "Apache-2.0" ]
permissive
asaini94/war_agent
dbc4252363329f1d9486416dd7efe1cde9f399ef
079deb3388352d14d1271afdb3fe12846bdbe41c
refs/heads/master
2020-04-22T21:02:56.201178
2019-02-15T06:38:58
2019-02-15T06:38:58
170,660,831
0
0
null
null
null
null
UTF-8
Java
false
false
4,127
java
/* * JBoss, Home of Professional Open Source * Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.as.quickstarts.wicketWar.pages; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.annotation.Resource; import javax.inject.Inject; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.link.Link; import org.apache.wicket.markup.repeater.Item; import org.apache.wicket.markup.repeater.RefreshingView; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.jboss.as.quickstarts.wicketWar.dao.ContactDao; import org.jboss.as.quickstarts.wicketWar.model.Contact; /** * Dynamic behavior for the ListContact page * * @author Filippo Diotalevi */ @SuppressWarnings("serial") public class ListContacts extends WebPage { // Inject the ContactDao using @Inject @Inject private ContactDao contactDao; @Resource(name = "welcomeMessage") private String welcome; // Set up the dynamic behavior for the page, widgets bound by id public ListContacts() { // Add the dynamic welcome message, specified in web.xml add(new Label("welcomeMessage", welcome)); // Populate the table of contacts add(new RefreshingView<ContactDto>("contacts") { @Override protected Iterator<IModel<ContactDto>> getItemModels() { List<IModel<ContactDto>> models = new ArrayList<>(); for (Contact contact : contactDao.getContacts()) { models.add(Model.of(new ContactDto(contact))); } return models.iterator(); } @Override protected void populateItem(final Item<ContactDto> item) { ContactDto contact = item.getModelObject(); item.add(new Label("name", contact.getName())); item.add(new Label("email", contact.getEmail())); item.add(new Link<ContactDto>("delete", item.getModel()) { // Add a click handler @Override public void onClick() { contactDao.remove(item.getModelObject().getId()); setResponsePage(ListContacts.class); } }); } }); } /** * This class is detached version of {@link Contact} and it's purpose is to * avoid detachable model in order not to complicate this example. * <p> * For more information please see * https://ci.apache.org/projects/wicket/guide/7.x/guide/modelsforms.html#modelsforms_6 */ private static class ContactDto implements Serializable { private final Long id; private final String name; private final String email; ContactDto(Contact contact) { this.id = contact.getId(); this.name = contact.getName(); this.email = contact.getEmail(); } public Long getId() { return id; } public String getName() { return name; } public String getEmail() { return email; } } }
[ "anusaini16394@gmail.com" ]
anusaini16394@gmail.com
2a9505cd755ab425419a524778bb9bb4bf69b597
11556c58049fc8f52f3a1a3fda291b155d19877c
/src/main/java/uk/co/hrdlicka/tomas/webapp/demo/aui/portal/template/RenderingException.java
824574266e2a93231d608b564ed7f5ac8c55663a
[]
no_license
royalwang/aui-demo-webapp
eb3f3319092c9a76bd1cbbfc53f989fae4e667bf
bdca738e93e78f00d09d470ee056f48e45a04551
refs/heads/master
2023-03-15T15:55:34.946583
2018-04-07T13:22:34
2018-04-07T13:22:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
680
java
/* Copyright 2016 Tomas Hrdlicka <tomas@hrdlicka.co.uk>. All rights reserved. */ package uk.co.hrdlicka.tomas.webapp.demo.aui.portal.template; /** * Template Rendering exception * * @author Tomas Hrdlicka <tomas@hrdlicka.co.uk> * @see <a href="http://tomas.hrdlicka.co.uk">Tomas 'Xboot' Hrdlicka</a> */ @SuppressWarnings("serial") public class RenderingException extends RuntimeException { public RenderingException(final String message, final Throwable cause) { super(message, cause); } public RenderingException(final String message) { super(message); } public RenderingException(final Throwable cause) { super(cause); } }
[ "tomas@hrdlicka.co.uk" ]
tomas@hrdlicka.co.uk
e9ec78fbc74ba22755610c0243cbf074ef93c251
a67bc4ffbb0d6a134ecfc1811e6815c2419d9855
/src/main/java/game/Used.java
3c4a871ebd96e92bffba05fc6861e5eba33526b5
[]
no_license
gordonstar01/game-email
ac0ccc86befc1869db2c799dae527211dd45185b
77e7dff376c5182fe8007240fa12add28d463eca
refs/heads/master
2022-12-09T16:59:12.947501
2020-09-17T05:49:29
2020-09-17T05:49:29
295,988,826
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package game; public class Used extends AbstractEvent { private Long id; private Long rewardId; private Long walletId; private String status; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getRewardId() { return rewardId; } public void setRewardId(Long rewardId) { this.rewardId = rewardId; } public Long getWalletId() { return walletId; } public void setWalletId(Long walletId) { this.walletId = walletId; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } }
[ "kikiki03@naver.com" ]
kikiki03@naver.com
4f8f47c49ee37ec055c99dfde89832a183fdd15e
004f43469494d6ea26cf9ae2f42bcdb815c4c22b
/app/src/main/java/com/ptp/phamtanphat/fragmentlayoutorientation3110/ChitietActivity.java
ff24e9cc75d8112df48d7405459f7580dbc65f26
[]
no_license
phamtanphat/FragmentLayoutOrientation3110
e753eea24c4547a5e02482c04bcf98bdd51ad020
55ff3c31c21c0e090dfbd944692835b43a48d210
refs/heads/master
2021-03-30T22:23:33.543616
2018-03-10T12:10:58
2018-03-10T12:10:58
124,652,325
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package com.ptp.phamtanphat.fragmentlayoutorientation3110; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class ChitietActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_chitiet); Intent intent = getIntent(); Sinhvien sinhvien = (Sinhvien) intent.getSerializableExtra("sinhvien"); FragmentChiTiet fragmentChiTiet = (FragmentChiTiet) getFragmentManager().findFragmentById(R.id.fragmentchitiet); fragmentChiTiet.SetTextFromData(sinhvien); } }
[ "khoaphp@yahoo.com" ]
khoaphp@yahoo.com
741580a9375ddada642310731044ea0e4358e593
1d0d7f25d5e67800eb24e6f32b9e3a1858cedee0
/src/main/java/edu/utdallas/aos/p3/filesystem/Q.java
d15398183d897931dceab2a76d660cf0a13ee8fc
[]
no_license
roboguy/FileSystem
0ddd2088f41edf5c7cb35cf95ebb0281b895ea4a
e3c0000d5394270a9f7cbeab723573cb3240a8b7
refs/heads/master
2021-01-18T01:36:42.005348
2015-05-05T01:52:06
2015-05-05T01:52:06
33,759,761
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package edu.utdallas.aos.p3.filesystem; public class Q extends P{ private Boolean isDS; public Q(String id, Integer VN, Integer RU, String content) { super(id, VN, RU, content); } public Boolean getIsDS() { return isDS; } public void setIsDS(Boolean isDS) { this.isDS = isDS; } }
[ "sudhanshu.iyer@tangomc.com" ]
sudhanshu.iyer@tangomc.com
573b24c4b82bc43480dc047afa5bbf39d9db6627
032f3b96711e4d771bbde5c941ed9fd8a45b3dcc
/src/main/java/com/wolken/monument/controller/SaveController.java
8c8ae09425eb90866b63754414c8b3fc5e9501f0
[]
no_license
mThanushree/Thanu
9734e1a5f797c034288da53f9430f543ffd22aa4
710952eba6e066735517972e734b1a5838cfecb5
refs/heads/master
2023-08-26T12:01:20.587864
2021-11-10T07:06:12
2021-11-10T07:06:12
415,239,083
0
0
null
null
null
null
UTF-8
Java
false
false
1,222
java
package com.wolken.monument.controller; import java.util.List; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import com.wolken.monument.dao.MonumentDAO; import com.wolken.monument.dto.MonumentDTO; import com.wolken.monument.entity.MonumentEntity; import com.wolken.monument.service.MonumentService; @Controller public class SaveController { @Autowired MonumentService service; @RequestMapping(value="save", method = RequestMethod.POST) ModelAndView saveDetails(MonumentDTO dto) { ModelAndView view=new ModelAndView(); System.out.println(dto); MonumentEntity entity=new MonumentEntity(); service.validateandsave(dto); view.setViewName("hello"); view.addObject("msg", "Data Saved"); view.addObject("data", dto); return view; } @RequestMapping("getAll") ModelAndView getAll() { ModelAndView view=new ModelAndView("hello"); List list=service.getAll(); view.addObject("list", list); return view; } }
[ "WSPL-0121@WSPL-0121.wolkensoftware.com" ]
WSPL-0121@WSPL-0121.wolkensoftware.com
163178c874093c2141e78607c48f47b9720ed75f
f30d3b01e2d6a8300e8da0595c254fad7f3b22d3
/src/ru/icmit/vk/Edge.java
f7587fc1e72101ca51addb0e482ac8f1d4df5013
[]
no_license
Adele94/Social-network-analysis
c070e7a3b951f3a6b938d17d48a6ad809b390868
565a1a2d6f2230f108db2dd8ce465f190c161df0
refs/heads/master
2020-05-17T12:09:11.246186
2019-05-19T10:00:09
2019-05-19T10:00:09
183,703,254
2
1
null
null
null
null
UTF-8
Java
false
false
856
java
package ru.icmit.vk; import java.util.HashSet; import java.util.Set; /** * Created by Adele on 03/05/2019. */ public class Edge { public int groupIdA; public int groupIdB; public float affinity; public Edge(int groupIdA, int groupIdB, float affinity) { this.groupIdA = groupIdA; this.groupIdB = groupIdB; this.affinity = affinity; } public int compareByAffinity(Edge other) { return Float.compare(this.affinity, other.affinity); } public int compareByAffinityDecs(Edge other) { return -compareByAffinity(other); } @Override public String toString() { return String.format("%d - %d: %f", groupIdA, groupIdB, affinity); } public String printEdges() { return String.format("\"source\":\"%s\",\"target\":\"%s\"}", groupIdA, groupIdB); } }
[ "adel.shavalieva@yandex.ru" ]
adel.shavalieva@yandex.ru
ae13297671c0cb4c4a4adda5ba047287fee391df
02fdb306df1ca9b06c4056cc251dd69d02c31628
/Websocket with Kafka/src/main/java/com/spring/microservices/kafka/configuration/KafkaConfiguration.java
dfc1954b6b46f7234e08ed1446cf9ee611a9c2ca
[ "Apache-2.0" ]
permissive
soumyadip007/Distributed-System-Message-Broking-Log-Monitoring-using-Websocket-Netflix-OSS-Kafka-and-Microservice
3d0d3cffb9b5609e96decba68850e5ecb59782c6
0bebb8c5c6c97ba7f02fcbc6c052328f9713f68c
refs/heads/master
2022-09-14T10:47:17.991386
2020-05-26T05:57:21
2020-05-26T05:57:21
266,951,685
1
1
null
null
null
null
UTF-8
Java
false
false
1,620
java
package com.spring.microservices.kafka.configuration; import java.util.HashMap; import java.util.Map; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.common.serialization.StringDeserializer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.kafka.annotation.EnableKafka; import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory; import org.springframework.kafka.core.ConsumerFactory; import org.springframework.kafka.core.DefaultKafkaConsumerFactory; @EnableKafka @Configuration public class KafkaConfiguration { //-----------------------String-String----------------------- @Bean public ConsumerFactory<String, String> consumerFactory() { Map<String, Object> config = new HashMap<>(); config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "127.0.0.1:9092"); config.put(ConsumerConfig.GROUP_ID_CONFIG, "group_id"); config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); return new DefaultKafkaConsumerFactory<>(config); } @Bean public ConcurrentKafkaListenerContainerFactory<String, String> kafkaListenerContainerFactory() { ConcurrentKafkaListenerContainerFactory<String, String> factory = new ConcurrentKafkaListenerContainerFactory(); factory.setConsumerFactory(consumerFactory()); return factory; } }
[ "soumyadip.note@gmail.com" ]
soumyadip.note@gmail.com
fd0bf5d61c6f8b1adbd58979205508fe2e2ac9a3
d684c8e89c93bb8481cce29e4b9ddfcd355fd68d
/src/main/java/com/core/domain/entities/Account.java
2098b2b5ff92e380dcba6860f522761c110a1f8f
[]
no_license
ruslan7up/adminWebApp
3327d5c0ad1fb089a216f2a34982004284221371
74d44e836a055914d6e6046aaad16c6ae1cf104b
refs/heads/master
2021-05-02T01:12:03.557763
2017-05-25T14:33:24
2017-05-25T14:33:24
78,829,613
0
0
null
null
null
null
UTF-8
Java
false
false
959
java
package com.core.domain.entities; import org.hibernate.validator.constraints.NotEmpty; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; /** * Created by Account on 13.01.2017. */ @Entity public class Account { @Id @GeneratedValue private Long id; @NotEmpty private String login; @NotEmpty private String password; public Account() { } public Account(String login, String password) { this.login = login; this.password = password; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getLogin() { return login; } public void setLogin(String login) { this.login = login; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "ruslan7up@gmail.com" ]
ruslan7up@gmail.com
5e018d1ac39601ad2375c5659c5df29a70033e59
e9a8922605b02334f780bcf043e1204d27af3786
/02Fabryka/Students/2017/Krzysztof Figalski/AbstractFactoryMethod/src/factory/CoverFactory.java
f44b6be42b96c41f0bf74771362551bb512eb388
[]
no_license
gomoslaw/DesignPatterns
b6cc6b243474b528ce792af9421adecdb72f577b
302788613f5fa8489929cb30293f7ea511a3d361
refs/heads/master
2020-04-04T13:39:58.862909
2018-12-07T16:49:24
2018-12-07T16:49:24
155,970,438
2
0
null
2018-11-03T09:57:01
2018-11-03T09:57:01
null
UTF-8
Java
false
false
587
java
package factory; import covers.ALiitleLifeCover; import covers.ICover; import covers.TheSistersBrothersCover; import enums.Tittles; import texts.IPages; public class CoverFactory extends AbstractFactory { @Override public ICover getCover(Tittles tittle) { if (tittle == null) { return null; } else if (tittle.equals(Tittles.A_LITTLE_LIFE)) { return new ALiitleLifeCover(); } else if (tittle.equals(Tittles.THE_SISTER_BROTHERS)) { return new TheSistersBrothersCover(); } return null; } @Override public IPages getPages(Tittles tittle) { return null; } }
[ "krzysztof.figalski@gmail.com" ]
krzysztof.figalski@gmail.com
10614668e3e64b4199ea39605ac4ed9db8915260
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/validation/io/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java
ba7bb58ae0ff6bb4c090b31721c980eb748c88bf
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
3,941
java
/** * Copyright 1999-2015 dangdang.com. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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. * </p> */ package io.elasticjob.lite.internal.sharding; import com.google.common.collect.Lists; import io.elasticjob.lite.config.JobCoreConfiguration; import io.elasticjob.lite.config.LiteJobConfiguration; import io.elasticjob.lite.executor.ShardingContexts; import io.elasticjob.lite.fixture.TestDataflowJob; import io.elasticjob.lite.internal.config.ConfigurationService; import io.elasticjob.lite.internal.storage.JobNodeStorage; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map; import junit.framework.TestCase; import org.hamcrest.core.Is; import org.junit.Assert; import org.junit.Test; import org.mockito.Mock; import org.mockito.Mockito; public final class ExecutionContextServiceTest { @Mock private JobNodeStorage jobNodeStorage; @Mock private ConfigurationService configService; private final ExecutionContextService executionContextService = new ExecutionContextService(null, "test_job"); @Test public void assertGetShardingContextWhenNotAssignShardingItem() { Mockito.when(configService.load(false)).thenReturn(LiteJobConfiguration.newBuilder(new io.elasticjob.lite.config.dataflow.DataflowJobConfiguration(JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).build(), TestDataflowJob.class.getCanonicalName(), true)).monitorExecution(false).build()); ShardingContexts shardingContexts = executionContextService.getJobShardingContext(Collections.<Integer>emptyList()); TestCase.assertTrue(shardingContexts.getTaskId().startsWith("test_job@-@@-@READY@-@")); Assert.assertThat(shardingContexts.getShardingTotalCount(), Is.is(3)); } @Test public void assertGetShardingContextWhenAssignShardingItems() { Mockito.when(configService.load(false)).thenReturn(LiteJobConfiguration.newBuilder(new io.elasticjob.lite.config.dataflow.DataflowJobConfiguration(JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).shardingItemParameters("0=A,1=B,2=C").build(), TestDataflowJob.class.getCanonicalName(), true)).monitorExecution(false).build()); Map<Integer, String> map = new HashMap<>(3); map.put(0, "A"); map.put(1, "B"); ShardingContexts expected = new ShardingContexts("fake_task_id", "test_job", 3, "", map); assertShardingContext(executionContextService.getJobShardingContext(Arrays.asList(0, 1)), expected); } @Test public void assertGetShardingContextWhenHasRunningItems() { Mockito.when(configService.load(false)).thenReturn(LiteJobConfiguration.newBuilder(new io.elasticjob.lite.config.dataflow.DataflowJobConfiguration(JobCoreConfiguration.newBuilder("test_job", "0/1 * * * * ?", 3).shardingItemParameters("0=A,1=B,2=C").build(), TestDataflowJob.class.getCanonicalName(), true)).monitorExecution(true).build()); Mockito.when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); Mockito.when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(true); Map<Integer, String> map = new HashMap<>(1, 1); map.put(0, "A"); ShardingContexts expected = new ShardingContexts("fake_task_id", "test_job", 3, "", map); assertShardingContext(executionContextService.getJobShardingContext(Lists.newArrayList(0, 1)), expected); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
68dc5da7427496f9af407be2c1627477e6472538
a898db243dca3fcade102814b2f37b9a1755a264
/src/sample/Calculator.java
1ab4720fb21896bea36908aebd6ccfe3603c8956
[]
no_license
DmitrySar/Demo-JavaFX-Calculator
ca467e096cf84821c13a3e121fb7d3da085c6d7d
6f7812ceb8dc7a6d942da5b764ba10927c39e788
refs/heads/master
2020-12-19T01:21:37.883446
2020-02-14T07:04:49
2020-02-14T07:04:49
235,576,985
0
0
null
null
null
null
UTF-8
Java
false
false
429
java
package sample; public class Calculator implements ICalculator { private IAtomicCalc calc; private String a; private String b; public Calculator(IAtomicCalc calc) { this.calc = calc; } public void setA(String a) { this.a = a; } public void setB(String b) { this.b = b; } @Override public String getResult() { return calc.getResult(a, b); } }
[ "youshin.d@gmail.com" ]
youshin.d@gmail.com
3cc273b5bd6add57101d914151b41da828435cab
7926a7bd472e630ff69443868ec7f6878c9a9ad1
/ScreenNavigationDemo/app/src/main/java/com/bipulhstu/screennavigationdemo/NepalFragment.java
7dd66a1d0659cb25903301e7b2cc9c26724def90
[]
no_license
bipulhstu/Android-Studio-Projects
80a409dc0474bfe111ef41b57bba5d3a4a920add
a74d80707e2a37dddeeffa20d04dbf9db6be599b
refs/heads/master
2020-04-05T19:48:53.593202
2020-01-01T08:50:29
2020-01-01T08:50:29
157,151,340
1
0
null
null
null
null
UTF-8
Java
false
false
665
java
package com.bipulhstu.screennavigationdemo; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; /** * A simple {@link Fragment} subclass. */ public class NepalFragment extends Fragment { public NepalFragment() { // Required empty public constructor } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_nepal, container, false); } }
[ "bipulhstu@gmail.com" ]
bipulhstu@gmail.com
bcb8b3026c072c10d1422ba8829fb38a3225d252
f1f677b01824f82d7add23d3760c0ea2ecf7f953
/IDEA-master/src/main/java/bits/BinaryOperator.java
0c3c270b61dcca29ed99be1e0dee4120dbc33f8e
[ "MIT" ]
permissive
tungsoi/IDEA_MMHNC
7a432584a61ece8c3c76ec78410a1c8a8dcaeae4
e9974b5db228a6a9209f0ee6cea109fba3a62ae4
refs/heads/master
2023-06-11T15:41:33.119883
2021-07-03T03:23:19
2021-07-03T03:23:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
112
java
package bits; public interface BinaryOperator { BitArray combine(BitArray operand1, BitArray operand2); }
[ "longdcnb1998@gmail.com" ]
longdcnb1998@gmail.com
11c1d324cd13a101698c6cd3542751334124cba3
07359367e0751c64fe26f26d459b4413c0e4bc34
/src/main/java/com/writingcode/www/community/controller/FeedbackController.java
9503a55ca61df27df6a86017381691191fab0421
[]
no_license
ChavyX/CommunityManagementSystem-backend
3fb89b4286676e5701eddff80e20cb6227096925
7565b6857d766e2d217b4c86ad60849ed57f14d0
refs/heads/master
2022-09-22T19:33:26.873770
2020-06-05T11:59:18
2020-06-05T11:59:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,944
java
package com.writingcode.www.community.controller; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.writingcode.www.community.entity.po.Feedback; import com.writingcode.www.community.entity.vo.FeedbackVo; import com.writingcode.www.community.result.CommonResult; import com.writingcode.www.community.service.IFeedbackService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** * @author Chavy * @date 2020/5/6 */ @RestController @RequestMapping("/api/feedback") public class FeedbackController { @Resource private IFeedbackService feedbackService; /** * 添加反馈 * @param feedback 反馈 * @return CommonResult<Void> */ @PostMapping("/addFeedback") public CommonResult<Void> addFeedback(@RequestBody Feedback feedback){ if(feedbackService.addFeedback(feedback)){ return new CommonResult<Void>().success(); } return new CommonResult<Void>().fail(); } /** * 更新反馈 * @param feedback 反馈 * @return CommonResult<Void> */ @PostMapping("/updateFeedback") public CommonResult<Void> updateFeedback(@RequestBody Feedback feedback){ if(feedbackService.updateFeedback(feedback)){ return new CommonResult<Void>().success(); } return new CommonResult<Void>().fail(); } /** * 分页获取反馈信息 * @param current 页码 * @param size 页面大小 * @return CommonResult<Page<FeedbackVo>> */ @GetMapping("/getFeedback") public CommonResult<Page<FeedbackVo>> getFeedback(@RequestParam(value = "current", defaultValue = "1") int current, @RequestParam(value = "size", defaultValue = "10") int size){ return new CommonResult<Page<FeedbackVo>>().success(feedbackService.getFeedback(new Page<>(current, size))); } }
[ "1175450568@qq.com" ]
1175450568@qq.com
b31ec7f5114b193788b264f47d7cbde62bb8cc06
6f6787577e96297be403418539a05f5b87f95384
/PaymentWallet/src/com/cg/beans/Wallet.java
47808cc43e5e6bf4db8f215d8e86a345231b21c4
[]
no_license
dylan2805/PleaseandThankYouXY
ed75ec02d4982cffbc9c3e8b165c455d7d15cefa
89a4296ce77abd0850c12b3cac1411f8048ba716
refs/heads/master
2020-04-01T13:03:12.978937
2018-11-02T02:58:40
2018-11-02T02:58:40
153,235,111
0
0
null
null
null
null
UTF-8
Java
false
false
1,153
java
package com.cg.beans; import java.util.ArrayList; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; @Entity public class Wallet { @Id @GeneratedValue (strategy = GenerationType.AUTO) private int id; private double balance; @OneToMany (cascade = CascadeType.ALL, fetch = FetchType.EAGER) @JoinColumn (name = "wallet_id") private List <Transaction> transactions; public Wallet () { super (); } public Wallet (double balance) { this.balance = balance; this.transactions = new ArrayList <Transaction> (); } public int getId () { return this.id; } public double getBalance () { return balance; } public List <Transaction> getTransactions () { return transactions; } public void setBalance (double balance) { this.balance = balance; } public void setTransactions (List <Transaction> transactions) { this.transactions = transactions; } }
[ "xuan-yu.er@capgemini.com" ]
xuan-yu.er@capgemini.com
707a297cc81a50f3c394098d57fb247c64070d80
3c695a255e8c59dacf6d3e98e54d0d7389327578
/src/main/java/net.havengarde.aureycore.foundation/CommandDeclaration.java
584b82a18097a2e5e65933569ba80ba22a239cb6
[]
no_license
Havengarde-DevTeam/aureycore-foundation
13573587859e92bc648467d7a43f636d5a47c77d
6929fbc2aaccf9cda7c415089769f947964d18c0
refs/heads/master
2023-07-11T14:08:18.281062
2021-08-16T14:29:05
2021-08-16T14:29:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,108
java
package net.havengarde.aureycore.foundation; import org.bukkit.command.CommandSender; public final class CommandDeclaration<T extends CommandSender> { final boolean isVariable; private final String mainCommand, subCommand, shortDescription; private final String[] fullDescription; private final CommandExecutable<T> executable; // for help commands CommandDeclaration(CommandExecutable<T> executable) { this(false, null, null, null, null, executable); } // for subcommand categories without descriptions public CommandDeclaration(String mainCommand, String subCommand) { this(false, mainCommand, subCommand, null, null, null); } // for subcommand categories with descriptions public CommandDeclaration(String mainCommand, String subCommand, String shortDescription, String[] fullDescription) { this(false, mainCommand, subCommand, shortDescription, fullDescription, null); } // for subcommand endpoints without descriptions public CommandDeclaration(boolean isVariable, String mainCommand, String subCommand, CommandExecutable<T> executable) { this(isVariable, mainCommand, subCommand, null, null, executable); } // for subcommand endpoints with descriptions public CommandDeclaration(boolean isVariable, String mainCommand, String subCommand, String shortDescription, String[] fullDescription, CommandExecutable<T> executable) { this.mainCommand = mainCommand; this.subCommand = subCommand; this.shortDescription = shortDescription; this.fullDescription = fullDescription; this.executable = executable; this.isVariable = isVariable; } String getFullCommand() { return this.mainCommand + " " + this.subCommand; } String getMainCommand() { return this.mainCommand; } String getSubCommand() { return this.subCommand; } String getShortDescription() { return this.shortDescription; } String[] getFullDescription() { return this.fullDescription; } CommandExecutable<T> getExecutable() { return this.executable; } @FunctionalInterface public interface CommandExecutable<T extends CommandSender> { boolean execute(T sender, String[] args); } }
[ "hayachikin@gmail.com" ]
hayachikin@gmail.com
9ee5689c329dfc60e4a800b9f011263c9e4534b3
37c10f6fb6eac98d4a70f05234fae89f2d2d6c2b
/src/edu/jhu/pha/vospace/process/tika/RowAnalyser.java
c19afae82b659bd91ba325c321824939a04bbf46
[ "Apache-2.0" ]
permissive
shradhasharma/scidrive
7f0a7c952258d70dc0f30fa34f90ef1cda9a5ddb
94cec67fa5379c2323b02a45278f47c60c81da8b
refs/heads/master
2021-01-18T03:16:04.927084
2014-02-21T19:11:48
2014-02-21T19:11:48
16,515,926
0
1
null
null
null
null
UTF-8
Java
false
false
2,164
java
/******************************************************************************* * Copyright 2013 Johns Hopkins University * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package edu.jhu.pha.vospace.process.tika; import java.util.ArrayList; import java.util.List; import no.geosoft.cc.util.SmartTokenizer; public class RowAnalyser { private static final int MAX_HEADER_ROWS = 2; private char delimiter; private List<Integer> rows; public RowAnalyser(char delimiter) { rows = new ArrayList<Integer>(); this.delimiter = delimiter; } public void addRow(String row) { rows.add(getRowType(row)); } private int getRowType(String row) { SmartTokenizer tokenizer = new SmartTokenizer(row,String.valueOf(delimiter)); int result = DataTypes.UNKNOWN; while (tokenizer.hasMoreTokens()) { String s = tokenizer.nextToken(); int type = DataTypes.getDataType(s); if (result == DataTypes.UNKNOWN) { result = type; } else if (result != type) { return DataTypes.UNKNOWN; } } return result; } public int getNumHeaderRows() { int headerRows = 0; int currentRow = 0; while (currentRow < rows.size() && currentRow < MAX_HEADER_ROWS) { if (rows.get(currentRow) == DataTypes.STRING) { headerRows++; } currentRow++; } return headerRows; } public int getNumDataRows() { return rows.size() - getNumHeaderRows(); } public int getNumRows() { return rows.size(); } public int getNumStringRows() { int n = 0; for (int t: rows) { if (t == DataTypes.STRING) n++; } return n; } }
[ "dmitry@pha.jhu.edu" ]
dmitry@pha.jhu.edu
ecfb74e9ddd584e19003bc57abf78341e0f57989
3a037942dbd275b989bb2a8748f2f3c6605ead95
/CardsInHand.java
78926a5a4758bbf60268ea83d674762ce4f32a65
[]
no_license
amirerfantim/DirtySevenCardGame
0d5eaa01297ae87b34d507c6f1741d2a6a11e4ae
9cd0e578b3e7e751274d41ba2890650cfaf016d5
refs/heads/main
2023-04-21T10:34:45.626678
2021-05-01T08:07:13
2021-05-01T08:07:13
363,356,193
1
0
null
null
null
null
UTF-8
Java
false
false
3,664
java
package com.company; import java.util.LinkedList; import java.util.Random; /** * just to create starter cards of game and share it between players * @author Amirerfan Teimoory * @version 1.0 */ public class CardsInHand { /** * linked list of cards that are in bank */ private LinkedList<Card> bank = new LinkedList<>() ; { { int i; for(i = 2; i <= 14; i++){ if(i == 3 || i == 4 || i == 5 || i == 6 || i == 9 || i == 13 || i == 14) { bank.add(new SimpleCard(i, "Black", i)); bank.add( new SimpleCard(i, "Red", i)); bank.add(new SimpleCard(i, "Green", i)); bank.add(new SimpleCard(i, "Yellow", i)); } } bank.add(new FourDrawCard()); bank.add((new TwoDrawCard("Red"))); bank.add((new TwoDrawCard("Green"))); bank.add((new TwoDrawCard("Yellow"))); bank.add((new GiveAwayCard("Red"))); bank.add((new GiveAwayCard("Green"))); bank.add((new GiveAwayCard("Yellow"))); bank.add((new GiveAwayCard("Black"))); bank.add((new ReverseCard("Red"))); bank.add((new ReverseCard("Green"))); bank.add((new ReverseCard("Yellow"))); bank.add((new ReverseCard("Black"))); bank.add((new SkipCard("Red"))); bank.add((new SkipCard("Green"))); bank.add((new SkipCard("Yellow"))); bank.add((new SkipCard("Black"))); bank.add((new WildCard("Red"))); bank.add((new WildCard("Green"))); bank.add((new WildCard("Yellow"))); bank.add((new WildCard("Black"))); bank.add((new BonusCard("Red"))); bank.add((new BonusCard("Green"))); bank.add((new BonusCard("Yellow"))); bank.add((new BonusCard("Black"))); } } /** * playersCount = number of players * humanCount = number of players that human */ private int playersCount, humanCount; /** * linked list of players that are playing */ private LinkedList<Player> players = new LinkedList<>(); /** * constructor of this class * @param playersCount number of players * @param humanCount number of players that are human */ public CardsInHand(int playersCount, int humanCount) { this.playersCount = playersCount; this.humanCount = humanCount; } /** * to share cards between players */ public void createStarterCards(){ for(int outerLoop = 0; outerLoop < playersCount; outerLoop++){ LinkedList<Card> starterCards = new LinkedList<>(); for(int innerLoop = 0; innerLoop < 7; innerLoop++){ Random random = new Random(); Card card = bank.get(random.nextInt(bank.size())); bank.remove(card); starterCards.add(card); } if(outerLoop < humanCount) { players.add(new HumanPlayer(starterCards)); }else{ players.add(new BotPlayer(starterCards)); } } } /** * get bank * @return bank liked list of cards */ public LinkedList<Card> getBank() { return bank; } /** * get players * @return players linked list of player */ public LinkedList<Player> getPlayers() { return players; } }
[ "noreply@github.com" ]
amirerfantim.noreply@github.com
ae7ae5f8df23a443f421632b42ac3b5d6358784d
32f5a0b47a5a1ef07944ffcb06503f6916c0fad4
/src/main/java/com/ciotola/entities/Expense.java
827d4956085d49973a462b6f13fb2746e391b572
[]
no_license
aCiotola/RenoMaxAccounting
236848652461dc6fe8f615cb6014a7bce5c313da
f976f32d2ccc14d2155df86c6467c57d3e74512b
refs/heads/master
2021-08-04T11:08:15.152004
2018-08-07T17:11:38
2018-08-07T17:11:38
115,448,375
0
0
null
null
null
null
UTF-8
Java
false
false
6,613
java
package com.ciotola.entities; import com.ciotola.utils.CustomDate; import java.math.BigDecimal; import java.sql.Date; import java.time.LocalDate; import java.util.Objects; import javafx.beans.property.IntegerProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleIntegerProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; /** * Entity class which contains the methods used for getting and setting Expense data. * * @author Alessandro Ciotola * @version 2018/05/19 * */ public class Expense { private IntegerProperty expenseID; private ObjectProperty<CustomDate> dateTime; private StringProperty supplier; private StringProperty mainDescription; private StringProperty subDescription; private ObjectProperty<BigDecimal> subtotal; private ObjectProperty<BigDecimal> gst; private ObjectProperty<BigDecimal> qst; private ObjectProperty<BigDecimal> total; public Expense(){ this(-1, new CustomDate(Date.valueOf(LocalDate.now()).getTime()), "", "", "", BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO); } public Expense(final int expenseID, final CustomDate dateTime, final String supplier, final String mainDescription, final String subDescription, final BigDecimal subtotal, final BigDecimal gst, final BigDecimal qst, final BigDecimal total) { super(); this.expenseID = new SimpleIntegerProperty(expenseID); this.dateTime = new SimpleObjectProperty(dateTime); this.supplier = new SimpleStringProperty(supplier); this.mainDescription = new SimpleStringProperty(mainDescription); this.subDescription = new SimpleStringProperty(subDescription); this.subtotal = new SimpleObjectProperty(subtotal); this.gst = new SimpleObjectProperty(gst); this.qst = new SimpleObjectProperty(qst); this.total = new SimpleObjectProperty(total); } public int getExpenseID(){ return expenseID.get(); } public IntegerProperty getExpenseIDProperty(){ return expenseID; } public void setExpenseID(final int expenseID){ this.expenseID.set(expenseID); } public CustomDate getDateTime(){ return dateTime.get(); } public ObjectProperty<CustomDate> getDateTimeProperty(){ return dateTime; } public void setDateTime(final CustomDate dateTime){ this.dateTime.set(dateTime); } public String getSupplier(){ return supplier.get(); } public StringProperty getSupplierProperty(){ return supplier; } public void setSupplier(final String supplier){ this.supplier.set(supplier); } public String getMainDescription(){ return mainDescription.get(); } public StringProperty getMainDescriptionProperty(){ return mainDescription; } public void setMainDescription(final String mainDescription){ this.mainDescription.set(mainDescription); } public String getSubDescription(){ return subDescription.get(); } public StringProperty getSubDescriptionProperty(){ return subDescription; } public void setSubDescription(final String subDescription){ this.subDescription.set(subDescription); } public BigDecimal getSubtotal(){ return subtotal.get(); } public ObjectProperty<BigDecimal> getSubtotalProperty(){ return subtotal; } public void setSubtotal(final BigDecimal subtotal){ this.subtotal.set(subtotal); } public BigDecimal getGst(){ return gst.get(); } public ObjectProperty<BigDecimal> getGstProperty(){ return gst; } public void setGst(final BigDecimal gst){ this.gst.set(gst); } public BigDecimal getQst(){ return qst.get(); } public ObjectProperty<BigDecimal> getQstProperty(){ return qst; } public void setQst(final BigDecimal qst){ this.qst.set(qst); } public BigDecimal getTotal(){ return total.get(); } public ObjectProperty<BigDecimal> getTotalProperty(){ return total; } public void setTotal(final BigDecimal total){ this.total.set(total); } @Override public int hashCode(){ int hash = 7; hash = 37 * hash + expenseID.get(); hash = 37 * hash + Objects.hashCode(this.dateTime); hash = 37 * hash + Objects.hashCode(this.supplier); hash = 37 * hash + Objects.hashCode(this.mainDescription); hash = 37 * hash + Objects.hashCode(this.subDescription); hash = 37 * hash + Objects.hashCode(this.subtotal); hash = 37 * hash + Objects.hashCode(this.gst); hash = 37 * hash + Objects.hashCode(this.qst); hash = 37 * hash + Objects.hashCode(this.total); return hash; } @Override public boolean equals(Object obj){ if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Expense other = (Expense) obj; if (expenseID.get() != other.expenseID.get()) { return false; } if (!dateTime.get().equals(other.dateTime.get())) { return false; } if (!supplier.get().equals(other.supplier.get())) { return false; } if (!mainDescription.get().equals(other.mainDescription.get())) { return false; } if (!subDescription.get().equals(other.subDescription.get())) { return false; } if (!subtotal.get().equals(other.subtotal.get())) { return false; } if (!gst.get().equals(other.gst.get())) { return false; } if (!qst.get().equals(other.qst.get())) { return false; } if (!total.get().equals(other.total.get())) { return false; } return true; } @Override public String toString(){ return expenseID.get() + " " + dateTime.get() + " " + supplier.get() + " " + mainDescription.get() + " " + subDescription.get() + " " + subtotal.get() + " " + gst.get() + " " + qst.get() + " " + total.get(); } }
[ "alessandromciotola@gmail.com" ]
alessandromciotola@gmail.com
5b531efbcdfcdbc8e45e5c224d04ca6f1a5803ae
0b3988f48505e71aa62703143afd53a3feb6e483
/base-domain/src/main/java/wmkang/domain/annotation/ServiceReadTransactional.java
609345c3e8ee7340785527457834b349857f9fdc
[]
no_license
sengeiou/wmkang
d2c1888a02389c59d23b2736e7da28142a1c83bd
2854c39f04441a9e0b6986f4d8317c623fb35136
refs/heads/main
2023-05-09T12:31:14.793173
2021-06-03T06:54:13
2021-06-03T06:54:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
798
java
package wmkang.domain.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import wmkang.domain.util.C; @Target({ ElementType.METHOD, ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) @Transactional( transactionManager = C.TX_MANAGER_SERVICE, readOnly = true, propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED, timeout = C.TX_TIMEOUT_SECONDS) public @interface ServiceReadTransactional { }
[ "wimin.kang@gmail.com" ]
wimin.kang@gmail.com
2ea02f554e1d4c8d031427da0a0d053c96f1d3cf
6286fa580287b45495a3ddc4903f3c7217c6cf34
/app/build/generated/not_namespaced_r_class_sources/debug/r/androidx/slidingpanelayout/R.java
378e3d556e7714d165bc66389df6c1ea4262ac5f
[]
no_license
VieiraMidas/AppEstrela
6f16c81f4b66a9732713cf5e206e3b3245bf6546
4e4d9a2e2d70bb06e0eba73d23c57979c1a2ebf7
refs/heads/master
2020-08-31T08:45:12.749093
2019-11-06T22:59:12
2019-11-06T22:59:12
206,446,846
0
0
null
null
null
null
UTF-8
Java
false
false
10,457
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.slidingpanelayout; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f020027; public static final int font = 0x7f02007a; public static final int fontProviderAuthority = 0x7f02007c; public static final int fontProviderCerts = 0x7f02007d; public static final int fontProviderFetchStrategy = 0x7f02007e; public static final int fontProviderFetchTimeout = 0x7f02007f; public static final int fontProviderPackage = 0x7f020080; public static final int fontProviderQuery = 0x7f020081; public static final int fontStyle = 0x7f020082; public static final int fontVariationSettings = 0x7f020083; public static final int fontWeight = 0x7f020084; public static final int ttcIndex = 0x7f02013c; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f040042; public static final int notification_icon_bg_color = 0x7f040043; public static final int ripple_material_light = 0x7f04004d; public static final int secondary_text_default_material_light = 0x7f04004f; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f05004b; public static final int compat_button_inset_vertical_material = 0x7f05004c; public static final int compat_button_padding_horizontal_material = 0x7f05004d; public static final int compat_button_padding_vertical_material = 0x7f05004e; public static final int compat_control_corner_material = 0x7f05004f; public static final int compat_notification_large_icon_max_height = 0x7f050050; public static final int compat_notification_large_icon_max_width = 0x7f050051; public static final int notification_action_icon_size = 0x7f05005b; public static final int notification_action_text_size = 0x7f05005c; public static final int notification_big_circle_margin = 0x7f05005d; public static final int notification_content_margin_start = 0x7f05005e; public static final int notification_large_icon_height = 0x7f05005f; public static final int notification_large_icon_width = 0x7f050060; public static final int notification_main_column_padding_top = 0x7f050061; public static final int notification_media_narrow_margin = 0x7f050062; public static final int notification_right_icon_size = 0x7f050063; public static final int notification_right_side_padding_top = 0x7f050064; public static final int notification_small_icon_background_padding = 0x7f050065; public static final int notification_small_icon_size_as_large = 0x7f050066; public static final int notification_subtext_size = 0x7f050067; public static final int notification_top_pad = 0x7f050068; public static final int notification_top_pad_large_text = 0x7f050069; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f06005d; public static final int notification_bg = 0x7f06005e; public static final int notification_bg_low = 0x7f06005f; public static final int notification_bg_low_normal = 0x7f060060; public static final int notification_bg_low_pressed = 0x7f060061; public static final int notification_bg_normal = 0x7f060062; public static final int notification_bg_normal_pressed = 0x7f060063; public static final int notification_icon_background = 0x7f060064; public static final int notification_template_icon_bg = 0x7f060065; public static final int notification_template_icon_low_bg = 0x7f060066; public static final int notification_tile_bg = 0x7f060067; public static final int notify_panel_notification_icon_bg = 0x7f060068; } public static final class id { private id() {} public static final int action_container = 0x7f07000d; public static final int action_divider = 0x7f07000f; public static final int action_image = 0x7f070010; public static final int action_text = 0x7f070016; public static final int actions = 0x7f070017; public static final int async = 0x7f07001d; public static final int blocking = 0x7f070020; public static final int chronometer = 0x7f070029; public static final int forever = 0x7f07003d; public static final int icon = 0x7f070043; public static final int icon_group = 0x7f070044; public static final int info = 0x7f070048; public static final int italic = 0x7f07004a; public static final int line1 = 0x7f07004c; public static final int line3 = 0x7f07004d; public static final int normal = 0x7f070055; public static final int notification_background = 0x7f070056; public static final int notification_main_column = 0x7f070057; public static final int notification_main_column_container = 0x7f070058; public static final int right_icon = 0x7f070061; public static final int right_side = 0x7f070062; public static final int tag_transition_group = 0x7f070082; public static final int tag_unhandled_key_event_manager = 0x7f070083; public static final int tag_unhandled_key_listeners = 0x7f070084; public static final int text = 0x7f070085; public static final int text2 = 0x7f070086; public static final int time = 0x7f070089; public static final int title = 0x7f07008a; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f080004; } public static final class layout { private layout() {} public static final int notification_action = 0x7f09001d; public static final int notification_action_tombstone = 0x7f09001e; public static final int notification_template_custom_big = 0x7f09001f; public static final int notification_template_icon_group = 0x7f090020; public static final int notification_template_part_chronometer = 0x7f090021; public static final int notification_template_part_time = 0x7f090022; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0b0029; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0c00ee; public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00ef; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00f0; public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00f1; public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00f2; public static final int Widget_Compat_NotificationActionContainer = 0x7f0c015a; public static final int Widget_Compat_NotificationActionText = 0x7f0c015b; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f020027 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f, 0x7f020080, 0x7f020081 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f02007a, 0x7f020082, 0x7f020083, 0x7f020084, 0x7f02013c }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
[ "guilherme.brasil3@etec.sp.gov.br" ]
guilherme.brasil3@etec.sp.gov.br
60c291a70e146aae865fa9f164fca02aa6b5f6b7
175a7cdc745fc6637813f885a4e3161e881fa044
/app/src/main/java/kz/voxpopuli/voxapplication/network/wrappers/pnews/Pnews.java
dfcdd1017aa75a7ddffab9868c9418b69a157aca
[]
no_license
alexHimik/VOXPopuli
118d674152135291b60b755bed867ad3c88cd7b0
d0aaa3dc5579346d86e7a4ee5d8e84280ec75c81
refs/heads/master
2021-01-19T10:34:47.473686
2015-05-26T16:23:42
2015-05-26T16:23:42
33,476,453
1
0
null
null
null
null
UTF-8
Java
false
false
2,441
java
package kz.voxpopuli.voxapplication.network.wrappers.pnews; import java.util.ArrayList; import java.util.List; import com.google.gson.annotations.Expose; import kz.voxpopuli.voxapplication.network.wrappers.mpage.Article; public class Pnews { @Expose private Article article; @Expose private List<Content> content = new ArrayList<Content>(); @Expose private List<NewsTag> tags = new ArrayList<NewsTag>(); @Expose private Author author; @Expose private List<Article> similar = new ArrayList<Article>(); /** * * @return * The article */ public Article getArticle() { return article; } /** * * @param article * The article */ public void setArticle(Article article) { this.article = article; } public Pnews withArticle(Article article) { this.article = article; return this; } /** * * @return * The content */ public List<Content> getContent() { return content; } /** * * @param content * The content */ public void setContent(List<Content> content) { this.content = content; } public Pnews withContent(List<Content> content) { this.content = content; return this; } /** * * @return * The tags */ public List<NewsTag> getTags() { return tags; } /** * * @param tags * The tags */ public void setTags(List<NewsTag> tags) { this.tags = tags; } public Pnews withTags(List<NewsTag> tags) { this.tags = tags; return this; } /** * * @return * The author */ public Author getAuthor() { return author; } /** * * @param author * The author */ public void setAuthor(Author author) { this.author = author; } public Pnews withAuthor(Author author) { this.author = author; return this; } /** * * @return * The similar */ public List<Article> getSimilar() { return similar; } /** * * @param similar * The similar */ public void setSimilar(List<Article> similar) { this.similar = similar; } public Pnews withSimilar(List<Article> similar) { this.similar = similar; return this; } }
[ "jura@pisem.net" ]
jura@pisem.net
6a83b4a81607d169d0b1c2ef1a9ef586ea8834a9
16ba2879cbd78844ece085c26377718a2e7961b6
/SCAAutomation/src/main/java/mailSender/MailNotification.java
172bc3433245ce2a23d3c879f57af07cf68700fa
[]
no_license
infodeepak21/SCAAutomation
81dd25089e4cabda0784f0af829ece76c314654c
68e1d0f0c8d221e381de5f492e26bf0b4db9380a
refs/heads/main
2023-06-04T12:53:27.937777
2021-06-20T11:30:27
2021-06-20T11:30:27
378,616,411
0
0
null
null
null
null
UTF-8
Java
false
false
3,967
java
package mailSender; /* * MailNotification class has been written in order to send the report after getting the extent reports * * @author Abhishek Shandilya */ import java.util.Properties; import javax.activation.DataHandler; import javax.activation.DataSource; import javax.activation.FileDataSource; import javax.mail.BodyPart; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Multipart; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeBodyPart; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeMultipart; import commonUtilities.PropertyManager; public class MailNotification { public static Properties props; public static Session session; public static Message message; public static BodyPart messageBodyPart; public static Multipart multipart; public static DataSource source; public final static String mailUsrername = PropertyManager.prop.getProperty("mailUsername"); public final static String mailPassword = PropertyManager.prop.getProperty("mailPassword"); public final static String host = PropertyManager.prop.getProperty("smtpHost"); public final static String port = PropertyManager.prop.getProperty("smtpPort"); public static String to = PropertyManager.prop.getProperty("mailTo"); public static String from = PropertyManager.prop.getProperty("mailFrom"); public static String cc = PropertyManager.prop.getProperty("mailCc"); public static String bcc = PropertyManager.prop.getProperty("mailBcc"); public static String subject = PropertyManager.prop.getProperty("subject"); public static String body = PropertyManager.prop.getProperty("body"); private static String reportFileName = "Test-Automaton-Report" + ".html"; private static String fileSeperator = System.getProperty("file.separator"); private static String reportFilepath = System.getProperty("user.dir") + fileSeperator + "ExecutionReport"; private static String executionReportFileLocation = reportFilepath + fileSeperator + reportFileName; /* * The use of this method is to get the session object by authenticating the * credentials then creating a mime message object then set up the address in * form of recipient as to, cc, bcc and having a subject of the message. * BodyPart class to be used to set the body of the message DataSource class is * used to send the attachment after the execution in form of extent report */ public static void sendMailWithAttachment() { props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", host); props.put("mail.smtp.port", port); session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(mailUsrername, mailPassword); } }); try { message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to)); message.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc)); message.setRecipients(Message.RecipientType.BCC, InternetAddress.parse(bcc)); message.setSubject(subject); messageBodyPart = new MimeBodyPart(); messageBodyPart.setText(body); multipart = new MimeMultipart(); multipart.addBodyPart(messageBodyPart); messageBodyPart = new MimeBodyPart(); source = new FileDataSource(executionReportFileLocation); messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(executionReportFileLocation); multipart.addBodyPart(messageBodyPart); message.setContent(multipart); Transport.send(message); System.out.println("Sent message successfully...."); } catch (MessagingException e) { throw new RuntimeException(e); } } }
[ "57134908+infodeepak21@users.noreply.github.com" ]
57134908+infodeepak21@users.noreply.github.com
c0fd1a5542f24b6165b8a5c76548d38ad9017bcf
7954a1dd67ecb69608d5b03252beaaa300ca121e
/Java/DynamicProgramming/src/Napsack.java
9943393dc7da642d960902fd0fc770d65c9e6a3d
[]
no_license
Alex-Alexiev/ICS4U
2c0e8a300b7f386de97e54cf535d6a88c125aa2f
f78b48d8fcc66bc74765b622e895d19eeba2beef
refs/heads/master
2022-12-12T20:54:47.625640
2019-06-01T21:37:50
2019-06-01T21:37:50
147,691,595
0
0
null
null
null
null
UTF-8
Java
false
false
947
java
public class Napsack { public static void main(String[] args) { int[][] objects = { {2,3}, {3,4}, {4,5}, {5,6} }; System.out.println(maxBenefit(objects, 5)); } public static int maxBenefit(int[][] objects, int maxWeight) { int[][] solutions = new int[objects.length+1][maxWeight+1]; for (int i = 1; i < solutions.length; i++) { for (int weight = 1; weight < solutions[0].length; weight++) { int newItemWeight = objects[i-1][0]; int newItemBenefit = objects[i-1][1]; if (newItemWeight <= weight) { int benefitWithNewItem = newItemBenefit+solutions[i-1][weight-newItemWeight]; if (benefitWithNewItem > solutions[i-1][weight]) { solutions[i][weight] = benefitWithNewItem; }else { solutions[i][weight] = solutions[i-1][weight]; } } else { solutions[i][weight] = solutions[i-1][weight]; } } } return solutions[solutions.length-1][maxWeight]; } }
[ "aalexiev@bayviewglen.ca" ]
aalexiev@bayviewglen.ca
20e89d0388a960f9a87ca645b095296ec6bce697
49c282985c34a872b4474d0d64ebc392e1887d74
/src/main/java/com/common/utils/LogUtil.java
f69e9fd7aff41e3701d5b26196089b378fe01e91
[]
no_license
llnforest/JAVA_springMvc
e153e6ddb3c6ecaa2aa9ec235e44f829078bdf6e
ad5d39f55c362e8c4b6c693f22c0bcfe251ae208
refs/heads/master
2022-12-22T07:01:09.720219
2020-07-15T09:37:22
2020-07-15T09:37:22
189,535,331
0
0
null
2022-12-16T07:46:04
2019-05-31T05:51:07
Java
UTF-8
Java
false
false
11,881
java
package com.common.utils; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import javax.persistence.Id; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; import com.common.spring.BeanHelper; import com.model.BaseModel; import com.model.SessionUser; import com.service.BaseService; import com.service.system.LogService; import com.service.system.TableService; /** * 日志工具类 * @author Lynn * 2019年2月15日 */ public class LogUtil { private static LogService logService = (LogService)BeanHelper.getBean("logManager"); /** * 添加日志 * 2019年2月15日 * @param request * @param menuId * @author:Lynn */ public static void addLog(HttpServletRequest request,String menuId){ if(StringUtils.isNotEmpty(menuId)){ String url = StringUtil.convertUrl(request.getRequestURI(), request.getQueryString()); HttpSession session = request.getSession(); SessionUser sessionUser = (SessionUser) session.getAttribute(Const.SESSION_USER); //获取客户端信息 Map<String, String> clientMap = ClientInfo.getClientInfo(request); String httpData = RequestUtil.getParamer(request); //添加日志默认成功 String logId = logService.addLog(url, clientMap, menuId, sessionUser.getUserId(),sessionUser.getUserName(), AppConfig.getAppName(),"1","",httpData); if(StringUtils.isNotEmpty(logId)) session.setAttribute(Const.SESSION_LOG_ID, logId); } } /** * 重置日志操作结果 * 2019年2月15日 * @param request * @author:Lynn */ public static void setFailLog(HttpServletRequest request){ String logId = (String) request.getSession().getAttribute(Const.SESSION_LOG_ID); if(StringUtils.isNotEmpty(logId)) logService.setFailLog(logId); } /** * 设置日志备注 * 2019年2月15日 * @param request * @param remark * @author:Lynn */ public static void setRemarkLog(HttpServletRequest request,String remark){ String logId = (String) request.getSession().getAttribute(Const.SESSION_LOG_ID); if(StringUtils.isNotEmpty(logId)) logService.setRemarkLog(logId,remark); } /** * 添加安全日志 * 2019年2月15日 * @param request * @param operateName * @param operateType * @param remark * @param operateResult * @author:Lynn */ public static void addSafeLog(HttpServletRequest request,String operateName,String operateType,String remark,String operateResult){ String url = StringUtil.convertUrl(request.getRequestURI(), request.getQueryString()); HttpSession session = request.getSession(); //获取客户端信息 Map<String, String> clientMap = ClientInfo.getClientInfo(request); SessionUser sessionUser = (SessionUser) session.getAttribute(Const.SESSION_USER); String userId = sessionUser == null ? null : sessionUser.getUserId(); String userName = sessionUser == null ? null : sessionUser.getUserName(); String logLevel = "4"; String httpData = RequestUtil.getParamer(request); String logId = logService.addSafeLog(operateName, operateType, operateResult, AppConfig.getAppName(), url, remark, logLevel,userId,userName, clientMap,httpData); if(StringUtils.isNotEmpty(logId)) session.setAttribute(Const.SESSION_LOG_ID, logId); } /** * 添加安全日志(简略版) * 2019年2月22日 * @param request * @param operateName * @param operateType * @author:Lynn */ public static void addSafeLog(HttpServletRequest request,String operateName,String operateType){ addSafeLog(request, operateName, operateType,"",Const.LOG_SUCCESS); } /** * 添加登录失败安全日志 * 2019年2月22日 * @param request * @param remark * @param userId * @param userName * @author:Lynn */ public static void addLoginFailLog(HttpServletRequest request,String remark,String userId,String userName){ String url = StringUtil.convertUrl(request.getRequestURI(), request.getQueryString()); //获取客户端信息 Map<String, String> clientMap = ClientInfo.getClientInfo(request); String logLevel = "4"; String httpData = RequestUtil.getParamer(request); logService.addSafeLog("后台登录", Const.LOG_LOGIN_TYPE, Const.LOG_FAIL, AppConfig.getAppName(), url, remark, logLevel,userId,userName, clientMap,httpData); } /** * 修改接口备注 * 2019年6月26日 * @param request * @param newModel * @author:Lynn */ public static void remarkUpdateLog(HttpServletRequest request,BaseModel newModel){ String logId = (String) request.getSession().getAttribute(Const.SESSION_LOG_ID); if(StringUtils.isEmpty(logId)) return; BaseModel model = getOldModel(newModel); Class<? extends BaseModel> clazz = newModel.getClass(); //从日志JSON数据中取出json字符串 转map // Map<String, Map<String, String>> map = (Map<String, Map<String, String>>) JSONObject.fromObject(JsonLog.get(clazz.getName())); //从table信息表中获取对应关系 TableService tableService = BeanHelper.getBean("tableManager"); Map<String, Map<String, String>> map = tableService.getFieldRemark(clazz.getName()); if(map.isEmpty()) return; Map<String,String> head = new HashMap<String, String>(); Map<String,String> body = new HashMap<String, String>(); //判断头部和内容key是否存在 if(map.containsKey("head")) head = map.get("head"); if(map.containsKey("body")) body = map.get("body"); String new_str,old_str,field_name,para; StringBuffer remarkBuffer = new StringBuffer(); StringBuffer headBuffer = new StringBuffer(); // 通过反射获取字段信息 Field[] fields = clazz.getDeclaredFields(); for(Field field:fields){ field_name = field.getName(); try { //头部固定内容 取新值 if(head.containsKey(field_name)){ field.setAccessible(true); new_str = String.valueOf(field.get(newModel)); para = head.get(field_name); new_str = map.get("dict").containsKey(field_name)?DictUtil.getDictName(map.get("dict").get(field_name), new_str):new_str; headBuffer.append(para+"【"+new_str+"】,"); field.setAccessible(false); } //比较内容 if(body.containsKey(field_name)){ field.setAccessible(true); new_str = String.valueOf(field.get(newModel)); new_str = map.get("dict").containsKey(field_name)?DictUtil.getDictName(map.get("dict").get(field_name), new_str):new_str; old_str = String.valueOf(field.get(model)); old_str = map.get("dict").containsKey(field_name)?DictUtil.getDictName(map.get("dict").get(field_name), old_str):old_str; new_str = !new_str.equals("null") ?new_str:""; old_str = !old_str.equals("null") ?old_str:""; if(!new_str.equals(old_str)){ para = body.get(field_name); remarkBuffer.append(para+"【"+old_str+"】改为【"+new_str+"】,"); } field.setAccessible(false); } } catch (Exception e) { e.printStackTrace(); } } String remark = headBuffer.toString() + (remarkBuffer.length() > 0 ? remarkBuffer.substring(0, remarkBuffer.length()-1).toString():""); setRemarkLog(request, remark); } /** * 添加接口备注 * 2019年6月26日 * @param request * @param newModel * @author:Lynn */ public static void remarkAddLog(HttpServletRequest request,BaseModel newModel){ String logId = (String) request.getSession().getAttribute(Const.SESSION_LOG_ID); if(StringUtils.isEmpty(logId)) return; Class<? extends BaseModel> clazz = newModel.getClass(); //从日志JSON数据中取出json字符串 转map // Map<String, Map<String, String>> map = (Map<String, Map<String, String>>) JSONObject.fromObject(JsonLog.get(clazz.getName())); //从table信息表中获取对应关系 TableService tableService = BeanHelper.getBean("tableManager"); Map<String, Map<String, String>> map = tableService.getFieldRemark(clazz.getName()); if(map.isEmpty()) return; Map<String,String> body = new HashMap<String, String>(); //判断内容key是否存在 if(map.containsKey("body")){ //比较字段信息 body = map.get("body"); } String new_str,field_name,para; StringBuffer remarkBuffer = new StringBuffer(); // 通过反射获取字段信息 Field[] fields = clazz.getDeclaredFields(); for(Field field:fields){ field_name = field.getName(); try { //比较内容 if(body.containsKey(field_name)){ field.setAccessible(true); new_str = String.valueOf(field.get(newModel)); if(StringUtils.isNotEmpty(new_str) && !new_str.equals("null")){ new_str = map.get("dict").containsKey(field_name)?DictUtil.getDictName(map.get("dict").get(field_name), new_str):new_str; para = body.get(field_name); remarkBuffer.append(para+"【"+new_str+"】,"); } field.setAccessible(false); } } catch (Exception e) { e.printStackTrace(); } } String remark = (remarkBuffer.length() > 0 ? remarkBuffer.substring(0, remarkBuffer.length()-1).toString():""); setRemarkLog(request, remark); } /** * 删除接口备注 * 2019年6月26日 * @param request * @param newModel * @author:Lynn */ public static void remarkDelLog(HttpServletRequest request,Class <? extends BaseModel> clazz,Object id){ String logId = (String) request.getSession().getAttribute(Const.SESSION_LOG_ID); if(StringUtils.isEmpty(logId)) return; BaseModel model; BaseService baseService = BeanHelper.getBean("service"); if(id instanceof Integer){ model = baseService.loadModel(clazz,(Integer) id); }else{ model = baseService.loadModel(clazz, (String) id); } //从日志JSON数据中取出json字符串 转map // Map<String, Map<String, String>> map = (Map<String, Map<String, String>>) JSONObject.fromObject(JsonLog.get(clazz.getName())); //从table信息表中获取对应关系 TableService tableService = BeanHelper.getBean("tableManager"); Map<String, Map<String, String>> map = tableService.getFieldRemark(clazz.getName()); if(map.isEmpty()) return; Map<String,String> body = new HashMap<String, String>(); if(map.containsKey("body")){ //比较字段信息 body = map.get("body"); } String old_str,field_name,para; StringBuffer remarkBuffer = new StringBuffer(); // 通过反射获取字段信息 Field[] fields = clazz.getDeclaredFields(); for(Field field:fields){ field_name = field.getName(); try { //比较内容 if(body.containsKey(field_name)){ field.setAccessible(true); old_str = String.valueOf(field.get(model)); if(StringUtils.isNotEmpty(old_str) && !old_str.equals("null")){ para = body.get(field_name); old_str = map.get("dict").containsKey(field_name)?DictUtil.getDictName(map.get("dict").get(field_name), old_str):old_str; remarkBuffer.append(para+"【"+old_str+"】,"); } field.setAccessible(false); } } catch (Exception e) { e.printStackTrace(); } } String remark = (remarkBuffer.length() > 0 ? remarkBuffer.substring(0, remarkBuffer.length()-1).toString():""); setRemarkLog(request, remark); } /** * 获得操作之前的对象 * 2019年6月26日 * @param baseModel * @return * @author:Lynn */ private static BaseModel getOldModel(BaseModel baseModel){ BaseModel model = null; Class <? extends BaseModel> clazz = baseModel.getClass(); Method[] methods = clazz.getDeclaredMethods(); for(Method method:methods){ if(method.isAnnotationPresent(Id.class)){ try { BaseService baseService = BeanHelper.getBean("service"); if(method.getReturnType() == Integer.class){ model = baseService.loadModel(clazz,(Integer)method.invoke(baseModel)); }else{ model = baseService.loadModel(clazz, (String) method.invoke(baseModel)); } break; } catch (Exception e) { e.printStackTrace(); } } } return model; } }
[ "bbxycx.18@163.com" ]
bbxycx.18@163.com
bf4f3dca2ff903447e118e208346d8d7172a6f89
445ae3cdc3b7c3d8ee6c1a1a4eaa34f8d5b12ba9
/app/build/generated/ap_generated_sources/debug/out/androidx/databinding/DataBinderMapperImpl.java
5e6f3274b1100a4adc31a5bb9df5090ef775c1c5
[]
no_license
ornush/Milestone3
f8717d3528da21546d0af73067d74651190fb5ea
ebf93d30c102525bdcdd18008c5e74c442faa4aa
refs/heads/master
2023-06-06T05:33:55.739740
2021-06-27T20:36:27
2021-06-27T20:36:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
212
java
package androidx.databinding; public class DataBinderMapperImpl extends MergedDataBinderMapper { DataBinderMapperImpl() { addMapper(new com.joystickandroidapp.remotejoystick.DataBinderMapperImpl()); } }
[ "noreply@github.com" ]
ornush.noreply@github.com
8516bc17d737a392d82ad2c1cd986e3506236a68
ae9287ab937a805558c5fb2fa7ea704d3bfdc5f7
/jdbcConnection/src/main/java/database/insert/jdbcConnection/SelectQuery.java
e8bc5969720e82c5a098406d9413ae2501b2d80c
[]
no_license
ajitaz/TenantMgmt
717c7fbc8fb3833522d559a0c7972794ae2ffef0
e417a527243fca6b1db8a53ae76ed93a8f050426
refs/heads/master
2022-12-20T22:52:01.609503
2020-09-20T16:41:26
2020-09-20T16:41:26
274,895,443
0
0
null
null
null
null
UTF-8
Java
false
false
1,273
java
package database.insert.jdbcConnection; import java.sql.*; public class SelectQuery { public static void main(String[] args) { Connection con = null; Statement st= null; try { Class.forName("com.mysql.jdbc.Driver"); con=DriverManager.getConnection("jdbc:mysql://localhost:3306/sagarmatha_jdbc","root",""); st = con.createStatement(); String sql = "SELECT * FROM student"; //"SELECT *FROM student WHERE address='ktm'" //"SELECT *FROM student WHERE address='"+location+"'"; //"SELECT *FROM student WHERE address LIKE'pal%'"; //"SELECT *FROM student WHERE address LIKE'%ara'"; //"SELECT *FROM student WHERE address LIKE'%a%'"; //"SELECT *FROM student WHERE address LIKE'_a%'"; //"SELECT *FROM student WHERE address LIKE'___a%'"; ResultSet rs =st.executeQuery(sql); System.out.println("Data"); while(rs.next()) { System.out.print(rs.getInt("id")+"\t"); System.out.print(rs.getString("name")+"\t"); System.out.print(rs.getString("faculty")+"\t"); System.out.println(rs.getString("address")+"\t"); } }catch(ClassNotFoundException e) { System.out.println("Sorry cannot find driver class"); }catch(SQLException e) { System.out.println("Sorry cannot close connection with database"); } } }
[ "azalbert.ab@gmail.com" ]
azalbert.ab@gmail.com
0b30d1ed6cd002ed311bc4f870702cf1fb178c8e
c98b0d55a8724f90df5c8a037624dcd3e6dcdb09
/src/module-info.java
f9b84f9b08b0cd391c7af4c13638199bb1bce10b
[]
no_license
saiprash220/Group2
3126de3beaa24ae758259165551f0eca294461ef
30abfa784d1da7c9f91e89c6ec92e49fb4d34845
refs/heads/master
2023-03-31T16:45:33.962616
2021-04-06T07:31:37
2021-04-06T07:31:37
355,065,180
0
0
null
null
null
null
UTF-8
Java
false
false
22
java
module TestGroup2 { }
[ "Prashant@DESKTOP-OGA94U8" ]
Prashant@DESKTOP-OGA94U8
1c1bbd2b21aff5506178184625209765815fbc0e
f087ae9fd5ccf01415499c59b9b8a4b0c5c533f9
/springboot/src/main/java/br/com/fiap/library/dto/BookDTO.java
2498686c3b9128e079e477d1d22772642e576b26
[]
no_license
ronaldoleitte1975/fiap-library-34scj
9a2108de327a764807fc6c66527786ce41ba8eb9
c7fc0585546ff2df663f970a630fb1a3a492b6a7
refs/heads/master
2020-12-23T08:14:33.492658
2020-02-13T01:47:18
2020-02-13T01:47:18
237,094,669
0
0
null
2020-01-29T22:25:54
2020-01-29T22:25:53
null
UTF-8
Java
false
false
2,906
java
package br.com.fiap.library.dto; import br.com.fiap.library.entity.Book; import java.time.ZonedDateTime; import java.util.Date; public class BookDTO { private Integer id; private String titulo; private Integer quantidadeDePaginas; private String ISBN; private ZonedDateTime dataLancamento; private AutorDTO autor; private Date dataCriacao; private Date dataAtualizacao; public BookDTO(){} public BookDTO(Integer id, String titulo, Integer quantidadeDePaginas, String ISBN, ZonedDateTime dataLancamento, AutorDTO autor) { this.id = id; this.titulo = titulo; this.quantidadeDePaginas = quantidadeDePaginas; this.ISBN = ISBN; this.dataLancamento = dataLancamento; this.autor = autor; } public BookDTO(CreateBookDTO createBookDTO, Integer id) { this.id = id; this.titulo = createBookDTO.getTitulo(); this.quantidadeDePaginas = createBookDTO.getQuantidadeDePaginas(); this.ISBN = createBookDTO.getISBN(); this.dataLancamento = createBookDTO.getDataLancamento(); } public BookDTO(Book book) { this.id = book.getId(); this.titulo = book.getTitulo(); this.quantidadeDePaginas = book.getQuantidadeDePaginas(); this.ISBN = book.getISBN(); this.dataLancamento = book.getDataLancamento(); if(book.getAutor() != null){ this.autor = new AutorDTO(book.getAutor()); } this.dataCriacao = book.getDataCriacao(); this.dataAtualizacao = book.getDataAtualizacao(); } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitulo() { return titulo; } public void setTitulo(String titulo) { this.titulo = titulo; } public Integer getQuantidadeDePaginas() { return quantidadeDePaginas; } public void setQuantidadeDePaginas(Integer quantidadeDePaginas) { this.quantidadeDePaginas = quantidadeDePaginas; } public String getISBN() { return ISBN; } public void setISBN(String ISBN) { this.ISBN = ISBN; } public ZonedDateTime getDataLancamento() { return dataLancamento; } public void setDataLancamento(ZonedDateTime dataLancamento) { this.dataLancamento = dataLancamento; } public AutorDTO getAutor() { return autor; } public void setAutor(AutorDTO autor) { this.autor = autor; } public Date getDataCriacao() { return dataCriacao; } public void setDataCriacao(Date dataCriacao) { this.dataCriacao = dataCriacao; } public Date getDataAtualizacao() { return dataAtualizacao; } public void setDataAtualizacao(Date dataAtualizacao) { this.dataAtualizacao = dataAtualizacao; } }
[ "miyasato.fabio@gmail.com" ]
miyasato.fabio@gmail.com
4aed873b906d05f18816af517e8045b2414ba36a
efdc92837e237fc1f6e8eeebc9bf192b18b301ac
/code/src/main/java/com/yanl/leetcode/L0222CountCompleteTreeNodes.java
0e75632c2cf23ff44830e0e3981abd22ae6e2570
[]
no_license
YanLdt/nowcoder
5184cb992613a04c45f77064a300db0fea6d6a05
e06567042a221a943ea89aded014a774f8fb4366
refs/heads/master
2023-01-23T21:15:30.438367
2020-11-25T08:28:35
2020-11-25T08:28:35
284,005,454
0
0
null
null
null
null
UTF-8
Java
false
false
938
java
package com.yanl.leetcode; import com.yanl.leetcodeutil.TreeNode; /** * @author YanL * @date 20:41 2020/11/24 * L0222 给出一个完全二叉树,求出该树的节点个数。 * 完全二叉树的定义如下:在完全二叉树中,除了最底层节点可能没填满外,其余每层节点数都达到最大值, * 并且最下面一层的节点都集中在该层最左边的若干位置。若最底层为第 h 层,则该层包含 1~ 2h 个节点。 * 递归可以求解 对于任意一颗二叉树都可以这么做 * 或者利用完全二叉树的性质 要么左子树和右子树等高 要么两者差1 * 可以求二叉树的高度 然后再单独遍历左子树或者右子树 * */ public class L0222CountCompleteTreeNodes { public int countNodes(TreeNode root){ if(root == null){ return 0; } return countNodes(root.left) + countNodes(root.right) + 1; } }
[ "imyanl.dt@gmail.com" ]
imyanl.dt@gmail.com
56db5f5abb91febec4b3bb729599b59babbcf089
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_9bac6f88f37de29c89500da1a2cfeea387cb19bc/CustomRollingPanel/2_9bac6f88f37de29c89500da1a2cfeea387cb19bc_CustomRollingPanel_s.java
63c3d3261af12493caa18e4728c9847c9612921c
[]
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
15,115
java
/* * Copyright 2011 cruxframework.org. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package org.cruxframework.crux.widgets.client.rollingpanel; import org.cruxframework.crux.core.client.screen.Screen; import org.cruxframework.crux.core.client.utils.StyleUtils; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.RepeatingCommand; import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.TableCellElement; import com.google.gwt.event.dom.client.MouseDownEvent; import com.google.gwt.event.dom.client.MouseDownHandler; import com.google.gwt.event.dom.client.MouseUpEvent; import com.google.gwt.event.dom.client.MouseUpHandler; import com.google.gwt.event.logical.shared.AttachEvent; import com.google.gwt.event.logical.shared.AttachEvent.Handler; import com.google.gwt.event.logical.shared.ResizeEvent; import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.CellPanel; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.DockPanel; import com.google.gwt.user.client.ui.HasHorizontalAlignment; import com.google.gwt.user.client.ui.HasVerticalAlignment; import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.InsertPanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; /** * @author Thiago da Rosa de Bustamante - * */ //TODO refatorar esta classe. Fazer sem tables public class CustomRollingPanel extends Composite implements InsertPanel, HasHorizontalAlignment, HasVerticalAlignment { public static final String DEFAULT_NEXT_STYLE_NAME = "crux-RollingPanelNext"; public static final String DEFAULT_PREVIOUS_STYLE_NAME = "crux-RollingPanelPrevious"; public static final String DEFAULT_BODY_HORIZONTAL_STYLE_NAME = "crux-RollingPanelBody"; public static final String DEFAULT_STYLE_NAME = "crux-RollingPanel"; private String nextButtonStyleName; private String previousButtonStyleName; private String bodyStyleName; protected CellPanel itemsPanel; protected DockPanel layoutPanel; private Button nextButton = null; private Button previousButton = null; private SimplePanel itemsScrollPanel; private boolean scrollToAddedWidgets = false; private HorizontalAlignmentConstant horizontalAlign; private VerticalAlignmentConstant verticalAlign; /** * @param vertical */ public CustomRollingPanel() { this.layoutPanel = new DockPanel(); this.itemsScrollPanel = new SimplePanel(); DOM.setStyleAttribute(this.itemsScrollPanel.getElement(), "overflowX", "hidden"); DOM.setStyleAttribute(this.itemsScrollPanel.getElement(), "overflowY", "hidden"); this.layoutPanel.setWidth("100%"); this.itemsScrollPanel.setWidth("100%"); this.itemsScrollPanel.setStyleName(DEFAULT_BODY_HORIZONTAL_STYLE_NAME); this.itemsPanel = new HorizontalPanel(); createNavigationButtons(); this.itemsScrollPanel.add(this.itemsPanel); this.layoutPanel.add(this.itemsScrollPanel, DockPanel.CENTER); this.layoutPanel.getElement().getStyle().setProperty("tableLayout", "fixed"); initWidget(layoutPanel); setSpacing(0); setStyleName(DEFAULT_STYLE_NAME); handleWindowResize(); maybeShowNavigationButtons(); } /** * @param child */ public void add(final Widget child) { this.itemsPanel.add(child); maybeShowNavigationButtons(); if (scrollToAddedWidgets) { Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { scrollToWidget(child); } }); } } /** * */ public void clear() { this.itemsPanel.clear(); maybeShowNavigationButtons(); } /** * @return */ public int getScrollPosition() { return itemsScrollPanel.getElement().getScrollLeft(); } /** * @return */ public int getSpacing() { return itemsPanel.getSpacing(); } /** * @param i * @return */ public Widget getWidget(int i) { return itemsPanel.getWidget(i); } /** * @return */ public int getWidgetCount() { return itemsPanel.getWidgetCount(); } /** * @see com.google.gwt.user.client.ui.IndexedPanel#getWidgetIndex(com.google.gwt.user.client.ui.Widget) */ public int getWidgetIndex(Widget child) { return ((InsertPanel)itemsPanel).getWidgetIndex(child); } /** * @param widget * @param i */ public void insert(final Widget widget, int i) { ((InsertPanel)itemsPanel).insert(widget, i); maybeShowNavigationButtons(); if (scrollToAddedWidgets) { Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { scrollToWidget(widget); } }); } } /** * @return */ public boolean isScrollToAddedWidgets() { return scrollToAddedWidgets; } /** * @see com.google.gwt.user.client.ui.IndexedPanel#remove(int) */ public boolean remove(int index) { boolean ret = ((InsertPanel)itemsPanel).remove(index); maybeShowNavigationButtons(); return ret; } /** * @param toRemove */ public void remove(Widget toRemove) { itemsPanel.remove(toRemove); maybeShowNavigationButtons(); } /** * @param widget */ public void scrollToWidget(Widget widget) { if (widget != null) { Element scroll = itemsScrollPanel.getElement(); Element item = widget.getElement(); if (itemsPanel.getOffsetWidth() > layoutPanel.getOffsetWidth()) { int realOffset = 0; int itemOffsetWidth = item.getOffsetWidth(); while (item != null && item != scroll) { realOffset += item.getOffsetLeft(); item = item.getParentElement(); } int scrollLeft = getScrollPosition(); int scrollOffsetWidth = scroll.getOffsetWidth(); int right = realOffset + itemOffsetWidth; int visibleWidth = scrollLeft + scrollOffsetWidth; if (realOffset < scrollLeft) { setScrollPosition(realOffset); } else if (right > visibleWidth) { setScrollPosition(scrollLeft + right - visibleWidth); } } } } /** * @param child * @param cellHeight */ public void setCellHeight(Widget child, String cellHeight) { this.itemsPanel.setCellHeight(child, cellHeight); } /** * @param w * @param align */ public void setCellHorizontalAlignment(Widget w, HorizontalAlignmentConstant align) { this.itemsPanel.setCellHorizontalAlignment(w, align); } /** * @param verticalAlign */ public void setCellVerticalAlignment(Widget w, VerticalAlignmentConstant verticalAlign) { this.itemsPanel.setCellVerticalAlignment(w, verticalAlign); } /** * @param child * @param cellWidth */ public void setCellWidth(Widget child, String cellWidth) { this.itemsPanel.setCellWidth(child, cellWidth); } /** * @param align */ public void setHorizontalAlignment(HorizontalAlignmentConstant align) { this.horizontalAlign = align; this.layoutPanel.setCellHorizontalAlignment(this.itemsScrollPanel, align); } /** * @param position */ public void setScrollPosition(int position) { if (position <0) { position = 0; } else { int offsetWidth = itemsPanel.getOffsetWidth(); if (position > offsetWidth) { position = offsetWidth; } } DOM.setElementPropertyInt(itemsScrollPanel.getElement(), "scrollLeft", position); // itemsScrollPanel.getElement().setScrollLeft(position); } /** * @param scrollToAddedWidgets */ public void setScrollToAddedWidgets(boolean scrollToAddedWidgets) { this.scrollToAddedWidgets = scrollToAddedWidgets; } /** * @param spacing */ public void setSpacing(int spacing) { itemsPanel.setSpacing(spacing); } /** * @param verticalAlign */ public void setVerticalAlignment(VerticalAlignmentConstant verticalAlign) { this.verticalAlign = verticalAlign; this.layoutPanel.setCellVerticalAlignment(this.itemsScrollPanel, verticalAlign); } /** * */ protected void createNavigationButtons() { previousButton = new Button(); previousButton.setText("<"); previousButton.setStyleName(DEFAULT_PREVIOUS_STYLE_NAME); HorizontalNavButtonEvtHandler handler = new HorizontalNavButtonEvtHandler(-20, -5); previousButton.addMouseDownHandler(handler); previousButton.addMouseUpHandler(handler); this.layoutPanel.add(previousButton, DockPanel.WEST); nextButton = new Button(); nextButton.setText(">"); nextButton.setStyleName(DEFAULT_NEXT_STYLE_NAME); handler = new HorizontalNavButtonEvtHandler(20, 5); nextButton.addMouseDownHandler(handler); nextButton.addMouseUpHandler(handler); this.layoutPanel.add(nextButton, DockPanel.EAST); Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { Element prevWrapper = getWrapperElement(previousButton); Element nextWrapper = getWrapperElement(nextButton); prevWrapper.setClassName(DEFAULT_PREVIOUS_STYLE_NAME + "Wrapper"); nextWrapper.setClassName(DEFAULT_NEXT_STYLE_NAME + "Wrapper"); ((TableCellElement)prevWrapper).setVAlign("middle"); ((TableCellElement)nextWrapper).setVAlign("middle"); } }); } /** * @return */ private Element getWrapperElement(Button button) { return button.getElement().getParentElement(); } /** * */ protected void checkNavigationButtons() { if (itemsPanel.getOffsetWidth() > layoutPanel.getOffsetWidth()) { enableNavigationButtons(); } else { disableNavigationButtons(); setScrollPosition(0); } } /** * */ protected void maybeShowNavigationButtons() { new Timer() { @Override public void run() { checkNavigationButtons(); } }.schedule(30); } /** * */ protected void disableNavigationButtons() { StyleUtils.addStyleDependentName(getWrapperElement(previousButton), "disabled"); StyleUtils.addStyleDependentName(getWrapperElement(nextButton), "disabled"); } /** * */ protected void enableNavigationButtons() { StyleUtils.removeStyleDependentName(getWrapperElement(previousButton), "disabled"); StyleUtils.removeStyleDependentName(getWrapperElement(nextButton), "disabled"); } /** * */ protected void handleWindowResize() { addAttachHandler(new Handler() { HandlerRegistration registration; @Override public void onAttachOrDetach(AttachEvent event) { if (event.isAttached()) { registration = Screen.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { checkNavigationButtons(); } }); } else if (registration != null) { registration.removeHandler(); registration = null; } } }); } /** * @author Thiago da Rosa de Bustamante - * */ class HorizontalNavButtonEvtHandler implements MouseDownHandler, MouseUpHandler { private int adjust; private boolean buttonPressed = false; private int delta; private int incrementalAdjust; private int originalIncrementalAdjust; HorizontalNavButtonEvtHandler(int adjust, int incrementalAdjust) { this.adjust = adjust; this.incrementalAdjust = incrementalAdjust; this.originalIncrementalAdjust = incrementalAdjust; this.delta = incrementalAdjust / 4; } public void onMouseDown(MouseDownEvent event) { buttonPressed = true; adjustScrollPosition(adjust); Scheduler.get().scheduleFixedDelay(new RepeatingCommand() { public boolean execute() { if (buttonPressed) { adjustScrollPosition(incrementalAdjust+=delta); } return buttonPressed; } }, 50); } public void onMouseUp(MouseUpEvent event) { buttonPressed = false; incrementalAdjust = originalIncrementalAdjust; } /** * @param adjust */ protected void adjustScrollPosition(int adjust) { int position = getScrollPosition() + adjust; setScrollPosition(position); } } public VerticalAlignmentConstant getVerticalAlignment() { return this.verticalAlign; } public HorizontalAlignmentConstant getHorizontalAlignment() { return this.horizontalAlign; } /** * @param nextButtonStyleName */ public void setNextButtonStyleName(String nextButtonStyleName) { this.nextButtonStyleName = nextButtonStyleName; this.nextButton.setStyleName(this.nextButtonStyleName); Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { Button btn = nextButton; getWrapperElement(btn).setClassName(CustomRollingPanel.this.nextButtonStyleName + "Wrapper"); } }); } /** * @param previousButtonStyleName */ public void setPreviousButtonStyleName(String previousButtonStyleName) { this.previousButtonStyleName = previousButtonStyleName; this.previousButton.setStyleName(this.nextButtonStyleName); Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { Button btn = previousButton; getWrapperElement(btn).setClassName(CustomRollingPanel.this.previousButtonStyleName + "Wrapper"); } }); } /** * @param bodyStyleName the bodyStyleName to set */ public void setBodyStyleName(String bodyStyleName) { this.bodyStyleName = bodyStyleName; this.itemsScrollPanel.setStyleName(this.bodyStyleName); } /** * @return the bodyStyleName */ public String getBodyStyleName() { return bodyStyleName; } /** * @return the nextButtonStyleName */ public String getNextButtonStyleName() { return nextButtonStyleName; } /** * @return the previousButtonStyleName */ public String getPreviousButtonStyleName() { return previousButtonStyleName; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
a032eafda36f41a63b1761d6630634ec732becd8
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/1/1_e376e1bb7b163fa5d9f9b575a3e0fa80220dc263/ResourceConstants/1_e376e1bb7b163fa5d9f9b575a3e0fa80220dc263_ResourceConstants_t.java
1ab5ffb95cfdd72bfa18f685819f34edd6c0fa5b
[]
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
4,731
java
/******************************************************************************* * Copyright (c) 2004 Actuate Corporation. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Actuate Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.birt.report.resource; public interface ResourceConstants { // dialog title public static final String EXCEPTION_DIALOG_TITLE = "birt.viewer.dialog.exception.title"; //$NON-NLS-1$ public static final String EXPORT_REPORT_DIALOG_TITLE = "birt.viewer.dialog.exportReport.title"; //$NON-NLS-1$ public static final String PARAMETER_DIALOG_TITLE = "birt.viewer.dialog.parameter.title"; //$NON-NLS-1$ public static final String SIMPLE_EXPORT_DATA_DIALOG_TITLE = "birt.viewer.dialog.simpleExportData.title"; //$NON-NLS-1$ /** * Page title for the "web viewer", "html" preview. */ public static final String BIRT_VIEWER_TITLE = "birt.viewer.title"; //$NON-NLS-1$ // general exception public static final String GENERAL_EXCEPTION_DOCUMENT_FILE_ERROR = "birt.viewer.generalException.DOCUMENT_FILE_ERROR"; //$NON-NLS-1$ public static final String GENERAL_EXCEPTION_DOCUMENT_ACCESS_ERROR = "birt.viewer.generalException.DOCUMENT_ACCESS_ERROR"; //$NON-NLS-1$ public static final String GENERAL_EXCEPTION_REPORT_FILE_ERROR = "birt.viewer.generalException.REPORT_FILE_ERROR"; //$NON-NLS-1$ public static final String GENERAL_EXCEPTION_REPORT_ACCESS_ERROR = "birt.viewer.generalException.REPORT_ACCESS_ERROR"; //$NON-NLS-1$ public static final String GENERAL_EXCEPTION_DOCUMENT_FILE_PROCESSING = "birt.viewer.generalException.DOCUMENT_FILE_PROCESSING"; //$NON-NLS-1$ // report service exception public static final String REPORT_SERVICE_EXCEPTION_EXTRACT_DATA_NO_DOCUMENT = "birt.viewer.reportServiceException.EXTRACT_DATA_NO_DOCUMENT"; //$NON-NLS-1$ public static final String REPORT_SERVICE_EXCEPTION_EXTRACT_DATA_NO_RESULT_SET = "birt.viewer.reportServiceException.EXTRACT_DATA_NO_RESULT_SET"; //$NON-NLS-1$ public static final String REPORT_SERVICE_EXCEPTION_INVALID_TOC = "birt.viewer.reportServiceException.INVALID_TOC"; //$NON-NLS-1$ public static final String REPORT_SERVICE_EXCEPTION_INVALID_PARAMETER = "birt.viewer.reportServiceException.INVALID_PARAMETER"; //$NON-NLS-1$ // birt action exception public static final String ACTION_EXCEPTION_NO_REPORT_DOCUMENT = "birt.viewer.actionException.NO_REPORT_DOCUMENT"; //$NON-NLS-1$ public static final String ACTION_EXCEPTION_INVALID_BOOKMARK = "birt.viewer.actionException.INVALID_BOOKMARK"; //$NON-NLS-1$ public static final String ACTION_EXCEPTION_INVALID_PAGE_NUMBER = "birt.viewer.actionException.INVALID_PAGE_NUMBER"; //$NON-NLS-1$ public static final String ACTION_EXCEPTION_INVALID_ID_FORMAT = "birt.viewer.actionException.INVALID_ID_FORMAT"; //$NON-NLS-1$ public static final String ACTION_EXCEPTION_DOCUMENT_FILE_NO_EXIST = "birt.viewer.actionException.DOCUMENT_FILE_NO_EXIST"; //$NON-NLS-1$ // birt soap binding exception public static final String SOAP_BINDING_EXCEPTION_NO_HANDLER_FOR_TARGET = "birt.viewer.soapBindingException.NO_HANDLER_FOR_TARGET"; //$NON-NLS-1$ // component processor exception public static final String COMPONENT_PROCESSOR_EXCEPTION_MISSING_OPERATOR = "birt.viewer.componentProcessorException.MISSING_OPERATOR"; //$NON-NLS-1$ // stack trace title public static final String EXCEPTION_DIALOG_STACK_TRACE = "birt.viewer.exceptionDialog.stackTrace"; //$NON-NLS-1$ public static final String EXCEPTION_DIALOG_SHOW_STACK_TRACE = "birt.viewer.exceptionDialog.showStackTrace"; //$NON-NLS-1$ public static final String EXCEPTION_DIALOG_HIDE_STACK_TRACE = "birt.viewer.exceptionDialog.hideStackTrace"; //$NON-NLS-1$ // viewer taglib excepton public static final String TAGLIB_NO_VIEWER_ID = "birt.viewer.taglib.NO_VIEWER_ID"; //$NON-NLS-1$ public static final String TAGLIB_INVALID_VIEWER_ID = "birt.viewer.taglib.INVALID_VIEWER_ID"; //$NON-NLS-1$ public static final String TAGLIB_VIEWER_ID_DUPLICATE = "birt.viewer.taglib.VIEWER_ID_DUPLICATE"; //$NON-NLS-1$ public static final String TAGLIB_NO_REPORT_SOURCE = "birt.viewer.taglib.NO_REPORT_SOURCE"; //$NON-NLS-1$ public static final String TAGLIB_NO_REPORT_DOCUMENT = "birt.viewer.taglib.NO_REPORT_DOCUMENT"; //$NON-NLS-1$ public static final String TAGLIB_NO_REQUESTER_NAME = "birt.viewer.taglib.NO_REQUESTER_NAME"; //$NON-NLS-1$ }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
6ca01c1240ab18e346deae24f36b9476d921889d
43d07af1742e01001c17eba4196f30156b08fbcc
/com/sun/tools/doclets/internal/toolkit/util/TaggedMethodFinder.java
92706c9a7aabc0f5dcc7604d80385cf34d096c62
[]
no_license
kSuroweczka/jdk
b408369b4b87ab09a828aa3dbf9132aaf8bb1b71
7ec3e8e31fcfb616d4a625191bcba0191ca7c2d4
refs/heads/master
2021-12-30T00:58:24.029054
2018-02-01T10:07:14
2018-02-01T10:07:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
650
java
/* */ package com.sun.tools.doclets.internal.toolkit.util; /* */ /* */ import com.sun.javadoc.MethodDoc; /* */ /* */ public class TaggedMethodFinder extends MethodFinder /* */ { /* */ public boolean isCorrectMethod(MethodDoc paramMethodDoc) /* */ { /* 43 */ return paramMethodDoc.paramTags().length + paramMethodDoc.tags("return").length + paramMethodDoc /* 43 */ .throwsTags().length + paramMethodDoc.seeTags().length > 0; /* */ } /* */ } /* Location: D:\dt\jdk\tools.jar * Qualified Name: com.sun.tools.doclets.internal.toolkit.util.TaggedMethodFinder * JD-Core Version: 0.6.2 */
[ "starlich.1207@gmail.com" ]
starlich.1207@gmail.com