blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
684M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
132 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
28 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
352
175e90d0cf6d30b0f67415a5dddfc81b6d5086fb
b9bea8ffd1cbe88fe3d84cfd8b0c4dae6faf43e5
/graphql-maven-plugin-logic/src/main/resources/templates/server_WebSocketConfig.vm.java
559c517de55bba6640468fe6ad8dc1a652172d74
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
graphql-java-generator/graphql-maven-plugin-project
5638a108449461fe5a9f0bc72b1b8f84c271388e
5d33ccc266383be06bd4455406f6032b42926f6f
refs/heads/master_2.x
2023-08-25T10:14:13.419820
2023-08-19T16:13:55
2023-08-19T17:15:32
176,287,522
107
49
MIT
2023-08-15T17:45:36
2019-03-18T13:05:23
Java
UTF-8
Java
false
false
2,198
java
/** Generated by the default template from graphql-java-generator */ package ${packageUtilName}; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.config.annotation.WebSocketConfigurer; import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean; import com.graphql_java_generator.server.util.GraphQlWebSocketHandler; import graphql.schema.GraphQLSchema; @Configuration @EnableWebSocket @SuppressWarnings("unused") public class WebSocketConfig implements WebSocketConfigurer { protected Logger logger = LoggerFactory.getLogger(WebSocketConfig.class); private final GraphQLSchema graphQLSchema; private final GraphQLWiring graphQLWiring; // This will search to the graphql.url property, in the application.properties or application.yml file. // IT defaults to "graphql" @Value("/${dollar}{graphql.url:graphql}") private String url; @Autowired public WebSocketConfig(GraphQLWiring graphQLWiring, GraphQLSchema graphQLSchema) { this.graphQLWiring = graphQLWiring; this.graphQLSchema = graphQLSchema; } @Bean public ServletServerContainerFactoryBean createWebSocketContainer() { logger.trace("Creating ServletServerContainerFactoryBean"); ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean(); // container.setMaxTextMessageBufferSize(8192); // container.setMaxBinaryMessageBufferSize(8192); return container; } @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { logger.debug("Registering WebSocketHandler for URL {}", url); // registry.addHandler(new WebSocketHandler(graphQLWiring, graphQLSchema), url).setAllowedOrigins("*"); registry.addHandler(new GraphQlWebSocketHandler(graphQLSchema), url).setAllowedOrigins("*"); } }
[ "etienne_sf@users.sf.net" ]
etienne_sf@users.sf.net
66b47a666b37b98243ce920fcb3edf738baa11b5
b2096124ef6f5bee511b1410e14acf3477baad33
/src/main/java/com/mansep/agenda/service/MedicalBuildingService.java
e836159efffe903cfcd19576a72e81bb1e08eebc
[]
no_license
mansep/agenda-medica-api
be25bfc3b0f0cfda9fe811f26006729c8bee8fee
e0a8a636f78c724057755eb1b1ad00b65f058ae9
refs/heads/master
2022-07-10T01:59:14.467413
2020-05-18T07:09:12
2020-05-18T07:09:12
255,127,550
0
0
null
null
null
null
UTF-8
Java
false
false
809
java
package com.mansep.agenda.service; import java.util.List; import com.mansep.agenda.dto.MedicalBuildingDto; import com.mansep.agenda.entity.MedicalBuilding; import com.mansep.agenda.exception.BadRequestException; import com.mansep.agenda.exception.NotFoundException; public interface MedicalBuildingService { MedicalBuilding create(MedicalBuildingDto mBuilding) throws BadRequestException, Exception; MedicalBuilding update(Long id, MedicalBuildingDto mBuilding) throws NotFoundException; List<MedicalBuilding> findAll(); void delete(Long id) throws NotFoundException; MedicalBuilding findOne(String code) throws NotFoundException; List<MedicalBuilding> findByIdMedicalCenter(Long id) throws NotFoundException; MedicalBuilding findById(Long id) throws NotFoundException; }
[ "manuel.sepulvedad@egt.cl" ]
manuel.sepulvedad@egt.cl
3daa8d5b777948f817d44b47efa35e7d387df6fa
f43f5483e65436395ad049c0ae9c708644ee5bb1
/Account-Maker-PrizeGen-1/src/main/java/com/bae/controller/PrizeGenController.java
156330c64b539b9cb65241cf72093f0c9535de2f
[]
no_license
JoeBenRob/Account-Maker
46834ecdc911d0f9dae654e494fd54421d4c9f65
9178b011dfed9d25e6f7dd1c6a612ee205a9b342
refs/heads/master
2020-07-01T06:40:24.386154
2019-08-08T09:20:03
2019-08-08T09:20:03
201,078,254
0
0
null
null
null
null
UTF-8
Java
false
false
896
java
package com.bae.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.bae.service.PrizeGenService; @RestController @RequestMapping("/PrizeGen") public class PrizeGenController { private PrizeGenService service; @Autowired public PrizeGenController(PrizeGenService service) { this.service = service; } public PrizeGenController() { } @GetMapping("/PrizeGen/{num}") public ResponseEntity<String> getPrize(@PathVariable String num) { return new ResponseEntity<>(service.getPrize(num), HttpStatus.OK); } }
[ "JoeBenRob@gmail.com" ]
JoeBenRob@gmail.com
2a5d2911e4ce7b4c27d5295bba2d99d8f3e26a6b
26310295b7311d42f1345f41edb569b86fecd54f
/rewrite-java-repairer/src/main/java/org/openrewrite/java/search/FindAnnotations.java
cc913e3bf497f441b6178e0c45b434ce3f27439a
[ "Apache-2.0" ]
permissive
shadowxiehao/repairer-gradle-plugin
387dfb0532d706a78e047943207bba0642c5542c
4a7ffdd9c9d91e46fbd69be4b3c88a1e909f4bf3
refs/heads/master
2023-04-15T21:27:33.425004
2021-04-22T19:52:52
2021-04-22T19:52:52
360,272,356
0
0
null
null
null
null
UTF-8
Java
false
false
3,221
java
/* * Copyright 2020 the original author or authors. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * https://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.openrewrite.java.search; import lombok.EqualsAndHashCode; import lombok.Value; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.java.AnnotationMatcher; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.marker.JavaSearchResult; import org.openrewrite.java.tree.J; import java.util.HashSet; import java.util.Set; import java.util.UUID; import static org.openrewrite.Tree.randomId; @EqualsAndHashCode(callSuper = true) @Value public class FindAnnotations extends Recipe { /** * An annotation pattern, expressed as a pointcut expression. * See {@link AnnotationMatcher} for syntax. */ @Option(displayName = "Annotation pattern", description = "An annotation pattern, expressed as a pointcut expression.", example = "@java.lang.SuppressWarnings(\"deprecation\")") String annotationPattern; UUID id = randomId(); @Override public String getDisplayName() { return "Find annotations"; } @Override public String getDescription() { return "Find all annotations matching the annotation pattern."; } @Override protected TreeVisitor<?, ExecutionContext> getVisitor() { AnnotationMatcher annotationMatcher = new AnnotationMatcher(annotationPattern); return new JavaIsoVisitor<ExecutionContext>() { @Override public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { J.Annotation a = super.visitAnnotation(annotation, ctx); if (annotationMatcher.matches(annotation)) { a = a.withMarkers(a.getMarkers().addOrUpdate(new JavaSearchResult(id, FindAnnotations.this))); } return a; } }; } public static Set<J.Annotation> find(J j, String annotationPattern) { AnnotationMatcher annotationMatcher = new AnnotationMatcher(annotationPattern); JavaIsoVisitor<Set<J.Annotation>> findVisitor = new JavaIsoVisitor<Set<J.Annotation>>() { @Override public J.Annotation visitAnnotation(J.Annotation annotation, Set<J.Annotation> as) { if (annotationMatcher.matches(annotation)) { as.add(annotation); } return super.visitAnnotation(annotation, as); } }; Set<J.Annotation> as = new HashSet<>(); findVisitor.visit(j, as); return as; } }
[ "799522476@qq.com" ]
799522476@qq.com
1dcf84d4c9446224d7381f0fe6348ee2932d0197
a2b7580d42ed29123ca3e9c7231d4adc5c6d57e1
/Orientação a Objetos/Polimorfismo/Instrumento/Baixo.java
6f2353f2440ee8021dcd5f2b79297681cf179d61
[]
no_license
cristiancechinel/ExerciciosResolvidosJava
713e0fe245fef5696f2ae6503aed6962620e9d27
3b1c21604771f2623e59773fb2472729ee83af70
refs/heads/master
2020-07-17T04:33:35.929434
2019-09-12T20:08:55
2019-09-12T20:08:55
205,943,947
0
1
null
null
null
null
UTF-8
Java
false
false
293
java
public class Baixo extends InstrumentoCorda { public Baixo() { this.setNumeroCorda(4); } public Baixo(int numeroDeCordas) { this.setNumeroCorda(numeroDeCordas); } @Override public void tocar() { System.out.println("Tocando baixo"); } }
[ "ricardo.santacattarina@gmail.com" ]
ricardo.santacattarina@gmail.com
7f0f2645999a325559c32dc6c34cf58d2438f75e
1ce7a2d1e8d6f58af86b60e69eb3a993deb5a3fe
/src/main/java/kye/Main.java
8a8fbea600b9653f23cf325c95ba409bd52ce05c
[]
no_license
KirylPod/Codewars
234925063aea1b799ac1203720dcb500037dd164
a91d4d0e13e2d9bc0093e38db1fe811737dad2cd
refs/heads/master
2020-07-11T06:35:33.780916
2019-09-14T15:09:14
2019-09-14T15:09:14
181,540,391
0
0
null
null
null
null
UTF-8
Java
false
false
4,450
java
package main.java.kye; import main.java.kye.eight.AreYouPlayingBanjo; import main.java.kye.eight.TransportationOnVacation; public class Main { public static void main(String[] args) { // CenturyFromYear.century(1705); // System.out.println(NoZerosForHeros.noBoringZeros(0)); // System.out.println(TheSupermarketQueue.solveSuperMarketQueue(new int[] { 2, 3, 4, 5 }, 2)); // System.out.println(FakeBinary.fakeBin("123456789")); // System.out.println(TransportationOnVacation.rentalCarCost(4)); System.out.println(AreYouPlayingBanjo.areYouPlayingBanjo("rar")); // System.out.println(SentenceSmash.smash(new String[] { "Bilal", "Djaghout" })); // StringyStrings.stringy(3); // AlternativeString.toAlternativeString("altERnaTIng cAsE"); // DNAtoRNAConversion.dnaToRna("TTTT"); // // FindMaximumAndMinimumValues.min(new int[]{-52, 56, 30, 29, -54, 0, -110}); // FindMaximumAndMinimumValues.max(new int[]{4, 6, 2, 1, 9, 63, -134, 566}); // System.out.println(HumanReadableDurationFormat.formatDuration(1)); // System.out.println(DisemvowelTrolls.disemvowel("What are you, a communist?")); // int[] input = new int[]{-1, -2, -3, -4, -5}; // Arrays.toString(InvertValues.invert(input)); // TortoiseRacing.race(720, 850, 70); // FactorialDecomposition.decomp(12); // System.out.println(DuckDuckGoose.duckDuckGoose(new Player[]{"a", "b", "c", "d"}, 1)); // System.out.println(CountOddNumbersBelow.oddCount(123587024)); // FindOdd.findIt(new int[]{1,1,3,2,2,3,3,3,3}); // DuplicateEncoder.encode("rrEced"); // Line.Tickets(new int[] {25,100,50}); // JadenCase.toJadenCase(null); // Index index = new Index(); // System.out.println(index.findEvenIndex(new int[]{1,2,3,4,3,2,1})); // Order.order("is2 Thi1s T4est 3a"); // Persist.persistence(25); // SpinWords spinWords = new SpinWords(); // spinWords.spinWords("Just gniddik [ereht is llits] one more"); // int[] exampleTest1 = {Integer.MAX_VALUE, 0, 1}; // System.out.println((FindOutlier.find(exampleTest1))); // MexicanWave.wave(" gap "); // Sid.howMuchILoveYou(21); // System.out.println(LongestConsec.longestConsec(new String[] {"zone", "abigail", "theta", "form", "libe", "zas", "theta", "abigail"}, 2)); // Hernia.returnHerni(new int[] {3,4,4,7,7}, 3); // long start = System.nanoTime(); // System.out.println(SumDigPower.sumDigPow(1, 25000000)); // long finish = System.nanoTime(); // System.out.println((double)(finish - start)/1000000000); // StrayNum.stray(new int []{5, 5, 5, 2, 5, 5, 5}); // System.out.println(Printer.printerError("aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbmmmmmmmmmmmmmmmmmmmxyz")); // UniqueNumber.findUniq(new double[]{1, 1, 1, 2, 1, 1}); // int[] r = BuyCar.nbMonths(18000, 32000, 1500, 1.25); // System.out.println(r[0] + ", " + r[1]); // String art[] = new String[]{"ABAR 200", "CDXE 500", "BKWR 250", "BTSQ 890", "DRTY 600"}; // String cd[] = new String[] {"A", "B"}; // System.out.println(StockList.stockSummaryStream(art, cd)); // System.out.println(TenMinWalk.isValid(new char[] {'w','e','w','e','w','e','w','e','w','e','w','e'})); // System.out.println(DirReduction.dirReduc(new String[]{"NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH"})); // Player[] players = makePlayerArr(new String[] {"a", "b", "c", "d", "c", "e", "f", "g", "h", "z"}); // DuckDuckGoose.duckDuckGoose(players, 10); // // private Player[] makePlayerArr(String[] names) { // Player[] players = new Player[names.length]; // for (int i = 0; i < names.length; i++) { // players[i] = new Player(names[i]); // } // return players; // } // new Dubstep().SongDecoder("RWUBWUBWUBLWUB"); // KeepHydrated kh = new KeepHydrated(); // kh.Liters(2); // ReversedStrings.solution("world"); // ReverseWords.reverseWords("I like eating"); // System.out.println(Max.sequence(new int[]{-2, -1, -3, -4, -1, -2, -1, -5, -4})); // System.out.println(PigLatin.pigIt("O temporal o mores !")); } }
[ "psossks@gmail.com" ]
psossks@gmail.com
5c2bc0736dac8c9daa78ac1ff01f3e5fcb6bd532
287dbb340765a05fac6047e4fa9e7d6277696596
/src/main/java/me/twister915/punishments/model/storage/mongodb/MongoConnection.java
d4237e5bd532c2bf4bd1c6e2c1794d7b24ef64b8
[ "Apache-2.0" ]
permissive
Twister915/TwistedPunishments
d807329eb0213f433257266f44b1c3d31464e041
048757098c75d44c6da48fc51d5bd38ee87d7121
refs/heads/master
2021-01-20T09:12:51.766304
2014-07-25T22:04:44
2014-07-25T22:04:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,989
java
/****************************************************************************** Copyright 2014 Joey Sacchini * * 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 me.twister915.punishments.model.storage.mongodb; import com.mongodb.DB; import lombok.Data; import me.twister915.punishments.model.PunishException; import me.twister915.punishments.model.Punishment; import me.twister915.punishments.model.PunishmentFactory; import me.twister915.punishments.model.manager.BaseStorage; import me.twister915.punishments.model.storage.DBConnection; @Data public final class MongoConnection implements DBConnection { final String prefix; final DB database; @Override public <P extends Punishment> BaseStorage<P> getStorageFor(Class<P> punishmentType, PunishmentFactory<P> factory) throws PunishException { return new MongoStorage<>(punishmentType, factory, this); } @Override public void onDisable() { } }
[ "joey.sacchini264@gmail.com" ]
joey.sacchini264@gmail.com
6a3ca40579671551cb8374ffa3fb3792c26995ce
24681f84a5dcf08b2391b3cd9100f57d6c2656e5
/admin-dashboard/src/main/java/it/valeriovaudi/admindashboard/AdminDashboardApplication.java
ca9591260fec2a1790283d314db6ea20a54a9cc1
[]
no_license
mrFlick72/cloud-native-infrastructure
0a26c01a7b49e38e2275e07ea4212b2c9d0f018f
e8ec6433f548a77b2ee8f15b0e92bfb66d621cb0
refs/heads/master
2021-07-04T23:08:35.328526
2020-11-12T19:34:39
2020-11-12T19:34:39
196,722,459
0
1
null
null
null
null
UTF-8
Java
false
false
1,225
java
package it.valeriovaudi.admindashboard; import de.codecentric.boot.admin.server.config.EnableAdminServer; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; 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; @EnableAdminServer @SpringBootApplication public class AdminDashboardApplication { public static void main(String[] args) { SpringApplication.run(AdminDashboardApplication.class, args); } } @EnableWebSecurity class SecurityConfig extends WebSecurityConfigurerAdapter { protected void configure(HttpSecurity http) throws Exception { http.csrf().disable() .authorizeRequests().antMatchers("/actuator/**").permitAll() .and() .authorizeRequests().anyRequest().authenticated() .and().oauth2Login().and().logout(); } }
[ "valerio.vaudi@gmail.com" ]
valerio.vaudi@gmail.com
70bd951bbcf8321ff818abc33bab4ab577f07eb9
633381a32e915457d9c7f583a45ca377f3b4b3f5
/src/main/java/com/nguyenhathanhdat/filter/AuthorizationFilter.java
63c6d9f1c80b65e2de1c6a98bebfd8193d8c11bb
[]
no_license
nguyenhathanhdat260898/ServletJDBCJSP
a6eacf76b3c2fe935a642dee2d4e56607f4196b0
8b8157f265670592451a2557f185b2789a674e2d
refs/heads/main
2023-04-01T22:06:21.086618
2021-04-17T04:48:52
2021-04-17T04:48:52
358,782,953
0
0
null
null
null
null
UTF-8
Java
false
false
1,965
java
package com.nguyenhathanhdat.filter; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.nguyenhathanhdat.constant.SystemConstant; import com.nguyenhathanhdat.model.NewModel; import com.nguyenhathanhdat.model.UserModel; import com.nguyenhathanhdat.utils.SectionUtil; public class AuthorizationFilter implements javax.servlet.Filter { private ServletContext context; @Override public void init(FilterConfig filterConfig) throws ServletException { // TODO Auto-generated method stub this.context = filterConfig.getServletContext(); } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { // TODO Auto-generated method stub HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; String url = request.getRequestURI(); if (url.startsWith("/admin")) { UserModel userModel = (UserModel) SectionUtil.getIntance().getValue(request, "USERMODEL"); if (userModel != null) { if (userModel.getRole().equals(SystemConstant.ADMIN)) { chain.doFilter(servletRequest, servletResponse); }else if(userModel.getRole().equals(SystemConstant.USER)) { response.sendRedirect(request.getContextPath()+"/dang-nhap?action=login&message=not_permission&alert=danger"); } } else { response.sendRedirect( request.getContextPath() + "/dang-nhap?action=login&message=not_login&alert=danger"); } } else { chain.doFilter(servletRequest, servletResponse); } } @Override public void destroy() { // TODO Auto-generated method stub } }
[ "nguyenhathanhdat260898@gmail.com" ]
nguyenhathanhdat260898@gmail.com
7bc20e76e0fd114ad5323453a0300fafd2bdd9e8
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_2/src/g/j/Calc_1_2_694.java
951c10e9ea2c249252eed51f19cd42d91037e0e0
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
128
java
package g.j; public class Calc_1_2_694 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
37a53c484726102473a5697d44625de8557da2c4
3ff2c98393cd5bbd0a11844d8c77ec06d385b6ab
/presto-sics-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/BaseJdbcClient.java
3a26a7a18b6506ffdc31dae2447e16c7bd603ffc
[]
no_license
mrzhangxuliang/presto-0.233-hana-connector
17e73137bbe464af08e40f83939309a6e0946bc9
213db2cc5a2e68bfd0c57ab4006593ea597c9dc4
refs/heads/master
2022-11-22T02:04:51.049240
2020-07-05T02:40:06
2020-07-05T02:40:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
34,647
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.facebook.presto.plugin.jdbc; import com.facebook.airlift.log.Logger; import com.facebook.presto.spi.ColumnHandle; import com.facebook.presto.spi.ColumnMetadata; import com.facebook.presto.spi.ConnectorSession; import com.facebook.presto.spi.ConnectorSplitSource; import com.facebook.presto.spi.ConnectorTableMetadata; import com.facebook.presto.spi.FixedSplitSource; import com.facebook.presto.spi.PrestoException; import com.facebook.presto.spi.SchemaTableName; import com.facebook.presto.spi.TableNotFoundException; import com.facebook.presto.spi.predicate.TupleDomain; import com.facebook.presto.spi.statistics.TableStatistics; import com.facebook.presto.spi.type.CharType; import com.facebook.presto.spi.type.DecimalType; import com.facebook.presto.spi.type.Type; import com.facebook.presto.spi.type.VarcharType; import com.google.common.base.CharMatcher; import com.google.common.base.Joiner; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import javax.annotation.Nullable; import javax.annotation.PreDestroy; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.UUID; import static com.facebook.presto.plugin.jdbc.JdbcErrorCode.JDBC_ERROR; import static com.facebook.presto.plugin.jdbc.StandardReadMappings.jdbcTypeToPrestoType; import static com.facebook.presto.spi.StandardErrorCode.NOT_FOUND; import static com.facebook.presto.spi.StandardErrorCode.NOT_SUPPORTED; import static com.facebook.presto.spi.type.BigintType.BIGINT; import static com.facebook.presto.spi.type.BooleanType.BOOLEAN; import static com.facebook.presto.spi.type.DateType.DATE; import static com.facebook.presto.spi.type.DoubleType.DOUBLE; import static com.facebook.presto.spi.type.IntegerType.INTEGER; import static com.facebook.presto.spi.type.RealType.REAL; import static com.facebook.presto.spi.type.SmallintType.SMALLINT; import static com.facebook.presto.spi.type.TimeType.TIME; import static com.facebook.presto.spi.type.TimeWithTimeZoneType.TIME_WITH_TIME_ZONE; import static com.facebook.presto.spi.type.TimestampType.TIMESTAMP; import static com.facebook.presto.spi.type.TimestampWithTimeZoneType.TIMESTAMP_WITH_TIME_ZONE; import static com.facebook.presto.spi.type.TinyintType.TINYINT; import static com.facebook.presto.spi.type.VarbinaryType.VARBINARY; import static com.facebook.presto.spi.type.Varchars.isVarcharType; import static com.google.common.base.MoreObjects.firstNonNull; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Strings.isNullOrEmpty; import static com.google.common.base.Verify.verify; import static com.google.common.collect.ImmutableMap.toImmutableMap; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static com.google.common.collect.Iterables.getOnlyElement; import static java.lang.String.format; import static java.lang.String.join; import static java.sql.ResultSetMetaData.columnNullable; import static java.util.Collections.nCopies; import static java.util.Locale.ENGLISH; import static java.util.Objects.requireNonNull; import static java.util.concurrent.TimeUnit.MILLISECONDS; public class BaseJdbcClient implements JdbcClient { private static final Logger log = Logger.get(BaseJdbcClient.class); private static final Map<Type, String> SQL_TYPES = ImmutableMap.<Type, String>builder() .put(BOOLEAN, "boolean") .put(BIGINT, "bigint") .put(INTEGER, "integer") .put(SMALLINT, "smallint") .put(TINYINT, "tinyint") .put(DOUBLE, "double precision") .put(REAL, "real") .put(VARBINARY, "varbinary") .put(DATE, "date") .put(TIME, "time") .put(TIME_WITH_TIME_ZONE, "time with timezone") .put(TIMESTAMP, "timestamp") .put(TIMESTAMP_WITH_TIME_ZONE, "timestamp with timezone") .build(); protected final String connectorId; protected final ConnectionFactory connectionFactory; protected final String identifierQuote; protected final boolean caseInsensitiveNameMatching; protected final Cache<JdbcIdentity, Map<String, String>> remoteSchemaNames; protected final Cache<RemoteTableNameCacheKey, Map<String, String>> remoteTableNames; public BaseJdbcClient(JdbcConnectorId connectorId, BaseJdbcConfig config, String identifierQuote, ConnectionFactory connectionFactory) { log.info("BaseJdbcClient"); this.connectorId = requireNonNull(connectorId, "connectorId is null").toString(); requireNonNull(config, "config is null"); // currently unused, retained as parameter for future extensions this.identifierQuote = requireNonNull(identifierQuote, "identifierQuote is null"); this.connectionFactory = requireNonNull(connectionFactory, "connectionFactory is null"); this.caseInsensitiveNameMatching = config.isCaseInsensitiveNameMatching(); CacheBuilder<Object, Object> remoteNamesCacheBuilder = CacheBuilder.newBuilder() .expireAfterWrite(config.getCaseInsensitiveNameMatchingCacheTtl().toMillis(), MILLISECONDS); this.remoteSchemaNames = remoteNamesCacheBuilder.build(); this.remoteTableNames = remoteNamesCacheBuilder.build(); } @PreDestroy public void destroy() throws Exception { connectionFactory.close(); } @Override public String getIdentifierQuote() { return identifierQuote; } @Override public final Set<String> getSchemaNames(JdbcIdentity identity) { log.info("getSchemaNames"); try (Connection connection = connectionFactory.openConnection(identity)) { return listSchemas(connection).stream() .map(schemaName -> schemaName.toLowerCase(ENGLISH)) .collect(toImmutableSet()); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } protected Collection<String> listSchemas(Connection connection) { log.info("listSchemas"); try (ResultSet resultSet = connection.getMetaData().getSchemas()) { ImmutableSet.Builder<String> schemaNames = ImmutableSet.builder(); while (resultSet.next()) { String schemaName = resultSet.getString("TABLE_SCHEM"); // skip internal schemas if (!schemaName.equalsIgnoreCase("information_schema")) { schemaNames.add(schemaName); } } return schemaNames.build(); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public List<SchemaTableName> getTableNames(JdbcIdentity identity, Optional<String> schema) { log.info("getTableNames"); try (Connection connection = connectionFactory.openConnection(identity)) { Optional<String> remoteSchema = schema.map(schemaName -> toRemoteSchemaName(identity, connection, schemaName)); try (ResultSet resultSet = getTables(connection, remoteSchema, Optional.empty())) { ImmutableList.Builder<SchemaTableName> list = ImmutableList.builder(); while (resultSet.next()) { String tableSchema = getTableSchemaName(resultSet); String tableName = resultSet.getString("TABLE_NAME"); list.add(new SchemaTableName(tableSchema.toLowerCase(ENGLISH), tableName.toLowerCase(ENGLISH))); } return list.build(); } } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Nullable @Override public JdbcTableHandle getTableHandle(JdbcIdentity identity, SchemaTableName schemaTableName) { log.info("getTableHandle"); try (Connection connection = connectionFactory.openConnection(identity)) { String remoteSchema = toRemoteSchemaName(identity, connection, schemaTableName.getSchemaName()); String remoteTable = toRemoteTableName(identity, connection, remoteSchema, schemaTableName.getTableName()); try (ResultSet resultSet = getTables(connection, Optional.of(remoteSchema), Optional.of(remoteTable))) { List<JdbcTableHandle> tableHandles = new ArrayList<>(); while (resultSet.next()) { tableHandles.add(new JdbcTableHandle( connectorId, schemaTableName, resultSet.getString("TABLE_CAT"), resultSet.getString("TABLE_SCHEM"), resultSet.getString("TABLE_NAME"))); } if (tableHandles.isEmpty()) { return null; } if (tableHandles.size() > 1) { throw new PrestoException(NOT_SUPPORTED, "Multiple tables matched: " + schemaTableName); } return getOnlyElement(tableHandles); } } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public List<JdbcColumnHandle> getColumns(ConnectorSession session, JdbcTableHandle tableHandle) { log.info("getColumns"); try (Connection connection = connectionFactory.openConnection(JdbcIdentity.from(session))) { try (ResultSet resultSet = getColumns(tableHandle, connection.getMetaData())) { List<JdbcColumnHandle> columns = new ArrayList<>(); while (resultSet.next()) { JdbcTypeHandle typeHandle = new JdbcTypeHandle( resultSet.getInt("DATA_TYPE"), resultSet.getInt("COLUMN_SIZE"), resultSet.getInt("DECIMAL_DIGITS")); Optional<ReadMapping> columnMapping = toPrestoType(session, typeHandle); String columnName = resultSet.getString("COLUMN_NAME"); log.info("columnName:" + columnName + ",jdbcType:" + typeHandle.getJdbcType()); // skip unsupported column types if (columnMapping.isPresent()) { boolean nullable = columnNullable == resultSet.getInt("NULLABLE"); columns.add(new JdbcColumnHandle(connectorId, columnName, typeHandle, columnMapping.get().getType(), nullable)); } } if (columns.isEmpty()) { // In rare cases (e.g. PostgreSQL) a table might have no columns. throw new TableNotFoundException(tableHandle.getSchemaTableName()); } return ImmutableList.copyOf(columns); } } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public Optional<ReadMapping> toPrestoType(ConnectorSession session, JdbcTypeHandle typeHandle) { log.info("toPrestoType"); return jdbcTypeToPrestoType(typeHandle); } @Override public ConnectorSplitSource getSplits(JdbcIdentity identity, JdbcTableLayoutHandle layoutHandle) { log.info("getSplits"); JdbcTableHandle tableHandle = layoutHandle.getTable(); JdbcSplit jdbcSplit = new JdbcSplit( connectorId, tableHandle.getCatalogName(), tableHandle.getSchemaName(), tableHandle.getTableName(), layoutHandle.getTupleDomain(), layoutHandle.getAdditionalPredicate()); return new FixedSplitSource(ImmutableList.of(jdbcSplit)); } @Override public Connection getConnection(JdbcIdentity identity, JdbcSplit split) throws SQLException { log.info("getConnection"); Connection connection = connectionFactory.openConnection(identity); try { connection.setReadOnly(true); } catch (SQLException e) { connection.close(); throw e; } return connection; } @Override public PreparedStatement buildSql(Connection connection, JdbcSplit split, List<JdbcColumnHandle> columnHandles) throws SQLException { log.info("buildSql"); return new QueryBuilder(identifierQuote).buildSql( this, connection, split.getCatalogName(), split.getSchemaName(), split.getTableName(), columnHandles, split.getTupleDomain(), split.getAdditionalPredicate()); } @Override public void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata) { log.info("createTable"); try { createTable(tableMetadata, session, tableMetadata.getTable().getTableName()); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public JdbcOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata) { log.info("beginCreateTable"); return beginWriteTable(session, tableMetadata); } @Override public JdbcOutputTableHandle beginInsertTable(ConnectorSession session, ConnectorTableMetadata tableMetadata) { log.info("beginInsertTable"); return beginWriteTable(session, tableMetadata); } private JdbcOutputTableHandle beginWriteTable(ConnectorSession session, ConnectorTableMetadata tableMetadata) { log.info("beginWriteTable"); try { return createTable(tableMetadata, session, generateTemporaryTableName()); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } protected JdbcOutputTableHandle createTable(ConnectorTableMetadata tableMetadata, ConnectorSession session, String tableName) throws SQLException { log.info("createTable"); SchemaTableName schemaTableName = tableMetadata.getTable(); JdbcIdentity identity = JdbcIdentity.from(session); if (!getSchemaNames(identity).contains(schemaTableName.getSchemaName())) { throw new PrestoException(NOT_FOUND, "Schema not found: " + schemaTableName.getSchemaName()); } try (Connection connection = connectionFactory.openConnection(identity)) { boolean uppercase = connection.getMetaData().storesUpperCaseIdentifiers(); String remoteSchema = toRemoteSchemaName(identity, connection, schemaTableName.getSchemaName()); String remoteTable = toRemoteTableName(identity, connection, remoteSchema, schemaTableName.getTableName()); if (uppercase) { tableName = tableName.toUpperCase(ENGLISH); } String catalog = connection.getCatalog(); ImmutableList.Builder<String> columnNames = ImmutableList.builder(); ImmutableList.Builder<Type> columnTypes = ImmutableList.builder(); ImmutableList.Builder<String> columnList = ImmutableList.builder(); for (ColumnMetadata column : tableMetadata.getColumns()) { String columnName = column.getName(); if (uppercase) { columnName = columnName.toUpperCase(ENGLISH); } columnNames.add(columnName); columnTypes.add(column.getType()); columnList.add(getColumnString(column, columnName)); } String sql = format( "CREATE TABLE %s (%s)", quoted(catalog, remoteSchema, tableName), join(", ", columnList.build())); execute(connection, sql); return new JdbcOutputTableHandle( connectorId, catalog, remoteSchema, remoteTable, columnNames.build(), columnTypes.build(), tableName); } } private String getColumnString(ColumnMetadata column, String columnName) { log.info("getColumnString"); StringBuilder sb = new StringBuilder() .append(quoted(columnName)) .append(" ") .append(toSqlType(column.getType())); if (!column.isNullable()) { sb.append(" NOT NULL"); } return sb.toString(); } protected String generateTemporaryTableName() { log.info("generateTemporaryTableName"); return "tmp_presto_" + UUID.randomUUID().toString().replace("-", ""); } //todo @Override public void commitCreateTable(JdbcIdentity identity, JdbcOutputTableHandle handle) { log.info("commitCreateTable"); renameTable( identity, handle.getCatalogName(), new SchemaTableName(handle.getSchemaName(), handle.getTemporaryTableName()), new SchemaTableName(handle.getSchemaName(), handle.getTableName())); } @Override public void renameTable(JdbcIdentity identity, JdbcTableHandle handle, SchemaTableName newTable) { log.info("renameTable1"); renameTable(identity, handle.getCatalogName(), handle.getSchemaTableName(), newTable); } protected void renameTable(JdbcIdentity identity, String catalogName, SchemaTableName oldTable, SchemaTableName newTable) { log.info("renameTable2"); try (Connection connection = connectionFactory.openConnection(identity)) { DatabaseMetaData metadata = connection.getMetaData(); String schemaName = oldTable.getSchemaName(); String tableName = oldTable.getTableName(); String newSchemaName = newTable.getSchemaName(); String newTableName = newTable.getTableName(); if (metadata.storesUpperCaseIdentifiers()) { schemaName = schemaName.toUpperCase(ENGLISH); tableName = tableName.toUpperCase(ENGLISH); newSchemaName = newSchemaName.toUpperCase(ENGLISH); newTableName = newTableName.toUpperCase(ENGLISH); } String sql = format( "ALTER TABLE %s RENAME TO %s", quoted(catalogName, schemaName, tableName), quoted(catalogName, newSchemaName, newTableName)); execute(connection, sql); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public void finishInsertTable(JdbcIdentity identity, JdbcOutputTableHandle handle) { log.info("finishInsertTable"); String temporaryTable = quoted(handle.getCatalogName(), handle.getSchemaName(), handle.getTemporaryTableName()); String targetTable = quoted(handle.getCatalogName(), handle.getSchemaName(), handle.getTableName()); String insertSql = format("INSERT INTO %s SELECT * FROM %s", targetTable, temporaryTable); String cleanupSql = "DROP TABLE " + temporaryTable; try (Connection connection = getConnection(identity, handle)) { execute(connection, insertSql); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } try (Connection connection = getConnection(identity, handle)) { execute(connection, cleanupSql); } catch (SQLException e) { log.warn(e, "Failed to cleanup temporary table: %s", temporaryTable); } } @Override public void addColumn(JdbcIdentity identity, JdbcTableHandle handle, ColumnMetadata column) { log.info("addColumn"); try (Connection connection = connectionFactory.openConnection(identity)) { String schema = handle.getSchemaName(); String table = handle.getTableName(); String columnName = column.getName(); DatabaseMetaData metadata = connection.getMetaData(); if (metadata.storesUpperCaseIdentifiers()) { schema = schema != null ? schema.toUpperCase(ENGLISH) : null; table = table.toUpperCase(ENGLISH); columnName = columnName.toUpperCase(ENGLISH); } String sql = format( "ALTER TABLE %s ADD %s", quoted(handle.getCatalogName(), schema, table), getColumnString(column, columnName)); execute(connection, sql); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public void renameColumn(JdbcIdentity identity, JdbcTableHandle handle, JdbcColumnHandle jdbcColumn, String newColumnName) { log.info("renameColumn"); try (Connection connection = connectionFactory.openConnection(identity)) { DatabaseMetaData metadata = connection.getMetaData(); if (metadata.storesUpperCaseIdentifiers()) { newColumnName = newColumnName.toUpperCase(ENGLISH); } String sql = format( "ALTER TABLE %s RENAME COLUMN %s TO %s", quoted(handle.getCatalogName(), handle.getSchemaName(), handle.getTableName()), jdbcColumn.getColumnName(), newColumnName); execute(connection, sql); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public void dropColumn(JdbcIdentity identity, JdbcTableHandle handle, JdbcColumnHandle column) { log.info("dropColumn"); try (Connection connection = connectionFactory.openConnection(identity)) { String sql = format( "ALTER TABLE %s DROP COLUMN %s", quoted(handle.getCatalogName(), handle.getSchemaName(), handle.getTableName()), column.getColumnName()); execute(connection, sql); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public void dropTable(JdbcIdentity identity, JdbcTableHandle handle) { log.info("dropTable"); StringBuilder sql = new StringBuilder() .append("DROP TABLE ") .append(quoted(handle.getCatalogName(), handle.getSchemaName(), handle.getTableName())); try (Connection connection = connectionFactory.openConnection(identity)) { execute(connection, sql.toString()); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public void rollbackCreateTable(JdbcIdentity identity, JdbcOutputTableHandle handle) { log.info("rollbackCreateTable"); dropTable(identity, new JdbcTableHandle( handle.getConnectorId(), new SchemaTableName(handle.getSchemaName(), handle.getTemporaryTableName()), handle.getCatalogName(), handle.getSchemaName(), handle.getTemporaryTableName())); } @Override public String buildInsertSql(JdbcOutputTableHandle handle) { log.info("buildInsertSql"); String vars = Joiner.on(',').join(nCopies(handle.getColumnNames().size(), "?")); return new StringBuilder() .append("INSERT INTO ") .append(quoted(handle.getCatalogName(), handle.getSchemaName(), handle.getTemporaryTableName())) .append(" VALUES (").append(vars).append(")") .toString(); } @Override public Connection getConnection(JdbcIdentity identity, JdbcOutputTableHandle handle) throws SQLException { log.info("getConnection"); return connectionFactory.openConnection(identity); } @Override public PreparedStatement getPreparedStatement(Connection connection, String sql) throws SQLException { log.info("getPreparedStatement"); return connection.prepareStatement(sql); } protected ResultSet getTables(Connection connection, Optional<String> schemaName, Optional<String> tableName) throws SQLException { log.info("getTables"); DatabaseMetaData metadata = connection.getMetaData(); Optional<String> escape = Optional.ofNullable(metadata.getSearchStringEscape()); return metadata.getTables( connection.getCatalog(), escapeNamePattern(schemaName, escape).orElse(null), escapeNamePattern(tableName, escape).orElse(null), new String[] {"TABLE", "VIEW"}); } protected String getTableSchemaName(ResultSet resultSet) throws SQLException { log.info("getTableSchemaName"); return resultSet.getString("TABLE_SCHEM"); } protected String toRemoteSchemaName(JdbcIdentity identity, Connection connection, String schemaName) { log.info("toRemoteSchemaName"); requireNonNull(schemaName, "schemaName is null"); verify(CharMatcher.forPredicate(Character::isUpperCase).matchesNoneOf(schemaName), "Expected schema name from internal metadata to be lowercase: %s", schemaName); if (caseInsensitiveNameMatching) { try { Map<String, String> mapping = remoteSchemaNames.getIfPresent(identity); if (mapping != null && !mapping.containsKey(schemaName)) { // This might be a schema that has just been created. Force reload. mapping = null; } if (mapping == null) { mapping = listSchemasByLowerCase(connection); remoteSchemaNames.put(identity, mapping); } String remoteSchema = mapping.get(schemaName); if (remoteSchema != null) { return remoteSchema; } } catch (RuntimeException e) { throw new PrestoException(JDBC_ERROR, "Failed to find remote schema name: " + firstNonNull(e.getMessage(), e), e); } } try { DatabaseMetaData metadata = connection.getMetaData(); if (metadata.storesUpperCaseIdentifiers()) { return schemaName.toUpperCase(ENGLISH); } return schemaName; } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } protected Map<String, String> listSchemasByLowerCase(Connection connection) { log.info("listSchemasByLowerCase"); return listSchemas(connection).stream() .collect(toImmutableMap(schemaName -> schemaName.toLowerCase(ENGLISH), schemaName -> schemaName)); } protected String toRemoteTableName(JdbcIdentity identity, Connection connection, String remoteSchema, String tableName) { log.info("toRemoteTableName"); requireNonNull(remoteSchema, "remoteSchema is null"); requireNonNull(tableName, "tableName is null"); verify(CharMatcher.forPredicate(Character::isUpperCase).matchesNoneOf(tableName), "Expected table name from internal metadata to be lowercase: %s", tableName); if (caseInsensitiveNameMatching) { try { RemoteTableNameCacheKey cacheKey = new RemoteTableNameCacheKey(identity, remoteSchema); Map<String, String> mapping = remoteTableNames.getIfPresent(cacheKey); if (mapping != null && !mapping.containsKey(tableName)) { // This might be a table that has just been created. Force reload. mapping = null; } if (mapping == null) { mapping = listTablesByLowerCase(connection, remoteSchema); remoteTableNames.put(cacheKey, mapping); } String remoteTable = mapping.get(tableName); if (remoteTable != null) { return remoteTable; } } catch (RuntimeException e) { throw new PrestoException(JDBC_ERROR, "Failed to find remote table name: " + firstNonNull(e.getMessage(), e), e); } } try { DatabaseMetaData metadata = connection.getMetaData(); if (metadata.storesUpperCaseIdentifiers()) { return tableName.toUpperCase(ENGLISH); } return tableName; } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } protected Map<String, String> listTablesByLowerCase(Connection connection, String remoteSchema) { log.info("listTablesByLowerCase"); try (ResultSet resultSet = getTables(connection, Optional.of(remoteSchema), Optional.empty())) { ImmutableMap.Builder<String, String> map = ImmutableMap.builder(); while (resultSet.next()) { String tableName = resultSet.getString("TABLE_NAME"); map.put(tableName.toLowerCase(ENGLISH), tableName); } return map.build(); } catch (SQLException e) { throw new PrestoException(JDBC_ERROR, e); } } @Override public TableStatistics getTableStatistics(ConnectorSession session, JdbcTableHandle handle, List<JdbcColumnHandle> columnHandles, TupleDomain<ColumnHandle> tupleDomain) { log.info("getTableStatistics"); return TableStatistics.empty(); } protected void execute(Connection connection, String query) throws SQLException { log.info("execute"); try (Statement statement = connection.createStatement()) { log.debug("Execute: %s", query); statement.execute(query); } } protected String toSqlType(Type type) { log.info("toSqlType.displayName:" + type.getDisplayName() + ",simpleName:" + type.getJavaType().getSimpleName()); String sql = this.doToSqlType(type); log.info("sql:" + sql); return sql; } private String doToSqlType(Type type){ if (isVarcharType(type)) { VarcharType varcharType = (VarcharType) type; if (varcharType.isUnbounded()) { return "varchar"; } return "varchar(" + varcharType.getLengthSafe() + ")"; } if (type instanceof CharType) { if (((CharType) type).getLength() == CharType.MAX_LENGTH) { return "char"; } return "char(" + ((CharType) type).getLength() + ")"; } if (type instanceof DecimalType) { return format("decimal(%s, %s)", ((DecimalType) type).getPrecision(), ((DecimalType) type).getScale()); } String sqlType = SQL_TYPES.get(type); if (sqlType != null) { return sqlType; } throw new PrestoException(NOT_SUPPORTED, "Unsupported column type: " + type.getDisplayName()); } protected String quoted(String name) { log.info("quoted:" + name); name = name.replace(identifierQuote, identifierQuote + identifierQuote); return identifierQuote + name + identifierQuote; } protected String quoted(String catalog, String schema, String table) { log.info("quoted:" + catalog + "," + schema + "," + table); StringBuilder sb = new StringBuilder(); if (!isNullOrEmpty(catalog)) { sb.append(quoted(catalog)).append("."); } if (!isNullOrEmpty(schema)) { sb.append(quoted(schema)).append("."); } sb.append(quoted(table)); return sb.toString(); } protected static Optional<String> escapeNamePattern(Optional<String> name, Optional<String> escape) { log.info("escapeNamePattern"); if (!name.isPresent() || !escape.isPresent()) { return name; } return Optional.of(escapeNamePattern(name.get(), escape.get())); } private static String escapeNamePattern(String name, String escape) { log.info("escapeNamePattern"); requireNonNull(name, "name is null"); requireNonNull(escape, "escape is null"); checkArgument(!escape.equals("_"), "Escape string must not be '_'"); checkArgument(!escape.equals("%"), "Escape string must not be '%'"); name = name.replace(escape, escape + escape); name = name.replace("_", escape + "_"); name = name.replace("%", escape + "%"); return name; } private static ResultSet getColumns(JdbcTableHandle tableHandle, DatabaseMetaData metadata) throws SQLException { log.info("getColumns"); Optional<String> escape = Optional.ofNullable(metadata.getSearchStringEscape()); return metadata.getColumns( tableHandle.getCatalogName(), escapeNamePattern(Optional.ofNullable(tableHandle.getSchemaName()), escape).orElse(null), escapeNamePattern(Optional.ofNullable(tableHandle.getTableName()), escape).orElse(null), null); } }
[ "513283439@qq.com" ]
513283439@qq.com
d588d57b2b41a9ac5afbe1ece88843bbeb173be9
83e81c25b1f74f88ed0f723afc5d3f83e7d05da8
/core/java/android/text/style/StrikethroughSpan.java
94560065c3bbfafc42a0f39591d618a11c2ede3b
[ "Apache-2.0", "LicenseRef-scancode-unicode" ]
permissive
Ankits-lab/frameworks_base
8a63f39a79965c87a84e80550926327dcafb40b7
150a9240e5a11cd5ebc9bb0832ce30e9c23f376a
refs/heads/main
2023-02-06T03:57:44.893590
2020-11-14T09:13:40
2020-11-14T09:13:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,310
java
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.text.style; import android.annotation.NonNull; import android.os.Parcel; import android.text.ParcelableSpan; import android.text.TextPaint; import android.text.TextUtils; /** * A span that strikes through the text it's attached to. * <p> * The span can be used like this: * <pre>{@code * SpannableString string = new SpannableString("Text with strikethrough span"); *string.setSpan(new StrikethroughSpan(), 10, 23, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);}</pre> * <img src="{@docRoot}reference/android/images/text/style/strikethroughspan.png" /> * <figcaption>Strikethrough text.</figcaption> */ public class StrikethroughSpan extends CharacterStyle implements UpdateAppearance, ParcelableSpan { /** * Creates a {@link StrikethroughSpan}. */ public StrikethroughSpan() { } /** * Creates a {@link StrikethroughSpan} from a parcel. */ public StrikethroughSpan(@NonNull Parcel src) { } @Override public int getSpanTypeId() { return getSpanTypeIdInternal(); } /** @hide */ @Override public int getSpanTypeIdInternal() { return TextUtils.STRIKETHROUGH_SPAN; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(@NonNull Parcel dest, int flags) { writeToParcelInternal(dest, flags); } /** @hide */ @Override public void writeToParcelInternal(@NonNull Parcel dest, int flags) { } @Override public void updateDrawState(@NonNull TextPaint ds) { ds.setStrikeThruText(true); } }
[ "keneankit01@gmail.com" ]
keneankit01@gmail.com
be14fdbdf23f3353d8c08878cbcb5ac26ea32b3f
91fd5d79da06f0315ab4c57c5ab105fccb5e5584
/src/main/java/check/data/db/domain/Comment.java
321d258fee605745bfad881f30f0a5b1d731306d
[]
no_license
kakutot/course-work
2ebe42a57e1b270da6c98e9657a58ab0217b054e
3154a5cda95ef8ff485f6facdcfc024e5c62b508
refs/heads/email
2023-06-08T18:43:48.378199
2018-12-15T14:12:10
2018-12-15T14:12:10
208,457,486
0
0
null
2023-05-23T20:10:51
2019-09-14T15:09:59
JavaScript
UTF-8
Java
false
false
2,011
java
package check.data.db.domain; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.hibernate.validator.constraints.NotEmpty; import javax.persistence.*; @Entity public class Comment { @Id @GeneratedValue(strategy = GenerationType.IDENTITY ) @Column(name = "id",nullable = false) public int commentId; @JsonIgnoreProperties("comments") @ManyToOne() @JoinColumn(name="teacher_id", nullable=false) public Teacher teacher; @JsonIgnoreProperties("comments") @ManyToOne() @JoinColumn(name="user_id", nullable=false) public User user; @Column(name = "message",nullable=false) public String message; @Column(name = "comment_date",nullable = false) public String commentDate; public Comment() { } public Comment(Teacher teacher, User user, String message,String commentDate) { this.teacher = teacher; this.user = user; this.message = message; this.commentDate = commentDate; } public int getCommentId() { return commentId; } public void setCommentId(int commentId) { this.commentId = commentId; } public Teacher getTeacher() { return teacher; } public void setTeacher(Teacher teacher) { this.teacher = teacher; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public String getCommentDate() { return commentDate; } public void setCommentDate(String commentDate) { this.commentDate = commentDate; } @Override public String toString() { return "Comment{" + "commentId=" + commentId + ", message='" + message + '\'' + ", commentDate='" + commentDate + '\'' + '}'; } }
[ "r.tupkalenko2012@gmail.com" ]
r.tupkalenko2012@gmail.com
e9c0c8c259aa878e202b4087f3bffd3e8c84fea6
a4e456c0d748a4a6717b18be3ed1bbea511e35a4
/src/main/java/com/yusei/dao/FieldExtendRuleDetailDao.java
4dfba628842d5fd99344b5a48dc2ce8291fd4481
[]
no_license
lutwwp/my-custom-flow
cf1da13e9e9c3c92fd4b8f0870797180df5af783
5eb4a0e8f9ae85e1bb3fe8208e04f2e6d5f5b889
refs/heads/master
2023-06-02T10:26:35.533546
2021-06-24T04:21:38
2021-06-24T04:21:38
379,801,731
0
0
null
null
null
null
UTF-8
Java
false
false
682
java
package com.yusei.dao; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.yusei.model.entity.FieldExtendRuleDetail; /** * 扩展规则详情表Dao * * @author generated by liuqiang * @date 2020-09-02 13:58:18 */ @Mapper public interface FieldExtendRuleDetailDao { /** * 批量插入记录,返回插入成功的行数(不插入主键) */ int insertBatch(@Param("list") List<FieldExtendRuleDetail> list); List<FieldExtendRuleDetail> selectListByRuleIdList(@Param("list") List<Long> extendRuleIdList); int deleteByExtendRuleIdList(@Param("list") List<Long> ruleIdList); }
[ "wangwp@si-tech.com.cn" ]
wangwp@si-tech.com.cn
7c6ffbaf463df797b6f6dabaf1d79dcf27cc2978
2755f18ecfd66368cfdae440b0cb023657b8eaab
/JavaApplication9/src/javaapplication9/Sensor.java
539c90e0f861b3fb430ad4ae50e4cbc5c08681b0
[]
no_license
dottore1/Bygningscontroller
34e5e29bae1b0fb2ae894c77a7eabd95a391a6ba
17b4f1a9b1b60176135fd1050a3cccad78474851
refs/heads/master
2020-09-12T14:02:30.276674
2019-11-19T08:51:47
2019-11-19T08:51:47
222,447,190
0
0
null
null
null
null
UTF-8
Java
false
false
418
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 javaapplication9; public abstract class Sensor extends Unit { private boolean isOutside; public Sensor(boolean isOutside, String name, int id) { super(name, id); this.isOutside = isOutside; } }
[ "nibor19@student.sdu.dk" ]
nibor19@student.sdu.dk
676cf32d42b143cd50501ae2d43affaf67443e02
d78dabbe0ccd5b759540d252c6ddf91f4bcd84ec
/imsdk/src/main/java/com/focustech/android/components/mt/sdk/android/service/processor/rsp/RspLoginProcessor.java
8e14eca7f4c55e0e03de3745b31bf5e1c53271f1
[]
no_license
fangyangdegezi88/Android_MVVM-MVP
817c6b045f9be4fbf228f8d0f1de6e7e18b33c4c
a7339e21763e9cd525d42c1da6f56d69ca234c48
refs/heads/master
2021-01-21T12:46:27.305035
2017-09-01T09:56:44
2017-09-01T09:56:44
102,095,569
1
0
null
null
null
null
UTF-8
Java
false
false
2,310
java
package com.focustech.android.components.mt.sdk.android.service.processor.rsp; import com.focustech.android.commonlibs.capability.log.LogFormat; import com.focustech.android.components.mt.sdk.android.ContextHolder; import com.focustech.android.components.mt.sdk.android.service.SessionManager; import com.focustech.android.components.mt.sdk.android.service.processor.AbstractMessageProcessor; import com.focustech.android.components.mt.sdk.android.service.processor.req.ReqLoginProcessor; import com.focustech.android.components.mt.sdk.support.cache.SharedPrefLoginInfo; import com.focustech.android.components.mt.sdk.util.AsyncLoginControlContent; import com.focustech.tm.open.sdk.messages.TMMessage; import com.focustech.tm.open.sdk.messages.protobuf.Messages; /** * 登陆rsp响应 * * @author zhangxu */ public class RspLoginProcessor extends AbstractMessageProcessor { public void onMessage(TMMessage message) throws Throwable { Messages.LoginRsp rsp = Messages.LoginRsp.parseFrom(message.getBody()); if (logger.isInfoEnabled()) { logger.info(LogFormat.format(LogFormat.LogModule.SERVICE, LogFormat.Operation.PROCESS, "{}"), rsp); } // 这里只关心失败,成功后由 UserInfoRsp返回再通知业务方 if (rsp.getCode() != 0) { operationComplete(message); SharedPrefLoginInfo sharedPrefLoginInfo = new SharedPrefLoginInfo(ContextHolder.getAndroidContext(), SharedPrefLoginInfo.LOGIN_INFO_FILE); sharedPrefLoginInfo.saveString("loginInfo", ""); if (rsp.getCode() == 10001) { SessionManager.getInstance().setIsUserOrPsdError(true); } if (getBizInvokeCallback() != null) { AsyncLoginControlContent.cleanContent(ReqLoginProcessor.LOGIN_KEY); logger.info("ReqLoginProcessor clean login control context"); getBizInvokeCallback().privateLoginFailed(rsp.getCode()); } else { AsyncLoginControlContent.cleanContent(ReqLoginProcessor.LOGIN_KEY); logger.info("clean login control context"); } } else { SessionManager.getInstance().newSession(rsp.getUserId(), rsp.getToken(), rsp.getPlantData(), message.getHead()); } } }
[ "470173422@qq.com" ]
470173422@qq.com
526aa8b657310d74f9b2482325deebad20086649
7ba951e9dfc18ac5fa6c39d8436216e535c84582
/Simulator/src/pagereplacement.java
dde7daeed84a71f880b15b8a494ba918329d8be5
[]
no_license
umeshsandeep/Os_Simulator
7970beabe61f10f47a14a67e5da451de3cb45753
929f0b43abb2a4e5ce439248ecd8e251f7b1af41
refs/heads/master
2021-01-10T02:07:32.695962
2015-12-22T09:40:26
2015-12-22T09:40:26
48,423,349
0
1
null
null
null
null
UTF-8
Java
false
false
4,509
java
//package page; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JLabel; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JTextField; import java.awt.Color; public class pagereplacement { private JFrame frame; private JTextField text; private JTextField text2; private JTextField text3; /** * Launch the application. */ public static void DS() { EventQueue.invokeLater(new Runnable() { public void run() { try { pagereplacement window = new pagereplacement(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the application. */ public pagereplacement() { initialize(); } /** * Initialize the contents of the frame. */ private void initialize() { frame = new JFrame(); frame.getContentPane().setBackground(Color.WHITE); frame.setBounds(100, 100, 764, 501); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); JLabel lblNewLabel = new JLabel("Page Replacement Algorithms"); lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 20)); lblNewLabel.setBounds(227, 11, 313, 50); frame.getContentPane().add(lblNewLabel); text = new JTextField(); text.setBounds(290, 278, 201, 44); frame.getContentPane().add(text); text.setColumns(10); JLabel lblInput = new JLabel(" INPUT :"); lblInput.setFont(new Font("Tahoma", Font.BOLD, 13)); lblInput.setBounds(160, 288, 68, 23); frame.getContentPane().add(lblInput); text2 = new JTextField(); text2.setBounds(290, 346, 204, 44); frame.getContentPane().add(text2); text2.setColumns(10); JLabel lblOutput = new JLabel("OUTPUT :"); lblOutput.setFont(new Font("Tahoma", Font.BOLD, 13)); lblOutput.setBounds(160, 360, 68, 14); frame.getContentPane().add(lblOutput); text3 = new JTextField(); text3.setBounds(293, 210, 100, 38); frame.getContentPane().add(text3); text3.setColumns(10); JLabel lblFrame = new JLabel("Frame Size:"); lblFrame.setFont(new Font("Tahoma", Font.BOLD, 15)); lblFrame.setBounds(135, 204, 123, 46); frame.getContentPane().add(lblFrame); JButton button = new JButton("FIFO"); button.setFont(new Font("Tahoma", Font.BOLD, 15)); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String Val,v=""; Val = text.getText(); convert z = new convert(Val); int[] L= z.method1(); int h = Integer.parseInt(text3.getText()); FIFO a1= new FIFO(h,L); int r = a1.method(); v=v+""+r; //a1.Get(L,L.length); text2.setText(v); } }); button.setBounds(61, 98, 119, 50); frame.getContentPane().add(button); JButton button_1 = new JButton("LRU"); button_1.setFont(new Font("Tahoma", Font.BOLD, 15)); button_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String Val,v=""; Val = text.getText(); convert z = new convert(Val); int[] L= z.method1(); int h = Integer.parseInt(text3.getText()); LRU a1= new LRU(h,L); int r = a1.method(); v=v+""+r; //a1.Get(L,L.length); text2.setText(v); } }); button_1.setBounds(238, 98, 100, 50); frame.getContentPane().add(button_1); JButton button_2 = new JButton("Optimal"); button_2.setFont(new Font("Tahoma", Font.BOLD, 15)); button_2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String Val,v=""; Val = text.getText(); convert z = new convert(Val); int[] L= z.method1(); int h = Integer.parseInt(text3.getText()); OPT a1= new OPT(h,L); int r = a1.method(); v=v+""+r; //a1.Get(L,L.length); text2.setText(v); } }); button_2.setBounds(401, 98, 100, 50); frame.getContentPane().add(button_2); Icon I23 = new ImageIcon("back.jpg"); JButton btnBack = new JButton(I23); btnBack.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { Home x=new Home(); x.Method(); frame.setVisible(false); } }); btnBack.setBounds(32, 35, 101, 50); frame.getContentPane().add(btnBack); } }
[ "umesh.d14@iiits.in" ]
umesh.d14@iiits.in
f95a65f4b1e099119cb17f9e3d3c3d7c992fe089
620c75f522d8650e87bf64b878ca0a7367623dda
/org.jebtk.modern/src/main/java/org/jebtk/modern/dialog/ModernDialogWindow.java
a180eea7df83e0ab51bd36d89d0d8393a4fa8435
[]
no_license
antonybholmes/jebtk-modern
539750965fcd0bcc9ee5ec3c371271c4dd2d4c08
04dcf905082052dd57890a056e647548e1222dff
refs/heads/master
2021-08-02T18:05:05.895223
2021-07-24T21:59:26
2021-07-24T21:59:26
100,538,521
0
0
null
null
null
null
UTF-8
Java
false
false
14,093
java
/** * Copyright (C) 2016, Antony Holmes * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package org.jebtk.modern.dialog; import java.awt.AWTEvent; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.AWTEventListener; import java.awt.event.MouseEvent; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JLayeredPane; import javax.swing.SwingUtilities; import javax.swing.border.Border; import org.jebtk.modern.BorderService; import org.jebtk.modern.ModernComponent; import org.jebtk.modern.ModernWidget; import org.jebtk.modern.UI; import org.jebtk.modern.button.ButtonsBox; import org.jebtk.modern.help.GuiAppInfo; import org.jebtk.modern.panel.BorderlessCardPanel; import org.jebtk.modern.panel.CardPanel; import org.jebtk.modern.panel.ModernPanel; import org.jebtk.modern.theme.ThemeService; import org.jebtk.modern.tooltip.ModernToolTipEvent; import org.jebtk.modern.tooltip.ModernToolTipListener; import org.jebtk.modern.tooltip.ToolTipService; import org.jebtk.modern.window.ModernWindow; /** * Standardized modern dialog window. * * @author Antony Holmes * */ public class ModernDialogWindow extends JDialog implements ModernToolTipListener { /** * The constant serialVersionUID. */ private static final long serialVersionUID = 1L; private class AllMouseEvents implements AWTEventListener { @Override public void eventDispatched(AWTEvent e) { if (e.getID() == MouseEvent.MOUSE_PRESSED) { doHideTooltips(); } } } /** * The constant STANDARD_LABEL_SIZE. */ public static final Dimension STANDARD_LABEL_SIZE = new Dimension(200, ModernWidget.getWidgetHeight()); /** * The constant STANDARD_INPUT_SIZE. */ public static final Dimension STANDARD_INPUT_SIZE = new Dimension(80, ModernWidget.getWidgetHeight()); /** The Constant DIALOG_BACKGROUND_1. */ public static final Color DIALOG_BACKGROUND = ThemeService.getInstance().getColors().getGray32(1); public static final Border FLAT_BORDER = BorderService.getInstance().createBottomBorder(ModernWidget.DOUBLE_PADDING); /** * The member status. */ protected ModernDialogStatus mStatus = ModernDialogStatus.CANCEL; /** * The member content panel. */ private ModernComponent mContentPanel = new ModernPanel(ModernDialogWindow.DIALOG_BACKGROUND); // new // ModernDialogWindowContentPanel(); /** * The member product details. */ protected GuiAppInfo mAppInfo; /** * The member parent. */ protected ModernWindow mParent; /** The m center. */ private Component mCenter; /** The m auto dispose. */ private boolean mAutoDispose = true; /** * Instantiates a new modern dialog window. * * @param parent the parent */ public ModernDialogWindow(ModernWindow parent) { this(parent, true); } /** * Instantiates a new modern dialog window. * * @param parent the parent * @param modal the modal */ public ModernDialogWindow(ModernWindow parent, boolean modal) { super(parent, modal); mParent = parent; mAppInfo = parent.getAppInfo(); setup(); } /** * Instantiates a new modern dialog window. * * @param productDetails the product details */ public ModernDialogWindow(GuiAppInfo productDetails) { mAppInfo = productDetails; setup(); } /** * Instantiates a new modern dialog window. * * @param parent the parent * @param productDetails the product details */ public ModernDialogWindow(ModernWindow parent, GuiAppInfo productDetails) { this(parent); mAppInfo = productDetails; setup(); } /** * Gets the app info. * * @return the app info */ public GuiAppInfo getAppInfo() { return mAppInfo; } /** * Gets the parent window. * * @return the parent window */ public ModernWindow getParentWindow() { return mParent; } // @Override // public void setBackground(Color color) { // // Set the background color of the dialog // // Container c = getContentPane(); // // if (c != null) { // System.err.println("g" + " " + color + " " + getTitle()); // c.setBackground(Color.ORANGE); //color); // } // } /** * Set the border around the content pane * * @param border */ public void setBorder(Border border) { ((ModernComponent) getContentPane()).setBorder(border); } /** * Set the window title but include the main app title. * * @param subTitle the new sub title */ public void setSubTitle(String subTitle) { setTitle(subTitle + " - " + getAppInfo().getName()); } /** * Setup. */ private void setup() { // setModalityType(ModalityType.APPLICATION_MODAL); // setUndecorated(true); // getRootPane ().setOpaque (false); // getWindowContentPanel().setBackground (new Color(0, 0, 0, 0)); // setBackground (new Color(0, 0, 0, 0)); setDarkBackground(); setIconImage(getAppInfo().getIcon().getImage(32)); super.getContentPane().add(mContentPanel, BorderLayout.CENTER); setResizable(false); setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); UI.centerWindowToScreen(this); // Receive tooltips ToolTipService.getInstance().addToolTipListener(this); // // Listen for clicking anywhere on the window to get rid of the tool tip // Toolkit.getDefaultToolkit().addAWTEventListener(new AllMouseEvents(), AWTEvent.MOUSE_EVENT_MASK); } /** * Sets the title. * * @param title the title * @param subTitle the sub title */ public void setTitle(String title, String subTitle) { setTitle(subTitle + " - " + title); } /** * Controls whether the dialog will dispose of itself once closed (free * resources) or be allowed to persist in memory. By default dialogs auto * dispose. * * @param autoDispose the new auto dispose */ public void setAutoDispose(boolean autoDispose) { mAutoDispose = autoDispose; } /** * Sets the header. * * @param c the new header */ protected void setHeader(Component c) { getContentPane().add(c, BorderLayout.PAGE_START); } /** * Sets the body. * * @param c the new body */ public void setBody(Component c) { if (mCenter != null) { getContentPane().remove(mCenter); } mCenter = c; getContentPane().add(c, BorderLayout.CENTER); getContentPane().validate(); getContentPane().repaint(); } /** * Sets the left. * * @param c the new left */ public void setLeft(Component c) { getContentPane().add(c, BorderLayout.LINE_START); } /** * Sets the footer. * * @param c the new footer */ public void setFooter(Component c) { getContentPane().add(c, BorderLayout.PAGE_END); } /** * Dialogs default to a white background. This changes it to the gray * background. */ public void setDarkBackground() { getContentPane().setBackground(DIALOG_BACKGROUND); } /** * Set the background to the default white color. */ public void setLightBackground() { getContentPane().setBackground(Color.WHITE); } public void setCard(JComponent c) { setBody(new CardPanel(new ModernComponent(c, ModernWidget.DOUBLE_BORDER), ModernWidget.DOUBLE_BORDER)); // Auto set the background to dark so that the card contrasts. // setDarkBackground(); } public void setBorderlessCardContent(JComponent c) { setBody(new BorderlessCardPanel(c)); // Auto set the background to dark so that the card contrasts. // setDarkBackground(); } /** * Set the content of the the dia * * @param c */ public void setFlatCardContent(JComponent c) { setBody(new ModernComponent(new ModernPanel(c, ModernWidget.QUAD_BORDER), FLAT_BORDER)); // Auto set the background to dark so that the card contrasts. // setDarkBackground(); } /** * Adds the component as the central content of the dialog inside a bordered box * with appropriate spacing. * * @param c the new content */ public void setContent(JComponent c) { setBody(new ModernComponent(c, ModernWidget.QUAD_BORDER)); // c); // //new // ModernDialogContentPanel(c)); } /** * Sets the buttons. * * @param c the new buttons */ public void setButtons(ButtonsBox c) { setFooter(c); } /** * Sets the buttons. * * @param c the new buttons */ public void setButtons(JComponent c) { setFooter(c); // new ModernDialogButtonBox(c)); } /** * Gets the content panel. * * @return the content panel */ // public ModernComponent getContentPanel() { // return mContentPanel; // } @Override public ModernComponent getContentPane() { return mContentPanel; } /* * (non-Javadoc) * * @see * org.abh.lib.ui.modern.tooltip.ModernToolTipModel#showToolTip(org.abh.lib. ui. * modern.ModernComponent, org.abh.lib.ui.modern.tooltip.ModernToolTipPanel) */ private void showToolTip(Component source, Component tooltip) { showToolTip(source, tooltip, toolTipP(source, tooltip)); } private void addToolTip(Component source, Component tooltip) { addToolTip(source, tooltip, toolTipP(source, tooltip)); } private Point toolTipP(Component source, Component tooltip) { Point p = source.getLocationOnScreen(); Rectangle wb = getBounds(); if (p.x + tooltip.getPreferredSize().width > wb.x + wb.width) { p.x += source.getWidth() - tooltip.getPreferredSize().width; } p.y += source.getHeight(); if (p.y + tooltip.getPreferredSize().height > wb.y + wb.height) { p.y -= source.getHeight() + tooltip.getPreferredSize().height; } return p; } /* * (non-Javadoc) * * @see * org.abh.lib.ui.modern.tooltip.ModernToolTipModel#showToolTip(org.abh.lib. ui. * modern.ModernComponent, org.abh.lib.ui.modern.tooltip.ModernToolTipPanel, * java.awt.Point) */ private synchronized void showToolTip(Component source, Component tooltip, Point p) { // Hide any current ones hideToolTips(); addToolTip(source, tooltip, p); } private synchronized void addToolTip(Component source, Component tooltip, Point p) { JLayeredPane layeredPane = getLayeredPane(); if (layeredPane == null) { return; } SwingUtilities.convertPointFromScreen(p, layeredPane); tooltip.setBounds(p.x, p.y, tooltip.getPreferredSize().width, tooltip.getPreferredSize().height); layeredPane.add(tooltip, JLayeredPane.POPUP_LAYER); validate(); repaint(); } private synchronized void hideToolTips() { // System.err.println("hide"); JLayeredPane layeredPane = getLayeredPane(); for (Component c : layeredPane.getComponentsInLayer(JLayeredPane.POPUP_LAYER)) { layeredPane.remove(c); } } protected void doHideTooltips() { ToolTipService.getInstance().hideToolTips(new ModernToolTipEvent(this, this)); } @Override public void tooltipShown(ModernToolTipEvent e) { if (e.getP() != null) { showToolTip(e.getSource(), e.getTooltip(), e.getP()); } else { showToolTip(e.getSource(), e.getTooltip()); } } @Override public void tooltipAdded(ModernToolTipEvent e) { if (e.getP() != null) { addToolTip(e.getSource(), e.getTooltip(), e.getP()); } else { addToolTip(e.getSource(), e.getTooltip()); } } @Override public void tooltipHidden(ModernToolTipEvent e) { getLayeredPane().remove(e.getTooltip()); validate(); repaint(); } /** * Hide tool tips. */ @Override public synchronized void tooltipsHidden(ModernToolTipEvent e) { for (Component c : getLayeredPane().getComponentsInLayer(JLayeredPane.POPUP_LAYER)) { getLayeredPane().remove(c); } validate(); repaint(); } /** * Sets the status. * * @param status the new status */ public final void setStatus(ModernDialogStatus status) { mStatus = status; } /** * Gets the status. * * @return the status */ public final ModernDialogStatus getStatus() { return mStatus; } /** * Returns true if the dialog was cancelled. * * @return true, if is cancelled */ public boolean isCancelled() { return mStatus == ModernDialogStatus.CANCEL; } /** * Close. */ protected void close() { setVisible(false); if (mAutoDispose) { dispose(); } } }
[ "antony.b.holmes@gmail.com" ]
antony.b.holmes@gmail.com
df036a16f7c7f721a5d72fcb0e571e8c2edc47f1
8181a16eb3fc76515711b54da523012ce98aaedf
/app/src/main/java/com/hultron/lifehelper/entity/NewsData.java
6e7a69efa2e74ff9fc34b3579c67bd0c2c41d365
[ "Apache-2.0" ]
permissive
Hultron/LifeHelper
9dabb7554803dc6abee3acc0163dca80f3a8ff80
94dbcc428aa123fc91fc3cc60041e5851be18a82
refs/heads/master
2021-01-18T20:30:20.235016
2017-04-14T14:52:23
2017-04-14T14:52:23
86,973,727
3
0
null
null
null
null
UTF-8
Java
false
false
627
java
package com.hultron.lifehelper.entity; /** * 时事新闻数据类 */ public class NewsData { //标题 private String title; public String getCtime() { return ctime; } public void setCtime(String ctime) { this.ctime = ctime; } //新闻时间 private String ctime; //新闻地址 private String url; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }
[ "hultron@foxmail.com" ]
hultron@foxmail.com
aad13afc53e72d847cf1038150655a176bf621bd
d5f09c7b0e954cd20dd613af600afd91b039c48a
/sources/com/amap/api/mapcore2d/bx.java
d1061737c6c230ebda0d382630863ffd784f2659
[]
no_license
t0HiiBwn/CoolapkRelease
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
a6a2b03e32cde0e5163016e0078391271a8d33ab
refs/heads/main
2022-07-29T23:28:35.867734
2021-03-26T11:41:18
2021-03-26T11:41:18
345,290,891
5
2
null
null
null
null
UTF-8
Java
false
false
339
java
package com.amap.api.mapcore2d; import android.graphics.PointF; import java.util.ArrayList; import java.util.List; /* compiled from: TrafSegment */ class bx { private int a; private List<PointF> b = new ArrayList(); public List<PointF> a() { return this.b; } public int b() { return this.a; } }
[ "test@gmail.com" ]
test@gmail.com
76c11c83851f7953498de7c424df17d01307856b
0a6336496abdb49a8fbcbbbcad581c850356f018
/src/main/java/org/openapitools/client/model/GetWalletTransactionDetailsByTransactionIDRIBS.java
a1aa5092010ca785e13a4b255618c546f412afec
[]
no_license
Crypto-APIs/Crypto_APIs_2.0_SDK_Java
8afba51f53a7a617d66ef6596010cc034a48c17d
29bac849e4590c4decfa80458fce94a914801019
refs/heads/main
2022-09-24T04:43:37.066099
2022-09-12T17:38:13
2022-09-12T17:38:13
360,245,136
5
1
null
null
null
null
UTF-8
Java
false
false
49,098
java
/* * CryptoAPIs * Crypto APIs is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of their blockchain applications. Crypto APIs provides unified endpoints and data, raw data, automatic tokens and coins forwardings, callback functionalities, and much more. * * The version of the OpenAPI document: 2021-03-20 * Contact: developers@cryptoapis.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.openapitools.client.model.GetTransactionDetailsByTransactionIDRIBSZVJoinSplitInner; import org.openapitools.client.model.GetTransactionDetailsByTransactionIDRIBSZVShieldedOutputInner; import org.openapitools.client.model.GetTransactionDetailsByTransactionIDRIBSZVShieldedSpendInner; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSB; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSBC; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSBSC; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSD; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSD2; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSE; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSEC; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSL; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSP; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSPGasPrice; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBST; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSZ; import org.openapitools.client.model.GetWalletTransactionDetailsByTransactionIDRIBSZVinInner; import org.openapitools.client.model.ListTransactionsByBlockHeightRIBSZVoutInner; import javax.ws.rs.core.GenericType; import java.io.IOException; import java.lang.reflect.Type; import java.util.logging.Level; import java.util.logging.Logger; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.HashMap; import java.util.Map; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonParseException; import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapterFactory; import com.google.gson.reflect.TypeToken; import com.google.gson.JsonPrimitive; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import io.cryptoapis.sdk.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-09-12T15:09:18.638874Z[Etc/UTC]") public class GetWalletTransactionDetailsByTransactionIDRIBS extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(GetWalletTransactionDetailsByTransactionIDRIBS.class.getName()); public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (!GetWalletTransactionDetailsByTransactionIDRIBS.class.isAssignableFrom(type.getRawType())) { return null; // this class only serializes 'GetWalletTransactionDetailsByTransactionIDRIBS' and its subtypes } final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSB> adapterGetWalletTransactionDetailsByTransactionIDRIBSB = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSB.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSBC> adapterGetWalletTransactionDetailsByTransactionIDRIBSBC = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSBC.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSBSC> adapterGetWalletTransactionDetailsByTransactionIDRIBSBSC = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSBSC.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSD> adapterGetWalletTransactionDetailsByTransactionIDRIBSD = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSD.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSD2> adapterGetWalletTransactionDetailsByTransactionIDRIBSD2 = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSD2.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSE> adapterGetWalletTransactionDetailsByTransactionIDRIBSE = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSE.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSEC> adapterGetWalletTransactionDetailsByTransactionIDRIBSEC = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSEC.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSL> adapterGetWalletTransactionDetailsByTransactionIDRIBSL = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSL.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSP> adapterGetWalletTransactionDetailsByTransactionIDRIBSP = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSP.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBST> adapterGetWalletTransactionDetailsByTransactionIDRIBST = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBST.class)); final TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBSZ> adapterGetWalletTransactionDetailsByTransactionIDRIBSZ = gson.getDelegateAdapter(this, TypeToken.get(GetWalletTransactionDetailsByTransactionIDRIBSZ.class)); return (TypeAdapter<T>) new TypeAdapter<GetWalletTransactionDetailsByTransactionIDRIBS>() { @Override public void write(JsonWriter out, GetWalletTransactionDetailsByTransactionIDRIBS value) throws IOException { if (value == null || value.getActualInstance() == null) { elementAdapter.write(out, null); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSB` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSB) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSB.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSB)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSBC` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSBC) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSBC.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSBC)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSBSC` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSBSC) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSBSC.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSBSC)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSD` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSD) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSD.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSD)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSD2` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSD2) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSD2.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSD2)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSE` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSE) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSE.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSE)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSEC` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSEC) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSEC.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSEC)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSL` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSL) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSL.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSL)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSP` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSP) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSP.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSP)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBST` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBST) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBST.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBST)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } // check if the actual instance is of the type `GetWalletTransactionDetailsByTransactionIDRIBSZ` if (value.getActualInstance() instanceof GetWalletTransactionDetailsByTransactionIDRIBSZ) { JsonObject obj = adapterGetWalletTransactionDetailsByTransactionIDRIBSZ.toJsonTree((GetWalletTransactionDetailsByTransactionIDRIBSZ)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); return; } throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: GetWalletTransactionDetailsByTransactionIDRIBSB, GetWalletTransactionDetailsByTransactionIDRIBSBC, GetWalletTransactionDetailsByTransactionIDRIBSBSC, GetWalletTransactionDetailsByTransactionIDRIBSD, GetWalletTransactionDetailsByTransactionIDRIBSD2, GetWalletTransactionDetailsByTransactionIDRIBSE, GetWalletTransactionDetailsByTransactionIDRIBSEC, GetWalletTransactionDetailsByTransactionIDRIBSL, GetWalletTransactionDetailsByTransactionIDRIBSP, GetWalletTransactionDetailsByTransactionIDRIBST, GetWalletTransactionDetailsByTransactionIDRIBSZ"); } @Override public GetWalletTransactionDetailsByTransactionIDRIBS read(JsonReader in) throws IOException { Object deserialized = null; JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; ArrayList<String> errorMessages = new ArrayList<>(); TypeAdapter actualAdapter = elementAdapter; // deserialize GetWalletTransactionDetailsByTransactionIDRIBSB try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSB.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSB; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSB'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSB failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSB'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSBC try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSBC.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSBC; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSBC'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSBC failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSBC'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSBSC try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSBSC.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSBSC; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSBSC'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSBSC failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSBSC'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSD try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSD.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSD; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSD'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSD failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSD'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSD2 try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSD2.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSD2; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSD2'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSD2 failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSD2'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSE try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSE.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSE; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSE'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSE failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSE'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSEC try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSEC.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSEC; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSEC'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSEC failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSEC'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSL try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSL.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSL; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSL'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSL failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSL'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSP try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSP.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSP; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSP'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSP failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSP'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBST try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBST.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBST; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBST'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBST failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBST'", e); } // deserialize GetWalletTransactionDetailsByTransactionIDRIBSZ try { // validate the JSON object to see if any exception is thrown GetWalletTransactionDetailsByTransactionIDRIBSZ.validateJsonObject(jsonObject); actualAdapter = adapterGetWalletTransactionDetailsByTransactionIDRIBSZ; match++; log.log(Level.FINER, "Input data matches schema 'GetWalletTransactionDetailsByTransactionIDRIBSZ'"); } catch (Exception e) { // deserialization failed, continue errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSZ failed with `%s`.", e.getMessage())); log.log(Level.FINER, "Input data does not match schema 'GetWalletTransactionDetailsByTransactionIDRIBSZ'", e); } if (match == 1) { GetWalletTransactionDetailsByTransactionIDRIBS ret = new GetWalletTransactionDetailsByTransactionIDRIBS(); ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } throw new IOException(String.format("Failed deserialization for GetWalletTransactionDetailsByTransactionIDRIBS: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonObject.toString())); } }.nullSafe(); } } // store a list of schema names defined in oneOf public static final Map<String, GenericType> schemas = new HashMap<String, GenericType>(); public GetWalletTransactionDetailsByTransactionIDRIBS() { super("oneOf", Boolean.FALSE); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSB o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSBC o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSBSC o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSD o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSD2 o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSE o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSEC o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSL o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSP o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBST o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } public GetWalletTransactionDetailsByTransactionIDRIBS(GetWalletTransactionDetailsByTransactionIDRIBSZ o) { super("oneOf", Boolean.FALSE); setActualInstance(o); } static { schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSB", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSB>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSBC", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSBC>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSBSC", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSBSC>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSD", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSD>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSD2", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSD2>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSE", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSE>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSEC", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSEC>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSL", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSL>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSP", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSP>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBST", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBST>() { }); schemas.put("GetWalletTransactionDetailsByTransactionIDRIBSZ", new GenericType<GetWalletTransactionDetailsByTransactionIDRIBSZ>() { }); } @Override public Map<String, GenericType> getSchemas() { return GetWalletTransactionDetailsByTransactionIDRIBS.schemas; } /** * Set the instance that matches the oneOf child schema, check * the instance parameter is valid against the oneOf child schemas: * GetWalletTransactionDetailsByTransactionIDRIBSB, GetWalletTransactionDetailsByTransactionIDRIBSBC, GetWalletTransactionDetailsByTransactionIDRIBSBSC, GetWalletTransactionDetailsByTransactionIDRIBSD, GetWalletTransactionDetailsByTransactionIDRIBSD2, GetWalletTransactionDetailsByTransactionIDRIBSE, GetWalletTransactionDetailsByTransactionIDRIBSEC, GetWalletTransactionDetailsByTransactionIDRIBSL, GetWalletTransactionDetailsByTransactionIDRIBSP, GetWalletTransactionDetailsByTransactionIDRIBST, GetWalletTransactionDetailsByTransactionIDRIBSZ * * It could be an instance of the 'oneOf' schemas. * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSB) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSBC) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSBSC) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSD) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSD2) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSE) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSEC) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSL) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSP) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBST) { super.setActualInstance(instance); return; } if (instance instanceof GetWalletTransactionDetailsByTransactionIDRIBSZ) { super.setActualInstance(instance); return; } throw new RuntimeException("Invalid instance type. Must be GetWalletTransactionDetailsByTransactionIDRIBSB, GetWalletTransactionDetailsByTransactionIDRIBSBC, GetWalletTransactionDetailsByTransactionIDRIBSBSC, GetWalletTransactionDetailsByTransactionIDRIBSD, GetWalletTransactionDetailsByTransactionIDRIBSD2, GetWalletTransactionDetailsByTransactionIDRIBSE, GetWalletTransactionDetailsByTransactionIDRIBSEC, GetWalletTransactionDetailsByTransactionIDRIBSL, GetWalletTransactionDetailsByTransactionIDRIBSP, GetWalletTransactionDetailsByTransactionIDRIBST, GetWalletTransactionDetailsByTransactionIDRIBSZ"); } /** * Get the actual instance, which can be the following: * GetWalletTransactionDetailsByTransactionIDRIBSB, GetWalletTransactionDetailsByTransactionIDRIBSBC, GetWalletTransactionDetailsByTransactionIDRIBSBSC, GetWalletTransactionDetailsByTransactionIDRIBSD, GetWalletTransactionDetailsByTransactionIDRIBSD2, GetWalletTransactionDetailsByTransactionIDRIBSE, GetWalletTransactionDetailsByTransactionIDRIBSEC, GetWalletTransactionDetailsByTransactionIDRIBSL, GetWalletTransactionDetailsByTransactionIDRIBSP, GetWalletTransactionDetailsByTransactionIDRIBST, GetWalletTransactionDetailsByTransactionIDRIBSZ * * @return The actual instance (GetWalletTransactionDetailsByTransactionIDRIBSB, GetWalletTransactionDetailsByTransactionIDRIBSBC, GetWalletTransactionDetailsByTransactionIDRIBSBSC, GetWalletTransactionDetailsByTransactionIDRIBSD, GetWalletTransactionDetailsByTransactionIDRIBSD2, GetWalletTransactionDetailsByTransactionIDRIBSE, GetWalletTransactionDetailsByTransactionIDRIBSEC, GetWalletTransactionDetailsByTransactionIDRIBSL, GetWalletTransactionDetailsByTransactionIDRIBSP, GetWalletTransactionDetailsByTransactionIDRIBST, GetWalletTransactionDetailsByTransactionIDRIBSZ) */ @Override public Object getActualInstance() { return super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSB`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSB`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSB` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSB` */ public GetWalletTransactionDetailsByTransactionIDRIBSB getGetWalletTransactionDetailsByTransactionIDRIBSB() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSB)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSBC`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSBC`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSBC` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSBC` */ public GetWalletTransactionDetailsByTransactionIDRIBSBC getGetWalletTransactionDetailsByTransactionIDRIBSBC() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSBC)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSBSC`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSBSC`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSBSC` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSBSC` */ public GetWalletTransactionDetailsByTransactionIDRIBSBSC getGetWalletTransactionDetailsByTransactionIDRIBSBSC() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSBSC)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSD`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSD`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSD` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSD` */ public GetWalletTransactionDetailsByTransactionIDRIBSD getGetWalletTransactionDetailsByTransactionIDRIBSD() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSD)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSD2`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSD2`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSD2` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSD2` */ public GetWalletTransactionDetailsByTransactionIDRIBSD2 getGetWalletTransactionDetailsByTransactionIDRIBSD2() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSD2)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSE`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSE`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSE` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSE` */ public GetWalletTransactionDetailsByTransactionIDRIBSE getGetWalletTransactionDetailsByTransactionIDRIBSE() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSE)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSEC`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSEC`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSEC` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSEC` */ public GetWalletTransactionDetailsByTransactionIDRIBSEC getGetWalletTransactionDetailsByTransactionIDRIBSEC() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSEC)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSL`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSL`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSL` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSL` */ public GetWalletTransactionDetailsByTransactionIDRIBSL getGetWalletTransactionDetailsByTransactionIDRIBSL() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSL)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSP`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSP`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSP` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSP` */ public GetWalletTransactionDetailsByTransactionIDRIBSP getGetWalletTransactionDetailsByTransactionIDRIBSP() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSP)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBST`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBST`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBST` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBST` */ public GetWalletTransactionDetailsByTransactionIDRIBST getGetWalletTransactionDetailsByTransactionIDRIBST() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBST)super.getActualInstance(); } /** * Get the actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSZ`. If the actual instance is not `GetWalletTransactionDetailsByTransactionIDRIBSZ`, * the ClassCastException will be thrown. * * @return The actual instance of `GetWalletTransactionDetailsByTransactionIDRIBSZ` * @throws ClassCastException if the instance is not `GetWalletTransactionDetailsByTransactionIDRIBSZ` */ public GetWalletTransactionDetailsByTransactionIDRIBSZ getGetWalletTransactionDetailsByTransactionIDRIBSZ() throws ClassCastException { return (GetWalletTransactionDetailsByTransactionIDRIBSZ)super.getActualInstance(); } /** * Validates the JSON Object and throws an exception if issues found * * @param jsonObj JSON Object * @throws IOException if the JSON Object is invalid with respect to GetWalletTransactionDetailsByTransactionIDRIBS */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // validate oneOf schemas one by one int validCount = 0; ArrayList<String> errorMessages = new ArrayList<>(); // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSB try { GetWalletTransactionDetailsByTransactionIDRIBSB.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSB failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSBC try { GetWalletTransactionDetailsByTransactionIDRIBSBC.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSBC failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSBSC try { GetWalletTransactionDetailsByTransactionIDRIBSBSC.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSBSC failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSD try { GetWalletTransactionDetailsByTransactionIDRIBSD.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSD failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSD2 try { GetWalletTransactionDetailsByTransactionIDRIBSD2.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSD2 failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSE try { GetWalletTransactionDetailsByTransactionIDRIBSE.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSE failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSEC try { GetWalletTransactionDetailsByTransactionIDRIBSEC.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSEC failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSL try { GetWalletTransactionDetailsByTransactionIDRIBSL.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSL failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSP try { GetWalletTransactionDetailsByTransactionIDRIBSP.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSP failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBST try { GetWalletTransactionDetailsByTransactionIDRIBST.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBST failed with `%s`.", e.getMessage())); // continue to the next one } // validate the json string with GetWalletTransactionDetailsByTransactionIDRIBSZ try { GetWalletTransactionDetailsByTransactionIDRIBSZ.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { errorMessages.add(String.format("Deserialization for GetWalletTransactionDetailsByTransactionIDRIBSZ failed with `%s`.", e.getMessage())); // continue to the next one } if (validCount != 1) { throw new IOException(String.format("The JSON string is invalid for GetWalletTransactionDetailsByTransactionIDRIBS with oneOf schemas: GetWalletTransactionDetailsByTransactionIDRIBSB, GetWalletTransactionDetailsByTransactionIDRIBSBC, GetWalletTransactionDetailsByTransactionIDRIBSBSC, GetWalletTransactionDetailsByTransactionIDRIBSD, GetWalletTransactionDetailsByTransactionIDRIBSD2, GetWalletTransactionDetailsByTransactionIDRIBSE, GetWalletTransactionDetailsByTransactionIDRIBSEC, GetWalletTransactionDetailsByTransactionIDRIBSL, GetWalletTransactionDetailsByTransactionIDRIBSP, GetWalletTransactionDetailsByTransactionIDRIBST, GetWalletTransactionDetailsByTransactionIDRIBSZ. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonObj.toString())); } } /** * Create an instance of GetWalletTransactionDetailsByTransactionIDRIBS given an JSON string * * @param jsonString JSON string * @return An instance of GetWalletTransactionDetailsByTransactionIDRIBS * @throws IOException if the JSON string is invalid with respect to GetWalletTransactionDetailsByTransactionIDRIBS */ public static GetWalletTransactionDetailsByTransactionIDRIBS fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, GetWalletTransactionDetailsByTransactionIDRIBS.class); } /** * Convert an instance of GetWalletTransactionDetailsByTransactionIDRIBS to an JSON string * * @return JSON string */ public String toJson() { return JSON.getGson().toJson(this); } }
[ "kristiyan.ivanov@menasoftware.com" ]
kristiyan.ivanov@menasoftware.com
71a63087ead793a48a740a9f512303418d71f1e8
b2b5185631ddf3f582f78065247caa8ff85919c9
/tags/release-2.1/src/DVN-EJB/src/java/edu/harvard/iq/dvn/core/study/StudyServiceLocal.java
2338f6023fa34e10cfe120384c90e0b70900b1b4
[]
no_license
dvn/dvn-svn-import-test5
bd606b663c8a061278b4164b9b21078667c1675e
09ef67d666fbd8860b8c233bedf2529f39c59bbd
refs/heads/master
2016-09-06T14:43:08.202121
2013-01-04T20:00:13
2013-01-04T20:00:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,792
java
/* * Dataverse Network - A web application to distribute, share and analyze quantitative data. * Copyright (C) 2007 * * This program 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 * or write to the Free Software Foundation,Inc., 51 Franklin Street, * Fifth Floor, Boston, MA 02110-1301 USA */ package edu.harvard.iq.dvn.core.study; import edu.harvard.iq.dvn.core.admin.VDCUser; import edu.harvard.iq.dvn.core.vdc.VDC; import java.io.File; import java.io.IOException; import java.sql.Timestamp; import java.util.Date; import java.util.List; import java.util.Map; import javax.ejb.Local; import javax.xml.bind.JAXBException; /** * This is the business interface for NewSession enterprise bean. */ @Local public interface StudyServiceLocal extends java.io.Serializable { /** * Add given Study to persistent storage. */ // Comments for breaking this into multiple classes // // 1= Retrieval // 2= Update // 3= Import/Export // 4= File related // ?= not sure if this is needed // x= no longer needed //? public void exportStudyFilesToLegacySystem(String lastUpdateTime, String authority) throws IOException, JAXBException; // comment out - not used public void addStudy(Study study); // 1 public Study getStudy(Long studyId); // 1 public Study getStudyByGlobalId(String globalId); // 1 (new to this version) public StudyVersion getStudyVersion(String globalId, Long versionNumber); public StudyVersion getStudyVersion(Long studyId, Long versionNumber); public StudyVersion getStudyVersionById(Long versionId); //1 public Study getStudyByHarvestInfo(VDC vdc, String harvestIdentifier); //1 public Study getStudyForSearch(Long studyId, Map studyFields); //2 public void updateStudy(Study study); public void updateStudyVersion(StudyVersion studyVersion); //2 public void deleteStudy(Long studyId); //2 public void deleteStudyInNewTransaction(Long studyId, boolean deleteFromIndex); //2 public void deleteStudyList(List<Long> studyIds); //? public List getStudies(); //1 public List<Long> getAllNonHarvestedStudyIds(); //1 java.util.List getOrderedStudies(List studyIdList, String orderBy); //? java.util.List getRecentStudies(Long vdcId, int numResults); //?1 public List getDvOrderedStudyIds(Long vdcId, String orderBy, boolean ascending ); //?1 public List getDvOrderedStudyIdsByCreator(Long vdcId, Long creatorId, String orderBy, boolean ascending ); //4 public void incrementNumberOfDownloads(Long studyFileId, Long currentVDCId); //4 public void incrementNumberOfDownloads(Long studyFileId, Long currentVDCId, Date lastDownloadTime); //4 public RemoteAccessAuth lookupRemoteAuthByHost(String remoteHost); //4 public List<DataFileFormatType> getDataFileFormatTypes(); //2 String generateStudyIdSequence(String protocol, String authority); //2 boolean isUniqueStudyId(String userStudyId,String protocol,String authority); //4 java.lang.String generateFileSystemNameSequence(); //4 boolean isUniqueFileSystemName(String fileSystemName); //2 List<StudyLock> getStudyLocks(); //2 void removeStudyLock(Long studyId); //2 void addStudyLock(Long studyId, Long userId, String detail); //2 void deleteDataVariables(Long dataTableId); //2 edu.harvard.iq.dvn.core.study.Study saveStudyVersion(StudyVersion studyVersion, Long userId); //3 edu.harvard.iq.dvn.core.study.Study importHarvestStudy(File xmlFile, Long vdcId, Long userId, String harvestIdentifier); //3 edu.harvard.iq.dvn.core.study.Study importStudy(File xmlFile, Long harvestFormatTypeId, Long vdcId, Long userId); //3 edu.harvard.iq.dvn.core.study.Study importStudy(File xmlFile, Long harvestFormatTypeId, Long vdcId, Long userId, List<StudyFileEditBean> filesToUpload); //3 edu.harvard.iq.dvn.core.study.Study importStudy(File xmlFile, Long harvestFormatTypeId, Long vdcId, Long userId, String harvestIdentifier, List<StudyFileEditBean> filesToUpload); //1 List getVisibleStudies(List studyIds, Long vdcId); //1 List getViewableStudies(List<Long> studyIds); //1 List getViewableStudies(List<Long> studyIds, Long userId, Long ipUserGroupId, Long vdcId); //3 List getStudyIdsForExport(); //? public List<Long> getAllStudyIds(); //3 public void exportStudy(Long studyId); public void exportStudy(Study study); public void exportStudyToFormat(Long studyId, String exportFormat); public void exportStudyToFormat(Study study, String exportFormat); public void exportUpdatedStudies(); public void exportStudies(List<Long> studyIds); public void exportStudies(List<Long> studyIds, String exportFormat); //2 public boolean isValidStudyIdString(String studyId); public void setIndexTime(Long studyId, Date indexTime); public Timestamp getLastUpdatedTime(Long vdcId); //1 public long getStudyDownloadCount(Long studyId); public Long getActivityCount(Long vdcId); public Long getTotalActivityCount(); //2 public void setReadyForReview(Long studyId); public void setReadyForReview(Long studyId, String versionNote); public void setReadyForReview(StudyVersion sv); public void saveVersionNote(Long studyId, Long versionNumber, String newVersionNote); public void saveVersionNote(Long studyVersionId, String newVersionNote); public void setReleased(Long studyId); public void setReleased(Long studyId, String versionNote); public void destroyWorkingCopyVersion(Long studyVersionId); public void deaccessionStudy(StudyVersion studyVersion); public List getDvOrderedStudyVersionIds(Long vdcId, String orderBy, boolean ascending); public List getDvOrderedStudyVersionIdsByContributor(Long vdcId, Long contributorId, String orderBy, boolean ascending); public List getAllStudyVersionIdsByContributor(Long contributorId, String orderBy, boolean ascending); }
[ "ekraffmiller@hmdc.harvard.edu" ]
ekraffmiller@hmdc.harvard.edu
22a941c1e3fb76a882eea2273c059a751353c249
e4f340aeac661f9439a513537e0f51c49bcb0493
/adminApi/wcaa-wxapp-api/src/main/java/wcaa/api/controller/UserController.java
0405e8bf18be66be7ca0fc486177c235c78abfba
[]
no_license
douruifeng/admin
6d7d13b6b06dea22a3662011f0399663e0639427
0833bad619130c832dd4a490edf18927c978e661
refs/heads/master
2022-06-25T17:04:22.219277
2020-03-07T14:17:06
2020-03-07T14:17:06
242,519,855
0
0
null
2022-06-21T02:51:26
2020-02-23T13:14:37
Vue
UTF-8
Java
false
false
3,943
java
package wcaa.api.controller; import io.swagger.annotations.*; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import wcaa.Vo.PageResult; import wcaa.pojo.User; import wcaa.service.userService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import wcaa.utils.JSONResult; import java.io.*; import java.util.List; @CrossOrigin @RestController @Api(value = "用户相关业务的接口",tags = "用户相关业务的接口") @RequestMapping("/user") public class UserController extends BasicController{ @Autowired private userService userService; @ApiOperation(value = "用户上传头像", notes = "用户上传接口") @ApiImplicitParam(name="userId",value="用户ID",dataType="string",required = true) @PostMapping("/uploadFace") public JSONResult logout(String userId, @RequestParam("file") MultipartFile[] files) { //文件保存的空间 String SaveFilesSpace ="C:/DRF/touxiang"; //保存到数据库中的相对路径 String SaveFilesDB = "/"+userId+"/face"; FileOutputStream fileOutputStream = null; InputStream inputStream = null; if(StringUtils.isBlank(userId)) { return JSONResult.errorMsg("用户ID不能为空"); } try { //操作文件流 if(files != null && files.length > 0) { String filename = files[0].getOriginalFilename(); if(StringUtils.isNotBlank(filename)) { //文件上传的最终保存路径 String fileFacePace = SaveFilesSpace + SaveFilesDB + "/" + filename; //设置数据库保存路径 SaveFilesDB += ("/" + filename); File outFile = new File(fileFacePace); if(outFile.getParentFile() != null || outFile.getParentFile().isDirectory()) { //创建父文件夹 outFile.getParentFile().mkdirs(); } fileOutputStream = new FileOutputStream(outFile); inputStream = files[0].getInputStream(); IOUtils.copy(inputStream,fileOutputStream); }else { return JSONResult.errorMsg("上传访问出错!"); } } } catch (Exception e) { e.printStackTrace(); return JSONResult.errorMsg("上传访问出错!"); }finally { if(fileOutputStream != null) { try { fileOutputStream.flush(); fileOutputStream.close(); } catch (Exception e){ e.printStackTrace(); return JSONResult.errorMsg("上传访问出错!"); } } } //User user = new User(); //user.setId(userId); //user.setPicture(SaveFilesDB); //userService.updateUser(user); return JSONResult.ok(SaveFilesDB); } @ApiOperation(value = "管理员信息", notes = "管理员信息查询接口") @GetMapping("/list") public JSONResult QueryUser(@ApiParam @RequestParam (value="page",required = false,defaultValue = "1") String page, @ApiParam @RequestParam (value="limit",required = false,defaultValue = "20") String limit, @ApiParam @RequestParam (value="sort",required = false,defaultValue = "%2Bid") String sort) { PageResult pageResult = userService.selePage(page,limit); return JSONResult.ok(pageResult); } }
[ "dou_email@163.com" ]
dou_email@163.com
e50303e2590eb1c9547e5847a30fae5281f21307
7129ca7b404f87ffa593dc861a70053c58a15d76
/refrigeratorSemi/src/com/refrigerator/common/controller/AjaxTodayRecipeController.java
3342d0e5ccb95fb4eaec04c3234503b14dafdb92
[]
no_license
seongit/refrigerator_workspace
e37dad4d80b155fe50978d33f4d55e3fbebf7dd4
38e2832defe254ffc114dc66bf61dc49023188b7
refs/heads/main
2023-07-24T00:09:02.009808
2021-09-12T08:09:25
2021-09-12T08:09:25
378,642,113
2
0
null
null
null
null
UTF-8
Java
false
false
1,570
java
package com.refrigerator.common.controller; import java.io.IOException; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.google.gson.Gson; import com.refrigerator.recipe.model.service.RecipeService; import com.refrigerator.recipe.model.vo.Recipe; /** * Servlet implementation class AjaxTodayRecipeController */ @WebServlet("/today.recipe") public class AjaxTodayRecipeController extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public AjaxTodayRecipeController() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ArrayList<Recipe> list = new RecipeService().selectTodayRecipe(); response.setContentType("application/json; charset=utf-8"); request.setAttribute("list",list); new Gson().toJson(list, response.getWriter()); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "seongeunk102@gmail.com" ]
seongeunk102@gmail.com
8974fcd508c6c528fba02913273f8faeddbcc5f2
a86fd523d6c1dc67501989bcf4dc90218bb48c1f
/GreenPOS/src-erp/com/openbravo/ws/externalsales/ProductPlus.java
4f347d66a4109504ae9f41fe7f585e61130770b6
[]
no_license
raccarab/openbravocustom
173302a4d448dda43d47f89ff092020b2cac57a3
2973aefa50331ba082cc8f0c54cd7fde1b273df4
refs/heads/master
2021-01-25T10:29:47.334527
2012-03-13T17:44:13
2012-03-13T17:44:13
32,250,738
0
0
null
null
null
null
UTF-8
Java
false
false
4,203
java
/** * ProductPlus.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.openbravo.ws.externalsales; import com.openbravo.ws.externalsales.ProductPlus; public class ProductPlus extends com.openbravo.ws.externalsales.Product implements java.io.Serializable { private static final long serialVersionUID = 9203746223092L; private double qtyonhand; public ProductPlus() { } public ProductPlus( com.openbravo.ws.externalsales.Category category, java.lang.String description, java.lang.String ean, java.lang.String id, java.lang.String imageUrl, double listPrice, java.lang.String name, java.lang.String number, double purchasePrice, com.openbravo.ws.externalsales.Tax tax, double qtyonhand) { super( category, description, ean, id, imageUrl, listPrice, name, number, purchasePrice, tax); this.qtyonhand = qtyonhand; } /** * Gets the qtyonhand value for this ProductPlus. * * @return qtyonhand */ public double getQtyonhand() { return qtyonhand; } /** * Sets the qtyonhand value for this ProductPlus. * * @param qtyonhand */ public void setQtyonhand(double qtyonhand) { this.qtyonhand = qtyonhand; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof ProductPlus)) { return false; } ProductPlus other = (ProductPlus) obj; if (obj == null) { return false; } if (this == obj) { return true; } if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = super.equals(obj) && this.qtyonhand == other.getQtyonhand(); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = super.hashCode(); _hashCode += new Double(getQtyonhand()).hashCode(); __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(ProductPlus.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("/services/ExternalSales", "ProductPlus")); org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("qtyonhand"); elemField.setXmlName(new javax.xml.namespace.QName("", "qtyonhand")); elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "double")); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
[ "thibaut.colson@gmail.com@59e4095a-f9fc-11de-8cdf-e97ad7d0f28a" ]
thibaut.colson@gmail.com@59e4095a-f9fc-11de-8cdf-e97ad7d0f28a
934c6a95959eaa8a1a0b3ee3db627512abfdd9f1
b4b1990cd06f3f0cd618fa6308e0036043cd5744
/vege-admin/src/main/java/com/vcooline/crm/admin/service/CrmCustomerService.java
8654276337b352edb1a4898b8f0e21bcc90921ed
[]
no_license
yp1989/vege
c1ea8e9cfcf4429d60c7e9f2fdfde42695860f18
5794b7f18d4af08600aa47533971769d6ef9dd5e
refs/heads/master
2021-04-26T04:47:55.345884
2017-10-15T08:16:15
2017-10-15T08:16:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
841
java
package com.vcooline.crm.admin.service; import com.vcooline.crm.common.model.CrmCustomer; import java.util.List; /** * Created by xinbaojian on 15/7/17. */ public interface CrmCustomerService { int deleteByPrimaryKey(Long id); int insert(CrmCustomer record); int insertSelective(CrmCustomer record); CrmCustomer selectByPrimaryKey(Long id); int updateByPrimaryKeySelective(CrmCustomer record); int updateByPrimaryKey(CrmCustomer record); /** * 根据线索ID查询该线索的联系人 * * @param clueId * @param releType * @return */ List<CrmCustomer> getCustlistByClueId(Long clueId, Byte releType); /** * 根据手机号模糊查询客户信息 * * @param phone * @return */ List<CrmCustomer> getCustListByPhone(String phone); }
[ "xinbaojian@126.com" ]
xinbaojian@126.com
95642dd759d4ed1c197d0a6f4d75dad9e102e184
c6b9427eec88a8076c9a936c99c8559d59abe0cc
/demo/src/test/java/com/sixplus/demo/DemoApplicationTests.java
93dcd06aed27ad368dbc5739052dd7c0996d6b8d
[]
no_license
2quarius/e-bookstore
56fbfe284d0c8157f2bcdde584afcb019135fe13
ed3254aafad8dde3647cdd1a2a1c30474eb72d9e
refs/heads/master
2022-12-26T05:49:50.001040
2019-06-09T07:11:43
2019-06-09T07:11:43
175,612,004
2
0
null
2022-12-09T18:37:07
2019-03-14T11:52:25
Vue
UTF-8
Java
false
false
340
java
package com.sixplus.demo; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class DemoApplicationTests { @Test public void contextLoads() { } }
[ "sixplus@sjtu.edu.cn" ]
sixplus@sjtu.edu.cn
39e7797e617432c639e42f91fc6799f4cbc24011
d7ecb3d0d78aefd86820f4ecd66dab82cf1b0808
/exercicio/src/polimorfismo/exercicio3/Addition.java
c0051cb6686b919d6e6806ddd371d1545b6a1c2e
[]
no_license
jailsonsf/Jailson-Farias
1f310ac8a5e370bbae5e7405c586cfd3fb1bdb75
19bae4c0813491c44328c1d15b742d0dcb4c7be1
refs/heads/master
2020-04-04T23:57:18.039875
2019-02-04T12:49:24
2019-02-04T12:49:24
156,377,817
0
0
null
null
null
null
UTF-8
Java
false
false
460
java
package polimorfismo.exercicio3; import java.util.ArrayList; public class Addition implements Operation { @Override public float calculate (float num1, float num2) { return num1 + num2; } @Override public float calculate (ArrayList<Float> numbers) { float result = 0; for (int i = 0; i < numbers.size(); i ++) { result += numbers.get(i); } return result; } }
[ "jailsonsoares002@gmail.com" ]
jailsonsoares002@gmail.com
faee95940fb37df2cc1602437cf3c47b589abd94
425fbbf3612b209b5e46891242c6dd51b8ba5e5f
/jcsecurity/trunk/src/main/java/com/jamcracker/common/security/keymgmt/dao/GenericKeyMgmtDao.java
363d9ab7daa762163a2315cee2c1155f741fbb90
[]
no_license
baskaran-radhakrishnan-10/uniqmac
d885695e588e508e232a3ebd59b9ec7cf25021be
a3646f52723987ccc815989dc12aec0be9a84471
refs/heads/master
2020-03-16T18:19:36.890119
2018-07-19T03:44:50
2018-07-19T03:44:50
132,868,386
1
0
null
null
null
null
UTF-8
Java
false
false
18,747
java
/* * * Class: GenericKeyMgmtDao.java * * Comments for Developers Only: * * Version History: * * Ver Date Who Release What and Why * --- ---------- ---------- ------- --------------------------------------- * 1.0 May 15, 2014 tmarum 7.0 Initial version. * 2.0 Apr 11, 2014 Muthusamy 7.1 changed methods for loading keys from new table jcp_crypto_key_mgmt * Old key creation methods removed * 3.0 June 7, 2014 Muthusamy 7.1 added proper error/log stmt and method level comments * This software is the confidential and proprietary information of Jamcracker, Inc. * ("Confidential Information"). You shall not disclose such Confidential Information * and shall use it only in accordance with the terms of the license agreement you * entered into with Jamcracker, Inc. Copyright (c) 2000 Jamcracker, Inc. All Rights * Reserved * * * ***************************************************** */ package com.jamcracker.common.security.keymgmt.dao; import java.security.Key; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.log4j.Logger; import com.jamcracker.common.security.constants.JCSecurityConstants; import com.jamcracker.common.security.crypto.JCDataLabel; import com.jamcracker.common.security.crypto.core.JCCryptor; import com.jamcracker.common.security.crypto.exception.JCCryptoException; import com.jamcracker.common.security.crypto.exception.JCCryptoFaultCode; import com.jamcracker.common.security.crypto.metadata.ConfigInfo; import com.jamcracker.common.security.crypto.metadata.CryptoAttribute; import com.jamcracker.common.security.keymgmt.dto.DataLabelInfo; import com.jamcracker.common.security.keymgmt.dto.ProtectorDataLabelInfo; import com.jamcracker.common.security.keymgmt.exception.KeyMgmtFaultCode; import com.jamcracker.common.security.keymgmt.service.KmfMgmtCache; import com.jamcracker.common.sql.dataobject.JCPersistenceInfo; import com.jamcracker.common.sql.exception.JCJDBCException; import com.jamcracker.common.sql.rowmapper.IRowMapper; import com.jamcracker.common.sql.spring.facade.dao.BaseSpringDAO; /** * @author tmarum * */ public class GenericKeyMgmtDao extends BaseSpringDAO implements IKeyMgmtDao { public static final Logger LOGGER = Logger.getLogger(GenericKeyMgmtDao.class); /**Will give the key for given crypto type and orgnization id * * @param cryptoType * @param actorId * @return * @throws JCCryptoException */ private JCPersistenceInfo getPersistenceInfo(String queryName, IRowMapper rowMapper) { JCPersistenceInfo jpi = new JCPersistenceInfo(); jpi.setSqlQueryName(queryName); jpi.setModuleName(moduleName); jpi.setRowMapper(rowMapper); return jpi; } /** * Get all keys from DB and load to cache. * PII,FII,Normal keys are protected with passphrase,hence decrypt with passphrase * HMAC salt/key is protected with key HPROTECTOR & encrypted with passphrase ,hence perform 2 level of decryption * */ @Override public Map<String, Map<JCDataLabel, CryptoAttribute>> getAllCryptoDataLabels() throws JCCryptoException { LOGGER.debug("Start: getAllCryptoDataLabels"); Map<JCDataLabel, CryptoAttribute> cryptoKeyMap = null; Map<String, Map<JCDataLabel, CryptoAttribute>> actorCryptoKeys = null; List<DataLabelInfo> list = null; JCCryptor jCCryptor = new JCCryptor(); String originalKey = null; String actualKey = null; Key key = null; String passphrase = System.getProperty(JCSecurityConstants.PASSPHRASE); try { Object[] objectParamValue = new Object[0]; JCPersistenceInfo jcPersistenceInfo = getPersistenceInfo("GET_ALL_KEYS", new DataLabelRowMapper()); jcPersistenceInfo.setSqlParams(objectParamValue); list = query(jcPersistenceInfo); if (list != null && list.size() > 0) { actorCryptoKeys = new HashMap<String, Map<JCDataLabel, CryptoAttribute>>(); Map<Integer, ProtectorDataLabelInfo> protectorAttribute = getAllProtectorKeys(); Map<JCDataLabel, Integer> versionMap = getLatestVersionForAllDataLabel(); String[] hmackeys = { JCSecurityConstants.HASHALG}; Map<String, String> hmackeyscmxMapMetaData = getConfig(hmackeys); for (DataLabelInfo datalabelInfo : list) { CryptoAttribute cryptoAttribute = new CryptoAttribute(); String actorIdandVersion = Integer.toString(datalabelInfo.getActorId()) + JCSecurityConstants.CMX_METADATA_SEPERATOR + Integer.toString(datalabelInfo.getKeyVersion()); cryptoKeyMap = actorCryptoKeys.get(actorIdandVersion); if (cryptoKeyMap == null) { cryptoKeyMap = new HashMap<JCDataLabel, CryptoAttribute>(); actorCryptoKeys.put(actorIdandVersion, cryptoKeyMap); } if (datalabelInfo.getDataLabel() == JCDataLabel.HMAC) { ProtectorDataLabelInfo protectorDataLabelInfo = protectorAttribute.get(datalabelInfo.getKeyVersion()); key = jCCryptor.constructKey(datalabelInfo.getCryptoKey(), protectorDataLabelInfo.getAlgorithm()); actualKey = jCCryptor.decPassPhraseKey(key, passphrase); originalKey = jCCryptor.decrypt(protectorDataLabelInfo.getAlgorithm(), protectorDataLabelInfo.getProtectorKey(), actualKey, protectorDataLabelInfo.getProvider()); key = jCCryptor.constructKey(originalKey, JCSecurityConstants.HASHALG); } else { key = jCCryptor.constructKey(datalabelInfo.getCryptoKey(), datalabelInfo.getAlgorithm()); cryptoAttribute.setProvider(datalabelInfo.getProvider()); cryptoAttribute.setAlgorithm(datalabelInfo.getAlgorithm()); originalKey = jCCryptor.decPassPhraseKey(key, passphrase); key = jCCryptor.constructKey(originalKey, datalabelInfo.getAlgorithm()); } cryptoAttribute.setStatus(datalabelInfo.getStatus()); cryptoAttribute.setKey(key); cryptoKeyMap.put(datalabelInfo.getDataLabel(), cryptoAttribute); if (versionMap.containsKey(JCDataLabel.valueOf(datalabelInfo.getDataLabel().getId())) && versionMap.get(JCDataLabel.valueOf(datalabelInfo.getDataLabel().getId())).equals(datalabelInfo.getKeyVersion())) { loadCMXData(versionMap, datalabelInfo, hmackeyscmxMapMetaData); } } } else { LOGGER.debug("No Active Keys Available...."); throw new JCCryptoException(JCCryptoFaultCode.CRYPTO_NO_ACTIVE_KEYS); } } catch (JCCryptoException e) { LOGGER.error("JCCryptoException"+e.getMessage()); throw new JCCryptoException(e.getFaultCode()); } catch (JCJDBCException e) { LOGGER.error("JCJDBCException"+e.getMessage()); throw new JCCryptoException(KeyMgmtFaultCode.UNABLE_TO_GET_KEY, e); } if(list!=null && list.size()>0) LOGGER.debug("Total Keys Loaded From DB " + list.size()); LOGGER.debug("End: getAllCryptoDataLabels "); return actorCryptoKeys; } /** * Load CrypoGraphy CMD Data Information for Latest DataLabels * @param versionMap * @param datalabelInfo * @param hmackeyscmxMapMetaData * @throws Exception */ private void loadCMXData(Map<JCDataLabel, Integer> versionMap, DataLabelInfo datalabelInfo, Map<String, String> hmackeyscmxMapMetaData) throws JCCryptoException { KmfMgmtCache.getInstance().putlatestVersion(JCDataLabel.valueOf(datalabelInfo.getDataLabel().getId()), versionMap.get(JCDataLabel.valueOf(datalabelInfo.getDataLabel().getId()))); List<String> list = new ArrayList<String>(); String cmxData=null; if (!JCDataLabel.valueOf(datalabelInfo.getDataLabel().getId()).equals(JCDataLabel.HMAC)) { list.add(datalabelInfo.getKeyType().toUpperCase()); list.add(datalabelInfo.getAlgorithm()); list.add(datalabelInfo.getKeyLength()); list.add(datalabelInfo.getKeyId().toUpperCase()); list.add(String.valueOf(JCDataLabel.valueOf(datalabelInfo.getDataLabel().getId())).toUpperCase()); cmxData=getCMXData(list, datalabelInfo.getKeyVersion(), datalabelInfo.getDataLabel().getId()); KmfMgmtCache.getInstance().putcmxDataMap(JCDataLabel.valueOf(datalabelInfo.getDataLabel().getId()), cmxData); } if (JCDataLabel.valueOf(datalabelInfo.getDataLabel().getId()).equals(JCDataLabel.HPROTECTOR)) { String hashcmxData = Integer.toString(datalabelInfo.getKeyVersion()) + "-" + hmackeyscmxMapMetaData.get(JCSecurityConstants.HASHALG); KmfMgmtCache.getInstance().putcmxDataMap(JCDataLabel.HMAC, hashcmxData); } } /** * Method Gets parent actorId. * @param actorId * @return * @throws JCCryptoException */ @Override public Integer getParentToChild(Integer actorId) throws JCCryptoException { LOGGER.debug("Start: getParent()-->"+actorId); Integer parentId = null; try { Object[] objectParamValue = new Object[1]; objectParamValue[0] = actorId; JCPersistenceInfo jcPersistenceInfo = getPersistenceInfo("GET_PARENT_TO_CHILD", new ActorIdRowMapper()); jcPersistenceInfo.setSqlParams(objectParamValue); List<Integer> list = query(jcPersistenceInfo); if (list == null || list.size() == 0) { return 0; } else { parentId = list.get(0); } } catch (Exception e) { LOGGER.error("actorId: "+actorId); LOGGER.error(e,e); throw new JCCryptoException(KeyMgmtFaultCode.ERROR_WHILE_GETTING_MISSING_ACTORS, e); } LOGGER.debug("End: getParent()-->"+parentId); return parentId; } /** * Reteive CMX Key Id mapping fields * @param configKeys * @return * @throws JCCryptoException */ private Map<String,String> getConfig(String configKeys[]) throws JCCryptoException{ LOGGER.debug("Start getConfig"); Map<String,String> configMap = new HashMap<String, String>(); ConfigInfo configInfo = null; List configInfoList = null; if(configKeys != null){ String sqlQueryName = "GET_CONFIG_FOR_CMX_DATALABELS"; String sqlvalue=getSqlManager().getQueryString(moduleName, sqlQueryName); Object[] sqlParamSelect = new Object[configKeys.length]; if((configKeys !=null) && (configKeys.length > 0)){ for(int i=0;i<configKeys.length;i++){ sqlvalue=sqlvalue.concat("?"); sqlParamSelect[i]=configKeys[i]; if( (i + 1)< configKeys.length ){ sqlvalue=sqlvalue.concat(","); } } sqlvalue= sqlvalue.concat(")"); JCPersistenceInfo jcPersistenceInfo = new JCPersistenceInfo(); jcPersistenceInfo.setSqlQueryValue(sqlvalue); jcPersistenceInfo.setSqlParams(sqlParamSelect); jcPersistenceInfo.setRowMapper(new ConfigRowMapper()); jcPersistenceInfo.setModuleName(moduleName); try { configInfoList =query(jcPersistenceInfo); if (configInfoList!= null && configInfoList.size() > 0) { Iterator listIterate=configInfoList.iterator(); while(listIterate.hasNext()){ configInfo =(ConfigInfo)listIterate.next(); configMap.put(configInfo.getConfigKey(), configInfo.getConfigValue()); } } }catch (JCJDBCException e) { e.printStackTrace(); LOGGER.error("Error in getting the Audit configuration from database:", e); throw new JCCryptoException(e.getFaultCode(), e); } if(LOGGER.isDebugEnabled()){ LOGGER.debug("getConfigValues() : End"); } } } LOGGER.debug("End getConfig"); return configMap; } /** * This method used to get the cmx data (i.e. data presents before '~' symbol) * @param list * @param latestVesion * @param cryptoType * @return * @throws JCCryptoException */ private String getCMXData(List<String> list,int latestVesion,int cryptoType) throws JCCryptoException{ String cmxData=null; String [] keys = list.toArray(new String[list.size()]); Map<String,String> cmxMapMetaData = getConfig(keys); cmxData = prepareCMXMetaData(latestVesion, list, cmxMapMetaData); return cmxData; } /** * Reteive Latest version of each dataLabel info * @return * @throws JCCryptoException */ private Map<JCDataLabel,Integer> getLatestVersionForAllDataLabel() throws JCCryptoException { LOGGER.debug("Start: getLatestVersionForAllDataLabel" ); HashMap<JCDataLabel,Integer> hmap = new HashMap<JCDataLabel,Integer>(); try { Object[] objectParamValue = new Object[0]; JCPersistenceInfo jcPersistenceInfo = getPersistenceInfo("GET_LATEST_VERSION", new DataLabelVersionRowMapper()); jcPersistenceInfo.setSqlParams(objectParamValue); List<DataLabelInfo> list = query(jcPersistenceInfo); for (DataLabelInfo datalabelInfo : list) { hmap.put(datalabelInfo.getDataLabel(), datalabelInfo.getKeyVersion()); } } catch (Exception e) { LOGGER.error("Exception in getLatestVersionForAllDataLabel", e); throw new JCCryptoException(KeyMgmtFaultCode.UNABLE_TO_GET_KEY, e); } LOGGER.debug("End: getLatestVersionForAllDataLabel"+hmap.size() ); return hmap; } /** * Method used to get Hprotector keys * @return * @throws JCCryptoException */ public Map<Integer,ProtectorDataLabelInfo> getAllProtectorKeys() throws JCCryptoException { LOGGER.debug("Start getAllProtectorKeys "); Map<Integer,ProtectorDataLabelInfo> protectorMap = new HashMap<Integer,ProtectorDataLabelInfo>(); JCCryptor jCCryptor = new JCCryptor(); try { Object[] objectParamValue = new Object[0]; JCPersistenceInfo jcPersistenceInfo = getPersistenceInfo("GET_PROTECTOR_KEY", new ProtectorKeyRowMapper()); jcPersistenceInfo.setSqlParams(objectParamValue); List<ProtectorDataLabelInfo> list = query(jcPersistenceInfo); for (ProtectorDataLabelInfo proDataLabelInfo: list) { ProtectorDataLabelInfo updatedDataLabelInfo=new ProtectorDataLabelInfo(); updatedDataLabelInfo.setAlgorithm(proDataLabelInfo.getAlgorithm()); updatedDataLabelInfo.setKeyVersion(proDataLabelInfo.getKeyVersion()); updatedDataLabelInfo.setProvider(proDataLabelInfo.getProvider()); Key protectorKey = null; try { protectorKey = jCCryptor.constructKey(proDataLabelInfo.getKeyString(), proDataLabelInfo.getAlgorithm()); String key =jCCryptor.decPassPhraseKey(protectorKey, System.getProperty(JCSecurityConstants.PASSPHRASE)); protectorKey = jCCryptor.constructKey(key, proDataLabelInfo.getAlgorithm()); } catch (JCCryptoException e) { LOGGER.error("Given Passphrase is invalid "+e.getFaultCode()); throw new JCCryptoException(e.getFaultCode()); } updatedDataLabelInfo.setProtectorKey(protectorKey); protectorMap.put(proDataLabelInfo.getKeyVersion(), updatedDataLabelInfo); } }catch (Exception e) { LOGGER.error("Exception in getAllProtectorKeys "+e.getMessage()); throw new JCCryptoException(KeyMgmtFaultCode.UNABLE_TO_GET_KEY, e); } LOGGER.debug("End getAllProtectorKeys "+protectorMap.size()); return protectorMap; } /** * Method is responsible to construct cmx information * @param latestVesion * @param list * @param cmxMapMetaData * @return */ private String prepareCMXMetaData(int latestVesion,List<String> list,Map<String,String> cmxMapMetaData) { LOGGER.debug("Start: prepareCMXMetaData starts"); String keyType=(String) cmxMapMetaData.get(list.get(0)); String algorithm =(String) cmxMapMetaData.get(list.get(1)); String keyLength =(String) cmxMapMetaData.get(list.get(2)); String keyId=(String) cmxMapMetaData.get(list.get(3)); String dataLabels=(String) cmxMapMetaData.get(list.get(4)); StringBuilder sb = new StringBuilder(); sb.append(latestVesion); sb.append("-"); sb.append(keyType); sb.append("-"); sb.append(algorithm); sb.append("-"); sb.append(keyLength); sb.append("-"); sb.append(keyId); sb.append("-"); sb.append(dataLabels); LOGGER.debug("End: prepareCMXMetaData"); return sb.toString(); } /** * Method used to get the key validity. * */ @Override public List<DataLabelInfo> getKeyValidityDetails() throws JCCryptoException { LOGGER.debug("Start: getKeyValidityDetails()-->"); List<DataLabelInfo> list=null; try { String sqlQueryName = "GET_KEY_VALIDITY"; String sqlvalue=getSqlManager().getQueryString(moduleName, sqlQueryName); JCPersistenceInfo jcPersistenceInfo = new JCPersistenceInfo(); jcPersistenceInfo.setSqlQueryValue(sqlvalue); jcPersistenceInfo.setRowMapper(new KeyValueRowMapper()); jcPersistenceInfo.setModuleName(moduleName); list= query(jcPersistenceInfo); } catch (Exception e) { LOGGER.error("error in getKeyValidityDetails details: "+e.getMessage()); throw new JCCryptoException(KeyMgmtFaultCode.UNABLE_TO_GET_KEY, e); } LOGGER.debug("End: getKeyValidityDetails()"); return list; } /** * Method updates key status based on cryptoId * @param expiredCryptoId * @throws JCCryptoException */ @Override public void updateDataLabelStatus(List<Integer> expiredCryptoId) throws JCCryptoException { LOGGER.debug("Start: updateDataLabelStatus() "); try { int length=expiredCryptoId.size(); String sqlQueryName = "UPDATE_KEY_EXPIRED_STATUS"; String sqlvalue=getSqlManager().getQueryString(moduleName, sqlQueryName); Object[] sqlParamSelect = new Object[expiredCryptoId.size()+2]; int i=0; Date date = Calendar.getInstance().getTime(); sqlParamSelect[i++]=new java.sql.Timestamp(date.getTime()); sqlParamSelect[i++]=1000; for(Integer expiredId:expiredCryptoId){ sqlvalue=sqlvalue.concat("?"); sqlParamSelect[i++]=expiredId; if(expiredCryptoId.get(length-1)!=expiredId) { sqlvalue=sqlvalue.concat(","); } }sqlvalue= sqlvalue.concat(")"); JCPersistenceInfo jcPersistenceInfo = new JCPersistenceInfo(); jcPersistenceInfo.setSqlQueryValue(sqlvalue); jcPersistenceInfo.setSqlParams(sqlParamSelect); execute(jcPersistenceInfo); }catch (Exception e) { LOGGER.error("updateDataLabelStatus"+e.getMessage()); throw new JCCryptoException(KeyMgmtFaultCode.UNABLE_TO_UPDATE_LABEL_STAUS, e); } LOGGER.debug("End: updateDataLabelStatus()"); } /** * Method populates Latest CMX xml and Digitally signed xml * @return Map * @throws JCCryptoException */ @Override public Map<String, String> getLatestXML() throws JCCryptoException { Map<String, String> xmlandSignature=null; try { Object[] objectParamValue = new Object[0]; JCPersistenceInfo jcPersistenceInfo = getPersistenceInfo("GET_XML_ANDCMXSIGN_DATA", new XmlRowMapper()); jcPersistenceInfo.setSqlParams(objectParamValue); List<String[]> list = query(jcPersistenceInfo); xmlandSignature = new HashMap<String, String>(); for (String[] xmls: list) { xmlandSignature.put(xmls[0], xmls[1]); } } catch (Exception e) { LOGGER.error("Exception in getLatestXML"+e.getMessage()); throw new JCCryptoException(KeyMgmtFaultCode.UNABLE_TO_GET_KEY, e); } return xmlandSignature; } }
[ "baskaran.coder@gmail.com" ]
baskaran.coder@gmail.com
bbbf43e5e528ae7f882ad5be2a2cfd4abd5200dd
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/26/26_560ec3b9c3985ca3ce5536b74b21e5c6a781b692/UIBean/26_560ec3b9c3985ca3ce5536b74b21e5c6a781b692_UIBean_t.java
fb4f53740ce65d6d17c2ef7d00fb0d04c41dc48d
[]
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,648
java
/* Copyright c 2005-2012. * Licensed under GNU LESSER General Public License, Version 3. * http://www.gnu.org/licenses */ package org.beangle.struts2.view.component; import java.io.Writer; import java.text.MessageFormat; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.apache.struts2.ServletActionContext; import org.beangle.commons.lang.Chars; import org.beangle.commons.lang.Strings; import org.beangle.struts2.util.TextResourceHelper; import org.beangle.struts2.view.UIIdGenerator; import org.beangle.struts2.view.template.TemplateEngine; import org.beangle.struts2.view.template.Theme; import org.beangle.struts2.view.template.ThemeStack; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.inject.Container; import com.opensymphony.xwork2.util.ValueStack; /** * @author chaostone */ public abstract class UIBean extends Component { protected String id; protected Theme theme; public UIBean(ValueStack stack) { super(stack); } protected void evaluateParams() { } @Override public boolean end(Writer writer, String body) { evaluateParams(); try { mergeTemplate(writer); } catch (Exception e) { throw new RuntimeException(e); } popComponentStack(); return false; } protected void mergeTemplate(Writer writer) throws Exception { TemplateEngine engine = getContainer().getInstance(TemplateEngine.class); engine.render(getTheme().getTemplatePath(getClass(), engine.getSuffix()), stack, writer, this); } /** * 将所有额外参数链接起来 * * @return 空格开始 空格相隔的参数字符串 */ public String getParameterString() { StringBuilder sb = new StringBuilder(parameters.size() * 10); for (Map.Entry<String, Object> entry : parameters.entrySet()) { String key = entry.getKey(); if ("cssClass".equals(key)) key = "class"; sb.append(" ").append(key).append("=\"").append(entry.getValue().toString()).append("\""); } return sb.toString(); } public String getId() { return id; } public void setId(String id) { this.id = id; } protected Theme getTheme() { if (null == theme) { ThemeStack themestack = (ThemeStack) stack.getContext().get(Theme.THEME_STACK); if (null != themestack) theme = themestack.peek(); if (null == theme) theme = (Theme) stack.getContext().get(Theme.THEME); return theme; } else { return theme; } } public void setTheme(String theme) { this.theme = Theme.getTheme(theme); } /** * 获得对应的国际化信息 * * @param text * @return 当第一个字符不是字母或者不包含.或者包含空格的均返回原有字符串 */ protected String getText(String text) { return getText(text, text); } protected String getText(String text, String defaultText) { if (Strings.isEmpty(text)) return defaultText; if (!Chars.isAsciiAlpha(text.charAt(0))) return defaultText; if (-1 == text.indexOf('.') || -1 < text.indexOf(' ')) { return defaultText; } else { // long start = System.currentTimeMillis(); String msg = TextResourceHelper.getText(text, defaultText, stack); // System.out.println("I18n:" + text + "->" + msg + " use :" + (System.currentTimeMillis() - // start)); return msg; } } protected HttpServletRequest getRequest() { return (HttpServletRequest) stack.getContext().get(ServletActionContext.HTTP_REQUEST); } protected String getRequestURI() { return getRequest().getRequestURI(); } protected String getRequestParameter(String name) { return getRequest().getParameter(name); } private static final String Number_Fmt = "{0,number,#.##}"; protected Object getValue(Object obj, String property) { stack.push(obj); try { Object value = stack.findValue(property); if (value instanceof Number) { return MessageFormat.format(Number_Fmt, value); } return value; } finally { stack.pop(); } } protected Container getContainer() { return (Container) stack.getContext().get(ActionContext.CONTAINER); } protected String render(String uri) { return getContainer().getInstance(ActionUrlRender.class).render(getRequestURI(), uri); } protected void generateIdIfEmpty() { if (Strings.isEmpty(id)) { id = ((UIIdGenerator) stack.getContext().get(UIIdGenerator.GENERATOR)).generate(getClass()); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d5d72abb64d6c3f314fde05ac3efc360264db500
3fd6c61f50cc2202c00c69b1cafe74768db414a1
/ProximitySensor/app/src/main/java/spider/proximitysensor/ProximitySensor.java
32f77cdd161b80ba9b1d685a64d798a1b83206bf
[]
no_license
gulapals/Spider_AppDev
88fb3cd4507b189b0253b9a3b2fd9612309f73b3
93c0ac747baa5fc36502198883694794a0e17736
refs/heads/master
2021-01-25T06:55:34.649346
2017-06-27T06:31:47
2017-06-27T06:31:47
93,232,292
0
0
null
null
null
null
UTF-8
Java
false
false
2,201
java
package spider.proximitysensor; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.media.MediaPlayer; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.ImageView; import android.widget.TextView; public class ProximitySensor extends AppCompatActivity implements SensorEventListener { private SensorManager sensorManager; private Sensor sensor; private ImageView imageView; private MediaPlayer mediaPlayer; private TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_proximity_sensor); sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); sensor = sensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); imageView = (ImageView) findViewById(R.id.imageView); mediaPlayer = MediaPlayer.create(this, R.raw.curse); textView = (TextView) findViewById(R.id.textView); } @Override protected void onResume(){ super.onResume(); sensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_NORMAL); } @Override protected void onPause() { super.onPause(); sensorManager.unregisterListener(this); } public void onAccuracyChanged(Sensor sensor, int accuracy) { } @Override public void onSensorChanged(SensorEvent event) { if (event.values[0] <= 1) { imageView.setImageResource(R.drawable.yosemitesambackoff); mediaPlayer.start(); // new CountDownTimer(30000, 1000) { // // public void onTick(long millisUntilFinished) { // textView.setText("seconds remaining: " + millisUntilFinished / 1000); // } // // public void onFinish() { // textView.setText("done!"); // } // }.start(); } else{ imageView.setImageResource(R.drawable.happy); mediaPlayer.pause(); } } }
[ "vinothgulapala@gmail.com" ]
vinothgulapala@gmail.com
38967adb8329e8cba760cb2c434177d922228436
35e09022a7a85679365a616df7793e9f35d37f61
/src/main/java/ru/controllers/UserController.java
f224cce42ff845df7957bdff76c5246289300199
[]
no_license
babay182/2.3.1
5e8f0c6f15a9e5e2e42611c7a4c1f6ebc53677b3
3498153bf633aaf6f6df385482e5ba0b04c785f2
refs/heads/master
2023-07-31T14:22:58.540299
2021-09-13T12:31:08
2021-09-13T12:32:28
393,844,164
0
0
null
null
null
null
UTF-8
Java
false
false
973
java
package ru.controllers; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import ru.service.UserService; import java.security.Principal; @Controller @RequestMapping("/") @Transactional public class UserController { private final UserService userService; @Autowired public UserController(UserService userService) { this.userService = userService; } @GetMapping("/login") public String formlogin() { return "/login"; } @GetMapping("/users/user") public String userProfile(Principal principal, Model model) { model.addAttribute("user", userService.getUserByName(principal.getName())); return "admin/show"; } }
[ "QaZWGhJ07^gnmc" ]
QaZWGhJ07^gnmc
1a369daff004c571bc9cc7dc5105c4d4e977d720
a472b32f79fd36cdf00d52d9f05ddb304dd1d644
/app/src/main/java/com/example/phoenix/nab/domain/interactor/DownloadFileUseCase.java
f9ff422785930158370d6ef0824caed9ba6a1a22
[]
no_license
Phanhuuloc/NAB
00898375b5ff9743896d646ba3bdebe654292082
814203d1cb9886af29e02a81048356241da2b181
refs/heads/master
2020-05-23T02:14:47.267972
2017-03-12T17:02:32
2017-03-12T17:02:32
84,741,461
0
0
null
2017-03-14T16:55:16
2017-03-12T16:50:56
Java
UTF-8
Java
false
false
979
java
package com.example.phoenix.nab.domain.interactor; import com.example.phoenix.nab.common.AppUtils; import com.example.phoenix.nab.data.net.RestApiImpl; import com.example.phoenix.nab.data.repository.ApiMediator; import io.reactivex.Observable; /** * Created by Phoenix on 3/11/17. */ public class DownloadFileUseCase extends UseCase<String, DownloadFileUseCase.Params> { private final ApiMediator apiMediator; public DownloadFileUseCase() { super(); this.apiMediator = new ApiMediator(RestApiImpl.getInstance()); } @Override Observable<String> buildUseCaseObservable(Params params) { AppUtils.checkNotNull(params); return apiMediator.downloadFile(params.url); } public static class Params { private final String url; public Params(String url) { this.url = url; } public static Params forDownload(String url) { return new Params(url); } } }
[ "huuloc.phan@gmail.com" ]
huuloc.phan@gmail.com
db673b83eeeb7811dac5ee103ffc12d086ea0e88
207f5706f1a15b1470e23199ddb7c44893475fcf
/app/src/main/java/com/fangfas/alincebusinessdaojobs/View/SlideList/SlideView.java
3f627edc21419835347f59d50411c74861f97b3d
[]
no_license
bruis121/alincebusinessdaojobs
560476803bc0a3a50f6cbc42d67ff73dfa797fe6
fdbe2ffa91e317f78806fe62eba5c76db3f009d9
refs/heads/master
2020-04-07T09:13:15.456828
2018-03-07T07:48:16
2018-03-07T07:48:16
124,199,161
0
0
null
null
null
null
UTF-8
Java
false
false
4,625
java
package com.fangfas.alincebusinessdaojobs.View.SlideList; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.util.TypedValue; import android.view.MotionEvent; import android.view.View; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.Scroller; import android.widget.TextView; import com.fangfas.alincebusinessdaojobs.R; public class SlideView extends LinearLayout { private static final String TAG = "SlideView"; private Context mContext; private LinearLayout mViewContent; private RelativeLayout mHolder; private Scroller mScroller; private OnSlideListener mOnSlideListener; private int mHolderWidth = 120; private int mLastX = 0; private int mLastY = 0; private static final int TAN = 2; public interface OnSlideListener { public static final int SLIDE_STATUS_OFF = 0; public static final int SLIDE_STATUS_START_SCROLL = 1; public static final int SLIDE_STATUS_ON = 2; /** * @param view current SlideView * @param status SLIDE_STATUS_ON or SLIDE_STATUS_OFF */ public void onSlide(View view, int status); } public SlideView(Context context) { super(context); initView(); } public SlideView(Context context, AttributeSet attrs) { super(context, attrs); initView(); } private void initView() { mContext = getContext(); mScroller = new Scroller(mContext); setOrientation(LinearLayout.HORIZONTAL); View.inflate(mContext, R.layout.privatelisting_delete_merge, this); mViewContent = (LinearLayout) findViewById(R.id.view_content); mHolderWidth = Math.round(TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, mHolderWidth, getResources() .getDisplayMetrics())); } public void setButtonText(CharSequence text) { ((TextView)findViewById(R.id.delete)).setText(text); } public void setContentView(View view) { mViewContent.addView(view); } public void setOnSlideListener(OnSlideListener onSlideListener) { mOnSlideListener = onSlideListener; } public void shrink() { if (getScrollX() != 0) { this.smoothScrollTo(0, 0); } } public void onRequireTouchEvent(MotionEvent event) { int x = (int) event.getX(); int y = (int) event.getY(); int scrollX = getScrollX(); Log.d(TAG, "x=" + x + " y=" + y); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: { if (!mScroller.isFinished()) { mScroller.abortAnimation(); } if (mOnSlideListener != null) { mOnSlideListener.onSlide(this, OnSlideListener.SLIDE_STATUS_START_SCROLL); } break; } case MotionEvent.ACTION_MOVE: { int deltaX = x - mLastX; int deltaY = y - mLastY; if (Math.abs(deltaX) < Math.abs(deltaY) * TAN) { break; } int newScrollX = scrollX - deltaX; if (deltaX != 0) { if (newScrollX < 0) { newScrollX = 0; } else if (newScrollX > mHolderWidth) { newScrollX = mHolderWidth; } this.scrollTo(newScrollX, 0); } break; } case MotionEvent.ACTION_UP: { int newScrollX = 0; if (scrollX - mHolderWidth * 0.75 > 0) { newScrollX = mHolderWidth; } this.smoothScrollTo(newScrollX, 0); if (mOnSlideListener != null) { mOnSlideListener.onSlide(this, newScrollX == 0 ? OnSlideListener.SLIDE_STATUS_OFF : OnSlideListener.SLIDE_STATUS_ON); } break; } default: break; } mLastX = x; mLastY = y; } private void smoothScrollTo(int destX, int destY) { // 缓慢滚动到指定位置 int scrollX = getScrollX(); int delta = destX - scrollX; mScroller.startScroll(scrollX, 0, delta, 0, Math.abs(delta) * 3); invalidate(); } @Override public void computeScroll() { if (mScroller.computeScrollOffset()) { scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); postInvalidate(); } } }
[ "bruis121@163.com" ]
bruis121@163.com
1a2af584dffecd2b2eec274fd604faa678313067
0ed7569b232c5c1dd8a7019064b7c1f35d6adba6
/Android/app/src/main/java/ca/ualberta/medroad/model/raw_table_rows/PatientRow.java
1731c4db67a2892fcf4dc2e17bd934f17a6ebd06
[ "Apache-2.0" ]
permissive
cntnboys/302-project
071b22d6c290a4ad23ce80afcd7c5f7a536f564a
48835d087e624902266ac86c5053a27640f2e6cc
refs/heads/master
2020-05-20T00:56:43.181618
2015-04-17T04:31:22
2015-04-17T09:17:02
29,940,943
0
2
null
null
null
null
UTF-8
Java
false
false
1,553
java
package ca.ualberta.medroad.model.raw_table_rows; import com.google.gson.Gson; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import ca.ualberta.medroad.auxiliary.Encrypter; import ca.ualberta.medroad.model.Patient; /** * Created by Yuey on 2015-03-12. * <p/> * Class representing a raw database latestRow for patients. */ public class PatientRow { public static final SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd", Locale.getDefault() ); public String patient_id; public String ahcn; public String dob; public String liveStatus; public String doctor; public String name; public PatientRow( int id, String ahcn, Date dob, boolean live, String physician, String name ) { this.patient_id = String.valueOf( id ); this.ahcn = ahcn; this.dob = sdf.format( dob ); //this.liveStatus = String.valueOf( live ); this.doctor = physician; this.name = name; if ( live ) { liveStatus = "y"; } else { liveStatus = "n"; } } public PatientRow( Patient patient, boolean live ) { this( patient.getId(), patient.getAhcn(), patient.getDob().getTime(), live, patient.getDoctor(), patient.getName() ); } public static String getJSON( PatientRow row ) { Gson gson = new Gson(); return Encrypter.encryptToString( gson.toJson( row ) ); } public static byte[] directToByte( PatientRow row ) { Gson gson = new Gson(); String jsonPayload = gson.toJson( row ); return Encrypter.encryptToByteArray( jsonPayload ); } }
[ "brandon.d.yue@gmail.com" ]
brandon.d.yue@gmail.com
5ac705d1e542e75669f6476cd62bef9be981d6e5
1b949586c8feb0fb5230382fa8501850893950b1
/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/registration/service/SelfServiceRegistrationReadPlatformService.java
9ff45b47ba92e17957d07c7ac152494c3250be0b
[ "MIT", "BSD-3-Clause", "Apache-2.0", "LGPL-2.0-or-later", "LicenseRef-scancode-public-domain", "CDDL-1.1", "LicenseRef-scancode-free-unknown", "EPL-1.0", "Classpath-exception-2.0", "GPL-2.0-only" ]
permissive
cjxonix/fineractapp
44d3a66cf9eddc99bfa3d8f5697797bc855f8e46
b711fb2d142f5f7ecc39448fa868cc0542084328
refs/heads/master
2022-06-19T11:52:56.167338
2020-04-06T05:37:37
2020-04-06T05:37:37
253,395,889
0
0
Apache-2.0
2022-06-03T02:18:38
2020-04-06T04:39:14
Java
UTF-8
Java
false
false
1,094
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.fineract.portfolio.self.registration.service; public interface SelfServiceRegistrationReadPlatformService { public boolean isClientExist(String accountNumber, String firstName, String lastName, String mobileNumber, boolean isEmailAuthenticationMode); }
[ "niwoogabajoel@gmail.com" ]
niwoogabajoel@gmail.com
2a62d42a32636704f840dae93cca529a96525f07
17595292e9ba84c47927e301ca37b86128c02879
/src/main/AccountGui.java
8272e7d764f75462c171a59851457c8a15a9989c
[]
no_license
frabbisw/account-management-system
9a7decd2d17ba76ab3d2fda1e4c9ee6fd9ded542
ce22f546810ef3ec49230987fe9c40758ed4049f
refs/heads/master
2021-06-07T21:26:32.004957
2021-05-01T09:18:32
2021-05-01T09:18:32
154,197,863
1
0
null
null
null
null
UTF-8
Java
false
false
26,976
java
package main; import java.awt.*; import java.awt.event.*; import java.io.IOException; import java.util.ArrayList; import javax.swing.*; public class AccountGui { int choice = 0; String name, tmp; int ID = 100000,index; double v; LoadAndSave sal; public ArrayList <Account> info; public AccountGui() { info = new ArrayList <Account> (); sal = new LoadAndSave(); try { info = sal.load(); } catch(Exception e) { new AllExceptions(e); } if(info.size()!=0) ID = info.get(info.size()-1).getID(); make(); try { sal.save(info); } catch(Exception e) { new AllExceptions(e); } } public void make() { final JFrame frame = new JFrame("Account"); frame.setSize(800, 600); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); JPanel panel = new JPanel(); JLabel label = new JLabel("Choose an Option: "); panel.add(label); frame.add(panel); JButton newButton = new JButton("New Account"); panel.add(newButton); JButton existedButton = new JButton("Existed Account"); panel.add(existedButton); JButton exitAccount = new JButton("Exit"); panel.add(exitAccount); newButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub JFrame newFrame = new JFrame("New"); newFrame.setSize(800, 600); newFrame.setVisible(true); newFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel newPanel = new JPanel(); newFrame.add(newPanel); JButton savingButton = new JButton("Savings Account"); newPanel.add(savingButton); JButton currentButton = new JButton("Current Account"); newPanel.add(currentButton); JButton exitNew = new JButton("exit"); newPanel.add(exitNew); savingButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame savingFrame = new JFrame("Saving Account"); savingFrame.setSize(800, 600); savingFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); savingFrame.setVisible(true); final JPanel namePanel = new JPanel(); savingFrame.add(namePanel); JLabel savingLabel = new JLabel("Enter your name"); final JTextField savingField = new JTextField("name", 20); JButton savingOkButton = new JButton("OK"); namePanel.add(savingLabel); namePanel.add(savingField); namePanel.add(savingOkButton); savingOkButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { name = savingField.getText(); namePanel.setVisible(false); ID++; final Account scc = new SavingAccount(name, ID, 0); JPanel savingPanel = new JPanel(); savingFrame.add(savingPanel); JButton withdrawButton = new JButton("Withdraw"); savingPanel.add(withdrawButton); JButton depositButton = new JButton("Deposit"); savingPanel.add(depositButton); final JButton seeButton = new JButton("See"); savingPanel.add(seeButton); JButton exitSaving = new JButton("Exit"); savingPanel.add(exitSaving); withdrawButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame withdrawFrame = new JFrame("Withdraw"); withdrawFrame.setVisible(true); withdrawFrame.setSize(800,600); withdrawFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel withdrawPanel = new JPanel(); withdrawFrame.add(withdrawPanel); JLabel withdrawLabel = new JLabel("Enter amount"); final JTextField withdrawField = new JTextField("0",30); JButton okButton = new JButton("OK"); withdrawPanel.add(withdrawLabel); withdrawPanel.add(withdrawField); withdrawPanel.add(okButton); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { double v = Double.parseDouble(withdrawField.getText()); scc.withdraw(v); withdrawFrame.dispose(); } }); } }); depositButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame depositFrame = new JFrame("Deposit"); depositFrame.setVisible(true); depositFrame.setSize(800,600); depositFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel depositPanel = new JPanel(); depositFrame.add(depositPanel); JLabel depositLabel = new JLabel("Enter amount"); final JTextField depositField = new JTextField("0",30); JButton okButton = new JButton("OK"); depositPanel.add(depositLabel); depositPanel.add(depositField); depositPanel.add(okButton); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { double v = Double.parseDouble(depositField.getText()); if(v<scc.getAmount()) scc.deposit(v); else JOptionPane.showMessageDialog(null, "Not enough value to deposit"); depositFrame.dispose(); } }); } }); seeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame seeFrame = new JFrame("Amount"); seeFrame.setVisible(true); seeFrame.setSize(800,400); seeFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel seePanel = new JPanel(); JLabel seeLabel = new JLabel(scc.table()); seePanel.add(seeLabel); JButton okButton = new JButton("OK"); seePanel.add(okButton); seeFrame.add(seePanel); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { seeFrame.dispose(); } }); } }); exitSaving.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { info.add(scc); savingFrame.dispose(); } }); } }); } }); currentButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame currentFrame = new JFrame("Current Account"); currentFrame.setSize(800, 600); currentFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); currentFrame.setVisible(true); final JPanel namePanel = new JPanel(); currentFrame.add(namePanel); JLabel currentLabel = new JLabel("Enter your name"); final JTextField currentField = new JTextField("name", 20); JButton currentOkButton = new JButton("OK"); namePanel.add(currentLabel); namePanel.add(currentField); namePanel.add(currentOkButton); currentOkButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { name = currentField.getText(); namePanel.setVisible(false); ID++; final Account ccc = new CurrentAccount(name, ID, 0); JPanel currentPanel = new JPanel(); currentFrame.add(currentPanel); JButton withdrawButton = new JButton("Withdraw"); currentPanel.add(withdrawButton); JButton depositButton = new JButton("Deposit"); currentPanel.add(depositButton); final JButton seeButton = new JButton("See"); currentPanel.add(seeButton); JButton exitCurrent = new JButton("Exit"); currentPanel.add(exitCurrent); withdrawButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame withdrawFrame = new JFrame("Withdraw"); withdrawFrame.setVisible(true); withdrawFrame.setSize(800,600); withdrawFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel withdrawPanel = new JPanel(); withdrawFrame.add(withdrawPanel); JLabel withdrawLabel = new JLabel("Enter amount"); final JTextField withdrawField = new JTextField("0",30); JButton okButton = new JButton("OK"); withdrawPanel.add(withdrawLabel); withdrawPanel.add(withdrawField); withdrawPanel.add(okButton); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { double v = Double.parseDouble(withdrawField.getText()); ccc.withdraw(v); withdrawFrame.dispose(); } }); } }); depositButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame depositFrame = new JFrame("Deposit"); depositFrame.setVisible(true); depositFrame.setSize(800,600); depositFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel depositPanel = new JPanel(); depositFrame.add(depositPanel); JLabel depositLabel = new JLabel("Enter amount"); final JTextField depositField = new JTextField("0",30); JButton okButton = new JButton("OK"); depositPanel.add(depositLabel); depositPanel.add(depositField); depositPanel.add(okButton); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { double v = Double.parseDouble(depositField.getText()); if(v<ccc.getAmount()) ccc.deposit(v); else JOptionPane.showMessageDialog(null, "Not enough value to deposit"); depositFrame.dispose(); } }); } }); seeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame seeFrame = new JFrame("Amount"); seeFrame.setVisible(true); seeFrame.setSize(800,400); seeFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel seePanel = new JPanel(); JLabel seeLabel = new JLabel(ccc.table()); seePanel.add(seeLabel); JButton okButton = new JButton("OK"); seePanel.add(okButton); seeFrame.add(seePanel); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { seeFrame.dispose(); } }); } }); exitCurrent.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { info.add(ccc); currentFrame.dispose(); } }); } }); } }); exitNew.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub newFrame.dispose(); } }); } }); existedButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame existedFrame = new JFrame("Existed Account"); existedFrame.setSize(800, 600); existedFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); existedFrame.setVisible(true); final JPanel idPanel = new JPanel(); existedFrame.add(idPanel); JLabel existedLabel = new JLabel("Enter your ID"); final JTextField existedField = new JTextField("0", 20); JButton existedOkButton = new JButton("OK"); idPanel.add(existedLabel); idPanel.add(existedField); idPanel.add(existedOkButton); existedOkButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int tmpID = Integer.parseInt(existedField.getText()); boolean f=false; for(int i=0; i<info.size(); i++) { if(tmpID == info.get(i).getID()) { index=i; f=true; } } if(f==false) JOptionPane.showMessageDialog(null, "No match found"); else { idPanel.setVisible(false); JPanel existedPanel = new JPanel(); existedFrame.add(existedPanel); JButton withdrawButton = new JButton("Withdraw"); existedPanel.add(withdrawButton); JButton depositButton = new JButton("Deposit"); existedPanel.add(depositButton); final JButton seeButton = new JButton("See"); existedPanel.add(seeButton); JButton exitExisted = new JButton("Exit"); existedPanel.add(exitExisted); withdrawButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame withdrawFrame = new JFrame("Withdraw"); withdrawFrame.setVisible(true); withdrawFrame.setSize(800,600); withdrawFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel withdrawPanel = new JPanel(); withdrawFrame.add(withdrawPanel); JLabel withdrawLabel = new JLabel("Enter amount"); final JTextField withdrawField = new JTextField("0",30); JButton okButton = new JButton("OK"); withdrawPanel.add(withdrawLabel); withdrawPanel.add(withdrawField); withdrawPanel.add(okButton); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { double v = Double.parseDouble(withdrawField.getText()); info.get(index).withdraw(v); withdrawFrame.dispose(); } }); } }); depositButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame depositFrame = new JFrame("Deposit"); depositFrame.setVisible(true); depositFrame.setSize(800,600); depositFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel depositPanel = new JPanel(); depositFrame.add(depositPanel); JLabel depositLabel = new JLabel("Enter amount"); final JTextField depositField = new JTextField("0",30); JButton okButton = new JButton("OK"); depositPanel.add(depositLabel); depositPanel.add(depositField); depositPanel.add(okButton); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { double v = Double.parseDouble(depositField.getText()); if(v<info.get(index).getAmount()) info.get(index).deposit(v); else JOptionPane.showMessageDialog(null, "Not enough value to deposit"); depositFrame.dispose(); } }); } }); seeButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { final JFrame seeFrame = new JFrame("Amount"); seeFrame.setVisible(true); seeFrame.setSize(800,400); seeFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel seePanel = new JPanel(); JLabel seeLabel = new JLabel(info.get(index).table()); seePanel.add(seeLabel); JButton okButton = new JButton("OK"); seePanel.add(okButton); seeFrame.add(seePanel); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { seeFrame.dispose(); } }); } }); exitExisted.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { existedFrame.dispose(); } }); } } }); } }); exitAccount.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { frame.dispose(); try { sal.save(info); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); } }
[ "frduiit@gmail.com" ]
frduiit@gmail.com
67f0460903e7521aacb2be8cca03636b25d998aa
9b5934a0d0a918ceecf441978302b6a03c997bd0
/src/Pharmachy_Management_Final/Madecine_Sells.java
a75df105a997361dea0a1131e3e631b9e144ebbc
[]
no_license
jasminakter01/Pharmacy-System-With-JAva
a3cdb231d15b296aa94fabfbfe31a5f969b217c1
2d6cb02aac63b64f200cb313074ffb1862479970
refs/heads/main
2023-02-03T12:34:53.873108
2020-12-23T09:58:58
2020-12-23T09:58:58
323,865,240
0
0
null
null
null
null
UTF-8
Java
false
false
40,213
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 Pharmachy_Management_Final; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.KeyEvent; import java.awt.print.PageFormat; import java.awt.print.Printable; import java.awt.print.PrinterException; import java.awt.print.PrinterJob; 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.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; /** * * @author jasmi */ public class Madecine_Sells extends javax.swing.JFrame { Connection ct=null; PreparedStatement ps=null; ResultSet rs=null; Statement st=null; int i=0; public Madecine_Sells(String status) { initComponents(); show_madecine(); statusl.setText(status); if(status.equals("Admin")){ } else{ Sample_Button.setVisible(false); Sample_Button1.setVisible(false); Sample_Button2.setVisible(false); Sample_Button3.setVisible(false); Sample_Button4.setVisible(false); jButton4.setVisible(false);} } private Madecine_Sells() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } /** * 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() { jPanel1 = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); jLabel105 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); jButton3 = new javax.swing.JButton(); jPanel6 = new javax.swing.JPanel(); jComboBox1 = new javax.swing.JComboBox<>(); jLabel3 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jTextField4 = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jTextField3 = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); jTextField5 = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); jButton9 = new javax.swing.JButton(); jPanel4 = new javax.swing.JPanel(); dat = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); paid = new javax.swing.JTextField(); total = new javax.swing.JTextField(); deu = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); jLabel16 = new javax.swing.JLabel(); jLabel17 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); total1 = new javax.swing.JLabel(); jButton10 = new javax.swing.JButton(); jPanel5 = new javax.swing.JPanel(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); jButton8 = new javax.swing.JButton(); Sample_Button = new javax.swing.JButton(); Sample_Button1 = new javax.swing.JButton(); Sample_Button2 = new javax.swing.JButton(); sample_Bill_Button1 = new javax.swing.JButton(); Sample_Button3 = new javax.swing.JButton(); Sample_Button4 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); statusl = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setUndecorated(true); getContentPane().setLayout(null); jPanel1.setBackground(new java.awt.Color(204, 0, 0)); jPanel1.setLayout(null); jLabel12.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N jLabel12.setForeground(new java.awt.Color(255, 255, 255)); jLabel12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel12.setText("Sales"); jPanel1.add(jLabel12); jLabel12.setBounds(80, 0, 730, 40); jLabel105.setFont(new java.awt.Font("Tahoma", 1, 48)); // NOI18N jLabel105.setForeground(new java.awt.Color(255, 255, 255)); jLabel105.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel105.setText("-"); jLabel105.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel105MouseClicked(evt); } }); jPanel1.add(jLabel105); jLabel105.setBounds(910, 0, 40, 40); jLabel13.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N jLabel13.setForeground(new java.awt.Color(255, 255, 255)); jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel13.setText("X"); jLabel13.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel13MouseClicked(evt); } }); jPanel1.add(jLabel13); jLabel13.setBounds(950, 0, 50, 40); jButton3.setBackground(new java.awt.Color(204, 0, 51)); jButton3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jButton3.setForeground(new java.awt.Color(255, 255, 255)); jButton3.setText("Medecine info"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel1.add(jButton3); jButton3.setBounds(840, 50, 160, 23); jPanel6.setBackground(new java.awt.Color(153, 0, 51)); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1010, Short.MAX_VALUE) ); jPanel6Layout.setVerticalGroup( jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 10, Short.MAX_VALUE) ); jPanel1.add(jPanel6); jPanel6.setBounds(0, 40, 1010, 10); jComboBox1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jComboBox1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Medicine" })); jComboBox1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboBox1ActionPerformed(evt); } }); jComboBox1.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { jComboBox1KeyPressed(evt); } }); jPanel1.add(jComboBox1); jComboBox1.setBounds(80, 140, 140, 30); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("Medicine"); jPanel1.add(jLabel3); jLabel3.setBounds(80, 120, 80, 20); jTextField2.setEditable(false); jTextField2.setBackground(new java.awt.Color(255, 255, 255)); jTextField2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jPanel1.add(jTextField2); jTextField2.setBounds(240, 140, 120, 30); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Stock Quantity"); jPanel1.add(jLabel1); jLabel1.setBounds(240, 120, 100, 20); jTextField4.setEditable(false); jTextField4.setBackground(new java.awt.Color(255, 255, 255)); jTextField4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jPanel1.add(jTextField4); jTextField4.setBounds(380, 140, 110, 30); jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel4.setForeground(new java.awt.Color(255, 255, 255)); jLabel4.setText("price"); jPanel1.add(jLabel4); jLabel4.setBounds(380, 120, 80, 20); jTextField3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jTextField3.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { jTextField3KeyPressed(evt); } public void keyTyped(java.awt.event.KeyEvent evt) { jTextField3KeyTyped(evt); } }); jPanel1.add(jTextField3); jTextField3.setBounds(80, 200, 210, 30); jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel5.setForeground(new java.awt.Color(255, 255, 255)); jLabel5.setText("Sales Quantity"); jPanel1.add(jLabel5); jLabel5.setBounds(80, 180, 130, 20); jTextField5.setEditable(false); jTextField5.setBackground(new java.awt.Color(255, 255, 255)); jTextField5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jPanel1.add(jTextField5); jTextField5.setBounds(300, 200, 200, 30); jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel6.setForeground(new java.awt.Color(255, 255, 255)); jLabel6.setText("Total Price"); jPanel1.add(jLabel6); jLabel6.setBounds(300, 180, 100, 20); jButton2.setBackground(new java.awt.Color(204, 0, 0)); jButton2.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jButton2.setForeground(new java.awt.Color(255, 255, 255)); jButton2.setText("Clear"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel1.add(jButton2); jButton2.setBounds(760, 220, 110, 40); jButton9.setBackground(new java.awt.Color(204, 0, 0)); jButton9.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N jButton9.setForeground(new java.awt.Color(255, 255, 255)); jButton9.setText("Save"); jButton9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton9ActionPerformed(evt); } }); jPanel1.add(jButton9); jButton9.setBounds(650, 220, 110, 40); jPanel4.setBackground(new java.awt.Color(204, 0, 0)); jPanel4.setLayout(null); dat.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N dat.setForeground(new java.awt.Color(255, 255, 255)); jPanel4.add(dat); dat.setBounds(470, 50, 120, 30); jLabel9.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel9.setForeground(new java.awt.Color(255, 255, 255)); jLabel9.setText("Paid"); jPanel4.add(jLabel9); jLabel9.setBounds(270, 520, 160, 20); jLabel10.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel10.setForeground(new java.awt.Color(255, 255, 255)); jLabel10.setText("Due"); jPanel4.add(jLabel10); jLabel10.setBounds(430, 520, 170, 20); jLabel11.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel11.setForeground(new java.awt.Color(255, 255, 255)); jLabel11.setText("Total Ammount"); jPanel4.add(jLabel11); jLabel11.setBounds(130, 520, 130, 20); paid.setEditable(false); paid.setBackground(new java.awt.Color(255, 255, 255)); paid.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jPanel4.add(paid); paid.setBounds(270, 540, 160, 30); total.setEditable(false); total.setBackground(new java.awt.Color(255, 255, 255)); total.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N total.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { totalActionPerformed(evt); } }); jPanel4.add(total); total.setBounds(130, 540, 140, 30); deu.setEditable(false); deu.setBackground(new java.awt.Color(255, 255, 255)); deu.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jPanel4.add(deu); deu.setBounds(430, 540, 170, 30); jLabel14.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel14.setForeground(new java.awt.Color(255, 255, 255)); jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel14.setText(".................................................................."); jPanel4.add(jLabel14); jLabel14.setBounds(60, 600, 200, 20); jLabel15.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel15.setForeground(new java.awt.Color(255, 255, 255)); jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel15.setText("Client Signature"); jPanel4.add(jLabel15); jLabel15.setBounds(60, 620, 200, 20); jLabel16.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel16.setForeground(new java.awt.Color(255, 255, 255)); jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel16.setText("Authorized Signature"); jPanel4.add(jLabel16); jLabel16.setBounds(400, 620, 200, 20); jLabel17.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N jLabel17.setForeground(new java.awt.Color(255, 255, 255)); jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel17.setText(".................................................................."); jPanel4.add(jLabel17); jLabel17.setBounds(400, 600, 200, 20); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Madicine", "Sales Price", "Quantity", "Total Price" } )); jScrollPane1.setViewportView(jTable1); jPanel4.add(jScrollPane1); jScrollPane1.setBounds(30, 20, 570, 350); total1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N total1.setForeground(new java.awt.Color(255, 255, 255)); total1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT); jPanel4.add(total1); total1.setBounds(370, 370, 230, 40); jPanel1.add(jPanel4); jPanel4.setBounds(50, 270, 630, 430); jButton10.setBackground(new java.awt.Color(204, 0, 0)); jButton10.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N jButton10.setForeground(new java.awt.Color(255, 255, 255)); jButton10.setText("Print"); jButton10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton10ActionPerformed(evt); } }); jPanel1.add(jButton10); jButton10.setBounds(700, 280, 150, 40); getContentPane().add(jPanel1); jPanel1.setBounds(360, 0, 1010, 730); jPanel5.setBackground(new java.awt.Color(153, 0, 0)); jPanel5.setLayout(null); jButton4.setBackground(new java.awt.Color(204, 0, 0)); jButton4.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton4.setForeground(new java.awt.Color(255, 255, 255)); jButton4.setText("Stock"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jPanel5.add(jButton4); jButton4.setBounds(30, 280, 290, 40); jButton5.setBackground(new java.awt.Color(204, 0, 0)); jButton5.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton5.setForeground(new java.awt.Color(255, 255, 255)); jButton5.setText("Home"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jPanel5.add(jButton5); jButton5.setBounds(30, 80, 290, 40); jButton6.setBackground(new java.awt.Color(204, 0, 0)); jButton6.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton6.setForeground(new java.awt.Color(255, 255, 255)); jButton6.setText("Purchase"); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); jPanel5.add(jButton6); jButton6.setBounds(30, 120, 290, 40); jButton7.setBackground(new java.awt.Color(204, 0, 0)); jButton7.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton7.setForeground(new java.awt.Color(255, 255, 255)); jButton7.setText("Sales"); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); jPanel5.add(jButton7); jButton7.setBounds(30, 160, 290, 40); jButton8.setBackground(new java.awt.Color(204, 0, 0)); jButton8.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jButton8.setForeground(new java.awt.Color(255, 255, 255)); jButton8.setText("Madechine Info"); jButton8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton8ActionPerformed(evt); } }); jPanel5.add(jButton8); jButton8.setBounds(30, 200, 290, 40); Sample_Button.setBackground(new java.awt.Color(204, 0, 0)); Sample_Button.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N Sample_Button.setForeground(new java.awt.Color(255, 255, 255)); Sample_Button.setText("Sample Purchase"); Sample_Button.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Sample_ButtonActionPerformed(evt); } }); jPanel5.add(Sample_Button); Sample_Button.setBounds(30, 320, 290, 40); Sample_Button1.setBackground(new java.awt.Color(204, 0, 0)); Sample_Button1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N Sample_Button1.setForeground(new java.awt.Color(255, 255, 255)); Sample_Button1.setText(" Purchase Show"); Sample_Button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Sample_Button1ActionPerformed(evt); } }); jPanel5.add(Sample_Button1); Sample_Button1.setBounds(30, 360, 290, 40); Sample_Button2.setBackground(new java.awt.Color(204, 0, 0)); Sample_Button2.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N Sample_Button2.setForeground(new java.awt.Color(255, 255, 255)); Sample_Button2.setText("Accounts"); Sample_Button2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Sample_Button2ActionPerformed(evt); } }); jPanel5.add(Sample_Button2); Sample_Button2.setBounds(30, 440, 290, 40); sample_Bill_Button1.setBackground(new java.awt.Color(204, 0, 0)); sample_Bill_Button1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N sample_Bill_Button1.setForeground(new java.awt.Color(255, 255, 255)); sample_Bill_Button1.setText(" Bill"); sample_Bill_Button1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { sample_Bill_Button1ActionPerformed(evt); } }); jPanel5.add(sample_Bill_Button1); sample_Bill_Button1.setBounds(30, 240, 290, 40); Sample_Button3.setBackground(new java.awt.Color(204, 0, 0)); Sample_Button3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N Sample_Button3.setForeground(new java.awt.Color(255, 255, 255)); Sample_Button3.setText("Pin"); Sample_Button3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Sample_Button3ActionPerformed(evt); } }); jPanel5.add(Sample_Button3); Sample_Button3.setBounds(30, 480, 290, 40); Sample_Button4.setBackground(new java.awt.Color(204, 0, 0)); Sample_Button4.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N Sample_Button4.setForeground(new java.awt.Color(255, 255, 255)); Sample_Button4.setText("Sales Show"); Sample_Button4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Sample_Button4ActionPerformed(evt); } }); jPanel5.add(Sample_Button4); Sample_Button4.setBounds(30, 400, 290, 40); getContentPane().add(jPanel5); jPanel5.setBounds(0, 80, 370, 650); jPanel3.setBackground(new java.awt.Color(153, 0, 0)); jPanel3.setLayout(null); statusl.setFont(new java.awt.Font("Tahoma", 1, 36)); // NOI18N statusl.setForeground(new java.awt.Color(153, 0, 0)); statusl.setText("User"); jPanel3.add(statusl); statusl.setBounds(0, 0, 140, 40); getContentPane().add(jPanel3); jPanel3.setBounds(0, 0, 370, 80); setSize(new java.awt.Dimension(1368, 724)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed // TODO add your handling code here: show_quantity(); }//GEN-LAST:event_jComboBox1ActionPerformed void shows(){ Date dt = new Date(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); DefaultTableModel dtt=(DefaultTableModel) jTable1.getModel(); contest(); i=Integer.parseInt(jTextField5.getText())+i; dtt.addRow(new Object[]{jComboBox1.getSelectedItem(),jTextField4.getText(),jTextField3.getText(),jTextField5.getText()}); total1.setText(""+i); } private void jTextField3KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField3KeyPressed // TODO add your handling code here: if (evt.getKeyCode() == KeyEvent.VK_ENTER) { if(jTextField4.getText().isEmpty()){ JOptionPane.showMessageDialog(rootPane, "Madecine Price is Empty"); }else if(jTextField3.getText().isEmpty()){ JOptionPane.showMessageDialog(rootPane, "Madecine Quantity is Empty"); }else{ int price=0,quan=0,stock=0; price=Integer.parseInt(jTextField4.getText()); quan=Integer.parseInt(jTextField3.getText()); stock=Integer.parseInt(jTextField2.getText()); if(stock<quan){ JOptionPane.showMessageDialog(rootPane, "Out Of Stock..."); }else{ jTextField5.setText(""+price*quan); } } } }//GEN-LAST:event_jTextField3KeyPressed private void jLabel105MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel105MouseClicked // TODO add your handling code here: this.setState(this.ICONIFIED); }//GEN-LAST:event_jLabel105MouseClicked private void jLabel13MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel13MouseClicked LogingPage l=new LogingPage(); l.setVisible(true); dispose(); }//GEN-LAST:event_jLabel13MouseClicked private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed // TODO add your handling code here: Medicine_Info pr=new Medicine_Info(statusl.getText()); pr.setVisible(true); }//GEN-LAST:event_jButton3ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed // TODO add your handling code here: Madecine_Stock s=new Madecine_Stock(statusl.getText()); s.setVisible(true); dispose(); }//GEN-LAST:event_jButton4ActionPerformed private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed // TODO add your handling code here: Home_PAge hp=new Home_PAge(statusl.getText()); hp.setVisible(true); dispose(); }//GEN-LAST:event_jButton5ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed Madechine_Purchase ms=new Madechine_Purchase(statusl.getText()); ms.setVisible(true); dispose(); }//GEN-LAST:event_jButton6ActionPerformed private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed Madecine_Sells ms=new Madecine_Sells(statusl.getText()); ms.setVisible(true); dispose(); }//GEN-LAST:event_jButton7ActionPerformed private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed // TODO add your handling code here: Medicine_Info mi=new Medicine_Info(statusl.getText()); mi.setVisible(true); dispose(); }//GEN-LAST:event_jButton8ActionPerformed private void jTextField3KeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField3KeyTyped char c = evt.getKeyChar(); if (!(Character.isDigit(c) || c == KeyEvent.VK_BACK_SPACE || c == KeyEvent.VK_DELETE|| c==KeyEvent.VK_SPACE)) { evt.consume(); } }//GEN-LAST:event_jTextField3KeyTyped private void jComboBox1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jComboBox1KeyPressed if (evt.getKeyCode() == KeyEvent.VK_ENTER) { if(jComboBox1.getSelectedIndex()<=0){ JOptionPane.showMessageDialog(rootPane, "Medicine Name Is Empty..."); }else{ jTextField3.requestFocus(); }} }//GEN-LAST:event_jComboBox1KeyPressed private void Sample_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Sample_ButtonActionPerformed Sample_Purchase s=new Sample_Purchase(statusl.getText()); s.setVisible(true); dispose(); }//GEN-LAST:event_Sample_ButtonActionPerformed private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed // TODO add your handling code here: if(jComboBox1.getSelectedIndex()<=0){ JOptionPane.showMessageDialog(rootPane, "Madecine is Empty"); jComboBox1.requestFocus(); } else if(jTextField3.getText().isEmpty()){ JOptionPane.showMessageDialog(rootPane, "Sales Quantity is Empty"); jTextField3.requestFocus(); }else if(jTextField5.getText().isEmpty()){ JOptionPane.showMessageDialog(rootPane, "T^otal Price is Empty"); jTextField5.requestFocus(); }else{ try { contest(); Date dt = new Date(); DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); int stockq=Integer.parseInt(jTextField2.getText()); int sellq=Integer.parseInt(jTextField3.getText()); if(stockq<sellq){ JOptionPane.showMessageDialog(rootPane," "+(sellq-stockq)+ " Medicines are out of stock..."); }else{ String s="INSERT INTO `pharmacy_management`.`sells`(`madecine`,`s_price`,`quantity`,`total price`,`date`) VALUES (?,?,?,?,?);"; ps=ct.prepareCall(s); ps.setString(1,jComboBox1.getSelectedItem().toString()); ps.setString(2,jTextField4.getText()); ps.setString(3,jTextField3.getText()); ps.setString(4,jTextField5.getText()); ps.setString(5,df.format(dt)); int m=ps.executeUpdate(); if(m>0){ shows(); jTextField2.setText(""); jTextField3.setText(""); jTextField4.setText(""); jTextField5.setText(""); jComboBox1.setSelectedIndex(0); jComboBox1.requestFocus(); }else{ JOptionPane.showMessageDialog(rootPane, "Madecine Sales Failed....."); } } } catch (SQLException ex) { Logger.getLogger(Medicine_Info.class.getName()).log(Level.SEVERE, null, ex); } } }//GEN-LAST:event_jButton9ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed jTextField2.setText(""); jTextField3.setText(""); jTextField4.setText(""); jTextField5.setText(""); jComboBox1.setSelectedIndex(0); DefaultTableModel dt=(DefaultTableModel) jTable1.getModel(); dt.setRowCount(0); total1.setText(""); }//GEN-LAST:event_jButton2ActionPerformed private void Sample_Button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Sample_Button1ActionPerformed Purchase_Show ps=new Purchase_Show(statusl.getText()); ps.setVisible(true); dispose(); }//GEN-LAST:event_Sample_Button1ActionPerformed private void Sample_Button2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Sample_Button2ActionPerformed Accounts ps=new Accounts(statusl.getText()); ps.setVisible(true); dispose(); }//GEN-LAST:event_Sample_Button2ActionPerformed private void sample_Bill_Button1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sample_Bill_Button1ActionPerformed Home_PAge h=new Home_PAge(statusl.getText()); h.setVisible(true); Bill_Paid_1 hp=new Bill_Paid_1(statusl.getText()); hp.setVisible(true); dispose(); }//GEN-LAST:event_sample_Bill_Button1ActionPerformed private void Sample_Button3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Sample_Button3ActionPerformed Create_Login_Pin ps=new Create_Login_Pin(); ps.setVisible(true); }//GEN-LAST:event_Sample_Button3ActionPerformed private void Sample_Button4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Sample_Button4ActionPerformed Sells_Show ps=new Sells_Show(statusl.getText()); ps.setVisible(true); dispose(); }//GEN-LAST:event_Sample_Button4ActionPerformed private void totalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_totalActionPerformed // TODO add your handling code here: }//GEN-LAST:event_totalActionPerformed private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed PrinterJob job=PrinterJob.getPrinterJob(); job.setJobName("Print Data"); job.setPrintable(new Printable() { @Override public int print(Graphics pg, PageFormat pf, int PageNum){ //To change body of generated methods, choose Tools | Templates. if(PageNum>0){ return NO_SUCH_PAGE;} Graphics2D g2=(Graphics2D) pg; g2.translate(pf.getImageableX(),pf.getImageableX()); g2.scale(1,0.8); jPanel4.print(g2); return Printable.PAGE_EXISTS; } }); if(job.printDialog()==true){ JOptionPane.showMessageDialog(this,"Print success.."); try{ job.print(); }catch(PrinterException P){ } dispose(); }else{JOptionPane.showMessageDialog(this,"Failed...");} }//GEN-LAST:event_jButton10ActionPerformed public void contest() { try { ct = DriverManager.getConnection("jdbc:mysql://localhost:3306/pharmacy_management", "root", ""); } catch (SQLException ex) { Logger.getLogger(Add_Supplier.class.getName()).log(Level.SEVERE, null, ex); } } void show_madecine(){ try { contest(); String s="SELECT `stock`.`Madicine_Name` FROM `stock`"; st = ct.prepareCall(s); rs = st.executeQuery(s); while(rs.next()){ jComboBox1.addItem(rs.getString(1)); } } catch (SQLException ex) { Logger.getLogger(Madecine_Sells.class.getName()).log(Level.SEVERE, null, ex); } } void show_quantity(){ try { contest(); String s="SELECT *FROM `stock` WHERE `Madicine_Name`='"+jComboBox1.getSelectedItem()+"'"; st = ct.prepareCall(s); rs = st.executeQuery(s); while(rs.next()){ int p=rs.getInt(2); int se=rs.getInt(3); int t=p-se; jTextField2.setText(""+t); } String mp="SELECT `s_price` FROM `purchase` WHERE `medecine`='"+jComboBox1.getSelectedItem()+"'"; st = ct.prepareCall(mp); rs = st.executeQuery(mp); while(rs.next()){ jTextField4.setText(""+rs.getInt(1)); } } catch (SQLException ex) { Logger.getLogger(Madecine_Sells.class.getName()).log(Level.SEVERE, null, ex); } } 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(Madecine_Sells.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Madecine_Sells.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Madecine_Sells.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Madecine_Sells.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Madecine_Sells().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton Sample_Button; private javax.swing.JButton Sample_Button1; private javax.swing.JButton Sample_Button2; private javax.swing.JButton Sample_Button3; private javax.swing.JButton Sample_Button4; private javax.swing.JLabel dat; private javax.swing.JTextField deu; private javax.swing.JButton jButton10; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JButton jButton8; private javax.swing.JButton jButton9; private javax.swing.JComboBox<String> jComboBox1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel105; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JTextField paid; private javax.swing.JButton sample_Bill_Button1; private javax.swing.JLabel statusl; private javax.swing.JTextField total; private javax.swing.JLabel total1; // End of variables declaration//GEN-END:variables }
[ "jasmin.akter283997@gmail.com" ]
jasmin.akter283997@gmail.com
aa648b06bdbb12cf150393aea03e80a36a5ef9e5
93c3c9287ee3bf1f3bbf68f3f7b6da080ece08fb
/_3_design_patterns/src/main/java/code/_4_student_effort/IteratorCurs/ArrayCustomIterator.java
33929d69665aceaa3888d878e310d12ee521abe5
[]
no_license
Claudiaursu/java-training
5ec764c1eba5d107ff016bd7ebc58e47f64a52d4
e15d7cceee2ac30a9427b2b545c074f51f5db599
refs/heads/master
2022-12-03T21:15:51.719134
2020-07-18T21:45:17
2020-07-18T21:45:17
255,379,295
0
0
null
2020-04-13T16:19:40
2020-04-13T16:19:39
null
UTF-8
Java
false
false
144
java
package code._4_student_effort.IteratorCurs; public interface ArrayCustomIterator { public boolean hasNext(); public Integer next(); }
[ "ursu.claudia99@yahoo.com" ]
ursu.claudia99@yahoo.com
7d9920b52c407b934cb1a5f0662b76cdf3a91ab3
8b20b238625885f3389b3d0f407d1390df2ba53a
/domain/src/main/java/com/innsmap/domain/bean/NeedBase.java
f1b20dcf42f21a378965c4daa1575791429555a7
[]
no_license
yongningyang/robot
44c9b9fa6992b3943655c9bac42eb96cab9dbbfd
013abae2ca4c0382595e02afb7307176d3f25d72
refs/heads/master
2020-04-09T07:47:31.462840
2018-12-03T10:36:17
2018-12-03T10:36:17
160,170,480
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
package com.innsmap.domain.bean; public class NeedBase<T> { private boolean succeed; private String errerMsg; private T data; public boolean isSucceed() { return succeed; } public void setSucceed(boolean succeed) { this.succeed = succeed; } public String getErrerMsg() { return errerMsg; } public void setErrerMsg(String errerMsg) { this.errerMsg = errerMsg; } public T getData() { return data; } public void setData(T data) { this.data = data; } }
[ "yongningyang@gmail.com" ]
yongningyang@gmail.com
c209d95e298b25876f2657b8cc73a490aded618f
75faa9a48774b05f91c1eae1ced56e1073d473f4
/src/main/java/com/web/spring/study/aop2/Singer.java
4a05dd119409760dcc0fbd93cd74e294846e12f2
[]
no_license
mrlin0518/Spring_0117
2df95c38f38b7566e2dbc9d417215749439f0cca
9c61b7b6733aed5aae2fb6c0ffb6567bee7bc8c6
refs/heads/master
2022-12-22T21:49:09.095554
2020-01-31T13:49:07
2020-01-31T13:49:07
237,428,372
0
0
null
2022-12-16T10:02:23
2020-01-31T12:46:21
Java
UTF-8
Java
false
false
671
java
package com.web.spring.study.aop2; import java.util.Random; import org.springframework.stereotype.Component; @Component public class Singer implements Actor{ @Override public void show() { try { System.out.println("唱歌"); Thread.sleep(1000); System.out.println("唱歌"); Thread.sleep(1000); System.out.println("唱歌"); } catch (Exception e) { } int score = new Random().nextInt(100); System.out.println("score: " + score); if (score < 60) { throw new RuntimeException("走音了..."); } } }
[ "student@192.168.1.77" ]
student@192.168.1.77
1531547148c6d2c681c5bb723346adb9d64a1fb7
05854bef8cc3153c4f643d5938272bfccebb6a8c
/src/test/java/com/zc/leetcode/DecodeWaysTest.java
01b400bc24e09442ccf8c21147c67c5231aa1531
[]
no_license
kuaile-zc/hello
c402cb86fc0ce71e775c61bdc926c83c1d0f23ba
c354fcd76eda1704668489893eea7c60056abcdd
refs/heads/master
2022-06-21T09:31:51.209426
2022-05-19T09:52:56
2022-05-19T09:52:56
173,756,706
0
0
null
2022-05-19T09:52:56
2019-03-04T14:08:33
Java
UTF-8
Java
false
false
603
java
package com.zc.leetcode; import org.junit.Assert; import org.junit.Test; /** * @Author CoreyChen Zhang * @Date: 2021/04/22/ 10:58 */ public class DecodeWaysTest { private DecodeWays decodeWays = new DecodeWays(); @Test public void case1(){ int i1 = decodeWays.numDecodings("12"); int i2 = decodeWays.numDecodings("226"); int i3 = decodeWays.numDecodings("0"); int i4 = decodeWays.numDecodings("06"); Assert.assertEquals(i1, 2); Assert.assertEquals(i2, 3); Assert.assertEquals(i3, 0); Assert.assertEquals(i4, 0); } }
[ "784554215@qq.com" ]
784554215@qq.com
43a7eed7d3fd0c16850bc583a75a78a4b92ef8b3
c0ac74acf3cbc0250faebf2a4d2a0f420887d441
/yshop-system/src/main/java/co/yixiang/modules/netty/DataUtil.java
db9f3ef86eec575c8f9b5e80d213439699d5e593
[ "Apache-2.0" ]
permissive
yuqijun/mall
84e270f91f776b8c8d8ab35b15369fa5d88176d3
8eafb139a48620170baa32e9351f9ad0ea08c5d9
refs/heads/master
2022-12-18T18:15:40.176783
2020-09-27T01:37:11
2020-09-27T01:37:11
298,927,593
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
//package co.yixiang.modules.netty; // //import java.text.SimpleDateFormat; //import java.util.Date; // //public class DataUtil { // public static String getNow(){ // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // String currentDate = sdf.format(new Date()); // return currentDate; // } // // public static void main(String [] args){ // System.err.println("获取当前时间戳=="+getNow()); // } //}
[ "yuqijun@nihaosi.com" ]
yuqijun@nihaosi.com
3a178d884d9addd10a2d82fa2fd96d222af52764
0f6195739da6168134150f71691f5f2e84fc31d7
/src/com/tryingpfq/singleton/Test.java
3e329bead6b4c539bfb33b8c94fb582081dbe475
[]
no_license
tryingpfq/DesignPattern
8b7047dbba29f0f4141c060985041d1b422fdaa3
2e286a2b0d94bb4c6d7970e54ff933c9b5580eb1
refs/heads/master
2021-01-23T02:06:30.137187
2018-11-11T07:37:14
2018-11-11T07:37:14
85,967,593
0
1
null
2018-03-12T13:46:29
2017-03-23T15:43:48
Java
UTF-8
Java
false
false
263
java
package com.tryingpfq.singleton; public class Test { public static void main(String[] args) { Emperor emperor=Emperor.getInstance(); emperor.emperorInfo(); Emperor.emperorInfo(); Emperor emperor1=Emperor.getInstance(); emperor.emperorInfo(); } }
[ "trying@163.com" ]
trying@163.com
bd3641d90a5e218db2e29f7b1db39c4cad89bbd7
2d801bd5626c41e360b582c0d3de9171a87921ae
/Server/src/org/osrspvp/model/Graphic.java
c737affd883c09934b799b6ebfb4cc8909fcdfe9
[]
no_license
puniksuke/Project-Dragon
56d6d4deb5ce3a26c61d6cd34ce67527affc1f8d
1ad8f0cc2718e81ba4df1f61239337a23babab82
refs/heads/master
2021-01-10T04:44:24.915389
2016-02-18T18:58:17
2016-02-18T18:58:17
52,028,767
0
1
null
null
null
null
UTF-8
Java
false
false
1,595
java
package org.osrspvp.model; public class Graphic { /** * Creates an graphic with no delay. * * @param id The id. * @return The new graphic object. */ public static Graphic create(int id) { return create(id, 0); } /** * Creates a graphic. * * @param id The id. * @param delay The delay. * @return The new graphic object. */ public static Graphic create(int id, int delay) { return create(id, delay, 0); } /** * Creates a graphic. * * @param id The id. * @param delay The delay. * @param height The height. * @return The new graphic object. */ public static Graphic create(int id, int delay, int height) { return new Graphic(id, delay, height); } /** * The id. */ private int id; /** * The delay. */ private int delay; /** * The height. */ private int height; /** * Creates a graphic. * * @param id The id. * @param delay The delay. */ private Graphic(int id, int delay, int height) { this.id = id; this.delay = delay; this.height = height; } /** * Gets the id. * * @return The id. */ public int getId() { return id; } /** * Gets the delay. * * @return The delay. */ public int getDelay() { return delay; } /** * Gets the height. * * @return The height. */ public int getHeight() { return height; } }
[ "puniksuke2@gmail.com" ]
puniksuke2@gmail.com
8371dc208c0607ab0debdd119b3ea984f9831628
aeb439f4431caf7189e9dc481e1b0f056b7f2fe1
/src/main/java/com/first/myapplicationtry/ListOfOffer_page.java
c6e17d033bf5bc4b6b421cbd854187a163e54498
[]
no_license
talfassy/Shelika-app
7e975a0bbf767fc7ac54faccf74b4234ed0ec9b1
b6c9f4dea0f330096a65e640ff521308d73ad18e
refs/heads/master
2022-04-24T09:55:44.297842
2020-04-26T19:31:56
2020-04-26T19:31:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,121
java
package com.first.myapplicationtry; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Bundle; import android.view.View; import com.firebase.ui.firestore.FirestoreRecyclerOptions; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.firebase.firestore.CollectionReference; import com.google.firebase.firestore.FirebaseFirestore; import com.google.firebase.firestore.Query; public class ListOfOffer_page extends AppCompatActivity { private FirebaseFirestore db = FirebaseFirestore.getInstance(); private CollectionReference notebookRef = db.collection("Notebook"); private Note_adapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_list_of_offer_page); FloatingActionButton floatingActionButton= findViewById(R.id.button_add_note); floatingActionButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(ListOfOffer_page.this , new_Note_Activity.class)); } }); setUpRecycleView(); } private void setUpRecycleView() { Query query =notebookRef.orderBy("date", Query.Direction.DESCENDING); FirestoreRecyclerOptions<Note> options = new FirestoreRecyclerOptions.Builder<Note>().setQuery(query, Note.class).build(); adapter = new Note_adapter(options); RecyclerView recyclerView = findViewById(R.id.recycle_view); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setAdapter(adapter); } @Override protected void onStart() { super.onStart(); adapter.startListening(); } @Override protected void onStop() { super.onStop(); adapter.stopListening(); } }
[ "talfassy23@gmail.com" ]
talfassy23@gmail.com
3f26cea8fc39c874afcd4e4919fe70c44c8dce88
7a2c91813117a8d949571521510895ee53daad49
/src/main/java/com/alipay/api/response/AlipayEbppIndustryOrderCreateResponse.java
636465ee3c41118a4759df7f8d34cbc977fa0f95
[ "Apache-2.0" ]
permissive
dut3062796s/alipay-sdk-java-all
eb5afb5b570fb0deb40d8c960b85a01d13506568
559180f4c370f7fcfef67a1c559768d11475c745
refs/heads/master
2020-07-03T21:00:06.124387
2019-06-23T01:13:43
2019-06-23T01:13:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,236
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.ebpp.industry.order.create response. * * @author auto create * @since 1.0, 2019-01-07 20:51:15 */ public class AlipayEbppIndustryOrderCreateResponse extends AlipayResponse { private static final long serialVersionUID = 5317912841684819385L; /** * 扩展属性,json串(key-value对) */ @ApiField("extend_field") private String extendField; /** * 支付宝的业务订单号,具有唯一性。 */ @ApiField("order_no") private String orderNo; /** * 输出机构的业务流水号,需要保证唯一性。 */ @ApiField("out_order_no") private String outOrderNo; public void setExtendField(String extendField) { this.extendField = extendField; } public String getExtendField( ) { return this.extendField; } public void setOrderNo(String orderNo) { this.orderNo = orderNo; } public String getOrderNo( ) { return this.orderNo; } public void setOutOrderNo(String outOrderNo) { this.outOrderNo = outOrderNo; } public String getOutOrderNo( ) { return this.outOrderNo; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
50b88eeb005f6d7cee8926328ba418792bf7f266
7223ec8b25d975aabfdd3f053fe71eead48b9563
/src/pm/entitymanager/logic/EntityRenameFailedException.java
012a452db2499126377da238e4bdc91be943f0ff
[]
no_license
vanizadmin/pmEntitiesLib
6f700ef701cd16b6371d7ebe7d8140b6e8af6734
cd8850fa4fa0bf5d0ba553b0afe8d067c2bd65a1
refs/heads/master
2021-01-10T21:11:34.976056
2014-06-12T00:02:04
2014-06-12T00:02:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
683
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 pm.entitymanager.logic; /** * * @author ToNio */ public class EntityRenameFailedException extends Exception { private EntityInterface entity; private String reason; public EntityRenameFailedException( EntityInterface entity, String reason) { } public EntityInterface getEntity() { return this.entity; } public String getReason() { return this.reason; } }
[ "PC01$@pc01.ser.theweb.gr" ]
PC01$@pc01.ser.theweb.gr
a81de047507bbc77166e5753fd4156bccdd57e64
6431fff08daae6ab179f356a26702cdbdd473237
/app/src/main/java/com/beini/ui/fragment/bluetooth/ble/SmartBLEService.java
4d95d5d3bd217b78052cb10429d159439404e4aa
[]
no_license
hwhVm/FunBox
0d7d0c908705a5b1dd87f1450ae0661c85cfa727
5d46b769525ca5eb66252d31d891ac2872039030
refs/heads/master
2021-09-06T20:27:58.358071
2018-02-11T06:12:59
2018-02-11T06:12:59
81,513,200
1
1
null
null
null
null
UTF-8
Java
false
false
14,807
java
package com.beini.ui.fragment.bluetooth.ble; import android.app.Service; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.bluetooth.BluetoothGattCallback; import android.bluetooth.BluetoothGattCharacteristic; import android.bluetooth.BluetoothGattDescriptor; import android.bluetooth.BluetoothGattService; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.content.Intent; import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import com.beini.util.BLog; import java.util.Arrays; import java.util.List; import java.util.UUID; public class SmartBLEService extends Service { private BluetoothManager mBluetoothManager; private BluetoothAdapter mBluetoothAdapter; private BluetoothGatt mBluetoothGatt; private String mBluetoothDeviceAddress; private BluetoothGattCharacteristic mCharWrite; private BluetoothGattCharacteristic mCharRead; private int mConnectionState = STATE_DISCONNECTED; public int getConnectionState() { return mConnectionState; } public static final int STATE_DISCONNECTED = 0; public static final int STATE_CONNECTING = 1; public static final int STATE_CONNECTED = 2; public class LocalBinder extends Binder { public SmartBLEService getService() { return SmartBLEService.this; } } @Override public IBinder onBind(Intent intent) { return mBinder; } @Override public boolean onUnbind(Intent intent) { close(); return super.onUnbind(intent); } private final IBinder mBinder = new LocalBinder(); @Override public void onCreate() { initialize(); } /** * 蓝牙回调函数 */ private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { if (newState == BluetoothProfile.STATE_CONNECTED) { if (status == BluetoothGatt.GATT_SUCCESS) { BLog.d("Connected to GATT server."); mConnectionState = STATE_CONNECTED; broadcastUpdate(Global.ACTION_GATT_CONNECTED); // Attempts to discover services after successful connection. if (mBluetoothGatt != null) { BLog.d("Attempting to start service discovery:" + mBluetoothGatt.discoverServices()); } } else { mConnectionState = STATE_DISCONNECTED; disconnect(); broadcastUpdate(Global.ACTION_GATT_CONNECTED_FAIL); close(); } } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { BLog.d("Disconnected from GATT server."); mConnectionState = STATE_DISCONNECTED; mBluetoothDeviceAddress = null; broadcastUpdate(Global.ACTION_GATT_DISCONNECTED); close(); } } @Override public void onServicesDiscovered(BluetoothGatt gatt, int status) { BLog.d("onServicesDiscovered received: " + status); if (status == BluetoothGatt.GATT_SUCCESS) { broadcastUpdate(Global.ACTION_GATT_SERVICES_DISCOVERED); } else { BLog.d("onServicesDiscovered received: " + status); broadcastUpdate(Global.ACTION_GATT_SERVICES_DISCOVER_FAIL); } } @Override public void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { UUID uuid = characteristic.getUuid(); BLog.d(" onCharacteristicRead ------------------>uuid==" + uuid); // if (uuid.equals(Global.UUID_CHARACTERISTIC_BIND_DEVICE)) { // // if (status == BluetoothGatt.GATT_SUCCESS) { // broadcastUpdate(ACTION_READ_CHARACTERISTIC_BIND_SUCCESS, KEY_BOUND_STATE, characteristic.getValue()); // // } else { // broadcastUpdate(ACTION_READ_CHARACTERISTIC_BIND_FAIL); // } // } } @Override public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { UUID uuid = characteristic.getUuid(); BLog.d(" onCharacteristicWrite ------------------>uuid==" + uuid); // if (uuid.equals(Global.UUID_CHARACTERISTIC_COMMUNICATION)) { // // if (status == BluetoothGatt.GATT_SUCCESS) { // broadcastUpdate(ACTION_WRITE_CHARACTERISTIC_SUCCESS); // // } else { // broadcastUpdate(ACTION_WRITE_CHARACTERISTIC_FAIL); // } // // } else if (uuid.equals(Global.UUID_CHARACTERISTIC_BIND_DEVICE)) { // if (status == BluetoothGatt.GATT_SUCCESS) { // broadcastUpdate(ACTION_WRITE_CHARACTERISTIC_BIND_SUCCESS); // // } else { // broadcastUpdate(ACTION_WRITE_CHARACTERISTIC_BIND_FAIL); // } // } } @Override public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { BLog.d("返回数据" + Arrays.toString(characteristic.getValue())); SppDecodeHolder.decodeData(characteristic.getValue(), characteristic.getValue().length); broadcastUpdate(Global.ACTION_DATA_AVAILABLE, Global.KEY_HISTORY_HOUR_DATA, characteristic.getValue()); // } } @Override public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { BLog.d(" onDescriptorWrite status =" + status); if (status == BluetoothGatt.GATT_SUCCESS) { broadcastUpdate(Global.ACTION_WRITE_DESCRIPTOR_SUCCESS); } else { broadcastUpdate(Global.ACTION_WRITE_DESCRIPTOR_FAIL); } } @Override public void onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status) { BLog.d("rssi value: " + rssi); } }; /** * 发送广播 * * @param action */ private void broadcastUpdate(final String action) { final Intent intent = new Intent(action); sendBroadcast(intent); } private void broadcastUpdate(String action, String key, byte[] value) { Intent intent = new Intent(action); intent.putExtra(key, value); sendBroadcast(intent); } /** * Initializes a reference to the local Bluetooth adapter. * * @return Return true if the initialization is successful. */ public boolean initialize() { if (mBluetoothManager == null) { mBluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE); if (mBluetoothManager == null) { BLog.d("Unable to initialize BluetoothManager."); return false; } } mBluetoothAdapter = mBluetoothManager.getAdapter(); if (mBluetoothAdapter == null) { BLog.d("Unable to obtain a BluetoothAdapter."); return false; } return true; } /** * Connects to the GATT server hosted on the Bluetooth LE device. * * @param address The device address of the destination device. * @return Return true if the connection is initiated successfully. The * connection result is reported asynchronously through the * {@code BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)} * callback. */ public boolean connect(final String address, boolean is) { if (mBluetoothAdapter == null || address == null) { BLog.d("BluetoothAdapter not initialized or unspecified address."); return false; } final BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address); if (device == null) { BLog.d("Device not found. Unable to connect."); return false; } mBluetoothGatt = device.connectGatt(this, false, mGattCallback); BLog.d("Trying to create a new connection."); mBluetoothDeviceAddress = address; mConnectionState = STATE_CONNECTING; return true; } /** * Disconnects an existing connection or cancel a pending connection. The * disconnection result is reported asynchronously through the * {@code BluetoothGattCallback#onConnectionStateChange(android.bluetooth.BluetoothGatt, int, int)} * callback. */ public void disconnect() { if (mBluetoothAdapter == null || mBluetoothGatt == null) { BLog.d("BluetoothAdapter not initialized"); return; } mBluetoothGatt.disconnect(); } /** * After using a given BLE device, the app must call this method to ensure * resources are released properly. */ public void close() { if (mBluetoothGatt == null) { return; } mBluetoothGatt.close(); mBluetoothGatt = null; } /** * 写特征值 * * @param characteristic */ public void wirteCharacteristic(BluetoothGattCharacteristic characteristic) { if (mBluetoothAdapter == null || mBluetoothGatt == null) { BLog.d("BluetoothAdapter not initialized"); return; } mBluetoothGatt.writeCharacteristic(characteristic); } public void writeCharacteristic(byte[] value) { BLog.d(" writeCharacteristic begin "); List<BluetoothGattService> supportedGattServices = mBluetoothGatt.getServices(); if (mBluetoothGatt.getServices() == null) { return; } for (int i = 0; i < supportedGattServices.size(); i++) { BLog.d("1:BluetoothGattService UUID=:" + supportedGattServices.get(i).getUuid()); List<BluetoothGattCharacteristic> listGattCharacteristic = supportedGattServices.get(i).getCharacteristics(); for (int j = 0; j < listGattCharacteristic.size(); j++) { int charaProp = listGattCharacteristic.get(i).getProperties(); BLog.d("2: BluetoothGattCharacteristic UUID=:" + listGattCharacteristic.get(j).getUuid() + "Prop " + charaProp); } } for (int i = 0; i < supportedGattServices.size(); i++) { List<BluetoothGattCharacteristic> listGattCharacteristic = supportedGattServices.get(i).getCharacteristics(); for (int j = 0; j < listGattCharacteristic.size(); j++) { int charaProp = listGattCharacteristic.get(i).getProperties(); UUID uuid = listGattCharacteristic.get(j).getUuid(); uuid.toString(); BLog.d("gattCharacteristic的UUID为:" + listGattCharacteristic.get(j).getUuid() + " charaProp " + charaProp); if ((charaProp == (BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE | BluetoothGattCharacteristic.PROPERTY_NOTIFY) && //只有这个UUID可用 uuid.equals(UUID.fromString("49535343-1e4d-4bd9-ba61-23c647249616")))) { BLog.d("gattCharacteristic的属性为: 可写通知 uuid " + uuid); mCharWrite = listGattCharacteristic.get(j); mCharRead = listGattCharacteristic.get(j); { mBluetoothGatt.setCharacteristicNotification(mCharRead, true); //将指令放置进来 mCharRead.setValue(value); //设置回复形式 mCharRead.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE); //开始写数据 mBluetoothGatt.writeCharacteristic(mCharRead); } break; } else if ((charaProp == BluetoothGattCharacteristic.PROPERTY_READ)) { BLog.d("gattCharacteristic的属性为: 可读通知"); // readUUID = supportedGattServices.get(i).getUuid(); // mCharRead = listGattCharacteristic.get(i); // connectFlag = 1; break; } } } } /** * 扫描设备 * * @param start */ public void scan(boolean start) { if (mBluetoothAdapter != null) { if (start) { mBluetoothAdapter.startLeScan(mLeScanCallback); } else { mBluetoothAdapter.stopLeScan(mLeScanCallback); } } else { BLog.d("bluetoothadapter is null"); } } /** * 扫描设备的回调方法 */ private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) { Bundle mBundle = new Bundle(); mBundle.putParcelable(BluetoothDevice.EXTRA_DEVICE, device); mBundle.putInt(BluetoothDevice.EXTRA_RSSI, rssi); if (device.getName() == null) { return; } BLog.d(" device.getName()=" + device.getName() + " device.getAddress()=" + device.getAddress()); Intent intent = new Intent(); intent.setAction(Global.ACTION_DEVICE_FOUND); intent.putExtras(mBundle); sendBroadcast(intent); } }; // get set public String getDeviceAddress() { return mBluetoothDeviceAddress; } /** * Retrieves a list of supported GATT services on the connected device. This * should be invoked only after {@code BluetoothGatt#discoverServices()} * completes successfully. * * @return A {@code List} of supported services. */ public List<BluetoothGattService> getSupportedGattServices() { if (mBluetoothGatt == null) return null; return mBluetoothGatt.getServices(); } /** * Read the RSSI for a connected remote device. */ public boolean getRssiVal() { if (mBluetoothGatt == null) return false; return mBluetoothGatt.readRemoteRssi(); } }
[ "874140704@qq.com" ]
874140704@qq.com
06d394c8c01701b4c588360b49099b4545887324
25c09df8a5ab7174905c3cf3e993c324b99ec90e
/06other/springSecurityDemo/springsecurity-app/src/main/java/com/ylt/springsecurityapp/validate/code/impl/RedisValidateCodeRepository.java
4331d29755192a28fb2b42e02c3a747cba87de47
[]
no_license
yuliantao/skillgather
884ef5aea0ad5cb613f4b75ef2c6a569dc4c00ea
9a284cde017dac36d6fce9dd7e933a289fd98483
refs/heads/master
2020-04-04T20:24:41.264551
2019-01-09T15:26:24
2019-01-09T15:26:24
156,245,437
0
0
null
null
null
null
UTF-8
Java
false
false
2,080
java
package com.ylt.springsecurityapp.validate.code.impl; import com.ylt.springsecuritycore.validate.code.ValidateCode; import com.ylt.springsecuritycore.validate.code.ValidateCodeException; import com.ylt.springsecuritycore.validate.code.ValidateCodeRepository; import com.ylt.springsecuritycore.validate.code.ValidateCodeType; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; import org.springframework.web.context.request.ServletWebRequest; import java.util.concurrent.TimeUnit; /** * @author yuliantao * @create 2018-12-21 21:34 * @description 功能描述 */ @Component public class RedisValidateCodeRepository implements ValidateCodeRepository { Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private RedisTemplate<Object,Object> redisTemplate; private String buildkey(ServletWebRequest request,ValidateCodeType type) { String deviceId = request.getHeader("deviceId"); if (StringUtils.isBlank(deviceId)) { logger.info("请在请求头中携带deviceId参数"); throw new ValidateCodeException("请在请求头中携带deviceId参数"); } return "code:" + type.toString().toLowerCase() + ":" + deviceId; } @Override public void save(ServletWebRequest request, ValidateCode code, ValidateCodeType type) { redisTemplate.opsForValue().set(buildkey(request,type),code,30, TimeUnit.MINUTES); } @Override public ValidateCode get(ServletWebRequest request, ValidateCodeType type) { Object value=redisTemplate.opsForValue().get(buildkey(request,type)); if (value==null) { return null; } return (ValidateCode) value; } @Override public void remove(ServletWebRequest request, ValidateCodeType type) { redisTemplate.delete(buildkey(request,type)); } }
[ "464399631@qq.com" ]
464399631@qq.com
9378f2df39d4b606588b3117cdaa610e6b84faca
6df832a3cfceb3ec4a65dabf51e3c8ad616cc92a
/app/src/androidTest/java/com/muhameddhouibi/geo/ExampleInstrumentedTest.java
bbd676b749e401f88d1ac679b9ddfcf8a0dba562
[]
no_license
mohameddhouibi/GeolocalisationArcGis
1dcf7c991f00a5e0307bc52f3a40c036091d4d6d
43203f7f2c3714bb036740c6f2916e0269db501d
refs/heads/master
2022-07-13T06:48:34.104841
2020-05-13T15:45:44
2020-05-13T15:45:44
261,607,949
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package com.muhameddhouibi.geo; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.muhameddhouibi.geo", appContext.getPackageName()); } }
[ "mohamed.dhouibi@esprit.tn" ]
mohamed.dhouibi@esprit.tn
4a0a6fec27395da90c129b0b035871d4d4ea2f29
cbb6aef12034b8fa8042c4d29aa58f310bbcafd7
/src/test/Main.java
3ffb44e0d9e164d16d1112f2c35b349f71049210
[]
no_license
Anytka555/Build_Hamburger
175de447de8b23f3155b80048cd8e3caa37cebd6
fb79fb6a62a213839e4c6e342b9f4a0063d115c6
refs/heads/master
2023-09-03T22:25:30.751376
2021-11-03T14:21:38
2021-11-03T14:21:38
424,250,940
0
0
null
null
null
null
UTF-8
Java
false
false
2,062
java
package test; import main.Hamburger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int chooseBurger, i; boolean mainSelection, hasNextInt, UI = true; Hamburger hamburger = new Hamburger(); while (UI) { System.out.println(" 1. Regular Hamburger"); System.out.println(" -> Press 1 to view Menu"); System.out.println(" -> Press 0 to exit"); mainSelection = scanner.hasNextInt(); if (mainSelection) { chooseBurger = scanner.nextInt(); switch (chooseBurger) { case 1: { hamburger.displayMenu(); System.out.println("\n Press 1 to Order a Regular Hamburger and select additional ingredients"); System.out.println(" Press 0 to back to main menu."); hasNextInt = scanner.hasNextInt(); if (hasNextInt) { i = scanner.nextInt(); if (i == 1) { hamburger.addons(); System.out.println("Want to Order more? (Press 1)"); hasNextInt = scanner.hasNextInt(); if (hasNextInt) { i = scanner.nextInt(); if (i != 1) UI = false; } } else continue; } else continue; break; } case 2: { UI = false; break; } } } } System.out.println("Thanks for visiting our store! \n"); } }
[ "LL565340@gmail.com" ]
LL565340@gmail.com
618dd19b8ed403506b907b85bf954c17bbdbeaa9
097ace5415b54571f16a368c351ce14bf468f873
/src/main/java/com/king/mideng/ApiIdempotentInterceptor.java
86d0076e93b64eb2fa657b7e8443a30dd2d9243b
[]
no_license
xisuo007/mymvc1
d306b6b445d35c52e7de4e087420c5049e1df988
14337409f226cc2efcf10d675941a293a2940ac6
refs/heads/master
2023-06-12T16:46:23.066257
2021-07-08T13:04:29
2021-07-08T13:04:29
382,248,833
0
0
null
null
null
null
UTF-8
Java
false
false
1,722
java
package com.king.mideng; import com.king.mideng.service.TokenService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.lang.reflect.Method; /** * Created by ljq on 2019/6/21 14:46 * * 接口幂等性拦截器 */ public class ApiIdempotentInterceptor implements HandlerInterceptor { @Autowired private TokenService tokenService; @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (!(handler instanceof HandlerMethod)) { return true; } HandlerMethod handlerMethod = (HandlerMethod) handler; Method method = handlerMethod.getMethod(); ApiIdempotent annotation = method.getAnnotation(ApiIdempotent.class); if (annotation != null) { check(request);//幂等性校验,校验通过则放行,校验失败则抛出异常,并通过统一异常处理返回提示 } return true; } private void check(HttpServletRequest request) { tokenService.checkToken(request); } @Override public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception { } @Override public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception { } }
[ "xisuo002@163.com" ]
xisuo002@163.com
9b14bd34e0a60a0e24648054805ae0f2958ef629
615c9171730eee635773f621bb827380d87a9ae8
/src/main/java/com/company/akka/CommonActor.java
f1b39ed3e75d7a97a21281738858d741db36e398
[]
no_license
vijethas/Akka_Company
d58c9c1f6a8bdd4cd9dccdeebfe177cc676861d6
99f7d3853cf380e462e163eadd33fceaa796a661
refs/heads/master
2020-06-18T05:02:39.811984
2017-03-03T09:34:00
2017-03-03T09:34:00
74,946,618
0
0
null
2017-03-03T09:34:00
2016-11-28T07:05:48
Java
UTF-8
Java
false
false
710
java
package com.company.akka; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; public class CommonActor extends Worker{ private Map<String,Method> commonMethods = new HashMap<String, Method>(); private final static String service = "com.company.services.CommonService"; public Class<?> getClassObject(){ Class<?> c = null; try { c = Class.forName(service); Method[] methods = c.getMethods(); for(Method m: methods){ commonMethods.put(m.getName(), m); } } catch (ClassNotFoundException e) { e.printStackTrace(); } return c; } public Method getMethod(String methodName){ return commonMethods.get(methodName); } }
[ "vijetha.nayak@riflexions.com" ]
vijetha.nayak@riflexions.com
4d594036db539a2f671178d6c5900b1e37b87e52
4ae7eaeef9dacf859188a8851824e4b69587abcd
/app/src/main/java/com/sdxxtop/zhidian/entity/AutoLoginBean.java
0cf497dfc339d5ac84b920eaf935a02307895a77
[]
no_license
ZhouSilverBullet/zhidian.android
fc901e30549c8fdbb3b7f66082b09ad06d972dc2
c8a17eb43cf9673cf8a0addfc6ea32ce0b4995c5
refs/heads/master
2020-03-22T11:10:34.854866
2018-09-03T11:33:21
2018-09-03T11:33:21
139,953,149
0
0
null
null
null
null
UTF-8
Java
false
false
2,152
java
package com.sdxxtop.zhidian.entity; /** * 作者:CaiCM * 日期:2018/3/22 时间:16:00 * 邮箱:15010104100@163.com * 描述:自动登录实体 */ public class AutoLoginBean { /** * code : 200 * msg : 成功 * data : {"userid":50000021,"auto_token":"2B8454948396505EB3220388A1A14D86","company_id":"100000","expire_time":"1521708027"} */ private int code; private String msg; private DataEntity data; public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public DataEntity getData() { return data; } public void setData(DataEntity data) { this.data = data; } public static class DataEntity { /** * userid : 50000021 * auto_token : 2B8454948396505EB3220388A1A14D86 * company_id : 100000 * expire_time : 1521708027 */ private int userid; private String auto_token; private String company_id; private String expire_time; public int getUserid() { return userid; } public void setUserid(int userid) { this.userid = userid; } public String getAuto_token() { return auto_token; } public void setAuto_token(String auto_token) { this.auto_token = auto_token; } public String getCompany_id() { return company_id; } public void setCompany_id(String company_id) { this.company_id = company_id; } public String getExpire_time() { return expire_time; } public void setExpire_time(String expire_time) { this.expire_time = expire_time; } } @Override public String toString() { return "AutoLoginBean{" + "code=" + code + ", msg='" + msg + '\'' + ", data=" + data + '}'; } }
[ "zhousaito@163.com" ]
zhousaito@163.com
09b0f6119de1f198f1ef558404593cab29a74b3f
96196a9b6c8d03fed9c5b4470cdcf9171624319f
/decompiled/com/google/android/gms/games/internal/IRoomServiceCallbacks.java
4a2f179a26887864c582bdef07eabe208542cb0f
[]
no_license
manciuszz/KTU-Asmens-Sveikatos-Ugdymas
8ef146712919b0fb9ad211f6cb7cbe550bca10f9
41e333937e8e62e1523b783cdb5aeedfa1c7fcc2
refs/heads/master
2020-04-27T03:40:24.436539
2019-03-05T22:39:08
2019-03-05T22:39:08
174,031,152
0
0
null
null
null
null
UTF-8
Java
false
false
21,654
java
package com.google.android.gms.games.internal; import android.os.Binder; import android.os.IBinder; import android.os.IInterface; import android.os.Parcel; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.support.v4.view.InputDeviceCompat; public interface IRoomServiceCallbacks extends IInterface { public static abstract class Stub extends Binder implements IRoomServiceCallbacks { private static class Proxy implements IRoomServiceCallbacks { private IBinder kq; Proxy(IBinder remote) { this.kq = remote; } public void a(ParcelFileDescriptor parcelFileDescriptor, int i) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); if (parcelFileDescriptor != null) { obtain.writeInt(1); parcelFileDescriptor.writeToParcel(obtain, 0); } else { obtain.writeInt(0); } obtain.writeInt(i); this.kq.transact(1024, obtain, null, 1); } finally { obtain.recycle(); } } public void a(ConnectionInfo connectionInfo) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); if (connectionInfo != null) { obtain.writeInt(1); connectionInfo.writeToParcel(obtain, 0); } else { obtain.writeInt(0); } this.kq.transact(1022, obtain, null, 1); } finally { obtain.recycle(); } } public void a(String str, byte[] bArr, int i) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeByteArray(bArr); obtain.writeInt(i); this.kq.transact(1002, obtain, null, 1); } finally { obtain.recycle(); } } public void a(String str, String[] strArr) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeStringArray(strArr); this.kq.transact(1008, obtain, null, 1); } finally { obtain.recycle(); } } public void al(IBinder iBinder) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeStrongBinder(iBinder); this.kq.transact(1021, obtain, null, 1); } finally { obtain.recycle(); } } public IBinder asBinder() { return this.kq; } public void b(String str, String[] strArr) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeStringArray(strArr); this.kq.transact(1009, obtain, null, 1); } finally { obtain.recycle(); } } public void bg(String str) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); this.kq.transact(1003, obtain, null, 1); } finally { obtain.recycle(); } } public void bh(String str) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); this.kq.transact(1004, obtain, null, 1); } finally { obtain.recycle(); } } public void bi(String str) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); this.kq.transact(1005, obtain, null, 1); } finally { obtain.recycle(); } } public void bj(String str) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); this.kq.transact(1006, obtain, null, 1); } finally { obtain.recycle(); } } public void bk(String str) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); this.kq.transact(1007, obtain, null, 1); } finally { obtain.recycle(); } } public void bl(String str) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); this.kq.transact(1018, obtain, null, 1); } finally { obtain.recycle(); } } public void bm(String str) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); this.kq.transact(1019, obtain, null, 1); } finally { obtain.recycle(); } } public void c(int i, int i2, String str) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeInt(i); obtain.writeInt(i2); obtain.writeString(str); this.kq.transact(1001, obtain, null, 1); } finally { obtain.recycle(); } } public void c(String str, String[] strArr) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeStringArray(strArr); this.kq.transact(1010, obtain, null, 1); } finally { obtain.recycle(); } } public void ck(int i) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeInt(i); this.kq.transact(1020, obtain, null, 1); } finally { obtain.recycle(); } } public void d(String str, String[] strArr) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeStringArray(strArr); this.kq.transact(1011, obtain, null, 1); } finally { obtain.recycle(); } } public void e(String str, String[] strArr) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeStringArray(strArr); this.kq.transact(1012, obtain, null, 1); } finally { obtain.recycle(); } } public void f(String str, String[] strArr) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeStringArray(strArr); this.kq.transact(1013, obtain, null, 1); } finally { obtain.recycle(); } } public void g(String str, String[] strArr) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeStringArray(strArr); this.kq.transact(1017, obtain, null, 1); } finally { obtain.recycle(); } } public void hJ() throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); this.kq.transact(1016, obtain, null, 1); } finally { obtain.recycle(); } } public void hK() throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); this.kq.transact(1023, obtain, null, 1); } finally { obtain.recycle(); } } public void onP2PConnected(String participantId) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(participantId); this.kq.transact(1014, obtain, null, 1); } finally { obtain.recycle(); } } public void onP2PDisconnected(String participantId) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(participantId); this.kq.transact(1015, obtain, null, 1); } finally { obtain.recycle(); } } public void t(String str, int i) throws RemoteException { Parcel obtain = Parcel.obtain(); try { obtain.writeInterfaceToken("com.google.android.gms.games.internal.IRoomServiceCallbacks"); obtain.writeString(str); obtain.writeInt(i); this.kq.transact(InputDeviceCompat.SOURCE_GAMEPAD, obtain, null, 1); } finally { obtain.recycle(); } } } public Stub() { attachInterface(this, "com.google.android.gms.games.internal.IRoomServiceCallbacks"); } public static IRoomServiceCallbacks am(IBinder iBinder) { if (iBinder == null) { return null; } IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); return (queryLocalInterface == null || !(queryLocalInterface instanceof IRoomServiceCallbacks)) ? new Proxy(iBinder) : (IRoomServiceCallbacks) queryLocalInterface; } public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { ParcelFileDescriptor parcelFileDescriptor = null; switch (code) { case 1001: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); c(data.readInt(), data.readInt(), data.readString()); return true; case 1002: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); a(data.readString(), data.createByteArray(), data.readInt()); return true; case 1003: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); bg(data.readString()); return true; case 1004: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); bh(data.readString()); return true; case 1005: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); bi(data.readString()); return true; case 1006: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); bj(data.readString()); return true; case 1007: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); bk(data.readString()); return true; case 1008: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); a(data.readString(), data.createStringArray()); return true; case 1009: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); b(data.readString(), data.createStringArray()); return true; case 1010: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); c(data.readString(), data.createStringArray()); return true; case 1011: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); d(data.readString(), data.createStringArray()); return true; case 1012: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); e(data.readString(), data.createStringArray()); return true; case 1013: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); f(data.readString(), data.createStringArray()); return true; case 1014: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); onP2PConnected(data.readString()); return true; case 1015: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); onP2PDisconnected(data.readString()); return true; case 1016: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); hJ(); return true; case 1017: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); g(data.readString(), data.createStringArray()); return true; case 1018: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); bl(data.readString()); return true; case 1019: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); bm(data.readString()); return true; case 1020: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); ck(data.readInt()); return true; case 1021: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); al(data.readStrongBinder()); return true; case 1022: ConnectionInfo bf; data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); if (data.readInt() != 0) { bf = ConnectionInfo.CREATOR.bf(data); } a(bf); return true; case 1023: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); hK(); return true; case 1024: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); if (data.readInt() != 0) { parcelFileDescriptor = (ParcelFileDescriptor) ParcelFileDescriptor.CREATOR.createFromParcel(data); } a(parcelFileDescriptor, data.readInt()); return true; case InputDeviceCompat.SOURCE_GAMEPAD /*1025*/: data.enforceInterface("com.google.android.gms.games.internal.IRoomServiceCallbacks"); t(data.readString(), data.readInt()); return true; case 1598968902: reply.writeString("com.google.android.gms.games.internal.IRoomServiceCallbacks"); return true; default: return super.onTransact(code, data, reply, flags); } } } void a(ParcelFileDescriptor parcelFileDescriptor, int i) throws RemoteException; void a(ConnectionInfo connectionInfo) throws RemoteException; void a(String str, byte[] bArr, int i) throws RemoteException; void a(String str, String[] strArr) throws RemoteException; void al(IBinder iBinder) throws RemoteException; void b(String str, String[] strArr) throws RemoteException; void bg(String str) throws RemoteException; void bh(String str) throws RemoteException; void bi(String str) throws RemoteException; void bj(String str) throws RemoteException; void bk(String str) throws RemoteException; void bl(String str) throws RemoteException; void bm(String str) throws RemoteException; void c(int i, int i2, String str) throws RemoteException; void c(String str, String[] strArr) throws RemoteException; void ck(int i) throws RemoteException; void d(String str, String[] strArr) throws RemoteException; void e(String str, String[] strArr) throws RemoteException; void f(String str, String[] strArr) throws RemoteException; void g(String str, String[] strArr) throws RemoteException; void hJ() throws RemoteException; void hK() throws RemoteException; void onP2PConnected(String str) throws RemoteException; void onP2PDisconnected(String str) throws RemoteException; void t(String str, int i) throws RemoteException; }
[ "evilquaint@gmail.com" ]
evilquaint@gmail.com
78195c7ac7e67b7cf00e37ccdaafbec19a73f942
595dc0c14ab5629b127d8f3e21fbc7a7471adfa8
/src/test/java/com/example/testMongo/TestMongoApplicationTests.java
cefcf9acd50dabb169e734d2d6e891a0bdabdb66
[]
no_license
Ashwinatg/testmongo
e704e17d369f045e7b34d91d7a0db0ea0bb0e7a2
d98c329e604e8823463c9e2384a114b5c21c50f1
refs/heads/master
2023-02-06T21:03:01.232471
2020-12-29T06:16:38
2020-12-29T06:16:38
325,200,961
0
0
null
null
null
null
UTF-8
Java
false
false
216
java
package com.example.testMongo; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class TestMongoApplicationTests { @Test void contextLoads() { } }
[ "ashwin.dasarathan@sapient.com" ]
ashwin.dasarathan@sapient.com
beed4a0a757857b565a8909b5a8fd9398344e6e5
0922afc752c9b6bd304ed1f7ba9190b4111fd7a9
/src/gui/SellerFormController.java
052b1b2189d9b6be8eda2f25e029242f92fcc28d
[]
no_license
felipeoliveirasilva/workshop-javafx-jdbc
153d57ebb47a7052aa70f7b862593d63a26020c7
534aa7389b143c3b58a9df60b3db95aa77f3f674
refs/heads/main
2023-04-22T05:47:53.934663
2021-04-29T17:50:44
2021-04-29T17:50:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,450
java
package gui; import java.net.URL; import java.time.Instant; import java.time.LocalDate; import java.time.ZoneId; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; import java.util.Set; import db.DbException; import gui.listeners.DataChangeListener; import gui.util.Alerts; import gui.util.Constraints; import gui.util.Utils; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.Alert.AlertType; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.control.DatePicker; import javafx.scene.control.Label; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; import javafx.scene.control.TextField; import javafx.util.Callback; import model.entities.Department; import model.entities.Seller; import model.exceptions.ValidationException; import model.services.DepartmentService; import model.services.SellerService; public class SellerFormController implements Initializable { private Seller entity; private SellerService service; private DepartmentService departmentService; private List<DataChangeListener> dataChangeListeners = new ArrayList<>(); @FXML private TextField txtId; @FXML private TextField txtName; @FXML private TextField txtEmail; @FXML private DatePicker dpBirthDate; @FXML private TextField txtBaseSalary; @FXML private ComboBox<Department> comboBoxDepartment; @FXML private Label labelErrorName; @FXML private Label labelErrorEmail; @FXML private Label labelErrorBirthDate; @FXML private Label labelErrorBaseSalary; @FXML private Button btSave; @FXML private Button btCancel; private ObservableList<Department> obsList; public void setSeller(Seller entity) { this.entity = entity; } public void setServices(SellerService service, DepartmentService departmentService) { this.service = service; this.departmentService = departmentService; } public void subscribeDataChangeListener(DataChangeListener listener) { dataChangeListeners.add(listener); } @FXML public void onBtSaveAction(ActionEvent event) { if (entity == null) { throw new IllegalStateException("Entity was null"); } if (service == null) { throw new IllegalStateException("Service was null"); } try { entity = getFormData(); service.saveOrUpdate(entity); notityDataChangeListeners(); Utils.currentStage(event).close(); } catch (DbException e) { Alerts.showAlert("Error saving object", null, e.getMessage(), AlertType.ERROR); } catch (ValidationException e) { setErrorsMessages(e.getErrors()); } } private void notityDataChangeListeners() { for (DataChangeListener listener : dataChangeListeners) { listener.onDataChanged(); } } private Seller getFormData() { Seller obj = new Seller(); ValidationException exception = new ValidationException("Validation Error"); obj.setId(Utils.tryParseToInt(txtId.getText())); if (txtName.getText() == null || txtName.getText().trim().equals("")) { exception.addError("name", "Field can't be empty"); } obj.setName(txtName.getText()); if (txtEmail.getText() == null || txtEmail.getText().trim().equals("")) { exception.addError("email", "Field can't be empty"); } obj.setEmail(txtEmail.getText()); if (dpBirthDate.getValue() == null) { exception.addError("birthDate", "Field can't be empty"); } else { Instant instant = Instant.from(dpBirthDate.getValue().atStartOfDay(ZoneId.systemDefault())); obj.setBirthDate(Date.from(instant)); } if (txtBaseSalary.getText() == null || txtBaseSalary.getText().trim().equals("")) { exception.addError("baseSalary", "Field can't be empty"); } obj.setBaseSalary(Utils.tryParseToDouble(txtBaseSalary.getText())); obj.setDepartment(comboBoxDepartment.getValue()); if (exception.getErrors().size() > 0) { throw exception; } return obj; } @FXML public void onBtCancelAction(ActionEvent event) { Utils.currentStage(event).close(); } @Override public void initialize(URL uri, ResourceBundle rb) { initializeNodes(); } private void initializeNodes() { Constraints.setTextFieldInteger(txtId); Constraints.setTextFieldMaxLength(txtName, 70); Constraints.setTextFieldDouble(txtBaseSalary); Constraints.setTextFieldMaxLength(txtEmail, 60); Utils.formatDatePicker(dpBirthDate, "dd/MM/yyyy"); initializeComboBoxDepartment(); } public void updateFormData() { if (entity == null) { throw new IllegalStateException("Entity was null"); } txtId.setText(String.valueOf(entity.getId())); txtName.setText(entity.getName()); txtEmail.setText(entity.getEmail()); Locale.setDefault(Locale.US); txtBaseSalary.setText(String.format("%.2f", entity.getBaseSalary())); if (entity.getBirthDate() != null) { dpBirthDate.setValue(LocalDate.ofInstant(entity.getBirthDate().toInstant(), ZoneId.systemDefault())); } if (entity.getDepartment() == null) { comboBoxDepartment.getSelectionModel().selectFirst(); } else { comboBoxDepartment.setValue(entity.getDepartment()); } } public void loadAssociatedObjects() { if (departmentService == null) { throw new IllegalStateException("DepartmentService was null"); } List<Department> list = departmentService.findAll(); obsList = FXCollections.observableArrayList(list); comboBoxDepartment.setItems(obsList); } private void setErrorsMessages(Map<String, String> errors) { Set<String> fields = errors.keySet(); labelErrorName.setText((fields.contains("name") ? errors.get("name") : "")); labelErrorEmail.setText((fields.contains("email") ? errors.get("email") : "")); labelErrorBaseSalary.setText((fields.contains("baseSalary") ? errors.get("baseSalary") : "")); labelErrorBirthDate.setText((fields.contains("birthDate") ? errors.get("birthDate") : "")); } private void initializeComboBoxDepartment() { Callback<ListView<Department>, ListCell<Department>> factory = lv -> new ListCell<Department>() { @Override protected void updateItem(Department item, boolean empty) { super.updateItem(item, empty); setText(empty ? "" : item.getName()); } }; comboBoxDepartment.setCellFactory(factory); comboBoxDepartment.setButtonCell(factory.call(null)); } }
[ "felipeosilva@hotmail.com" ]
felipeosilva@hotmail.com
94abc90c60774deac33ae1c965d03b73dc952ab1
7eae884ffcb7698744e567ac7774241a281a7a8b
/leaverecords/src/observertestharness/IObserver.java
059242e175bc0baafff6dc39ee0b52688e9f3be9
[]
no_license
amstevenson/LeaveRecords
755dd861f6f6c0fc9f53f5ae806245db38c41943
51d7b525ac7b34bf10435af15b5203d41361ec17
refs/heads/master
2021-01-10T13:44:13.708866
2016-01-31T19:57:41
2016-01-31T19:57:41
50,792,196
0
1
null
null
null
null
UTF-8
Java
false
false
332
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package observertestharness; /** * An interface that allows a class to "observe a subject" and update as the * subject changes state automatically * * @author AStevenson */ public interface IObserver { void update(); }
[ "adam.m.stevenson@students.plymouth.ac.uk" ]
adam.m.stevenson@students.plymouth.ac.uk
5e45c1e3a0a200aeaa8a82b831d9de9bc72a4719
d0fee9d35e1d2c06b00f5a66c7fcd0a53b86172e
/bookstore/src/com/bs/admin/dao/impl/EmployeeDaoImpl.java
bf77519e13c8b1dfaf13d3d8946fb1b9bb746688
[]
no_license
caddyz/bookstorebackground
28e443c5ac46956c06275e1b7149b13ebdb309e1
467eac950b65fe2936aa1373ffc82c490026ebc8
refs/heads/master
2020-04-18T02:26:18.425253
2019-01-23T10:19:33
2019-01-23T10:19:33
167,162,504
0
0
null
null
null
null
UTF-8
Java
false
false
1,532
java
package com.bs.admin.dao.impl; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import com.bs.admin.dao.EmployeeDao; import com.bs.admin.mapper.EmployeeMapper; import com.bs.admin.pojo.Employee; @Repository public class EmployeeDaoImpl implements EmployeeDao{ @Autowired private EmployeeMapper em; @Override public Employee retrieveEmpByEmpId(Long EmpId) { return em.getEmpByEmpId(EmpId); } @Override public Integer createEmp(Employee emp) { return em.createEmp(emp); } @Override public Integer deleteEmp(Long empId) { return em.deleteEmp(empId); } @Override public Integer updateEmp(Employee emp) { return em.updateEmp(emp); } @Override public List<Employee> retrieveAllEmp() { return em.getAllEmp(); } @Override public List<Employee> retrieveEmpByFields(String name, String value, String date1, String date2, Integer empStatus, Integer start, Integer pageSize) { List<Employee> list = em.getEmpByFeilds(name, value, date1, date2, empStatus, start, pageSize); return list; } @Override public Integer retrieveTotalCount(String name, String value, String date1, String date2, Integer status) { System.out.println("em : "+em); return em.getEmpCountByFields(name, value, date1, date2, status, null, null); } @Override public List<Employee> retrieveEmpByDept(String dept) { return em.getEmpByDept(dept); } @Override public List<String> retrieveDeptAll() { return em.getAllDept(); } }
[ "18784227116@163.com" ]
18784227116@163.com
552edaaa4369c17d25e514b10f25858c3c0b4aa4
56b335c537850d795119a23a06faf849669f309b
/src/main/java/com/example/redispubsub/services/RedisClient.java
8a4657272f04721ea9df1bbdc440bcbaaab842c9
[]
no_license
jpatel-ontic/redispubsub
7db80f6f5861472307d6207950e4a227cbe57477
9b482efdd6017dd43ac9f5e53ec00d23fe1bda9d
refs/heads/master
2020-12-18T10:06:29.805970
2020-01-23T08:48:47
2020-01-23T08:48:47
235,341,868
0
0
null
null
null
null
UTF-8
Java
false
false
557
java
package com.example.redispubsub.services; import org.redisson.Redisson; import org.redisson.api.RedissonClient; import org.redisson.config.Config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class RedisClient { @Bean RedissonClient getRedissonClient() { Config config = new Config(); config.useSingleServer().setAddress("redis://127.0.0.1:6379"); RedissonClient client = Redisson.create(config); return client; } }
[ "eagleye@JeetAs-MBP.Dlink" ]
eagleye@JeetAs-MBP.Dlink
1c29ed898516419022b6a74d978fa8bdfc3c32d4
f9b964bc7c76cb0b46104965536a1a05c904eac1
/app/src/main/java/com/example/luis/applicationthree/provider/Contract.java
ef2aae00e45b90b251b1b5b527b046e392e6d692
[]
no_license
angellsant/PglPractice3
ac89284d58c0b154bec97c3eba3588f68d05de7a
4c3fba002066a1666b556d3b1d70b0475a6e8abf
refs/heads/master
2020-04-05T16:52:23.539004
2018-11-11T19:13:18
2018-11-11T19:13:18
157,032,204
0
0
null
null
null
null
UTF-8
Java
false
false
650
java
package com.example.luis.applicationthree.provider; import android.net.Uri; import android.provider.BaseColumns; public class Contract { public static final String AUTHORITY = "com.example.luis.applicationthree.DataProvider"; public static final class Constructor implements BaseColumns { // Table public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/Constructor"); // Table columns public static final String NAMECONSTRUCTOR = "nameConstructor"; public static final String YEARBIRDTH = "yearBirdth"; public static final String FOUNDER = "founderName"; } }
[ "aluis.santana@icloud.com" ]
aluis.santana@icloud.com
84430276f457da2c9877eb1632ddc59f2ba8d4aa
c319c4729acb308c981c582349a27866eef5dc4b
/bdysysm/src/main/java/com/yootii/bdy/preference/model/PreferenceField.java
c712597b4c41792157d5057648803d27bd41a2e8
[]
no_license
godlessyou/suit
866e7704407a5bfdbcf579454486d88c7455e0d6
454bb494b16ba63817eec97e45661e8a38b4516c
refs/heads/master
2020-04-16T12:25:22.429576
2019-01-14T01:59:57
2019-01-14T01:59:57
165,578,613
0
0
null
null
null
null
UTF-8
Java
false
false
2,047
java
package com.yootii.bdy.preference.model; public class PreferenceField { private Integer preferenceId; private String dataType; private String preferenceName; private String description; private String defaultStringValue; private String defaultIntValue; private String preferenceType; private String format; public Integer getPreferenceId() { return preferenceId; } public void setPreferenceId(Integer preferenceId) { this.preferenceId = preferenceId; } public String getDataType() { return dataType; } public void setDataType(String dataType) { this.dataType = dataType == null ? null : dataType.trim(); } public String getPreferenceName() { return preferenceName; } public void setPreferenceName(String preferenceName) { this.preferenceName = preferenceName == null ? null : preferenceName.trim(); } public String getDescription() { return description; } public void setDescription(String description) { this.description = description == null ? null : description.trim(); } public String getDefaultStringValue() { return defaultStringValue; } public void setDefaultStringValue(String defaultStringValue) { this.defaultStringValue = defaultStringValue == null ? null : defaultStringValue.trim(); } public String getDefaultIntValue() { return defaultIntValue; } public void setDefaultIntValue(String defaultIntValue) { this.defaultIntValue = defaultIntValue == null ? null : defaultIntValue.trim(); } public String getPreferenceType() { return preferenceType; } public void setPreferenceType(String preferenceType) { this.preferenceType = preferenceType == null ? null : preferenceType.trim(); } public String getFormat() { return format; } public void setFormat(String format) { this.format = format == null ? null : format.trim(); } }
[ "243772034@qq.com" ]
243772034@qq.com
bfe0417fea0a989e708344873e0ee37ae539209d
76d0800c81cda7fa2828e587002cfafce260d789
/gamitour/src/com/dawes/dao/RolDAO.java
39cec859f8b4eb730b0ee4729900109e757c816c
[]
no_license
gamitourgrupotres/proyectodaw
381d04811489b585005c2ffb9347fa83cd247a1d
cc835b104419ab5d071e53e8e2272dfbfefcdd54
refs/heads/master
2021-04-28T20:44:56.152754
2018-02-18T10:02:09
2018-02-18T10:02:09
121,933,715
0
1
null
2018-02-20T12:05:50
2018-02-18T08:38:36
Java
UTF-8
Java
false
false
158
java
package com.dawes.dao; import com.dawes.modelo.Rol; import com.dawes.util.GenericDAO; public interface RolDAO extends GenericDAO<Rol, Integer> { }
[ "gamitourdaw@gmail.com" ]
gamitourdaw@gmail.com
b50e19166d8351a9ec4ca790ca7825881f5bbfb8
cae024905c85cc374fb27d58809422b5278d4923
/bomberman_cado/src/bomberman/Item.java
6bd88dfb69f0201088fe2238778ad4660699e375
[]
no_license
clgt1903/Professor
06a07079ad6b4ba55f9b36a582b304713939acaf
6a1bcad9bcf1512697c3b279cd0fd1abc47280cb
refs/heads/master
2020-04-05T21:02:04.482996
2018-11-27T08:07:00
2018-11-27T08:07:00
157,204,587
0
0
null
null
null
null
UTF-8
Java
false
false
1,263
java
package bomberman; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import javax.swing.ImageIcon; public class Item { public static int Item_Bomb = 1; public static int Item_BombSize = 2; public static int Item_Shoe = 3; private int x, y, type, width, height, timeLine; private Image img; public Item(int x, int y, int type, String image) { super(); this.x = x; this.y = y; this.type = type; this.img = new ImageIcon(getClass().getResource(image)).getImage(); this.width = img.getWidth(null); this.height = img.getHeight(null); timeLine = 250; } public void drawItem(Graphics2D g2d) { g2d.drawImage(img, x, y, null); } public int getX() { return x; } public int getY() { return y; } public int getType() { return type; } public int getWidth() { return width; } public int getHeight() { return height; } public int getTimeLine() { return timeLine; } public void setTimeLine(int timeLine) { this.timeLine = timeLine; } public boolean isImpactItemVsBomber(Bomber bomber) { Rectangle rec1 = new Rectangle(x, y, width, height); Rectangle rec2 = new Rectangle(bomber.getX(), bomber.getY(), bomber.getWidth(), bomber.getHeight()); return rec1.intersects(rec2); } }
[ "duonghoa123190299@gmail.com" ]
duonghoa123190299@gmail.com
5ca88289c5f68f7b9852dd2ac73630a4acff05cf
ffee35a70c2d861eea6f6fc185e4e837481076b9
/src/BirmanSchiperStephenson/Timestamp.java
1d420c149c06b4fd53576ca337fa1228961fdbfe
[]
no_license
karelvandoesburg/DistributedAlgorithms_secondtry
287ab7169239e3cb1e00a0c3dae5746ca3557161
944e5627a118d7332bc6e7eb62033015c4b3e096
refs/heads/master
2021-09-03T19:12:02.303950
2017-11-24T11:53:54
2017-11-24T11:53:54
111,904,504
0
0
null
null
null
null
UTF-8
Java
false
false
62
java
package BirmanSchiperStephenson; public class Timestamp { }
[ "karelvandoesburg@gmail.com" ]
karelvandoesburg@gmail.com
20948d800097dd5e4a5f0b59dbe4b9d39f17bd45
3b481b302b02edf57b816acac9e5ff3b7ec602e2
/src/dfy.java
3a27c91f2a474884f4a10c121de336f48fc7ebfb
[]
no_license
reverseengineeringer/com.twitter.android
53338ae009b2b6aa79551a8273875ec3728eda99
f834eee04284d773ccfcd05487021200de30bd1e
refs/heads/master
2021-04-15T04:35:06.232782
2016-07-21T03:51:19
2016-07-21T03:51:19
63,835,046
1
1
null
null
null
null
UTF-8
Java
false
false
2,245
java
import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import rx.ao; import rx.exceptions.e; public final class dfy implements ao { private Set<ao> a; private volatile boolean b; private static void a(Collection<ao> paramCollection) { if (paramCollection == null) { return; } ao localao = null; Iterator localIterator = paramCollection.iterator(); paramCollection = localao; for (;;) { if (!localIterator.hasNext()) { break label68; } localao = (ao)localIterator.next(); try { localao.Q_(); } catch (Throwable localThrowable) { if (paramCollection != null) { break label73; } } } paramCollection = new ArrayList(); label68: label73: for (;;) { paramCollection.add(localThrowable); break; e.a(paramCollection); return; } } public void Q_() { if (!b) { try { if (b) { return; } b = true; Set localSet = a; a = null; a(localSet); return; } finally {} } } public void a(ao paramao) { if (paramao.b()) { return; } if (!b) { try { if (!b) { if (a == null) { a = new HashSet(4); } a.add(paramao); return; } } finally {} } paramao.Q_(); } public void b(ao paramao) { if (!b) { try { if ((b) || (a == null)) { return; } boolean bool = a.remove(paramao); if (bool) { paramao.Q_(); return; } } finally {} } } public boolean b() { return b; } public void c() { if (!b) { try { if ((b) || (a == null)) { return; } Set localSet = a; a = null; a(localSet); return; } finally {} } } } /* Location: * Qualified Name: dfy * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
68dad51b44c9b2ab4a5e2b7b253b45c9fb4c6b56
ae6766b8c7e6214ddb0c793ed4dc85ffea0f2815
/src/com/kuku/Test.java
a11b035562929434a92dc039828b699ddad75564
[]
no_license
Zlobnuykrolya/Kuku
d8970f9071b543a76b3a6f0d18e4952c97ca4d01
326f29013877a98cdc19241045d8e045291adc02
refs/heads/master
2020-04-18T17:52:06.161621
2019-02-18T23:10:42
2019-02-18T23:10:42
167,666,106
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
package com.kuku; public class Test { int a, b; Test(int i,int j) { a = i; b = j; } void meth(Test o) { o.a *= 2; o.b /= 2; } void meth(int a,int b) { a *= 2; b /= 2; } }
[ "marla1@inbox.ru" ]
marla1@inbox.ru
6607cf92b08ddf0f1b983333e129f67353236943
d1a6d1e511df6db8d8dd0912526e3875c7e1797d
/genny_JavaWithoutLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava18/Foo263.java
f0a80da62a99ace8ab21efec77b177dbd365b947
[]
no_license
NikitaKozlov/generated-project-for-desugaring
0bc1443ab3ddc84cd289331c726761585766aea7
81506b3711004185070ca4bb9a93482b70011d36
refs/heads/master
2020-03-20T00:35:06.996525
2018-06-12T09:30:37
2018-06-12T09:30:37
137,049,317
0
0
null
null
null
null
UTF-8
Java
false
false
348
java
package applicationModulepackageJava18; public class Foo263 { public void foo0() { new applicationModulepackageJava18.Foo262().foo5(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } }
[ "nikita.e.kozlov@gmail.com" ]
nikita.e.kozlov@gmail.com
0cb774913d88a27e958683da5c7cd32e850a6898
440c08b26ba2dcc2927fe4f82cb1b4b51eb1cf76
/src/main/java/com/fatcup/backend/TeamService.java
007842555e4e2e74d42b593bed8caa7fa122b48b
[]
no_license
Swiftstar/FatCup-Backend
c79412715622713595c8e11707048ebf2758b290
927f23d0e6032a08688a6bc2b84f1acda584bfe3
refs/heads/master
2020-03-29T13:46:07.570925
2018-12-10T03:32:46
2018-12-10T03:32:46
149,981,152
0
0
null
null
null
null
UTF-8
Java
false
false
5,112
java
package com.fatcup.backend; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import com.fasterxml.jackson.databind.ObjectMapper; import com.fatcup.backend.data.OrderRepository; import com.fatcup.backend.data.Orders; import com.fatcup.backend.data.OrdersStatus; import com.fatcup.backend.data.Team; import com.fatcup.backend.data.TeamRepository; import com.fatcup.backend.net.ResponseBase; import com.fatcup.backend.net.ReturnCode; import com.fatcup.backend.net.TeamOrderDTO; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseAuthException; import com.google.firebase.auth.FirebaseToken; @Service public class TeamService { Logger logger = LoggerFactory.getLogger(TeamService.class); @Autowired OrderRepository orderRepository; @Autowired TeamRepository teamRepository; @Autowired FirebaseAuth firebaseAuth; public ResponseEntity<ResponseBase> UserCheck(String token) { ResponseBase response = new ResponseBase(); FirebaseToken decodedToken; try { decodedToken = firebaseAuth.verifyIdToken(token); } catch (FirebaseAuthException e) { response.setReturnCode(HttpStatus.FORBIDDEN.value()); response.setReturnMessage(e.getErrorCode()); return ResponseEntity.status(HttpStatus.FORBIDDEN).body(response); } String uid = decodedToken.getUid(); logger.debug("uid:" + uid); Team u = teamRepository.findById(uid).get(); if (u != null) { response.setReturnCode(ReturnCode.OK); response.Set("uid", u.getUid()); response.Set("isuser", true); } else { response.setReturnCode(ReturnCode.OK); response.Set("uid", null); response.Set("isuser", false); } return ResponseEntity.ok(response); } public ResponseEntity<ResponseBase> MapOrders() { ResponseBase response = new ResponseBase(); Collection<OrdersStatus> status = new HashSet<OrdersStatus>(); status.add(OrdersStatus.WATING); status.add(OrdersStatus.ACCEPT); ArrayList<Orders> result = (ArrayList<Orders>) orderRepository.findByStatusIn(status); response.Set("taskList", result); return ResponseEntity.ok(response); } @SuppressWarnings("unchecked") public ResponseEntity<ResponseBase> TaskInformation(String language, Long orderId) { ResponseBase response = new ResponseBase(); Orders orders = orderRepository.findById(orderId).get(); ObjectMapper objectMapper = new ObjectMapper(); Map<String, Object> data = objectMapper.convertValue(orders, HashMap.class); response.Set(data); return ResponseEntity.ok(response); } @SuppressWarnings("unchecked") public ResponseEntity<ResponseBase> TaskAdd(TeamOrderDTO request) { ResponseBase response = new ResponseBase(); Orders orders = orderRepository.findById(request.orderId).get(); orders.setStatus(OrdersStatus.ACCEPT); orders.setTeamLat(request.latitude); orders.setTeamLong(request.longitude); orderRepository.save(orders); ObjectMapper objectMapper = new ObjectMapper(); Map<String, Object> data = objectMapper.convertValue(orders, HashMap.class); response.Set(data); return ResponseEntity.ok(response); } public ResponseEntity<ResponseBase> UserTask(TeamOrderDTO request) { ResponseBase response = new ResponseBase(); Team team = teamRepository.findById(request.uid).get(); List<Orders> orders = orderRepository.findByTeamAndStatus(team, OrdersStatus.ACCEPT); response.Set("orders", orders); return ResponseEntity.ok(response); } @SuppressWarnings("unchecked") public ResponseEntity<ResponseBase> TaskFinish(TeamOrderDTO request) { ResponseBase response = new ResponseBase(); Orders orders = orderRepository.findById(request.orderId).get(); orders.setStatus(OrdersStatus.FINISH); orderRepository.save(orders); ObjectMapper objectMapper = new ObjectMapper(); Map<String, Object> data = objectMapper.convertValue(orders, HashMap.class); response.Set(data); return ResponseEntity.ok(response); } @SuppressWarnings("unchecked") public ResponseEntity<ResponseBase> TaskDelete(TeamOrderDTO request) { ResponseBase response = new ResponseBase(); Orders orders = orderRepository.findById(request.orderId).get(); orders.setStatus(OrdersStatus.CANCEL); orders.setRemark(request.reason); orderRepository.save(orders); ObjectMapper objectMapper = new ObjectMapper(); Map<String, Object> data = objectMapper.convertValue(orders, HashMap.class); response.Set(data); return ResponseEntity.ok(response); } public ResponseEntity<ResponseBase> TaskHistory(TeamOrderDTO request) { ResponseBase response = new ResponseBase(); Team team = teamRepository.findById(request.uid).get(); List<Orders> orders = orderRepository.findByTeam(team); response.Set("orders", orders); return ResponseEntity.ok(response); } }
[ "h79121@gmail.com" ]
h79121@gmail.com
720b1b8b8f80bf9b2e29237c81a110afac635d83
470c33a2dd326a2963a84719f9062e64d840020c
/app/src/main/java/app/data/foundation/net/RestApi.java
7fabfce299050bec5e2cfc1c465405b39acd5aaa
[]
no_license
robertofrontado/YoutubeSample-Android
0c508aba8221540a3ecda411f016d4c44417fc1d
80a7a7c8b86b522acda4d6e10831842583b53576
refs/heads/master
2021-01-19T06:35:56.778010
2016-07-13T11:19:43
2016-07-13T11:19:43
62,753,036
0
0
null
null
null
null
UTF-8
Java
false
false
2,759
java
/* * Copyright 2016 FuckBoilerplate * * 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 app.data.foundation.net; import app.domain.sections.YoutubeVideosResponse; import retrofit2.Response; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.POST; import retrofit2.http.Path; import retrofit2.http.Query; import rx.Observable; /** * Definition for Retrofit of every endpoint required by the Api. */ public interface RestApi { String URL_BASE = "https://www.googleapis.com/youtube/v3/"; @GET("channels") Observable<Response<Object>> getChannels(@Header("Authorization") String bearerToken, @Query("part") String part, @Query("mine") boolean mine, @Query("access_token") String accessToken); @GET("videos") Observable<Response<Object>> getVideos(@Query("part") String part, @Query("chart") String chart, @Query("key") String apiKey); @GET("videos") Observable<Response<YoutubeVideosResponse>> getVideosOAuth(@Query("access_token") String bearerToken, @Query("part") String part, @Query("chart") String chart, @Query("key") String apiKey); @GET("search") Observable<Response<Object>> search(@Query("part") String part, @Query("key") String apiKey); @GET("search") Observable<Response<Object>> getRelatedVideos(@Header("Authorization") String bearerToken, @Query("part") String part, @Query("relatedToVideoId") String relatedToVideoId, @Query("type") String type, @Query("key") String apiKey); @POST("subscriptions") Observable<Response<Object>> subscribe(@Query("access_token") String bearerToken); }
[ "robertofrontado@gmail.com" ]
robertofrontado@gmail.com
78bb3c3420e98d44c6e180e83b05e55582c1da16
67fd691e2809b76d03b520f3d75f76fd81c67bff
/app/src/main/java/com/example/fuck/helloweather/view/CircleBarView.java
a9470b2201e1cc92086656fffa81d387ec6e97d9
[]
no_license
deep0603/helloweather
fe2647ae8391c1d2a3579dae3cdb9dd810071223
b6a39b2b04a248489484546032c0793cce06d8cb
refs/heads/master
2020-05-16T01:40:03.814226
2019-04-22T02:35:57
2019-04-22T02:35:57
182,607,646
0
0
null
null
null
null
UTF-8
Java
false
false
6,593
java
package com.example.fuck.helloweather.view; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.RectF; import android.util.AttributeSet; import android.view.View; import android.view.animation.Animation; import android.view.animation.Transformation; import android.widget.TextView; import com.example.fuck.helloweather.R; import com.example.fuck.helloweather.util.DpOrPxUtils; /** * Created by anlia on 2017/10/10. */ public class CircleBarView extends View { private Paint bgPaint;//绘制背景圆弧的画笔 private Paint progressPaint;//绘制圆弧的画笔 private RectF mRectF;//绘制圆弧的矩形区域 private CircleBarAnim anim; private float progressNum;//可以更新的进度条数值 private float maxNum;//进度条最大值 private int progressColor;//进度条圆弧颜色 private int bgColor;//背景圆弧颜色 private float startAngle;//背景圆弧的起始角度 private float sweepAngle;//背景圆弧扫过的角度 private float barWidth;//圆弧进度条宽度 private int defaultSize;//自定义View默认的宽高 private float progressSweepAngle;//进度条圆弧扫过的角度 private TextView textView; private OnAnimationListener onAnimationListener; public CircleBarView(Context context, AttributeSet attrs) { super(context, attrs); init(context,attrs); } private void init(Context context,AttributeSet attrs){ TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CircleBarView); progressColor = typedArray.getColor(R.styleable.CircleBarView_progress_color,Color.GREEN); bgColor = typedArray.getColor(R.styleable.CircleBarView_bg_color,Color.GRAY); startAngle = typedArray.getFloat(R.styleable.CircleBarView_start_angle,0); sweepAngle = typedArray.getFloat(R.styleable.CircleBarView_sweep_angle,360); barWidth = typedArray.getDimension(R.styleable.CircleBarView_bar_width, DpOrPxUtils.dip2px(context,10)); typedArray.recycle(); progressNum = 0; maxNum = 100; defaultSize = DpOrPxUtils.dip2px(context,100); mRectF = new RectF(); progressPaint = new Paint(); progressPaint.setStyle(Paint.Style.STROKE);//只描边,不填充 progressPaint.setColor(progressColor); progressPaint.setAntiAlias(true);//设置抗锯齿 progressPaint.setStrokeWidth(barWidth); progressPaint.setStrokeCap(Paint.Cap.ROUND);//设置画笔为圆角 bgPaint = new Paint(); bgPaint.setStyle(Paint.Style.STROKE);//只描边,不填充 bgPaint.setColor(bgColor); bgPaint.setAntiAlias(true);//设置抗锯齿 bgPaint.setStrokeWidth(barWidth); bgPaint.setStrokeCap(Paint.Cap.ROUND); anim = new CircleBarAnim(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); int height = measureSize(defaultSize, heightMeasureSpec); int width = measureSize(defaultSize, widthMeasureSpec); int min = Math.min(width, height);// 获取View最短边的长度 setMeasuredDimension(min, min);// 强制改View为以最短边为长度的正方形 if(min >= barWidth*2){ mRectF.set(barWidth/2,barWidth/2,min-barWidth/2,min-barWidth/2); } } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawArc(mRectF,startAngle,sweepAngle,false,bgPaint); canvas.drawArc(mRectF,startAngle,progressSweepAngle,false, progressPaint); } public class CircleBarAnim extends Animation{ public CircleBarAnim(){ } @Override protected void applyTransformation(float interpolatedTime, Transformation t) {//interpolatedTime从0渐变成1,到1时结束动画,持续时间由setDuration(time)方法设置 super.applyTransformation(interpolatedTime, t); progressSweepAngle = interpolatedTime * sweepAngle * progressNum / maxNum; if(onAnimationListener!=null){ if(textView !=null){ textView.setText(onAnimationListener.howToChangeText(interpolatedTime, progressNum,maxNum)); } onAnimationListener.howTiChangeProgressColor(progressPaint,interpolatedTime, progressNum,maxNum); } postInvalidate(); } } private int measureSize(int defaultSize,int measureSpec) { int result = defaultSize; int specMode = MeasureSpec.getMode(measureSpec); int specSize = MeasureSpec.getSize(measureSpec); if (specMode == MeasureSpec.EXACTLY) { result = specSize; } else if (specMode == MeasureSpec.AT_MOST) { result = Math.min(result, specSize); } return result; } /** * 设置进度条最大值 * @param maxNum */ public void setMaxNum(float maxNum) { this.maxNum = maxNum; } /** * 设置进度条数值 * @param progressNum 进度条数值 * @param time 动画持续时间 */ public void setProgressNum(float progressNum, int time) { this.progressNum = progressNum; anim.setDuration(time); this.startAnimation(anim); } /** * 设置显示文字的TextView * @param textView */ public void setTextView(TextView textView) { this.textView = textView; } public interface OnAnimationListener { /** * 如何处理要显示的文字内容 * @param interpolatedTime 从0渐变成1,到1时结束动画 * @param updateNum 进度条数值 * @param maxNum 进度条最大值 * @return */ String howToChangeText(float interpolatedTime, float updateNum, float maxNum); /** * 如何处理进度条的颜色 * @param paint 进度条画笔 * @param interpolatedTime 从0渐变成1,到1时结束动画 * @param updateNum 进度条数值 * @param maxNum 进度条最大值 */ void howTiChangeProgressColor(Paint paint, float interpolatedTime, float updateNum, float maxNum); } public void setOnAnimationListener(OnAnimationListener onAnimationListener) { this.onAnimationListener = onAnimationListener; } }
[ "deep0603" ]
deep0603
0e52c748bb6f84948c974a182dead7c4115cb084
38d766eccf89a3503ce7b6769e32b088f50939b9
/backoffice/src/main/java/com/angkorteam/framework/wicket/extensions/markup/html/repeater/data/table/filter/FilterToolbar.java
ee4f10bf850ca618b57e59e5730e22fa819e4eda
[ "Apache-2.0" ]
permissive
PkayJava/ECommerce
e4bd6aade8f1121b0fce2e7b959594789b782d7b
a04f50130efb96be7a25fd936ba638ce0cfe50cd
refs/heads/master
2021-01-18T13:11:34.017001
2017-03-12T08:15:44
2017-03-12T08:16:08
80,732,080
0
1
null
null
null
null
UTF-8
Java
false
false
622
java
package com.angkorteam.framework.wicket.extensions.markup.html.repeater.data.table.filter; import org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable; import org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterForm; /** * @author Socheat KHAUV */ public class FilterToolbar extends org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterToolbar { /** * */ private static final long serialVersionUID = 7585327710822016088L; public <T, S, F> FilterToolbar(DataTable<T, S> table, FilterForm<F> form) { super(table, form); } }
[ "pkayjava@gmail.com" ]
pkayjava@gmail.com
8bc59d15c67b487565469923bbfe47f765546da9
2e1f6f10de72112fc0940cb5626385e7bb9166c5
/BTNodeApp/src/btnodeapp/BinaryTree.java
9689e0a9fb198ee17d5fd2ce9ce6bf1d11d5d6bc
[]
no_license
donyd/NCIYearTwoJava
3feac8928f82ad52cf6da7cc0a85ebeedb4c6b5f
452905e0662fe3bca43b3cd855bd4213872cdfc2
refs/heads/master
2021-01-11T01:54:38.445512
2017-04-08T15:53:18
2017-04-08T15:53:18
70,839,095
0
0
null
null
null
null
UTF-8
Java
false
false
615
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 btnodeapp; /** * * @author x15012743 */ public class BinaryTree { public BTNode root(){ return null; } public int size(){ return 0; } public Boolean isEmpty(){ return true; } public BTNode elements(){ return null; } public Boolean contains(BTNode v){ return true; } }
[ "x15012743@SCR3-020.student.nci.col" ]
x15012743@SCR3-020.student.nci.col
e7b99e2e805e28c8861a4479121dd16f528fae25
cac0573f06404497f57f3eadf42c7032e8583b27
/Hello.java
58a8249e9a14c006f4347de4ab327b7747fe03f6
[]
no_license
swetasir/HelloWorld
052b66221c0db08d116c96adde6172df1511d075
297a754dd8a6204c7502725cf9d2c900d520c95a
refs/heads/master
2022-05-30T02:14:15.806578
2020-05-03T18:39:13
2020-05-03T18:39:13
260,994,229
0
0
null
null
null
null
UTF-8
Java
false
false
180
java
public class Hello{ public static void main(String[] args){ for(int i=1;i<=10;i++){ System.out.println("Hello World..."+i); } } }
[ "sweta.alla@gmail.com" ]
sweta.alla@gmail.com
1f25144578feae61b005c8f82f6d58a0a81c73a5
e78524f7bde2dc64056a7173982fc49146cb06ee
/workspace/app_v2/bshare_src/com/bshare/ui/ShareListDialog.java
afbe342499f74d181c0f6ad289a90d299814da57
[]
no_license
ben-kenobi/android_lagacy
90b417538a94c1643ef8b70998c478ec508eb217
ecaf31f82a8245f9c0a3702870cfa84ac747b6e1
refs/heads/master
2020-12-24T08:08:36.967953
2017-06-06T16:12:21
2017-06-06T16:12:21
73,343,156
1
0
null
null
null
null
UTF-8
Java
false
false
7,622
java
package com.bshare.ui; import java.util.ArrayList; import java.util.List; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.os.AsyncTask; import android.os.Bundle; import android.view.Display; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.widget.FrameLayout; import android.widget.ListView; import android.widget.Toast; import com.bshare.core.BSShareItem; import com.bshare.core.BShareShareListAdapter; import com.bshare.core.BShareWindowHandler; import com.bshare.core.Config; import com.bshare.core.Constants; import com.bshare.core.PlatformType; import com.bshare.platform.GeneralPlatform; import com.bshare.platform.Platform; import com.bshare.platform.PlatformFactory; import com.bshare.utils.BSUtils; /** * * @author chris.xue * */ public class ShareListDialog extends Dialog implements android.view.View.OnClickListener { public ShareListDialog(Context context, BSShareItem shareItem) { super(context, BSUtils.getResourseIdByName(context, "style", "bshare_dialog")); this.shareItem = shareItem; } public ShareListDialog(Context context, BSShareItem shareItem, BShareWindowHandler windowHandler) { this(context, shareItem); registerWindowHandler(windowHandler); } public void registerWindowHandler(BShareWindowHandler windowHandler) { if (windowHandler != null) { windowHandlers.add(windowHandler); } } public void unregisterWindowHandler(BShareWindowHandler windowHandler) { if (windowHandler != null) { windowHandlers.remove(windowHandler); } } protected BSShareItem shareItem; private List<BShareWindowHandler> windowHandlers = new ArrayList<BShareWindowHandler>(); protected View btnMore; protected ListView lvPlatform; protected List<PlatformType> platformList; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCanceledOnTouchOutside(true); requestWindowFeature(Window.FEATURE_NO_TITLE); View content = LayoutInflater.from(getContext()).inflate( BSUtils.getResourseIdByName(getContext(), "layout", "bshare_share_list"), null); setOnDismissListener(new OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { if (windowHandlers.isEmpty()) { for (BShareWindowHandler h : windowHandlers) { if (h != null) { h.onWindowClose(this); } } windowHandlers.clear(); } } }); Display display = getWindow().getWindowManager().getDefaultDisplay(); float scale = getContext().getResources().getDisplayMetrics().density; float[] dimensions = display.getWidth() < display.getHeight() ? Constants.DIMENSIONS_PORTRAIT : Constants.DIMENSIONS_LANDSCAPE; addContentView(content, new FrameLayout.LayoutParams((int) (dimensions[0] * scale + 0.5f), (int) (dimensions[1] * scale + 0.5f))); // setContentView(content); platformList = new ArrayList<PlatformType>(Config.instance().getShareList()); btnMore = findViewById(BSUtils.getResourseIdByName(getContext(), "id", "bs_share_button_more")); lvPlatform = (ListView) findViewById(BSUtils.getResourseIdByName(getContext(), "id", "bs_share_button_list_view")); BShareShareListAdapter adapter = new BShareShareListAdapter(getContext(), platformList, this); lvPlatform.setAdapter(adapter); if (btnMore != null) { if (Config.instance().isShouldDisplayMore()) { btnMore.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Dialog moreList = Config.instance().getDialogBuilder() .buildMoreListDialog(getContext(), shareItem, null); moreList.show(); if (isShowing()) { dismiss(); } } }); } else { btnMore.setVisibility(View.GONE); } } } public void share(PlatformType platformType) { final Platform platform = PlatformFactory.getPlatform(getContext(), platformType); platform.setShareItem(shareItem); if (!BSUtils.isOnline(getContext())) { Toast.makeText(getContext(), BSUtils.getResourseIdByName(getContext(), "string", "bshare_error_msg_offline"), Toast.LENGTH_SHORT) .show(); } else { if ((platform instanceof GeneralPlatform) == true) { platform.share(); } else { platform.setAccessTokenAndSecret(getContext()); if (platform.validation(true)) { AsyncTask<Object, Object, Object> task = new AsyncTask<Object, Object, Object>() { @Override protected Object doInBackground(Object... params) { platform.share(); return null; } }; task.execute(); } } } if (Config.instance().isAutoCloseShareList() && isShowing()) { dismiss(); } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if (isShowing()) { dismiss(); } return true; } return super.onKeyDown(keyCode, event); } @Override public void onClick(View item) { PlatformType p = (PlatformType) item.getTag(); if (p != null) { final Platform platform = PlatformFactory.getPlatform(getContext(), p); platform.setShareItem(shareItem); if (!BSUtils.isOnline(getContext())) { Toast.makeText(getContext(), BSUtils.getResourseIdByName(getContext(), "string", "bshare_error_msg_offline"), Toast.LENGTH_SHORT).show(); } else { if ((platform instanceof GeneralPlatform) == true) { platform.share(); } else { platform.setAccessTokenAndSecret(getContext()); if (platform.validation(true)) { AsyncTask<Object, Object, Object> task = new AsyncTask<Object, Object, Object>() { @Override protected Object doInBackground(Object... params) { platform.share(); return null; } }; task.execute(); } } } if (Config.instance().isAutoCloseShareList() && isShowing()) { dismiss(); } } } }
[ "whatelsecani@gmail.com" ]
whatelsecani@gmail.com
7fd77b077442fa05e20dee11505ab333bf6f0214
7ed352d4e5379ffa16f6a92abcc7c2ddaa1df99b
/MyCheckBoxApp/app/src/androidTest/java/com/example/lenovo/mycheckboxapp/ExampleInstrumentedTest.java
acd9abb5e7c6713149171c4c77378ab126d9fdfe
[]
no_license
kunalkhr001/Android-Samples
10ce863d3ae55eac3e306874a9bbd53ccc088e87
a61998c6b9eb966a4204292fa8fdd7792c3e85dc
refs/heads/master
2020-03-16T03:28:25.900828
2018-05-07T11:05:03
2018-05-07T11:05:03
132,488,277
0
0
null
null
null
null
UTF-8
Java
false
false
768
java
package com.example.lenovo.mycheckboxapp; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.lenovo.mycheckboxapp", appContext.getPackageName()); } }
[ "kunalkhr001@gmail.com" ]
kunalkhr001@gmail.com
e4e4366c7bbe341a017ff653d7bb17f2abc38b77
94243e15cfe9cccdf3638d53527fa58327efac29
/habeascorpus_tokens/apache-maven-3.0.4/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProcessor.java
23fcb4d80707a5d46d6e795aace6f13f14f38d74
[]
no_license
habeascorpus/habeascorpus-data-withComments
4e0193450273f2d46ea9ef497746aaf93b5fc491
3a516954b42b24c93a8d1e292ff0a0907bed97ad
refs/heads/master
2021-01-20T21:53:35.264690
2015-05-22T14:59:36
2015-05-22T14:59:36
18,139,450
3
1
null
2023-03-20T11:51:26
2014-03-26T13:45:05
Java
UTF-8
Java
false
false
9,013
java
package TokenNamepackage org TokenNameIdentifier org . TokenNameDOT apache TokenNameIdentifier apache . TokenNameDOT maven TokenNameIdentifier maven . TokenNameDOT model TokenNameIdentifier model . TokenNameDOT building TokenNameIdentifier building ; TokenNameSEMICOLON /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ TokenNameCOMMENT_BLOCK Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. import TokenNameimport java TokenNameIdentifier java . TokenNameDOT io TokenNameIdentifier io . TokenNameDOT File TokenNameIdentifier File ; TokenNameSEMICOLON import TokenNameimport java TokenNameIdentifier java . TokenNameDOT io TokenNameIdentifier io . TokenNameDOT IOException TokenNameIdentifier IO Exception ; TokenNameSEMICOLON import TokenNameimport java TokenNameIdentifier java . TokenNameDOT io TokenNameIdentifier io . TokenNameDOT InputStream TokenNameIdentifier Input Stream ; TokenNameSEMICOLON import TokenNameimport java TokenNameIdentifier java . TokenNameDOT io TokenNameIdentifier io . TokenNameDOT Reader TokenNameIdentifier Reader ; TokenNameSEMICOLON import TokenNameimport java TokenNameIdentifier java . TokenNameDOT util TokenNameIdentifier util . TokenNameDOT Map TokenNameIdentifier Map ; TokenNameSEMICOLON import TokenNameimport org TokenNameIdentifier org . TokenNameDOT apache TokenNameIdentifier apache . TokenNameDOT maven TokenNameIdentifier maven . TokenNameDOT model TokenNameIdentifier model . TokenNameDOT Model TokenNameIdentifier Model ; TokenNameSEMICOLON import TokenNameimport org TokenNameIdentifier org . TokenNameDOT apache TokenNameIdentifier apache . TokenNameDOT maven TokenNameIdentifier maven . TokenNameDOT model TokenNameIdentifier model . TokenNameDOT io TokenNameIdentifier io . TokenNameDOT ModelReader TokenNameIdentifier Model Reader ; TokenNameSEMICOLON import TokenNameimport org TokenNameIdentifier org . TokenNameDOT apache TokenNameIdentifier apache . TokenNameDOT maven TokenNameIdentifier maven . TokenNameDOT model TokenNameIdentifier model . TokenNameDOT locator TokenNameIdentifier locator . TokenNameDOT ModelLocator TokenNameIdentifier Model Locator ; TokenNameSEMICOLON import TokenNameimport org TokenNameIdentifier org . TokenNameDOT codehaus TokenNameIdentifier codehaus . TokenNameDOT plexus TokenNameIdentifier plexus . TokenNameDOT component TokenNameIdentifier component . TokenNameDOT annotations TokenNameIdentifier annotations . TokenNameDOT Component TokenNameIdentifier Component ; TokenNameSEMICOLON import TokenNameimport org TokenNameIdentifier org . TokenNameDOT codehaus TokenNameIdentifier codehaus . TokenNameDOT plexus TokenNameIdentifier plexus . TokenNameDOT component TokenNameIdentifier component . TokenNameDOT annotations TokenNameIdentifier annotations . TokenNameDOT Requirement TokenNameIdentifier Requirement ; TokenNameSEMICOLON @ TokenNameAT Component TokenNameIdentifier Component ( TokenNameLPAREN role TokenNameIdentifier role = TokenNameEQUAL ModelProcessor TokenNameIdentifier Model Processor . TokenNameDOT class TokenNameclass ) TokenNameRPAREN public TokenNamepublic class TokenNameclass DefaultModelProcessor TokenNameIdentifier Default Model Processor implements TokenNameimplements ModelProcessor TokenNameIdentifier Model Processor { TokenNameLBRACE @ TokenNameAT Requirement TokenNameIdentifier Requirement private TokenNameprivate ModelLocator TokenNameIdentifier Model Locator locator TokenNameIdentifier locator ; TokenNameSEMICOLON @ TokenNameAT Requirement TokenNameIdentifier Requirement private TokenNameprivate ModelReader TokenNameIdentifier Model Reader reader TokenNameIdentifier reader ; TokenNameSEMICOLON public TokenNamepublic DefaultModelProcessor TokenNameIdentifier Default Model Processor setModelLocator TokenNameIdentifier set Model Locator ( TokenNameLPAREN ModelLocator TokenNameIdentifier Model Locator locator TokenNameIdentifier locator ) TokenNameRPAREN { TokenNameLBRACE this TokenNamethis . TokenNameDOT locator TokenNameIdentifier locator = TokenNameEQUAL locator TokenNameIdentifier locator ; TokenNameSEMICOLON return TokenNamereturn this TokenNamethis ; TokenNameSEMICOLON } TokenNameRBRACE public TokenNamepublic DefaultModelProcessor TokenNameIdentifier Default Model Processor setModelReader TokenNameIdentifier set Model Reader ( TokenNameLPAREN ModelReader TokenNameIdentifier Model Reader reader TokenNameIdentifier reader ) TokenNameRPAREN { TokenNameLBRACE this TokenNamethis . TokenNameDOT reader TokenNameIdentifier reader = TokenNameEQUAL reader TokenNameIdentifier reader ; TokenNameSEMICOLON return TokenNamereturn this TokenNamethis ; TokenNameSEMICOLON } TokenNameRBRACE public TokenNamepublic File TokenNameIdentifier File locatePom TokenNameIdentifier locate Pom ( TokenNameLPAREN File TokenNameIdentifier File projectDirectory TokenNameIdentifier project Directory ) TokenNameRPAREN { TokenNameLBRACE return TokenNamereturn locator TokenNameIdentifier locator . TokenNameDOT locatePom TokenNameIdentifier locate Pom ( TokenNameLPAREN projectDirectory TokenNameIdentifier project Directory ) TokenNameRPAREN ; TokenNameSEMICOLON } TokenNameRBRACE public TokenNamepublic Model TokenNameIdentifier Model read TokenNameIdentifier read ( TokenNameLPAREN File TokenNameIdentifier File input TokenNameIdentifier input , TokenNameCOMMA Map TokenNameIdentifier Map < TokenNameLESS String TokenNameIdentifier String , TokenNameCOMMA ? TokenNameQUESTION > TokenNameGREATER options TokenNameIdentifier options ) TokenNameRPAREN throws TokenNamethrows IOException TokenNameIdentifier IO Exception { TokenNameLBRACE return TokenNamereturn reader TokenNameIdentifier reader . TokenNameDOT read TokenNameIdentifier read ( TokenNameLPAREN input TokenNameIdentifier input , TokenNameCOMMA options TokenNameIdentifier options ) TokenNameRPAREN ; TokenNameSEMICOLON } TokenNameRBRACE public TokenNamepublic Model TokenNameIdentifier Model read TokenNameIdentifier read ( TokenNameLPAREN Reader TokenNameIdentifier Reader input TokenNameIdentifier input , TokenNameCOMMA Map TokenNameIdentifier Map < TokenNameLESS String TokenNameIdentifier String , TokenNameCOMMA ? TokenNameQUESTION > TokenNameGREATER options TokenNameIdentifier options ) TokenNameRPAREN throws TokenNamethrows IOException TokenNameIdentifier IO Exception { TokenNameLBRACE return TokenNamereturn reader TokenNameIdentifier reader . TokenNameDOT read TokenNameIdentifier read ( TokenNameLPAREN input TokenNameIdentifier input , TokenNameCOMMA options TokenNameIdentifier options ) TokenNameRPAREN ; TokenNameSEMICOLON } TokenNameRBRACE public TokenNamepublic Model TokenNameIdentifier Model read TokenNameIdentifier read ( TokenNameLPAREN InputStream TokenNameIdentifier Input Stream input TokenNameIdentifier input , TokenNameCOMMA Map TokenNameIdentifier Map < TokenNameLESS String TokenNameIdentifier String , TokenNameCOMMA ? TokenNameQUESTION > TokenNameGREATER options TokenNameIdentifier options ) TokenNameRPAREN throws TokenNamethrows IOException TokenNameIdentifier IO Exception { TokenNameLBRACE return TokenNamereturn reader TokenNameIdentifier reader . TokenNameDOT read TokenNameIdentifier read ( TokenNameLPAREN input TokenNameIdentifier input , TokenNameCOMMA options TokenNameIdentifier options ) TokenNameRPAREN ; TokenNameSEMICOLON } TokenNameRBRACE } TokenNameRBRACE
[ "dma@cs.cmu.edu" ]
dma@cs.cmu.edu
7f394e9010446e4dfb120fe2a3088d34760f7f0e
4f1bca344c8887c150adb1f7fdcb9f1c17d8c658
/src/main/java/com/spb/StrangersPlayBackend/service/AdvertisementService.java
eae00f7bb632674404f1a054e2d8ccf1522462f8
[]
no_license
209278/StrangersPlayBackend
adc1a9a86dcdcf440037b0509499384a14642f33
30c27bcbaae0b43d629f23e6669dda9bd2a4c613
refs/heads/master
2023-04-28T12:15:14.848913
2019-11-13T13:41:42
2019-11-13T13:41:42
212,407,732
0
0
null
2023-04-14T17:54:24
2019-10-02T18:02:15
Java
UTF-8
Java
false
false
506
java
package com.spb.StrangersPlayBackend.service; import com.spb.StrangersPlayBackend.dto.AdvertisementDto; import com.spb.StrangersPlayBackend.dto.AdvertisementSimpleResponse; import com.spb.StrangersPlayBackend.model.AdvertisementModel; import java.util.List; public interface AdvertisementService { AdvertisementModel addNewAdvertisement(AdvertisementDto advertisementDto); AdvertisementDto getAdvertisementDetails(int id); List<AdvertisementSimpleResponse> getListOfAllAdvertisement(); }
[ "209420@edu.p.lodz.pl" ]
209420@edu.p.lodz.pl
4662c3cccc3f303c05e8915eaf160a4e64a2d757
c841d1c028e0b2a2abccb5d3ee55d294b2615281
/src/main/java/com/metty/rpc/handler/RequestHandler.java
cb25e46b3089999f0e9c60fe1f8dc6b443dfbc29
[]
no_license
whywhy24/Metty
a1825b57ea31f8254d1e1b0a6abcba2723e67a4e
0a6de54bb2027f9eb41837d5e502288a99e266b5
refs/heads/master
2021-05-02T09:02:33.127738
2016-11-09T06:45:55
2016-11-09T06:45:55
72,826,587
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
package com.metty.rpc.handler; import com.metty.rpc.netty.Server; import io.netty.channel.Channel; /** * Created by j_zhan on 2016/11/7. */ public interface RequestHandler<Request, Response> extends Runnable { void setServer(Server server); void setRequest(Request request); void setData(byte[] data); void setChannel(Channel channel); void setTimeStamp(long timeStamp); Response doRun() throws Exception; }
[ "672374694@qq.com" ]
672374694@qq.com
851a3886267556b4f46d57a80d679c9d9b262853
7f6f4f6185739ffd0e07e011b47d82e602705a78
/znbs/CreditArk-znbs/src/main/java/eu/ark/creditark/services/creditarkservices/enums/DtoTransformationType.java
730733a91e5bff7be3b553ec1e4c16c9914439aa
[]
no_license
spirosoorfanoswm/calegacy
6289be61f538d1f0f0050974c3e00a2631301be2
240ce55e14c996787621a74221a2960f0f9ceccf
refs/heads/master
2023-04-01T09:04:09.613237
2021-04-08T13:08:29
2021-04-08T13:08:29
354,871,804
0
0
null
null
null
null
UTF-8
Java
false
false
1,635
java
package eu.ark.creditark.services.creditarkservices.enums; public enum DtoTransformationType { CLIENT_STATISTICS_GRAPH("CLIENT_STATISTICS_GRAPH"), CLIENT_STATISTICS_VIEW("CLIENT_STATISTICS_VIEW"), CLIENT_DISTRIBUTION_VIEW("CLIENT_DISTRIBUTION_VIEW"), CUSTOMER_VIEW("CUSTOMER_VIEW"), CUSTOMER_ENTITY("CUSTOMER_ENTITY"), SCENARIOS("SCENARIOS"), SCENARIOS_MAIN_PARAMETERS("SCENARIOS_MAIN_PARAMETERS"), SCENARIOS_TO_BUS("SCENARIOS_TO_BUS"), SCENARIOS_TEMPLATE("SCENARIOS_TEMPLATE"), SCENARIOS_STATISTICS_TO_UI_STATISTICS("SCENARIOS_STATISTICS_TO_UI_STATISTICS"), SCENARIOS_MAIN_PARAMS_TRANSFORMATION("SCENARIOS_MAIN_PARAMS_TRANSFORMATION"), SCENARIOS_MAIN_PARAMS_VALIDATION("SCENARIOS_MAIN_PARAMS_VALIDATION"), SCENARIOS_MAIN_PROSPECT_VALIDATION("SCENARIOS_MAIN_PROSPECT_VALIDATION"), SCENARIOS_MAIN_CUSTOMER_VALIDATION("SCENARIOS_MAIN_CUSTOMER_VALIDATION"), SCENARIOS_MAIN_PORTFOLIO_VALIDATION("SCENARIOS_MAIN_PORTFOLIO_VALIDATION"), SCENARIOS_MAIN_PARAMS_BUSINESS_VALIDATION("SCENARIOS_MAIN_PARAMS_BUSINESS_VALIDATION"), SCENARIOS_MAIN_PROSPECT_BUSINESS_VALIDATION("SCENARIOS_MAIN_PROSPECT_BUSINESS_VALIDATION"), SCENARIOS_MAIN_CUSTOMER_BUSINESS_VALIDATION("SCENARIOS_MAIN_CUSTOMER_BUSINESS_VALIDATION"), SCENARIOS_MAIN_PORTFOLIO_BUSINESS_VALIDATION("SCENARIOS_MAIN_PORTFOLIO_BUSINESS_VALIDATION"), VALIDATION_RULE_LIST("VALIDATION_RULE_LIST"); private String id; private DtoTransformationType(String id) { this.id = id; } public String getId() { return id; } @Override public String toString() { return id; } }
[ "spiridon.orfanos@vodafone.com" ]
spiridon.orfanos@vodafone.com
f91e98ff00df768ac411936cb9ef5f1158457b8a
e5e8dbd13ac1c58c4fd92d2889effa69feba4ee1
/app/src/main/java/com/example/jackskitt/adlarcherydatalogger/Processing/Matchers/VarienceMatcher.java
a4574cd23927545c757b35440e176bb3845bf100
[]
no_license
Jacks6245/ADL
b81d1cec25021331036252d84f830a3e93acfddd
07a945667b49f5966edba03532c7948c67293927
refs/heads/master
2021-01-23T06:34:50.657709
2017-05-08T07:51:09
2017-05-08T07:51:09
86,377,260
0
0
null
null
null
null
UTF-8
Java
false
false
852
java
package com.example.jackskitt.adlarcherydatalogger.Processing.Matchers; import com.example.jackskitt.adlarcherydatalogger.Processing.SimilarityTesters.DeviationTester; /** * Created by Jack Skitt on 22/04/2017. */ public class VarienceMatcher extends EventSearch { public VarienceMatcher(int length, float lowThreshold, float highThreshold, TemplateType type) { super("VarienceMatcher"); similarityTester = new DeviationTester(this); this.lengthOfTemplate = length; this.lowThreadhold = lowThreshold; this.highThreshold = highThreshold; setType(type); } public void searchForEvent(double toAdd) { double r = similarityTester.getSimilarity(toAdd); if (r > lowThreadhold) { super.setEvent(similarityTester.start, similarityTester.end, r); } } }
[ "skittjack@gmail.com" ]
skittjack@gmail.com
be3375f450c6f4846d4b8304ed15fdff31a4d201
0d04c4968be91e828da12d1e25cb7163eb274099
/app/src/main/java/com/songwenju/androidtvstudy/data/MovieProvider.java
24c5ff6fb1bdd31c6e6a1b8ead8c59840ade5991
[]
no_license
songwenju/AndroidTVStudy
78563a940f4e15a4ecbdda8af19404feb9122f4b
bbebd67962111b2669b89a437449a3a3c3af86c7
refs/heads/master
2021-01-21T18:21:44.367768
2017-06-07T09:09:00
2017-06-07T09:09:00
92,037,742
1
0
null
null
null
null
UTF-8
Java
false
false
5,308
java
package com.songwenju.androidtvstudy.data; import com.songwenju.androidtvstudy.model.Movie; import java.util.ArrayList; public class MovieProvider { private static ArrayList<Movie> mItems = null; private MovieProvider() {} public static ArrayList<Movie> getMovieItems() { String description = "Lorem ipsum dolor sit amet, qui mundi vivendum cu. Mazim dicant possit te his. Quo solet dicant prodesset eu, pri deseruisse concludaturque ea, saepe maiorum sea et. Impetus discere sed at. Vim eu novum erant integre, te tale voluptatibus est. Facer labores te mel.\n" + "\n" + "Dictas denique qualisque mea id, cu mei verear fabellas. Mel no autem nusquam, viderer oblique te mei. At minimum corpora consulatu vim. Cibo nominavi vis no, in verterem vulputate eos, essent iriure cu vel. Ius ferri expetendis ad, omnes aeterno nominati id his, eum debitis lobortis comprehensam id.\n" + "\n" + "Illud dicit nostrud sit no. Eu quod nostro pro. Ut gubergren mnesarchum has, nostro detracto scriptorem et quo, no illud phaedrum recteque sea. Ad his summo probatus recusabo. Qui amet tale viris et, ei his quodsi torquatos adipiscing. Laudem malorum no eum, accusam mandamus sit ex, est ut tractatos dissentiet. Dictas feugiat usu et, an his cibo appareat placerat, eu quis dignissim qui.\n" + "\n" + "Euripidis neglegentur eu per, denique singulis vel cu, malis dolore ne duo. Cum no iracundia persecuti expetendis. Vim alii dolore malorum at, veniam perfecto salutandi cu nec, vix ad nonumes consulatu scripserit. At sit nonumy dolores aliquando, eu nam sumo legere. Eu maiorum adipisci torquatos his, vidit appareat eos no.\n" + "\n" + "Solet laboramus no quo, cu aperiam inermis vix. Eum animal graecis id, ne quodsi abhorreant sit. Tale persequeris te qui. Labitur invenire explicari in vix." + "Lorem ipsum dolor sit amet, qui mundi vivendum cu. Mazim dicant possit te his. Quo solet dicant prodesset eu, pri deseruisse concludaturque ea, saepe maiorum sea et. Impetus discere sed at. Vim eu novum erant integre, te tale voluptatibus est. Facer labores te mel.\n" + "\n" + "Dictas denique qualisque mea id, cu mei verear fabellas. Mel no autem nusquam, viderer oblique te mei. At minimum corpora consulatu vim. Cibo nominavi vis no, in verterem vulputate eos, essent iriure cu vel. Ius ferri expetendis ad, omnes aeterno nominati id his, eum debitis lobortis comprehensam id.\n" + "\n" + "Illud dicit nostrud sit no. Eu quod nostro pro. Ut gubergren mnesarchum has, nostro detracto scriptorem et quo, no illud phaedrum recteque sea. Ad his summo probatus recusabo. Qui amet tale viris et, ei his quodsi torquatos adipiscing. Laudem malorum no eum, accusam mandamus sit ex, est ut tractatos dissentiet. Dictas feugiat usu et, an his cibo appareat placerat, eu quis dignissim qui.\n" + "\n" + "Euripidis neglegentur eu per, denique singulis vel cu, malis dolore ne duo. Cum no iracundia persecuti expetendis. Vim alii dolore malorum at, veniam perfecto salutandi cu nec, vix ad nonumes consulatu scripserit. At sit nonumy dolores aliquando, eu nam sumo legere. Eu maiorum adipisci torquatos his, vidit appareat eos no.\n" + "\n" + "Solet laboramus no quo, cu aperiam inermis vix. Eum animal graecis id, ne quodsi abhorreant sit. Tale persequeris te qui. Labitur invenire explicari in vix."; if(mItems == null) { mItems = new ArrayList<Movie>(); Movie movie1 = new Movie(); movie1.setId(1); movie1.setTitle("Title1"); movie1.setStudio("studio1"); movie1.setDescription(description); movie1.setCardImageUrl("http://heimkehrend.raindrop.jp/kl-hacker/wp-content/uploads/2014/08/DSC02580.jpg"); //movie1.setVideoUrl("http://corochann.com/wp-content/uploads/2015/07/MVI_0949.mp4"); /* Google sample app's movie */ movie1.setVideoUrl("http://mt.lenovo.com.cn/c/292/1495509642969.mp4"); mItems.add(movie1); Movie movie2 = new Movie(); movie2.setId(2); movie2.setTitle("Title2"); movie2.setStudio("studio2"); movie2.setDescription(description); movie2.setCardImageUrl("http://heimkehrend.raindrop.jp/kl-hacker/wp-content/uploads/2014/08/DSC02630.jpg"); movie2.setVideoUrl("http://corochann.com/wp-content/uploads/2015/07/MVI_0962.mp4"); /* Google sample app's movie */ // movie2.setVideoUrl("http://2449.vod.myqcloud.com/2449_43b6f696980311e59ed467f22794e792.f20.mp4"); mItems.add(movie2); Movie movie3 = new Movie(); movie3.setId(3); movie3.setTitle("Title3"); movie3.setStudio("studio3"); movie3.setDescription(description); movie3.setCardImageUrl("http://heimkehrend.raindrop.jp/kl-hacker/wp-content/uploads/2014/08/DSC02529.jpg"); movie3.setVideoUrl("http://mt.lenovo.com.cn/c/292/1495509642969.mp4"); mItems.add(movie3); } return mItems; } }
[ "songwj2@lenovo.com" ]
songwj2@lenovo.com
a621761033cfd2aac247cc69643c4b1ad3762cb0
92185671b03a73d27fc23407cdf4d9d61f671930
/src/main/java/com/binu/proj1/repository/AddressRepository.java
80ee2ec6164cfff684ab19953df4fc963d4e0776
[]
no_license
binukp/proj1
2ed7c58dc0102be5062d9e461017cd5f2f91192d
b95d623bede9f43b41d1a9dc745857e69c94484a
refs/heads/main
2023-02-25T00:49:44.629632
2021-02-02T00:52:50
2021-02-02T00:52:50
335,096,188
0
0
null
null
null
null
UTF-8
Java
false
false
612
java
package com.binu.proj1.repository; import com.binu.proj1.entity.Address; import com.binu.proj1.entity.Person; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface AddressRepository extends JpaRepository<Address, Integer> { @Query(value = "SELECT u FROM Address u WHERE u.person = :person_id") List<Address> findAAllAddressByPersonID(@Param("person_id") Person person_id); }
[ "binu.philip@mozobi.com" ]
binu.philip@mozobi.com
c7cea41c2c951b64264b87ed2797dcef8abf8df1
c61f0ac728e113893470e4a328540f609fbcfe78
/connectors/connector-interface/src/main/java/home/abel/photohub/connector/prototype/ImageProcessingException.java
aa1383359470b8ed382666cbeba19d4c3f55999a
[]
no_license
abel-msk/photohub
cab5e23a6f201ada7334012c60c6ae7c10a2a3bf
63c0e7820420f696b495d7ef5123a73c1449f51f
refs/heads/master
2021-09-24T09:47:54.331733
2018-10-07T16:48:29
2018-10-07T16:48:29
111,151,929
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package home.abel.photohub.connector.prototype; public class ImageProcessingException extends RuntimeException { private static final long serialVersionUID = 1L; public ImageProcessingException(String message) { super(message); } public ImageProcessingException(String message, Exception e) { super(message, e); } public ImageProcessingException(Exception e) { super(e.getMessage(), e); } }
[ "Artem.Belyaev@gmail.com" ]
Artem.Belyaev@gmail.com
182a6d37c5e49278c82392e616d5ca64273fb360
883f7a747d79563ccaa4abffa4a2d1522f3d4e5a
/src/main/java/service/StudentService.java
979e67d0fb96a67ae9419ae0b765c326b0ea379a
[]
no_license
YangXiangFeng/SSMProject_StudengManagerSystem
8dd250a08c255b218c21ea24efff1b55267114d4
b8821f32f0a9dd6972d883c9f287f5c106535642
refs/heads/master
2022-12-24T00:43:37.092440
2019-11-19T13:55:56
2019-11-19T13:55:56
222,225,537
0
0
null
2022-12-16T14:50:55
2019-11-17T09:36:09
CSS
GB18030
Java
false
false
815
java
package service; import pojo.Page; import pojo.Student; import java.util.List; import java.util.Map; /* * 一个dao就有一个service,这是最基本的,dao只是最基本的操作 * 然后要想做复杂的业务,比如分页,要多写业务 * */ public interface StudentService { // 新增学生 public void insertStudent(Student student); // 根据id删除学生 public void deleteStudentById(int id); //更新学生信息 public void updateStudentNameById(Map map); //查询所有学生 public List<Student> queryStudent(); Student queryStudentById(int id); List<Student> queryStudentByPage(int page); List<Student> getStudentListByPage(Map map); int getTotalNumber(); void updateStudentById(Student student); }
[ "1195653706@qq.com" ]
1195653706@qq.com
62697500554ec23c10cd22cd43a59bc84b8cabe3
4433ef114291f45d3e0bc60ba85f307cfc465cab
/Bedezup/src/com/tams/bedezup/domain/FolderDTO.java
dd4ea2b42e7d9154e658325996b9143c970a5159
[]
no_license
shaiful-hisham/Bedezup-Backend
6632c73bc3a56f97b35a8ea3bb1a0fd87e81afa6
1ba957320db849edc35c9fc5f8566c4f097d5ebf
refs/heads/master
2021-01-20T16:10:04.231672
2017-05-13T05:55:57
2017-05-13T05:55:57
90,821,740
0
0
null
null
null
null
UTF-8
Java
false
false
1,024
java
/** * Sencha GXT 3.0.1 - Sencha for GWT * Copyright(c) 2007-2012, Sencha, Inc. * licensing@sencha.com * * http://www.sencha.com/products/gxt/license/ */ package com.tams.bedezup.domain; import java.util.ArrayList; public class FolderDTO extends BaseDTO implements FolderDTOInterface { private static final long serialVersionUID = 1L; private ArrayList <BaseDTO> children = new ArrayList <BaseDTO>(); public FolderDTO() { super(); } public FolderDTO(Long id, String name) { super(id, name); } public ArrayList <BaseDTO> getChildren() { return children; } public void setChildren(ArrayList <BaseDTO> children) { this.children = children; } public void addChild(BaseDTO child) { getChildren().add(child); } @Override public String toString() { StringBuffer sb = new StringBuffer(); if (children != null && !children.isEmpty()) { for (BaseDTO base : children) { sb.append("\n" + base.toString()); } } return sb.toString(); } }
[ "shaiful.hisham@outlook.com" ]
shaiful.hisham@outlook.com
ba5a60f1c1a49b055b1785ef14a6a42259835cdb
88e07073034a20afe6d49cca1f36bcd059610038
/src/main/java/com/example/base/service/impl/OrderQueryServiceImpl.java
52f74f0e7958af7649e84c8d9dd9a116462c71f3
[]
no_license
marianorapa/tsoft-cqrs-1
f4e22ae746fc125c9b4eea138b7343355be8b98e
939bd818e8c7639a733886ad587c851ac7d8b888
refs/heads/master
2022-12-09T13:33:04.052337
2020-09-11T20:35:41
2020-09-11T20:35:41
294,732,485
0
0
null
null
null
null
UTF-8
Java
false
false
1,084
java
package com.example.base.service.impl; import com.example.base.dto.OrdersUserSummaryDto; import com.example.base.entity.Order; import com.example.base.repository.OrderRepository; import com.example.base.service.OrderQueryService; import com.example.base.service.UserQueryService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class OrderQueryServiceImpl implements OrderQueryService { @Autowired private OrderRepository orderRepository; @Autowired private UserQueryService userQueryService; @Override public OrdersUserSummaryDto getOrdersSummaryByUser(Long userId) { OrdersUserSummaryDto ordersUserSummaryDto = new OrdersUserSummaryDto(); ordersUserSummaryDto.setUserName(userQueryService.getUserNameById(userId)); Double totalAmt = orderRepository.findByUserId(userId) .stream().map(Order::getTotalAmt).reduce((double) 0, Double::sum); ordersUserSummaryDto.setTotalAmt(totalAmt); return ordersUserSummaryDto; } }
[ "marianorapaport@gmail.com" ]
marianorapaport@gmail.com
1ef9b91edd03fa5b13cfb167cdf57ea348fcde42
4f421650a66c37ca0cd595593d20ea1410a4aebe
/src/main/java/com/mvcweb/base/CommonUtils.java
c0acd24aad7aa22eb1b71b3b77ba8a557a450c56
[]
no_license
1031493914/kugooadmin-idea
0e8dae9e08eacf0331a45a34ae390c71c3e7ebdd
d862ac3a90d57c42ce262bcb230f1d52f5a35f6d
refs/heads/master
2022-12-24T21:56:57.147291
2020-03-10T06:43:49
2020-03-10T06:43:49
246,208,065
0
0
null
2022-12-16T01:21:46
2020-03-10T04:27:54
JavaScript
UTF-8
Java
false
false
22,467
java
package com.mvcweb.base; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Calendar; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; /** * The common operation utilities. * Including string operation, date operation, collection operation, array operation, and etc. * * @author Xiufeng.Bao */ public class CommonUtils { /** The empty String */ public static final String EMPTY = ""; /** The comma String */ public static final String COMMA = ","; /** The percent String */ private static final String PERCENT = "%"; /** The Get String */ private static final String GET = "get"; /** The Set String */ private static final String SET = "set"; /** The filling string */ private static final String TRUNCATE_FILLING = "..."; /** The default date format */ public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; /** The default time format */ public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss"; /** The default datetime format */ public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; /** The default datetime formator */ public static final SimpleDateFormat DEFAULT_DTF = new SimpleDateFormat(DEFAULT_DATETIME_FORMAT); /** * Checks if a Object is null or empty. * * @param o The Object to check, may be null * @return true if the Object is null or empty */ public static boolean isNull(Object o) { return (o == null || o.toString().length() == 0); } /** * Checks if a Object is not null and not empty. * * @param o The Object to check, may be null * @return true if the Object is not null and not empty */ public static boolean isNotNull(Object o) { return !isNull(o); } /** * Checks if a String is empty or null. * * @param str The String to check, may be null * @return true if the String is empty or null */ public static boolean isEmpty(String str) { return (str == null || str.trim().length() == 0); } /** * Checks if a String is not empty and not null. * * @param str The String to check, may be null * @return true if the String is not empty and not null */ public static boolean isNotEmpty(String str) { return !isEmpty(str); } /** * Checks if a array is null or empty. * * @param objects Object array * @return true if The array is null or empty */ public static boolean isEmpty(Object[] objects) { return (objects == null || objects.length == 0); } /** * Checks if a array is not null and not empty. * * @param objects Object array * @return true if The array is not null and not empty */ public static boolean isNotEmpty(Object[] objects) { return !isEmpty(objects); } /** * Checks if a Collection is null or empty. * * @param objects Object list * @return true if The Collection is null or empty */ public static boolean isEmpty(Collection<? extends Object> objects) { return (objects == null || objects.isEmpty()); } /** * Checks if a Collection is not null and not empty. * * @param objects Object list * @return true if The Collection is not null and not empty */ public static boolean isNotEmpty(Collection<? extends Object> objects) { return !isEmpty(objects); } /** * Removes control characters (char &lt;= 32) from both ends of this String. * Returning an empty String ("") if the String is empty ("") after the trim or if it is null. * * @param str The String to be trimmed, may be null * @return The trimmed String, or an empty String if null input */ public static String trimToEmpty(String str) { return (str == null ? EMPTY : str.trim()); } /** * Removes control characters (char &lt;= 32) from both ends of this String. * Returning null if the String is empty ("") after the trim or if it is null. * * @param str The String to be trimmed, may be null * @return The trimmed String, null if only chars &lt;= 32, empty or null String input */ public static String trimToNull(String str) { String trimStr = trim(str); return (trimStr == null || trimStr.length() == 0 ? null : trimStr); } /** * Gets the current date String by given optional date format. * * @param format Optional date format * @return Formatted current date String */ public static String getCurrentDate(String... format) { if (format.length == 1) { SimpleDateFormat df = new SimpleDateFormat(format[0]); return df.format(new Date()); } return DEFAULT_DTF.format(new Date()); } /** * Converts the given String to date by given optional date format. * * @param str The String to be converted * @param format Optional date format * @return Converted date */ public static Date stringToDate(String str, String... format) { SimpleDateFormat df = (format.length == 1 ? new SimpleDateFormat( format[0]) : DEFAULT_DTF); try { return df.parse(str); } catch (Exception e) { return null; } } /** * Converts the given Date to date String by given optional date format. * * @param d The Date to be converted * @param format Optional date format * @return Converted date String */ public static String dateToString(Date d, String... format) { SimpleDateFormat df = (format.length == 1 ? new SimpleDateFormat( format[0]) : DEFAULT_DTF); try { return df.format(d); } catch (Exception e) { return null; } } /** * Adds percent character around the given String. * Insert position: Before and After the given String. * * @param value The String to be inserted * @return Inserted String */ public static String addBAPercent(String value) { if (isEmpty(value)) return EMPTY; return new StringBuffer().append(PERCENT).append(value.trim()).append(PERCENT).toString(); } /** * Adds percent character around the given String. * Insert position: After the given String. * * @param value The String to be inserted * @return Inserted String */ public static String addAPercent(String value) { if (isEmpty(value)) return EMPTY; return new StringBuffer().append(value.trim()).append(PERCENT).toString(); } /** * Splits the given String to String list by given split character. * * @param str The String to be splited * @param split The split character * @return Splited String list */ public static List<String> stringToList(String str, String split) { if (isEmpty(str)) return null; return Arrays.asList(str.split(split)); } /** * Splits the given String to String array by given split character. * * @param str The String to be splited * @param split The split character * @return Splited String array */ public static String[] stringToArray(String str, String split) { if (isEmpty(str)) return null; return str.split(split); } /** * Concats the given String list to String by given connector character. * The default connector is comma (,) character. * * @param str The String list to be concatted * @param connector The connector character * @return Concatted String */ public static String listToString(List<String> strings, String... connector) { if (isEmpty(strings)) return EMPTY; StringBuilder s = new StringBuilder(); int size = strings.size(); String c = (connector.length == 0 ? COMMA : connector[0]); for (int i = 0; i < size; i++) { s.append(strings.get(i)); if (i < size - 1) s.append(c); } return s.toString(); } /** * Concats the given String list to String by given connector character. * The aliasMap is the String list's alias mapping table. * The default connector is comma (,) character. * This method generally be used to concat the SELECT columns SQL. * * @param str The String list to be concatted * @param aliasMap The String list's alias mapping table * @param connector The connector character * @return Concatted String */ public static String listToString(List<String> strings, Map<String, String> aliasMap, String... connector) { if (isEmpty(strings)) return EMPTY; if (aliasMap == null) aliasMap = new HashMap<String, String>(); StringBuilder s = new StringBuilder(); int size = strings.size(); String c = (connector.length == 0 ? COMMA : connector[0]); String str = null; for (int i = 0; i < size; i++) { str = strings.get(i); if (aliasMap.containsKey(str)) { s.append(aliasMap.get(str)).append(" AS \"").append(str).append("\""); } else { s.append(str); } if (i < size - 1) s.append(c); } return s.toString(); } /** * Concats the given String array to String by given connector character. * The default connector is comma (,) character. * * @param str The String array to be concatted * @param connector The connector character * @return Concatted String */ public static String arrayToString(String[] strings, String... connector) { if (isEmpty(strings)) return EMPTY; StringBuilder s = new StringBuilder(); int length = strings.length; String c = (connector.length == 0 ? COMMA : connector[0]); for (int i = 0; i < length; i++) { s.append(strings[i]); if (i < length - 1) s.append(c); } return s.toString(); } /** * Concats the given String array. * * @param strings The concatted String array * @return Concatted String */ public static String concatStr(String... strings) { StringBuffer s = new StringBuffer(); for (String str : strings) { s.append(str); } return s.toString(); } /** * Parses the given Object to int. * * @param o The Object to be parsed * @return Parsed int value */ public static int parseInt(Object o) { if (o != null) { String s = trimToNull(o.toString()); if (s != null) { try { return Integer.parseInt(s); } catch (NumberFormatException e) {} } } return 0; } /** * Parses the given Object to long. * * @param o The Object to be parsed * @return Parsed long value */ public static long parseLong(Object o) { if (o != null) { String s = trimToNull(o.toString()); if (s != null) { try { return Long.parseLong(s); } catch (NumberFormatException e) {} } } return 0L; } /** * Parses the given Object to float. * * @param o The Object to be parsed * @return Parsed float value */ public static float parseFloat(Object o) { if (o != null) { String s = trimToNull(o.toString()); if (s != null) { try { return Float.parseFloat(s); } catch (NumberFormatException e) {} } } return 0.0F; } /** * Parses the given Object to double. * * @param o The Object to be parsed * @return Parsed double value */ public static double parseDouble(Object o) { if (o != null) { String s = trimToNull(o.toString()); if (s != null) { try { return Double.parseDouble(s); } catch (NumberFormatException e) {} } } return 0.0; } /** * Capitalizes a String changing the first letter to title case. * No other letters are changed. * * @param str The String to capitalize, may be null * @return The capitalized String, null if null String input */ public static String capitalize(String str) { int length; if (str == null || (length = str.length()) == 0) return str; return new StringBuffer(length) .append(Character.toTitleCase(str.charAt(0))) .append(str.substring(1)).toString(); } /** * Uncapitalizes a String changing the first letter to title case. * No other letters are changed. * * @param str The String to uncapitalize, may be null * @return The uncapitalized String, null if null String input */ public static String uncapitalize(String str) { int length; if (str == null || (length = str.length()) == 0) return str; return new StringBuffer(length) .append(Character.toLowerCase(str.charAt(0))) .append(str.substring(1)).toString(); } /** * Gets the field name from the Get/Set method. * * @param str The Get/Set method name * @return The filed name */ public static String fetchFieldName(String str) { if (str == null || str.trim().length() <= 3) return EMPTY; return uncapitalize(str.trim().substring(3)); } /** * Judges the Get method. * * @param str The judged method name * @return true if the method is a get method */ public static boolean isGetMethod(String str) { if (str != null && str.startsWith(GET)) return true; return false; } /** * Judges the Set method. * * @param str The judged method name * @return true if the method is a set method */ public static boolean isSetMethod(String str) { if (str != null && str.startsWith(SET)) return true; return false; } /** * Truncates the given String to the given max length. * * @param str The String to be truncated * @param maxLength The max length to be truncated * @return Truncated String */ public static String truncateStr(String str, int maxLength) { if (str != null && str.length() > maxLength) { return str.substring(0, maxLength) + TRUNCATE_FILLING; } return str; } /** * Truncates the given String util the given suffix. * The given suffix is excluded. * * @param str The String to be truncated * @param subffix The suffix to be truncated * @return Truncated String */ public static String truncateStr(String str, String subffix) { return str.substring(0, str.indexOf(subffix)); } /** * Judges the same Objects. * * @param o1 The judged Object o1 * @param o2 The judged Object o2 * @return true if the given two Objects is same */ public static boolean isSame(Object o1, Object o2) { String s1 = nullToEmpty(o1); String s2 = nullToEmpty(o2); return s1.equals(s2); } /** * Compares two Strings, returning true if they are equal. * * @param one The first String * @param two The second String * @return true(if they are equal, case sensitive, or both are null) */ public static boolean equals(String one, String two) { return (one == null ? two == null : one.equals(two)); } /** * Compares two Strings, returning true if they are equal ignoring the case. * * @param one The first String * @param two The second String * @return true(if they are equal, case insensitive, or both are null) */ public static boolean equalsIgnoreCase(String one, String two) { return (one == null ? two == null : one.equalsIgnoreCase(two)); } /** * Checks if the String contains only unicode letters. * * @param str The String to check * @return true(if only contains letters, and is not null) */ public static boolean isAlpha(String str) { if (str == null) { return false; } int strLength = str.length(); for (int i = 0; i < strLength; i++) { if (Character.isLetter(str.charAt(i)) == false) { return false; } } return true; } /** * Checks if the String contains only digits. * @param str The String to check * @return true(if only contains digits, and is not null) */ public static boolean isNumeric(String str) { if (str == null) { return false; } int strLength = str.length(); for (int i = 0; i < strLength; i++) { if (Character.isDigit(str.charAt(i)) == false) { return false; } } return true; } /** * Checks if the String contains only unicode letters or digits. * * @param str The String to check * @return true(if only contains unicode letters or digits, and is not null) */ public static boolean isAlphanumeric(String str) { if (str == null) { return false; } int strLength = str.length(); for (int i = 0; i < strLength; i++) { if (Character.isLetterOrDigit(str.charAt(i)) == false) { return false; } } return true; } /** * Removes control characters (char <= 32) from both ends of the String. * Returning null if the String is null. * * @param str The String to be trimmed * @return The trimmed String */ public static String trim(String str) { return (str == null ? null : str.trim()); } /** * Converts null to empty String if the Object is null.. * * @param value The Object to be converted * @return The converted String */ public static String nullToEmpty(Object value) { return (value == null ? EMPTY : value.toString()); } /** * Gets the leftmost len characters of a String. * * @param str The String to get the leftmost characters from. * @param len The lenght of the required String, must be zero or positive * @return The leftmost len characters */ public static String left(String str, int len) { if (str == null) return null; if (len < 0) return EMPTY; if (str.length() < len) { return str; } else { return str.substring(0, len); } } /** * Gets the rightmost len characters of a String. * * @param str The String to get the rightmost characters from. * @param len The lenght of the required String, must be zero or positive * @return The rightmost len characters */ public static String right(String str, int len) { if (str == null) return null; if (len < 0) return EMPTY; if (str.length() < len) { return str; } else { return str.substring(str.length() - len); } } /** * 给指定字符串补充指定长度的半角空格字符. * * @param content 待补充的字符串 * @param totalLength 补充长度 * @return 补充后的字符串 */ public static String addSpace(String content, int totalLength) { String space = " "; if (totalLength < 1) { return content; } if ((null == content) || (EMPTY.equals(content))) { return space; } if (totalLength < content.length()) { return content; } content += space.substring(0, totalLength - content.length()); return content; } /** * Gets the start time at the given date. * * @param d The given date * @return The start time */ public static Date getMinTime(Date d) { Calendar c = Calendar.getInstance(); c.setTime(d); c.set(Calendar.HOUR, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); return c.getTime(); } /** * Gets the end time at the given date. * * @param d The given date * @return The end time */ public static Date getMaxTime(Date d) { Calendar c = Calendar.getInstance(); c.setTime(d); c.add(Calendar.DAY_OF_MONTH, 1); c.add(Calendar.SECOND, -1); return c.getTime(); } /** * Calculates the time difference by given two dates. * The time difference unit is seconds. * * @param d1 The given date d1 * @param d2 The given date d2 * @return Calculated the time difference */ public static long dateDifference(Date d1, Date d2) { return (d2.getTime() - d1.getTime()) / 1000; } /** * Converts the given binary String to byte. * * @param s The converted binary String * @return Converted byte value */ public static byte stringToByte(String s) { try { Integer.parseInt(s); } catch (Exception e) { return 0; } char c; int m = 0; for (int i = 0, len = s.length(); i < len; i++) { c = s.charAt(i); if (c == '1') { m += (1 << (len - i - 1)); } } return (byte) m; } /** * Converts the given byte to binary String. * * @param b The converted byte * @param len The converted String length * @return String Converted String */ public static String byteToString(byte b, int len) { int i = b & 0xFF; return toBinaryInt(i, len); } /** * Converts the given int to binary String. * * @param i The converted int value * @param len The converted String length * @return Converted binary String */ private static String toBinaryInt(int i, int len) { StringBuilder s = new StringBuilder(); for (int j = 0; j < len; j++) { s.append("0"); } DecimalFormat df = new DecimalFormat(s.toString()); int out = Integer.parseInt(Integer.toBinaryString(i)); return df.format(out); } /** * Prints the given exception's stack track. * * @param e The given exception * @return The exception stack track */ public static String printStackTrack(Exception e) { StringBuffer errSb = new StringBuffer(); errSb.append(e.toString()); errSb.append("\r\n"); StackTraceElement[] ee = e.getStackTrace(); for (int i = 0; i < ee.length; i++) { errSb.append("\tat "); errSb.append(ee[i].toString()); errSb.append("\r\n"); } return errSb.toString(); } }
[ "jiangxu123" ]
jiangxu123
252151e7be840d15a704e510d60600cb4bf8d332
d573b8c79f7be22043de9579039700d2989cdc39
/de.fxdiagram.lib/xtend-gen/de/fxdiagram/lib/simple/OpenDiagramCommand.java
abb94f3d008decf3817814090237426ac18dde43
[]
no_license
nagyistge/FXDiagram
1200c917663a0eb58868c75e74f1b44fb71b95d3
f8386bfb6343ba4d009d2111b9e1e56ab45bd581
refs/heads/master
2021-01-25T08:12:39.447472
2017-05-10T17:34:25
2017-05-10T17:34:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,257
java
package de.fxdiagram.lib.simple; import de.fxdiagram.core.command.AnimationCommand; import de.fxdiagram.core.command.CommandContext; import de.fxdiagram.lib.simple.OpenableDiagramNode; import javafx.animation.Animation; import javafx.util.Duration; @SuppressWarnings("all") public class OpenDiagramCommand implements AnimationCommand { private OpenableDiagramNode host; public OpenDiagramCommand(final OpenableDiagramNode host) { this.host = host; } @Override public Animation getExecuteAnimation(final CommandContext context) { Duration _defaultExecuteDuration = context.getDefaultExecuteDuration(); return this.host.openDiagram(_defaultExecuteDuration); } @Override public Animation getUndoAnimation(final CommandContext context) { Duration _defaultUndoDuration = context.getDefaultUndoDuration(); return this.host.closeDiagram(_defaultUndoDuration); } @Override public Animation getRedoAnimation(final CommandContext context) { Duration _defaultUndoDuration = context.getDefaultUndoDuration(); return this.host.openDiagram(_defaultUndoDuration); } @Override public boolean clearRedoStackOnExecute() { return true; } @Override public void skipViewportRestore() { } }
[ "jan.koehnlein@itemis.de" ]
jan.koehnlein@itemis.de
b6f0baf1df90729a47b9a3dee11e81ea1717533c
d951ae3dee516bec82aa04f0e5e042cd065827b5
/code/NCases.java
b283be0b1050690104b6be6fb5b4557c5fa412ed
[]
no_license
wellthathappened/COP4516_HackPack
4540508c7d938b59a9196ca1ff5d90bd19b00996
37759d80c28b0af3a54a9550be88d59c818aa68a
refs/heads/master
2020-03-12T07:40:45.366749
2018-04-30T07:08:03
2018-04-30T07:08:03
130,511,306
2
0
null
null
null
null
UTF-8
Java
false
false
245
java
import java.util.*; public class NCases { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i = 0;i < n;i++) { // Solution code goes here } } }
[ "iansmac@github.com" ]
iansmac@github.com
db657370b2445cea0ce258304b5f9266d89be111
1aaa4071584a75a6b36e7f2ded5b2e065e087779
/Android/app/src/main/java/com/futech/our_school/utils/request/ApiHelper.java
9943b53624cf8be4624179c2c88809984bee56c4
[]
no_license
abolfazlalz/Our-School
c88c8239c86378d23bca05227013b073c9a42f1d
8d42c62c7c82dda00d2f9b0387c2bd324d460878
refs/heads/master
2023-08-27T11:59:08.287467
2020-08-21T04:47:19
2020-08-21T04:47:19
296,353,111
3
0
null
null
null
null
UTF-8
Java
false
false
1,025
java
package com.futech.our_school.utils.request; import android.content.Context; import com.futech.our_school.Application; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; public class ApiHelper<T> { private Context context; private String apiAddress; private final Type type; private String tag; public ApiHelper(Context context, String apiAddress, Type type) { this.context = context; this.apiAddress = apiAddress; this.type = type; this.tag = "ApiHelper"; } protected Context getContext() { return this.context; } private Type getType() { return type; } public ApiControl<T> getApiControl(String requestName) { return new ApiControl<T>(getContext(), apiAddress, getType(), tag).setRequest(requestName); } public void setTag(String tag) { this.tag = tag; } public void cancel() { Application.getRequestQueue().cancelAll(tag); } }
[ "mrabolfazlalz@outlook.com" ]
mrabolfazlalz@outlook.com
c22d679595b18f7f900f8f491a4c1c63bc88ceaf
3f2aec9f3063737e608cc637598efde392994f97
/Generic/src/main/java/base/CommonAPI.java
16885f2a2b84b83ca7a7cd38b7eef27c1c4ce317
[]
no_license
khoyer123/WebAutomationBestBuy
c82bbbad85810a32f4364c7c7fcfa0d6722250e7
efaa08ece61f4e019ca21e5da3199475a3ebe77b
refs/heads/master
2022-07-05T22:58:53.524422
2019-10-27T22:27:33
2019-10-27T22:27:33
217,924,914
0
0
null
2021-04-26T19:37:15
2019-10-27T22:27:26
Java
UTF-8
Java
false
false
12,438
java
package base; import com.relevantcodes.extentreports.ExtentReports; import com.relevantcodes.extentreports.LogStatus; import org.apache.commons.io.FileUtils; import org.openqa.selenium.*; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.ITestContext; import org.testng.ITestResult; import org.testng.annotations.*; import report.ExtentManager; import report.ExtentTestManager; import java.io.File; import java.io.PrintWriter; import java.io.StringWriter; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.concurrent.TimeUnit; public class CommonAPI { public static WebDriver driver; public static ExtentReports extent; public static String sauceUserName = ""; public static String sauceKey = ""; public static String browserStackUserName = ""; public static String browserStackKey = ""; //http:// + username + : + key + specific url for cloud public static String SAUCE_URL = "http://" + sauceUserName + ":" + sauceKey + "@ondemand.saucelabs.com:80/wd/hub"; public static String BROWERSTACK_URL = "http://" + browserStackUserName + ":" + browserStackKey + "@hub-cloud.browserstack.com:80/wd/hub"; /** * @param platform - * @param url - * @param browser - * @param cloud - * @param browserVersion - * @param envName - * @return * @throws MalformedURLException * @Parameters - values are coming from the runner.xml file of the project modules */ @Parameters({"platform", "url", "browser", "cloud", "browserVersion", "envName"}) @BeforeMethod public static WebDriver setupDriver(String platform, String url, String browser, boolean cloud, String browserVersion, String envName) throws MalformedURLException { if (cloud) { driver = getCloudDriver(browser, browserVersion, platform, envName); } else { driver = getLocalDriver(browser, platform); } driver.get(url); return driver; } /** * @param browser the browser you want to execute your test case * @param platform in the operating system you want to execute your test case * @return WebDriver Object */ public static WebDriver getLocalDriver(String browser, String platform) { //chrome popup ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("disable-infobars"); if (platform.equalsIgnoreCase("mac") && browser.equalsIgnoreCase("chrome")) { System.setProperty("webdriver.chrome.driver", "../Generic/src/main/resources/chromedriver"); driver = new ChromeDriver(chromeOptions); } else if (platform.equalsIgnoreCase("windows") && browser.equalsIgnoreCase("chrome")) { System.setProperty("webdriver.chrome.driver", "../Generic/src/main/resources/chromedriver.exe"); driver = new ChromeDriver(chromeOptions); } else if (platform.equalsIgnoreCase("mac") && browser.equalsIgnoreCase("firefox")) { System.setProperty("webdriver.gecko.driver", "../Generic/src/main/resources/geckodriver"); driver = new FirefoxDriver(); } else if (platform.equalsIgnoreCase("windows") && browser.equalsIgnoreCase("firefox")) { System.setProperty("webdriver.gecko.driver", "../Generic/src/main/resources/geckodriver.exe"); driver = new FirefoxDriver(); } driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS); driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); driver.manage().window().maximize(); return driver; } public static WebDriver getCloudDriver(String browser, String browserVersion, String platform, String envName) throws MalformedURLException { DesiredCapabilities desiredCapabilities = new DesiredCapabilities(); desiredCapabilities.setCapability("name", "Cloud Execution"); desiredCapabilities.setCapability("browserName", browser); desiredCapabilities.setCapability("browser_version", browserVersion); desiredCapabilities.setCapability("os", platform); desiredCapabilities.setCapability("os_version", "Mojave"); desiredCapabilities.setCapability("resolution", "1600x1200"); if (envName.equalsIgnoreCase("saucelabs")) { driver = new RemoteWebDriver(new URL(SAUCE_URL), desiredCapabilities); } else if (envName.equalsIgnoreCase("browserstack")) { driver = new RemoteWebDriver(new URL(BROWERSTACK_URL), desiredCapabilities); } return driver; } //screenshot public static void captureScreenshot(WebDriver driver, String screenshotName) { DateFormat df = new SimpleDateFormat("(MM.dd.yyyy-HH:mma)"); Date date = new Date(); df.format(date); File file = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); try { FileUtils.copyFile(file, new File(System.getProperty("user.dir") + "/screenshots/" + screenshotName + " " + df.format(date) + ".png")); System.out.println("Screenshot captured"); } catch (Exception e) { System.out.println("Exception while taking screenshot " + e.getMessage()); } } //reporting starts @BeforeSuite public void extentSetup(ITestContext context) { ExtentManager.setOutputDirectory(context); extent = ExtentManager.getInstance(); } @BeforeMethod public void startExtent(Method method) { String className = method.getDeclaringClass().getSimpleName(); ExtentTestManager.startTest(method.getName()); ExtentTestManager.getTest().assignCategory(className); } protected String getStackTrace(Throwable t) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); return sw.toString(); } @AfterMethod public void afterEachTestMethod(ITestResult result) { ExtentTestManager.getTest().getTest().setStartedTime(getTime(result.getStartMillis())); ExtentTestManager.getTest().getTest().setEndedTime(getTime(result.getEndMillis())); for (String group : result.getMethod().getGroups()) { ExtentTestManager.getTest().assignCategory(group); } if (result.getStatus() == 1) { ExtentTestManager.getTest().log(LogStatus.PASS, "Test Passed"); } else if (result.getStatus() == 2) { ExtentTestManager.getTest().log(LogStatus.FAIL, getStackTrace(result.getThrowable())); } else if (result.getStatus() == 3) { ExtentTestManager.getTest().log(LogStatus.SKIP, "Test Skipped"); } ExtentTestManager.endTest(); extent.flush(); if (result.getStatus() == ITestResult.FAILURE) { captureScreenshot(driver, result.getName()); } } private Date getTimeByMilliseconds(long millis) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(millis); return calendar.getTime(); } @AfterSuite public void generateReport() { extent.close(); } //reporting finish @AfterMethod public void cleanUp() { driver.close(); driver.quit(); } public void sleepFor(int seconds) { try { Thread.sleep(seconds * 1000); } catch (InterruptedException e) { e.printStackTrace(); } } // commmon methods public void clickOnElementByXpath(String locator) { driver.findElement(By.xpath(locator)).click(); } public void clickOnElementById(String locator) { driver.findElement(By.id(locator)).click(); } public void clickOnElementByLinkText(String locator) { driver.findElement(By.linkText(locator)).click(); } public void typeOnElementByXpath(String locator, String value) { driver.findElement(By.xpath(locator)).sendKeys(value); } public void typeOnElementById(String locator, String value) { driver.findElement(By.id(locator)).sendKeys(value); } public String getValueByXpath(String locator) { return driver.findElement(By.xpath(locator)).getText(); } public boolean isElementDisplayed(String locator) { return driver.findElement(By.xpath(locator)).isDisplayed(); } public boolean isElementEnabled(String locator) { boolean flag = true; flag = driver.findElement(By.xpath(locator)).isEnabled(); return flag; } public boolean isElementSelected(String locator) { boolean flag = true; flag = driver.findElement(By.xpath(locator)).isSelected(); return flag; } /** * @param locator - xpath that we are trying to make webElement of * @return WebElement - WebElement of the xpath */ public WebElement getElement(String locator) { return driver.findElement(By.xpath(locator)); } public WebElement getElementByLinkText(String locator) { return driver.findElement(By.linkText(locator)); } public void dragNdropByXpaths(String fromLocator, String toLocator) { Actions actions = new Actions(driver); WebElement from = getElement(fromLocator); WebElement to = getElement(toLocator); actions.dragAndDrop(from, to).build().perform(); } public void scrollIntoView(String locator) { JavascriptExecutor javascriptExecutor = (JavascriptExecutor) driver; javascriptExecutor.executeScript("arguments[0].scrollIntoView(true);", getElementByLinkText(locator)); } // Explicit Wait public void waitExplicitlyByXpath(String locator, int seconds) { WebDriverWait webDriverWait = new WebDriverWait(driver, seconds); //webDriverWait.until(ExpectedConditions.visibilityOf(getElement(locator))); //webDriverWait.until(ExpectedConditions.visibilityOf(driver.findElement(By.xpath(locator)))); webDriverWait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locator))); } public void waitUntilSelectable(String locator, int seconds) { WebDriverWait webDriverWait = new WebDriverWait(driver, seconds); webDriverWait.until(ExpectedConditions.elementToBeSelected(getElement(locator))); } public void waitUntilClickable(String locator, int seconds) { WebDriverWait webDriverWait = new WebDriverWait(driver, seconds); webDriverWait.until(ExpectedConditions.elementToBeClickable(By.xpath(locator))); } //getLink public String getAllLink() { return driver.findElement(By.tagName("a")).getText(); } public List<String> getAllLinks() { List<WebElement> webElementsList = driver.findElements(By.tagName("a")); List<String> stringList = new ArrayList<String>(); for (int i = 0; i < webElementsList.size(); i++) { stringList.add(webElementsList.get(i).getText()); } return stringList; } public void uploadFileByXpath(String path, String locator) { driver.findElement(By.xpath(locator)).sendKeys(path); } public void clearFieldByXpath(String locator) { driver.findElement(By.xpath(locator)).clear(); } public void typeEnterByXpath(String locator) { driver.findElement(By.xpath(locator)).sendKeys(Keys.ENTER); } public Date getTime(long millis) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(millis); return calendar.getTime(); } public void navigateBack() { driver.navigate().back(); } public void navigateForward() { driver.navigate().forward(); } }
[ "muhammedkhoyer@Muhammeds-MacBook-Pro.local" ]
muhammedkhoyer@Muhammeds-MacBook-Pro.local
5a7a717d47e1c388843acc646495410c1b5eedc4
f87f2c77736046bd1cac2140e8be109d0bfba131
/FlowerGarden/src/main/java/com/flowergarden/bouquet/MarriedBouquet.java
92bc2e3223c7b1a7ae23b49017f248ef828a7014
[]
no_license
ham11max/JavaAdvancedCourseNov17
543bc2e9f480569a91f01a0caeafb7152ed9de1a
4177275cce7dcd3dbda8fa3f3f4def141e9b0fb9
refs/heads/master
2021-08-14T09:54:27.892774
2017-11-15T09:12:53
2017-11-15T09:12:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,194
java
package com.flowergarden.bouquet; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; import com.flowergarden.flowers.Chamomile; import com.flowergarden.flowers.GeneralFlower; import com.flowergarden.flowers.Rose; public class MarriedBouquet implements Bouquet<GeneralFlower> { private float assemblePrice = 120; private List<GeneralFlower> flowerList = new ArrayList<>(); @Override public float getPrice() { //TODO } @Override public void addFlower(GeneralFlower flower) { //TODO } @Override public Collection<GeneralFlower> searchFlowersByLenght(int start, int end) { List<GeneralFlower> searchResult = new ArrayList<GeneralFlower>(); for (GeneralFlower flower : flowerList) { if (flower.getLenght() >= start && flower.getLenght() <= end) { searchResult.add(flower); } } return searchResult; } @Override public void sortByFreshness() { Collections.sort(flowerList); } @Override public Collection<GeneralFlower> getFlowers() { return flowerList; } public void setAssembledPrice(float price) { assemblePrice = price; } }
[ "asidun@gmail.com" ]
asidun@gmail.com
18dc3fc5e28c3065c858552d3db0fdff0667534d
aa058947e2488968231616608a2012888a352544
/app/src/main/java/com/riverauction/riverauction/feature/photo/PhotoSelector.java
03fe4c873bad534615ead616643eb24859242100
[]
no_license
jesusking52/myriver2
cc4fde94168d4c167c3b22edc7972f5b00c2d427
d10bed77664a68191d8183745dd6e2411ff65eb0
refs/heads/master
2020-06-10T01:23:48.874824
2017-03-06T14:50:53
2017-03-06T14:50:53
76,117,728
0
0
null
null
null
null
UTF-8
Java
false
false
3,454
java
package com.riverauction.riverauction.feature.photo; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import com.jhcompany.android.libs.utils.CacheUtils; import com.jhcompany.android.libs.utils.FileUtils; import com.riverauction.riverauction.base.BaseActivity; import com.riverauction.riverauction.feature.utils.RiverAuctionFileUtils; import java.io.File; public class PhotoSelector { private static final String EXTRA_PREFIX = "com.riverauction.riverauction.feature.photo.PhotoSelector."; private static final String EXTRA_REQUEST_PHOTO_URI = EXTRA_PREFIX + "request_photo_uri"; private static final String EXTRA_REQUEST_DATA_RESULT_PATH = EXTRA_PREFIX + "request_data_result_path"; private BaseActivity mActivity; public PhotoSelector(BaseActivity activity) { mActivity = activity; } public void requestImageFromCamera() { final Uri resultUri = Uri.fromFile(RiverAuctionFileUtils.createNewPhotoFile()); final Intent intent = CommonPhotoIntents.getPickBitmapFromCameraIntent(resultUri); Bundle bundle = new Bundle(); bundle.putString(EXTRA_REQUEST_PHOTO_URI, resultUri.toString()); mActivity.startActivityForResultWithBundle(intent, CommonPhotoIntents.REQUEST_GET_IMAGE_FROM_CAMERA, bundle); } public void requestImageFromAndroidGallery() { final Intent intent = CommonPhotoIntents.getPickImageFromAndroidGalleryIntent(); mActivity.startActivityForResult(intent, CommonPhotoIntents.REQUEST_GET_IMAGE_FROM_ANDROID_GALLERY); } public void requestCropImage(Uri photoUri) { File resultFilePath = new File(FileUtils.getRandomFile(CacheUtils.getDiskCacheDir(mActivity, "").getAbsolutePath())); Intent intent = CommonPhotoIntents.getCropIntentProfilePhoto(mActivity, photoUri, Uri.fromFile(resultFilePath)); Bundle bundle = new Bundle(); bundle.putString(EXTRA_REQUEST_DATA_RESULT_PATH, resultFilePath.toString()); mActivity.startActivityForResultWithBundle(intent, CommonPhotoIntents.REQUEST_CROP_IMAGE, bundle); } public CPhotoInfo onActivityResult(int requestCode, int resultCode, Intent data, Bundle bundle) { if (resultCode != Activity.RESULT_OK) { return null; } switch (requestCode) { case CommonPhotoIntents.REQUEST_GET_IMAGE_FROM_CAMERA: Uri resultUri = Uri.parse(bundle.getString(EXTRA_REQUEST_PHOTO_URI)); savePhotoToGallery(resultUri); requestCropImage(resultUri); break; case CommonPhotoIntents.REQUEST_GET_IMAGE_FROM_ANDROID_GALLERY: requestCropImage(data.getData()); break; case CommonPhotoIntents.REQUEST_CROP_IMAGE: if (bundle == null) { break; } String filePath = bundle.getString(EXTRA_REQUEST_DATA_RESULT_PATH); return new CPhotoInfo(filePath); } return null; } /** * 사진을 안드로이드 내장 갤러리에 저장 (BetweenDate 폴더에 저장) * @param uri 저장할 사진의 Uri */ private void savePhotoToGallery(Uri uri) { Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); mediaScanIntent.setData(uri); mActivity.sendBroadcast(mediaScanIntent); } }
[ "csh109521@gmail.com" ]
csh109521@gmail.com
4305fd85d1bbb6f2c0f730c037386ac0744b3481
bbfa28d1aacf2048b3e7b489d9ed74039fbd563b
/src/main/java/com/sharehoo/util/ServletUtils.java
c53f6d21fbccf5436b2f004b095a04f48fa95011
[]
no_license
miki-hmt/sharehoo
bbf606b5c1979c4cf950f0c92fa24bd3040593d6
5c1684a8e45cca6522f702616ebd518fc3be5579
refs/heads/master
2023-04-27T06:54:50.768962
2022-07-03T14:09:31
2022-07-03T14:09:31
218,234,356
6
0
null
2023-04-14T17:32:49
2019-10-29T08:05:29
JavaScript
UTF-8
Java
false
false
2,992
java
package com.sharehoo.util; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import com.sharehoo.util.text.Convert; /** * 客户端工具类 * * @author ruoyi */ public class ServletUtils { /** * 获取String参数 */ public static String getParameter(String name) { return getRequest().getParameter(name); } /** * 获取String参数 */ public static String getParameter(String name, String defaultValue) { return Convert.toStr(getRequest().getParameter(name), defaultValue); } /** * 获取Integer参数 */ public static Integer getParameterToInt(String name) { return Convert.toInt(getRequest().getParameter(name)); } /** * 获取Integer参数 */ public static Integer getParameterToInt(String name, Integer defaultValue) { return Convert.toInt(getRequest().getParameter(name), defaultValue); } /** * 获取request */ public static HttpServletRequest getRequest() { return getRequestAttributes().getRequest(); } /** * 获取response */ public static HttpServletResponse getResponse() { return getRequestAttributes().getResponse(); } /** * 获取session */ public static HttpSession getSession() { return getRequest().getSession(); } public static ServletRequestAttributes getRequestAttributes() { RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); return (ServletRequestAttributes) attributes; } /** * 将字符串渲染到客户端 * * @param response 渲染对象 * @param string 待渲染的字符串 * @return null */ public static String renderString(HttpServletResponse response, String string) { try { response.setContentType("application/json"); response.setCharacterEncoding("utf-8"); response.getWriter().print(string); } catch (IOException e) { e.printStackTrace(); } return null; } /** * 是否是Ajax异步请求 * * @param request */ public static boolean isAjaxRequest(HttpServletRequest request) { String accept = request.getHeader("accept"); if (accept != null && accept.indexOf("application/json") != -1) { return true; } String xRequestedWith = request.getHeader("X-Requested-With"); if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) { return true; } String uri = request.getRequestURI(); if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) { return true; } String ajax = request.getParameter("__ajax"); if (StringUtils.inStringIgnoreCase(ajax, "json", "xml")) { return true; } return false; } }
[ "1329289117@qq.com" ]
1329289117@qq.com
48a0679eb83b206ee16922821d3c26fb59798b60
7116e42ac9d3850e5fa7d14d21fae8ac7c90a2e2
/src/TestNG_T__HSN/DataProvider__Recap3__SoftAssert.java
df579c90edffdd1f05b9d36bd12083bb0b8e75c4
[]
no_license
GulenYilmaz/Java__2020__AllProject__Stdy_By_V
208a1dcfee100fb8064e47ad0a0a0c81e069ab8b
cd02395b4519f57e5745509c7ef432d86f9584b5
refs/heads/master
2022-10-19T00:29:04.195543
2020-06-04T01:47:51
2020-06-04T01:47:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,310
java
package TestNG_T__HSN; import java.util.concurrent.TimeUnit; import org.apache.commons.collections4.Get; import org.junit.BeforeClass; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeDriverService; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.annotations.AfterMethod; import org.testng.asserts.SoftAssert; import org.testng.Assert; import org.testng.annotations.*; public class DataProvider__Recap3__SoftAssert { WebDriver driver; @BeforeClass public void openBrowserAndNavigateToHRM() throws InterruptedException { System.setProperty(ChromeDriverService.CHROME_DRIVER_SILENT_OUTPUT_PROPERTY, "true"); System.setProperty("webdriver.chrome.driver","drivers/chromedriver.exe"); driver=new ChromeDriver(); driver.get("https://opensource-demo.orangehrmlive.com/index.php/auth/login"); //driver.manage().window().maximize(); Thread.sleep(3000); } @AfterClass public void closeBrowser() { driver.quit(); } @BeforeMethod public void login() throws InterruptedException { driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); //login HRM driver.findElement(By.id("txtUsername")).sendKeys("Admin"); driver.findElement(By.id("txtPassword")).sendKeys("admin123"); //click login button driver.findElement(By.id("btnLogin")).click(); Thread.sleep(3000); } @AfterMethod public void logaout() throws InterruptedException { driver.findElement(By.id("welcome")).click(); Thread.sleep(4000); driver.findElement(By.linkText("Logout")).click(); Thread.sleep(4000); } @Test (dataProvider="getData") public void addEmployee(String name, String lastName) throws InterruptedException { driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); //navigate to employee page driver.findElement(By.id("menu_pim_viewPimModule")).click(); Thread.sleep(4000); driver.findElement(By.id("menu_pim_addEmployee")).click(); Thread.sleep(4000); //add employee name and lastName Thread.sleep(4000); driver.findElement(By.id("firstName")).sendKeys(name); Thread.sleep(4000); driver.findElement(By.id("lastName")).sendKeys(lastName); driver.findElement(By.id("btnSave")).click(); Thread.sleep(3000); String actEmpFullName= driver.findElement(By.id("//div[@id='profile-pic']/h1")).getText(); String expName= name+" "+lastName; SoftAssert sAssert=new SoftAssert(); sAssert.assertEquals(actEmpFullName, expName); String actEmpId=driver.findElement(By.id("personal_txtEmployeeId")).getAttribute("value"); sAssert.assertEquals(actEmpFullName, expName, "Employee ID validation FAIL"); // takeScreenShot((name+lastName)); } @DataProvider public Object[][] getData(){// provide argument for @Test method Object[][] data= {{"John","Simit"},{"Eva","Anna"}}; return data; } //herbir satir icin bu dosyayi kullanicaz //simdi bu methodu yukaridaki test icine atamamiz gerekiyor bunun icinde (dataProvider="getData") //seklinde yaziyoruz }
[ "gulenaltintasyilmaz@gmail.com" ]
gulenaltintasyilmaz@gmail.com
41fbc8299e6d3caadfa53b23c7a6b8238ad19f14
951a2cebfb3b742a0b9da0dee787f4610505292c
/toq/Misc/JavaSrc/com/intel/bluetooth/NotImplementedError.java
bf82c20837151575585fba16b0ed1e8b2aa43a02
[]
no_license
marciallus/mytoqmanager
eca30683508878b712e9c1c6642f39f34c2e257b
65fe1d54e8593900262d5b263d75feb646c015e6
refs/heads/master
2020-05-17T01:03:44.121469
2014-12-10T07:22:14
2014-12-10T07:22:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
440
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) fieldsfirst noctor space package com.intel.bluetooth; public class NotImplementedError extends Error { public static final boolean enabled = true; private static final long serialVersionUID = 1L; public NotImplementedError() { super("Not Implemented"); } }
[ "marc.lanouiller@gmail.com" ]
marc.lanouiller@gmail.com
55e8d79ff43e05778bc3b213e52ec91b70710759
7b97c1f9b3d36d472800838efdd07f7abec915e4
/src/GeneralUtilities/Utilities.java
db3d57cb39048b377db7220cb737f5e506e1ffd3
[]
no_license
MCHectorious/CS_Project_Program_B
a0f654fa924c866cf7653d67c3894b18cd3ecc02
d54e6907ebda252abbb3e90506140847fa063825
refs/heads/master
2020-03-07T07:14:42.456437
2018-04-30T20:37:57
2018-04-30T20:37:57
127,344,171
0
0
null
null
null
null
UTF-8
Java
false
false
3,050
java
package GeneralUtilities; import Models.Model; import java.util.ArrayList; public class Utilities { public static String arrayToString(Model[] array) { StringBuilder stringBuilder = new StringBuilder();//Uses a string builder for faster appending for (Model model : array) { stringBuilder.append(model.toString()).append(",");//Uses toString because using the provided description would take up too much space for some Models. } return stringBuilder.toString(); } public static String arrayToString(int[] array) { StringBuilder stringBuilder = new StringBuilder();//Uses a string builder for faster appending for (int i : array) { stringBuilder.append(i).append(",");//uses comma separated values because that is the standard in Java } return stringBuilder.toString(); } public static String arrayToString(Character[] array) { StringBuilder stringBuilder = new StringBuilder();//Uses a string builder for faster appending for (Character character : array) { stringBuilder.append(character).append(",");//uses comma separated values because that is the standard in Java } return stringBuilder.toString(); } public static String arrayToString(double[] array) { StringBuilder stringBuilder = new StringBuilder();//Uses a string builder for faster appending for (double d : array) { stringBuilder.append(d).append(",");//uses comma separated values because that is the standard in Java } return stringBuilder.toString(); } public static String arrayToString(Double[] array) { StringBuilder builder = new StringBuilder();//Uses a string builder for faster appending for (Double d : array) { builder.append(d).append(",");//uses comma separated values because that is the standard in Java } return builder.toString(); } public static double getUpperQuartile(ArrayList<Double> inputs) { ArrayList<Double> values = new QuickSort().sort(inputs);//Uses quick sort because it is very efficient return values.get(3*values.size()/4);//The upper quartile is the value of 3/4 from the smallest value } public static String convertToURLFormat(String string){ StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < string.length(); i++) { switch(string.charAt(i)) { case ' ': stringBuilder.append("+");//Converts spaces into pluses break;//So that is doesn't copy the original as well case ',': stringBuilder.append("%2C");//Converts commas into the string representing commas break;//So that is doesn't copy the original as well default: stringBuilder.append(string.charAt(i));//Otherwise, just copy the string break; } } return stringBuilder.toString(); } public static int countOfCharacterInString(Character c, String s){ int count = 0; for (int i = 0; i < s.length(); i++) { if (s.charAt(i)==c){ count++; } } return count; } }
[ "MCHectorious@gmail.com" ]
MCHectorious@gmail.com
ac0126055cd43af801a21f011714ef6a889af09c
e3b1b470121d9f506e69de25ffe06a9c80beb7e9
/src/main/java/com/meicloud/schedule/Utils/SpringUtil.java
f149e41866c188f3ab56f890d286294bedc0a1a3
[]
no_license
zhougit86/MSS
a7673241c2c9c06009b54b7c209e3cf98c7142b0
5cf2072673c594e35ec6ee1a9c05fd835daf3af5
refs/heads/master
2020-04-11T07:51:00.934140
2018-12-13T10:40:41
2018-12-13T10:40:41
161,624,007
0
0
null
null
null
null
UTF-8
Java
false
false
1,570
java
// // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower decompiler) // package com.meicloud.schedule.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Component; @Component public class SpringUtil implements ApplicationContextAware { private static Logger LOG = LoggerFactory.getLogger(SpringUtil.class); private static ApplicationContext applicationContext; public SpringUtil() { } public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { if(SpringUtil.applicationContext == null) { SpringUtil.applicationContext = applicationContext; } LOG.info("========ApplicationContext配置成功,在普通类可以通过调用SpringUtils.getApplicationContext()获取applicationContext对象,applicationContext=" + SpringUtil.applicationContext + "========"); } public static ApplicationContext getApplicationContext() { return applicationContext; } public static <T> T getBean(String name) { return (T)getApplicationContext().getBean(name); } public static <T> T getBean(Class<T> clazz) { return getApplicationContext().getBean(clazz); } public static <T> T getBean(String name, Class<T> clazz) { return getApplicationContext().getBean(name, clazz); } }
[ "80828913@yonghui.cn" ]
80828913@yonghui.cn