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
5f69b4e25b373d1aba9090bef7d78de1a799680a
e8ec9f140e96eebfcacd8719f6d987a5709b2da4
/timeEnglish.java
0c2f080a30d41635076fc56aeca9ab7c7374d570
[]
no_license
WilsonAPCPSCA/chapter-5-programming-with-methods-practice-Chubbypanda7134
012fe41462b2d9c96c38b1b1f1069279295ba515
b58cc7d4a9a1fcc9d3ca7dbe227d91a0fcc22a9d
refs/heads/master
2021-08-08T05:12:35.050317
2017-11-09T16:07:55
2017-11-09T16:07:55
110,136,937
0
0
null
null
null
null
UTF-8
Java
false
false
1,113
java
package apCompSci; import java.util.Scanner; public class timeEnglish { public static String getTimeName(int hours, int minutes) { String timeName; String[] numWords = { "", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve" }; if(minutes == 0) { timeName = numWords[hours] + " o' clock"; } else if(minutes == 30) { timeName = "half past " + numWords[hours]; } else if(minutes == 15) { timeName = "quarter after " + numWords[hours]; } else if(minutes == 45) { if(hours < 12) { timeName = "quarter till " + numWords[hours + 1]; } else { timeName = "quarter till " + numWords[1]; } } else { timeName = minutes + " minutes past " + numWords[hours]; } return timeName; } public static void main(String[]args) { Scanner in = new Scanner(System.in); System.out.print("Enter the hour: "); int hour = in.nextInt(); System.out.print("Enter the minutes: "); int min = in.nextInt(); System.out.println(getTimeName(hour, min)); } }
4fe8a3d8316883705cb4e2a1c556da4d18365fa4
d4261417db59c92bb118cb7ec12c0bc43c85d62f
/src/de/uni/bielefeld/sc/hterhors/psink/obie/projects/soccerplayer/ontology/classes/MiltonKeynesDonsFC.java
0b3090cd406ad66b89139df4c6575814ef6d8243
[ "Apache-2.0" ]
permissive
berezovskyi/SoccerPlayerOntology
ed3a24a7ace88ba209f5439a49b04c11a8e6034a
c7dafee008911b45a2b9e8c55ffd43c1e69c3660
refs/heads/master
2022-06-20T02:17:21.385038
2018-09-21T17:09:38
2018-09-21T17:09:38
149,870,122
0
0
Apache-2.0
2022-05-20T22:00:24
2018-09-22T11:19:31
Java
UTF-8
Java
false
false
16,348
java
package de.uni.bielefeld.sc.hterhors.psink.obie.projects.soccerplayer.ontology.classes; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Resource; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.annotations.AssignableSubClasses; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.annotations.DirectInterface; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.annotations.DirectSiblings; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.annotations.NamedIndividual; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.annotations.SuperRootClasses; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.annotations.TextMention; import de.uni.bielefeld.sc.hterhors.psink.obie.core.ontology.interfaces.IOBIEThing; import de.uni.bielefeld.sc.hterhors.psink.obie.projects.soccerplayer.ontology.interfaces.IMiltonKeynesDonsFC; /** * * @author hterhors * * * Sep 6, 2018 */ @NamedIndividual @SuperRootClasses(get = { Team.class, }) @DirectSiblings(get = { JamaicaNationalFootballTeam.class, FcDordrecht.class, IndiaNationalUnder19FootballTeam.class, BradfordCityAFC.class, ScTelstar.class, PanamaNationalFootballTeam.class, PelsallVillaFC.class, BirminghamCityFC.class, OngcFC.class, Vitesse.class, BayelsaUnitedFC.class, CrookTownAFC.class, PeruNationalFootballTeam.class, GreeceWomenSNationalFootballTeam.class, FkHaugesund.class, HartlepoolUnitedFC.class, SwedenNationalFootballTeam.class, FcGirondinsDeBordeaux.class, VsiTampaBayFc.class, BirkirkaraFC.class, HeartlandFC.class, FcDenBosch.class, SwanseaCityAFC.class, ScTavriyaSimferopol.class, BostonUnitedFC.class, WienerSportClub.class, PlymouthArgyleFC.class, IranNationalUnder20FootballTeam.class, ClubAfricain.class, ShenzhenRubyFC.class, FCEtar.class, HamiltonAcademicalFC.class, AsMonacoFc.class, IpswichTownFC.class, NorwayNationalFootballTeam.class, GreenockMortonFC.class, QatarSc.class, BristolRoversFC.class, FcGroningen.class, PortugalNationalFootballTeam.class, _1FcFemina.class, QatarNationalFootballTeam.class, AlArabiScQatar.class, SanMarinoNationalFootballTeam.class, TianjinTedaFC.class, KuwaitSc.class, SCBeiraMar.class, GuizhouRenheFC.class, RbcRoosendaal.class, BoltonWanderersFC.class, ArbroathFC.class, DeportivoMongomo.class, DerbyCountyFC.class, HungaryWomenSNationalFootballTeam.class, BotafogoDeFutebolERegatas.class, RangdajiedUnitedFC.class, ArmthorpeWelfareFC.class, ArgentinaNationalFootballTeam.class, NasarawaUnitedFC.class, NottinghamForestFC.class, LincolnCityFC.class, ZambiaNationalFootballTeam.class, ShillongLajongFC.class, KDiegemSport.class, KuwaitNationalFootballTeam.class, BarnsleyFC.class, LouthUnitedFC.class, AFCBournemouth.class, ChileNationalFootballTeam.class, MaccabiTelAvivFC.class, EastGermanyNationalFootballTeam.class, SheffieldUnitedFC.class, AlQuwaAlJawiya.class, NewportCountyAFC.class, BarkingsideFC.class, BathCityFC.class, SouthernSamity.class, UnitedSC.class, VeteransBviFootball.class, SunHeiSc.class, WillingtonAFC.class, TheStrongest.class, MoorGreenFC.class, GermanyNationalFootballTeam.class, FCPorto.class, MiltonKeynesDonsFC.class, AtalantaBC.class, RcKouba.class, MexicoNationalFootballTeam.class, LebanonNationalFootballTeam.class, CFOsBelenenses.class, PowerDynamosFC.class, FarRabat.class, CreditonUnitedAFC.class, IfElfsborg.class, UslDunkerque.class, RDaringClubMolenbeek.class, PortsAuthorityFC.class, ManchesterUnitedFC.class, AlSalmiyaSc.class, BrightonHoveAlbionFC.class, ShrewsburyTownFC.class, CentroDeFutebolZicoSociedadeEsportiva.class, WisbechTownFC.class, NacBreda.class, AjaxCapeTownFC.class, HalifaxTownAFC.class, UsBoulogne.class, PfcLokomotivSofia.class, UnionDouala.class, TulsaGoldenHurricaneMenSSoccer.class, MontroseFC.class, SouthAfricaNationalFootballTeam.class, SouthChinaAa.class, CalcioPadova.class, TauroFC.class, OlympiqueDeMarseille.class, FcOss.class, NotreDameSc.class, IsraelNationalUnder21FootballTeam.class, EnglandNationalUnder17FootballTeam.class, SeoulArmyClub.class, DoverAthleticFC.class, UnitedStatesMenSNationalSoccerTeam.class, GraysAthleticFC.class, IslandersFc.class, JsKabylie.class, WolverhamptonWanderersFC.class, GrimsbyTownFC.class, KBeerschotVAC.class, SunderlandAFC.class, CoventryCityFC.class, SportingClubeDeGoa.class, HuddersfieldTownFC.class, WrexhamFC.class, FirstViennaFc.class, BradfordParkAvenueAFC.class, GrenobleFoot38.class, MasFez.class, DeportivoCoopsol.class, MumbaiTigersFC.class, PfcSpartakPleven.class, PuaikuraFc.class, ChesterCityFC.class, BoliviaNationalFootballTeam.class, KikwanchaPyongyang.class, HangzhouGreentownFC.class, QueenSParkFC.class, GatesheadFC.class, TunisiaNationalFootballTeam.class, UnitedSikkimFC.class, VancouverRoyals.class, PersijaJakarta.class, ArnettGardensFC.class, BorussiaDortmund.class, CDMotagua.class, HungaryNationalFootballTeam.class, SingaporeNationalFootballTeam.class, MsvDuisburg.class, JuanAurich.class, IttihadFc.class, DonBoscoFc.class, IndonesiaNationalFootballTeam.class, NottsCountyFC.class, ClubLibertad.class, LeytonOrientFC.class, WeymouthFC.class, StranraerFC.class, GloucesterCityAFC.class, SportingClubeDePortugal.class, FcUtrecht.class, MoroccoNationalFootballTeam.class, FortLauderdaleStrikers.class, FcSheriffTiraspol.class, ClydeFC.class, BedminsterFC.class, SouthKoreaNationalFootballTeam.class, BoldklubbenFrem.class, MiddlesbroughFC.class, AnkaraDemirspor.class, ChesterfieldFC.class, CookIslandsNationalFootballTeam.class, RosarioCentral.class, ADBaucau.class, EnuguRangers.class, DanubioFC.class, ConsettAFC.class, XerezCd.class, OceanBoysFC.class, AugustFootballClub.class, SfaxRailwaysSports.class, FcMetz.class, GuiseleyAFC.class, PfcBotevPlovdiv.class, TamworthFC.class, PersiramRajaAmpat.class, NorthernIrelandNationalUnder21FootballTeam.class, GefleIf.class, NorwichCityFC.class, Hamborn07.class, MillwallFC.class, BurnleyFC.class, DundeeUnitedFC.class, MontpellierHscLadies.class, SportingCristal.class, AccraHeartsOfOakSc.class, OwlertonFC.class, ClubSocialYDeportivoFlandria.class, EnglandNationalFootballTeam.class, VancouverWhitecapsFc.class, BurtonTownFC.class, AlgeriaNationalFootballTeam.class, FcPuumaTallinn.class, HaringeyBoroughFC.class, CarlisleUnitedFC.class, FcAk.class, LutonTownFC.class, DempoSC.class, Feyenoord.class, MontpellierHsc.class, TokushimaVortis.class, CorinthianFC.class, AcHorsens.class, NetherlandsNationalFootballTeam.class, WimbledonFC.class, RealGarcilaso.class, AACEagles.class, NigeriaNationalFootballTeam.class, LDAlajuelense.class, FulhamFC.class, RajaCasablanca.class, SantaCruzFutebolClube.class, ArisThessalonikiFCWomen.class, OldForestersFC.class, HeiderSv.class, GuangdongSunrayCaveFC.class, VeriaFC.class, RomaniaNationalFootballTeam.class, MvvMaastricht.class, ExeterCityFC.class, PecZwolle.class, ClaphamRoversFC.class, _1FcMagdeburg.class, SaudiArabiaNationalFootballTeam.class, WiganAthleticFC.class, MerthyrTownFC.class, BlackburnRoversFC.class, WalesNationalFootballTeam.class, StockportCountyFC.class, SouthendUnitedFC.class, PofcBotevVratsa.class, AustriaNationalFootballTeam.class, CercleBruggeKSV.class, DagenhamRedbridgeFC.class, KhaitanSportingClub.class, FcGueugnon.class, ColchesterUnitedFC.class, StJohnstoneFC.class, DominicaNationalFootballTeam.class, MohunBaganAC.class, SheffieldWednesdayFC.class, BritishVirginIslandsNationalFootballTeam.class, StokeCityFC.class, MarlowFC.class, DalianAerbinFC.class, YorkCityFC.class, MumbaiFC.class, PfcSlaviaSofia.class, DenmarkNationalFootballTeam.class, MacclesfieldTownFC.class, GooleAFC.class, IfkEskilstuna.class, TottenhamHotspurFC.class, AlArabiScKuwait.class, HednesfordTownFC.class, BraintreeTownFC.class, AjAuxerre.class, SogndalFotball.class, DeportivoTolucaFC.class, QadsiaSc.class, OmanNationalFootballTeam.class, BulgariaNationalFootballTeam.class, WiganBoroughFC.class, GrenadaNationalFootballTeam.class, ToulouseFc.class, FrickleyAthleticFC.class, DundeeFC.class, LivingstonFC.class, ClydebankFC.class, TeamSoccerooFC.class, GuineaNationalFootballTeam.class, BarbadosNationalFootballTeam.class, BangorCityFC.class, PfcKaliakraKavarna.class, BlythFC.class, ClubTijuana.class, FcAarau.class, WaBoufarik.class, ClubUniversidadDeChile.class, SouthamptonFC.class, PfcLevskiSofia.class, OudHeverleeLeuven.class, ClubNacional.class, BelgiumNationalFootballTeam.class, PortValeFC.class, KazmaSportingClub.class, TimorLesteNationalFootballTeam.class, AsfaYennenga.class, FredrikstadFk.class, BuxtonFC.class, SouthportFC.class, TranmereRoversFC.class, SierraLeoneNationalFootballTeam.class, AsNancy.class, PullmanFC.class, UruguayNationalFootballTeam.class, DjiboutiNationalFootballTeam.class, ArsenalFC.class, ItalyNationalFootballTeam.class, FalkenbergsFf.class, AstonVillaFC.class, ClubLitoral.class, AdDiliOeste.class, SkKladno.class, WillemIiFootballClub.class, AberdeenFC.class, PfcCskaSofia.class, AnchorQueensParkRangersFc.class, SloughTownFC.class, HapoelIroniKiryatShmonaFC.class, EquatorialGuineaNationalFootballTeam.class, EastFifeFC.class, ParefSouthridgeSchool.class, EvertonFC.class, JomoCosmosFC.class, SkBrann.class, SliemaWanderersFC.class, KigwanchaSportsClub.class, LuxembourgNationalFootballTeam.class, ChelmsfordCityFC.class, AtlantaChiefs.class, HaitiNationalFootballTeam.class, MaltaNationalFootballTeam.class, EnosisNeonParalimniFc.class, TeignmouthFC.class, PfcChernoMoreVarna.class, AsDouanesDakar.class, JuventusFC.class, _1SimmeringerSc.class, BahrainNationalFootballTeam.class, OgcNice.class, ClubNacionalDeFootball.class, FreemantleFC.class, MamelodiSundownsFC.class, CameroonNationalFootballTeam.class, BoNessUnitedFC.class, FcDynamoMoscow.class, SalgaocarFC.class, Sarpsborg08Ff.class, TechnoAryanFC.class, PaokFC.class, NewcastleUnitedFC.class, PaykanFC.class, SandvikensIf.class, AmericanSamoaNationalAssociationFootballTeam.class, AlumniAthleticClub.class, DeportivoSaprissa.class, FcVolendam.class, NorthKoreaNationalFootballTeam.class, DarlingtonFC.class, EgersundsIk.class, ChurchillBrothersSC.class, ParaguayNationalFootballTeam.class, DunfermlineAthleticFC.class, DalianShideFC.class, FcVolynLutsk.class, CircoloSportivoItaliano.class, LevadiakosFC.class, NorthamptonTownFC.class, TorquayUnitedFC.class, FkAustriaWien.class, LiverpoolFC.class, BasingstokeTownFC.class, VvvVenlo.class, RcLens.class, SherwoodForesters.class, FcKharkiv.class, ThackleyFC.class, EstoniaNationalFootballTeam.class, CelticBoysClub.class, AlAnsarSc.class, BristolCityFC.class, HarlandAndWolff.class, SouthKoreaNationalUnder17FootballTeam.class, PuneFC.class, Gais.class, GombakUnitedFc.class, UsOuakam.class, IraqNationalFootballTeam.class, AlianzaLima.class, FleetwoodTownFC.class, NkanaFC.class, KorinthosFC.class, PohangSteelers.class, ChicagoSting.class, WestBromwichAlbionFC.class, CDTrofense.class, KBocholterVV.class, VagonulArad.class, PooleTownFC.class, AkademiskBoldklub.class, MansfieldTownFC.class, PacificLutheranUniversity.class, ACMonzaBrianza1912.class, MexicoWomenSNationalFootballTeam.class, LandskronaBois.class, FcAkademiyaTolyatti.class, SpartaRotterdam.class, FcTwente.class, IsHalmia.class, PyongyangCitySportsClub.class, CowdenbeathFC.class, RhylFC.class, FcMidtjylland.class, RCharleroiSC.class, ScBastia.class, CzechoslovakiaNationalFootballTeam.class, CostaRicaNationalFootballTeam.class, ThandaRoyalZuluFC.class, ZamalekSc.class, IkSleipner.class, ArkaGdynia.class, HondurasNationalFootballTeam.class, ScotlandNationalFootballTeam.class, Pakistan.class, KSintTruidenseVV.class, QatarNationalUnder23FootballTeam.class, EgyptNationalFootballTeam.class, HarwichParkestonFC.class, FranceNationalFootballTeam.class, DefensoresDeBelgrano.class, CasualsFC.class, FcDesnaChernihiv.class, FranceWomenSNationalFootballTeam.class, BlackpoolFC.class, ChelseaFC.class, VikingFk.class, JeonnamDragons.class, TruroCityFC.class, AikFotboll.class, CrusadersFC.class, PsmMakassar.class, HfcHaarlem.class, CharlestonBattery.class, WydadCasablanca.class, CoritibaFootBallClub.class, }) @DirectInterface(get = IMiltonKeynesDonsFC.class) @AssignableSubClasses(get = {}) public class MiltonKeynesDonsFC implements IMiltonKeynesDonsFC { final static public String ONTOLOGY_NAME = "http://psink.de/scio/MiltonKeynesDonsFC"; final public String annotationID; private Integer characterOffset; private Integer characterOnset; final static private Map<IOBIEThing, String> resourceFactory = new HashMap<>(); final static private long serialVersionUID = 1L; @TextMention final private String textMention; public MiltonKeynesDonsFC(MiltonKeynesDonsFC miltonKeynesDonsFC) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { this.annotationID = miltonKeynesDonsFC.getAnnotationID(); this.characterOffset = miltonKeynesDonsFC.getCharacterOffset(); this.characterOnset = miltonKeynesDonsFC.getCharacterOnset(); this.textMention = miltonKeynesDonsFC.getTextMention(); } public MiltonKeynesDonsFC() { this.annotationID = null; this.textMention = null; } public MiltonKeynesDonsFC(String annotationID, String textMention) { this.annotationID = annotationID; this.textMention = textMention; } /***/ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; MiltonKeynesDonsFC other = (MiltonKeynesDonsFC) obj; if (textMention == null) { if (other.textMention != null) return false; } else if (!textMention.equals(other.textMention)) return false; if (characterOffset == null) { if (other.characterOffset != null) return false; } else if (!characterOffset.equals(other.characterOffset)) return false; if (characterOnset == null) { if (other.characterOnset != null) return false; } else if (!characterOnset.equals(other.characterOnset)) return false; if (annotationID == null) { if (other.annotationID != null) return false; } else if (!annotationID.equals(other.annotationID)) return false; return true; } /***/ @Override public String getAnnotationID() { return annotationID; } /***/ @Override public Integer getCharacterOffset() { return characterOffset; } /***/ @Override public Integer getCharacterOnset() { return characterOnset; } /***/ @Override public String getONTOLOGY_NAME() { return ONTOLOGY_NAME; } /***/ @Override public Model getRDFModel(String resourceIDPrefix) { Model model = ModelFactory.createDefaultModel(); Resource group = model.createResource(getResourceName()); model.add(group, model.createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), model.createResource(ONTOLOGY_NAME)); return model; } /***/ @Override public String getResourceName() { return ONTOLOGY_NAME; } /***/ @Override public String getTextMention() { return textMention; } /***/ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.textMention == null) ? 0 : this.textMention.hashCode()); result = prime * result + ((this.characterOffset == null) ? 0 : this.characterOffset.hashCode()); result = prime * result + ((this.characterOnset == null) ? 0 : this.characterOnset.hashCode()); result = prime * result + ((this.annotationID == null) ? 0 : this.annotationID.hashCode()); return result; } /***/ @Override public boolean isEmpty() { boolean isEmpty = true; return false; } /***/ @Override public void setCharacterOffset(Integer offset) { this.characterOffset = offset; } /***/ @Override public void setCharacterOnset(Integer onset) { this.characterOnset = onset; } @Override public String toString() { return "MiltonKeynesDonsFC [annotationID=" + annotationID + ",characterOffset=" + characterOffset + ",characterOnset=" + characterOnset + ",serialVersionUID=" + serialVersionUID + ",textMention=" + textMention + "]"; } }
a9ecf89c6f3dbdb989d9a4f425660c4d362fd811
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/71/org/apache/commons/math/ode/events/EventState_reinitializeBegin_149.java
7e12b51d248f7a163d6a411318e99a91fd8f7997
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,007
java
org apach common math od event handl state link event handler eventhandl event handler integr step time integr propos step event handler switch function check handl state handler integr step refer state end preced step inform decid handler trigger event propos step step reduc ensur event occur bound insid step version revis date event state eventst reiniti begin step param start tstart independ time variabl begin step param start ystart arrai current state vector begin step except event except eventexcept event handler evalu begin step reiniti begin reinitializebegin start tstart start ystart event except eventexcept start tstart handler start tstart start ystart posit g0posit
26b315adb595e42b389d07b202055e85b6dc3c5a
cf9b167b6d73305eb7cb37712bc70fb8b2f60175
/minecraft/net/minecraft/entity/item/EntityEnderEye.java
31d5303e8e7258c31fdef0f1c88133de1a317c2f
[]
no_license
Capsar/Rapture
b1ef74dfceb005b291e695605f83839dc25d1c9e
b73f53f22eb1caed44e39e4a026eac5cda7b41fc
refs/heads/master
2021-06-12T20:06:53.100425
2020-04-09T14:13:47
2020-04-09T14:13:47
254,388,305
5
2
null
null
null
null
UTF-8
Java
false
false
7,251
java
package net.minecraft.entity.item; import net.minecraft.entity.Entity; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class EntityEnderEye extends Entity { /** 'x' location the eye should float towards. */ private double targetX; /** 'y' location the eye should float towards. */ private double targetY; /** 'z' location the eye should float towards. */ private double targetZ; private int despawnTimer; private boolean shatterOrDrop; public EntityEnderEye(World worldIn) { super(worldIn); this.setSize(0.25F, 0.25F); } @Override protected void entityInit() {} /** * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge * length * 64 * renderDistanceWeight Args: distance */ @Override public boolean isInRangeToRenderDist(double distance) { double var3 = this.getEntityBoundingBox().getAverageEdgeLength() * 4.0D; var3 *= 64.0D; return distance < var3 * var3; } public EntityEnderEye(World worldIn, double x, double y, double z) { super(worldIn); this.despawnTimer = 0; this.setSize(0.25F, 0.25F); this.setPosition(x, y, z); } public void moveTowards(BlockPos p_180465_1_) { double var2 = p_180465_1_.getX(); int var4 = p_180465_1_.getY(); double var5 = p_180465_1_.getZ(); double var7 = var2 - this.posX; double var9 = var5 - this.posZ; float var11 = MathHelper.sqrt_double(var7 * var7 + var9 * var9); if (var11 > 12.0F) { this.targetX = this.posX + var7 / var11 * 12.0D; this.targetZ = this.posZ + var9 / var11 * 12.0D; this.targetY = this.posY + 8.0D; } else { this.targetX = var2; this.targetY = var4; this.targetZ = var5; } this.despawnTimer = 0; this.shatterOrDrop = this.rand.nextInt(5) > 0; } /** * Sets the velocity to the args. Args: x, y, z */ @Override public void setVelocity(double x, double y, double z) { this.motionX = x; this.motionY = y; this.motionZ = z; if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { float var7 = MathHelper.sqrt_double(x * x + z * z); this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(x, z) * 180.0D / Math.PI); this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(y, var7) * 180.0D / Math.PI); } } /** * Called to update the entity's position/logic. */ @Override public void onUpdate() { this.lastTickPosX = this.posX; this.lastTickPosY = this.posY; this.lastTickPosZ = this.posZ; super.onUpdate(); this.posX += this.motionX; this.posY += this.motionY; this.posZ += this.motionZ; float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); for (this.rotationPitch = (float)(Math.atan2(this.motionY, var1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ; } while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { this.prevRotationPitch += 360.0F; } while (this.rotationYaw - this.prevRotationYaw < -180.0F) { this.prevRotationYaw -= 360.0F; } while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { this.prevRotationYaw += 360.0F; } this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; if (!this.worldObj.isRemote) { double var2 = this.targetX - this.posX; double var4 = this.targetZ - this.posZ; float var6 = (float)Math.sqrt(var2 * var2 + var4 * var4); float var7 = (float)Math.atan2(var4, var2); double var8 = var1 + (var6 - var1) * 0.0025D; if (var6 < 1.0F) { var8 *= 0.8D; this.motionY *= 0.8D; } this.motionX = Math.cos(var7) * var8; this.motionZ = Math.sin(var7) * var8; if (this.posY < this.targetY) { this.motionY += (1.0D - this.motionY) * 0.014999999664723873D; } else { this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D; } } float var10 = 0.25F; if (this.isInWater()) { for (int var3 = 0; var3 < 4; ++var3) { this.worldObj.spawnParticle(EnumParticleTypes.WATER_BUBBLE, this.posX - this.motionX * var10, this.posY - this.motionY * var10, this.posZ - this.motionZ * var10, this.motionX, this.motionY, this.motionZ, new int[0]); } } else { this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, this.posX - this.motionX * var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * var10 - 0.5D, this.posZ - this.motionZ * var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ, new int[0]); } if (!this.worldObj.isRemote) { this.setPosition(this.posX, this.posY, this.posZ); ++this.despawnTimer; if (this.despawnTimer > 80 && !this.worldObj.isRemote) { this.setDead(); if (this.shatterOrDrop) { this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye))); } else { this.worldObj.playAuxSFX(2003, new BlockPos(this), 0); } } } } /** * (abstract) Protected helper method to write subclass entity data to NBT. */ @Override public void writeEntityToNBT(NBTTagCompound tagCompound) {} /** * (abstract) Protected helper method to read subclass entity data from NBT. */ @Override public void readEntityFromNBT(NBTTagCompound tagCompund) {} /** * Gets how bright this entity is. */ @Override public float getBrightness(float partialTicks) { return 1.0F; } @Override public int getBrightnessForRender(float partialTicks) { return 15728880; } /** * If returns false, the item will not inflict any damage against entities. */ @Override public boolean canAttackWithItem() { return false; } }
bd7821fef5dc10cf4ed9581fb4b626a3447ed793
74643b1e500f0e2782bd00fdc945f7f2a6505f24
/build/generated-sources/ap-source-output/modelo/Estado_.java
0d673cf1e323e5424bd5cc2528f0a68a16bfcd5b
[]
no_license
gondelcorro/Herbario
a4d87add2bd7a8500e11587bb33ffafc27bcd49a
02562d1099d807ee70410a03514aba2a3dd68cb8
refs/heads/master
2021-05-13T14:16:56.954406
2018-01-08T22:19:07
2018-01-08T22:19:07
116,734,618
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
package modelo; import javax.annotation.Generated; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; @Generated(value="EclipseLink-2.5.2.v20140319-rNA", date="2017-02-22T23:03:51") @StaticMetamodel(Estado.class) public class Estado_ { public static volatile SingularAttribute<Estado, Integer> id; public static volatile SingularAttribute<Estado, Integer> ubicacionpaisid; public static volatile SingularAttribute<Estado, String> estadonombre; }
0cbe42825750a43e2378a3fb62d4ee761806cf35
10f382be7338b9a4f89602ae72e0e2b1360a1605
/src/main/java/com/au/billmates/configuration/WebSecurity.java
63c3fcf31ad7386337b3f906e104380b37450b6b
[]
no_license
stan13/billmates
bafe8d420ac393f66217ad86ff4d5b224abcefae
841b1ecca1464c9fe93374c3877d455aa5528dbb
refs/heads/master
2020-05-01T18:53:36.373774
2019-04-23T19:22:08
2019-04-23T19:22:08
177,634,259
0
0
null
null
null
null
UTF-8
Java
false
false
2,455
java
package com.au.billmates.configuration; import org.springframework.context.annotation.Bean; import org.springframework.http.HttpMethod; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import static com.au.billmates.configuration.SecurityConstants.SIGN_UP_URL; @EnableWebSecurity public class WebSecurity extends WebSecurityConfigurerAdapter { private UserDetailsServiceImpl userDetailsService; private BCryptPasswordEncoder bCryptPasswordEncoder; public WebSecurity(UserDetailsServiceImpl userDetailsService, BCryptPasswordEncoder bCryptPasswordEncoder) { this.userDetailsService = userDetailsService; this.bCryptPasswordEncoder = bCryptPasswordEncoder; } @Override protected void configure(HttpSecurity http) throws Exception { http.cors().and().csrf().disable().authorizeRequests() .antMatchers(HttpMethod.POST, SIGN_UP_URL).permitAll() .anyRequest().authenticated() .and() .addFilter(new JwtAuthenticationFilter(authenticationManager())) .addFilter(new JwtAuthorizationFilter(authenticationManager())) // this disables session creation on Spring Security .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); } @Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder); } @Bean CorsConfigurationSource corsConfigurationSource() { final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); source.registerCorsConfiguration("/**", new CorsConfiguration().applyPermitDefaultValues()); return source; } }
a870c9fb1cdfb88f46f29a2fd8be2d2a05b9cea3
e923146de8154e8afc466db711a92417f87d79be
/src/main/java/jp/yahooapis/im/v201809/conversiontracker/ApiException.java
6085a207e5a28f3d2d6fa09cc240ead6221b17dd
[ "MIT" ]
permissive
YutaFukuma/ydn-api-java-samples
18d2716b4c9aebc4a9deedfb48fade421c232530
c2568ff4781691710b55b3e9f48b889f36ae9623
refs/heads/master
2020-03-30T23:23:48.376544
2018-09-20T02:49:54
2018-09-20T02:49:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,077
java
package jp.yahooapis.im.v201809.conversiontracker; import javax.xml.ws.WebFault; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.2.9-b130926.1035 * Generated source version: 2.2 * */ @WebFault(name = "ApiExceptionFault", targetNamespace = "http://im.yahooapis.jp/V201809/ConversionTracker") public class ApiException extends Exception { /** * Java type that goes as soapenv:Fault detail element. * */ private String faultInfo; /** * * @param faultInfo * @param message */ public ApiException(String message, String faultInfo) { super(message); this.faultInfo = faultInfo; } /** * * @param faultInfo * @param cause * @param message */ public ApiException(String message, String faultInfo, Throwable cause) { super(message, cause); this.faultInfo = faultInfo; } /** * * @return * returns fault bean: java.lang.String */ public String getFaultInfo() { return faultInfo; } }
952b883a7b32a8d9c044072053c0fa4967d62812
1b1d8bba58d429eb94c4f5c6aadce2005510ac48
/backend/goodday/src/main/java/seeuthere/goodday/path/exception/PathExceptionSet.java
d5f8821a1cdae479d9482fca4eea52d8d6bb2fe1
[]
no_license
365kim/2021-see-you-there
f3b263016108b2246a12d1d55ae84d1b18716c86
a929e288426366a16b7325c6f9bd998ed8e57695
refs/heads/develop
2023-07-01T17:30:35.503681
2021-08-12T07:04:05
2021-08-12T07:04:05
393,598,502
1
0
null
2021-08-12T07:06:57
2021-08-07T06:19:28
JavaScript
UTF-8
Java
false
false
750
java
package seeuthere.goodday.path.exception; import org.springframework.http.HttpStatus; import seeuthere.goodday.exception.CustomException; public enum PathExceptionSet implements CustomException { NOT_FOUND_PATH("해당 위치에서는 경로를 찾을 수 없습니다.", HttpStatus.BAD_REQUEST.value()), OVER_WALK_TIME("이동할 수 있는 경로가 없습니다.", HttpStatus.BAD_REQUEST.value()); private final String message; private final int status; PathExceptionSet(String message, int status) { this.message = message; this.status = status; } @Override public String getMessage() { return message; } @Override public int getStatus() { return status; } }
1e4de65de78c71c3c49be6ec371be829c58e45bb
bf6a7cebca211b52030564b859009b24922f6ea0
/app/src/main/java/com/cisco/tme/material/MaterialThemeDialogFragment.java
af6ed777835c7ec46d04654a4137e947d942f123
[]
no_license
fkicenko/ConnectedAI_CumulusSupport
028c70962bcdb36dcd89d0497658cda5e262cf4e
98a75ecec4bd38e4ef40e84017ea13f7a2bb91e7
refs/heads/master
2020-04-03T20:34:02.149228
2018-10-31T12:41:22
2018-10-31T12:41:24
155,548,825
0
0
null
null
null
null
UTF-8
Java
false
false
6,548
java
package com.cisco.tme.material; import android.app.Activity; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.annotation.StringRes; import android.support.v4.app.DialogFragment; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.cisco.tme.R; import com.cisco.tme.theme.MaterialTheme; import com.cisco.tme.log.LogUtils; import timber.log.Timber; /** * Simple dialog fragment that creates an alert dialog that can be themed. * * @author Steven Byle */ public class MaterialThemeDialogFragment extends DialogFragment implements DialogInterface.OnClickListener { private static final String KEY_ARG_TITLE = "KEY_ARG_TITLE"; private static final String KEY_ARG_MESSAGE = "KEY_ARG_MESSAGE"; private static final String KEY_ARG_ALERT_DIALOG_THEME = "KEY_ARG_ALERT_DIALOG_THEME"; private String mTitle, mMessage; private MaterialTheme mAlertDialogTheme; public static MaterialThemeDialogFragment newInstance(String title, String message, @Nullable MaterialTheme alertDialogTheme) { Timber.v(LogUtils.METHOD_ONLY); MaterialThemeDialogFragment fragment = new MaterialThemeDialogFragment(); Bundle args = fragment.getArguments(); if (args == null) { args = new Bundle(); } args.putString(KEY_ARG_TITLE, title); args.putString(KEY_ARG_MESSAGE, message); args.putSerializable(KEY_ARG_ALERT_DIALOG_THEME, alertDialogTheme); fragment.setArguments(args); return fragment; } public static MaterialThemeDialogFragment newInstance(Context context, @StringRes int titleResId, @StringRes int messageResId, @Nullable MaterialTheme alertDialogTheme) { MaterialThemeDialogFragment fragment = newInstance( context.getString(titleResId), context.getString(messageResId), alertDialogTheme); return fragment; } @Override public void onAttach(Context context) { super.onAttach(context); Timber.v(LogUtils.METHOD_ONLY); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Timber.v(LogUtils.getSavedInstanceStateNullMessage(savedInstanceState)); // Get passed in parameters Bundle args = getArguments(); // If no parameters were passed in, default them if (args == null) { mTitle = null; mMessage = null; mAlertDialogTheme = null; } // Otherwise, set incoming parameters else { mTitle = args.getString(KEY_ARG_TITLE); mMessage = args.getString(KEY_ARG_MESSAGE); mAlertDialogTheme = (MaterialTheme) args.getSerializable(KEY_ARG_ALERT_DIALOG_THEME); } // If this is the first creation, default state variables if (savedInstanceState == null) { } // Otherwise, restore state else { } } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { Timber.v(LogUtils.getSavedInstanceStateNullMessage(savedInstanceState)); // Create the alert dialog using the proper theme Activity parentActivity = getActivity(); AlertDialog.Builder alertDialogBuilder; if (mAlertDialogTheme != null) { alertDialogBuilder = new AlertDialog.Builder(parentActivity, mAlertDialogTheme.getThemeResId()); } else { alertDialogBuilder = new AlertDialog.Builder(parentActivity); } alertDialogBuilder.setTitle(mTitle) .setMessage(mMessage) .setPositiveButton(R.string.material_theme_dialog_button_positive, this) .setNegativeButton(R.string.material_theme_dialog_button_negative, this); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.setCanceledOnTouchOutside(true); return alertDialog; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View fragmentView = super.onCreateView(inflater, container, savedInstanceState); Timber.v(LogUtils.getSavedInstanceStateNullMessage(savedInstanceState)); return fragmentView; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); Timber.v(LogUtils.getSavedInstanceStateNullMessage(savedInstanceState)); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); Timber.v(LogUtils.getSavedInstanceStateNullMessage(savedInstanceState)); } @Override public void onViewStateRestored(Bundle savedInstanceState) { super.onViewStateRestored(savedInstanceState); Timber.v(LogUtils.getSavedInstanceStateNullMessage(savedInstanceState)); } @Override public void onStart() { super.onStart(); Timber.v(LogUtils.METHOD_ONLY); } @Override public void onResume() { super.onResume(); Timber.v(LogUtils.METHOD_ONLY); } @Override public void onPause() { super.onPause(); Timber.v(LogUtils.METHOD_ONLY); } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); Timber.v(LogUtils.METHOD_ONLY); } @Override public void onStop() { super.onStop(); Timber.v(LogUtils.METHOD_ONLY); } @Override public void onDestroyView() { super.onDestroyView(); Timber.v(LogUtils.METHOD_ONLY); } @Override public void onDestroy() { super.onDestroy(); Timber.v(LogUtils.METHOD_ONLY); } @Override public void onDismiss(DialogInterface dialog) { super.onDismiss(dialog); Timber.d(LogUtils.METHOD_ONLY); } @Override public void onCancel(DialogInterface dialog) { super.onCancel(dialog); Timber.d(LogUtils.METHOD_ONLY); } @Override public void onClick(DialogInterface dialog, int which) { Timber.d(LogUtils.METHOD_ONLY); } }
34d1b5cb0989e8ea4b1fcd02b1a54e34e8090ae1
5841e4894861ea11f3cf98baad12c73123ba4fce
/java/atl/atl-core/src/main/java/org/lmind/atl/core/ast/Node.java
7d459940ab7dde934fabeb0f8487ff531d72cf6b
[]
no_license
lminds/lmind-practise
bb71e34edfd7de48e0ffae172654c4bb4cb7954c
98ad83dc10a6c7488c4069b3a48f9d62d158da19
refs/heads/master
2021-01-19T09:48:52.239024
2015-05-10T05:31:05
2015-05-10T05:31:05
23,507,953
0
0
null
null
null
null
UTF-8
Java
false
false
1,389
java
/* Generated By:JJTree: Do not edit this line. Node.java Version 6.0 */ /* JavaCCOptions:MULTI=false,NODE_USES_PARSER=false,VISITOR=false,TRACK_TOKENS=true,NODE_PREFIX=Atl,NODE_EXTENDS=,NODE_FACTORY=AtlNodeFactory,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ package org.lmind.atl.core.ast; /* All AST nodes must implement this interface. It provides basic machinery for constructing the parent and child relationships between nodes. */ public interface Node { /** This method is called after the node has been made the current node. It indicates that child nodes can now be added to it. */ public void jjtOpen(); /** This method is called after all the child nodes have been added. */ public void jjtClose(); /** This pair of methods are used to inform the node of its parent. */ public void jjtSetParent(Node n); public Node jjtGetParent(); /** This method tells the node to add its argument to the node's list of children. */ public void jjtAddChild(Node n, int i); /** This method returns a child node. The children are numbered from zero, left to right. */ public Node jjtGetChild(int i); /** Return the number of children the node has. */ public int jjtGetNumChildren(); public int getId(); } /* JavaCC - OriginalChecksum=020e80aa8e6058408c811635c25ffb8f (do not edit this line) */
13d11d98bcd14024acb6949e8af1b3132184fc0c
8f5406a49020fd803a6c65059690eabf7f2b1f9e
/app/src/main/java/com/dvinfosys/WidgetsExample/view/ItemsCountView.java
0e5b1ad3534f9100c47e954aff22d227fc2b9d48
[ "Apache-2.0" ]
permissive
Mr-Ramzan/CustomWidgets
3f7f032f2212c87c89f5c36b8cfc575e383d92ab
54a4de994d0fd532f37b5e1876a8393a1af488db
refs/heads/master
2023-06-12T14:32:06.973105
2020-01-31T07:50:46
2020-01-31T07:50:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,633
java
package com.dvinfosys.WidgetsExample.view; import android.annotation.SuppressLint; import android.content.Context; import android.os.Build; import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.ViewGroup; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.DecelerateInterpolator; import android.view.animation.TranslateAnimation; import android.widget.LinearLayout; import android.widget.TextSwitcher; import android.widget.TextView; import com.dvinfosys.WidgetsExample.R; public class ItemsCountView extends LinearLayout { private TextSwitcher textSwitcher; private TextView textView; public ItemsCountView(Context context) { super(context); init(context); } public ItemsCountView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); init(context); } private void init(Context context) { textSwitcher = new TextSwitcher(context); textSwitcher.addView(createViewForTextSwitcher(context)); textSwitcher.addView(createViewForTextSwitcher(context)); addView(textSwitcher, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); textView = new TextView(context); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { textView.setTextAppearance(R.style.positionIndicator); } else { textView.setTextAppearance(context, R.style.positionIndicator); } addView(textView, new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); } private TextView createViewForTextSwitcher(Context context) { TextView textView = new TextView(context); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { textView.setTextAppearance(R.style.positionIndicatorCurrent); } else { textView.setTextAppearance(context, R.style.positionIndicatorCurrent); } textView.setLayoutParams(new TextSwitcher.LayoutParams(TextSwitcher.LayoutParams.WRAP_CONTENT, TextSwitcher.LayoutParams.WRAP_CONTENT)); return textView; } @SuppressLint("SetTextI18n") public void update(int newPosition, int oldPosition, int totalElements) { textView.setText(" / " + totalElements); int offset = (int) (textSwitcher.getHeight() * 0.75); int duration = 250; if (newPosition > oldPosition) { textSwitcher.setInAnimation(createPositionAnimation(-offset, 0, 0f, 1f, duration)); textSwitcher.setOutAnimation(createPositionAnimation(0, offset, 1f, 0f, duration)); } else if (oldPosition > newPosition) { textSwitcher.setInAnimation(createPositionAnimation(offset, 0, 0f, 1f, duration)); textSwitcher.setOutAnimation(createPositionAnimation(0, -offset, 1f, 0f, duration)); } textSwitcher.setText(String.valueOf(newPosition + 1)); } private Animation createPositionAnimation(int fromY, int toY, float fromAlpha, float toAlpha, int duration) { TranslateAnimation translate = new TranslateAnimation(0, 0, fromY, toY); translate.setDuration(duration); AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha); alpha.setDuration(duration); AnimationSet set = new AnimationSet(true); set.setInterpolator(new DecelerateInterpolator()); set.addAnimation(translate); set.addAnimation(alpha); return set; } }
f02e2c2ddc07833d36c9274142b3fba0d47b2cd2
86ca1f796871e6ef9f70a061917ed2a25f1ee395
/Teams-information-service/src/main/java/com/zlatenov/teamsinformationservice/model/response/Leagues.java
8b8622c26843534163122b3031b65c23310a549a
[]
no_license
and1teachera/SpoilerFreeNba
09833bb46fe4f17beefe30452ac2407ca1c8efef
348e0d6a30a4ad37880ae27d7c9def3d4623c599
refs/heads/master
2022-06-10T12:23:32.228345
2019-12-19T11:29:44
2019-12-19T11:29:44
226,909,124
0
0
null
2022-05-20T21:18:10
2019-12-09T15:52:08
Java
UTF-8
Java
false
false
340
java
package com.zlatenov.teamsinformationservice.model.response; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import java.util.List; /** * @author Angel Zlatenov */ @Getter @Setter @AllArgsConstructor @NoArgsConstructor public class Leagues { List<League> leagues; }
4f66fcd16f24074a334748d47857e885388bee41
ffa7634728ee5f2c6d1c40411f30bfc3a6ddae45
/EducationPlatformWechat/src/com/saint/wechat/test/Test1.java
8252c673b2b79380da0fd6b59f658004f392b494
[]
no_license
duducc/EducationPlatformWechat
82d2a834c7578a876286ceb29cf1beacba1efe2a
b0989dc2c6f04328ecf0873ad3de6100182dd0af
refs/heads/master
2023-02-17T12:48:49.136990
2021-01-21T09:41:17
2021-01-21T09:41:17
331,575,131
0
0
null
null
null
null
UTF-8
Java
false
false
217
java
package com.saint.wechat.test; public class Test1 { public static void main(String[] args) { String[] a={"1","2","3"}; int i=0; for(String b : a){ i++; if(i<=5){ System.out.println(b); } } } }
87f83856f1c75de50c70ee228dff6c8c1a793e75
777a63014dbb07a4221e2b96ccf8e6525ea7511c
/hw6/lesson6/src/main/java/ru/itmo/wp/model/service/TalkService.java
6d9a02ac45c88c9097defed12e91ed7102aeb65f
[]
no_license
VankaTaganai/web_ITMO
97f314fcb08cddb102ba0320d91431e9048a4ae8
0fbfccd0e9a79d1eedea690dcbba6a2492638970
refs/heads/master
2023-06-23T01:23:48.928001
2021-07-17T16:21:47
2021-07-17T16:21:47
305,459,234
0
0
null
null
null
null
UTF-8
Java
false
false
1,443
java
package ru.itmo.wp.model.service; import ru.itmo.wp.model.domain.Talk; import ru.itmo.wp.model.exception.ValidationException; import ru.itmo.wp.model.repository.TalkRepository; import ru.itmo.wp.model.repository.UserRepository; import ru.itmo.wp.model.repository.impl.TalkRepositoryImpl; import ru.itmo.wp.model.repository.impl.UserRepositoryImpl; import java.util.List; public class TalkService { private final UserRepository userRepository = new UserRepositoryImpl(); private final TalkRepository talkRepository = new TalkRepositoryImpl(); public long getTargetUserId(String id) throws ValidationException { try { return Long.parseLong(id); } catch (NumberFormatException e) { throw new ValidationException("Wrong target user"); } } public void validateMessage(long targetUserId, String text) throws ValidationException { if (text == null || text.length() > 1000) { throw new ValidationException("Message can't be longer than 1000 symbols"); } if (userRepository.find(targetUserId) == null) { throw new ValidationException("Wrong target user"); } } public void saveTalk(long sourceUserId, long targetUserId, String text) { talkRepository.save(new Talk(sourceUserId, targetUserId, text)); } public List<Talk> findAllById(long id) { return talkRepository.findAllById(id); } }
3d64f39da8644941906379a4a74f45604c503c64
08cd37e588c627b3bfe70b88cd1f5c7d9c8ff768
/src/collections/ArrayListExample.java
a4098a9d40396f22273626fbf3133f82d0319598
[]
no_license
VenkyRoja/JavaBasics
9d965459a41a8df30fb1f53225460d90ba30aff5
ebb56d935516a30f14b2442290193f7912d1c1af
refs/heads/master
2023-05-12T00:45:17.952978
2021-06-04T04:43:27
2021-06-04T04:43:27
367,763,706
0
0
null
null
null
null
UTF-8
Java
false
false
2,399
java
package collections; import java.util.ArrayList; import java.util.Iterator; public class ArrayListExample { public static void main(String[] args) { System.out.println("\n=================================== Begin ===ArrayListExample========================\n"); ArrayList al = new ArrayList(); al.add(100); al.add(200); al.add(300); System.out.println("Size of the arraylist = " + al.size()); System.out.println(al.toString()); al.add(400); al.add(500); System.out.println("Size of the arraylist = " + al.size()); System.out.println(al.toString()); al.add("Raja"); al.add("Ram"); al.add(true); al.add(21.96); al.add('A'); al.add('X'); System.out.println("Size of the arraylist = " + al.size()); System.out.println(al.toString()); al.remove(10); System.out.println("Size of the arraylist = " + al.size()); System.out.println(al.toString()); System.out.println(al.get(4)); System.out.println(al.get(6)); System.out.println(al.get(7)); System.out.println(al.get(8)); System.out.println(al.get(9)); System.out.println("----------------using a counter in for loop"); for (int i=0; i < al.size(); i++) { System.out.println(al.get(i)); } System.out.println("----------------using iterator in a while loop"); Iterator it = al.iterator(); while (it.hasNext()) { System.out.println(it.next()); } System.out.println("----------------using object counter in a for loop"); for (Object x : al) { System.out.println(x.toString()); } System.out.println("----------------"); ArrayList<Integer> ali = new ArrayList<Integer>(); ali.add(12); ali.add(99); ali.add(1212); System.out.println("----------------using a counter in for loop"); for (int i=0; i < ali.size(); i++) { System.out.println(ali.get(i)); } System.out.println("----------------using iterator in a while loop"); Iterator<Integer> itx = ali.iterator(); while (itx.hasNext()) { System.out.println(itx.next()); } System.out.println("----------------using object counter in a for loop"); for (Integer x : ali) { System.out.println(x.toString()); } System.out.println("----------------"); System.out.println("\n=================================== End ===ArrayListExample========================\n"); } }
3267fae84adaf430b8888ea42f537bc4e100bfbd
108988e9a31a65e5d32ebd4e14ec01c489e9dd7e
/app/src/main/java/com/example/app_usuario/Controlador/Tiempo.java
c5267172198c70bfef96dbc1e00ee3d625a22c08
[]
no_license
Kacharpo/Kacharpo_App_usuario
8b15b728eb5121d841a0f00db64c523e6882c5ac
f8de0a921ad9f60721772429db5a7fafee42559d
refs/heads/master
2023-09-03T10:45:25.310246
2021-11-06T01:27:46
2021-11-06T01:27:46
381,622,794
0
1
null
2021-07-22T23:01:08
2021-06-30T08:04:02
Java
UTF-8
Java
false
false
2,032
java
package com.example.app_usuario.Controlador; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.fragment.app.Fragment; import com.example.app_usuario.R; /** * A simple {@link Fragment} subclass. * Use the {@link Tiempo#newInstance} factory method to * create an instance of this fragment. */ public class Tiempo extends Fragment { // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM2 = "param2"; // TODO: Rename and change types of parameters private String mParam1; private String mParam2; public Tiempo() { // Required empty public constructor } /** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param param1 Parameter 1. * @param param2 Parameter 2. * @return A new instance of fragment Tiempo. */ // TODO: Rename and change types and number of parameters public static Tiempo newInstance(String param1, String param2) { Tiempo fragment = new Tiempo(); Bundle args = new Bundle(); args.putString(ARG_PARAM1, param1); args.putString(ARG_PARAM2, param2); fragment.setArguments(args); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null) { mParam1 = getArguments().getString(ARG_PARAM1); mParam2 = getArguments().getString(ARG_PARAM2); } } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_tiempo, container, false); } }
50d0d00fbe7e55cef2df0dcbee630212debb1d2b
2dfca8eb925cbac03b08ba08494aac5eac960300
/example-v2/concurrent/src/main/java/cn/enjoyedu/ch2/forkjoin/sort/FkSort.java
fb387c1fa7174b7182b0dc34fce1705dca0178a1
[ "MIT" ]
permissive
ZuRun/xstudy
04b3a585dcd00cbda5898ac9733c7eda60f1cc50
6364d7f3c1a4a29ec2bea31632bbdd2c98e2f92e
refs/heads/master
2022-12-23T07:09:42.034813
2020-01-12T15:53:58
2020-01-12T15:53:58
143,006,462
1
0
MIT
2022-12-16T08:48:07
2018-07-31T11:41:15
Java
UTF-8
Java
false
false
1,610
java
package cn.enjoyedu.ch2.forkjoin.sort; import cn.enjoyedu.ch2.forkjoin.sum.MakeArray; import java.util.Arrays; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.RecursiveTask; /** * forkjoin实现的归并排序 */ public class FkSort { private static class SumTask extends RecursiveTask<int[]>{ private final static int THRESHOLD = 2; private int[] src; public SumTask(int[] src) { this.src = src; } @Override protected int[] compute() { if(src.length<=THRESHOLD){ return InsertionSort.sort(src); }else{ //fromIndex....mid.....toIndex int mid = src.length / 2; SumTask leftTask = new SumTask(Arrays.copyOfRange(src, 0, mid)); SumTask rightTask = new SumTask(Arrays.copyOfRange(src, mid, src.length)); invokeAll(leftTask,rightTask); int[] leftResult = leftTask.join(); int[] rightResult = rightTask.join(); return MergeSort.merge(leftResult,rightResult); } } } public static void main(String[] args) { ForkJoinPool pool = new ForkJoinPool(); int[] src = MakeArray.makeArray(); SumTask innerFind = new SumTask(src); long start = System.currentTimeMillis(); int[] invoke = pool.invoke(innerFind); // for(int number:invoke){ // System.out.println(number); // } System.out.println(" spend time:"+(System.currentTimeMillis()-start)+"ms"); } }
4e218fc8ab6cb51685182839276f64d474fe7c6c
be6924d696786e2e5a1186eb3464f5da742049f6
/src/main/java/ctf/pcap/EthernetFrame.java
796c876a44e1cb0dc305b10ce35a89414e557390
[]
no_license
plumsoup/ctf-tools
a47b80a8ffada2e083d8a299b653c90e45c0ef04
6cc1b7263c11ce487bf3ff79d1e24d929161e542
refs/heads/master
2023-04-30T04:14:56.857391
2021-05-19T02:00:24
2021-05-19T02:00:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,747
java
package ctf.pcap; // This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild import io.kaitai.struct.ByteBufferKaitaiStream; import io.kaitai.struct.KaitaiStream; import io.kaitai.struct.KaitaiStruct; import java.io.IOException; import java.util.HashMap; import java.util.Map; /** * Ethernet frame is a OSI data link layer (layer 2) protocol data unit * for Ethernet networks. In practice, many other networks and/or * in-file dumps adopted the same format for encapsulation purposes. * * @see <a href="https://ieeexplore.ieee.org/document/7428776">Source</a> */ public class EthernetFrame extends KaitaiStruct { private EtherTypeEnum etherType; private byte[] dstMac; private byte[] srcMac; private EtherTypeEnum etherType1; private TagControlInfo tci; private EtherTypeEnum etherType2; private Object body; private EthernetFrame _root; private KaitaiStruct _parent; private byte[] _raw_body; public EthernetFrame(KaitaiStream _io) { this(_io, null, null); } public EthernetFrame(KaitaiStream _io, KaitaiStruct _parent) { this(_io, _parent, null); } public EthernetFrame(KaitaiStream _io, KaitaiStruct _parent, EthernetFrame _root) { super(_io); this._parent = _parent; this._root = _root == null ? this : _root; _read(); } public static EthernetFrame fromFile(String fileName) throws IOException { return new EthernetFrame(new ByteBufferKaitaiStream(fileName)); } private void _read() { this.dstMac = this._io.readBytes(6); this.srcMac = this._io.readBytes(6); this.etherType1 = EtherTypeEnum.byId(this._io.readU2be()); if (etherType1() == EtherTypeEnum.IEEE_802_1Q_TPID) { this.tci = new TagControlInfo(this._io, this, _root); } if (etherType1() == EtherTypeEnum.IEEE_802_1Q_TPID) { this.etherType2 = EtherTypeEnum.byId(this._io.readU2be()); } switch (etherType()) { case IPV4: { this._raw_body = this._io.readBytesFull(); KaitaiStream _io__raw_body = new ByteBufferKaitaiStream(_raw_body); this.body = new Ipv4Packet(_io__raw_body); break; } case IPV6: { this._raw_body = this._io.readBytesFull(); KaitaiStream _io__raw_body = new ByteBufferKaitaiStream(_raw_body); this.body = new Ipv6Packet(_io__raw_body); break; } default: { this.body = this._io.readBytesFull(); break; } } } /** * Ether type can be specied in several places in the frame. If * first location bears special marker (0x8100), then it is not the * real ether frame yet, an additional payload (`tci`) is expected * and real ether type is upcoming next. */ public EtherTypeEnum etherType() { if (this.etherType != null) return this.etherType; this.etherType = (etherType1() == EtherTypeEnum.IEEE_802_1Q_TPID ? etherType2() : etherType1()); return this.etherType; } /** * Destination MAC address */ public byte[] dstMac() { return dstMac; } /** * Source MAC address */ public byte[] srcMac() { return srcMac; } /** * Either ether type or TPID if it is a IEEE 802.1Q frame */ public EtherTypeEnum etherType1() { return etherType1; } public TagControlInfo tci() { return tci; } public EtherTypeEnum etherType2() { return etherType2; } public Object body() { return body; } public EthernetFrame _root() { return _root; } public KaitaiStruct _parent() { return _parent; } public byte[] _raw_body() { return _raw_body; } public enum EtherTypeEnum { IPV4(2048), X_75_INTERNET(2049), NBS_INTERNET(2050), ECMA_INTERNET(2051), CHAOSNET(2052), X_25_LEVEL_3(2053), ARP(2054), IEEE_802_1Q_TPID(33024), IPV6(34525); private static final Map<Long, EtherTypeEnum> byId = new HashMap<Long, EtherTypeEnum>(9); static { for (EtherTypeEnum e : EtherTypeEnum.values()) byId.put(e.id(), e); } private final long id; EtherTypeEnum(long id) { this.id = id; } public static EtherTypeEnum byId(long id) { return byId.get(id); } public long id() { return id; } } /** * Tag Control Information (TCI) is an extension of IEEE 802.1Q to * support VLANs on normal IEEE 802.3 Ethernet network. */ public static class TagControlInfo extends KaitaiStruct { private long priority; private boolean dropEligible; private long vlanId; private EthernetFrame _root; private EthernetFrame _parent; public TagControlInfo(KaitaiStream _io) { this(_io, null, null); } public TagControlInfo(KaitaiStream _io, EthernetFrame _parent) { this(_io, _parent, null); } public TagControlInfo(KaitaiStream _io, EthernetFrame _parent, EthernetFrame _root) { super(_io); this._parent = _parent; this._root = _root; _read(); } public static TagControlInfo fromFile(String fileName) throws IOException { return new TagControlInfo(new ByteBufferKaitaiStream(fileName)); } private void _read() { this.priority = this._io.readBitsInt(3); this.dropEligible = this._io.readBitsInt(1) != 0; this.vlanId = this._io.readBitsInt(12); } /** * Priority Code Point (PCP) is used to specify priority for * different kinds of traffic. */ public long priority() { return priority; } /** * Drop Eligible Indicator (DEI) specifies if frame is eligible * to dropping while congestion is detected for certain classes * of traffic. */ public boolean dropEligible() { return dropEligible; } /** * VLAN Identifier (VID) specifies which VLAN this frame * belongs to. */ public long vlanId() { return vlanId; } public EthernetFrame _root() { return _root; } public EthernetFrame _parent() { return _parent; } } }
fe898a29cece1aee114642f37b4282c74be025b9
44e7adc9a1c5c0a1116097ac99c2a51692d4c986
/aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/transform/DeleteRobotResultJsonUnmarshaller.java
ba449a24905d159e36d45da4f0019ce9dee279eb
[ "Apache-2.0" ]
permissive
QiAnXinCodeSafe/aws-sdk-java
f93bc97c289984e41527ae5bba97bebd6554ddbe
8251e0a3d910da4f63f1b102b171a3abf212099e
refs/heads/master
2023-01-28T14:28:05.239019
2020-12-03T22:09:01
2020-12-03T22:09:01
318,460,751
1
0
Apache-2.0
2020-12-04T10:06:51
2020-12-04T09:05:03
null
UTF-8
Java
false
false
1,583
java
/* * Copyright 2015-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.robomaker.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.robomaker.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import static com.fasterxml.jackson.core.JsonToken.*; /** * DeleteRobotResult JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DeleteRobotResultJsonUnmarshaller implements Unmarshaller<DeleteRobotResult, JsonUnmarshallerContext> { public DeleteRobotResult unmarshall(JsonUnmarshallerContext context) throws Exception { DeleteRobotResult deleteRobotResult = new DeleteRobotResult(); return deleteRobotResult; } private static DeleteRobotResultJsonUnmarshaller instance; public static DeleteRobotResultJsonUnmarshaller getInstance() { if (instance == null) instance = new DeleteRobotResultJsonUnmarshaller(); return instance; } }
[ "" ]
5d516a667ddcca3a38b3a308acebacccfaf3c4ce
7bbcb14e3465c4f5829c391776793f808576754c
/spring/src/main/java/org/wrl/spring/demo/service/IGoodsService.java
50fd921d44ba0124e45077977b7b53fb5b02b762
[ "Apache-2.0" ]
permissive
wangruiling/samples
a85aa343e67f10d94a5f5bd83956d98701913f6a
4d11763cbbcf34a0651d9319164a72c166018eb3
refs/heads/master
2020-04-06T03:33:53.856469
2016-11-03T16:49:00
2016-11-03T16:49:00
37,109,431
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package org.wrl.spring.demo.service; import org.springframework.data.domain.Page; import org.wrl.spring.demo.model.GoodsModel; import org.wrl.spring.orm.commons.service.IBaseService; public interface IGoodsService extends IBaseService<GoodsModel, Integer> { int DEFAULT_PAGE_SIZE = 10; /**根据页码查询所有已发布的商品的分页对象*/ Page<GoodsModel> listAllPublished(int pn); }
7aa5d97b7a779cac6c1db0bb6fa4b7c36c19d9d6
0779936529a34ea265ead6f5c7c2e7886102d725
/proyecto web/aplicacionweb/src/java/Servlets/recibirpago.java
9fd5417fd47864230e1ad438bef92b99beffad79
[]
no_license
mtorreso/finales
3eed2b8a94e5b55e234b4c37006c250c96ad5a49
ceb603d8e019dbafaf01146b21646ae6a415d6d8
refs/heads/master
2023-05-10T18:22:21.797476
2019-12-13T02:27:20
2019-12-13T02:27:20
227,117,475
0
0
null
2023-05-04T21:16:05
2019-12-10T12:39:06
CSS
UTF-8
Java
false
false
2,734
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Servlets; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Manuel */ public class recibirpago extends HttpServlet { String recibir = "pago.jsp"; String index = "indexadmin.jsp"; String acceso = ""; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); request.setCharacterEncoding("UTF-8"); String accion = request.getParameter("accion"); if (accion.equals("recibir")) { acceso = recibir; request.setAttribute("id", request.getParameter("id")); request.setAttribute("id_reserva", request.getParameter("id_reserva")); request.setAttribute("rut", request.getParameter("rut")); } else { acceso = index; } RequestDispatcher dispatcher = request.getRequestDispatcher(acceso); dispatcher.forward(request, response); } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
14b672f1a8b65f86b641539a781cc16daa34f1a9
f11b4b09cf363d11c7f7df58cdc1f3d5329de335
/source/Back_linkedInRestfulProject/src/model/PendingRequestBean.java
c1eac78b3367111e6b534532d9570ab5a48cda69
[ "MIT" ]
permissive
MikeXydas/professionalNetworkingWebApp
0976c81ce48b6d29c77a98ff300234871730b06d
0aa4bc439b5e144e849ded88de1f86e3dcefea1b
refs/heads/master
2023-01-11T19:17:06.272448
2020-06-19T08:51:37
2020-06-19T08:51:37
158,578,873
0
0
MIT
2023-01-04T18:28:13
2018-11-21T16:45:04
Java
UTF-8
Java
false
false
1,020
java
package model; import java.util.Date; public class PendingRequestBean { private int userId; private int reqId; private String firstName; private String lastName; private PhotoBean photoBean; private Date sendTime; public int getReqId() { return reqId; } public void setReqId(int reqId) { this.reqId = reqId; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public PhotoBean getPhotoBean() { return photoBean; } public void setPhotoBean(PhotoBean photoBean) { this.photoBean = photoBean; } public Date getSendTime() { return sendTime; } public void setSendTime(Date sendTime) { this.sendTime = sendTime; } }
6b32f26a1170d5cac58a1d735ad540bc54d5683c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/15/15_3ab4ba6b811bd733bdfa3775fdbecde36688179e/ModuleMain/15_3ab4ba6b811bd733bdfa3775fdbecde36688179e_ModuleMain_s.java
4c4bf8a0138cda1537e844aaa48205470bbf919c
[]
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,551
java
package edu.teco.dnd.module; import io.netty.bootstrap.ChannelFactory; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.oio.OioEventLoopGroup; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.channel.socket.oio.OioDatagramChannel; import io.netty.util.internal.logging.InternalLoggerFactory; import java.io.IOException; import java.net.InetSocketAddress; import java.util.Arrays; import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import edu.teco.dnd.module.config.ConfigReader; import edu.teco.dnd.module.config.JsonConfig; import edu.teco.dnd.module.messages.infoReq.ModInfoReqMsgHandler; import edu.teco.dnd.module.messages.infoReq.ModInfoRequestMessage; import edu.teco.dnd.module.messages.startApp.StartAppMessage; import edu.teco.dnd.module.messages.startApp.StartAppMessageHandler; import edu.teco.dnd.network.PeerExchanger; import edu.teco.dnd.network.TCPConnectionManager; import edu.teco.dnd.network.UDPMulticastBeacon; import edu.teco.dnd.network.logging.Log4j2LoggerFactory; import edu.teco.dnd.network.messages.PeerMessage; import edu.teco.dnd.util.InetSocketAddressAdapter; import edu.teco.dnd.util.NetConnection; /** * The main class that is started on a Module. */ public class ModuleMain { /** * The logger for this class. */ private static final Logger LOGGER = LogManager.getLogger(ModuleMain.class); /** * Default path for config file. */ public static final String DEFAULT_CONFIG_PATH = "module.cfg"; public static void main(final String[] args) { String configPath = DEFAULT_CONFIG_PATH; if (args.length > 0) { LOGGER.debug("argument 0 is \"{}\"", args[0]); if (args[0].equals("--help") || args[0].equals("-h")) { System.out.println("Parameters: [--help| $pathToConfig]"); System.out.println("\t--help: print this message"); System.out.println("\t$pathToConfig the path to the used config file."); } else { configPath = args[0]; } } ConfigReader moduleConfig = null; try { moduleConfig = new JsonConfig(configPath); } catch (IOException e) { LOGGER.fatal("could not load config", e); System.exit(1); } InternalLoggerFactory.setDefaultFactory(new Log4j2LoggerFactory()); // TODO: add config options to allow selection of netty engine and number of application threads // TODO: name threads final NioEventLoopGroup networkEventLoopGroup = new NioEventLoopGroup(); final TCPConnectionManager connectionManager = new TCPConnectionManager(networkEventLoopGroup, networkEventLoopGroup, new ChannelFactory<NioServerSocketChannel>() { @Override public NioServerSocketChannel newChannel() { return new NioServerSocketChannel(); } }, new ChannelFactory<NioSocketChannel>() { @Override public NioSocketChannel newChannel() { return new NioSocketChannel(); } }, moduleConfig.getUuid()); for (final InetSocketAddress address : moduleConfig.getListen()) { connectionManager.startListening(address); } final UDPMulticastBeacon beacon = new UDPMulticastBeacon(new ChannelFactory<OioDatagramChannel>() { @Override public OioDatagramChannel newChannel() { return new OioDatagramChannel(); } }, new OioEventLoopGroup(), networkEventLoopGroup, moduleConfig.getUuid()); beacon.addListener(connectionManager); final List<InetSocketAddress> announce = Arrays.asList(moduleConfig.getAnnounce()); beacon.setAnnounceAddresses(announce); for (final NetConnection address : moduleConfig.getMulticast()) { beacon.addAddress(address.getInterface(), address.getAddress()); } connectionManager.addMessageType(PeerMessage.class); connectionManager.registerTypeAdapter(InetSocketAddress.class, new InetSocketAddressAdapter()); final PeerExchanger peerExchanger = new PeerExchanger(connectionManager); peerExchanger.addModule(moduleConfig.getUuid(), announce); ModuleApplicationManager appMan = new ModuleApplicationManager(moduleConfig.getMaxThreadsPerApp(), moduleConfig.getUuid(), moduleConfig, connectionManager); // /// register msg handlers /// connectionManager.addHandler(StartAppMessage.class, new StartAppMessageHandler(appMan)); connectionManager.addHandler(ModInfoRequestMessage.class, new ModInfoReqMsgHandler(moduleConfig, appMan)); } // TODO: add method for shutdown }
432d17b868a9e66a847e558c14ef68a40d9fb7d1
a840a5e110b71b728da5801f1f3e591f6128f30e
/src/main/java/com/google/security/zynamics/reil/translators/ppc/BdzflTranslator.java
38e2f3b484e521c2e38ee9e33c1410b08d35a458
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
tpltnt/binnavi
0a25d2fde2c6029aeef4fcfec8eead5c8e51f4b4
598c361d618b2ca964d8eb319a686846ecc43314
refs/heads/master
2022-10-20T19:38:30.080808
2022-07-20T13:01:37
2022-07-20T13:01:37
107,143,332
0
0
Apache-2.0
2023-08-20T11:22:53
2017-10-16T15:02:35
Java
UTF-8
Java
false
false
2,009
java
/* Copyright 2011-2016 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.google.security.zynamics.reil.translators.ppc; import com.google.security.zynamics.reil.ReilInstruction; import com.google.security.zynamics.reil.translators.IInstructionTranslator; import com.google.security.zynamics.reil.translators.ITranslationEnvironment; import com.google.security.zynamics.reil.translators.InternalTranslationException; import com.google.security.zynamics.reil.translators.TranslationHelpers; import com.google.security.zynamics.zylib.disassembly.IInstruction; import com.google.security.zynamics.zylib.disassembly.IOperandTreeNode; import java.util.List; public class BdzflTranslator implements IInstructionTranslator { @Override public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException { TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "bdzfl"); final IOperandTreeNode addressOperand = instruction.getOperands().get(1).getRootNode().getChildren().get(0); final IOperandTreeNode BIOperand = instruction.getOperands().get(0).getRootNode().getChildren().get(0); BranchGenerator.generate(instruction.getAddress().toLong() * 0x100, environment, instruction, instructions, "bdzfl", BIOperand.getValue(), addressOperand.getValue(), true, false, true, true, true, true); } }
63899b39cc8eabf95784a930697f326f4ae5fc9f
041a828a665fb33b3de571cb6beb9755b4cf7a39
/src/dao/OrderTicketDao.java
c5be57912ba7162572227e20a65534621c924314
[]
no_license
ningxinyu1522/ReservationSystem
f235cc166f1f5b86d28197e6d5cef7f2a7be3321
18a9f11f11b93604184c420e89b84fa06fd5b5b2
refs/heads/master
2020-11-23T20:42:31.664782
2019-10-09T09:19:55
2019-10-09T09:19:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,262
java
package dao; import java.sql.SQLException; import java.util.List; import entity.OrderTicket; /** * 订票信息Dao接口 * @author 我的袜子都是洞 * @date: 2019-01-18 */ public interface OrderTicketDao { /** * 创建订票信息 * @param orderTicket * @return 创建结果 */ boolean saveOrderTicket(OrderTicket orderTicket) throws SQLException; /** * 删除订票信息 * @param id * @return 删除结果 */ boolean delOrderTicket(int id) throws SQLException; /** * 更新订票信息 * @param orderTicket * @return 更新结果 */ boolean updateOrderTicket(OrderTicket orderTicket) throws SQLException; /** * 获得某个订票信息 * @param id * @return 订票信息对象 */ OrderTicket getOrderTicket(int id) throws SQLException; /** * * @param id * @return * @throws SQLException */ boolean isUseFlightID(int id, String username) throws SQLException; /** * 获得所有订票信息 * @return 订票信息对象数组 * @throws SQLException */ List<OrderTicket> listOrderTicket() throws SQLException; /** * 获取某用户的所有订单 * @param username * @return * @throws SQLException */ List<OrderTicket> listOrderTicket(String username) throws SQLException; }
eb306f85022d2f6bcb2159206bac718f37ecf152
81c64e616c34f74580980b4304eb50a573686343
/src/main/java/com/paleimitations/schoolsofmagic/common/items/TeacupItem.java
d8055ffff41cd352539f04c2c824f569eb1e02bd
[]
no_license
pale-imitations/schools_of_magic
33a1197f166f266420409a9f54e801d7a2a97aa1
487c7b2244329c68d2886a587f7034d1e8dcfa26
refs/heads/main
2023-09-02T10:57:47.017057
2021-11-17T04:57:49
2021-11-17T04:57:49
391,169,411
2
7
null
null
null
null
UTF-8
Java
false
false
6,768
java
package com.paleimitations.schoolsofmagic.common.items; import com.paleimitations.schoolsofmagic.References; import com.paleimitations.schoolsofmagic.common.TeaBrewResult; import com.paleimitations.schoolsofmagic.common.data.TeaUtils; import com.paleimitations.schoolsofmagic.common.quests.Quest; import com.paleimitations.schoolsofmagic.common.registries.ItemRegistry; import com.paleimitations.schoolsofmagic.common.registries.QuestRegistry; import com.paleimitations.schoolsofmagic.common.registries.TeaRegistry; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.*; import net.minecraft.nbt.CompoundNBT; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.PotionUtils; import net.minecraft.potion.Potions; import net.minecraft.stats.Stats; import net.minecraft.util.ActionResult; import net.minecraft.util.DrinkHelper; import net.minecraft.util.Hand; import net.minecraft.util.NonNullList; import net.minecraft.util.text.IFormattableTextComponent; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import javax.annotation.Nullable; import java.util.List; import java.util.Random; public class TeacupItem extends Item { public final boolean filled; public final Item drinkResult; public TeacupItem(Properties props, boolean filled, Item drinkResult) { super(props); this.filled = filled; this.drinkResult = drinkResult; } @OnlyIn(Dist.CLIENT) public void appendHoverText(ItemStack stack, @Nullable World world, List<ITextComponent> list, ITooltipFlag tooltipFlag) { if(filled) { TeaBrewResult brew = TeaUtils.getTea(stack); if(brew!=null && !brew.isMilk && brew.successful) { if (Screen.hasShiftDown()) TeaUtils.addTooltip(stack, list, 1.0F); else list.add(new TranslationTextComponent(References.MODID + ".hold_shift").withStyle(TextFormatting.GRAY).withStyle(TextFormatting.ITALIC)); } } else { super.appendHoverText(stack, world, list, tooltipFlag); } } public String getDescriptionId(ItemStack stack) { return filled? TeaUtils.getName(stack, "item.schoolsofmagic.filled_teacup") : super.getDescriptionId(stack); } public void fillItemCategory(ItemGroup group, NonNullList<ItemStack> items) { if (this == ItemRegistry.FILLED_WHITE_TERRACOTTA_TEACUP.get()) { if (this.allowdedIn(group)) { for(TeaRegistry.Tea tea : TeaRegistry.TEAS) { ItemStack stack = new ItemStack(this); TeaUtils.setTea(stack, tea, tea, tea, false); items.add(stack); } } } else if (this.allowdedIn(group)) { items.add(new ItemStack(this)); } } public ItemStack finishUsingItem(ItemStack stack, World world, LivingEntity living) { PlayerEntity playerentity = living instanceof PlayerEntity ? (PlayerEntity)living : null; if (playerentity instanceof ServerPlayerEntity) { CriteriaTriggers.CONSUME_ITEM.trigger((ServerPlayerEntity)playerentity, stack); } if (!world.isClientSide) { TeaBrewResult brew = TeaUtils.getTea(stack); Random rand = living.getRandom(); if(brew.successful) { if (brew.isMilk) { living.curePotionEffects(new ItemStack(Items.MILK_BUCKET)); } else { if (!brew.tier1Pool.isEmpty()) { EffectInstance effectinstance = brew.tier1Pool.get(rand.nextInt(brew.tier1Pool.size())); if (effectinstance.getEffect().isInstantenous()) { effectinstance.getEffect().applyInstantenousEffect(playerentity, playerentity, living, effectinstance.getAmplifier(), 1.0D); } else { living.addEffect(new EffectInstance(effectinstance)); } } if (!brew.tier2Pool.isEmpty()) { EffectInstance effectinstance = brew.tier2Pool.get(rand.nextInt(brew.tier2Pool.size())); if (effectinstance.getEffect().isInstantenous()) { effectinstance.getEffect().applyInstantenousEffect(playerentity, playerentity, living, effectinstance.getAmplifier(), 1.0D); } else { living.addEffect(new EffectInstance(effectinstance)); } } if (!brew.tier3Pool.isEmpty()) { EffectInstance effectinstance = brew.tier3Pool.get(rand.nextInt(brew.tier3Pool.size())); if (effectinstance.getEffect().isInstantenous()) { effectinstance.getEffect().applyInstantenousEffect(playerentity, playerentity, living, effectinstance.getAmplifier(), 1.0D); } else { living.addEffect(new EffectInstance(effectinstance)); } } } } } if (playerentity != null) { playerentity.awardStat(Stats.ITEM_USED.get(this)); if (!playerentity.abilities.instabuild) { stack.shrink(1); } } if (playerentity == null || !playerentity.abilities.instabuild) { if (stack.isEmpty()) { return new ItemStack(drinkResult); } if (playerentity != null) { playerentity.inventory.add(new ItemStack(drinkResult)); } } return stack; } public int getUseDuration(ItemStack stack) { return filled? 32 : 0; } public UseAction getUseAnimation(ItemStack stack) { return filled? UseAction.DRINK : UseAction.NONE; } public ActionResult<ItemStack> use(World world, PlayerEntity player, Hand hand) { return filled? DrinkHelper.useDrink(world, player, hand) : ActionResult.pass(player.getItemInHand(hand)); } }
c4e385b4cbe042e4889e56f26c0d3141c4a0014b
5d7344d2172358227eaf4b53e9a649c0ac71c38e
/demo/src/main/java/com/kaiba/demo/ebean/OrderAggregate.java
fca81aea4e03778da17a312d71d56f3dbfc9e04d
[]
no_license
kaibagit/practice
b553388c5501207f69956ea285203e30e1b8f966
a1f0b7fa55d174f93f1a30e219132eedfd315ff3
refs/heads/master
2023-01-12T17:00:47.032342
2022-05-18T02:46:29
2022-05-18T02:46:29
64,130,715
0
0
null
2022-12-27T14:47:22
2016-07-25T11:59:12
Java
UTF-8
Java
false
false
105
java
package com.kaiba.demo.ebean; /** * Created by kaiba on 2016/9/17. */ public class OrderAggregate { }
29bb44610a816e5d1427139adcbd6f071094842f
c1d23fc2e2001c5c9a102cb5bde64059e4d33f50
/src/test/java/com/yaw/eshop/cucumber/stepdefs/StepDefs.java
2838b25a819131c806abe14ebc9be3c814231e59
[]
no_license
Yamachar/e-shop-application
581557f8e2e9ad9ab07b35aca4a6b7ee721aa874
dc5562b10fd97a6be9895effc5f82e1a7dca58dc
refs/heads/master
2022-12-23T21:50:15.431079
2020-09-28T10:43:38
2020-09-28T10:43:38
299,071,585
0
0
null
null
null
null
UTF-8
Java
false
false
174
java
package com.yaw.eshop.cucumber.stepdefs; import org.springframework.test.web.servlet.ResultActions; public abstract class StepDefs { protected ResultActions actions; }
6774bb70a2b025b37566c6f32b32a5f800431e30
75ef3f240f801a0dfd4f1a080749b15e8732b5e9
/src/test/java/com/tw/apistackbase/controller/PackageControllerTest.java
ca20f95de11035d154fee04fa38ec03bb0a8d7f6
[]
no_license
jed1337/MiniPackageBackEnd
075429d0b2a0e07e2bc60d58541a38feac17a487
48ba58b05ea3a1016e33107327a7909ae4137823
refs/heads/master
2020-08-26T23:54:52.530284
2019-10-24T04:23:44
2019-10-24T04:23:44
217,186,741
0
0
null
null
null
null
UTF-8
Java
false
false
3,419
java
package com.tw.apistackbase.controller; import com.fasterxml.jackson.databind.ObjectMapper; import com.tw.apistackbase.entity.Package; import com.tw.apistackbase.services.PackageService; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import java.util.Arrays; import java.util.List; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @ExtendWith(SpringExtension.class) @WebMvcTest(PackageController.class) @ActiveProfiles(profiles = "test") public class PackageControllerTest { @Autowired private MockMvc mvc; @MockBean private PackageService packageService; @Autowired private ObjectMapper objectMapper; @Test public void should_findAllPackages() throws Exception { List<Package> packageList = Arrays.asList( new Package(1), new Package(2) ); when(packageService.findAllPackages()).thenReturn(packageList); ResultActions result = mvc.perform(get("/packages/")); result.andExpect(status().isOk()) .andDo(print()) .andExpect(jsonPath("$", hasSize(2))) .andExpect(jsonPath("$[0].packageNumber", is(1))) .andExpect(jsonPath("$[1].packageNumber", is(2))); } @Test public void should_getSinglePackage() throws Exception { Package newPackage = new Package(1); newPackage.setPhoneNumber("12"); when(packageService.findById(1)).thenReturn(newPackage); ResultActions result = mvc.perform(get("/packages/1")); result.andExpect(status().isOk()) .andDo(print()) .andExpect(jsonPath("$.packageNumber", is(1))) .andExpect(jsonPath("$.phoneNumber", is("12"))); } @Test public void should_post_newPackage() throws Exception { Package newPackage = new Package(1); newPackage.setPhoneNumber("12"); when(packageService.postNewPackage(newPackage)).thenReturn(newPackage); ResultActions result = mvc.perform(post("/packages/") .contentType(MediaType.APPLICATION_JSON) .content(objectMapper.writeValueAsString(newPackage)) ); result.andExpect(status().isCreated()) .andDo(print()) .andExpect(jsonPath("$.packageNumber", is(1))) .andExpect(jsonPath("$.phoneNumber", is("12"))); } }
eda1d4a5fc7aecb9609ede90069d60e93291700b
4da9097315831c8639a8491e881ec97fdf74c603
/src/StockIT-v1-release_source_from_JADX/sources/com/google/android/gms/internal/ads/zzame.java
1ea87582b5f2e5b9f72d80e7a42f00373a87732c
[ "Apache-2.0" ]
permissive
atul-vyshnav/2021_IBM_Code_Challenge_StockIT
5c3c11af285cf6f032b7c207e457f4c9a5b0c7e1
25c26a4cc59a3f3e575f617b59acc202ee6ee48a
refs/heads/main
2023-08-11T06:17:05.659651
2021-10-01T08:48:06
2021-10-01T08:48:06
410,595,708
1
1
null
null
null
null
UTF-8
Java
false
false
363
java
package com.google.android.gms.internal.ads; /* compiled from: com.google.android.gms:play-services-ads@@19.4.0 */ final class zzame implements zzbad<zzaki> { zzame() { } public final /* synthetic */ void zzh(Object obj) { zzaki zzaki = (zzaki) obj; zzaki.zza("/log", zzagx.zzdey); zzaki.zza("/result", zzagx.zzdfg); } }
8c7e2ad022c9a129d9772586f4613b5d684e899b
0ac6bef87c29954a14ed6c401bd9ac017b92bcb7
/app/src/main/java/com/acktos/playcoffe/models/QueueTrack.java
59f4acc07aef7dd8a6fd7dd2890e68d47fb1f17f
[]
no_license
cyberosc/RockAndPlay
55a155da64ba7022328d336d56bf7f33861a2345
412b85ca9b8fac96adc213c08bf21f0328e5051e
refs/heads/master
2021-01-10T12:41:18.201118
2016-04-23T03:23:38
2016-04-23T03:23:38
43,472,708
0
0
null
null
null
null
UTF-8
Java
false
false
3,359
java
package com.acktos.playcoffe.models; /** * Created by Acktos on 9/30/15. */ @Deprecated public class QueueTrack { private String id; private String trackId; private String state; private String order; private String trackName; private String artistName; private String duration; private String thumbAlbum; private String userId; private String userName; public static final String KEY_TRACK_ID="trackId"; public static final String KEY_STATE="state"; public static final String KEY_ORDER="order"; public static final String KEY_TRACK_NAME="trackName"; public static final String KEY_ARTIST_NAME="artistName"; public static final String KEY_DURATION="duration"; public static final String KEY_THUMB_ALBUM="thumbAlbum"; public static final String KEY_USER_ID="userId"; public static final String KEY_USERNAME="userName"; public QueueTrack( String trackId, String trackName, String artistName, String duration, String thumbAlbum, String userId, String userName) { //this.id = id; this.trackId = trackId; this.trackName = trackName; this.artistName = artistName; this.duration = duration; this.thumbAlbum = thumbAlbum; this.userId = userId; this.userName = userName; } public QueueTrack( String id,String trackId, String state, String order, String trackName, String artistName, String duration, String thumbAlbum, String userId, String userName) { this.id=id; this.trackId=trackId; this.state = state; this.order = order; this.trackName = trackName; this.artistName = artistName; this.duration = duration; this.thumbAlbum = thumbAlbum; this.userId = userId; this.userName = userName; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getTrackId() { return trackId; } public void setTrackId(String trackId) { this.trackId = trackId; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getOrder() { return order; } public void setOrder(String order) { this.order = order; } public String getTrackName() { return trackName; } public void setTrackName(String trackName) { this.trackName = trackName; } public String getArtistName() { return artistName; } public void setArtistName(String artistName) { this.artistName = artistName; } public String getDuration() { return duration; } public void setDuration(String duration) { this.duration = duration; } public String getThumbAlbum() { return thumbAlbum; } public void setThumbAlbum(String thumbAlbum) { this.thumbAlbum = thumbAlbum; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } }
df37117ef6f368b898ec43dc14cba223b4dc19ad
1f0f245105175cc46a2641a5f34e869d8488c18d
/app/src/main/java/com/esgi/project/underdico/presenters/LoginPresenter.java
8817598574a0306fe946bf430570e1b34cbac82e
[]
no_license
csgrdcelia/underdico-android
d8c01bc8f301706511b84dede7ef631e8b460a3e
bb0fda1c11143dcfa936d30f9d833ea5c61e0966
refs/heads/master
2020-05-10T00:19:29.281845
2019-10-25T11:26:41
2019-10-25T11:26:41
181,526,178
0
0
null
null
null
null
UTF-8
Java
false
false
2,609
java
package com.esgi.project.underdico.presenters; import android.content.Context; import android.text.TextUtils; import android.util.Log; import com.esgi.project.underdico.R; import com.esgi.project.underdico.models.Token; import com.esgi.project.underdico.services.UserService; import com.esgi.project.underdico.utils.ApiInstance; import com.esgi.project.underdico.utils.Constants; import com.esgi.project.underdico.utils.Session; import com.esgi.project.underdico.views.login.LoginView; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class LoginPresenter { LoginView view; Context context; public LoginPresenter(LoginView view, Context context) { this.view = view; this.context = context; initialize(); } private void initialize() { view.assignViews(); view.setListeners(); } /*private void checkIfLogged() { Token token = Session.getFromSharedPref(context); if(token != null && token.isValid()) { Session.setCurrentToken(token); Session.callUserInformation(context, view); } }*/ public void handleLogin(String username, String password) { if(TextUtils.isEmpty(username) || TextUtils.isEmpty(password)) { view.askUserToFillFields(); } else { tryLogin(username, password); } } private void tryLogin(String username, String password) { view.showProgress(true); UserService service = ApiInstance.getRetrofitInstance(context).create(UserService.class); Call<Token> call = service.login(username, password); call.enqueue(new Callback<Token>() { @Override public void onResponse(Call<Token> call, Response<Token> response) { view.showProgress(false); if (response.isSuccessful()) { Session.setCurrentToken(response.body()); Session.saveToSharedPrefs(context); Session.callUserInformation(context, view); } else { view.showToast(context.getString(R.string.login_fail)); } } @Override public void onFailure(Call<Token> call, Throwable t) { Log.e(Constants.NETWORK_ERROR, "\nCause: " + t.getCause() + "\nMessage: " + t.getMessage() + "\nLocalized Message: " + t.getLocalizedMessage()); view.showProgress(false); view.showToast(context.getString(R.string.error_network)); } }); } }
052de1ee6d2adc2b2b89cdf8e1756c3f5ed497e5
24397b7a79ed4f21fe374520f89f747577d42c7b
/app/src/main/java/com/lenovo/bount/newsquarter/activitybao/SousuoActivity.java
a2b2af137352a87f4f0e86e30f03a702f83230e4
[]
no_license
Bount0000/Newsquarter2
b6e06d730a4004b0edb7733b94b64feadc794bc3
5f4bbc5a758e8beae4f48ee2c630465521c6b7da
refs/heads/master
2021-05-06T21:44:10.449938
2017-12-20T00:46:22
2017-12-20T00:46:22
112,676,555
0
0
null
null
null
null
UTF-8
Java
false
false
4,230
java
package com.lenovo.bount.newsquarter.activitybao; import android.support.v7.widget.LinearLayoutManager; import android.view.View; import android.widget.EditText; import android.widget.ImageView; import android.widget.RelativeLayout; import com.jcodecraeer.xrecyclerview.XRecyclerView; import com.lenovo.bount.newsquarter.R; import com.lenovo.bount.newsquarter.adapter.RandomSousuoAdapter; import com.lenovo.bount.newsquarter.base.BaseActivity; import com.lenovo.bount.newsquarter.base.BasePresenter; import com.lenovo.bount.newsquarter.bean.RandomFriendsBean; import com.lenovo.bount.newsquarter.bean.SearchBean; import com.lenovo.bount.newsquarter.presenter.RandomFavoritePresenter; import com.lenovo.bount.newsquarter.presenter.SearchFriendsPresenter; import com.lenovo.bount.newsquarter.view.RandomFavoriteView; import com.lenovo.bount.newsquarter.view.SearchFriendsView; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import scut.carson_ho.searchview.ICallBack; import scut.carson_ho.searchview.SearchView; import scut.carson_ho.searchview.bCallBack; public class SousuoActivity extends BaseActivity implements SearchFriendsView, RandomFavoriteView { @BindView(R.id.back) ImageView back; @BindView(R.id.rt_1) RelativeLayout rt1; @BindView(R.id.soussuo) ImageView soussuo; @BindView(R.id.et_content) EditText etContent; @BindView(R.id.rt_2) RelativeLayout rt2; @BindView(R.id.sousuo_xrv) XRecyclerView sousuoXrv; @BindView(R.id.search_view) SearchView searchView; @BindView(R.id.randomsousuo_xrv) XRecyclerView randomsousuoXrv; private int page = 1; private SearchFriendsPresenter presenter; private RandomFavoritePresenter randomFavoritePresenter; @Override public int bindLayout() { return R.layout.activity_sousuo; } @Override public void setLister() { soussuo.setOnClickListener(this); } @Override public void Click(View view) { switch (view.getId()) { case R.id.search_view: break; } } @Override public void initView() { setshowActionBar(false); ButterKnife.bind(this); } @Override public void initDate() { presenter = new SearchFriendsPresenter(this); randomFavoritePresenter = new RandomFavoritePresenter(this); randomFavoritePresenter.getRandomFavorite(); searchView.setOnClickSearch(new ICallBack() { @Override public void SearchAciton(String string) { presenter.getSearch(string, page); } }); searchView.setOnClickBack(new bCallBack() { @Override public void BackAciton() { finish(); } }); } @Override public List<BasePresenter> initPresenter() { List<BasePresenter> list = new ArrayList<>(); list.add(presenter); list.add(randomFavoritePresenter); return list; } @Override public void SearchSuccess(SearchBean value) { List<SearchBean.DataBean> data = value.data; showToast(value.msg); /* SousuoAdapter adapter = new SousuoAdapter(this, data); LinearLayoutManager manager = new LinearLayoutManager(this); sousuoXrv.setLayoutManager(manager); sousuoXrv.setAdapter(adapter);*/ } @Override public void SearchError(String msg) { showToast(msg); } @Override public void SearchonFair(String msg) { showToast(msg); } @Override public void RandomFavoriteSucces(RandomFriendsBean bean) { showToast(bean.msg); List<RandomFriendsBean.DataBean> data = bean.data; LinearLayoutManager manager2 = new LinearLayoutManager(this); RandomSousuoAdapter adapter2 = new RandomSousuoAdapter(this, data); randomsousuoXrv.setLayoutManager(manager2); randomsousuoXrv.setAdapter(adapter2); } @Override public void RandomFavoriteError(String msg) { showToast(msg); } @Override public void RandomFavoriteOnFair(String msg) { showToast(msg); } }
1d404b15fa35d7457b04bc87ce8f1a8f18cdc684
5f72126be979bb6f852353eb2b7b07c3f437d8ec
/Week4/ThaoXD/TamGiac.java
7e5d117b9d3c1def1dcdef29a0d7e7126b56d63e
[]
no_license
HanuCodee/PPL_Fall2018
e120c3088ef35c7ddbd82968d2efe10175f100f4
800a3fe416cfccd09ca17bc30cdaa22750c72429
refs/heads/master
2020-03-27T01:36:18.415983
2018-10-03T09:30:38
2018-10-03T09:30:38
145,726,743
1
0
null
null
null
null
UTF-8
Java
false
false
2,101
java
package PPL_Fall2018.Week4.ThaoXD; import java.util.Scanner; public class TamGiac { private int a; private int b; private int c; public static void main(String[] args) { TamGiac tg = new TamGiac(); Scanner sc = new Scanner(System.in); System.out.print("Nhap a: "); tg.a = sc.nextInt(); System.out.print("Nhap b: "); tg.b = sc.nextInt(); System.out.print("Nhap c: "); tg.c = sc.nextInt(); boolean check = tg.laTamGiac(); if (check == true) { System.out.println("La tam giac"); System.out.println("P = " + tg.getChuVi()); System.out.println("S = " + tg.getDienTich()); } else { System.out.println("Khong la tam giac"); } } public TamGiac() { } public TamGiac(int a, int b, int c) { this.a = a; this.b = b; this.c = c; } public int getCanhA() { return a; } public void setCanhA(int v) { if (validateA(a)) { this.a = v; } } public int getCanhB() { return b; } public void setCanhB(int v) { if (validateB(b)) { this.b = v; } } public int getCanhC() { return c; } public void setCanhC(int v) { if (validateC(c)) { this.c = v; } } public boolean laTamGiac() { if (a + b > c && a + c > b && c + b > a) { // System.out.println("La tam giac"); return true; } else { // System.out.println("Khong phai tam giac"); return false; } } public boolean laTamGiac(int a, int b, int c) { if (a + b > c || a + c > b || c + b > a) { return true; } else { return false; } } private boolean validateA(int a) { if (a <= 0) { System.out.println("Invalid value"); return false; } else { return true; } } private boolean validateB(int b) { if (b <= 0) { System.out.println("Invalid value"); return false; } else { return true; } } private boolean validateC(int c) { if (c <= 0) { System.out.println("Invalid value"); return false; } else { return true; } } public double getChuVi() { return a + b + c; } public double getDienTich() { return (int) Math.sqrt((a + b + c) * (a + b - c) * (b + c - a) * (c + a - b)) / 4; } }
d3c884605d1d6386d28d726be4e0738645fbb9d3
967df5d63c9889ad63329c532d7e0ed2c2be2a62
/app/src/androidTest/java/com/nbs/mvpsample/di/modules/PreferenceTestModule.java
6c94f45fbb86075187265d30fcfca1eafda63cdc
[]
no_license
kazwert/mvp-android
8ccfd7a0fba5d6206ec3154542d0943e82130db4
3b63e7ce8a5024aade387a3dbd4299553466893a
refs/heads/master
2021-01-19T17:38:15.040280
2017-04-16T17:50:48
2017-04-16T17:50:48
88,337,928
0
0
null
null
null
null
UTF-8
Java
false
false
690
java
package com.nbs.mvpsample.di.modules; import com.nbs.mvpsample.data.preference.IPreferenceManager; import com.nbs.mvpsample.data.preference.PreferenceManager; import com.nbs.mvpsample.di.PreferenceInfo; import com.nbs.mvpsample.utils.AppConstants; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; /** * Created by ghiyatshanif on 2/8/17. */ @Module public class PreferenceTestModule { @PreferenceInfo @Provides String providePrefname() { return AppConstants.PREF_NAME; } @Singleton @Provides IPreferenceManager providePreferenceManager(PreferenceManager preferenceManager) { return preferenceManager; } }
c6d6fb3edb4b9b637baf3e364873d51c8f7e0ede
b55a2c5613086dd9e08d6eb2943ccaed71f6003c
/src/main/java/hyh/auth/dao/impl/UserInfoDao.java
8e0dcd0dc7acd3255836b10d9ff3801ef66a2794
[]
no_license
nixidexiangjiao/hyhtestspring
ae0283b5b5b75f7564424fabd081a6bc3f0cd49e
a404d3565a8ee71f4a18cce1095d9acb6d2991e9
refs/heads/master
2022-06-02T02:44:21.350253
2014-10-16T06:11:53
2014-10-16T06:11:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
248
java
package hyh.auth.dao.impl; import org.springframework.stereotype.Repository; import hyh.auth.dao.IUserInfoDao; import hyh.auth.model.UserInfo; @Repository public class UserInfoDao extends BaseDao<UserInfo> implements IUserInfoDao{ }
0ca485fbc111c339f9a832f0abb3888cb801dd57
e553651cca6ec696d13c7a7c367818eea3e7e9f2
/housemart-server/src/main/java/org/housemart/server/dao/entities/AreaPositionEntity.java
ade58957dbe4c3f3687f67ef77642ee80f2efd10
[]
no_license
qinpeng/housemart-server
f4af0a4eb653961fc42cddf6270ad6c5283a3e84
f56eb3394910dc8d52762e87f3c9bd42232876e5
refs/heads/master
2020-04-05T18:33:11.274878
2014-05-28T13:14:20
2014-05-28T13:14:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,486
java
/** * Created on 2013-2-24 * */ package org.housemart.server.dao.entities; import java.util.Date; import org.housemart.server.util.CommonUtils; /** * * @ClassName: AreaPositionEntity * @Description: TODO * @date 2013-4-16 上午10:52:22 * */ public class AreaPositionEntity { private int id; private int cityId; private int type; private int positionId; private String lat = ""; private String lng = ""; private Date addTime = CommonUtils.getDefaultDate(); private Date updateTime = CommonUtils.getDefaultDate(); public int getId() { return id; } public void setId(int id) { this.id = id; } public int getCityId() { return cityId; } public void setCityId(int cityId) { this.cityId = cityId; } public int getType() { return type; } public void setType(int type) { this.type = type; } public int getPositionId() { return positionId; } public void setPositionId(int positionId) { this.positionId = positionId; } public String getLat() { return lat; } public void setLat(String lat) { this.lat = lat; } public String getLng() { return lng; } public void setLng(String lng) { this.lng = lng; } public Date getAddTime() { return addTime; } public void setAddTime(Date addTime) { this.addTime = addTime; } public Date getUpdateTime() { return updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } }
ce8886552a18dcc953c54833a89ba183ceb6bf40
58e28ac435667a5bf8712212484ffdb4f349dd7b
/flyway-core/src/main/java/org/flywaydb/core/internal/database/sqlite/SQLiteDatabase.java
7825ba4b3e82e0fc8c72cc4d0257e7f3c93dd209
[ "Apache-2.0" ]
permissive
Diffblue-benchmarks/Flyway-flyway
8f13529c82cf8abc3e6488b75d86efc04e8a1a95
5d026a1455e78dacc3f3b70bc9f7d5693f2f4805
refs/heads/master
2020-04-08T22:56:17.542038
2018-11-29T16:36:32
2018-11-29T16:36:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,289
java
/* * Copyright 2010-2018 Boxfuse GmbH * * 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.flywaydb.core.internal.database.sqlite; import org.flywaydb.core.api.configuration.Configuration; import org.flywaydb.core.internal.database.base.Database; import org.flywaydb.core.internal.placeholder.PlaceholderReplacer; import org.flywaydb.core.internal.resource.ResourceProvider; import org.flywaydb.core.internal.sqlscript.AbstractSqlStatementBuilderFactory; import org.flywaydb.core.internal.sqlscript.SqlStatementBuilder; import org.flywaydb.core.internal.sqlscript.SqlStatementBuilderFactory; import java.sql.Connection; /** * SQLite database. */ public class SQLiteDatabase extends Database<SQLiteConnection> { /** * Creates a new instance. * * @param configuration The Flyway configuration. * @param connection The connection to use. */ public SQLiteDatabase(Configuration configuration, Connection connection, boolean originalAutoCommit ) { super(configuration, connection, originalAutoCommit ); } @Override protected SQLiteConnection getConnection(Connection connection ) { return new SQLiteConnection(configuration, this, connection, originalAutoCommit ); } @Override public final void ensureSupported() { ensureDatabaseIsRecentEnough("3.7.2"); } @Override protected SqlStatementBuilderFactory createSqlStatementBuilderFactory(PlaceholderReplacer placeholderReplacer ) { return new SQLiteSqlStatementBuilderFactory(placeholderReplacer); } public String getDbName() { return "sqlite"; } @Override protected String doGetCurrentUser() { return ""; } @Override public boolean supportsDdlTransactions() { return true; } @Override public boolean supportsChangingCurrentSchema() { return false; } @Override public String getBooleanTrue() { return "1"; } @Override public String getBooleanFalse() { return "0"; } @Override public String doQuote(String identifier) { return "\"" + identifier + "\""; } @Override public boolean catalogIsSchema() { return true; } @Override public boolean useSingleConnection() { return true; } private static class SQLiteSqlStatementBuilderFactory extends AbstractSqlStatementBuilderFactory { SQLiteSqlStatementBuilderFactory(PlaceholderReplacer placeholderReplacer) { super(placeholderReplacer); } @Override public SqlStatementBuilder createSqlStatementBuilder() { return new SQLiteSqlStatementBuilder(); } } }
b0a6da8cdd5afc290554169da62d4c6d2679595e
ce677f6bba2c19053f1ba6a8b5c790fb45592370
/SpringUserManagement-1/src/main/java/com/lti/dao/UserDaoImpl.java
0b781a5dcdcb2cae16997fa68c355f7d8f9b5c2f
[]
no_license
anerishah1997/Spring_Day3
c9059b1c9e166cd433f9ea1682fb66d8130c5a09
ba4afdae3190f582d9905c4fdc75bb4e60433958
refs/heads/master
2022-12-26T09:37:53.928339
2019-11-14T04:19:33
2019-11-14T04:19:33
221,462,355
0
0
null
2022-12-15T23:38:54
2019-11-13T13:11:24
Java
UTF-8
Java
false
false
2,031
java
package com.lti.dao; import java.util.List; import org.springframework.jdbc.core.JdbcTemplate; import com.lti.model.Users; public class UserDaoImpl implements UserDao { private JdbcTemplate template; public UserDaoImpl(JdbcTemplate template) { this.template = template; } public JdbcTemplate getTemplate() { return template; } public void setTemplate(JdbcTemplate template) { this.template = template; } private static final String READ_LOGIN = "Select * from Users where username=? and password=?"; private static final String INSERT_USER = "Insert into Users(Username,firstname,lastname,mobilenumber,password) values(?,?,?,?,?)"; private static final String UPDATE_USER = "Update Users set firstname=?, lastname=?, mobilenumber=? where username=?"; private static final String DELETE_USER= "Delete from Users where username=?"; private static final String SELECT_ALL_USERS="Select * from Users"; public int readLogin(String username, String password){ // for select queries with parameters. List<Users> list = template.query(READ_LOGIN, new Object[]{username,password} /*object array*/, new EmployeeRowMapper()); return list!=null?list.size():0; } public int createUser(Users user){ int result = template.update(INSERT_USER,user.getUsername(),user.getFirstname(),user.getLastname(),user.getMobilenumber(),user.getPassword()); return result; } public List<Users> readAllUsers(){ List<Users> list = template.query(SELECT_ALL_USERS, new EmployeeRowMapper()); return list; } public Users updateUser(Users user) { int result = template.update(UPDATE_USER,user.getFirstname(),user.getLastname(),user.getMobilenumber(),user.getUsername()); if(result == 1) return user; else return null; } public int deleteUser(String username){ int result = template.update(DELETE_USER,username); return result; } }
edea2db7a587f1bd43311bb06d6cb97838b4c54e
b4c47b649e6e8b5fc48eed12fbfebeead32abc08
/android/app/OnActivityPausedListener.java
bec5a37efb9ee6e78f6515c8f4bfe01ed61d9a4c
[]
no_license
neetavarkala/miui_framework_clover
300a2b435330b928ac96714ca9efab507ef01533
2670fd5d0ddb62f5e537f3e89648d86d946bd6bc
refs/heads/master
2022-01-16T09:24:02.202222
2018-09-01T13:39:50
2018-09-01T13:39:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
360
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) package android.app; // Referenced classes of package android.app: // Activity public interface OnActivityPausedListener { public abstract void onPaused(Activity activity); }
9dcc4afb6adc384e0cfac4305c6ce0b142f4d34b
f395929643ec5613c62807f06155da96263d668b
/android/WeexSDK/src/main/java/com/taobao/weex/dom/WXDomModule.java
df2d9028253165338e4386a88440dd5eef042dc0
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
beslow/weex-hackernews
02f6ab6d9e1bc6b5972c299fc27385c309944539
f0931a0e40f6b7e223a8f7bdd61943412940d97d
refs/heads/master
2021-01-11T19:00:43.622637
2017-01-07T14:28:03
2017-01-07T14:28:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
27,860
java
/** * * Apache License * Version 2.0, January 2004 * http://www.apache.org/licenses/ * * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION * * 1. Definitions. * * "License" shall mean the terms and conditions for use, reproduction, * and distribution as defined by Sections 1 through 9 of this document. * * "Licensor" shall mean the copyright owner or entity authorized by * the copyright owner that is granting the License. * * "Legal Entity" shall mean the union of the acting entity and all * other entities that control, are controlled by, or are under common * control with that entity. For the purposes of this definition, * "control" means (i) the power, direct or indirect, to cause the * direction or management of such entity, whether by contract or * otherwise, or (ii) ownership of fifty percent (50%) or more of the * outstanding shares, or (iii) beneficial ownership of such entity. * * "You" (or "Your") shall mean an individual or Legal Entity * exercising permissions granted by this License. * * "Source" form shall mean the preferred form for making modifications, * including but not limited to software source code, documentation * source, and configuration files. * * "Object" form shall mean any form resulting from mechanical * transformation or translation of a Source form, including but * not limited to compiled object code, generated documentation, * and conversions to other media types. * * "Work" shall mean the work of authorship, whether in Source or * Object form, made available under the License, as indicated by a * copyright notice that is included in or attached to the work * (an example is provided in the Appendix below). * * "Derivative Works" shall mean any work, whether in Source or Object * form, that is based on (or derived from) the Work and for which the * editorial revisions, annotations, elaborations, or other modifications * represent, as a whole, an original work of authorship. For the purposes * of this License, Derivative Works shall not include works that remain * separable from, or merely link (or bind by name) to the interfaces of, * the Work and Derivative Works thereof. * * "Contribution" shall mean any work of authorship, including * the original version of the Work and any modifications or additions * to that Work or Derivative Works thereof, that is intentionally * submitted to Licensor for inclusion in the Work by the copyright owner * or by an individual or Legal Entity authorized to submit on behalf of * the copyright owner. For the purposes of this definition, "submitted" * means any form of electronic, verbal, or written communication sent * to the Licensor or its representatives, including but not limited to * communication on electronic mailing lists, source code control systems, * and issue tracking systems that are managed by, or on behalf of, the * Licensor for the purpose of discussing and improving the Work, but * excluding communication that is conspicuously marked or otherwise * designated in writing by the copyright owner as "Not a Contribution." * * "Contributor" shall mean Licensor and any individual or Legal Entity * on behalf of whom a Contribution has been received by Licensor and * subsequently incorporated within the Work. * * 2. Grant of Copyright License. Subject to the terms and conditions of * this License, each Contributor hereby grants to You a perpetual, * worldwide, non-exclusive, no-charge, royalty-free, irrevocable * copyright license to reproduce, prepare Derivative Works of, * publicly display, publicly perform, sublicense, and distribute the * Work and such Derivative Works in Source or Object form. * * 3. Grant of Patent License. Subject to the terms and conditions of * this License, each Contributor hereby grants to You a perpetual, * worldwide, non-exclusive, no-charge, royalty-free, irrevocable * (except as stated in this section) patent license to make, have made, * use, offer to sell, sell, import, and otherwise transfer the Work, * where such license applies only to those patent claims licensable * by such Contributor that are necessarily infringed by their * Contribution(s) alone or by combination of their Contribution(s) * with the Work to which such Contribution(s) was submitted. If You * institute patent litigation against any entity (including a * cross-claim or counterclaim in a lawsuit) alleging that the Work * or a Contribution incorporated within the Work constitutes direct * or contributory patent infringement, then any patent licenses * granted to You under this License for that Work shall terminate * as of the date such litigation is filed. * * 4. Redistribution. You may reproduce and distribute copies of the * Work or Derivative Works thereof in any medium, with or without * modifications, and in Source or Object form, provided that You * meet the following conditions: * * (a) You must give any other recipients of the Work or * Derivative Works a copy of this License; and * * (b) You must cause any modified files to carry prominent notices * stating that You changed the files; and * * (c) You must retain, in the Source form of any Derivative Works * that You distribute, all copyright, patent, trademark, and * attribution notices from the Source form of the Work, * excluding those notices that do not pertain to any part of * the Derivative Works; and * * (d) If the Work includes a "NOTICE" text file as part of its * distribution, then any Derivative Works that You distribute must * include a readable copy of the attribution notices contained * within such NOTICE file, excluding those notices that do not * pertain to any part of the Derivative Works, in at least one * of the following places: within a NOTICE text file distributed * as part of the Derivative Works; within the Source form or * documentation, if provided along with the Derivative Works; or, * within a display generated by the Derivative Works, if and * wherever such third-party notices normally appear. The contents * of the NOTICE file are for informational purposes only and * do not modify the License. You may add Your own attribution * notices within Derivative Works that You distribute, alongside * or as an addendum to the NOTICE text from the Work, provided * that such additional attribution notices cannot be construed * as modifying the License. * * You may add Your own copyright statement to Your modifications and * may provide additional or different license terms and conditions * for use, reproduction, or distribution of Your modifications, or * for any such Derivative Works as a whole, provided Your use, * reproduction, and distribution of the Work otherwise complies with * the conditions stated in this License. * * 5. Submission of Contributions. Unless You explicitly state otherwise, * any Contribution intentionally submitted for inclusion in the Work * by You to the Licensor shall be under the terms and conditions of * this License, without any additional terms or conditions. * Notwithstanding the above, nothing herein shall supersede or modify * the terms of any separate license agreement you may have executed * with Licensor regarding such Contributions. * * 6. Trademarks. This License does not grant permission to use the trade * names, trademarks, service marks, or product names of the Licensor, * except as required for reasonable and customary use in describing the * origin of the Work and reproducing the content of the NOTICE file. * * 7. Disclaimer of Warranty. Unless required by applicable law or * agreed to in writing, Licensor provides the Work (and each * Contributor provides its Contributions) on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or * implied, including, without limitation, any warranties or conditions * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A * PARTICULAR PURPOSE. You are solely responsible for determining the * appropriateness of using or redistributing the Work and assume any * risks associated with Your exercise of permissions under this License. * * 8. Limitation of Liability. In no event and under no legal theory, * whether in tort (including negligence), contract, or otherwise, * unless required by applicable law (such as deliberate and grossly * negligent acts) or agreed to in writing, shall any Contributor be * liable to You for damages, including any direct, indirect, special, * incidental, or consequential damages of any character arising as a * result of this License or out of the use or inability to use the * Work (including but not limited to damages for loss of goodwill, * work stoppage, computer failure or malfunction, or any and all * other commercial damages or losses), even if such Contributor * has been advised of the possibility of such damages. * * 9. Accepting Warranty or Additional Liability. While redistributing * the Work or Derivative Works thereof, You may choose to offer, * and charge a fee for, acceptance of support, warranty, indemnity, * or other liability obligations and/or rights consistent with this * License. However, in accepting such obligations, You may act only * on Your own behalf and on Your sole responsibility, not on behalf * of any other Contributor, and only if You agree to indemnify, * defend, and hold each Contributor harmless for any liability * incurred by, or claims asserted against, such Contributor by reason * of your accepting any such warranty or additional liability. * * END OF TERMS AND CONDITIONS * * APPENDIX: How to apply the Apache License to your work. * * To apply the Apache License to your work, attach the following * boilerplate notice, with the fields enclosed by brackets "[]" * replaced with your own identifying information. (Don't include * the brackets!) The text should be enclosed in the appropriate * comment syntax for the file format. We also recommend that a * file or class name and description of purpose be included on the * same "printed page" as the copyright notice for easier * identification within third-party archives. * * Copyright 2016 Alibaba Group * * 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.taobao.weex.dom; import android.graphics.Rect; import android.os.Message; import android.text.TextUtils; import android.view.View; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.taobao.weex.WXSDKInstance; import com.taobao.weex.WXSDKManager; import com.taobao.weex.bridge.WXBridgeManager; import com.taobao.weex.common.WXModule; import com.taobao.weex.utils.WXLogUtils; import com.taobao.weex.utils.WXViewUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.List; /** * <p> * Module class for dom operation. Methods in this class will run in dom thread by default. * Actually, methods in this class are wrapper classes, they just wrap method call info, and hand * the wrapped info to the {@link WXDomHandler} for further process. This class is also singleton * in the {@link com.taobao.weex.WXSDKInstance} * </p> * <p> * This module is work different with other regular module, method is invoked directly, without reflection. * </p> */ public final class WXDomModule extends WXModule { /** package **/ // method static final String CREATE_BODY = "createBody"; static final String UPDATE_ATTRS = "updateAttrs"; static final String UPDATE_STYLE = "updateStyle"; static final String REMOVE_ELEMENT = "removeElement"; static final String ADD_ELEMENT = "addElement"; static final String MOVE_ELEMENT = "moveElement"; static final String ADD_EVENT = "addEvent"; static final String REMOVE_EVENT = "removeEvent"; static final String CREATE_FINISH = "createFinish"; static final String REFRESH_FINISH = "refreshFinish"; static final String UPDATE_FINISH = "updateFinish"; static final String SCROLL_TO_ELEMENT = "scrollToElement"; static final String ADD_RULE = "addRule"; static final String GET_COMPONENT_RECT = "getComponentRect"; public static final String WXDOM = "dom"; public static final String INVOKE_METHOD = "invokeMethod"; /** * Methods expose to js. Every method which will be called in js should add to this array. */ public static final String[] METHODS = {CREATE_BODY, UPDATE_ATTRS, UPDATE_STYLE, REMOVE_ELEMENT, ADD_ELEMENT, MOVE_ELEMENT, ADD_EVENT, REMOVE_EVENT, CREATE_FINISH, REFRESH_FINISH, UPDATE_FINISH, SCROLL_TO_ELEMENT, ADD_RULE,GET_COMPONENT_RECT, INVOKE_METHOD}; public WXDomModule(WXSDKInstance instance){ mWXSDKInstance = instance; } public void callDomMethod(JSONObject task) { if (task == null) { return; } String method = (String) task.get(WXBridgeManager.METHOD); JSONArray args = (JSONArray) task.get(WXBridgeManager.ARGS); if (method == null) { return; } try { switch (method) { case CREATE_BODY: if (args == null) { return; } createBody((JSONObject) args.get(0)); break; case UPDATE_ATTRS: if (args == null) { return; } updateAttrs((String) args.get(0), (JSONObject) args.get(1)); break; case UPDATE_STYLE: if (args == null) { return; } updateStyle((String) args.get(0), (JSONObject) args.get(1)); break; case REMOVE_ELEMENT: if (args == null) { return; } removeElement((String) args.get(0)); break; case ADD_ELEMENT: if (args == null) { return; } addElement((String) args.get(0), (JSONObject) args.get(1), (Integer) args.get(2)); break; case MOVE_ELEMENT: if (args == null) { return; } moveElement((String) args.get(0), (String) args.get(1), (Integer) args.get(2)); break; case ADD_EVENT: if (args == null) { return; } addEvent((String) args.get(0), (String) args.get(1)); break; case REMOVE_EVENT: if (args == null) { return; } removeEvent((String) args.get(0), (String) args.get(1)); break; case CREATE_FINISH: createFinish(); break; case REFRESH_FINISH: refreshFinish(); break; case UPDATE_FINISH: updateFinish(); break; case SCROLL_TO_ELEMENT: if (args == null) { return; } scrollToElement((String) args.get(0), (JSONObject) args.get(1)); break; case ADD_RULE: if (args == null) { return; } addRule((String) args.get(0), (JSONObject) args.get(1)); case GET_COMPONENT_RECT: if(args == null){ return; } getComponentRect((String) args.get(0),(String) args.get(1)); break; case INVOKE_METHOD: if(args == null){ return; } invokeMethod((String) args.get(0),(String) args.get(1),(JSONArray) args.get(2)); break; } } catch (IndexOutOfBoundsException e) { // no enougn args e.printStackTrace(); WXLogUtils.e("Dom module call miss arguments."); } catch (ClassCastException cce) { WXLogUtils.e("Dom module call arguments format error!!"); } } /** * invoke dom method * @param ref * @param method * @param args */ public void invokeMethod(String ref, String method, JSONArray args){ if(ref == null || method == null){ return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); List<Object> msgArgs = new ArrayList<>(); msgArgs.add(ref); msgArgs.add(method); msgArgs.add(args); task.args = msgArgs; msg.what = WXDomHandler.MsgType.WX_DOM_INVOKE; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Create a body for the current {@link com.taobao.weex.WXSDKInstance} according to given * parameter. * @param element info about how to create a body */ public void createBody(JSONObject element) { if (element == null) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(element); msg.what = WXDomHandler.MsgType.WX_DOM_CREATE_BODY; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Update attributes * @param ref * @param attr the expected attr */ public void updateAttrs(String ref, JSONObject attr) { if (TextUtils.isEmpty(ref) || attr == null || attr.size() < 1) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(ref); task.args.add(attr); msg.what = WXDomHandler.MsgType.WX_DOM_UPDATE_ATTRS; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Update DOM style. * @param ref DOM reference * @param style the expected style */ public void updateStyle(String ref, JSONObject style) { if (TextUtils.isEmpty(ref) || style == null || style.size() < 1) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(ref); task.args.add(style); msg.what = WXDomHandler.MsgType.WX_DOM_UPDATE_STYLE; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Remove a node for the node tree. * @param ref reference of the node to be removed. */ public void removeElement(String ref) { if (TextUtils.isEmpty(ref)) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(ref); msg.what = WXDomHandler.MsgType.WX_DOM_REMOVE_DOM; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Add a {@link WXDomObject} to the specified parent as its given n-th child. * @param parentRef reference of the parent. * @param element the node to be added * @param index the expected index that the new dom in its new parent */ public void addElement(String parentRef, JSONObject element, Integer index) { if (element == null || TextUtils.isEmpty(parentRef)) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(parentRef); task.args.add(element); task.args.add(index); msg.what = WXDomHandler.MsgType.WX_DOM_ADD_DOM; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Move the DomElement to the specified parent as its given n-th child. * @param ref reference of the node to be moved. * @param parentRef reference of the parent. * @param index the expected index that the dom in its new parent */ public void moveElement(String ref, String parentRef, Integer index) { if (TextUtils.isEmpty(ref) || TextUtils.isEmpty(parentRef)) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(ref); task.args.add(parentRef); task.args.add(index); msg.what = WXDomHandler.MsgType.WX_DOM_MOVE_DOM; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Add eventListener for the specified {@link WXDomObject} * @param ref reference of the node * @param type the type of the event listener to be added. */ public void addEvent(String ref, String type) { if (TextUtils.isEmpty(ref) || TextUtils.isEmpty(type)) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(ref); task.args.add(type); msg.what = WXDomHandler.MsgType.WX_DOM_ADD_EVENT; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Remove eventListener for the specified {@link WXDomObject} * @param ref reference of the node * @param type the type of the event listener to be removed. */ public void removeEvent(String ref, String type) { if (TextUtils.isEmpty(ref) || TextUtils.isEmpty(type)) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(ref); task.args.add(type); msg.what = WXDomHandler.MsgType.WX_DOM_REMOVE_EVENT; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Notify the {@link WXDomManager} that creation of dom tree is finished. * This notify is given by JS. */ public void createFinish() { Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); msg.what = WXDomHandler.MsgType.WX_DOM_CREATE_FINISH; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Notify the {@link WXDomManager} that refreshing of dom tree is finished. * This notify is given by JS. */ public void refreshFinish() { Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); msg.what = WXDomHandler.MsgType.WX_DOM_REFRESH_FINISH; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } public void updateFinish() { Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); msg.what = WXDomHandler.MsgType.WX_DOM_UPDATE_FINISH; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * Scroll the specified {@link WXDomObject} to given offset in given duration * @param ref reference of specified dom object * @param options scroll option, like {offset:0, duration:300} */ public void scrollToElement(String ref, JSONObject options) { if (TextUtils.isEmpty(ref) || options == null) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(ref); task.args.add(options); msg.what = WXDomHandler.MsgType.WX_DOM_SCROLLTO; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } public void addRule(String type, JSONObject options) { if (TextUtils.isEmpty(type) || options == null) { return; } Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(type); task.args.add(options); msg.what = WXDomHandler.MsgType.WX_DOM_ADD_RULE; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } /** * By ref the width and height of the component. * * @param ref the refer of component * @param callback function id */ public void getComponentRect(String ref, String callback) { if (TextUtils.isEmpty(ref) || TextUtils.isEmpty(callback)) { Map<String, Object> options = new HashMap<>(); options.put("result", false); options.put("errMsg", "Illegal parameter"); WXSDKManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callback, options); return; } else if ("viewport".equalsIgnoreCase(ref)) { if(mWXSDKInstance!=null && mWXSDKInstance.getContainerView()!=null && mWXSDKInstance.getContainerView().getParent()!=null){ Map<String, Object> options = new HashMap<>(); Map<String, String> sizes = new HashMap<>(); Rect rect=new Rect(); ((View)mWXSDKInstance.getContainerView().getParent()).getGlobalVisibleRect(rect); sizes.put("width", String.valueOf(WXViewUtils.getWebPxByWidth(rect.width()))); sizes.put("height", String.valueOf(WXViewUtils.getWebPxByWidth(rect.height()))); sizes.put("bottom",String.valueOf(WXViewUtils.getWebPxByWidth(rect.bottom))); sizes.put("left",String.valueOf(WXViewUtils.getWebPxByWidth(rect.left))); sizes.put("right",String.valueOf(WXViewUtils.getWebPxByWidth(rect.right))); sizes.put("top",String.valueOf(WXViewUtils.getWebPxByWidth(rect.top))); options.put("size", sizes); options.put("result", true); WXSDKManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callback, options); }else{ Map<String, Object> options = new HashMap<>(); options.put("result", false); options.put("errMsg", "Component does not exist"); WXSDKManager.getInstance().callback(mWXSDKInstance.getInstanceId(), callback, options); } } else { Message msg = Message.obtain(); WXDomTask task = new WXDomTask(); task.instanceId = mWXSDKInstance.getInstanceId(); task.args = new ArrayList<>(); task.args.add(ref); task.args.add(callback); msg.what = WXDomHandler.MsgType.WX_COMPONENT_SIZE; msg.obj = task; WXSDKManager.getInstance().getWXDomManager().sendMessage(msg); } } }
f7b86449b7b11af3ab039394b7ff17b1052c6fc4
4912fb470fd011127fa65870f038a64f1deaa5c9
/szkeleton/src/szkeleton/TunnelEntranceCounter.java
5f252586b9684e9a1dd1ae9909c07a64f58734a3
[]
no_license
adam-marton/projlab
c559eaac941abe428a13fd2b23c0557252dba2c8
95ccd733fc6eb29c0cf0d9d5863b31e62a078290
refs/heads/szkeleton
2020-12-31T05:24:09.552676
2017-05-06T09:32:33
2017-05-06T09:32:33
85,487,615
0
0
null
2017-03-20T00:22:29
2017-03-19T15:36:16
Java
UTF-8
Java
false
false
783
java
package szkeleton; /** * * @author Adam */ public class TunnelEntranceCounter { private static TunnelEntranceCounter instance = null; private int counter = 0; private TunnelEntranceCounter() { } /** * * @return */ public static TunnelEntranceCounter getInstance() { if(null == instance) { instance = new TunnelEntranceCounter(); } return instance; } /** * * Visszaadja a counter számláló értékét. * @return */ public int getCounter() { return counter; } /** * Beállítja a counter számlálónak a paraméterül kapott int értékét. * @param counter */ public void addCounter(int counter) { this.counter = counter; } }
410ca2e6f7caede06fa2e11c1e988a3a1bbc8dc3
022980735384919a0e9084f57ea2f495b10c0d12
/src/ext_cttdt_ca/ext-impl/src/com/nss/portlet/partner/model/PartnerModel.java
b034c3bf7412ada93246c67b84622723d34bf8fa
[]
no_license
thaond/nsscttdt
474d8e359f899d4ea6f48dd46ccd19bbcf34b73a
ae7dacc924efe578ce655ddfc455d10c953abbac
refs/heads/master
2021-01-10T03:00:24.086974
2011-02-19T09:18:34
2011-02-19T09:18:34
50,081,202
0
0
null
null
null
null
UTF-8
Java
false
false
1,805
java
package com.nss.portlet.partner.model; import com.liferay.portal.model.BaseModel; import java.util.Date; /** * <a href="PartnerModel.java.html"><b><i>View Source</i></b></a> * * <p> * ServiceBuilder generated this class. Modifications in this class will be * overwritten the next time is generated. * </p> * * <p> * This interface is a model that represents the <code>Partner</code> * table in the database. * </p> * * @author Brian Wing Shun Chan * * @see com.nss.portlet.partner.model.Partner * @see com.nss.portlet.partner.model.impl.PartnerImpl * @see com.nss.portlet.partner.model.impl.PartnerModelImpl * */ public interface PartnerModel extends BaseModel<Partner> { public long getPrimaryKey(); public void setPrimaryKey(long pk); public long getMaPartner(); public void setMaPartner(long maPartner); public String getTenPartner(); public void setTenPartner(String tenPartner); public String getUrlPartner(); public void setUrlPartner(String urlPartner); public String getMoTaPartner(); public void setMoTaPartner(String moTaPartner); public long getCompanyid(); public void setCompanyid(long companyid); public long getUserid(); public void setUserid(long userid); public Date getCreatedate(); public void setCreatedate(Date createdate); public Date getModifieddate(); public void setModifieddate(Date modifieddate); public int getThuTuPartner(); public void setThuTuPartner(int thuTuPartner); public String getTarget(); public void setTarget(String target); public int getActive(); public void setActive(int active); public long getImageId_liferay(); public void setImageId_liferay(long imageId_liferay); public Partner toEscapedModel(); }
[ "nguyentanmo@843501e3-6f96-e689-5e61-164601347e4e" ]
nguyentanmo@843501e3-6f96-e689-5e61-164601347e4e
d1ba3f92cc8b83e8b628b3519f204dc92bf0f3c3
ebf90bd734472a9834e15b460249b23ce1a9186f
/src/main/java/com/jackie/hellojackie/controller/AccountController.java
1851ac3f47f1748892cd4d1453c40dfaaf96f6cf
[]
no_license
jackiexu928/hellojackie
06b9296d1c0542104e57975a0cab036b4d92d875
4560aef88b08675e900dea9ee69e6feb31057662
refs/heads/master
2020-03-18T03:36:57.121126
2018-05-23T08:37:07
2018-05-23T08:37:07
133,912,822
0
0
null
null
null
null
UTF-8
Java
false
false
283
java
package com.jackie.hellojackie.controller; import com.jackie.hellojackie.util.ParamUtil; import org.eclipse.jetty.util.StringUtil; /** * Created with IntelliJ IDEA. * Description: * * @author xujj * @date 2018/5/18 */ public class AccountController extends BaseController{ }
ab06f6a91067bda21941689ab2b042743c952b20
bd20489675dc12cc572f24378570ee82925fd9fd
/Desktop/COC/CS/All282project2/New folder/Garcia/src/tree234app/Tree234App.java
07f5f096fcb587df1ecf2fa6b56837835c8fcfd7
[]
no_license
cy-xu/College-of-the-Canyons
2191d7ddf3ca219ec0515ea25c4f2b2ab0660626
21df64e475fc2260bfb55b3a1ccb78677f098956
refs/heads/master
2021-01-20T06:10:56.653659
2017-05-23T03:08:48
2017-05-23T03:08:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,617
java
package tree234app; /* * @author Nicole Garcia * November 17, 2015 * CS 282 Lab Project #2 */ import java.io.*; public class Tree234App { public static void main(String[] args) throws IOException { long value; Tree234 theTree = new Tree234(); theTree.insert(50); theTree.insert(40); theTree.insert(60); theTree.insert(30); theTree.insert(70); while (true) { System.out.print("Enter first letter of "); System.out.print("show, insert, find, change order or quit: "); char choice = getChar(); switch (choice) { case 's': theTree.displayTree(); break; case 'i': System.out.print("Enter value to insert: "); value = getInt(); theTree.insert(value); break; case 'f': System.out.print("Enter value to find: "); value = getInt(); int found = theTree.find(value); if (found != -1) { System.out.println("Found " + value); } else { System.out.println("Could not find " + value); } break; case 'c': System.out.print("Enter order of BTree: "); value = getInt(); System.out.println("New order: " + value); break; case 'q': System.out.println("Done"); System.exit(0); default: System.out.print("Invalid entry\n"); } // end switch } // end while } // end main() //-------------------------------------------------------------- public static String getString() throws IOException { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); String s = br.readLine(); return s; } //-------------------------------------------------------------- public static char getChar() throws IOException { String s = getString(); return s.charAt(0); } //------------------------------------------------------------- public static int getInt() throws IOException { String s = getString(); return Integer.parseInt(s); } //------------------------------------------------------------- } // end class Tree234App
[ "Kevin Ponek" ]
Kevin Ponek
d7f1f24389bcf13728684ff13efb30a117ebe94c
1fd9857a40fa12f02c46a80d2ac8fc1aba11524b
/ImageView2_Controller.java
f02a60a7321b82346f1d4d80e2b2664fa60ab03a
[]
no_license
a0dinw225/ScoringApplication
5ef7f3247adb34028576e320782fce8a82f67979
e2499c1387f6d5e0e2f26374a3cff53b1897cd53
refs/heads/main
2023-08-29T00:23:35.995936
2021-11-03T01:22:34
2021-11-03T01:22:34
420,317,820
0
0
null
null
null
null
SHIFT_JIS
Java
false
false
2,065
java
package application; import java.net.URL; import java.util.ResourceBundle; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; public class ImageView2_Controller implements Initializable{ @FXML private BorderPane borderPane; @FXML private ImageView imageView; @FXML private Button bt1; @FXML private Button bt2; public void initStage(Stage stage) { stage.setWidth(1000); stage.setHeight(750); stage.setTitle(ImageView_Controller.idpath); imageView.fitWidthProperty().bind(borderPane.widthProperty()); imageView.fitHeightProperty().bind(borderPane.heightProperty()); } @FXML void ScaleDown(ActionEvent event) { imageView.setScaleX(1.0); imageView.setScaleY(1.0); } @FXML void ScaleUp(ActionEvent event) { imageView.setScaleX(1.5); imageView.setScaleY(1.5); } @Override public void initialize(URL location, ResourceBundle resources) { // TODO 自動生成されたメソッド・スタブ //path.setText(ImageView_Controller.idpath); //path.setFont(Font.font(24)); Image image = new Image("file:" + ImageView_Controller.idpath); System.out.println("画像セットします"); System.out.println("file:" + ImageView_Controller.idpath); imageView.setImage(image); System.out.println("画像セットしました"); } @FXML void initialize() { assert borderPane != null : "fx:id=\"borderPane\" was not injected: check your FXML file 'ImageView2.fxml'."; assert imageView != null : "fx:id=\"imageView\" was not injected: check your FXML file 'ImageView2.fxml'."; assert bt1 != null : "fx:id=\"bt1\" was not injected: check your FXML file 'ImageView2.fxml'."; assert bt2 != null : "fx:id=\"bt2\" was not injected: check your FXML file 'ImageView2.fxml'."; } }
9f9f7b34238d2f90b9779be6afcc63753c83adb2
f465f82e27cb1097fb7793def4ccfe10e9e8b4db
/DesignPatternFlyweight/src/FlyweightPatternDemo.java
ddec96d5ed062947f42e58e52de0352da0affbc0
[]
no_license
OttoBismark/FlyweightDesignPattern
543c325048f670e2628feca337bb4ac3a7f48e9a
e4f93a84f2c56cafbb1cd19fdbd6c8ec5e971128
refs/heads/master
2020-04-07T21:35:07.174833
2018-11-22T17:40:21
2018-11-22T17:40:21
158,732,930
0
0
null
null
null
null
UTF-8
Java
false
false
591
java
public class FlyweightPatternDemo { private static final String []colors = {"Red", "Blue", "Green"}; public static void main(String[] args) { Circle circle = (Circle)ShapeFactory.getCircle(getRandomColor()); circle.setX(getRandomX()); circle.setY(getRandomY()); circle.setRadius(5.2); circle.draw(); } private static String getRandomColor() { return colors[(int)Math.random()*colors.length]; } private static double getRandomX() { return (Math.random()*10); } private static double getRandomY() { return (Math.random()*10); } }
06eedbd1263cdf703207abe42450fccfdecda8f9
a82ffa9487703b15ed9af9d8e791129c24b3e6a2
/1.JavaSyntax/src/com/javarush/task/task07/task0711/Solution.java
eecb510c09bd776b67e131c8d534163fcc0737cf
[]
no_license
dinikoff/JavaRushTasks
53d9b31acfdd154d847045debb410297e848ac7a
d7ecd4b0ec6acdb93c33301aa738138e4ce3ca8f
refs/heads/master
2020-03-20T11:16:57.260238
2018-10-31T19:01:27
2018-10-31T19:01:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
817
java
package com.javarush.task.task07.task0711; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; /* Удалить и вставить */ public class Solution { public static void main(String[] args) throws Exception { //напишите тут ваш код BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); ArrayList<String> list = new ArrayList<>(); for (int i = 0; i < 5; i++) { list.add(reader.readLine()); } String temp; for (int i = 0; i < 13; i++) { temp = list.get(list.size()-1); list.remove(list.size()-1); list.add(0, temp); } for (String s : list) { System.out.println(s); } } }
94fd9737aa78dcca944b6e3de1361c6b8a333529
83803696ea6694065b4feb2d7ee976375a4231d6
/booking/src/main/java/com/kltn/booking/conversions/TicketConversion.java
91fd68993eb4b234ce81e1552517c44a7853c84e
[]
no_license
rongxanh77443/reserveBus
343b5fc2a3bbf2a52cc68275df0a235c32cd5992
7e90f1b14be6e487f6595668529d9c0da9eb0268
refs/heads/master
2023-02-01T23:10:29.983204
2020-12-15T18:20:52
2020-12-15T18:20:52
321,750,812
0
0
null
null
null
null
UTF-8
Java
false
false
1,323
java
package com.kltn.booking.conversions; import com.kltn.booking.dtos.basedtos.TicketDto; import com.kltn.booking.entities.Ticket; import org.springframework.stereotype.Component; @Component public class TicketConversion { private final SeatConversion seatConversion; private final SessionConversion sessionConversion; public TicketConversion(SeatConversion seatConversion, SessionConversion sessionConversion) { this.seatConversion = seatConversion; this.sessionConversion = sessionConversion; } public Ticket toTicketEntity(TicketDto ticketDto){ Ticket ticket=new Ticket(); ticket.setStatus(ticketDto.getStatus()); ticket.setSeat(seatConversion.toSeatEntity(ticketDto.getSeat())); return ticket; } public TicketDto toTicketDto(Ticket ticket){ TicketDto ticketDto=new TicketDto(); if (ticket.getId()!=null) ticketDto.setId(ticket.getId()); ticketDto.setSeat(seatConversion.toSeatDto(ticket.getSeat())); ticketDto.setStatus(ticket.getStatus()); return ticketDto; } public Ticket toTicketEntity(Ticket ticket,TicketDto ticketDto){ ticket.setStatus(ticketDto.getStatus()); ticket.setSeat(seatConversion.toSeatEntity(ticketDto.getSeat())); return ticket; } }
9fe6d0b850cde64728c808885e323921d4543be1
32d69f230eb362a45556d6af4f1f75620ecdd82a
/src/main/java/br/com/prefeitura/bomdestino/sig/service/dto/UserDTO.java
9231bdec1c15e5f6c4c9411e5e5836f5e0c83734
[]
no_license
viniciusjs07/prefeitura-sgm
ec4bfbfa40027932be8716b9b6a0cf4c520b16f5
24260aa764a19d78c8c586275db3f95b8f5ace1b
refs/heads/main
2023-08-24T18:17:12.522886
2021-04-12T01:52:14
2021-04-12T01:52:14
356,732,133
0
0
null
null
null
null
UTF-8
Java
false
false
3,793
java
package br.com.prefeitura.bomdestino.sig.service.dto; import br.com.prefeitura.bomdestino.sig.config.Constants; import br.com.prefeitura.bomdestino.sig.domain.Authority; import br.com.prefeitura.bomdestino.sig.domain.Profile; import br.com.prefeitura.bomdestino.sig.domain.User; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.validation.constraints.*; import java.time.Instant; import java.util.HashSet; import java.util.Set; import static br.com.prefeitura.bomdestino.sig.util.RegexConstant.PASSWORD_REGEX; /** * A DTO representing a user, with his profiles. */ @Getter @Setter @NoArgsConstructor public class UserDTO extends AbstractDTO { public static final int PASSWORD_MIN_LENGTH = 7; private Long id; @NotNull @Pattern(regexp = Constants.LOGIN_REGEX) @Size(min = 3, max = 50) private String login; @Size(min = 3, max = 50) @NotNull private String firstName; @Size(max = 50) @NotNull private String lastName; @Email @Pattern(regexp = ".{3,64}@.{1,255}") private String email; @Size(min = 2, max = 10) private String langKey; private String createdBy; private String lastModifiedBy; @NotNull private Set<Profile> profiles = new HashSet<>(); @NotNull private Set<AuthorityDTO> authorities = new HashSet<>(); private String image; @Pattern(regexp = PASSWORD_REGEX, message = "{error.user.password.pattern}") @ApiModelProperty(value = "Senha do usuário.", position = 7) private String password; private Boolean onFirstPassword; private Boolean blinding; private Boolean superUser; private Instant lastPasswordUpdate; public UserDTO(User user) { this.id = user.getId(); this.login = user.getLogin(); this.firstName = user.getFirstName(); this.lastName = user.getLastName(); this.email = user.getEmail(); this.activated = user.isActivated(); this.langKey = user.getLangKey(); this.createdBy = user.getCreatedBy(); this.createdDate = user.getCreatedDate(); this.lastModifiedBy = user.getLastModifiedBy(); this.lastModifiedDate = user.getLastModifiedDate(); this.setProfiles(new HashSet<>(user.getProfiles())); if (user.getImage() != null) { this.image = user.getImage().getUrl(); } for (Profile profile : user.getProfiles()) { for (Authority authority : profile.getAuthorities()) { this.authorities.add(new AuthorityDTO(authority.getName())); } } this.password = user.getPassword(); this.onFirstPassword = user.getOnFirstPassword(); this.blinding = user.getBlinding(); this.superUser = user.getSuperUser(); this.lastPasswordUpdate = user.getLastPasswordUpdate(); } public void setProfiles(Set<Profile> profiles) { this.profiles = profiles; } @Override public String toString() { return "UserDTO{" + "login='" + login + '\'' + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", activated=" + activated + ", langKey='" + langKey + '\'' + ", createdBy=" + createdBy + ", createdDate=" + createdDate + ", lastModifiedBy='" + lastModifiedBy + '\'' + ", lastModifiedDate=" + lastModifiedDate + ", profiles=" + profiles + ", onFirstPassword=" + onFirstPassword + ", lastPasswordUpdate=" + lastPasswordUpdate + "}"; } }
6375de639b68c55df8ba2ebab9de9dc0716d616a
ae92ede9ec303177a44c2fc7402b4f667edd3c0e
/app/src/main/java/e/marc/sunny/BoardLocater.java
f24f8ce1c3da1ca8254c160259e5b020e828b393
[]
no_license
marcdon/Sunny2.0
3b0c4a25ba754353f16c8da0aae7a711fb6cc950
26898d09631127c9d7c6ed1e3cfca424d87db982
refs/heads/master
2020-04-29T18:58:01.910437
2019-04-02T17:04:06
2019-04-02T17:04:06
176,339,390
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package e.marc.sunny; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class BoardLocater extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_board_locater); } }
8e47f1748491f24ec3b75d262319caeb28729768
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/未反混淆/src/main/java/com/tencent/mm/plugin/game/d/m.java
6445552284141a2ab180ff1e051a2c937dc7185b
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,668
java
package com.tencent.mm.plugin.game.d; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.bt.a; public final class m extends a { public String mZV; public final int op(int i, Object... objArr) { AppMethodBeat.i(116993); int f; if (i == 0) { e.a.a.c.a aVar = (e.a.a.c.a) objArr[0]; if (this.mZV != null) { aVar.e(1, this.mZV); } AppMethodBeat.o(116993); return 0; } else if (i == 1) { if (this.mZV != null) { f = e.a.a.b.b.a.f(1, this.mZV) + 0; } else { f = 0; } AppMethodBeat.o(116993); return f; } else if (i == 2) { e.a.a.a.a aVar2 = new e.a.a.a.a((byte[]) objArr[0], unknownTagHandler); for (f = a.getNextFieldNumber(aVar2); f > 0; f = a.getNextFieldNumber(aVar2)) { if (!super.populateBuilderWithField(aVar2, this, f)) { aVar2.ems(); } } AppMethodBeat.o(116993); return 0; } else if (i == 3) { e.a.a.a.a aVar3 = (e.a.a.a.a) objArr[0]; m mVar = (m) objArr[1]; switch (((Integer) objArr[2]).intValue()) { case 1: mVar.mZV = aVar3.BTU.readString(); AppMethodBeat.o(116993); return 0; default: AppMethodBeat.o(116993); return -1; } } else { AppMethodBeat.o(116993); return -1; } } }
46d391d99fce19f84df968d691743b340a085daa
73267fc544324a986ff6d572161d21598524c642
/UE3-Angabe/we-lab3-group81/app/models/UserRegisterModel.java
f9d3918a8d6146303744862db09d5a0246c0b829
[]
no_license
danurna/webengineering
c206a7ee200b3814635d9b2f4ec7fd1d3bc7a071
ad183b3fa57c4708ed7cb884e79f63009751d239
refs/heads/master
2021-01-19T16:56:36.268637
2015-02-11T10:09:38
2015-02-11T10:09:38
17,824,498
0
0
null
null
null
null
UTF-8
Java
false
false
1,023
java
package models; import java.util.Date; import play.data.validation.Constraints.MaxLength; import play.data.validation.Constraints.MinLength; import play.data.validation.Constraints.Required; import play.i18n.Messages; public class UserRegisterModel { public String firstname; public String lastname; // Uses application wide language specific date formats public Date birthdate; public String gender; @Required @MinLength(4) @MaxLength(8) public String username; @Required @MinLength(4) @MaxLength(8) public String password; public String validate() { // Validate birthdate if( birthdate != null && birthdate.after(new Date()) ){ return Messages.get("error.futuredate"); } // Validate username uniquness if( !uniqueUsername(username) ){ return Messages.get("error.userexists"); } return null; } private boolean uniqueUsername(String username) { return (UserModel.findUserByName(username) == null); } }
42e203ec6af72538466a75b401169f278c57899e
35e25f7149e47fdb8104e3b7083b028ac8683488
/app/src/test/java/com/example/naman/stayuncleprototype/ExampleUnitTest.java
35289915b0d22b0bd726610b16ec6e2ca00e46d6
[]
no_license
ng0227/Stay-Uncle-Protoype
12edfd59d0ffeb670d13267dc7717ddbf0f79b09
9c45bae66e391eedc4850e64af544d4ea0df4607
refs/heads/master
2020-09-16T23:28:07.843749
2016-10-29T06:52:49
2016-10-29T06:52:49
67,831,450
1
1
null
2016-10-29T06:56:56
2016-09-09T20:42:56
Java
UTF-8
Java
false
false
329
java
package com.example.naman.stayuncleprototype; import org.junit.Test; import static org.junit.Assert.*; /** * To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }
[ "namangupta022\\@gmail.com" ]
namangupta022\@gmail.com
6eea0a99d2986682b13936920ab5bb3cde678d95
e1b266336e7c6d71d34a0c9952014d5e7330b169
/org.lunifera.runtime.web.common/src/org/lunifera/runtime/web/common/IWebContextRegistry.java
a0672f8988a724e6e3342bf1ce50ff50fa077bd6
[]
no_license
spind42/lunifera-runtime-web
04910c17eef5f33ddc60fa22b0282b1524a1e1bc
a9e1b7413cde920097f4e0ed53e249e936d3d4ee
refs/heads/master
2021-01-22T07:48:53.247182
2014-05-20T16:29:31
2014-05-20T16:29:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,221
java
/** * Copyright (c) 2012 Committers of lunifera.org. * 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: * Florian Pirchner - initial API and implementation */ package org.lunifera.runtime.web.common; import java.util.Map; /** * A registry for web contexts. Web contexts are created by that service. And it * also observes the lifecycle of them. */ public interface IWebContextRegistry { /** * Returns the count of the contained contexts. * * @return */ int size(); /** * Creates a webcontext for the given user. * * @param user * The user id. * @param properties * Will be passed to the context. Should only contain primitive * types, their wrappers and java types. * @return */ IWebContext createContext(String user, Map<String, Object> properties); /** * Returns the webcontext for the given id or <code>null</code> if no * context is available. * * @param id * @return */ IWebContext getContext(String id); }
e79ba6dd5a48b36a178807393ca52136d9b251a5
d7061171c3ebe83a08ca47388455945f1d90667f
/BCX_Wallet/module_asset/src/main/java/com/cocos/module_asset/nh_order_manager/NhOrderDetailActivity.java
5b4152f3bb32675fbb52386fe642ab2e32fffec9
[]
no_license
3rbna/AndroidWallet
49ed63f52c489d47872a272ec32b289a80887c10
6474722fa740d66677b740d5437ce8a5f67f682a
refs/heads/master
2020-08-27T20:59:16.555180
2019-09-23T02:20:21
2019-09-23T02:20:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
15,435
java
package com.cocos.module_asset.nh_order_manager; import android.databinding.DataBindingUtil; import android.databinding.Observable; import android.os.Bundle; import android.support.design.widget.BottomSheetBehavior; import android.support.design.widget.BottomSheetDialog; import android.support.design.widget.CoordinatorLayout; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import com.alibaba.android.arouter.facade.annotation.Route; import com.cocos.bcx_sdk.bcx_api.CocosBcxApiWrapper; import com.cocos.bcx_sdk.bcx_callback.IBcxCallBack; import com.cocos.library_base.BR; import com.cocos.library_base.base.BaseActivity; import com.cocos.library_base.base.BaseVerifyPasswordDialog; import com.cocos.library_base.bus.event.EventBusCarrier; import com.cocos.library_base.entity.FeeModel; import com.cocos.library_base.entity.NhAssetOrderEntity; import com.cocos.library_base.entity.OperateResultModel; import com.cocos.library_base.global.EventTypeGlobal; import com.cocos.library_base.global.IntentKeyGlobal; import com.cocos.library_base.router.RouterActivityPath; import com.cocos.library_base.utils.AccountHelperUtils; import com.cocos.library_base.utils.ToastUtils; import com.cocos.library_base.utils.Utils; import com.cocos.library_base.utils.singleton.GsonSingleInstance; import com.cocos.library_base.utils.singleton.MainHandler; import com.cocos.module_asset.R; import com.cocos.module_asset.databinding.ActivityNhOrderDetailBinding; import com.cocos.module_asset.databinding.DialogBuyOrderConfirmBinding; import com.cocos.module_asset.databinding.DialogCancelOrderConfirmBinding; /** * @author ningkang.guo * @Date 2019/7/16 */ @Route(path = RouterActivityPath.ACTIVITY_NH_ORDER_DETAIL) public class NhOrderDetailActivity extends BaseActivity<ActivityNhOrderDetailBinding, NhOrderDetailViewModel> { NhAssetOrderEntity.NhOrderBean nhOrderBean; private BottomSheetDialog dialog; @Override public int initContentView(Bundle savedInstanceState) { return R.layout.activity_nh_order_detail; } @Override public int initVariableId() { return BR.viewModel; } @Override public void initParam() { try { nhOrderBean = (NhAssetOrderEntity.NhOrderBean) getIntent().getExtras().getSerializable(IntentKeyGlobal.NH_ORDER_MODEL); } catch (Exception e) { } } @Override public void initData() { viewModel.requestOrderDetailData(nhOrderBean); } @Override public void onHandleEvent(EventBusCarrier busCarrier) { if (null != busCarrier) { if (TextUtils.equals(EventTypeGlobal.SHOW_CANCEL_ORDER_PASSWORD_VERIFY_DIALOG, busCarrier.getEventType())) { dialog.dismiss(); NhAssetOrderEntity.NhOrderBean nhOrderBean = (NhAssetOrderEntity.NhOrderBean) busCarrier.getObject(); showCancelOrderPasswordVerifyDialog(nhOrderBean); } else if (TextUtils.equals(EventTypeGlobal.SHOW_BUY_ORDER_PASSWORD_VERIFY_DIALOG, busCarrier.getEventType())) { dialog.dismiss(); NhAssetOrderEntity.NhOrderBean nhOrderBean = (NhAssetOrderEntity.NhOrderBean) busCarrier.getObject(); showBuyOrderPasswordVerifyDialog(nhOrderBean); } else if (TextUtils.equals(EventTypeGlobal.DIALOG_DISMISS_TYPE, busCarrier.getEventType())) { if (null != dialog) { dialog.dismiss(); } } } } @Override public void initViewObservable() { viewModel.uc.cancelBtnObservable.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() { @Override public void onPropertyChanged(Observable sender, int propertyId) { CocosBcxApiWrapper.getBcxInstance().cancel_nh_asset_order_fee(nhOrderBean.seller, nhOrderBean.id, "COCOS", new IBcxCallBack() { @Override public void onReceiveValue(final String s) { MainHandler.getInstance().post(new Runnable() { @Override public void run() { if (TextUtils.isEmpty(s)) { ToastUtils.showShort(R.string.net_work_failed); return; } final FeeModel feeModel = GsonSingleInstance.getGsonInstance().fromJson(s, FeeModel.class); if (feeModel.code == 161) { ToastUtils.showShort(R.string.module_asset_order_not_exist); return; } if (!TextUtils.isEmpty(feeModel.message) && (feeModel.message.contains("insufficient_balance") || feeModel.message.contains("Insufficient Balance"))) { ToastUtils.showShort(R.string.insufficient_balance); return; } if (!feeModel.isSuccess()) { return; } dialog = new BottomSheetDialog(NhOrderDetailActivity.this); DialogCancelOrderConfirmBinding binding = DataBindingUtil.inflate(LayoutInflater.from(Utils.getContext()), R.layout.dialog_cancel_order_confirm, null, false); dialog.setContentView(binding.getRoot()); // 设置dialog 完全显示 View parent = (View) binding.getRoot().getParent(); BottomSheetBehavior behavior = BottomSheetBehavior.from(parent); binding.getRoot().measure(0, 0); behavior.setPeekHeight(binding.getRoot().getMeasuredHeight()); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) parent.getLayoutParams(); params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL; parent.setLayoutParams(params); dialog.setCanceledOnTouchOutside(false); final CancelOrderConfirmViewModel cancelOrderConfirmViewModel = new CancelOrderConfirmViewModel(getApplication()); binding.setViewModel(cancelOrderConfirmViewModel); nhOrderBean.minerFee = feeModel.data.amount; nhOrderBean.feeSymbol = "COCOS"; cancelOrderConfirmViewModel.setCancelOrderModel(nhOrderBean); dialog.show(); } }); } }); } }); viewModel.uc.buyBtnObservable.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() { @Override public void onPropertyChanged(Observable sender, int propertyId) { if (TextUtils.equals(AccountHelperUtils.getCurrentAccountName(), nhOrderBean.sellerName)) { ToastUtils.showShort(R.string.module_asset_can_not_buy_owner_order); return; } CocosBcxApiWrapper.getBcxInstance().buy_nh_asset_fee(AccountHelperUtils.getCurrentAccountName(), nhOrderBean.id, new IBcxCallBack() { @Override public void onReceiveValue(final String s) { MainHandler.getInstance().post(new Runnable() { @Override public void run() { if (TextUtils.isEmpty(s)) { ToastUtils.showShort(R.string.net_work_failed); return; } Log.i("buy_nh_asset_fee", s); final FeeModel feeModel = GsonSingleInstance.getGsonInstance().fromJson(s, FeeModel.class); if (feeModel.code == 161) { ToastUtils.showShort(R.string.module_asset_order_not_exist); return; } if (!TextUtils.isEmpty(feeModel.message) && (feeModel.message.contains("insufficient_balance") || feeModel.message.contains("Insufficient Balance"))) { ToastUtils.showShort(R.string.insufficient_balance); return; } if (!feeModel.isSuccess()) { return; } dialog = new BottomSheetDialog(NhOrderDetailActivity.this); DialogBuyOrderConfirmBinding binding = DataBindingUtil.inflate(LayoutInflater.from(Utils.getContext()), R.layout.dialog_buy_order_confirm, null, false); dialog.setContentView(binding.getRoot()); // 设置dialog 完全显示 View parent = (View) binding.getRoot().getParent(); BottomSheetBehavior behavior = BottomSheetBehavior.from(parent); binding.getRoot().measure(0, 0); behavior.setPeekHeight(binding.getRoot().getMeasuredHeight()); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) parent.getLayoutParams(); params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL; parent.setLayoutParams(params); dialog.setCanceledOnTouchOutside(false); final BuyOrderConfirmViewModel buyOrderConfirmViewModel = new BuyOrderConfirmViewModel(getApplication()); binding.setViewModel(buyOrderConfirmViewModel); nhOrderBean.minerFee = feeModel.data.amount; nhOrderBean.feeSymbol = "COCOS"; buyOrderConfirmViewModel.setBuyOrderModel(nhOrderBean); dialog.show(); } }); } }); } }); } /** * 弹出取消订单密码验证弹窗 * * @param nhOrderBean */ private void showCancelOrderPasswordVerifyDialog(final NhAssetOrderEntity.NhOrderBean nhOrderBean) { final BaseVerifyPasswordDialog passwordVerifyDialog = new BaseVerifyPasswordDialog(); passwordVerifyDialog.show(getSupportFragmentManager(), "passwordVerifyDialog"); passwordVerifyDialog.setPasswordListener(new BaseVerifyPasswordDialog.IPasswordListener() { @Override public void onFinish(String password) { CocosBcxApiWrapper.getBcxInstance().cancel_nh_asset_order(nhOrderBean.seller, password, nhOrderBean.id, "COCOS", new IBcxCallBack() { @Override public void onReceiveValue(String s) { final OperateResultModel operateResultModel = GsonSingleInstance.getGsonInstance().fromJson(s, OperateResultModel.class); if (operateResultModel.code == 161) { ToastUtils.showShort(R.string.module_asset_order_not_exist); return; } if (operateResultModel.code == 105) { ToastUtils.showShort(R.string.module_asset_wrong_password); return; } if (!TextUtils.isEmpty(operateResultModel.message) && (operateResultModel.message.contains("insufficient_balance") || operateResultModel.message.contains("Insufficient Balance"))) { ToastUtils.showShort(R.string.insufficient_balance); return; } if (!operateResultModel.isSuccess()) { ToastUtils.showShort(R.string.net_work_failed); return; } ToastUtils.showShort(R.string.module_asset_order_cancel_success); finish(); } }); } @Override public void cancel() { } }); } private void showBuyOrderPasswordVerifyDialog(final NhAssetOrderEntity.NhOrderBean nhOrderBean) { final BaseVerifyPasswordDialog passwordVerifyDialog = new BaseVerifyPasswordDialog(); passwordVerifyDialog.show(getSupportFragmentManager(), "passwordVerifyDialog"); passwordVerifyDialog.setPasswordListener(new BaseVerifyPasswordDialog.IPasswordListener() { @Override public void onFinish(String password) { CocosBcxApiWrapper.getBcxInstance().buy_nh_asset(password, AccountHelperUtils.getCurrentAccountName(), nhOrderBean.id, new IBcxCallBack() { @Override public void onReceiveValue(String s) { Log.i("buy_nh_asset", s); final OperateResultModel operateResultModel = GsonSingleInstance.getGsonInstance().fromJson(s, OperateResultModel.class); if (operateResultModel.code == 161) { ToastUtils.showShort(R.string.module_asset_order_not_exist); return; } if (operateResultModel.code == 105) { ToastUtils.showShort(R.string.module_asset_wrong_password); return; } if (!TextUtils.isEmpty(operateResultModel.message) && (operateResultModel.message.contains("insufficient_balance") || operateResultModel.message.contains("Insufficient Balance"))) { ToastUtils.showShort(R.string.insufficient_balance); return; } if (!operateResultModel.isSuccess()) { ToastUtils.showShort(R.string.net_work_failed); return; } finish(); ToastUtils.showShort(R.string.module_asset_order_buy_success); } }); } @Override public void cancel() { } }); } }
16780b04417564f5088aed15eff7efe8db678f84
c429139f2d22f3300081252acb45ecdb4fd8c3b4
/src/io/miti/workchart/dbutil/Database.java
b288afae88b03dbd00020e9a80933cac692c18fa
[ "MIT" ]
permissive
argonium/workchart
ab72ae1100321c29e8157d56e9ff03c808ec5ecb
52f9200d52e2f49c5bfc49ece768ca4244f1395c
refs/heads/master
2021-01-20T08:47:08.661594
2015-07-15T02:25:27
2015-07-15T02:25:27
39,111,647
0
0
null
null
null
null
UTF-8
Java
false
false
5,035
java
package io.miti.workchart.dbutil; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import java.util.Map; import io.miti.workchart.model.UrlInfo; import io.miti.workchart.util.Logger; /** * Encapsulate the database functionality. * * @author mwallace * @version 1.0 */ public final class Database { /** * Whether the database driver has been loaded into memory. */ private static boolean driverLoaded = false; /** * Default constructor. */ private Database() { super(); } public static Map<String, Integer> executeSelectForStringIntMap(final String sqlCmd, final Connection dbConn) { Map<String, Integer> map = new HashMap<String, Integer>(10); // Check the SQL command if ((sqlCmd == null) || (sqlCmd.length() < 1)) { System.err.println("The SQL cmd is empty or null"); return map; } else if (dbConn == null) { System.err.println("The connection is null for selecting string/int maps"); return map; } // Execute the statement and get the returned ID PreparedStatement stmt = null; ResultSet rs = null; try { // Create the Statement object from the connection stmt = dbConn.prepareStatement(sqlCmd); if (null != stmt) { // Now execute the query and save the result set rs = stmt.executeQuery(); // Check for a result if (rs != null) { // Check for a result while (rs.next()) { // Save the value String str = rs.getString(1); int num = rs.getInt(2); map.put(str, Integer.valueOf(num)); } // Close the result set rs.close(); rs = null; } // Close the statement stmt.close(); stmt = null; } } catch (SQLException sqlex) { Logger.error(sqlex); } catch (Exception ex) { Logger.error(ex, -1); } finally { // Close the ResultSet if it's not null try { if (rs != null) { rs.close(); rs = null; } } catch (SQLException sqle) { Logger.error(sqle); } // Close the Statement if it's not null try { if (stmt != null) { stmt.close(); stmt = null; } } catch (SQLException sqle) { Logger.error(sqle); } } // Return the result of the operation return map; } /** * Load the database driver. */ public static boolean loadDriver() { // See if the class needs to be loaded boolean found = false; if (!driverLoaded) { // Mark the driver as loaded, whether it's loaded or not driverLoaded = true; try { Class.forName("org.postgresql.Driver"); found = true; } catch (ClassNotFoundException cnfe) { Logger.error(cnfe); cnfe.printStackTrace(); } } return found; } public static Connection createConnection(final String fullUrl, final String username, final String password) { // Make sure the driver is loaded loadDriver(); // This is the connection that gets returned Connection dbConn = null; try { UrlInfo urlInfo = UrlInfo.createFromString(fullUrl); dbConn = DriverManager.getConnection(urlInfo.url, username, password); // Connect to a schema connectToSchema(urlInfo.schema, dbConn); } catch (SQLException sqle) { String errMsg = sqle.getMessage(); System.err.println("Exception creating DB connection: " + errMsg); Logger.error(sqle); } return dbConn; } private static void connectToSchema(String schema, final Connection conn) { if ((schema == null) || schema.trim().isEmpty()) { return; } Statement statement = null; try { statement = conn.createStatement(); statement.execute("set search_path to '" + schema + "'"); } catch (SQLException ex) { ex.printStackTrace(); } finally { try { statement.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * Close the database connection. */ public static void closeConnection(final Connection dbConn) { // Check if the database connection is null if (dbConn == null) { return; } try { // Close the connection dbConn.close(); } catch (SQLException sqle) { System.err.println(sqle.getMessage()); Logger.error(sqle); } } }
a25705f75a917a4e3c0941b45576006c4cdc4faa
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/neo4j/2018/4/JMXManagementModule.java
55d8c4153a341e56633a5f4ffd53b23ca7e4cc39
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
2,546
java
/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.server.enterprise.modules; import java.lang.management.ManagementFactory; import javax.management.InstanceNotFoundException; import javax.management.MBeanServer; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import org.neo4j.server.NeoServer; import org.neo4j.server.enterprise.jmx.ServerManagement; import org.neo4j.server.modules.ServerModule; public class JMXManagementModule implements ServerModule { private final NeoServer server; public JMXManagementModule( NeoServer server ) { this.server = server; } @Override public void start() { try { ServerManagement serverManagement = new ServerManagement( server ); MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer(); beanServer.registerMBean( serverManagement, createObjectName() ); } catch ( Exception e ) { throw new RuntimeException( "Unable to initialize jmx management, see nested exception.", e ); } } @Override public void stop() { try { MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer(); beanServer.unregisterMBean( createObjectName() ); } catch ( InstanceNotFoundException e ) { // ok } catch ( Exception e ) { throw new RuntimeException( "Unable to shut down jmx management, see nested exception.", e ); } } private ObjectName createObjectName() throws MalformedObjectNameException { return new ObjectName( "org.neo4j.ServerManagement", "restartServer", "lifecycle" ); } }
82073f97b4582f360d75348994ecb4afef90f376
31cd3061480c72cdedcf55f94f8b30046c9d2eaf
/tiger/src/test/java/tiger/test/superinject/Phoenix.java
daae23065eb803f448c8d43490072f377a37bcbe
[ "Apache-2.0" ]
permissive
Justice-love/tiger
930970c9164a01786ae7103788961b5e88b9728e
ed15f9be3025cfeecfa91291b958bddde3ed63db
refs/heads/master
2021-01-19T02:44:13.755898
2014-11-14T13:17:46
2014-11-14T13:17:46
25,665,172
1
0
null
null
null
null
UTF-8
Java
false
false
264
java
/** * * @creatTime 下午8:11:12 * @author Eddy */ package tiger.test.superinject; import javax.inject.Named; /** * @author Eddy * */ @Named("phoenix") public class Phoenix extends Animal { public void phoenix() { cow.cow(); } }
046f8522b7f7d738c4e03f3d075d082cbf9719ab
43ff45813c890338a6571083269aa080530a8916
/src/com/tencent/controller/EmpController.java
39690f778226a358b4eeb5d83ed1d996d8e440b8
[]
no_license
javaobjects/day03_springMVC05_validation
86444a86455f5167803c283975520c30fa92903a
150d40c4073899e1a4962979fbf2ee21eaaaa560
refs/heads/master
2020-08-17T14:19:55.795902
2019-10-17T07:21:11
2019-10-17T07:21:11
215,677,474
0
0
null
null
null
null
UTF-8
Java
false
false
11,903
java
package com.tencent.controller; import java.io.IOException; import java.util.Arrays; import java.util.List; import javax.annotation.Resource; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.validation.Valid; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; import org.springframework.validation.ObjectError; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import com.tencent.group.Goup1; import com.tencent.group.Goup2; import com.tencent.pojo.Emp; import com.tencent.service.IEmpService; /** * * <p>Title: EmpController</p> * <p> * Description: * 控制器:处理器请求,响应结果 * </p> * @author xianxian * @date 2019年10月16日 */ @Controller @RequestMapping("/emp")//修饰类,访问路径 http://localhost:8088/day01_springMVC02_requestMapping/emp/get public class EmpController { //@Autowired @Qualifier("empService") //默认根据类型匹配,通常结合@Qualifier指定引用名称使用 @Resource(name = "empService") private IEmpService empService; /** * * <p>Title: getEmps</p> * <p> * Description: * 1.默认支持五种类型:HttpServletRequest、HttpServletResponse、HttpSession、Model、ModelMap * </p> * @param request * @param response * @param session * @param model * @param modelMap * @return */ @RequestMapping("/get") public String getEmps(HttpServletRequest request,HttpServletResponse response,HttpSession session, Model model, ModelMap modelMap) { //request String ename = request.getParameter("ename"); System.out.println("request: " + ename); //response System.out.println("response: 国家:" + response.getLocale().getCountry() + "_" + response.getLocale().getLanguage()); //session System.out.println("session:" + session.getId()); //1.调用service方法,查询所有雇员信息 List<Emp> empList = empService.selectEmps(); //2.保存到作用域,相当于request.setAttribute("empList", empList); model.addAttribute("empList", empList); modelMap.addAttribute("title", "雇员信息列表"); //3.指定跳转的路径,相当于request.getRequestDispatcher("/empQuery.jsp").forward(request,response); return "empQuery";// 前缀 / + empQuery + 后缀.jsp = /empQuery.jsp } /** * * <p>Title: getEmpByempIndex</p> * <p> * Description: * 2.简单类型: * 1 支持整形、字符串、单精度/双单度、布尔型 * * 2 建议所有的基本数据类型使用包装类,例如使用Integer、Float、Double、Boolean类型 * * 3 形式参数的参数名称必须与实际参数(请求发送时的参数)的参数名称保持大小写一至 * <a href="${pageContext.request.contextPath}/emp/ * getEmpByempIndex.action?empIndex=${status.index}">编辑</a> * 中的实际参数empIndex的名称属性与 * public String getEmpByempIndex(Model model,Integer empIndex) * 中的Integer empno的形式参数的名称保持大小写一致 * </p> * @param model * @param empIndex * @return */ @RequestMapping("/getEmpByempIndex") public String getEmpByempIndex(Model model,Integer empIndex) { System.out.println("修改用户的empIndex:" + empIndex); //1. 调用service方法获取当前Emp的信息 Emp emp = empService.selectEmpByempIndex(empIndex); //2. 保存到作用域 model.addAttribute("emp",emp); //3. 转发到修改页面 return "empUpdate"; } /** * 2.1 简单类型: * ① 支持整型、字符串、单精度/双精度、布尔型 * * ② 建议所有的基本数据类型使用包装类,例如使用Integer、Float、Double、Boolean类型,允许接收null值 * * ③ 形式参数的参数名称必须与实际参数(请求发送时的参数)的参数名称保持大小写一致 * * <a href="${pageContext.request.contextPath}/emp/getEmpByEmpno.action?empno=${status.index}">编辑</a>中的实际参数empno的名称 * * 必须与 * * public String getEmpByEmpno(Model model,Integer empno)中的Integer empno的形式参数的名称保持大小写 * * 一致 * * ④ 当形式参数与实际参数(请求参数名)名称不一致时,可使用@RequestParam统一参数信息: * value:表示实际参数名称 * defaultValue:参数为空时的默认值 * required:表示参数是否必带 */ @RequestMapping("/getEmpByEmpno2") public String getEmpByempIndex2(Model model,@RequestParam(value="index",defaultValue="0",required=true)Integer empIndex) { System.out.println("修改用户的empIndex:" + empIndex); //1. 调用service方法获取当前Emp的信息 Emp emp = empService.selectEmpByempIndex(empIndex); //2. 保存到作用域 model.addAttribute("emp",emp); //3. 转发到修改页面 return "empUpdate"; } /** * * <p>Title: updateEmp</p> * <p> * Description: * 3. 简单pojo类型: * 将表单域的name属性值与pojo对象的属性名称保持大小写一致,即: * <input type="text" name="ename" value="${emp.ename}">中的name属性值ename * 与 * public String updateEmp(HttpServletRequest request,Emp emp)方法中emp对象的setEname后的ename名称保持 * 大小写一致 * * 4. 复杂(包装)pojo类型:dept.deptno dept.dname * * 5. 自定义参数:需自定义转换器 * </p> * @param request * @param emp * @return */ @RequestMapping("/updateEmp") public String updateEmp(HttpServletRequest request,Emp emp) { System.out.println("修改用户的信息:" + emp); return "success"; } /** * * <p>Title: insertEmp</p> * <p> * Description: * @Validated:表示pojo对象需要被校验 * BindingResult:保存校验不通过的错误信息 * * * @Validated与BindingResult通常一前一后结合使用,前者负责校验,后者负责取校验错误结果 * </p> * @param model * @param emp * @param bindingResult * @return */ @RequestMapping("/insertEmp") public String insertEmp(Model model,@Validated(value = {Goup1.class,Goup2.class}) Emp emp,BindingResult bindingResult,Integer id) { //判断是否有错误结果 if(bindingResult.hasErrors()) { //获取错误结果 List<ObjectError> errorList = bindingResult.getAllErrors(); /*for (ObjectError error : errorList) { System.err.println(error.getDefaultMessage()); }*/ //将错误结果保存在request作用域 model.addAttribute("errorList",errorList); /** * 数据回显: * 1.pojo类型:默认保存在request作用域中,作用域中key值默认为pojo类型首字母小写,即Emp的key为emp * * 2.简单类型:需要手动保存到作用域中 */ //model.addAttribute("emp",emp); model.addAttribute("id",id); //跳转回新增界面,并显示错误信息 return "empInsert"; } System.out.println("新增用户的信息:" + emp); return "success"; } /** * * <p>Title: deleteEmps</p> * <p> * Description: * 6.数组类型 * 1. 实际参数的名称与形式参数名称保持大小写一致 * <input type="checkbox" name="empnos" value="${emp.empno}">中的name属性值empnos * 与 * public String deleteEmps(Integer[] empnos) 中的empnos保持大小写一致 * </p> * @param empnos * @return */ @RequestMapping("/deleteEmps") public String deleteEmps(Integer[] empnos) { System.out.println("删除用户的empno:" + Arrays.toString(empnos)); return "success"; } /** * * <p>Title: getSubEmpByEmpno</p> * <p> * Description: * 7. List集合 * </p> * @param model * @param empno * @return */ @RequestMapping("/getSubEmpByempIndex") public String getSubEmpByempIndex(Model model,Integer empIndex) { System.out.println("查看当前用户的empIndex:" + empIndex); //当前员工的信息 Emp emp = empService.selectEmpByempIndex(empIndex); System.out.println("查看当前用户的empno: " + empIndex + "得到的员工信息:" + emp); //当前员工的下属信息 List<Emp> subEmpList = emp.getSubEmpList(); //保存数据 model.addAttribute("emp",emp); model.addAttribute("subEmpList",subEmpList); return "subEmpQuery"; } @RequestMapping("/updateSubEmps") public String updateSubEmps(Emp emp) { List<Emp> subEmpList = emp.getSubEmpList(); for(Emp subEmp : subEmpList) { System.out.println(subEmp); } return "success"; } /** * * <p>Title: getEmps3</p> * <p> * Description: * 2.返回String: 返回跳转页面的路径 * </p> * @param request * @return */ @RequestMapping("/get2") public String getEmps2(HttpServletRequest request) { //1.调用service方法,查询所有雇员信息 List<Emp> empList = empService.selectEmps(); //2.保存到作用域,相当于request.setAttribute("empList", empList); request.setAttribute("empList", empList); //3.指定跳转的路径,相当于request.getRequestDispatcher("/empQuery.jsp").forward(request,response); return "empQuery";// 前缀 / + empQuery + 后缀.jsp = /empQuery.jsp } /** * * <p>Title: getEmps3</p> * <p> * Description: * 2.1 返回String: 返回跳转页面的路径,使用转发forward: * * </p> * @param request * @return */ @RequestMapping("/get3") public String getEmps3(HttpServletRequest request) { //1.调用service方法,查询所有雇员信息 List<Emp> empList = empService.selectEmps(); //2.保存到作用域,相当于request.setAttribute("empList", empList); request.setAttribute("empList", empList); //3.指定跳转的路径,相当于request.getRequestDispatcher("/empQuery.jsp").forward(request,response); return "forward:/empQuery.jsp";// 不会拼接前后缀 } /** * * <p>Title: getEmps4</p> * <p> * Description: * 2.2 返回String: 返回跳转页面的路径,使用重定向redirect: * * </p> * @param request * @return */ @RequestMapping("/get4") public String getEmps4(HttpServletRequest request) { //1.调用service方法,查询所有雇员信息 List<Emp> empList = empService.selectEmps(); //2.保存到作用域,相当于session.setAttribute("empList", empList); request.getSession().setAttribute("empList", empList); //3.指定跳转的路径,相当于response.sendRedirect(request.getContextPath + "/empQuery.jsp"); return "redirect:/empQuery.jsp";// 不会拼接前后缀 } /** * * <p>Title: getEmps5</p> * <p> * Description: * 3. 返回void: 无返回值 * * </p> * @param request * @param response * @throws ServletException * @throws IOException */ @RequestMapping("/get5") public void getEmps5(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { //1.调用service方法,查询所有雇员信息 List<Emp> empList = empService.selectEmps(); //2.保存到作用域,相当于session.setAttribute("empList", empList); request.setAttribute("empList", empList); //3.指定跳转的路径,相当于request.getRequestDispatcher("/empQuery.jsp").forward(request,response); request.getRequestDispatcher("/empQuery.jsp").forward(request,response); } }
a5af9dcbcf2eb5c463cbe1a9075d2f1f7def6c96
ceb1468643edac7acd725656e15869f21bbd33a2
/supersql/codegenerator/PDF/PDFAttribute.java
6ed366cd5bc194142daffa0f87753ccb49217183
[]
no_license
Constellation/NewSSQL
ffdae830c2c34cd3762eb957a5f6ac05e103cdc7
b8cb6e53c4ca531859994c0f191dc7acf0f0f459
refs/heads/master
2021-01-22T19:09:14.658839
2016-09-23T09:28:24
2016-09-23T09:28:24
85,172,234
1
1
null
2017-03-16T08:38:06
2017-03-16T08:38:05
null
EUC-JP
Java
false
false
9,544
java
package supersql.codegenerator.PDF; import supersql.codegenerator.Attribute; import supersql.codegenerator.Manager; import supersql.codegenerator.TFE; import supersql.extendclass.ExtList; public class PDFAttribute extends Attribute implements PDFTFE { private PDFEnv pdf_env; private PDFValue value; private String data; private float data_width; private float data_height; private float box_width; private float box_height; private float padding_H; private float padding_V; private float fontsize; private String fontstyle; //レイアウト変換用 newLEはAttributeでは特に意味はない private TFE newLE; private boolean change = false; private boolean fontsizeDECO = false; private boolean widthDECO = false; private float tuneWidth = 0; private float tmpTuneWidth; private float tuneFontsize = 0; private float tmpTuneFontsize; //コンストラクタ public PDFAttribute(Manager manager, PDFEnv penv) { super(); this.pdf_env = penv; new PDFModifier(); } //Attributeのworkメソッド @Override public String work(ExtList data_info) { // int level = pdf_env.level; padding_H = pdf_env.padding_H; padding_V = pdf_env.padding_V; fontsize = pdf_env.DefaultFontSize; System.out.println("++++ Attでvalueをnewします"); this.value = new PDFValue("Att"); //上位の装飾情報の退避 from PDFEnv data = this.getStr(data_info); System.out.println("[PDFAtt]data = "+data); //値を代入する前に処理する装飾子 setDecoration1(); if(tuneFontsize != 0) fontsize = tuneFontsize; //-------------------------------------------------------// //data_width = modifier.stringwidth(data, pdf_env); data_width = pdf_env.stringwidth(data, fontsize); //data_height = pdf_env.fontsize;////仮に高さを固定にする data_height = fontsize;////仮に高さを固定にする //誤差による表構造の乱れの解消!! if(data_width - (int)data_width > 0.9) data_width = (int)data_width + 1; box_width = data_width + padding_H * 2; box_height = data_height + padding_V * 2; //-------------------------------------------------------// //値を代入する直前に処理する装飾子 fontstyle = pdf_env.DefaultFontStyle; setDecoration2();//imageのように場所を変えるべきかも if(tuneWidth != 0) box_width = tuneWidth; //追加10.27 テキストボックス処理のため if(box_width - padding_H * 2 < data_width){ data_width = box_width - padding_H * 2; data_height = pdf_env.textflow_blind(data, fontsize, fontstyle, data_width); box_height = data_height + padding_V * 2; } System.out.println("*************"+data_width+" "+box_width); //変更10.17 value.data = data; value.data_width = data_width; value.data_height = data_height; value.box_width = box_width; value.box_height = box_height; value.padding = padding_H; value.fontsize = fontsize; value.fontstyle = fontstyle; value.originalWidth = box_width; //C2のレイアウト変換に使用 value.originalHeight = box_height; //C1のレイアウト変換に使用 //値を代入した後にに処理する装飾子 setDecoration3(); //問題点 //modifier.set_modifier2(data, data_width, pdf_env, value); //追加10.17 pdf_env.tmp_width = box_width; pdf_env.tmp_height = box_height; return null; //退避していた装飾情報を戻す to PDFEnv } public void setDecoration1(){ //余白 if(decos.containsKey("padding")){ padding_H = Float.parseFloat(decos.get("padding").toString()); padding_V = Float.parseFloat(decos.get("padding").toString()); } //文字サイズ if(decos.containsKey("font-size")){ fontsize = Float.parseFloat(decos.get("font-size").toString()); fontsizeDECO = true; } else if(decos.containsKey("font size")){ fontsize = Float.parseFloat(decos.get("font size").toString()); fontsizeDECO = true; } else if(decos.containsKey("size")){ fontsize = Float.parseFloat(decos.get("size").toString()); fontsizeDECO = true; } else if(decos.containsKey("fontsize")){ fontsize = Float.parseFloat(decos.get("fontsize").toString()); fontsizeDECO = true; } //文字のスタイル if(decos.containsKey("style")) fontstyle = decos.get("style").toString(); else if(decos.containsKey("font-style")) fontstyle = decos.get("font-style").toString(); else if(decos.containsKey("font style")) fontstyle = decos.get("font style").toString(); else if(decos.containsKey("fontstyle")) fontstyle = decos.get("fontstyle").toString(); } public void setDecoration2(){ //セルの幅・高さ dataで取らないとテキストボックスにならない+heightを指定しないと行を変えられない if(decos.containsKey("width")){ box_width = Float.parseFloat(decos.get("width").toString()); widthDECO = true; } //テキストボックス処理 text_flowで解決 if(decos.containsKey("height")) box_height = Float.parseFloat(decos.get("height").toString()); } public void setDecoration3(){ //文字位置 if(decos.containsKey("align")) value.align = decos.get("align").toString(); if(decos.containsKey("valign")) value.valign = decos.get("valign").toString(); //背景色 if(decos.containsKey("background-color")) value.bgcolor = decos.get("background-color").toString(); else if(decos.containsKey("bgcolor")) value.bgcolor = decos.get("bgcolor").toString(); //文字色 if(decos.containsKey("color")) value.fontcolor = decos.get("color").toString(); else if(decos.containsKey("font-color")) value.fontcolor = decos.get("font-color").toString(); else if(decos.containsKey("font color")) value.fontcolor = decos.get("font color").toString(); else if(decos.containsKey("fontcolor")) value.fontcolor = decos.get("fontcolor").toString(); } public PDFValue getInstance(){ System.out.println("++++ Attをsetしました"); return this.value; } public void setLabel(PDFValue result) { int labelH = pdf_env.labelH; int labelV = pdf_env.labelV; int labelO = pdf_env.labelO; if( pdf_env.labelSuffixH.equals("null") ) result.labelH = Integer.toString(labelH); else result.labelH = Integer.toString(labelH) + pdf_env.labelSuffixH; if( pdf_env.labelSuffixV.equals("null") ) result.labelV = Integer.toString(labelV); else result.labelV = Integer.toString(labelV) + pdf_env.labelSuffixV; if( pdf_env.labelSuffixH.equals("null") ) result.labelOH = Integer.toString(labelO); else result.labelOH = Integer.toString(labelO) + pdf_env.labelSuffixH; if( pdf_env.labelSuffixV.equals("null") ) result.labelOV = Integer.toString(labelO); else result.labelOV = Integer.toString(labelO) + pdf_env.labelSuffixV; if( !pdf_env.labelListH.contains(result.labelH) ) pdf_env.labelListH.add(result.labelH); if( !pdf_env.labelListV.contains(result.labelV) ) pdf_env.labelListV.add(result.labelV); if( !pdf_env.labelListOH.contains(result.labelOH) ) pdf_env.labelListOH.add(result.labelOH); if( !pdf_env.labelListOV.contains(result.labelOV) ) pdf_env.labelListOV.add(result.labelOV); } //Attributeでは特に意味はない public void restoreFOLD(PDFValue check){ } public boolean optimizeW(float Dexcess, PDFValue box){ boolean flex = false; //fontsizeの縮小も幅の指定もまだ仮 条件がいい加減 if(!fontsizeDECO){ //下のif文の条件を変えたので、指定があってもいいかも int charNum = box.data.length();//英数字が入ると等幅ではないからlengthじゃあ対応しきれないかも float DperChar = Dexcess / charNum; float newFontsize = box.fontsize - DperChar; if( newFontsize > box.fontsize - (pdf_env.DefaultFontSize - pdf_env.minFontsize) ){ //if(newFontsize > pdf_env.minFontsize){ // decos.put("fontsize", Float.toString(newFontsize)); tmpTuneFontsize = tuneFontsize; tuneFontsize = newFontsize; System.out.println("fontsize change"); //change = true;//layoutの変更がある訳ではないので flex = true; pdf_env.cutWidth = Dexcess; } } //else if(!widthDECO){ if(!widthDECO && !flex){ //if(!widthDECO){ float newWidth = box.box_width - Dexcess; //pdf_env.flexTHを使わないといけない if(newWidth > 0){ //--------------------------------------// // Attributeは新しくnewするのは難しい // // newLE = new PDFAttribute(manager, pdf_env); // ((PDFAttribute)newLE).decos = this.decos; // ((PDFAttribute)newLE).Items = this.Items; // decos.put("width", Float.toString(newWidth)); // change = true;//やっぱり変更タイプにするC1に凝る影響 //--------------------------------------// // decos.put("width", Float.toString(newWidth)); tmpTuneWidth = tuneWidth; tuneWidth = newWidth; System.out.println("width change"); //change = true;//layoutの変更がある訳ではないので flex = true; pdf_env.cutWidth = Dexcess; } } return flex; } public boolean optimizeH(float Dexcess, PDFValue box){ boolean flex = false; return flex; } public void redoChange(){ tuneWidth = tmpTuneWidth; tuneFontsize = tmpTuneFontsize; } //Attributeでは特に意味はない public TFE getNewChild(){ return newLE; } public boolean changeORnot(){ return change; } }
7dc0c457a1889bc4528449128ae07387c65d5be8
8246e05fe9af988c580c66573136deae598b6f72
/src/com/stark/web/entity/DialogueInfo.java
09b5b409628fda40fb5bb2da3481383e91a34a06
[]
no_license
songcser/Gam
9cce4c5b98a7fbe30c0b432e79ce5656ffed93e9
7fb172a825bc4245adf424a918ea456b3dbf778a
refs/heads/master
2021-01-10T19:40:33.362142
2015-07-02T09:53:54
2015-07-02T09:53:54
37,971,001
1
0
null
null
null
null
UTF-8
Java
false
false
1,376
java
package com.stark.web.entity; import java.util.Date; public class DialogueInfo { private static String key = "Dialogue:Info:Hash:"; public static String DIALOGUEID = "DialogueId"; public static String USERID = "UserId"; public static String CHARTLETID = "ChartletId"; public static String CONTENT = "Content"; public static String NUMBER = "Number"; public static String DATE = "Date"; private int dialogueId; private UserInfo user; private ChartletInfo chartlet; private String content; private int number; private Date date; public int getDialogueId() { return dialogueId; } public void setDialogueId(int dialogueId) { this.dialogueId = dialogueId; } public UserInfo getUser() { return user; } public void setUser(UserInfo user) { this.user = user; } public ChartletInfo getChartlet() { return chartlet; } public void setChartlet(ChartletInfo chartlet) { this.chartlet = chartlet; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public String getKey() { return key+dialogueId; } public static String getKey(int id) { return key+id; } }
ce7287af1c3ab5daeee7ca597eb3d585a13ca662
cedcb6da09c5d4527d8d7f6d3b811c37c5e0c4fb
/homework8-bookservice/src/main/java/ua/edu/ukma/krukovska/bookservice/persistence/repository/BookRepository.java
f1c7e20110511679d7afbc23b3c74aedf51fcb57
[]
no_license
YanaKrukovska/javaee-course
91673a6808ed50b726617057dd241f67ed7b9904
089accae1f69a8f603172186e3d106b06df181a2
refs/heads/master
2023-04-04T15:18:36.565608
2021-04-03T14:05:08
2021-04-03T14:05:08
340,674,976
0
0
null
null
null
null
UTF-8
Java
false
false
669
java
package ua.edu.ukma.krukovska.bookservice.persistence.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import ua.edu.ukma.krukovska.bookservice.persistence.model.Book; import java.util.List; public interface BookRepository extends JpaRepository<Book, Long> { Book findByIsbn(String isbn); Book getById(Integer id); @Query("SELECT b FROM Book b WHERE lower(b.title) LIKE %:q% OR lower(b.author) LIKE %:q% OR lower(b.isbn) LIKE %:q%") List<Book> findAllWhereTitleLikeOrAuthorLikeOrIsbnLike(@Param("q") String q); }
cd4ad9aebf095759384ce38c03d155821a64afad
9f0e5d97a075f897dfb1eb85489090beb7ffbf13
/src/main/java/com/stylegame/lavaindustries/hadlers/FuelHandler.java
af3d9f35c991c23b725b9b26a65944f1ce14ded3
[ "MIT" ]
permissive
DenisMasterHerobrine/Lava-Industries
6b267c3245c42e549afdf9c666ad2669b7c4d374
3e3e517a29c48ff9afb8397e8c50b0c2bddfe5b1
refs/heads/master
2021-05-09T23:26:40.619413
2019-05-12T17:38:09
2019-05-12T17:38:09
118,784,451
0
0
null
null
null
null
UTF-8
Java
false
false
670
java
package com.stylegame.lavaindustries.hadlers; import com.stylegame.lavaindustries.register.BlocksRegister; import com.stylegame.lavaindustries.register.ItemReg; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.IFuelHandler; public class FuelHandler implements IFuelHandler { @Override public int getBurnTime(ItemStack fuel) { Item fuelItem = fuel.getItem(); if (fuelItem == ItemReg.LavaCoal) { return 6400; } else if (fuelItem == Item.getItemFromBlock(BlocksRegister.LavaCoalBlock)) { return 64000; } return 0; } }
19484fba3caf480b22069e1809825a17a94ff85c
55e7b08d6e1af1ec458454b719d3b4cd2c337444
/JavaApplication1/src/javaapplication1/ScrabbleComparator.java
26e7a654c927cd4684ac579efc1734a4bd2ab03b
[]
no_license
Simclem/JavaScrabble
3601709fa4405397c627ce1713df6881a00ce27d
1b62644656d6eec875098c0945114fc58b1331cf
refs/heads/master
2020-04-06T04:53:53.842179
2016-11-24T18:30:22
2016-11-24T18:30:22
73,829,143
1
0
null
null
null
null
UTF-8
Java
false
false
1,640
java
package javaapplication1; import java.util.Comparator; public class ScrabbleComparator implements Comparator<String>{ private char[] letters; public ScrabbleComparator(char[] letters){ this.letters = letters; } public int letterValue(char letter){ String[] groupPoints = {"*", "eainorstul", "dmg", "bcp", "fhv", "jq", "kwxyz"}; String s = "" + letter; s = Dictionnary.replaceFrenchCharacter(s); CharSequence cs = "" + s; if (groupPoints[0].contains(cs)){ return 0; } else if (groupPoints[1].contains(cs)){ return 1; } else if (groupPoints[2].contains(cs)){ return 2; } else if (groupPoints[3].contains(cs)){ return 3; } else if (groupPoints[4].contains(cs)){ return 4; } else if (groupPoints[5].contains(cs)){ return 8; } else if (groupPoints[6].contains(cs)){ return 10; } return -1; } public int lettersValue(char[] letters){ int score = 0; for (int i = 0; i < letters.length; i++){ score += letterValue(letters[i]); } return score; } public int wordValue(String word) { return lettersValue(Dictionnary.getComposition(word, letters)); } public int compare(String s1, String s2){ if (wordValue(s1) < wordValue(s2)){ return 1; } else if (wordValue(s1) == wordValue(s2)){ return 0; } else{ return -1; } } }
bd66fa45df574c8698a56b39c5b8384850d91c65
7af33f1f4c862f437507b73c7f5c254d5a668662
/EurkaTest/user_provider/src/main/java/com/test/domin/User.java
081b3ec8e76b983d9b70c54461a161766664398f
[]
no_license
linguangshen/TestDemo
bc29d5d7bcfe19ee4a999b12a7f80942d6e33dc2
32783f2a6bcb6785591ab5721c91478d42695a9e
refs/heads/master
2023-01-24T05:43:33.199709
2020-11-11T15:23:53
2020-11-11T15:23:53
310,996,438
0
0
null
null
null
null
UTF-8
Java
false
false
219
java
package com.test.domin; import lombok.Data; import java.io.Serializable; @Data public class User implements Serializable { private int id; private int age; private String name; private String city; }
2943062f127067da8617efb3d622dac0d7857bd4
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes5.dex_source_from_JADX/com/google/common/collect/EnumMultiset.java
61590db1c73600012b7bbd994038878dd8463715
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
2,375
java
package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.GwtIncompatible; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.Collection; import java.util.EnumMap; import java.util.Set; import javax.annotation.Nullable; @GwtCompatible /* compiled from: call_comment_id */ public final class EnumMultiset<E extends Enum<E>> extends AbstractMapBasedMultiset<E> { private transient Class<E> f7302a; public final /* bridge */ /* synthetic */ boolean addAll(Collection collection) { return super.addAll(collection); } public final /* bridge */ /* synthetic */ boolean contains(@Nullable Object obj) { return super.contains(obj); } public final /* bridge */ /* synthetic */ Set m13338d() { return super.d(); } public final /* bridge */ /* synthetic */ boolean equals(@Nullable Object obj) { return super.equals(obj); } public final /* bridge */ /* synthetic */ int hashCode() { return super.hashCode(); } public final /* bridge */ /* synthetic */ boolean isEmpty() { return super.isEmpty(); } public final /* bridge */ /* synthetic */ boolean remove(@Nullable Object obj) { return super.remove(obj); } public final /* bridge */ /* synthetic */ boolean removeAll(Collection collection) { return super.removeAll(collection); } public final /* bridge */ /* synthetic */ boolean retainAll(Collection collection) { return super.retainAll(collection); } public final /* bridge */ /* synthetic */ String toString() { return super.toString(); } @GwtIncompatible("java.io.ObjectOutputStream") private void writeObject(ObjectOutputStream objectOutputStream) { objectOutputStream.defaultWriteObject(); objectOutputStream.writeObject(this.f7302a); Serialization.m13652a((Multiset) this, objectOutputStream); } @GwtIncompatible("java.io.ObjectInputStream") private void readObject(ObjectInputStream objectInputStream) { objectInputStream.defaultReadObject(); this.f7302a = (Class) objectInputStream.readObject(); this.a = WellBehavedMap.m13783a(new EnumMap(this.f7302a)); Serialization.m13650a((Multiset) this, objectInputStream); } }
cf10d2bb65017f55c5f493c7918ec848bb494e67
475f60f76f132f9528fa33d155957d037c2e12f8
/app/src/main/java/com/bysj/imageutil/util/ClickUtil.java
e31b087d405f3919f55fdb70ab59e5692b9693c2
[ "Apache-2.0" ]
permissive
AivenLi/ImageUtil
72d99328ba50e93dfc77c7ce77e576782e7192e1
8c887486f87fcb3727027e231ebd6fa629d5f9b6
refs/heads/main
2023-04-03T14:20:55.530881
2021-04-07T03:56:45
2021-04-07T03:56:45
334,087,237
5
2
null
null
null
null
UTF-8
Java
false
false
380
java
package com.bysj.imageutil.util; public class ClickUtil { private static long lastClickTime; public static boolean isFastDoubleClick() { long time = System.currentTimeMillis(); long timeD = time - lastClickTime; if ( 0 < timeD && timeD < 800 ) { return true; } lastClickTime = time; return false; } }
c824bbbfbd7f0a8eb9c37ac31571746796d426c0
68629396678105a2abc0d68f285fa631acfb21d6
/ClassAndObject/src/classandobjects/pro2.java
d5bc56b3b30878a12ab49c7e7c128a0d9719fa27
[]
no_license
180030416/180030416_s5
d45f57a3452618b484fe81f881d5019a9f11582c
9bfb14382c98fd0178aae00fdca4e5ad9d42f8e3
refs/heads/master
2023-05-07T23:04:15.826003
2021-05-22T13:19:29
2021-05-22T13:19:29
366,261,832
2
1
null
null
null
null
UTF-8
Java
false
false
475
java
package classandobjects; public class pro2 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(Calculator.powerDouble(85.0, 2)); System.out.println(Calculator.powerInt(85,3)); } } class Calculator { static double powerInt(int num1,int num2) { return Math.pow(num1,num2); } static double powerDouble(double num1,int num2) { return Math.pow(num1,num2); } }
7fba0454803ac6b067fc6be2f6c0c1972328b2a4
0e3fa776cfaf72d659ebdff71eeebb5d6d3a3309
/app/src/androidTest/java/com/example/luoxiao/myweather/ApplicationTest.java
0bdb0a21ca26ac6ce94cb9df6216dc3182f81353
[]
no_license
voidException/MyWeather
65dc2e36495bd38e582de88e74160a31b9fac340
6d7e5cbc990ead12949b5198aae82e2235cd16f8
refs/heads/master
2021-01-10T01:32:47.430120
2015-11-04T05:34:28
2015-11-04T05:34:28
45,517,506
0
0
null
null
null
null
UTF-8
Java
false
false
360
java
package com.example.luoxiao.myweather; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
9a773e86a2ecef1430c5a0443dcaa90e1fc66790
327d615dbf9e4dd902193b5cd7684dfd789a76b1
/base_source_from_JADX/sources/androidx/appcompat/view/menu/C0172b.java
620d1345bcb513208926c7529e99f7d1e7912f78
[]
no_license
dnosauro/singcie
e53ce4c124cfb311e0ffafd55b58c840d462e96f
34d09c2e2b3497dd452246b76646b3571a18a100
refs/heads/main
2023-01-13T23:17:49.094499
2020-11-20T10:46:19
2020-11-20T10:46:19
314,513,307
0
0
null
null
null
null
UTF-8
Java
false
false
5,142
java
package androidx.appcompat.view.menu; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.appcompat.view.menu.C0198m; import androidx.appcompat.view.menu.C0200n; import java.util.ArrayList; /* renamed from: androidx.appcompat.view.menu.b */ public abstract class C0172b implements C0198m { /* renamed from: a */ protected Context f554a; /* renamed from: b */ protected Context f555b; /* renamed from: c */ protected C0183g f556c; /* renamed from: d */ protected LayoutInflater f557d; /* renamed from: e */ protected LayoutInflater f558e; /* renamed from: f */ protected C0200n f559f; /* renamed from: g */ private C0198m.C0199a f560g; /* renamed from: h */ private int f561h; /* renamed from: i */ private int f562i; /* renamed from: j */ private int f563j; public C0172b(Context context, int i, int i2) { this.f554a = context; this.f557d = LayoutInflater.from(context); this.f561h = i; this.f562i = i2; } /* renamed from: a */ public View mo1297a(C0187i iVar, View view, ViewGroup viewGroup) { C0200n.C0201a b = view instanceof C0200n.C0201a ? (C0200n.C0201a) view : mo1305b(viewGroup); mo1302a(iVar, b); return (View) b; } /* renamed from: a */ public C0198m.C0199a mo1298a() { return this.f560g; } /* renamed from: a */ public C0200n mo1299a(ViewGroup viewGroup) { if (this.f559f == null) { this.f559f = (C0200n) this.f557d.inflate(this.f561h, viewGroup, false); this.f559f.initialize(this.f556c); updateMenuView(true); } return this.f559f; } /* renamed from: a */ public void mo1300a(int i) { this.f563j = i; } /* access modifiers changed from: protected */ /* renamed from: a */ public void mo1301a(View view, int i) { ViewGroup viewGroup = (ViewGroup) view.getParent(); if (viewGroup != null) { viewGroup.removeView(view); } ((ViewGroup) this.f559f).addView(view, i); } /* renamed from: a */ public abstract void mo1302a(C0187i iVar, C0200n.C0201a aVar); /* renamed from: a */ public boolean mo1303a(int i, C0187i iVar) { return true; } /* access modifiers changed from: protected */ /* renamed from: a */ public boolean mo1304a(ViewGroup viewGroup, int i) { viewGroup.removeViewAt(i); return true; } /* renamed from: b */ public C0200n.C0201a mo1305b(ViewGroup viewGroup) { return (C0200n.C0201a) this.f557d.inflate(this.f562i, viewGroup, false); } public boolean collapseItemActionView(C0183g gVar, C0187i iVar) { return false; } public boolean expandItemActionView(C0183g gVar, C0187i iVar) { return false; } public boolean flagActionItems() { return false; } public int getId() { return this.f563j; } public void initForMenu(Context context, C0183g gVar) { this.f555b = context; this.f558e = LayoutInflater.from(this.f555b); this.f556c = gVar; } public void onCloseMenu(C0183g gVar, boolean z) { C0198m.C0199a aVar = this.f560g; if (aVar != null) { aVar.mo914a(gVar, z); } } public boolean onSubMenuSelected(C0207r rVar) { C0198m.C0199a aVar = this.f560g; if (aVar != null) { return aVar.mo915a(rVar); } return false; } public void setCallback(C0198m.C0199a aVar) { this.f560g = aVar; } public void updateMenuView(boolean z) { ViewGroup viewGroup = (ViewGroup) this.f559f; if (viewGroup != null) { C0183g gVar = this.f556c; int i = 0; if (gVar != null) { gVar.flagActionItems(); ArrayList<C0187i> visibleItems = this.f556c.getVisibleItems(); int size = visibleItems.size(); int i2 = 0; for (int i3 = 0; i3 < size; i3++) { C0187i iVar = visibleItems.get(i3); if (mo1303a(i2, iVar)) { View childAt = viewGroup.getChildAt(i2); C0187i itemData = childAt instanceof C0200n.C0201a ? ((C0200n.C0201a) childAt).getItemData() : null; View a = mo1297a(iVar, childAt, viewGroup); if (iVar != itemData) { a.setPressed(false); a.jumpDrawablesToCurrentState(); } if (a != childAt) { mo1301a(a, i2); } i2++; } } i = i2; } while (i < viewGroup.getChildCount()) { if (!mo1304a(viewGroup, i)) { i++; } } } } }
187d81865f211eeb3f5313c2195cc6f31716d3f6
6889f8f30f36928a2cd8ba880032c855ac1cc66c
/dev/ChaseOrbitalGateway/src/semplest/server/service/orbital/test/VoidSample.java
2e2d10b03111b9c177591d800f36f79c4c70c19d
[]
no_license
enterstudio/semplest2
77ceb4fe6d076f8c161d24b510048802cd029b67
44eeade468a78ef647c62deb4cec2bea4318b455
refs/heads/master
2022-12-28T18:35:54.723459
2012-11-20T15:39:09
2012-11-20T15:39:09
86,645,696
0
0
null
2020-10-14T08:14:22
2017-03-30T01:32:35
Roff
UTF-8
Java
false
false
5,907
java
package semplest.server.service.orbital.test; import com.paymentech.orbital.sdk.interfaces.RequestIF; import com.paymentech.orbital.sdk.interfaces.ResponseIF; import com.paymentech.orbital.sdk.interfaces.TransactionProcessorIF; import com.paymentech.orbital.sdk.request.FieldNotFoundException; import com.paymentech.orbital.sdk.request.Request; import com.paymentech.orbital.sdk.transactionProcessor.TransactionException; import com.paymentech.orbital.sdk.transactionProcessor.TransactionProcessor; import com.paymentech.orbital.sdk.util.exceptions.InitializationException; public class VoidSample { //Global Constants public final static int NORMAL_EXIT = 1; public final static int ERROR_EXIT = -1; public static void main(String[] args) { /** * Please note that this code is for documentation purposes only and is * specifically written in a simplistic way, in order to better represent and * convey specific concepts in the use of the Orbital SDK. * Best practices in error handling and control flow for java coding, * have often been ignored in favor of providing code that clearly represents * a specific concept. * Due to the best practices compromises we have made in our sample code, * we do not recommend using this code in a production environment without * rigorous improvements to error handling and overall architecture. */ //Create a Transaction Processor //The Transaction Processor acquires and releases resources and executes transactions. //It configures a pool of protocol engines, then uses the pool to execute transactions. TransactionProcessorIF tp = null; try { tp = new TransactionProcessor(); } catch (InitializationException iex) { System.err.println("TransactionProcessor failed to initialize"); System.err.println(iex.getMessage()); iex.printStackTrace(); System.exit(ERROR_EXIT); } //Create a request object //The request object uses the XML templates along with data we provide //to generate a String representation of the xml request RequestIF request = null; try { request = new Request(RequestIF.REVERSE_TRANSACTION); request.setFieldValue("MerchantID", "041756"); request.setFieldValue("BIN", "000001"); request.setFieldValue("OrderID", "1223Reverse"); //Note: Copy a TxRefNum from a previously approved auth, and recompile this sample request.setFieldValue("TxRefNum", "4395E2348E2364AADC5F93451528B19F24C55389"); //Display the request System.out.println("\nVoid Request:\n" + request.getXML()); } catch (InitializationException ie) { System.err.println("Unable to initialize request object"); System.err.println(ie.getMessage()); ie.printStackTrace(); System.exit(ERROR_EXIT); } catch (FieldNotFoundException fnfe) { System.err.println("Unable to find XML field in template"); System.err.println(fnfe.getMessage()); fnfe.printStackTrace(); System.exit(ERROR_EXIT); } catch (Exception ex) { ex.printStackTrace(); System.exit(ERROR_EXIT); } //Process the transaction //Pass in the request object (created above), and receive a response object. //If the resources required by the Transaction Processor have been exhausted, //this code will block until the resources become available. //The "TransactionProcessor.poolSize" configuration property specifies how many resources //will be available. The TransactionProcessor acts as a governor, only allowing //up to "poolSize" transactions outstanding at any point in time. //As transactions are completed, their resources are placed back in the pool. ResponseIF response = null; try { response = tp.process(request); } catch (TransactionException tex) { System.err.println("Transaction failed, including retries and failover"); System.err.println(tex.getMessage()); tex.printStackTrace(); System.exit(ERROR_EXIT); } //Display the response //This line displays the entire xml response on the java system console. System.out.println("\nResponse:\n" + response.toXmlString() + "\n"); //The lines below report all the various attributes of the response object. //It is not necessary to use all of these attributes - use only the ones you need. //Also, some of the attributes are meaningful only for specific types of transactions, //but for consistency and simplicity in the sample code we dump them all for every transaction type. System.out.println("Response Attributes:"); System.out.println("isGood=" + response.isGood()); System.out.println("isError=" + response.isError()); System.out.println("isQuickResponse=" + response.isQuickResponse()); System.out.println("isApproved=" + response.isApproved()); System.out.println("isDeclined=" + response.isDeclined()); System.out.println("AuthCode=" + response.getAuthCode()); System.out.println("TxRefNum=" + response.getTxRefNum()); System.out.println("ResponseCode=" + response.getResponseCode()); System.out.println("Status=" + response.getStatus()); System.out.println("Message=" + response.getMessage()); System.out.println("AVSCode=" + response.getAVSResponseCode()); System.out.println("CVV2ResponseCode=" + response.getCVV2RespCode()); } }
[ "Nan@02200ff9-b5b2-46f0-9171-221b09c08c7b" ]
Nan@02200ff9-b5b2-46f0-9171-221b09c08c7b
e0012863ca08e035ff0e4c6f810dbc84afef45ef
f26db551184bf906d6d8c5c5089e900820da7671
/sgoa/src/main/java/com/bcqsoft/sgoa/service/netshare/impl/.svn/text-base/NetShareServiceImpl.java.svn-base
11b6b4329f06410a3268f6595dd64d13f8fab5cb
[]
no_license
flypig5211/sgoa
eaad47612f2a9e8913cabbcf66dfd93baa872eb3
0344bef1746d72e5d2678c3ccf17d7cadc7a3473
refs/heads/master
2021-12-26T07:36:23.471981
2018-01-04T03:02:34
2018-01-04T03:02:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,607
package com.bcqsoft.sgoa.service.netshare.impl; import java.util.List; import static com.bcqsoft.sgoa.common.util.ArrayUtil.toStringArray; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bcqsoft.sgoa.core.base.BaseService; import com.bcqsoft.sgoa.core.security.SecurityUtils; import com.bcqsoft.sgoa.dao.netshare.NetShareDAO; import com.bcqsoft.sgoa.dao.netshare.dataobject.NetShare; import com.bcqsoft.sgoa.service.netshare.NetShareService; @Service public class NetShareServiceImpl extends BaseService implements NetShareService { @Autowired private NetShareDAO netShareDAO; /** * 添加共享信息 * * @param netShare * @return * * @Author Bcqsoft.com lzy * @Date 2011-11-16 */ public boolean createNetShareInfo(NetShare netShare) { String str = netShare.getToShareId(); String[] idArray = toStringArray(str); boolean returnValue = false; for (String tosid : idArray) { // 根据toShareId添加信息 netShare.setToShareId(tosid); Long pk = netShareDAO.insertIntoNetShare(netShare); if (isInsertSucc(pk)) { returnValue = true; } } return returnValue; } /** * 根据ID删除一条共享信息(物理删除) * * @param id * @return True:修改成功, Flase:修改失败 * * @Author Bcqsoft.com lzy * @Date 2011-11-16 */ public boolean deleteNetShareInfo(Long id) { Integer count = netShareDAO.updateNetShareStatusToDisabled(id); return isUpdateSucc(count); } /** * 删除共享信息(多选框批量删除) * * @param id * @return 是否修改成功(True:成功, False:失败) * * @Author lzy * @Date 2011-8-17 */ public boolean deleteNetShareInfos(long[] idArray, String status) { // 返回是否操作成功,成功删除一条数据即为操作成功 boolean returnValue = false; // 循环删除共享信息 // 如记录数量较多时,可以采用Ibatis中的Batch处理 for (long storageId : idArray) { NetShare netShare = new NetShare(); netShare.setNetId(storageId); netShare.setToShareId(SecurityUtils.getLoginId()); netShare.setStatus(status); // 物理删除 boolean isUpdate = deleteMyNetShareInfo(netShare); // 某条更新成功即设置操作成功 if (isUpdate) { returnValue = true; } } return returnValue; } /** * 根据条件删除一条共享信息(物理删除) * * @param id * @return True:修改成功, Flase:修改失败 * * @Author Bcqsoft.com lzy * @Date 2011-11-16 */ public boolean deleteMyNetShareInfo(NetShare netShare) { Integer count = netShareDAO.updateMyNetShareStatusToDisabled(netShare); return isUpdateSucc(count); } /** * 根据条件查询共享信息 * * @param id * @return True:修改成功, Flase:修改失败 * * @Author Bcqsoft.com lzy * @Date 2011-11-16 */ public String[] getNetShareDetailInfo(Long id,String status) { String[] stringVal=new String[2]; String stringValF=""; String stringValS=""; NetShare netShare=new NetShare(); netShare.setStatus(status); netShare.setNetId(id); List<NetShare> netShareList=netShareDAO.findNetShareInfo(netShare); Integer count =netShareList.size(); for(int i=0;i<count;i++){ if (i > 0) { stringValF = stringValF + ","; stringValS = stringValS + ","; } stringValF = stringValF + netShareList.get(i).getToShareId(); stringValS = stringValS + netShareList.get(i).getToShareName(); } stringVal[0]=stringValF; stringVal[1]=stringValS; return stringVal; } }
399772badd726b1357e7e746f23781555fe1b8e2
2b890756d9fe3bbfadf450577b1ce96e202ed503
/src/com/aselalee/bouncingball/ProximityTestActivity.java
a226a9ac84ad9a13dc13f9d6c3ac3ac2c6130d5b
[]
no_license
saifullah27/bouncing-2d-ball
059efc03fbc70e0dbe983680bae7275a710a2a14
92cda21a0b5ce232c5e1fed6d6d27a86ea31ada5
refs/heads/master
2021-01-13T01:55:31.203941
2012-08-03T09:31:46
2012-08-03T09:31:46
33,558,386
0
0
null
null
null
null
UTF-8
Java
false
false
2,772
java
package com.aselalee.bouncingball; import android.app.Activity; import android.app.KeyguardManager; import android.app.KeyguardManager.KeyguardLock; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.os.Bundle; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.util.Log; public class ProximityTestActivity extends Activity implements SensorEventListener{ private SensorManager mSensorManager; private Sensor mProximitySensor; private PowerManager mPowerManager; private WakeLock mProximityWakelock; private KeyguardManager mKeygaurdManager; private KeyguardLock mKeyGaurdLock; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_proximity_test); Log.i("ProximityTest", this.getClass().getName() + " - OnCreate"); int PROXIMITY_SCREEN_OFF_WAKE_LOCK = 32; mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE); mProximitySensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); mProximityWakelock = mPowerManager.newWakeLock(PROXIMITY_SCREEN_OFF_WAKE_LOCK, "ProximityWakeLock"); mKeygaurdManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE); mSensorManager.registerListener(this, mProximitySensor, SensorManager.SENSOR_DELAY_UI); mKeyGaurdLock = mKeygaurdManager.newKeyguardLock("KeyGaurdLock"); } @Override public void onPause() { Log.i("ProximityTest", this.getClass().getName() + " - OnPause"); super.onPause(); } @Override public void onResume() { Log.i("ProximityTest", this.getClass().getName() + " - onResume"); mKeyGaurdLock.reenableKeyguard(); super.onResume(); } @Override public void onDestroy() { Log.i("ProximityTest", this.getClass().getName() + " - OnDestroy"); mSensorManager.unregisterListener(this); if(mProximityWakelock.isHeld()) mProximityWakelock.release(); super.onDestroy(); } @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { //Log.i("ProximityTest", this.getClass().getName() + " - onAccuracyChanged"); } @Override public void onSensorChanged(SensorEvent event) { //Log.i("ProximityTest", this.getClass().getName() + " - onSensorChanged"); if(mProximityWakelock == null || mKeyGaurdLock == null) return; if(event.values[0] < 4.0f) { //Lock if(!mProximityWakelock.isHeld()) { mProximityWakelock.acquire(); } } else { //Release if(mProximityWakelock.isHeld()) { mProximityWakelock.release(); } mKeyGaurdLock.disableKeyguard(); } } }
[ "[email protected]@b31b7d96-f992-a9ad-2583-3c6bf6736d57" ]
[email protected]@b31b7d96-f992-a9ad-2583-3c6bf6736d57
878190dcc46a5d2622c7a19fa3c0347ae2367ffb
408ecf8825f29f333b605d1a05a181e4f7f31700
/HackyEaster_2017/writeupfiles/mobile/HackyEaster_4.0_source_from_JADX/android/support/v4/util/LogWriter.java
9ca4c6640894af3dee9c449e85e09ab9aa520dbf
[]
no_license
avnh/CTF-writeups-public
c84cc1fbaa4bdea9747c5eb4b58733b8cbba610a
cd8c144d8e6e0cb668609044f8d0e4aee95545fd
refs/heads/master
2020-03-25T22:41:03.724853
2018-03-30T15:53:01
2018-03-30T15:53:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,188
java
package android.support.v4.util; import android.support.annotation.RestrictTo; import android.support.annotation.RestrictTo.Scope; import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; import android.util.Log; import java.io.Writer; @RestrictTo({Scope.LIBRARY_GROUP}) public class LogWriter extends Writer { private StringBuilder mBuilder; private final String mTag; public LogWriter(String tag) { this.mBuilder = new StringBuilder(AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS); this.mTag = tag; } public void close() { flushBuilder(); } public void flush() { flushBuilder(); } public void write(char[] buf, int offset, int count) { for (int i = 0; i < count; i++) { char c = buf[offset + i]; if (c == '\n') { flushBuilder(); } else { this.mBuilder.append(c); } } } private void flushBuilder() { if (this.mBuilder.length() > 0) { Log.d(this.mTag, this.mBuilder.toString()); this.mBuilder.delete(0, this.mBuilder.length()); } } }
3d6fe170c69f8d156898e46073a7d61953d4dae2
7f2b97f6531b477c9711d574d0f8d39e11d0d6fc
/src/main/java/com/example/demo/registration/token/ConfirmationTokenRepository.java
87129528ee16449632dd7b1c5d07b0c298dce1de
[]
no_license
BibekUprety/login-registraton-backend
de0cf1e4536da6b4f8c8e50673746679b9f3697f
566f256fb41f136ec843450568ef9f3c2b2d1a00
refs/heads/master
2023-04-02T08:02:37.847865
2021-03-26T14:28:11
2021-03-26T14:28:11
351,806,348
1
0
null
null
null
null
UTF-8
Java
false
false
807
java
package com.example.demo.registration.token; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; import java.util.Optional; @Repository public interface ConfirmationTokenRepository extends JpaRepository<ConfirmationToken,Long> { Optional<ConfirmationToken> findByToken(String token); @Transactional @Modifying @Query("UPDATE ConfirmationToken c " + "SET c.confirmedAt = ?2 " + "WHERE c.token = ?1") int updateConfirmedAt(String token, LocalDateTime confirmedAt); }
8df237aef432d0885941fcb6676a3cc673a26692
2a802b71c99a8e89885edef09a6539a38e808c2b
/cas-server-core-authentication/src/main/java/org/jasig/cas/authentication/SuccessfulHandlerMetaDataPopulator.java
6fd6f7e1b10d4b41a54ba39f24a63154e7c94453
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
permanz/cas
649bd90491e78d3641c49c13c5da760e462ad696
ece1fc2652ea1ba0bc91d2911e3d3607135242c3
refs/heads/master
2021-01-18T20:47:57.665139
2016-05-01T18:55:17
2016-05-01T18:55:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,371
java
package org.jasig.cas.authentication; import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.stereotype.Component; import java.util.HashSet; import java.util.Set; /** * Sets an authentication attribute containing the collection of authentication handlers (by name) that successfully * authenticated credential. The attribute name is given by {@link AuthenticationHandler#SUCCESSFUL_AUTHENTICATION_HANDLERS}. * This component provides a simple method to inject successful handlers into the CAS ticket validation * response to support level of assurance and MFA use cases. * * @author Marvin S. Addison * @author Alaa Nassef * @since 4.0.0 */ @RefreshScope @Component("successfulHandlerMetaDataPopulator") public class SuccessfulHandlerMetaDataPopulator implements AuthenticationMetaDataPopulator { @Override public void populateAttributes(final AuthenticationBuilder builder, final Credential credential) { Set<String> successes = builder.getSuccesses().keySet(); if (successes != null && !successes.isEmpty()) { successes = new HashSet(successes); } builder.mergeAttribute(AuthenticationHandler.SUCCESSFUL_AUTHENTICATION_HANDLERS, successes); } @Override public boolean supports(final Credential credential) { return true; } }
3a67dd588a7d3464d2fadeb608c81961856c107e
ae78419d062513cd6e0e2f74d5febb7c6d91b223
/repository/ht1/src/main/java/cn/tarena/ht/controller/RoleController.java
5a8c249e31e9812e4b6a6c5e7a5bf03bf3073f38
[]
no_license
peanutes/firstrepository
1ff21e61800cf041218bda415c86e7372ff33bb0
c35af84e41cc8d4411b7e9a3da9d4cc11e53ce72
refs/heads/master
2021-05-07T05:48:21.019754
2017-11-21T11:17:17
2017-11-21T11:17:17
111,618,975
0
0
null
null
null
null
UTF-8
Java
false
false
870
java
package cn.tarena.ht.controller; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import cn.tarena.ht.pojo.Role; import cn.tarena.ht.service.RoleService; @Controller @RequestMapping("/sysadmin/role") public class RoleController { @Resource private RoleService roleService; @RequestMapping("/list") public String list(Model model){ List<Role> roleLists = roleService.findAll(); model.addAttribute("roleLists",roleLists); return "/sysadmin/role/jRoleList"; } @RequestMapping("/delete") public String deletes(@RequestParam(value="roletId")String[] roleIds){ roleService.delete(roleIds); return "redirect:/sysadmin/role/list"; } }
684293c315000ff2a6cc4b22f4eeea9bccc26191
bcca3b871b33ac3fb92a458e04d7e844a646b8c3
/src/main/java/strategy/crmyers/beta/pieces/Flag.java
ece51cf6caeeb199a29de1282ec6ce1c78cb42ee
[]
no_license
C7C8/cs4233-Strategy
e4e3453be9001582cc04a8075a9d2ca49af1e040
8a852a7f7591d3e86edf357876b40df132edb950
refs/heads/master
2022-01-12T10:50:36.649533
2019-04-14T17:21:59
2019-04-14T17:21:59
178,934,062
0
0
null
null
null
null
UTF-8
Java
false
false
2,050
java
/* * Copyright (c) 2019 Christopher Myers * * This file is part of cs4233-strategy. * * cs4233-strategy is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * cs4233-strategy is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with cs4233-strategy. If not, see <https://www.gnu.org/licenses/>. * ====== * * This file was developed as part of CS 4233: Object Oriented Analysis & * Design, at Worcester Polytechnic Institute. */ package strategy.crmyers.beta.pieces; import strategy.Piece; import strategy.StrategyException; import strategy.crmyers.beta.BetaBoard; import strategy.crmyers.beta.PieceDefined; /** * Class to represent a Flag piece. */ public class Flag extends PieceDefined { public Flag(PieceColor color) { super(color); } /** * Move the piece. * * @param board BetaBoard to move on * @param fr From row * @param fc From column * @param tr To row * @param tc To column * @return Result of move * @throws StrategyException Thrown if move is invalid for any reason (e.g. out of bounds) */ @Override public MoveResult move(BetaBoard board, int fr, int fc, int tr, int tc) throws StrategyException { throw new StrategyException("Flags cannot move"); } /** * Determine the outcome of a particular strike. * * @param target Targeted piece. * @return Result of the strike! */ @Override public MoveResult strike(Piece target) { throw new StrategyException("Flags cannot strike"); } public String toString() { return getColorStr() + "F"; } @Override public PieceType getPieceType() { return PieceType.FLAG; } }
f000b6a4201189e83321f983c5d0705a33fa248f
ae5cbac2ba64152d920fdb8c96355422f55e1e55
/src/com/mylearning/enumerated/menu/Food.java
26082420fd149dd080f5ab7a5313d77ab4ae3fd7
[]
no_license
huangyinhy/ThinkingInJava4th
ea31b182105bc7db4c0f59dd7d27612c7fd53aef
b119539e438170b27bdf42528e0d0dc5b0bb88b8
refs/heads/master
2020-03-26T21:30:25.936405
2018-09-06T10:12:31
2018-09-06T10:12:31
145,392,512
0
0
null
null
null
null
UTF-8
Java
false
false
449
java
package com.mylearning.enumerated.menu; public interface Food { enum Appetizer implements Food { SALAD, SOUP, SPRING_ROLLS; } enum MainCourse implements Food { LASAGNE, BURRITO, PAD_THAI, LENTILS, HUMMOUS, VINDALOO; } enum Dessert implements Food { TIRAMISU, GELATO, BLACK_FOREST_CAKE, FRUIT, CREME_CARAMEL; } enum Coffee implements Food { BLACK_COFFEE, DECAF_COFFEE, ESPRESSO, LATTE, CAPPUCCINO, TEA, HERB_TEA; } }
8bafc36481684d61218ce6ca9958362104964868
71bc5f647480e978193fd2701331d946b335c70e
/src/main/java/pl/javastart/dao/ClientDao.java
82738f7f6fb150e034274a8a02e127a62e2ee927
[]
no_license
WojciechTom/21_springstart_springJPA_springBoot_OneToManyAndManyToOneRelation_GenericDao
82c2c4288d4f91c1b3ab56f9da74ffaed44f22ed
68c1a2e4678002b162e669613f16b2b38bcd586f
refs/heads/master
2020-12-09T07:16:49.074871
2020-01-11T13:14:10
2020-01-11T13:14:10
233,234,026
0
0
null
null
null
null
UTF-8
Java
false
false
1,050
java
package pl.javastart.dao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import pl.javastart.model.Client; import pl.javastart.model.Order; @Repository @Transactional public class ClientDao extends GenericDao<Client, Long>{ /* * In this class we override two methods (get and remove). First because of the lazy initialize - we have to run any action * in transactional mode in order to read whole information form database (whole order list). * Remove - because we don't use cascade annotation and we have to remove all orders before we remove a client. * */ @Autowired private OrderDao orderDao; public void remove (Client client) { for(Order ord:client.getOrders()) { orderDao.remove(ord); } super.remove(client); } public Client get (Long id) { Client client = super.get(id); client.getOrders().size(); return client; } }
6f5eec4b7745e0ed2ef01c205fbcb72607e67db8
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/67/org/apache/commons/math/distribution/ExponentialDistributionImpl_setMeanInternal_84.java
b6a404b24ef4f9c44f4cd318f4973543128445e1
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
741
java
org apach common math distribut implement link exponenti distribut exponentialdistribut version revis date exponenti distribut impl exponentialdistributionimpl abstract continu distribut abstractcontinuousdistribut modifi param newmean illeg argument except illegalargumentexcept code newmean code posit set intern setmeanintern newmean newmean math runtim except mathruntimeexcept creat illeg argument except createillegalargumentexcept local format localizedformat posit newmean newmean
b39b4e55d7141d26531363934f4ede059aa8e0cd
dc565336a98dd002ee535d3709c750e842147795
/app/src/main/java/com/example/yotam707/feedmeapp/TopFragment.java
3f0e0533740eac7d0a797e9d4f1def83c588c40b
[]
no_license
Adiron147/FeedMeApp
3e9ff759723fe8a3d120f431014d42f03f856183
1337df538033607b8ad072b56b847789f476537c
refs/heads/master
2020-12-24T10:58:40.581854
2016-11-07T18:51:26
2016-11-07T18:51:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,103
java
package com.example.yotam707.feedmeapp; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ExpandableListView; import android.widget.Toast; import com.example.yotam707.feedmeapp.data.DataManager; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; /** * Created by yotam707 on 9/10/2016. */ public class TopFragment extends Fragment { ExpandableListView expListView; Context thisContext; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { thisContext = inflater.getContext(); return inflater.inflate(R.layout.top_fragment_layout,container,false); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); expListView = (ExpandableListView) view.findViewById(R.id.courses_list); Activity host = (Activity)thisContext; final ExpandableListAdapter expListAdapter = new ExpandableListAdapter(host , DataManager.getInstance().getGroupList(), DataManager.getInstance().getCoursesCollection()); expListView.setAdapter(expListAdapter); expListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() { public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Course co = (Course) expListAdapter.getChild( groupPosition, childPosition); final String selected = co.getName(); Toast.makeText(thisContext, selected, Toast.LENGTH_LONG) .show(); return true; } }); } }
8c79c46f6a152456e14e8c6e1b97281261cadb81
eb5f5353f49ee558e497e5caded1f60f32f536b5
/com/sun/management/jmx/TraceFilter.java
38a27634cf445dabfb1597fc9407daa78e2bce65
[]
no_license
mohitrajvardhan17/java1.8.0_151
6fc53e15354d88b53bd248c260c954807d612118
6eeab0c0fd20be34db653f4778f8828068c50c92
refs/heads/master
2020-03-18T09:44:14.769133
2018-05-23T14:28:24
2018-05-23T14:28:24
134,578,186
0
2
null
null
null
null
UTF-8
Java
false
false
781
java
package com.sun.management.jmx; import javax.management.Notification; import javax.management.NotificationFilter; @Deprecated public class TraceFilter implements NotificationFilter { protected int levels; protected int types; public TraceFilter(int paramInt1, int paramInt2) throws IllegalArgumentException { levels = paramInt1; types = paramInt2; } public boolean isNotificationEnabled(Notification paramNotification) { return false; } public int getLevels() { return levels; } public int getTypes() { return types; } } /* Location: C:\Program Files (x86)\Java\jre1.8.0_151\lib\rt.jar!\com\sun\management\jmx\TraceFilter.class * Java compiler version: 8 (52.0) * JD-Core Version: 0.7.1 */
32ca15eaa2424a828c1fc60c8025f963235e88ac
1907f7af5ae5ed05adc706e9b6d452eb9a112fc7
/Unit 13/src/Lab15e.java
1f01388f9d34565a0064fc8948fb9bd171e4d921
[]
no_license
tua3122/tua3122
1be9eca449dffee5051097d68d3c75b73729db71
6caf84fc49be71ab45252844214750714f7f4588
refs/heads/master
2021-05-03T11:53:13.350063
2018-05-23T17:01:47
2018-05-23T17:01:47
120,486,758
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
694
java
//© A+ Computer Science - www.apluscompsci.com //Name - //Date - //Class - //Lab - import java.util.Arrays; import static java.lang.System.*; public class Lab15e { public static void main(String args[]) { //test case 1 int[] one = NumberSort.getSortedDigitArray(567891); for(int item : one) { System.out.print(item + " "); } System.out.println(); int[] two = NumberSort.getSortedDigitArray(901912468); for(int item : two) { System.out.print(item + " "); } System.out.println(); int[] three = NumberSort.getSortedDigitArray(864213507); for(int item : three) { System.out.print(item + " "); } System.out.println(); } }
20bb80d0cbb4d609e63f9a6f48fe8eacbf2bff69
e75be673baeeddee986ece49ef6e1c718a8e7a5d
/submissions/blizzard/Corpus/eclipse.jdt.ui/8286.java
ae168e1030a832fed6006a938bd6b1ea7837111e
[ "MIT" ]
permissive
zhendong2050/fse18
edbea132be9122b57e272a20c20fae2bb949e63e
f0f016140489961c9e3c2e837577f698c2d4cf44
refs/heads/master
2020-12-21T11:31:53.800358
2018-07-23T10:10:57
2018-07-23T10:10:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
104
java
package p; class A { } class B extends A { void m() { } void n() { } }
bdb7419972493556a5c928bef7af1de6f026ad94
c9bad1de08b4f56ec01416b0776cdcb5aac7a056
/src/GUI/Home.java
9063add9fc58ae618e596829c8aa6c295ac63ab5
[]
no_license
SamaaAmr/AOOSE-Project
27e58ccb637624d99af5d1ca2628db56048e5338
992486cd83c6580eb06fff21064ec94aea6c616c
refs/heads/master
2021-05-06T09:32:36.414106
2017-12-13T05:26:23
2017-12-13T05:26:23
114,077,342
0
0
null
null
null
null
UTF-8
Java
false
false
5,579
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package GUI; /** * * @author Samaa */ public class Home extends javax.swing.JFrame { /** * Creates new form Home */ public Home() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel2 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel2.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 3, 48)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("Banking System"); getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 90, 510, 50)); jButton1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/Client.png"))); // NOI18N jButton1.setText("Client"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 270, 100, 110)); jButton2.setBackground(new java.awt.Color(102, 102, 102)); jButton2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/Admin.png"))); // NOI18N jButton2.setText("Admin"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(360, 270, 100, 110)); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI/Background.jpg"))); // NOI18N getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, 605)); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: Home h = new Home(); AdminLogin a = new AdminLogin(); h.setDefaultCloseOperation(Home.DISPOSE_ON_CLOSE); a.setVisible(true); }//GEN-LAST:event_jButton2ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: Home h = new Home(); CLientRegister c= new CLientRegister(); h.setDefaultCloseOperation(Home.DISPOSE_ON_CLOSE); c.setVisible(true); }//GEN-LAST:event_jButton1ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Home().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; // End of variables declaration//GEN-END:variables }
[ "Samaa@DESKTOP-DE5TQ81" ]
Samaa@DESKTOP-DE5TQ81
8a153493b23d56ad68feeda31d9eecae2e0c9c31
8ccadd5bc7fd9e7c48a24d2d613700236a5e046f
/src/main/java/com/ben/thread/MutablePoint.java
e106d624d95926d59b6da16715768228b623a882
[]
no_license
zhangchuanben/boottest
20137897282dc03f35cdf999807dcac0fdaf26e9
3b36bb55577c91d0911608943542e9d3d942bbd8
refs/heads/master
2021-01-09T20:33:55.293334
2016-08-13T10:47:55
2016-08-13T10:58:50
65,608,828
0
0
null
2016-08-13T10:54:36
2016-08-13T08:57:37
Java
UTF-8
Java
false
false
274
java
package com.ben.thread; import com.ben.thread.annotations.UnThreadSafe; @UnThreadSafe public class MutablePoint { public int x,y; public MutablePoint() { x = 0; y = 0; } public MutablePoint(MutablePoint p) { this.x = p.x; this.y = p.y; } }
db6142662733a9e3fe1228f64dd643167ef5e6de
963d3628750f4c644694a35398f26e0cce19005f
/app/src/main/java/com/lo/sisyphuser/fish/source/TypeListModel.java
a8a45f7449c69b154c9c9a645813f49545addb2a
[]
no_license
NevLight/Fish
2c242438e885c6369d20a3351080cd98ef6c8e93
e335e65404815347b7c34acc88671f2feff989c8
refs/heads/master
2021-01-14T12:36:11.638566
2016-09-22T07:57:04
2016-09-22T07:57:04
68,499,124
2
0
null
null
null
null
UTF-8
Java
false
false
1,129
java
package com.lo.sisyphuser.fish.source; import com.lo.sisyphuser.fish.source.base.ITypeListModel; import com.zhy.http.okhttp.OkHttpUtils; import com.zhy.http.okhttp.callback.StringCallback; import com.zhy.http.okhttp.request.RequestCall; import java.util.Map; import okhttp3.Call; /** * Created by xx on 2016/9/13. */ public class TypeListModel implements ITypeListModel { private RequestCall call; @Override public void loadList(String url, final Map<String, String> paraMap, final ITypeListModel.TypeListListener listener) { call= OkHttpUtils.post() .url(url) .params(paraMap) .build(); call.execute(new StringCallback() { @Override public void onError(Call call, Exception e, int id) { listener.loadFail(e,paraMap); } @Override public void onResponse(String response, int id) { listener.loadSuccess(response,paraMap); } }); } @Override public void cancle() { if(call!=null) call.cancel(); } }
f0da3ceb46a3fd1f9f57d17a3184bac5250935bd
72033cac24d669c2fa10333cf515dece966ee38f
/src/main/java/org/cdac/MvcConfig.java
05ddcc5c5225217e40c6531f96210c3883764e5a
[]
no_license
rajjaiswalsaumya/spring-security-starter-database-demo
76d77558690b2a3c9bc7bf590251a5eeacb0dc01
f9a3e6c33add3c1939bebeb94a4cb747bb04dca6
refs/heads/master
2016-09-05T23:41:15.719711
2014-11-12T06:04:50
2014-11-12T06:05:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,119
java
package org.cdac; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration public class MvcConfig extends WebMvcConfigurerAdapter { @Override public void addViewControllers(final ViewControllerRegistry registry) { registry.addViewController("/").setViewName("login"); registry.addViewController("/hello").setViewName("hello"); registry.addViewController("/error").setViewName("error"); } // @Bean // public ThymeleafTilesConfigurer tilesConfigurer() { // final ThymeleafTilesConfigurer tilesConfigurer = new // ThymeleafTilesConfigurer(); // tilesConfigurer.setDefinitions("classpath:tiles/tiles.def.xml"); // return tilesConfigurer; // } // @Override // public void addResourceHandlers(final ResourceHandlerRegistry registry) { // registry.addResourceHandler("/static/**") // .addResourceLocations("classpath:/static/") // .setCachePeriod(31556926); // registry.setOrder(Ordered.HIGHEST_PRECEDENCE); // } }
740703834384fd9288d1ebd3395b934e62898b68
3247dbc2dd7409ac2f0514d0eb12163fdb9cf32e
/app/src/main/java/com/example/joonas/ht/Current.java
835fa3742de4b4f75c0293eedbd5344f6d7902e5
[]
no_license
JonesTPG/AndroidHT
64c68cdc001ede87bf65666750745314e4d90eda
e10db2afe1e43090f288b28ce8b72d429aa560bb
refs/heads/master
2020-04-12T19:22:08.858229
2018-12-21T13:45:25
2018-12-21T13:45:25
162,707,384
0
0
null
null
null
null
UTF-8
Java
false
false
283
java
package com.example.joonas.ht; /*A class that remembers the login of the current user. Later on I added the boolean variable to keep track if the logged in user is admin or not. */ public class Current { public static String currentUser; public static boolean isAdmin; }
c60fe036860b3ee6344de5c398c3cf2294611201
300c5473a153f6c3c979eaddaa143234cae44e0c
/MultiThreading/src/com/multithreading/main/BlockingQueueExample.java
44e777b27f68215748d90aedbe7c149f4fd3c4f2
[]
no_license
Leela-Prasad/multithreading-workspace
0873651525f2f47d765275e5d215bc5463bd55c1
fb47a34b149459ba0d2ed37285759290ddc118e4
refs/heads/master
2021-01-20T05:41:32.138659
2017-08-26T06:09:09
2017-08-26T06:09:09
101,466,305
0
1
null
null
null
null
UTF-8
Java
false
false
1,296
java
package com.multithreading.main; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; class Producer implements Runnable { private BlockingQueue<Integer> queue; public Producer(BlockingQueue<Integer> queue) { this.queue=queue; } @Override public void run() { int value=1; while(true) { try { queue.put(value); System.out.println("putting item to queue : "+value); ++value; Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } } class Consumer implements Runnable { private BlockingQueue<Integer> queue; public Consumer(BlockingQueue<Integer> queue) { this.queue=queue; } @Override public void run() { while(true) { try { int value=queue.take(); System.out.println("Removing item to queue : "+value); Thread.sleep(10); } catch (InterruptedException e) { e.printStackTrace(); } } } } public class BlockingQueueExample { private static BlockingQueue<Integer> queue = new ArrayBlockingQueue<>(10); public static void main(String[] args) { Producer producer = new Producer(queue); Consumer consumer = new Consumer(queue); Thread t1 = new Thread(producer); Thread t2 = new Thread(consumer); t1.start(); t2.start(); } }
bb870f7715f27c9a0d70e10185e9de78a316f319
213bf562db6173671a79ed54a467cccaefc6a170
/server/hl7-gateway/src/main/java/com/icupad/hl7_gateway/test_type_module/blood_gas/domain/BloodGas.java
2f81ebb6bc4d414435bd4141322e816140442c81
[]
no_license
Dasiu/icu-pad
01149f535e298966748eca8c6d25ac2b700e43af
b5c0b387de21fb7216668c6912603d5642333421
refs/heads/master
2021-05-01T01:02:21.178214
2015-10-03T14:20:09
2015-10-03T14:20:09
25,922,186
1
0
null
null
null
null
UTF-8
Java
false
false
205
java
package com.icupad.hl7_gateway.test_type_module.blood_gas.domain; import com.icupad.hl7_gateway.core.domain.TestType; import javax.persistence.Entity; @Entity public class BloodGas extends TestType { }
bb6195195464b12f49d550a76b6c917179b08461
5584d471b1c6e82483f00429dc9cdb29efc02144
/BaekJoon/src/Greedy1/Q11399.java
43c4f963ae8a2b089ed732ac2063616894c7ec22
[]
no_license
Jaaaewon/Algorithm
c58d895a92a9bb2e1622aa7906fea8036118d0af
9540ce90eb4d84072ba65905bbd3854ccc9a28da
refs/heads/master
2022-11-27T19:47:12.754749
2020-08-11T08:02:48
2020-08-11T08:02:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
779
java
package Greedy1; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Q11399 { public static void main(String[] args) throws Exception { // TODO Auto-generated method stub BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); int num = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine()); int arr[] = new int[num]; for(int i=0; i<num; i++) { arr[i] = Integer.parseInt(st.nextToken()); } System.out.println(greedyResult(arr)); } public static int greedyResult(int arr[]) { Arrays.sort(arr); int min = arr[0]; for(int i=1; i<arr.length; i++) { arr[i] += arr[i-1]; min += arr[i]; } return min; } }
2af187543ba40d8cc46f6687e50f8f294fad08e1
c9d29786e8d64832cec3099dc0931ba5dcf0c741
/src/main/java/com/example/demo/service/model/DigitdataModel.java
1bb672ee65d1b8361baebc6520bf45db9e2d4f0b
[]
no_license
xxy2dd/DigitInputTest
002fb5ba801fc614b267a276aa8342e4654c0164
8e5f91436c7fe46032eb876b9232dae7015911c7
refs/heads/master
2022-06-24T01:54:30.816234
2019-07-02T03:01:48
2019-07-02T03:01:48
181,996,127
0
0
null
2022-06-17T02:10:00
2019-04-18T01:41:28
Java
UTF-8
Java
false
false
868
java
package com.example.demo.service.model; import com.example.demo.data.dataobject.DigitdataDO; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; /** * @author xxy * @date 2019/5/10 * @description */ @Setter @Getter @NoArgsConstructor @AllArgsConstructor public class DigitdataModel { /** * 数字序号 */ private int index; /** * 数据库中正确的值 */ private String dbvalue; /** * 用户输入的值 */ private String inputvalue; /** * * @param digitdataDO * @param inputvalue */ public DigitdataModel(DigitdataDO digitdataDO, String inputvalue,Integer kind){ this.index = digitdataDO.getIndex()-400*(kind-1); this.dbvalue = digitdataDO.getValue(); this.inputvalue = inputvalue; } }
c02b4fd6fc85290d29194a496c8aacadfb0642cf
1f9fba363b28daf6336e512de5a5fb2116f69221
/src/com/dyb/socket/client/SocketClientMain.java
10c5cf7c61fc0db51d2a1a02dc6f1545bf26d5bc
[]
no_license
kissyoudyb/JavaSpecialForce
fb85403985b155401fb7ac180159edf335afaff8
182cbef01c421ddc488c5849321298ef60316e71
refs/heads/master
2016-09-16T05:44:21.653914
2015-02-24T02:21:39
2015-02-24T02:21:39
31,238,840
0
0
null
null
null
null
UTF-8
Java
false
false
1,934
java
package com.dyb.socket.client; import java.io.FileNotFoundException; import java.io.IOException; import java.net.SocketException; import java.util.Scanner; import com.dyb.socket.SocketWrapper; import com.dyb.socket.client.exceptions.DirectNotExistsException; import com.dyb.socket.client.exceptions.ExitException; import com.dyb.socket.client.exceptions.NoOptionException; import com.dyb.socket.client.processor.LineProcessor; import static com.dyb.socket.Commons.print; public class SocketClientMain { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { Scanner scanner = new Scanner(System.in); SocketWrapper socketWrapper = new SocketWrapper("localhost", 8888); try{ print("已经连接上服务器端,现在可以输入数据开始通信了......\n>"); String line = scanner.nextLine(); while(!"byte".equals(line)){ if(line != null){ try{ LineProcessor processor = new LineProcessor(line); processor.sendContentBySocket(socketWrapper); socketWrapper.displayStatus(); }catch(ExitException e){ break; //退出系统 }catch(NoOptionException e){ /*没有做任何操作*/ }catch(DirectNotExistsException e){ System.out.println(e.getMessage()); }catch(RuntimeException e){ System.out.println(e.getMessage()); }catch(FileNotFoundException e){ System.out.println(e.getMessage()); }catch(SocketException e){ socketWrapper.displayStatus(); System.out.println("Socket异常:" + e.getMessage() + ",程序将与服务器断开连接......"); break; }catch(Exception e){ e.printStackTrace(); System.out.println("与线上服务器断开连接!"); break; } } print(">"); line = scanner.nextLine(); } } finally{ socketWrapper.close(); } } }
7dbeed1ce6bf9f35aca31562bcd401da3bdfed5e
39bd5d301e773f7d8f9eda8fe630737213bd1da5
/weShop/weshop-wechat/src/main/java/tech/wetech/weshop/wechat/exception/WechatExceptionHandler.java
d02b5a09f96c8246c27f74905f5ccd28d0dfe3a8
[ "MIT" ]
permissive
lizheng8845021/weshop
b7e7c6b66d33aa3a6073416b84d58c7d9373c5fb
019955a8b21be6eb1122b1c58a45f94c44dc7600
refs/heads/master
2022-10-01T23:05:08.142244
2020-06-09T06:01:31
2020-06-09T06:01:31
267,826,050
0
0
null
null
null
null
UTF-8
Java
false
false
1,154
java
package tech.wetech.weshop.wechat.exception; import me.chanjar.weixin.common.error.WxErrorException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import tech.wetech.weshop.common.exception.GlobalExceptionHandler; import tech.wetech.weshop.common.utils.Result; import tech.wetech.weshop.wechat.enums.WeshopWechatResultStatus; import javax.servlet.http.HttpServletRequest; /** * @author cjbi */ @ControllerAdvice public class WechatExceptionHandler { private static final Logger LOG = LoggerFactory.getLogger(GlobalExceptionHandler.class); /** * 微信服务调用失败的异常拦截 * * @param request * @param e * @return */ @ExceptionHandler(WxErrorException.class) public Result handleWxErrorException(HttpServletRequest request, WxErrorException e) { LOG.warn("execute method exception error.url is {}", request.getRequestURI(), e); return Result.failure(WeshopWechatResultStatus.WECHAT_SERVICE_ERROR.getCode(), e.getMessage()); } }
edb597926d071eab3429462d50dc2b5c8c820160
a75a99194f6be8a8c95b1add9afad1be4c0cf5f7
/src/main/java/org/tw/exercise/galaxy/utils/RomanUtils.java
375ebd13c2b137a51d282a0aefa9723e27936373
[]
no_license
SarthakMakhija/GalaxyGuide
586cd7886ae945b263030e986bf149495874675e
dd3c12ebc15e4c56de19d8374bd195c5fc922f86
refs/heads/master
2020-06-28T13:05:56.626957
2016-08-18T18:10:23
2016-08-18T18:10:23
66,015,187
0
0
null
2016-08-18T18:10:23
2016-08-18T16:56:08
Java
UTF-8
Java
false
false
2,499
java
package org.tw.exercise.galaxy.utils; import org.tw.exercise.galaxy.vo.RomanSymbolUnit; public class RomanUtils { public static final String CREDIT_IDENTIFIER = "credits"; private RomanUtils(){ } public static boolean isCurrentSymbolSmallerEqualsNext ( Character currentCh, Character nextCh ) { if ( isCurrentSymbolEqualsNext( currentCh, nextCh ) || isCurrentSymbolSmallerThanNext(currentCh, nextCh) ) return true; return false; } public static boolean isCurrentSymbolEqualsNext ( Character currentCh, Character nextCh ) { return new RomanSymbolUnit(asString(currentCh)).compareTo(new RomanSymbolUnit(asString(nextCh))) == 0 ? true : false; } public static boolean isCurrentSymbolSmallerThanNext ( Character currentCh, Character nextCh ) { return new RomanSymbolUnit(asString(currentCh)).compareTo(new RomanSymbolUnit(asString(nextCh))) == -1 ? true : false; } public static boolean isCurrentSymbolSmallerThanNext ( RomanSymbolUnit unit, RomanSymbolUnit nextUnit ) { return unit.compareTo(nextUnit) == -1 ? true : false; } public static boolean isCurrentSymbolLargerThanNext ( Character currentCh, Character nextCh ) { return new RomanSymbolUnit(asString(currentCh)).compareTo(new RomanSymbolUnit(asString(nextCh))) == 1 ? true : false; } public static boolean isRepeatCountGreaterThanExpected ( String romanLiteral, String symbol, Integer expectedCount ){ return getRepeatCount(romanLiteral, symbol).compareTo(expectedCount) == 1 ? true : false; } public static Integer getRepeatCount ( String romanLiteral, String symbol ){ return romanLiteral.length() - romanLiteral.replaceAll(symbol, "").length(); } public static char[] getRomanSymbols( String romanLiteral ){ return romanLiteral.toCharArray(); } public static boolean isSymbolWeightRatioLtEqExpectedRatio ( Character currentCh, Character nextCh, Integer expectedRatio ){ return new RomanSymbolUnit(asString(currentCh)).isSymbolWeightRatioLtEqExpectedRatio(new RomanSymbolUnit(asString(nextCh)), expectedRatio); } public static String[] split ( String input, String splitOn ){ return input.split(splitOn); } public static String[] splitOnSpace ( String input ) { return split(input, " "); } public static boolean isRomanNumeral ( String symbol ){ return RomanSymbolUnit.isRomanNumeral(symbol); } public static String asString ( char ch ){ return String.valueOf(ch); } public static String asString ( Integer i ){ return String.valueOf(i); } }
dd1edc64f794b0351aae06f6e12680a5c7be0a5a
3eef6b56d747f2946038c3a55d447ba3d198578f
/XMLViewer/src/xmlviewer/tree/util/XMLTreeUtil.java
5f3ddbb76de26a05ecf9d6e58f18329536123323
[]
no_license
cbiegel/XMLSAPInvoiceViewer
a31d5f8d2c92fc11bf72744a506208335a99b0a0
156a35beb792ec6be87f8c5416874d80490f3757
refs/heads/master
2020-04-24T10:09:36.844385
2014-04-01T08:09:10
2014-04-01T08:09:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,151
java
package xmlviewer.tree.util; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.StringTokenizer; import javax.swing.JOptionPane; import javax.swing.JTree; import javax.swing.tree.TreePath; import org.w3c.dom.Node; import xmlviewer.tree.XMLTreeExpansionState; public class XMLTreeUtil { private static final String APPDATA_PATH = System.getenv("APPDATA"); private static final String TREE_EXPANSION_PATH = APPDATA_PATH + "\\XMLViewer\\expansionStates"; private static final String TREE_EXPANSION_FILE = TREE_EXPANSION_PATH + "\\treeExp-"; private static final String TREE_EXPANSION_FILE_SUFFIX = ".exp"; /** * @return true, if path1 is a descendant of path2. Else, returns false. */ public static boolean isDescendant(TreePath path1, TreePath path2) { int count1 = path1.getPathCount(); int count2 = path2.getPathCount(); if (count1 <= count2) return false; while (count1 != count2) { path1 = path1.getParentPath(); count1--; } return path1.equals(path2); } /** * Saves the current expansion state of a JTree and returns it in an Enumeration for storing purposes. Example: A * JTree that has all its branches collapsed will return a TreeExpansionState of ",0". * * @param tree * Save the current expansion state of this tree * @return The current expansion state of the given tree as Enumeration<TreePath> */ public static String getTreeExpansionState(JTree tree, int row) { TreePath rowPath = tree.getPathForRow(row); StringBuilder sb = new StringBuilder(); int rowCount = tree.getRowCount(); for (int i = row; i < rowCount; i++) { TreePath path = tree.getPathForRow(i); if (i == row || isDescendant(path, rowPath)) { if (tree.isExpanded(path)) sb.append("," + String.valueOf(i - row)); } else { break; } } return sb.toString(); } /** * Loads the given expansion state of a JTree, making it expand in the given manner. * * @param tree * The JTree to be expended * @param enumeration * The expansion state for tree as Enumeration<TreePath> */ public static void loadTreeExpansionState(JTree tree, String expansionState, int row) { // if a tree is opened for the first time, its expansionState is null if (expansionState == null) { return; } StringTokenizer stok = new StringTokenizer(expansionState, ","); while (stok.hasMoreTokens()) { int token = row + Integer.parseInt(stok.nextToken()); tree.expandRow(token); } } public static void expandAllNodes(JTree tree) { int row = 0; while (row < tree.getRowCount()) { tree.expandRow(row); ++row; } } public static void collapseAllNodes(JTree tree) { int row = tree.getRowCount() - 1; while (row > 0) { tree.collapseRow(row); --row; } } public static void serializeTreeExpansionState(XMLTreeExpansionState expansionState, int hash) { // do nothing if expansionState is null if (expansionState.getExpansionState() == null) { return; } try { File f = new File(TREE_EXPANSION_PATH); if (!f.exists()) { f.mkdirs(); } if (!f.exists()) { JOptionPane.showMessageDialog(null, "Warning: No write permissions for: \n" + f.getAbsolutePath(), "Error saving tree state", JOptionPane.WARNING_MESSAGE); return; } String outputFilePath = TREE_EXPANSION_FILE + hash + TREE_EXPANSION_FILE_SUFFIX; FileOutputStream fOut = new FileOutputStream(outputFilePath); ObjectOutputStream oOut = new ObjectOutputStream(fOut); oOut.writeObject(expansionState); oOut.close(); fOut.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public static XMLTreeExpansionState deserializeTreeExpansionState(int hash) { XMLTreeExpansionState result = null; String inputFilePath = TREE_EXPANSION_FILE + hash + TREE_EXPANSION_FILE_SUFFIX; try { File f = new File(TREE_EXPANSION_PATH); if (!f.exists()) { f.mkdir(); } f = new File(inputFilePath); if (!f.exists()) { return null; } FileInputStream fIn = new FileInputStream(inputFilePath); ObjectInputStream oIn = new ObjectInputStream(fIn); result = (XMLTreeExpansionState) oIn.readObject(); oIn.close(); fIn.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } return result; } /** * Determines whether the given JTree represents a TsSapInvoiceExternal from the COAST system * * @return True, if tree is a TsSapInvoiceExternal (converted from the corresponding XML file). False, if it is not. */ public static boolean isTsSapInvoiceListExternal(JTree tree) { Node root = (Node) tree.getModel().getRoot(); return root.getNodeName().equals("com.scandlines.coast.common.payment.TsSapInvoiceListExternal"); } }
61f7fb3dfaf8f86df6186f6e2aa4354beeb0d9c5
4347b3b901586d62d8278a98f03c39f2f45e9d63
/src/jp/co/aforce/test/MinMax.java
51b14686b569e055431716cb47809877414b93cd
[]
no_license
KanonHayashi695/2021_training2
ed7f3f89ff9a7cae870b09032cdce03598a4ea99
6a8cb69efcfa12c647914bdb80d39eb3efcc202d
refs/heads/master
2023-04-28T12:58:18.276922
2021-05-12T08:18:41
2021-05-12T08:18:41
366,642,364
0
0
null
null
null
null
UTF-8
Java
false
false
153
java
package jp.co.aforce.test; public class MinMax { void getMaxValueint(int a,int b,int c) { } void getMinValue(int a, int b, int c) { } }