blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
7016fda406296e744c95e6a3a0d7cdd12818ad71
c433ff0eb2e4f1e0f17130c04ebea4224852a87c
/src/main/java/Hooks/WebDriverHooks.java
4d38726821ffc147cae5cb531543f81392867741
[]
no_license
testing48/Java-Automation-Framework
a606017946b923f3b7668a4a4077fec349c8118d
b5f899b084befe60d831ff2b3b0aa46803a0a0b9
refs/heads/master
2020-04-23T10:38:05.784341
2019-02-07T21:25:21
2019-02-07T21:25:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,850
java
package Hooks; import Utils.WebDriverFactory; import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; import com.aventstack.extentreports.reporter.ExtentHtmlReporter; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeSuite; public class WebDriverHooks { //public static ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent2.html"); private static ExtentReports extent; public static ThreadLocal<ExtentTest> _extenttest = new ThreadLocal<>(); /* @BeforeSuite public void setUp() { }*/ @BeforeSuite public void InitializeWebDriver() { ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent.html"); // create ExtentReports and attach reporter(s) extent = new ExtentReports(); extent.attachReporter(htmlReporter); _extenttest.set(extent.createTest("MyFirstTest3", "Sample description")); //WebDriverFactory.InitDriver(); } /* @Test public void test5(){ ExtentTest test = extent.createTest("MyFirstTest2", "Sample description"); test.log(Status.INFO, "This step shows usage of log(status, details)"); test.pass("Test passed"); //WebDriverFactory.webdriver().manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); WebDriverFactory.webdriver().get("https://www.bbc.co.uk/"); //BaseWebElement.CreatePageObject() System.out.println(WebDriverFactory.webdriver().getCurrentUrl()); WebDriverFactory.webdriver().findElement(By.linkText("Weather")).click(); }*/ @AfterTest public void TearDown() { extent.flush(); WebDriverFactory.CloseBrowser(); } // @AfterSuite // public void ExtentTearDown() // { // // } /* @CucumberOptions(features = "src/main/Features", plugin = "json:target/cucumber-report-feature-composite.json") public class TestRunner { private TestNGCucumberRunner testNGCucumberRunner; @BeforeClass(alwaysRun = true) public void setUpClass() throws Exception { testNGCucumberRunner = new TestNGCucumberRunner(this.getClass()); } @Test(groups = "cucumber scenarios", description = "Runs Cucumber Scenarios", dataProvider = "scenarios") public void scenario(PickleEventWrapper pickleEvent, CucumberFeatureWrapper cucumberFeature) throws Throwable{ testNGCucumberRunner.runScenario(pickleEvent.getPickleEvent()); } @DataProvider public Object[][] scenarios() { return testNGCucumberRunner.provideScenarios(); } @AfterClass(alwaysRun = true) public void tearDownClass() throws Exception { testNGCucumberRunner.finish(); }*/ }
cc564164a8cf9198e33d0b70955f8334996d9af0
44c386c3e7d426533456cbdff0e23083683c38d2
/src/in/sol/com/LearnMergeMap.java
8aa9b5fcc74face49fc24bc72ce2ec9f246a3e8b
[]
no_license
Kallankudlu/mySolutions
53ef22b6ee5e818452a1a23c9ee7eac9122b5c84
c24bdd56b69a325b824ce8fbadf01fc5287f736d
refs/heads/master
2020-06-07T02:09:38.079229
2019-10-04T12:23:02
2019-10-04T12:23:02
192,898,208
0
0
null
null
null
null
UTF-8
Java
false
false
250
java
/** * */ package in.sol.com; import java.util.function.BiFunction; /** * @author athreya.ks * */ public class LearnMergeMap { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub } }
6c75ea32a279de87c81d390948f83d58c0ef358f
58be909c0ba9a741bec0b11851ae09dcb41a83a1
/configcenter-biz/src/main/java/org/antframework/configcenter/biz/service/AddOrModifyPropertyKeyService.java
5871668ca273effc760eaa972b0e5c39c5774a5c
[ "Apache-2.0" ]
permissive
zhongxunking/configcenter
1b7f43ed293f069b8a60ade18f256d3e8cbf3fa1
d966b84995af5c769db1e8b51dd145a88d25cf20
refs/heads/master
2023-03-17T03:11:51.846023
2022-04-24T10:00:15
2022-04-24T10:00:15
100,801,601
87
51
Apache-2.0
2021-06-27T11:12:53
2017-08-19T14:59:05
Java
UTF-8
Java
false
false
1,981
java
/* * 作者:钟勋 (e-mail:[email protected]) */ /* * 修订记录: * @author 钟勋 2017-08-20 20:42 创建 */ package org.antframework.configcenter.biz.service; import lombok.AllArgsConstructor; import org.antframework.common.util.facade.BizException; import org.antframework.common.util.facade.CommonResultCode; import org.antframework.common.util.facade.EmptyResult; import org.antframework.common.util.facade.Status; import org.antframework.configcenter.dal.dao.AppDao; import org.antframework.configcenter.dal.dao.PropertyKeyDao; import org.antframework.configcenter.dal.entity.App; import org.antframework.configcenter.dal.entity.PropertyKey; import org.antframework.configcenter.facade.order.AddOrModifyPropertyKeyOrder; import org.bekit.service.annotation.service.Service; import org.bekit.service.annotation.service.ServiceExecute; import org.bekit.service.engine.ServiceContext; import org.springframework.beans.BeanUtils; /** * 添加或修改配置key服务 */ @Service(enableTx = true) @AllArgsConstructor public class AddOrModifyPropertyKeyService { // 应用dao private final AppDao appDao; // 配置key dao private final PropertyKeyDao propertyKeyDao; @ServiceExecute public void execute(ServiceContext<AddOrModifyPropertyKeyOrder, EmptyResult> context) { AddOrModifyPropertyKeyOrder order = context.getOrder(); App app = appDao.findLockByAppId(order.getAppId()); if (app == null) { throw new BizException(Status.FAIL, CommonResultCode.INVALID_PARAMETER.getCode(), String.format("应用[%s]不存在", order.getAppId())); } PropertyKey propertyKey = propertyKeyDao.findLockByAppIdAndKey(order.getAppId(), order.getKey()); if (propertyKey == null) { propertyKey = new PropertyKey(); } BeanUtils.copyProperties(order, propertyKey); propertyKeyDao.save(propertyKey); } }
c45f3ea0690583c87a7d5787bd8589cca40d93d0
fc160694094b89ab09e5c9a0f03db80437eabc93
/java-notebooks/samples/snippets/generated/com/google/cloud/notebooks/v1/notebookservice/getinstancehealth/SyncGetInstanceHealth.java
338a5273e882933f03f4e03054647497e0eb07e3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/google-cloud-java
4f4d97a145e0310db142ecbc3340ce3a2a444e5e
6e23c3a406e19af410a1a1dd0d0487329875040e
refs/heads/main
2023-09-04T09:09:02.481897
2023-08-31T20:45:11
2023-08-31T20:45:11
26,181,278
1,122
685
Apache-2.0
2023-09-13T21:21:23
2014-11-04T17:57:16
Java
UTF-8
Java
false
false
2,022
java
/* * Copyright 2023 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.cloud.notebooks.v1.samples; // [START notebooks_v1_generated_NotebookService_GetInstanceHealth_sync] import com.google.cloud.notebooks.v1.GetInstanceHealthRequest; import com.google.cloud.notebooks.v1.GetInstanceHealthResponse; import com.google.cloud.notebooks.v1.InstanceName; import com.google.cloud.notebooks.v1.NotebookServiceClient; public class SyncGetInstanceHealth { public static void main(String[] args) throws Exception { syncGetInstanceHealth(); } public static void syncGetInstanceHealth() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) { GetInstanceHealthRequest request = GetInstanceHealthRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[INSTANCE]").toString()) .build(); GetInstanceHealthResponse response = notebookServiceClient.getInstanceHealth(request); } } } // [END notebooks_v1_generated_NotebookService_GetInstanceHealth_sync]
dca4957c3e050c9987d50873b432a040cdb30d01
68f9f00dec828a52ab6da347a7f7d3a48f4a6f53
/src/ua/pd/hillel/java15/homeWork5/store/registors/FirstRegister.java
89910a7b5fa4fdc9b794f367f304481bbafab8d7
[]
no_license
AlekseiChe/Lesson5HomeWork
25cae9d3463f10ebc6df6e10d64fa21f4db291b7
52baee904df15d5d2ba908ffb52632f5ca87392e
refs/heads/master
2021-01-25T07:54:28.340308
2017-06-11T20:13:40
2017-06-11T20:13:40
93,679,376
0
0
null
null
null
null
UTF-8
Java
false
false
1,429
java
package ua.pd.hillel.java15.homeWork5.store.registors; import ua.pd.hillel.java15.homeWork5.piople.buyers.Buyer; import ua.pd.hillel.java15.homeWork5.piople.cashiers.Cashier; import java.util.LinkedList; import java.util.Queue; /** * Created by aleksei on 07.06.17. */ public class FirstRegister extends AbstractRegister implements Runnable { private final Cashier cashier; private final Queue<Buyer> queue = new LinkedList<>(); public FirstRegister(Cashier cashier){ this.cashier = cashier; } public void newBuyer(Buyer buyer){ queue.add(buyer); } public void run(){ int numberOfCustomers = 0; int totalTime = 0; int brokenTime = 0; Buyer buyer; while ((buyer = queue.poll()) != null) { brokenTime += isBroken(); totalTime += brokenTime; totalTime += buyer.putGoodsOnTheLine(); totalTime += cashier.pierce(); totalTime += cashier.takeMoney(); totalTime += buyer.payForGoods(); totalTime += cashier.serviceTime(); numberOfCustomers++; } System.out.println("На первой кассе было: " + numberOfCustomers + " покупателей, обслуживание заняло: " + totalTime + " секунд." + " Касса была неисправна: " + brokenTime + " секунд."); } }
5644c22f50fd4af60a7a75f265562f463447f15b
bbe44d3e4445965dfaca645e9bed7b34c3e7eeb3
/src/main/java/edu/wustl/mir/erl/ihe/xdsi/validation/TestRAD68ImagingDocumentSource.java
a32c07b1b1110a778244c9f6222b14f721177618
[]
no_license
IHE-WUSTL/XDSI
921dc03c18aa3864f1c25bd999d3519cf6b56896
76a79262bdc0771e772081ead18c29f7c63028bd
refs/heads/master
2020-03-07T06:57:02.961177
2018-03-29T19:08:20
2018-03-29T19:08:20
127,335,719
0
1
null
null
null
null
UTF-8
Java
false
false
13,542
java
package edu.wustl.mir.erl.ihe.xdsi.validation; import java.io.File; import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; import edu.wustl.mir.erl.ihe.xdsi.util.PfnType; import edu.wustl.mir.erl.ihe.xdsi.util.ProcessNISTSimulatorLogs; import edu.wustl.mir.erl.ihe.xdsi.util.Utility; import edu.wustl.mir.erl.ihe.xdsi.util.DICOMUtility; import edu.wustl.mir.erl.ihe.xdsi.util.KOSBean; @SuppressWarnings("javadoc") public class TestRAD68ImagingDocumentSource extends Test { private static Logger log = null; private static Path root = Paths.get(Utility.getXDSIRoot()); private String testCmd = null; /** * <b>Parameters:</b> * <ol> * <li>String pfn of test KOS Document file. Absolute path or relative to * XDSI Root.</li> * <li>String pfn of std KOS Document file used for comparison (The * "gold standard" object). Absolute path or relative to XDSI Root.</li> * <li>String pfn of test KOS Metadata XML file. Absolute path or relative to * XDSI Root.</li> * <li>String pfn of std KOS MetadataXML file used for comparison (The * "gold standard" XML). Absolute path or relative to XDSI Root.</li> * </ol> */ @Override public void initializeTest(String[] args) throws Exception { log = Utility.getLog(); testCmd = getArg(args, 0); log.info("TestRAD68ImagingDocumentSource Running " + testCmd); if (testCmd.equalsIgnoreCase("RUNTEST")) { this.initializeMethodTest(args); } else if (testCmd.equalsIgnoreCase("TESTLOGS")) { this.initializeMethodLogs(args); } else if (testCmd.equalsIgnoreCase("TESTLOGS2")) { this.initializeMethodLogs2(args); } else if (testCmd.equalsIgnoreCase("DRYRUN")) { this.initializeMethodDryRun(args); } else if (testCmd.equalsIgnoreCase("DRYRUN2")) { this.initializeMethodDryRun2(args); } } public void runTestForPID(String pid, String simulatorName) throws Exception { log.info("BO TestRAD68ImagingDocumentSource runTestForPID"); Path stdPath = Paths.get(Utility.getXDSIRoot(), "storage", "runtime", pid, "kos"); log.info("test data dir " + stdPath); Utility.isValidPfn("RAD-68 test data dir", stdPath, PfnType.DIRECTORY, "r"); } private void initializeMethodTest(String[] args) throws Exception { // args[0] is the command that brought us to this method String testDcmPfn = args[1]; String stdDcmPfn = args[2]; String testXmlPfn = args[3]; String stdXmlPfn = args[4]; StepRAD68KOSDocument stepRAD68KOSDocument = new StepRAD68KOSDocument(); stepRAD68KOSDocument.initializeStep(new Object[] { testDcmPfn, stdDcmPfn }); addStep(stepRAD68KOSDocument); StepRAD68KOSMetadata stepRAD68KOSMetadata = new StepRAD68KOSMetadata(); stepRAD68KOSMetadata.initializeStep(new Object[] { testXmlPfn, stdXmlPfn }); addStep(stepRAD68KOSMetadata); } private void initializeMethodLogs(String[] args) throws Exception { String simulator = getArg(args, 1); String pidDepartment = getArg(args, 2); String pidAffinityDomain = getArg(args, 3); Path dir = root.resolve("storage" + Utility.fs + "runtime").resolve(pidDepartment); Path std = dir.resolve("kos"); Path test = dir.resolve("test"); Files.createDirectories(test); this.deleteIfExists(test, "kos.dcm"); this.deleteIfExists(test, "metadata.xml"); this.fileMustExist(std, "kos.dcm"); this.fileMustExist(std, "metadata.xml"); ProcessNISTSimulatorLogs.main(new String[] {"GETKOS", simulator, pidAffinityDomain, "-", test.toString(), "kos.dcm"}); ProcessNISTSimulatorLogs.main(new String[] {"GETMETADATA", simulator, pidAffinityDomain, "-", test.toString(), "metadata.xml"}); this.fileMustExist(test, "kos.dcm"); this.fileMustExist(test, "metadata.xml"); this.initializeMethodTest(new String[] { "RUNTEST", test.resolve("kos.dcm").toString(), std.resolve("kos.dcm").toString(), test.resolve("metadata.xml").toString(), std.resolve("metadata.xml").toString()}); } private void initializeMethodLogs2(String[] args) throws Exception { String simulator = getArg(args, 1); String pidDepartment = getArg(args, 2); String pidAffinityDomain = getArg(args, 3); String label = getArg(args, 4); String extension = getArg(args, 5); String testName = getArg(args, 6); Path dir = root.resolve("storage" + Utility.fs + "ids" + Utility.fs + extension).resolve(pidDepartment); Path std = dir.resolve("kos"); Path test = root.resolve("results" + Utility.fs + label + Utility.fs + testName + Utility.fs + "data"); Files.createDirectories(test); Path report = root.resolve("results" + Utility.fs + label + Utility.fs + testName + Utility.fs + "validation"); Files.createDirectories(report); reportFolder = report.toString(); this.deleteIfExists(test, "kos.dcm"); this.deleteIfExists(test, "metadata.xml"); this.fileMustExist(std, "kos.dcm"); this.fileMustExist(std, "metadata.xml"); ProcessNISTSimulatorLogs.main(new String[] {"GETKOS", simulator, "rep", "prb", pidAffinityDomain, "-", test.toString(), "kos.dcm"}); ProcessNISTSimulatorLogs.main(new String[] {"GETMETADATA", simulator, "rep", "prb", pidAffinityDomain, "-", test.toString(), "metadata.xml"}); this.fileMustExist(test, "kos.dcm"); this.fileMustExist(test, "metadata.xml"); dumpKOSToText(test.toString() + Utility.fs + "kos.txt", test.toString() + Utility.fs + "kos.dcm"); this.initializeMethodTest(new String[] { "RUNTEST", test.resolve("kos.dcm").toString(), std.resolve("kos.dcm").toString(), test.resolve("metadata.xml").toString(), std.resolve("metadata.xml").toString()}); } private void dumpKOSToText(String outputPath, String kosPath) throws Exception { DICOMUtility u = new DICOMUtility(); KOSBean bean = u.readKOS(kosPath); String s = bean.toString(); PrintWriter writer = new PrintWriter(outputPath, "UTF-8"); writer.println(s); writer.close(); } private void initializeMethodDryRun(String[] args) throws Exception { String simulator = getArg(args, 1); String pidDepartment = getArg(args, 2); String pidAffinityDomain = getArg(args, 3); Path dir = root.resolve("storage" + Utility.fs + "runtime").resolve(pidDepartment); Path std = dir.resolve("kos"); Path test = dir.resolve("test"); Files.createDirectories(test); this.deleteIfExists(test, "kos.dcm"); this.deleteIfExists(test, "metadata.xml"); this.fileMustExist(std, "kos.dcm"); this.fileMustExist(std, "metadata.xml"); ProcessNISTSimulatorLogs.main(new String[] {"GETKOS", simulator, pidAffinityDomain, "-", test.toString(), "kos.dcm"}); ProcessNISTSimulatorLogs.main(new String[] {"GETMETADATA", simulator, pidAffinityDomain, "-", test.toString(), "metadata.xml"}); this.fileMustExist(test, "kos.dcm"); this.fileMustExist(test, "metadata.xml"); // Path testPathKOS = test.resolve("kos.dcm"); // Path testPathMetadata = test.resolve("metadata.xml"); // Path stdPathKOS = std.resolve("kos.dcm"); // Path stdPathMetadata = std.resolve("metadata.xml"); } private void initializeMethodDryRun2(String[] args) throws Exception { String simulator = getArg(args, 1); String pidDepartment = getArg(args, 2); String pidAffinityDomain = getArg(args, 3); String label = getArg(args, 4); String extension = getArg(args, 5); String testName = getArg(args, 6); Path dir = root.resolve("storage" + Utility.fs + "ids" + Utility.fs + extension).resolve(pidDepartment); Path std = dir.resolve("kos"); Path test = root.resolve("results" + Utility.fs + label + Utility.fs + testName + Utility.fs + "data"); Files.createDirectories(test); this.deleteIfExists(test, "kos.dcm"); this.deleteIfExists(test, "metadata.xml"); this.fileMustExist(std, "kos.dcm"); this.fileMustExist(std, "metadata.xml"); ProcessNISTSimulatorLogs.main(new String[] {"GETKOS", simulator, pidAffinityDomain, "-", test.toString(), "kos.dcm"}); ProcessNISTSimulatorLogs.main(new String[] {"GETMETADATA", simulator, pidAffinityDomain, "-", test.toString(), "metadata.xml"}); this.fileMustExist(test, "kos.dcm"); this.fileMustExist(test, "metadata.xml"); Path testPathKOS = test.resolve("kos.dcm"); Path testPathMetadata = test.resolve("metadata.xml"); Path stdPathKOS = std.resolve("kos.dcm"); Path stdPathMetadata = std.resolve("metadata.xml"); } private void deleteIfExists(Path p, String filename) throws Exception { log.debug("TestRAD68ImagingDocumentSource::deleteIfExists start method " + p.toString() + " " + filename); Path filePath = p.resolve(filename); File f = filePath.toFile(); if (f.exists()) { log.debug("File does exist and will be deleted"); f.delete(); } } private void fileMustExist(Path p, String filename) throws Exception { log.debug("TestRAD68ImagingDocumentSource::fileMustExist start method " + p.toString() + " " + filename); File f = p.resolve(filename).toFile(); if (! f.exists()) { String s = p.resolve(filename).toString(); log.error("File does not exist; fileMustExist method throwing an exception: " + s); throw new Exception("File is missing and is required for operation: " + s); } } /** * Test harness. * <ol> * <li>First argument indicates method to test</li> * <ol> * <li>RUNTEST = initialize, run, get results</li> * </ol> * <li>Remainder of arguments are passed to method in order.</li> * </ol> * * @param args arguments */ public static void main(String[] args) { TestRAD68ImagingDocumentSource testRAD68ImagingDocumentSource = new TestRAD68ImagingDocumentSource(); try { testRAD68ImagingDocumentSource.initializeTest(args); testRAD68ImagingDocumentSource.runTest(); Results results = testRAD68ImagingDocumentSource .getResults("RAD-68 Imaging Document Source"); log.info("Test Results:" + Utility.nl + results); testRAD68ImagingDocumentSource.reportResults("RAD-68 Imaging Document Source"); } catch (Exception e) { e.printStackTrace(); } /* String cmd; String[] pars = { "-r", Utility.getXDSIRoot() + fs + "runDirectory" }; Util.initializeCommandLine("METHOD_TEST", pars, null); log = Util.getLog(); cmd = getArg(args, 0); log.info("Running " + cmd + " test"); try { if (cmd.equalsIgnoreCase("RUNTEST")) { TestRAD68ImagingDocumentSource test = new TestRAD68ImagingDocumentSource(); test.initializeTest(new String[] { args[1], args[2], args[3], args[4] }); test.runTest(); Results results = test.getResults(); log.info("Test Results:" + nl + results); } if (cmd.equalsIgnoreCase("TESTLOGS")) { // Args: // simulator name (e.g., xdsi01__rep-reg) // Patient ID: Department // Patient ID: Affinity Domain String simulator = getArg(args, 1); String pidDepartment = getArg(args, 2); String pidAffinityDomain = getArg(args, 3); Path dir = root.resolve("storage" + fs + "runtime").resolve(pidDepartment); Path std = dir.resolve("kos"); Path test = dir.resolve("test"); Files.createDirectories(test); ProcessNISTSimulatorLogs.main(new String[] {"GETKOS", simulator, pidAffinityDomain, "-", test.toString(), "kos.dcm"}); ProcessNISTSimulatorLogs.main(new String[] {"GETMETADATA", simulator, pidAffinityDomain, "-", test.toString(), "metadata.xml"}); TestRAD68ImagingDocumentSource testLogs = new TestRAD68ImagingDocumentSource(); testLogs.initializeTest(new String[] { test.resolve("kos.dcm").toString(), std.resolve("kos.dcm").toString(), test.resolve("metadata.xml").toString(), std.resolve("metadata.xml").toString()}); testLogs.runTest(); Results results = testLogs.getResults(); log.info("Test Results:" + nl + results); } log.info(cmd + " test completed"); } catch (Exception e) { log.fatal(cmd + " test failed"); e.printStackTrace(); } */ } private String getArg(String[] args, int arg) { if (args.length > arg) { String a = args[arg]; if (StringUtils.isBlank(a) || a.equals("-") || a.equals("_") || a.equalsIgnoreCase("null")) return null; return a.trim(); } return null; } /* private String getArg(Object[] args, int arg) { if (args.length > arg) { String a = (String) args[arg]; if (StringUtils.isBlank(a) || a.equals("-") || a.equals("_") || a.equalsIgnoreCase("null")) return null; return a.trim(); } return null; } */ }
84e1b3adbb1a20c5a41aa47610aa754fd9290ccd
1d064236be3ed83de183c6454aa38860f86fa66d
/src/main/java/cn/nukkit/network/protocol/PlayerArmorDamagePacket.java
7f1272496e04fd9efe335b9587aba7b692b54a51
[]
no_license
Tobias123567/NukkitPetteriM1Edition
ddf9699804e2a9b6458cc8fb5d8eb3989e139571
c4b76cb17d802f4833e367bf1ab5a20c7757add1
refs/heads/master
2023-03-13T15:34:32.587092
2021-03-10T16:04:58
2021-03-10T16:04:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,187
java
package cn.nukkit.network.protocol; import java.util.EnumSet; import java.util.Set; public class PlayerArmorDamagePacket extends DataPacket { public final Set<PlayerArmorDamageFlag> flags = EnumSet.noneOf(PlayerArmorDamageFlag.class); public final int[] damage = new int[4]; @Override public byte pid() { return ProtocolInfo.PLAYER_ARMOR_DAMAGE_PACKET; } @Override public void decode() { int flagsval = this.getByte(); for (int i = 0; i < 4; i++) { if ((flagsval & (1 << i)) != 0) { this.flags.add(PlayerArmorDamageFlag.values()[i]); this.damage[i] = this.getVarInt(); } } } @Override public void encode() { this.reset(); int outflags = 0; for (PlayerArmorDamageFlag flag : this.flags) { outflags |= 1 << flag.ordinal(); } this.putByte((byte) outflags); for (PlayerArmorDamageFlag flag : this.flags) { this.putVarInt(this.damage[flag.ordinal()]); } } public enum PlayerArmorDamageFlag { HELMET, CHESTPLATE, LEGGINGS, BOOTS } }
b5e1fb1e419d857065451bdc11fcd752a991e53d
64c2dbe5b7c3b33615ad712d98ebd9da523f98e3
/RA/.svn/pristine/af/af0ab0b0bdbec78578769070d12d7d6b6890c53c.svn-base
e37103419149b3a513f8fe176af1aac4f76acfcb
[ "Apache-2.0" ]
permissive
appi123/ResourceAdda
089cc0552edee6877f737a17730cda979afa3377
9eb0ec891a56b5262641b0a9c72c615eb4887488
refs/heads/master
2020-03-25T20:42:59.455801
2018-08-09T11:26:35
2018-08-09T11:26:35
144,142,302
0
0
null
null
null
null
UTF-8
Java
false
false
2,002
package com.ojas.ra.service; import java.util.List; import java.util.Map; import org.bson.types.ObjectId; import com.ojas.ra.domain.Address; import com.ojas.ra.exception.RAException; import com.ojas.ra.util.MongoAdvancedQuery; import com.ojas.ra.util.MongoSortVO; /** * * @author skkhadar * */ public interface AddressService { /** * * @param sort * @param pageNo * @param pageSize * @return */ List<Address> getAllObjects(MongoSortVO sort, int pageNo, int pageSize); /** * * @param id * @return */ boolean removeByPrimaryId(String id); /** * * @param condition * @return */ Address findOneByCondition(Map<String, Object> condition); /** * * @param addressMappingcondition * @param sort * @param pageNo * @param pageSize * @return */ List<Address> advancedFindByCondition(Map<String, MongoAdvancedQuery> addressMappingcondition, MongoSortVO sort, int pageNo, int pageSize); /** * * @param value * @return * @throws RAException */ Address findOneByPrimaryId(String value) throws RAException; /** * * @param condition * @param sort * @return * @throws RAException */ List<Address> findAllByCondition(Map<String, Object> condition, MongoSortVO sort) throws RAException; /** * * @param objId * @return * @throws RAException */ boolean deleteAddress(ObjectId objId) throws RAException; /** * * @param address * @return * @throws RAException */ boolean saveAddress(Address address) throws RAException; /** * * @param address * @return * @throws RAException */ boolean createAddress(Address address) throws RAException; /** * * @param condition * @param target * @return */ boolean updateMapByCondition(Map<String, Object> condition, Map<String, Object> target); /** * * @param sort * @param pageSize * @return */ int getPages(MongoSortVO sort, int pageSize); /** * * @param sort * @return */ int getCount(MongoSortVO sort); }
e2a13c1fb8513c5cc8ef8fd0e0b3edb149800c6d
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/google/android/gms/internal/gtm/zzpo.java
e039ae52cb05fa1646e46e5a4f91a4d94a1b352c
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,387
java
package com.google.android.gms.internal.gtm; import java.util.AbstractList; import java.util.Collection; import java.util.List; import java.util.RandomAccess; abstract class zzpo<E> extends AbstractList<E> implements zzrj<E> { private boolean zzavs = true; zzpo() { } public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof List)) { return false; } if (!(obj instanceof RandomAccess)) { return super.equals(obj); } List list = (List) obj; int size = size(); if (size != list.size()) { return false; } for (int i = 0; i < size; i++) { if (!get(i).equals(list.get(i))) { return false; } } return true; } public int hashCode() { int size = size(); int i = 1; for (int i2 = 0; i2 < size; i2++) { i = (i * 31) + get(i2).hashCode(); } return i; } public boolean add(E e2) { zzmz(); return super.add(e2); } public void add(int i, E e2) { zzmz(); super.add(i, e2); } public boolean addAll(Collection<? extends E> collection) { zzmz(); return super.addAll(collection); } public boolean addAll(int i, Collection<? extends E> collection) { zzmz(); return super.addAll(i, collection); } public void clear() { zzmz(); super.clear(); } public boolean zzmy() { return this.zzavs; } public final void zzmi() { this.zzavs = false; } public E remove(int i) { zzmz(); return super.remove(i); } public boolean remove(Object obj) { zzmz(); return super.remove(obj); } public boolean removeAll(Collection<?> collection) { zzmz(); return super.removeAll(collection); } public boolean retainAll(Collection<?> collection) { zzmz(); return super.retainAll(collection); } public E set(int i, E e2) { zzmz(); return super.set(i, e2); } /* access modifiers changed from: protected */ public final void zzmz() { if (!this.zzavs) { throw new UnsupportedOperationException(); } } }
f6b98792b71893536ac33c19b4946608cd9044c9
ce654d813cd148bb10223ebcbb95db4e39ae5f23
/COMP2603Marker/output/Ifeaye Murray_219483_assignsubmission_file_/Booking.java
fbe60d7118a2542a42a78b355357b66540ade4f4
[]
no_license
justkrismanohar/TA_Tools
e3fc8c75f3a5f07604a87ac4033ace82a5a9fe9a
bc08da4378e5038cef8710d2792c370606ea3102
refs/heads/master
2022-05-26T19:40:35.501672
2022-05-05T01:33:40
2022-05-05T01:33:40
179,185,808
1
0
null
2022-05-05T02:26:57
2019-04-03T01:21:37
HTML
UTF-8
Java
false
false
800
java
//816007834 public class Booking { private static int bookingIDCounter=1; private int bookingID; private String description; private int duration; private String location; private int numSeating; public Booking(String description, int duration, int numSeating) { this.description=description; this.duration=duration; this.numSeating=numSeating; bookingID=bookingIDCounter; bookingIDCounter++; } public int getBookingID() { return bookingID; } public void setLocation(String roomID) { this.location=roomID; } public String toString() { return "Booking ID: " + bookingID + " Description: " + description + " Duration: " + duration + " Location: " + location; } }
3b0e58bde77b4fbb2173ea3834c4d2fad763e4e7
d754c98b8e0835e2a4eba8061789660d98952d73
/src/main/java/br/com/spot/ecommerceintegration/integrations/bling/model/ProdutoLoja.java
5bc7ada3325aada693530c93b3656851d8932c93
[]
no_license
gcbrandao/ecommerce-integration
fd69fc38d526d7e10930303c409eae2c9c5920ad
5c8094bdf95594e0cbef4bcc3a02ce00b7d2c06c
refs/heads/main
2023-04-19T04:27:20.561705
2021-05-07T20:53:22
2021-05-07T20:53:22
340,776,671
0
0
null
null
null
null
UTF-8
Java
false
false
739
java
package br.com.spot.ecommerceintegration.integrations.bling.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.*; import java.time.LocalDate; import java.util.List; @Getter @Setter @Builder @ToString @NoArgsConstructor @AllArgsConstructor @JsonIgnoreProperties(ignoreUnknown = true) public class ProdutoLoja { @JsonProperty("idProdutoLoja") private String idProdutoLoja; @JsonProperty("preco") private Preco preco; @JsonProperty("dataInclusao") private LocalDate dataInclusao; @JsonProperty("dataAlteracao") private LocalDate dataAlteracao; @JsonProperty("categoria") private List<Categoria> categoria; }
fd51ed809670e40d336ae2d0902cb6b5ebd19cb7
21e6339abe1d01daad65d50cbf003bbac9bce123
/src/main/java/store/Observable.java
f56c730b7baf0618dace43dd04adb63c8e16535a
[]
no_license
vdovych/store
7ed7ce6fd301b11976ec5e8d4d403403d77e494c
6ccb2a272b4fea22465360d4219158e63c230c85
refs/heads/master
2021-09-01T00:01:14.356331
2017-12-23T16:31:38
2017-12-23T16:31:38
110,579,290
0
0
null
null
null
null
UTF-8
Java
false
false
545
java
package store; import java.util.LinkedList; import java.util.List; public abstract class Observable { protected List<Observer> observers; public Observable(){ observers = new LinkedList<Observer>(); } public void addObserver(Observer observer){ observers.add(observer); } public void removeObserver(Observer observer){ observers.remove(observer); } public void notifyObservers(){ for (Observer observer: observers) { observer.update(); } } }
d29e7ce7296329d62d78b1b3cd9903559b00eb4b
0f30534c22dbc1abe4543d8553eb02e65c9572ad
/src/main/java/com/app/models/ShipOrientation.java
56fb2a2638e4ef2ce25226535780615fa9ec7485
[]
no_license
nickmage/Battleship
b3b40e3f9e66780e11cd3f0300ba4b351a68972e
e06dd7006753a5076f6a41818b555579f2f82958
refs/heads/master
2022-11-25T17:28:51.120981
2020-01-29T13:53:22
2020-01-29T13:53:22
208,830,984
0
0
null
2022-11-16T08:56:37
2019-09-16T15:13:54
Java
UTF-8
Java
false
false
88
java
package com.app.models; public enum ShipOrientation { HORIZONTAL, VERTICAL, NONE }
67016f9079f943107231b0e78cc191d9427eba15
a75cabd71746222d7073c3dfaab2e773b7fd165a
/brad2101/src/tw/brad/j2ee/Brad54.java
278faf72bac5a0f55bfa08183476a1d2496eaa53
[]
no_license
bradchao/III2101_J2EE
8a2f2b9a3879203d76b9fd0eefe5aebb7fcb142f
7f671c5419bace081d13e83a7feb96df23260d62
refs/heads/master
2020-12-03T02:26:24.666382
2017-07-23T08:03:39
2017-07-23T08:03:39
95,938,379
0
1
null
null
null
null
UTF-8
Java
false
false
786
java
package tw.brad.j2ee; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/Brad54") public class Brad54 extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html; charset=UTF-8"); PrintWriter out = response.getWriter(); request.setCharacterEncoding("UTF-8"); try { Thread.sleep( 30 * 1000); } catch (InterruptedException e) { } out.print("OK:" + (int)(Math.random()*49+1)); } }
3a6d3dd603b3a8608d632069d0ae004076ed4c68
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-422-32-21-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/wikimodel/xhtml/XhtmlParser_ESTest.java
2a998d1c8cb29a022926a4a20eab09d9fa89c780
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
564
java
/* * This file was automatically generated by EvoSuite * Tue Apr 07 01:03:39 UTC 2020 */ package org.xwiki.rendering.wikimodel.xhtml; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class XhtmlParser_ESTest extends XhtmlParser_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
e38a6628a00304279a25d71ade3f05159cf77832
18ba32a4973cb0d1b9c1ea2c65a366909377a6a7
/app/src/main/java/com/example/fitnessapp/Activity/Sunday_45.java
a46d11fa8ec49e1b58ae8ef6633ed700e1886a97
[]
no_license
abhibarkade111/Fitness-Point
05d71b48dfb0b4b89efab9952a0e9bb57fd8b5de
c944b4d80fbbad894b71951cf6eee3f0489d3844
refs/heads/master
2023-08-28T07:15:12.282469
2021-11-01T14:42:32
2021-11-01T14:42:32
423,499,431
0
0
null
null
null
null
UTF-8
Java
false
false
781
java
package com.example.fitnessapp.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import androidx.appcompat.app.AppCompatActivity; import com.example.fitnessapp.R; public class Sunday_45 extends AppCompatActivity { private ImageView backBtn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sunday45); backBtn = findViewById(R.id.backSunday45); backBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(Sunday_45.this,AboveMiddleHome.class)); } }); } }
6b0d18d7496c5abe4ff959795d0c970d732a2b57
17aae95c0fc919cc00092a8a2cda675f08c79901
/web/src/dept/LocationDAO.java
0687e6c4391620c56a349ff65f297217100527cb
[]
no_license
youn1995/Yedam_JSP
c21ce59b53a06ce199eefdee5499cfc45a7a83f2
a83df0b47549174ba9df72398349d85158699b8e
refs/heads/master
2022-12-18T11:15:48.776419
2020-09-29T02:01:22
2020-09-29T02:01:22
290,443,906
0
0
null
null
null
null
UTF-8
Java
false
false
1,127
java
package dept; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; import java.util.HashMap; import common.ConnectionManager; public class LocationDAO { //싱글톤 private static LocationDAO instance = new LocationDAO(); public static LocationDAO getInstance() { return instance; } //전체조회 public ArrayList<HashMap<String, String>> selectAll() { ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>(); Connection conn = null; try { //3.Statement conn = ConnectionManager.getConnnect(); String sql=" select location_id, city " + " from hr.locations order by city "; PreparedStatement pstmt = conn.prepareStatement(sql); ResultSet rs = pstmt.executeQuery(); while(rs.next()) { HashMap<String, String> map = new HashMap<String, String>(); map.put("location_id", rs.getString(1)); map.put("city",rs.getString(2)); list.add(map); } } catch (Exception e) { e.printStackTrace(); } System.out.println(list); return list; } }
b5db26e0432750731de8eae6ef7f115ef565cbce
9e002eeff4e64eb048714eb9761f6e470ee4d56b
/swingx/swingx/src/org/jdesktop/swingx/JXCollapsiblePaneBeanInfo.java
2d187a3e9ebedbb1e63572b5a2ff3fae4b58564f
[]
no_license
Richie-Z/java-smk
edb31ab5348c96ac04d65846418626196530cabd
98b7d724624b3a43e63f2194c79c481c723a0cba
refs/heads/master
2023-08-30T14:22:29.695973
2021-11-03T07:01:52
2021-11-03T07:01:52
424,120,896
2
0
null
null
null
null
UTF-8
Java
false
false
6,487
java
/* * $Id: JXCollapsiblePaneBeanInfo.java,v 1.3 2005/10/10 18:01:49 rbair Exp $ * * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package org.jdesktop.swingx; import java.awt.Image; import java.beans.BeanDescriptor; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.MethodDescriptor; import java.beans.PropertyDescriptor; import java.beans.SimpleBeanInfo; import java.lang.reflect.Method; import java.util.Vector; /** * BeanInfo class for JXCollapsiblePane. */ public class JXCollapsiblePaneBeanInfo extends SimpleBeanInfo { /** Description of the Field */ protected BeanDescriptor bd = new BeanDescriptor(JXCollapsiblePane.class); /** Description of the Field */ protected Image iconMono16; /** Description of the Field */ protected Image iconColor16; /** Description of the Field */ protected Image iconMono32; /** Description of the Field */ protected Image iconColor32; /** Constructor for the JXCollapsiblePaneBeanInfo object */ public JXCollapsiblePaneBeanInfo() throws java.beans.IntrospectionException { // setup bean descriptor in constructor. bd.setName("JXCollapsiblePane"); bd.setShortDescription("A pane which hides its content with an animation."); bd.setValue("isContainer",Boolean.TRUE); bd.setValue("containerDelegate","getContentPane"); BeanInfo info = Introspector.getBeanInfo(getBeanDescriptor().getBeanClass().getSuperclass()); String order = info.getBeanDescriptor().getValue("propertyorder") == null ? "" : (String) info.getBeanDescriptor().getValue("propertyorder"); PropertyDescriptor[] pd = getPropertyDescriptors(); for (int i = 0; i != pd.length; i++) { if (order.indexOf(pd[i].getName()) == -1) { order = order + (order.length() == 0 ? "" : ":") + pd[i].getName(); } } getBeanDescriptor().setValue("propertyorder", order); } /** * Gets the additionalBeanInfo * * @return The additionalBeanInfo value */ public BeanInfo[] getAdditionalBeanInfo() { Vector bi = new Vector(); BeanInfo[] biarr = null; try { for (Class cl = JXCollapsiblePane.class.getSuperclass(); !cl.equals(java.awt.Component.class.getSuperclass()); cl = cl.getSuperclass()) { bi.addElement(Introspector.getBeanInfo(cl)); } biarr = new BeanInfo[bi.size()]; bi.copyInto(biarr); } catch (Exception e) { // Ignore it } return biarr; } /** * Gets the beanDescriptor * * @return The beanDescriptor value */ public BeanDescriptor getBeanDescriptor() { return bd; } /** * Gets the defaultPropertyIndex * * @return The defaultPropertyIndex value */ public int getDefaultPropertyIndex() { String defName = ""; if (defName.equals("")) { return -1; } PropertyDescriptor[] pd = getPropertyDescriptors(); for (int i = 0; i < pd.length; i++) { if (pd[i].getName().equals(defName)) { return i; } } return -1; } /** * Gets the icon * * @param type Description of the Parameter * @return The icon value */ public Image getIcon(int type) { if (type == BeanInfo.ICON_COLOR_16x16) { return iconColor16; } if (type == BeanInfo.ICON_MONO_16x16) { return iconMono16; } if (type == BeanInfo.ICON_COLOR_32x32) { return iconColor32; } if (type == BeanInfo.ICON_MONO_32x32) { return iconMono32; } return null; } /** * Gets the Property Descriptors * * @return The propertyDescriptors value */ public PropertyDescriptor[] getPropertyDescriptors() { try { Vector descriptors = new Vector(); PropertyDescriptor descriptor = null; try { descriptor = new PropertyDescriptor("animated", JXCollapsiblePane.class); } catch (IntrospectionException e) { descriptor = new PropertyDescriptor("animated", JXCollapsiblePane.class, "getAnimated", null); } descriptor.setPreferred(true); descriptor.setBound(true); descriptors.add(descriptor); try { descriptor = new PropertyDescriptor("collapsed", JXCollapsiblePane.class); } catch (IntrospectionException e) { descriptor = new PropertyDescriptor("collapsed", JXCollapsiblePane.class, "getCollapsed", null); } descriptor.setPreferred(true); descriptor.setBound(true); descriptors.add(descriptor); return (PropertyDescriptor[]) descriptors.toArray(new PropertyDescriptor[descriptors.size()]); } catch (Exception e) { // Ignored } return null; } /** * Gets the methodDescriptors attribute ... * * @return The methodDescriptors value */ public MethodDescriptor[] getMethodDescriptors() { Vector descriptors = new Vector(); MethodDescriptor descriptor = null; Method[] m; Method method; try { m = Class.forName("org.jdesktop.swingx.JXCollapsiblePane").getMethods(); } catch (ClassNotFoundException e) { return new MethodDescriptor[0]; } return (MethodDescriptor[]) descriptors.toArray(new MethodDescriptor[descriptors.size()]); } }
3e52f6dd75159d6b71f44d421acdec24ef00df17
798768b4c78f627f9868c5272d5e361cd7f91af9
/src/main/java/CoinEnum/Coins.java
eacf6facbfcefd32872483dd2d5fa5da36fae9ec
[]
no_license
alon-hoffman/CoinFactoryTest
120d2a61aa36be972475709ba3d2be6d50d9e667
3a5c569ef41c1acb149bc46fdf11e09b13783668
refs/heads/master
2022-12-10T11:11:25.094393
2020-09-10T11:49:16
2020-09-10T11:49:16
294,394,216
0
0
null
null
null
null
UTF-8
Java
false
false
62
java
package CoinEnum; public enum Coins { ILS, USD, Unknown }
2f2d3134287e12169737b4f4d8b12ee3acb37ecb
14a7ea722bbbd78f965439fe9a5c5b06b1532336
/src/main/java/imie/campus/core/contexts/AuthRequestContext.java
ba43c2447b43ce6cd2224fab5f59f227913ef6b4
[]
no_license
Ziguard/Java_CovoiturageBack
4271964ad56177ae594210c4224f6c097a205d58
dc142813fd279e1be4b08c8fd9f7ddcfca8092df
refs/heads/master
2020-03-27T11:07:07.009763
2018-08-28T15:14:45
2018-08-28T15:14:45
146,466,510
0
0
null
null
null
null
UTF-8
Java
false
false
749
java
package imie.campus.core.contexts; import imie.campus.security.model.UserTemplate; import javax.servlet.ServletRequest; import java.util.Optional; public interface AuthRequestContext<U extends UserTemplate<?>> extends RequestContext { Optional<U> authenticatedUser(); static <U extends UserTemplate<?>> AuthRequestContext from( final ServletRequest request, final U user) { return new AuthRequestContext() { @Override public Optional<? extends UserTemplate<?>> authenticatedUser() { return Optional.ofNullable(user); } @Override public ServletRequest request() { return request; } }; } }
cbde20defa0a303b7fb6794d61b2684042f7d57f
92225460ebca1bb6a594d77b6559b3629b7a94fa
/src/com/kingdee/eas/fdc/sellhouse/AFMortgagedApproachEntry.java
8ff1383bc4852af15c6e5aa88aa6bcae48e433c9
[]
no_license
yangfan0725/sd
45182d34575381be3bbdd55f3f68854a6900a362
39ebad6e2eb76286d551a9e21967f3f5dc4880da
refs/heads/master
2023-04-29T01:56:43.770005
2023-04-24T05:41:13
2023-04-24T05:41:13
512,073,641
0
1
null
null
null
null
UTF-8
Java
false
false
9,911
java
package com.kingdee.eas.fdc.sellhouse; import com.kingdee.bos.framework.ejb.EJBRemoteException; import com.kingdee.bos.util.BOSObjectType; import java.rmi.RemoteException; import com.kingdee.bos.framework.AbstractBizCtrl; import com.kingdee.bos.orm.template.ORMObject; import java.lang.String; import com.kingdee.eas.common.EASBizException; import com.kingdee.bos.metadata.entity.EntityViewInfo; import com.kingdee.bos.dao.IObjectPK; import com.kingdee.eas.fdc.sellhouse.app.*; import com.kingdee.bos.metadata.entity.SelectorItemCollection; import com.kingdee.bos.metadata.entity.SorterItemCollection; import com.kingdee.eas.framework.CoreBaseCollection; import com.kingdee.bos.util.*; import com.kingdee.bos.metadata.entity.FilterInfo; import com.kingdee.bos.BOSException; import com.kingdee.bos.Context; import com.kingdee.eas.framework.CoreBaseInfo; import com.kingdee.bos.framework.*; import com.kingdee.eas.framework.BillEntryBase; import com.kingdee.eas.framework.IBillEntryBase; public class AFMortgagedApproachEntry extends BillEntryBase implements IAFMortgagedApproachEntry { public AFMortgagedApproachEntry() { super(); registerInterface(IAFMortgagedApproachEntry.class, this); } public AFMortgagedApproachEntry(Context ctx) { super(ctx); registerInterface(IAFMortgagedApproachEntry.class, this); } public BOSObjectType getType() { return new BOSObjectType("95476B82"); } private AFMortgagedApproachEntryController getController() throws BOSException { return (AFMortgagedApproachEntryController)getBizController(); } /** *exists-System defined method *@param pk pk *@return */ public boolean exists(IObjectPK pk) throws BOSException, EASBizException { try { return getController().exists(getContext(), pk); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *exists-System defined method *@param filter filter *@return */ public boolean exists(FilterInfo filter) throws BOSException, EASBizException { try { return getController().exists(getContext(), filter); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *exists-System defined method *@param oql oql *@return */ public boolean exists(String oql) throws BOSException, EASBizException { try { return getController().exists(getContext(), oql); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getValue-System defined method *@param pk pk *@return */ public AFMortgagedApproachEntryInfo getAFMortgagedApproachEntryInfo(IObjectPK pk) throws BOSException, EASBizException { try { return getController().getAFMortgagedApproachEntryInfo(getContext(), pk); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getValue-System defined method *@param pk pk *@param selector selector *@return */ public AFMortgagedApproachEntryInfo getAFMortgagedApproachEntryInfo(IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException { try { return getController().getAFMortgagedApproachEntryInfo(getContext(), pk, selector); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getValue-System defined method *@param oql oql *@return */ public AFMortgagedApproachEntryInfo getAFMortgagedApproachEntryInfo(String oql) throws BOSException, EASBizException { try { return getController().getAFMortgagedApproachEntryInfo(getContext(), oql); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *addnew-System defined method *@param model model *@return */ public IObjectPK addnew(AFMortgagedApproachEntryInfo model) throws BOSException, EASBizException { try { return getController().addnew(getContext(), model); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *addnew-System defined method *@param pk pk *@param model model */ public void addnew(IObjectPK pk, AFMortgagedApproachEntryInfo model) throws BOSException, EASBizException { try { getController().addnew(getContext(), pk, model); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *update-System defined method *@param pk pk *@param model model */ public void update(IObjectPK pk, AFMortgagedApproachEntryInfo model) throws BOSException, EASBizException { try { getController().update(getContext(), pk, model); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *updatePartial-System defined method *@param model model *@param selector selector */ public void updatePartial(AFMortgagedApproachEntryInfo model, SelectorItemCollection selector) throws BOSException, EASBizException { try { getController().updatePartial(getContext(), model, selector); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *updateBigObject-System defined method *@param pk pk *@param model model */ public void updateBigObject(IObjectPK pk, AFMortgagedApproachEntryInfo model) throws BOSException { try { getController().updateBigObject(getContext(), pk, model); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *delete-System defined method *@param pk pk */ public void delete(IObjectPK pk) throws BOSException, EASBizException { try { getController().delete(getContext(), pk); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getPKList-System defined method *@return */ public IObjectPK[] getPKList() throws BOSException, EASBizException { try { return getController().getPKList(getContext()); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getPKList-System defined method *@param oql oql *@return */ public IObjectPK[] getPKList(String oql) throws BOSException, EASBizException { try { return getController().getPKList(getContext(), oql); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getPKList-System defined method *@param filter filter *@param sorter sorter *@return */ public IObjectPK[] getPKList(FilterInfo filter, SorterItemCollection sorter) throws BOSException, EASBizException { try { return getController().getPKList(getContext(), filter, sorter); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getCollection-System defined method *@return */ public AFMortgagedApproachEntryCollection getAFMortgagedApproachEntryCollection() throws BOSException { try { return getController().getAFMortgagedApproachEntryCollection(getContext()); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getCollection-System defined method *@param view view *@return */ public AFMortgagedApproachEntryCollection getAFMortgagedApproachEntryCollection(EntityViewInfo view) throws BOSException { try { return getController().getAFMortgagedApproachEntryCollection(getContext(), view); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *getCollection-System defined method *@param oql oql *@return */ public AFMortgagedApproachEntryCollection getAFMortgagedApproachEntryCollection(String oql) throws BOSException { try { return getController().getAFMortgagedApproachEntryCollection(getContext(), oql); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *delete-System defined method *@param filter filter *@return */ public IObjectPK[] delete(FilterInfo filter) throws BOSException, EASBizException { try { return getController().delete(getContext(), filter); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *delete-System defined method *@param oql oql *@return */ public IObjectPK[] delete(String oql) throws BOSException, EASBizException { try { return getController().delete(getContext(), oql); } catch(RemoteException err) { throw new EJBRemoteException(err); } } /** *delete-System defined method *@param arrayPK arrayPK */ public void delete(IObjectPK[] arrayPK) throws BOSException, EASBizException { try { getController().delete(getContext(), arrayPK); } catch(RemoteException err) { throw new EJBRemoteException(err); } } }
3eac4e3f91080b2445203f456372381a413ae741
9a2cb0307cf68116e4cb29961a18999416b31907
/src/main/java/com/nhom19/laptopapi/dto/CartDto.java
3181c114bf3a41cf8a4c98b806219a3690a52b36
[]
no_license
xuannam2512/Shoplaptop-softwaremodel
2bed4753cc41bcaee5cfb2a6090bdaf581bedc35
44965a9705691fdc85f19f1538189ca485debc28
refs/heads/master
2020-04-13T18:30:27.114303
2018-12-28T06:46:18
2018-12-28T06:46:18
163,376,231
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package com.nhom19.laptopapi.dto; import java.util.Date; import java.util.List; import com.nhom19.laptopapi.model.CartDetail; import com.nhom19.laptopapi.model.User; public class CartDto { private int id; private Date date; private User user; private List<CartDetail> cartDetails; public int getId() { return id; } public void setId(int id) { this.id = id; } public Date getDate() { return date; } public void setDate(Date date) { this.date = date; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public List<CartDetail> getCartDetails() { return cartDetails; } public void setCartDetails(List<CartDetail> cartDetails) { this.cartDetails = cartDetails; } }
f5742a5f987b80f4cb3a7082130ed7d35a410d33
d78b17cd653fea36fe0c1075d8e80ab95090c474
/src/main/java/com/example/SpringBootWebApplication.java
5ac2d2228af59371f2aae9318db552a93966d176
[]
no_license
khakiout/spring-boot-demo-api
921885035905134f8efc5aa463225a087f870f6f
70d72aeb9425b8226e9748f3d3b4bef2951cbf0f
refs/heads/master
2020-03-26T13:21:07.543085
2018-08-06T16:23:33
2018-08-06T16:23:33
144,934,399
0
0
null
null
null
null
UTF-8
Java
false
false
329
java
package com.example; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringBootWebApplication { public static void main(String[] args) { SpringApplication.run(SpringBootWebApplication.class, args); } }
17f829451cc6b1917f956d2f04152ebfa3e7180e
25794a6e12fe1961aafdb0f8296d7016e30ba6f3
/src/util/EmailUtility.java
99ba5946363e8332dd99d4325d361642637a7d79
[]
no_license
meet1612/user_FinanceBank
d724c5da722a24fd44c650654c5633a55fdb1c30
638a24e22069dc939a8bd1aa5caa9f0eac286172
refs/heads/master
2023-02-05T07:26:51.539483
2020-12-26T10:07:37
2020-12-26T10:07:37
324,428,893
0
0
null
null
null
null
UTF-8
Java
false
false
1,758
java
package util; import java.util.Date; import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class EmailUtility { public static void sendEmail(String host, String port, final String userName, final String password, String toAddress, String subject, String message) throws AddressException, MessagingException { // sets SMTP server properties Properties properties = new Properties(); properties.put("mail.smtp.host", host); properties.put("mail.smtp.port", port); properties.put("mail.smtp.auth", "true"); properties.put("mail.smtp.starttls.enable", "true"); // creates a new session with an authenticator Authenticator auth = new Authenticator() { public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(userName, password); } }; Session session = Session.getInstance(properties, auth); // creates a new e-mail message Message msg = new MimeMessage(session); msg.setFrom(new InternetAddress(userName)); InternetAddress[] toAddresses = { new InternetAddress(toAddress) }; msg.setRecipients(Message.RecipientType.TO, toAddresses); msg.setSubject(subject); msg.setSentDate(new Date()); msg.setText(message); // sends the e-mail Transport.send(msg); } }
a176f93fae86ea5e3b33883ea5f6886d206f274c
46b1fb87b930927d13efa108324291efe53eef1f
/fastyaml/src/main/java/serialize/TableCols/Column.java
146644470fcc925a00a2bc2c4f27b1776c6bb04d
[]
no_license
chris-henderson-alation/hackathon_2019
093f1b3b04f83ce98f45ecb68f24cfc5888e041a
4f4beb025cf552502cc2bf5486619f4ced477197
refs/heads/master
2020-06-22T04:24:52.588878
2019-07-18T21:25:37
2019-07-18T21:25:37
197,632,233
0
0
null
null
null
null
UTF-8
Java
false
false
1,987
java
package serialize.TableCols; import serialize.HiveToJDBC; import serialize.ObjectName; import org.apache.hadoop.hive.metastore.api.FieldSchema; import java.util.Objects; /** * Derived from alation.extractor.adbc.core.base.DbColumn */ public class Column { // https://yaml.org/type/bool.html // Which is to say, yes, "Y" and "N" are // apparently valid YAML boolean types. public enum Nullable { Y, N, } public String m_columnName; public String m_normType; public Nullable m_nullable; public String m_remarks; public String m_typeName; public int m_ordinalPosition; public ObjectName m_objName; public Column(FieldSchema col, ObjectName m_objName, int m_ordinalPosition) { this.m_columnName = col.getName(); this.m_normType = HiveToJDBC.toJDBCTypeString(col.getType()); this.m_nullable = Nullable.Y; this.m_typeName = col.getType(); this.m_remarks = col.getComment(); this.m_objName = m_objName; this.m_ordinalPosition = m_ordinalPosition; } // Empty constructors are necessary for snakeyaml to deserialize these. public Column() { } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Column column = (Column) o; return m_ordinalPosition == column.m_ordinalPosition && Objects.equals(m_columnName, column.m_columnName) && Objects.equals(m_normType, column.m_normType) && m_nullable == column.m_nullable && Objects.equals(m_remarks, column.m_remarks) && Objects.equals(m_typeName, column.m_typeName) && Objects.equals(m_objName, column.m_objName); } @Override public int hashCode() { return Objects.hash(m_columnName, m_normType, m_nullable, m_remarks, m_typeName, m_ordinalPosition, m_objName); } }
a0862b163102d2b4c418b609fb413eb968e0f5df
23f4d78623458d375cf23b7017c142dd45c32481
/Core/orient-sysmodel/com/orient/sysmodel/domain/mq/CwmMsg.java
a39e92a1b9590278f9bb294a35ae7f1ba6bf0d83
[]
no_license
lcr863254361/weibao_qd
4e2165efec704b81e1c0f57b319e24be0a1e4a54
6d12c52235b409708ff920111db3e6e157a712a6
refs/heads/master
2023-04-03T00:37:18.947986
2021-04-11T15:12:45
2021-04-11T15:12:45
356,436,350
0
0
null
null
null
null
UTF-8
Java
false
false
4,369
java
package com.orient.sysmodel.domain.mq; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; /** * ${DESCRIPTION} * * @author Administrator * @create 2016-12-15 14:43 */ @Entity @Table(name = "CWM_MSG") public class CwmMsg { public static final String TYPE_COLLAB_FEEDBACK = "feedback"; private Long id; private String title; private String content; private String data; private Long timestamp; private Long userId; private String type; private String src; private String dest; private Boolean readed; @Id @Column(name = "ID", nullable = false, insertable = true, updatable = true, precision = -127) @GeneratedValue(generator = "sequence") @GenericGenerator(name = "sequence", strategy = "sequence", parameters = {@org.hibernate.annotations.Parameter(name = "sequence", value = "SEQ_CWM_MSG")}) public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Basic @Column(name = "TITLE") public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } @Basic @Column(name = "CONTENT") public String getContent() { return content; } public void setContent(String content) { this.content = content; } @Basic @Column(name = "DATA") public String getData() { return data; } public void setData(String data) { this.data = data; } @Basic @Column(name = "TIMESTAMP") public Long getTimestamp() { return timestamp; } public void setTimestamp(Long timestamp) { this.timestamp = timestamp; } @Basic @Column(name = "USER_ID") public Long getUserId() { return userId; } public void setUserId(Long userId) { this.userId = userId; } @Basic @Column(name = "TYPE") public String getType() { return type; } public void setType(String type) { this.type = type; } @Basic @Column(name = "SRC") public String getSrc() { return src; } public void setSrc(String src) { this.src = src; } @Basic @Column(name = "DEST") public String getDest() { return dest; } public void setDest(String dest) { this.dest = dest; } @Basic @Column(name = "READED") public Boolean getReaded() { return readed; } public void setReaded(Boolean readed) { this.readed = readed; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CwmMsg cwmMsg = (CwmMsg) o; if (id != null ? !id.equals(cwmMsg.id) : cwmMsg.id != null) return false; if (title != null ? !title.equals(cwmMsg.title) : cwmMsg.title != null) return false; if (content != null ? !content.equals(cwmMsg.content) : cwmMsg.content != null) return false; if (timestamp != null ? !timestamp.equals(cwmMsg.timestamp) : cwmMsg.timestamp != null) return false; if (userId != null ? !userId.equals(cwmMsg.userId) : cwmMsg.userId != null) return false; if (type != null ? !type.equals(cwmMsg.type) : cwmMsg.type != null) return false; if (src != null ? !src.equals(cwmMsg.src) : cwmMsg.src != null) return false; if (dest != null ? !dest.equals(cwmMsg.dest) : cwmMsg.dest != null) return false; if (readed != null ? !readed.equals(cwmMsg.readed) : cwmMsg.readed != null) return false; return true; } @Override public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (title != null ? title.hashCode() : 0); result = 31 * result + (content != null ? content.hashCode() : 0); result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0); result = 31 * result + (userId != null ? userId.hashCode() : 0); result = 31 * result + (type != null ? type.hashCode() : 0); result = 31 * result + (src != null ? src.hashCode() : 0); result = 31 * result + (dest != null ? dest.hashCode() : 0); result = 31 * result + (readed != null ? readed.hashCode() : 0); return result; } }
[ "lcr18015367626" ]
lcr18015367626
94b2952ef57c278664f85f6863a7b4cd9dd6ac3a
83ff7210c53a80febd72c665fcda3d6136ea9ed0
/tuyaTest/src/main/java/com/tuya/smart/android/demo/presenter/SharedMemberAddPresenter.java
24bb97ae51ff87db8d56619be36321dfaf64345e
[]
no_license
ClarePhang/tuyasmart_android_sdk
21eb62d254c9565b979ac52772a0b5a1c5c9ac08
4d973bdec87de550bf355dd138699b194704977e
refs/heads/master
2020-12-25T15:40:18.029189
2016-09-02T05:44:36
2016-09-02T05:44:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,317
java
package com.tuya.smart.android.demo.presenter; import android.app.Activity; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Message; import android.provider.ContactsContract; import android.text.TextUtils; import com.tuya.smart.android.demo.R; import com.tuya.smart.android.demo.activity.CountryListActivity; import com.tuya.smart.android.demo.event.FriendEventModel; import com.tuya.smart.android.demo.model.SharedMemberAddModel; import com.tuya.smart.android.demo.model.SharedModel; import com.tuya.smart.android.demo.test.event.EventSender; import com.tuya.smart.android.demo.test.utils.DialogUtil; import com.tuya.smart.android.demo.utils.CountryUtils; import com.tuya.smart.android.demo.utils.ProgressUtil; import com.tuya.smart.android.demo.utils.ToastUtil; import com.tuya.smart.android.demo.view.ISharedMemberAddView; import com.tuya.smart.android.mvp.bean.Result; import com.tuya.smart.android.mvp.presenter.BasePresenter; import com.tuya.smart.android.user.bean.PersonBean; import com.tuya.smart.sdk.TuyaSdk; import java.util.ArrayList; /** * Created by leaf on 15/12/21. * 收到的共享 */ public class SharedMemberAddPresenter extends BasePresenter { private static final String TAG = "SharedMemberAddPresenter"; public static final int REQUEST_TO_PICK_CONTACT = 0x030; public static final int REQUEST_TO_COUNTRY_LIST = 0x031; private Activity mActivity; protected ISharedMemberAddView mView; protected SharedModel mSharedModel; protected SharedMemberAddModel mModel; private PersonBean mPerson; private String mCountryCode; private String mCountryName; public SharedMemberAddPresenter(Activity activity, ISharedMemberAddView view) { mActivity = activity; mView = view; mModel = new SharedMemberAddModel(activity, mHandler); mSharedModel = new SharedModel(activity, mHandler); } @Override public void onDestroy() { super.onDestroy(); mModel.onDestroy(); mSharedModel.onDestroy(); } public void add() { String mobile = mView.getMobile(); String code = mCountryCode; if (verify(mobile)) { mPerson = new PersonBean(); mPerson.setMobile(mobile); ProgressUtil.showLoading(mActivity, R.string.loading); mSharedModel.addMember(mobile, "", code, ""); } } private boolean verify(String mobile) { if (TextUtils.isEmpty(mobile)) { ToastUtil.showToast(mActivity, R.string.username_phone_is_null); } else { return true; } return false; } @Override public boolean handleMessage(Message msg) { switch (msg.what) { case SharedModel.WHAT_ADD_SENT_SUCCESS: ProgressUtil.hideLoading(); mPerson.setId((Integer) ((Result) msg.obj).getObj()); EventSender.friendUpdate(null, FriendEventModel.OP_QUERY); mActivity.finish(); break; case SharedModel.WHAT_ERROR: ProgressUtil.hideLoading(); DialogUtil.simpleSmartDialog(mActivity, ((Result) msg.obj).error, null); break; } return super.handleMessage(msg); } public ArrayList<String> getRelationNameList() { return mModel.getRelationNameList(); } public void gotoPickContact() { Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); mActivity.startActivityForResult(intent, REQUEST_TO_PICK_CONTACT); } public void onActivityResult(int reqCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { switch (reqCode) { case (REQUEST_TO_PICK_CONTACT): Uri contactData = data.getData(); Cursor c = mActivity.managedQuery(contactData, null, null, null, null); if (c.moveToFirst()) { String name = c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)); String hasPhone = c.getString(c.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER)); String contactId = c.getString(c.getColumnIndex(ContactsContract.Contacts._ID)); String phoneNumber = null; if (hasPhone.equalsIgnoreCase("1")) { Cursor phones = mActivity.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = " + contactId, null, null); while (phones.moveToNext()) { phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); } phones.close(); } if (null != phoneNumber) mView.setMobile(phoneNumber.replace(" ", "").replace("+86", "").replace("-", "")); } break; case REQUEST_TO_COUNTRY_LIST: mCountryName = data.getStringExtra(CountryListActivity.COUNTRY_NAME); mCountryCode = data.getStringExtra(CountryListActivity.PHONE_CODE); mView.setCountry(mCountryName, mCountryCode); break; } } } public void getCountry() { String countryKey = CountryUtils.getCountryKey(TuyaSdk.getApplication()); if (!TextUtils.isEmpty(countryKey)) { mCountryName = CountryUtils.getCountryTitle(countryKey); mCountryCode = CountryUtils.getCountryNum(countryKey); } else { countryKey = CountryUtils.getCountryDefault(TuyaSdk.getApplication()); mCountryName = CountryUtils.getCountryTitle(countryKey); mCountryCode = CountryUtils.getCountryNum(countryKey); } mView.setCountry(mCountryName, mCountryCode); } public void selectCountry() { mActivity.startActivityForResult(new Intent(mActivity, CountryListActivity.class), REQUEST_TO_COUNTRY_LIST); } }
836c59e2a212a9461a889004196435996e605587
80fc7258c97b64969a7995649d813fce66f5072d
/src/main/java/com/skcc/book/config/FeignConfiguration.java
56f5d1d2600d5408fa5a18a56d88d34774cd06f1
[]
no_license
sky9743/book
6641e646f9db33479a60529461df1db0f5442f36
d4dfe2131255c04a2225e60499478d1c8abadc04
refs/heads/master
2023-07-09T14:56:35.217637
2020-10-15T01:19:35
2020-10-15T01:19:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
664
java
package com.skcc.book.config; import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.FeignClientsConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration @EnableFeignClients(basePackages = "com.skcc.book") @Import(FeignClientsConfiguration.class) public class FeignConfiguration { /** * Set the Feign specific log level to log client REST requests. */ @Bean feign.Logger.Level feignLoggerLevel() { return feign.Logger.Level.BASIC; } }
cca9e09cf76573b8b42ceb611977b287140a0fe9
a50b80b598c1fe2fb64d23475f2ab153b75cbde2
/src/main/java/com/example/demo/dao/ClothesMapper.java
d7ddc84f568eab92bd99837c5cbed5d87744137e
[]
no_license
Innovation0416/ssm
7e0a423f3cfb595a9d3ce1ad6e8199e3ce870c22
fb70e29fe4ac6178cff7f5d17c84ee0f6eaedbd9
refs/heads/master
2020-03-28T11:58:57.592183
2019-06-04T08:27:54
2019-06-04T08:27:54
148,261,254
0
0
null
null
null
null
UTF-8
Java
false
false
437
java
package com.example.demo.dao; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import com.example.demo.entity.Clothes; @Mapper public interface ClothesMapper { public List<Clothes> findAll(@Param("items")int items, @Param("category")String category,@Param("sex")short sex); public List<Clothes> findByColums(String category); public Clothes findById(String id); }
a5e8ec8bc3892e0bdbc03735b0c0bfa3e53560bb
b876164ed6b842b85eeda289d11dcb0bf4188587
/src/rs/ac/uns/ftn/informatika/RS13/IspitniProjekat/server/servlet/PrepareUpdateKorisnikLozinka.java
d1e495c23b63a1854d6a0059c51f09fb6a422aed
[]
no_license
basskibo/EbookRepo
ca1726ea530fee9d3f0c1729341511b9f53987b5
470fc70379244cc8ceb9bba1a7803741a62000c1
refs/heads/master
2021-01-10T13:25:13.883669
2017-01-17T17:18:48
2017-01-17T17:18:48
51,478,271
1
0
null
null
null
null
UTF-8
Java
false
false
875
java
package rs.ac.uns.ftn.informatika.RS13.IspitniProjekat.server.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; public class PrepareUpdateKorisnikLozinka extends HttpServlet{ private static final long serialVersionUID = -734547181116L; private static Logger log = Logger.getLogger(PrepareUpdateKorisnikLozinka.class); protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendRedirect(response.encodeRedirectURL("./updatePassword.jsp")); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
ff512a70312afa30ee294a12d621909e5b3baa82
9a52eeaf13f9f7593dbe3de539469aca1c233757
/app/src/main/java/com/android/tv/menu/ChannelsPosterPrefetcher.java
f2fbee5afa2367411f540c7c5f01152bf0748ef4
[]
no_license
johnjcool/TV
1942eb4c34bb753e8dbf16ebd99114cf0a3a26da
e1ed59a055c41dcdc72e49df7175c5fa469374ad
refs/heads/master
2020-03-31T22:30:02.802799
2018-10-11T17:19:30
2018-10-11T17:19:30
152,620,829
0
1
null
null
null
null
UTF-8
Java
false
false
5,619
java
/* * Copyright (C) 2015 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.tv.menu; import android.content.Context; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.support.annotation.MainThread; import android.support.annotation.NonNull; import android.util.Log; import com.google.android.tv.R; import com.android.tv.common.SoftPreconditions; import com.android.tv.common.WeakHandler; import com.android.tv.data.ChannelImpl; import com.android.tv.data.Program; import com.android.tv.data.ProgramDataManager; import com.android.tv.data.api.Channel; import java.util.List; /** A poster image prefetcher to show the program poster art in the Channels row faster. */ public class ChannelsPosterPrefetcher { private static final String TAG = "PosterPrefetcher"; private static final boolean DEBUG = false; private static final int MSG_PREFETCH_IMAGE = 1000; private static final int ONDEMAND_POSTER_PREFETCH_DELAY_MILLIS = 500; // 500 milliseconds private final ProgramDataManager mProgramDataManager; private final ChannelsRowAdapter mChannelsAdapter; private final int mPosterArtWidth; private final int mPosterArtHeight; private final Context mContext; private final Handler mHandler = new PrefetchHandler(this); private boolean isCanceled; /** Create {@link ChannelsPosterPrefetcher} object with given parameters. */ public ChannelsPosterPrefetcher( Context context, ProgramDataManager programDataManager, ChannelsRowAdapter adapter) { mProgramDataManager = programDataManager; mChannelsAdapter = adapter; mPosterArtWidth = context.getResources().getDimensionPixelSize(R.dimen.card_image_layout_width); mPosterArtHeight = context.getResources().getDimensionPixelSize(R.dimen.card_image_layout_height); mContext = context.getApplicationContext(); } /** Start prefetching of program poster art of recommendation. */ public void prefetch() { SoftPreconditions.checkState(!isCanceled, TAG, "Prefetch called after cancel was called."); if (isCanceled) { return; } if (DEBUG) Log.d(TAG, "startPrefetching()"); /* * When a user browse channels, this method could be called many times. We don't need to * prefetch the intermediate channels. So ignore previous schedule. */ mHandler.removeMessages(MSG_PREFETCH_IMAGE); mHandler.sendMessageDelayed( mHandler.obtainMessage(MSG_PREFETCH_IMAGE), ONDEMAND_POSTER_PREFETCH_DELAY_MILLIS); } /** Cancels pending and current prefetch requests. */ public void cancel() { isCanceled = true; mHandler.removeCallbacksAndMessages(null); } @MainThread // ProgramDataManager.getCurrentProgram must be called from the main thread private void doPrefetchImages() { if (DEBUG) Log.d(TAG, "doPrefetchImages() started"); // This executes on the main thread, but since the item list is expected to be about 5 items // and ImageLoader spawns an async task so this is fast enough. 1 ms in local testing. List<ChannelsRowItem> items = mChannelsAdapter.getItemList(); if (items != null) { for (ChannelsRowItem item : items) { if (isCanceled) { return; } Channel channel = item.getChannel(); if (!ChannelImpl.isValid(channel)) { continue; } channel.prefetchImage( mContext, Channel.LOAD_IMAGE_TYPE_CHANNEL_LOGO, mPosterArtWidth, mPosterArtHeight); Program program = mProgramDataManager.getCurrentProgram(channel.getId()); if (program != null) { program.prefetchPosterArt(mContext, mPosterArtWidth, mPosterArtHeight); } } } if (DEBUG) { Log.d( TAG, "doPrefetchImages() finished. ImageLoader may still have async tasks for " + "channels " + items); } } private static class PrefetchHandler extends WeakHandler<ChannelsPosterPrefetcher> { public PrefetchHandler(ChannelsPosterPrefetcher ref) { // doPrefetchImages must be called from the main thread. super(Looper.getMainLooper(), ref); } @Override @MainThread public void handleMessage(Message msg, @NonNull ChannelsPosterPrefetcher prefetcher) { switch (msg.what) { case MSG_PREFETCH_IMAGE: prefetcher.doPrefetchImages(); break; } } } }
4bd5b2c68e5ffd6c0a6c611c2aba94d748d7a036
30867ef12d561a6f86f6159167c78e2d8e499f9e
/LinkedLinearList.java
e6964b7c430c4f04d5b64dcf0596ca01f0c49394
[]
no_license
brittsaunders/DataStructures
243c42d20c03eb78d3d5522decf6c22585667c01
289cdb8e8208a98a335bf967f5cc59f7a0ac9fd0
refs/heads/master
2020-04-01T09:50:28.450146
2018-10-15T10:05:57
2018-10-15T10:05:57
153,091,704
0
0
null
null
null
null
UTF-8
Java
false
false
7,747
java
/* Brittany Saunders cssc0954 Assignment 1 */ package data_structures; import java.util.Iterator; import java.util.NoSuchElementException; public class LinkedLinearList<E> implements LinearListADT<E> { private Node <E> head; private Node <E> tail; private int currentSize; public void LinkedList(){ head = null; tail = null; currentSize = 0; } class Node <E> { E data; Node <E> next; public Node(E obj) { data = obj; next = null; } } // Adds the Object obj to the end of list. public void addLast(E obj){ Node <E> node = new Node<E>(obj); if(head == null) { head = tail = node; currentSize++; return; } Node <E> temp = head; while(temp.next != null) temp = temp.next; temp.next = node; tail = temp.next; currentSize++; } // Adds the Object obj to the beginning of list. public void addFirst(E obj){ Node <E> node = new Node<E>(obj); node.next = head; head = node; currentSize++; tail = head; while(tail.next != null) tail = tail.next; } // Inserts the Object obj at the position indicated. If there is an element at // that location, all elements from that location to the end of the list are // shifted down to make room for the new insertion. The location is one based. // If the location > size()+1 then a RuntimeException is thrown. List elements // must be contiguous. public void insert(E obj, int location){ Node <E> prev = null, current = head, temp = null; if(location == 1) { addFirst(obj); return; } if(current.next == null) { addLast(obj); return; } int i = 1; while(current != null) { if(i == location) { temp = current; break; } prev = current; current = current.next; i++; } Node <E> node = new Node<E>(obj); prev.next = node; node.next = current; currentSize++; } // Removes the object located at the parameter location (one based). // Throws a RuntimeException if the location does not map to a valid position within the list. public E remove(int location){ Node <E> prev = null, current = head; int i = 1; while(current != null) { if (i == location) { if(i == 1) return removeFirst(); E temp = current.data; prev.next = current.next; currentSize--; return temp; } prev = current; current = current.next; i++; } throw new RuntimeException("No element to remove at this location."); } // Removes and returns the parameter object obj from the list if the list contains it, null otherwise. // The ordering of the list is preserved. The list may contain duplicate elements. This method // removes and returns the first matching element found when traversing the list from first position. public E remove(E obj){ Node <E> current = head, prev = null; while(current != null) { if(((Comparable<E>)obj).compareTo(current.data) == 0) { if(current == head) return removeFirst(); if(current == tail) return removeLast(); prev.next = current.next; currentSize--; return current.data; } prev = current; current = current.next; } return null; } // Removes and returns the parameter object obj in first position in list if the list is not empty, // null if the list is empty. The ordering of the list is preserved. public E removeFirst(){ E temp = head.data; Node<E> tmp = head; if(head == null) throw new RuntimeException("No element to remove at this location."); if(head == tail) head = tail = null; head = tmp.next; currentSize--; return temp; } // Removes and returns the parameter object obj in last position in list if the list is not empty, // null if the list is empty. The ordering of the list is preserved. public E removeLast(){ if(head == null) throw new RuntimeException("No element to remove at this location."); if(head == tail) return removeFirst(); Node <E> current = head, prev = null; while(current != tail) { prev = current; current = current.next; } prev.next = null; tail = prev; currentSize--; return current.data; } // Returns the parameter object located at the parameter location position (one based). // Throws a RuntimeException if the location does not map to a valid position within the list. public E get(int location){ Node <E> prev = null, current = head, temp; for(int i = 1; i <= location; i++) { if(i == location) { prev.next = current.next; return current.data; } prev = current; current = current.next; } throw new RuntimeException("No element at this location."); } // Returns true if the parameter object obj is in the list, false otherwise. public boolean contains(E obj){ Node <E> current = head; while(current != null) { if(((Comparable<E>)obj).compareTo(current.data) == 0) return true; current = current.next; } return false; } // Returns the one based location of the parameter object obj if it is in the list, -1 otherwise. // In the case of duplicates, this method returns the element closest to position #1. public int locate(E obj){ Node <E> current = head; int i = 1; while(current != null) { if(((Comparable<E>)obj).compareTo(current.data) == 0) return i; current = current.next; i++; } return -1; } // The list is returned to an empty state. public void clear(){ head = tail = null; currentSize = 0; } // Returns true if the list is empty, otherwise false public boolean isEmpty(){ if(head == null) return true; return false; } // Returns the number of Objects currently in the list. public int size(){ return currentSize; } // Returns an Iterator of the values in the list, presented in // the same order as the underlying order of the list. (position #1 first) public Iterator<E> iterator(){ return new IteratorHelper(); } class IteratorHelper implements Iterator<E> { Node <E> index; public IteratorHelper() { index = head; } public boolean hasNext() { return (index != null); } public E next() { if(!hasNext()) throw new NoSuchElementException(); E value = index.data; index = index.next; return value; } } }
2d691ad267b3785ac01f6f44bfb41e7e9a47c946
44a02ce9faa018489b1ca5cd7f246a430643ce51
/src/com/langesokker/exceptions/ImageNotFoundException.java
9afe5774b432a534715cec1fed9c2b66ef33a28c
[]
no_license
Gyhrs/StreamingTjeneste
db7b2a531adc52b389ee095f559f83bf0114692b
c79722da5b39323d9185fdbb3c7bb877ee5b8cd0
refs/heads/master
2023-02-02T07:26:29.157434
2020-12-20T11:07:15
2020-12-20T11:07:15
314,544,121
2
0
null
2020-12-07T15:03:10
2020-11-20T12:12:36
Java
UTF-8
Java
false
false
603
java
package com.langesokker.exceptions; public class ImageNotFoundException extends Exception{ private final String path; /** * Konstrukt&oslash;r af ImageNotFoundException * @param message = Fejlbeskeden * @param path = Stien til billede der ikke kunne indl&aelig;ses */ public ImageNotFoundException(String message, String path){ super(message); this.path = path; } /** * Getter metode til billedestien * @return En string med Basepath ("com/langesokker") + localpath */ public String getPath() { return path; } }
b2b9d1f4be3628dadaeab24fd6fe15cf26f5fad3
049d29d893f2a1de85f3348066c66a516a9e0dbe
/sample/trunk/src/org/net9/minipie/sample/util/CredentialEncoder.java
f83ef101d6f75f5536448d2bbc01cf3ebc8b69a3
[ "MIT" ]
permissive
leethree/mini-pie
8437cd8e7f9477195e0c7f97fed4fadc69c94a7a
166f6898c53fb55daf54dfddeca22ab6305017c6
refs/heads/master
2020-04-06T05:26:16.094984
2015-03-15T15:19:06
2015-03-15T15:19:06
32,265,255
2
0
null
null
null
null
UTF-8
Java
false
false
668
java
/** * */ package org.net9.minipie.sample.util; import com.sun.jersey.core.util.Base64; /** * @author LeeThree * */ public final class CredentialEncoder { /** * <p> * Encode the specified credentials into a String as required by HTTP Basic * Authentication (<a href="http://www.ietf.org/rfc/rfc2617.txt">RFC * 2617</a>). * </p> * * @param username * Username to be encoded * @param password * Password to be encoded */ public static String encodeBasic(String username, String password) { String encode = username + ":" + password; return new String(Base64.encode(encode)); } }
[ "philipleethree@ff72b304-07c1-11de-b8f3-b9fb9eb71b04" ]
philipleethree@ff72b304-07c1-11de-b8f3-b9fb9eb71b04
74a08f9de2333e05a792b4037f8c9c073044ba95
dfa4b629d358fa1e618f66747b0921c7e81910d5
/src/main/java/fpt/java/finalproject/dtos/ShopItemDto.java
3beee86a0a16251362e552580f61804e3236301f
[]
no_license
simonpoulin/finalproject
2bffbcfe1c45d3679dbec82e6414e0ca9e789401
5de961f420e2fa571028d3eb2346e02f4ff0a5cd
refs/heads/master
2023-03-05T04:58:34.710714
2021-02-17T07:49:27
2021-02-17T07:49:27
297,859,143
0
3
null
2020-11-16T17:37:17
2020-09-23T05:09:58
Java
UTF-8
Java
false
false
2,894
java
package fpt.java.finalproject.dtos; import java.io.Serializable; import org.springframework.web.multipart.MultipartFile; import fpt.java.finalproject.models.Product; import fpt.java.finalproject.models.Shop; import fpt.java.finalproject.models.ShopItem; public class ShopItemDto implements Serializable { private Integer id; private String title; private String des; private Float price; private Integer quantity; private MultipartFile image; private String imageName; private Integer productId; private Integer shopId; public ShopItemDto() { } public ShopItemDto(ShopItem s) { this.id = s.getId(); this.title = s.getTitle(); this.des = s.getDes(); this.price = s.getPrice(); this.quantity = s.getQuantity(); this.imageName = s.getImage(); this.productId = s.getProduct().getId(); this.shopId = s.getShop().getId(); } public ShopItem convertToShopItem() { ShopItem s = new ShopItem(); if (this.id != null && this.id > 0) { s.setId(this.id); } s.setTitle(this.title); s.setDes(this.des); s.setPrice(this.price); s.setImage(this.imageName); if (this.productId!= null || this.productId > 0) { Product p = new Product(); p.setId(this.productId); s.setProduct(p); } if (this.shopId != null || this.shopId > 0) { Shop sh = new Shop(); sh.setId(this.shopId); s.setShop(sh); } return s; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDes() { return des; } public void setDes(String des) { this.des = des; } public Float getPrice() { return price; } public void setPrice(Float price) { this.price = price; } public Integer getQuantity() { return quantity; } public void setQuantity(Integer quantity) { this.quantity = quantity; } public Integer getProductId() { return productId; } public void setProductId(Integer productId) { this.productId = productId; } public Integer getShopId() { return shopId; } public void setShopId(Integer shopId) { this.shopId = shopId; } public String getImageName() { return imageName; } public void setImageName(String imageName) { this.imageName = imageName; } public MultipartFile getImage() { return image; } public void setImage(MultipartFile image) { this.image = image; } }
5a640b5dab1a8e231ddeeb8aca95ef5abe5d8f19
7ccfbb9c5977a619cfdb670e958239f4f8280194
/src/fivehundred/FiveHundred.java
ffc5cdc090d4c2c3dd4a929f0450b3be92279f07
[]
no_license
phillipjohnson/FiveHundred
e1a1113f0f126fc8699e492620098d893f53ad41
2264be2a9c4fe5c17befaf999502e190790f9e68
refs/heads/master
2021-01-10T19:24:18.853663
2014-01-04T19:52:05
2014-01-04T19:52:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
485
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package fivehundred; import mechanics.*; /** * * @author shivasprogeny */ public class FiveHundred { public static void main(String[] args) { Table table = new Table(3); for (int i = 0; i < 100; i++) { table.playGame(); } for(Team t : table.teams){ System.out.println(t + " " + t.gamesWon); } } }
1a035fbc2cdb4ecf137e2bcf976ed5772968bb08
3710bc2228ca202152281bb345394459e5f91288
/app/src/main/java/com/franciscorp/meli/pruebameli/models/search/Seller.java
acbaa28812d2a8674da479bc08396c61f362321e
[]
no_license
andresfranciscorp/Mercadolibre
c334d81a4c64472f59db16bd7489a447bcf89216
0528024b49e82015fd69eae5ef08c7bce7bdcac3
refs/heads/master
2023-07-11T03:07:50.186886
2021-08-10T17:14:23
2021-08-10T17:14:23
394,719,976
0
0
null
null
null
null
UTF-8
Java
false
false
3,638
java
package com.franciscorp.meli.pruebameli.models.search; import android.os.Parcel; import android.os.Parcelable; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class Seller implements Parcelable { @SerializedName("id") @Expose private Integer id; @SerializedName("permalink") @Expose private String permalink; @SerializedName("registration_date") @Expose private String registrationDate; @SerializedName("car_dealer") @Expose private Boolean carDealer; @SerializedName("real_estate_agency") @Expose private Boolean realEstateAgency; @SerializedName("tags") @Expose private List<String> tags = null; @SerializedName("seller_reputation") @Expose private SellerReputation sellerReputation; protected Seller(Parcel in) { if (in.readByte() == 0) { id = null; } else { id = in.readInt(); } permalink = in.readString(); registrationDate = in.readString(); byte tmpCarDealer = in.readByte(); carDealer = tmpCarDealer == 0 ? null : tmpCarDealer == 1; byte tmpRealEstateAgency = in.readByte(); realEstateAgency = tmpRealEstateAgency == 0 ? null : tmpRealEstateAgency == 1; tags = in.createStringArrayList(); sellerReputation = in.readParcelable(SellerReputation.class.getClassLoader()); } @Override public void writeToParcel(Parcel dest, int flags) { if (id == null) { dest.writeByte((byte) 0); } else { dest.writeByte((byte) 1); dest.writeInt(id); } dest.writeString(permalink); dest.writeString(registrationDate); dest.writeByte((byte) (carDealer == null ? 0 : carDealer ? 1 : 2)); dest.writeByte((byte) (realEstateAgency == null ? 0 : realEstateAgency ? 1 : 2)); dest.writeStringList(tags); dest.writeParcelable(sellerReputation, flags); } @Override public int describeContents() { return 0; } public static final Creator<Seller> CREATOR = new Creator<Seller>() { @Override public Seller createFromParcel(Parcel in) { return new Seller(in); } @Override public Seller[] newArray(int size) { return new Seller[size]; } }; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getPermalink() { return permalink; } public void setPermalink(String permalink) { this.permalink = permalink; } public String getRegistrationDate() { return registrationDate; } public void setRegistrationDate(String registrationDate) { this.registrationDate = registrationDate; } public Boolean getCarDealer() { return carDealer; } public void setCarDealer(Boolean carDealer) { this.carDealer = carDealer; } public Boolean getRealEstateAgency() { return realEstateAgency; } public void setRealEstateAgency(Boolean realEstateAgency) { this.realEstateAgency = realEstateAgency; } public List<String> getTags() { return tags; } public void setTags(List<String> tags) { this.tags = tags; } public SellerReputation getSellerReputation() { return sellerReputation; } public void setSellerReputation(SellerReputation sellerReputation) { this.sellerReputation = sellerReputation; } }
e6e12892cb079d1afb5d6cc9aee4778681ebd087
fae40de4591992cb241d0faa2d14a8a0254f4b69
/Menjacnica/src/menjacnica/Menjacnica.java
6f8bc10e017a2316e14b6a260d2bdd606d0328c8
[]
no_license
MilosBrkic/Menjacnica
c180b86793d367c5bebd72c63d4552c059adff27
e2fd159ce7aa20eee30d53232232575d5c8620c2
refs/heads/master
2021-04-12T03:22:54.578365
2018-03-19T12:37:36
2018-03-19T12:37:36
125,418,752
0
0
null
null
null
null
UTF-8
Java
false
false
3,661
java
package menjacnica; import java.util.GregorianCalendar; import java.util.LinkedList; import interfejs.InterfejsMenjacnica; import kurs.Kurs; import valuta.Valuta; public class Menjacnica implements InterfejsMenjacnica { private LinkedList<Valuta> valute = new LinkedList<Valuta>(); public LinkedList<Valuta> getValute() { return valute; } public void setValute(LinkedList<Valuta> valute) { if(valute.isEmpty()) System.out.println("Lista je prazna"); else this.valute = valute; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((valute == null) ? 0 : valute.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Menjacnica other = (Menjacnica) obj; if (valute == null) { if (other.valute != null) return false; } else if (!valute.equals(other.valute)) return false; return true; } @Override public String toString() { return "Valute:\n" + valute; } @Override public void dodavnjeKursa(String valuta, Kurs kurs) { GregorianCalendar pom; for(int i=0; i<valute.size();i++) { if(valute.get(i).getNaziv().equals(valuta)) { Valuta v = valute.get(i); for(int j=0; j<v.getKursevi().size(); j++) { pom=v.getKursevi().get(j).getDatum(); if(pom.get(GregorianCalendar.YEAR)==kurs.getDatum().get(GregorianCalendar.YEAR) && pom.get(GregorianCalendar.MONTH)==kurs.getDatum().get(GregorianCalendar.MONTH) && pom.get(GregorianCalendar.DAY_OF_MONTH)==kurs.getDatum().get(GregorianCalendar.DAY_OF_MONTH)) { System.out.println("Kurs sa istim datumom vec postoji"); return; } } valute.get(i).getKursevi().add(kurs); System.out.println("Kurs je uspesno dodat"); return; } } System.out.println("Ne postoji valuta pod tim nazivom"); } @Override public void brisanjeKursa(String valuta, GregorianCalendar datum) { GregorianCalendar pom; for(int i=0; i<valute.size();i++) { if(valute.get(i).getNaziv().equals(valuta)) { Valuta v = valute.get(i); for(int j=0; j<v.getKursevi().size(); j++) { pom=v.getKursevi().get(j).getDatum(); if(pom.get(GregorianCalendar.YEAR)==datum.get(GregorianCalendar.YEAR) && pom.get(GregorianCalendar.MONTH)==datum.get(GregorianCalendar.MONTH) && pom.get(GregorianCalendar.DAY_OF_MONTH)==datum.get(GregorianCalendar.DAY_OF_MONTH)) { v.getKursevi().remove(j); System.out.println("Kurs je uspesno izbrisan"); return; } } System.out.println("Ne postoji kurs za uneti datum"); return; } } System.out.println("Ne postoji valuta pod tim nazivom"); } @Override public Kurs pronalazenjeKursa(String valuta, GregorianCalendar datum) { GregorianCalendar pom; for(int i=0; i<valute.size();i++) { if(valute.get(i).getNaziv().equals(valuta)) { Valuta v = valute.get(i); for(int j=0; j<v.getKursevi().size(); j++) { pom=v.getKursevi().get(j).getDatum(); if(pom.get(GregorianCalendar.YEAR)==datum.get(GregorianCalendar.YEAR) && pom.get(GregorianCalendar.MONTH)==datum.get(GregorianCalendar.MONTH) && pom.get(GregorianCalendar.DAY_OF_MONTH)==datum.get(GregorianCalendar.DAY_OF_MONTH)) { return v.getKursevi().get(j); } } throw new RuntimeException("Ne postoji kurs za uneti datum"); } } throw new RuntimeException("Ne postoji valuta pod tim nazivom"); } }
125d72210688e6c6ecb6c53a146f6bdde0d10b65
90b4221dbef2523dae8cf2bcd6688ddb1ac10b95
/src/test/java/com/jmaguero/crypto/exercise/api/CryptoExerciseApiApplicationTests.java
531acca78e87b822c661b15cc5105c05ffd04b66
[]
no_license
jmepicapp/crypto-exercise-api
78d957dc336339ea7a15f961fccfc8c6481ab400
b41d932030a47f17ce5f6d24d31ff6027904b8d3
refs/heads/master
2023-03-06T13:52:48.991149
2021-02-08T02:20:57
2021-02-08T02:20:57
336,886,000
0
0
null
null
null
null
UTF-8
Java
false
false
235
java
package com.jmaguero.crypto.exercise.api; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class CryptoExerciseApiApplicationTests { @Test void contextLoads() { } }
030a0c7d377ce5683f07c36bed961d4c3f320dcf
770441d12c3246dbd6ee571e904b783cd1d27758
/src/main/java/mutants/fastjson_1_2_45/com/alibaba/fastjson/TypeReference.java
11855e020fde125f4fded7d72d61afbf62ec024f
[]
no_license
GenaGeng/FastJsonTester
047a937222bf256c8688b0e8f11deea56219e71b
4eb1f980ce7d493cc150ca2f414ad541b88ab0d8
refs/heads/master
2020-09-10T05:03:10.336765
2019-12-03T06:40:24
2019-12-03T06:40:34
221,655,012
0
0
null
2019-11-14T09:07:08
2019-11-14T09:07:07
null
UTF-8
Java
false
false
3,492
java
package mutants.fastjson_1_2_45.com.alibaba.fastjson; import java.lang.reflect.GenericArrayType; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import com.alibaba.fastjson.util.ParameterizedTypeImpl; import com.alibaba.fastjson.util.TypeUtils; /** * Represents a generic type {@code T}. Java doesn't yet provide a way to * represent generic types, so this class does. Forces clients to create a * subclass of this class which enables retrieval the type information even at * runtime. * * <p>For example, to create a type literal for {@code List<String>}, you can * create an empty anonymous inner class: * * <pre> * TypeReference&lt;List&lt;String&gt;&gt; list = new TypeReference&lt;List&lt;String&gt;&gt;() {}; * </pre> * This syntax cannot be used to create type literals that have wildcard * parameters, such as {@code Class<?>} or {@code List<? extends CharSequence>}. */ public class TypeReference<T> { static ConcurrentMap<Type, Type> classTypeCache = new ConcurrentHashMap<Type, Type>(16, 0.75f, 1); protected final Type type; /** * Constructs a new type literal. Derives represented class from type * parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type * parameter in the anonymous class's type hierarchy so we can reconstitute it * at runtime despite erasure. */ protected TypeReference(){ Type superClass = getClass().getGenericSuperclass(); Type type = ((ParameterizedType) superClass).getActualTypeArguments()[0]; Type cachedType = classTypeCache.get(type); if (cachedType == null) { classTypeCache.putIfAbsent(type, type); cachedType = classTypeCache.get(type); } this.type = cachedType; } /** * @since 1.2.9 * @param actualTypeArguments */ protected TypeReference(Type... actualTypeArguments){ Class<?> thisClass = this.getClass(); Type superClass = thisClass.getGenericSuperclass(); ParameterizedType argType = (ParameterizedType) ((ParameterizedType) superClass).getActualTypeArguments()[0]; Type rawType = argType.getRawType(); Type[] argTypes = argType.getActualTypeArguments(); int actualIndex = 0; for (int i = 0; i < argTypes.length; ++i) { if (argTypes[i] instanceof TypeVariable && actualIndex < actualTypeArguments.length) { argTypes[i] = actualTypeArguments[actualIndex++]; } // fix for openjdk and android env if (argTypes[i] instanceof GenericArrayType) { argTypes[i] = TypeUtils.checkPrimitiveArray( (GenericArrayType) argTypes[i]); } } Type key = new ParameterizedTypeImpl(argTypes, thisClass, rawType); Type cachedType = classTypeCache.get(key); if (cachedType == null) { classTypeCache.putIfAbsent(key, key); cachedType = classTypeCache.get(key); } type = cachedType; } /** * Gets underlying {@code Type} instance. */ public Type getType() { return type; } public final static Type LIST_STRING = new TypeReference<List<String>>() {}.getType(); }
3da396b3d058677380c84cab7513db03478d382f
a7415b4c1115093d8fe464a92eed2b5fad11237f
/app/src/main/java/com/example/administrator/classromapplication/LoginUtil.java
1f2c91664939a39518d1d09622bc99755ad9d634
[]
no_license
CoolCsf/ClassRoomApplication
9ac81ff427500d4d227fa5b4a9f8efd118c91a68
c69abdacf740e2b6e140c97674070470be03a219
refs/heads/master
2021-09-08T01:44:28.723402
2018-03-05T14:04:03
2018-03-05T14:04:03
111,175,254
0
0
null
null
null
null
UTF-8
Java
false
false
3,176
java
package com.example.administrator.classromapplication; import android.app.Activity; import android.util.Log; import com.example.administrator.classromapplication.model.Installation; import com.example.administrator.classromapplication.view.ui.AbsActivity; import com.example.administrator.classromapplication.view.ui.MainActivity; import com.example.administrator.classromapplication.view.ui.RootMainActivity; import com.example.administrator.classromapplication.viewmodel.UserViewModel; import com.tool.util.CollectionUtils; import com.tool.util.ToastHelp; import java.util.List; import cn.bmob.v3.BmobInstallationManager; import cn.bmob.v3.BmobQuery; import cn.bmob.v3.BmobUser; import cn.bmob.v3.exception.BmobException; import cn.bmob.v3.listener.FindListener; import cn.bmob.v3.listener.LogInListener; import cn.bmob.v3.listener.UpdateListener; /** * Created by Administrator on 2017/12/2. */ public class LoginUtil { public static void login(String userName, String pwd, final AbsActivity activity) { activity.showLoading(); BmobUser.loginByAccount(userName, pwd, new LogInListener<UserViewModel>() { @Override public void done(UserViewModel userViewModel, BmobException e) { if (userViewModel != null) { modifyInstallation(userViewModel.isRoot, activity, userViewModel.getObjectId()); } else { ToastHelp.showToast("登录失败" + e.toString()); activity.closeLoading(); } } }); } private static void modifyInstallation(final Boolean isRoot, final AbsActivity absActivity, final String userId) { BmobQuery<Installation> bmobQuery = new BmobQuery<>(); final String id = BmobInstallationManager.getInstallationId(); bmobQuery.addWhereEqualTo("installationId", id); bmobQuery.findObjects(new FindListener<Installation>() { @Override public void done(List<Installation> list, BmobException e) { if (CollectionUtils.collectionState(list) == CollectionUtils.COLLECTION_UNEMPTY) { Installation installation = list.get(0); installation.setRoot(isRoot); installation.setUserId(userId); installation.update(new UpdateListener() { @Override public void done(BmobException e) { if (e == null) { Log.d("LoginActivity", "更新设备成功"); if (isRoot) { absActivity.goActivity(RootMainActivity.class, null); } else { absActivity.goActivity(MainActivity.class, null); } } else { ToastHelp.showToast(e.getMessage()); } absActivity.closeLoading(); } }); } } }); } }
60f5fbbcdc8ad88d1b63872e97e64e04faed088f
f8c91fc068027dd789570cff58c804c5d9019532
/app/src/main/java/com/example/myapplicationprova/Person.java
3a6cbbe3f3eba6c7d29a13f6e5f8955a0199805e
[]
no_license
raresabie/buzz
366d94cd9c5e1c0501519a65a36d0d9c5aacfe61
6403afcf79d8f89c655e8a3d9380e2ac62a1b286
refs/heads/master
2022-10-17T23:52:20.569071
2020-06-14T02:39:05
2020-06-14T02:39:05
272,120,606
0
0
null
null
null
null
UTF-8
Java
false
false
286
java
package com.example.myapplicationprova; public class Person { private String nome; public Person (String nome){ this.nome=nome; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } }
5e34b0645963a60fdf59c6a8e31948686f87dca9
6e462e6464ae224bbb043cc1ce530228b1dd8274
/src/main/java/net/hontheim/ulp/ble/services/InfoService.java
df78a649f423438872487568c23e1dab14216ff5
[]
no_license
hhontheim/ulp-ble
96212c829ebbc6acaa929e0632fbe3e1fc522473
5ab2b7aa1a08223d20ab89a422a10947bcfddf1c
refs/heads/master
2022-10-23T11:55:11.148563
2020-06-10T20:48:05
2020-06-10T20:48:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
203
java
package net.hontheim.ulp.ble.services; import it.tangodev.ble.BleService; public class InfoService extends BleService { public InfoService() { super("/ulp/s/info", "180a", false); } }
bf0cca6c51ae65fc45d51df8ed7dfa0b1389d6d5
6d4834ed63ed36625d5f01c435f5228b2df8c6a8
/backend/src/main/java/com/jcleonel/cursomc/repositories/CategoriaRepository.java
5b09d50543343081e1887c7264a91a5fb0faa1d1
[ "MIT" ]
permissive
jcleonel/spring-ionic
6b4929de992bc7f4e87be7cfd366b1ca7b479a77
73bce020a5b881bca2ee10c4a542632775ccc0bd
refs/heads/master
2023-08-03T16:02:02.998980
2021-09-15T00:41:34
2021-09-15T00:41:34
397,620,533
0
0
null
2021-08-19T21:16:10
2021-08-18T13:59:55
Java
UTF-8
Java
false
false
300
java
package com.jcleonel.cursomc.repositories; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import com.jcleonel.cursomc.domain.Categoria; @Repository public interface CategoriaRepository extends JpaRepository<Categoria, Integer> { }
af11c8c2402905413fe9cce55965bc8001997c8c
0e515dfe72bef45ffcebb996eb3dc3a7a0c663c0
/src/main/java/com/yaoyao/sell/enums/ResultEnum.java
f84929612faf36c796e76f18cc89f904bc830481
[]
no_license
xiaoxinllleee/sell
5f80cb4222858935cf602bbf607216cb62c5b223
f210156dc106fc356f2376fbb43b308e05ffbd41
refs/heads/master
2020-03-17T08:29:43.419437
2018-05-22T09:23:32
2018-05-22T09:23:36
133,440,694
0
0
null
null
null
null
UTF-8
Java
false
false
1,263
java
package com.yaoyao.sell.enums; import lombok.Getter; @Getter public enum ResultEnum { SUCCESS(0, "成功"), PARAM_ERROR(1, "参数不正确"), PRODUCT_NOT_EXIST(10, "商品不存在"), PRODUCT_STOCK_ERROR(11, "商品库存不正确"), ORDER_NOT_EXIST(12, "订单不存在"), ORDERDETAIL_NOT_EXIST(13, "订单详情不存在"), ORDER_STATUS_ERROR(14, "订单状态不正确"), ORDER_UPDATE_FAIL(15, "订单更新失败"), ORDER_DETAIL_EMPTY(16, "订单详情为空"), ORDER_PAY_STATUS_ERROR(17, "订单支付状态不正确"), CART_EMPTY(18, "购物车为空"), ORDER_OWNER_ERROR(19, "该订单不属于当前用户"), WECHAT_MP_ERROR(20, "微信公众账号方面错误"), WXPAY_NOTIFY_MONEY_VERIFY_ERROR(21, "微信支付异步通知金额校验不通过"), ORDER_CANCEL_SUCCESS(22, "订单取消成功"), ORDER_FINISH_SUCCESS(23, "订单完结成功"), PRODUCT_STATUS_ERROR(24, "商品状态不正确"), LOGIN_FAIL(25, "登录失败, 登录信息不正确"), LOGOUT_SUCCESS(26, "登出成功"),; private Integer code; private String message; ResultEnum(Integer code,String message){ this.code = code; this.message = message; } }
0113bc4216aa744c04e1217908b6d7f6e402a9d9
a50da85faae6ff01981e3e930e92a38f764f0c26
/src/test/java/Academy/HomePage.java
e1c51149a032af8ffafec7c27d12c706bb239b5a
[]
no_license
ashwiniole/E2EProjectRahul
401c817e17f290efd1d79fe4d928dca54567f489
40fb1ea44991966b4e4f3dace7851e08ab3c0ef1
refs/heads/master
2023-04-25T02:30:02.652496
2021-05-15T09:45:39
2021-05-15T09:45:39
367,585,988
0
0
null
null
null
null
UTF-8
Java
false
false
1,812
java
package Academy; import java.io.IOException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import pageObjects.LandingPage; import pageObjects.LoginPage; import resources.base; public class HomePage extends base{ public static Logger log =LogManager.getLogger(base.class.getName()); @BeforeTest public void initialize() throws IOException { driver =initializeDriver(); } @Test(dataProvider="getData") public void basePageNavigation(String Username,String Password,String text) throws IOException { //one is inheritance // creating object to that class and invoke methods of it driver.get(prop.getProperty("url")); LandingPage l=new LandingPage(driver); l.getLogin().click(); //driver.findElement(By.css() LoginPage lp=new LoginPage(driver); lp.getEmail().sendKeys(Username); lp.getPassword().sendKeys(Password); log.info(text); lp.getLogin().click(); System.out.println("Login success"); } @AfterTest public void teardown() { driver.close(); driver=null; } @DataProvider public Object[][] getData() { // Row stands for how many different data types test should run //coloumn stands for how many values per each test // Array size is 2 // 0,1 Object[][] data=new Object[2][3]; //0th row data[0][0]="[email protected]"; data[0][1]="123456"; data[0][2]="Restrcited User"; //1st row data[1][0]="[email protected]"; data[1][1]="456788"; data[1][2]= "Non restricted user"; return data; } }
8a03d02edb644283305fd8a89fbcb2d817b8a4e8
2936e5b367ddfad1c42c65e51fa204bfb3a2479b
/src/reentrantLock/Demo4.java
df38e606d9c72a9671629e9efd81ec249c4d3b6d
[]
no_license
weimin1998/concurrent
c5ecde9298f8715fe80b70c651d7f2277f866481
0c4daa347b707233e82d6ff6c43c939170761e9d
refs/heads/master
2023-03-07T23:01:01.757527
2023-02-26T05:05:00
2023-02-26T05:05:00
326,370,698
0
0
null
null
null
null
UTF-8
Java
false
false
936
java
package reentrantLock; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.ReentrantLock; /** * 锁超时2 */ public class Demo4 { public static ReentrantLock lock = new ReentrantLock(); public static void main(String[] args) { Thread thread = new Thread(() -> { // 尝试获得锁 boolean b = false; try { b = lock.tryLock(2, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } if(b){ System.out.println("子线程获得了锁"); }else { System.out.println("子线程没有获得锁"); } }); lock.lock(); thread.start(); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } lock.unlock(); } }
9b6edf44554d0f9db925d15a6d015219fc33b348
f29bd713198d28f10c929335985df2fbe120d731
/PROLACTANCIA/app/src/main/java/com/packages/prolactancia/MenuPrincipal.java
0b861b56f9a8e25bf49e44162dbac530bc9c85d5
[]
no_license
dsgonzag/ProyectoLactancia
8fa68489b537fba6255a13fae7bb6340fe0c4415
f2f04919838cacb83388b465fcac7566e18e5442
refs/heads/master
2022-12-13T17:13:00.451759
2020-09-15T16:10:15
2020-09-15T16:10:15
288,861,500
0
0
null
null
null
null
UTF-8
Java
false
false
12,599
java
package com.packages.prolactancia; import androidx.appcompat.app.AppCompatActivity; import androidx.constraintlayout.widget.ConstraintLayout; import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Bundle; import android.util.DisplayMetrics; import android.view.View; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.Toast; import com.packages.prolactancia.R; public class MenuPrincipal extends AppCompatActivity implements View.OnClickListener{ ImageButton bt_beneficios, bt_lactancia, bt_extraccion, bt_donacion, bt_higiene, bt_mitos; Intent siguiente; @Override protected void onCreate(Bundle savedInstanceState) { this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); super.onCreate(savedInstanceState); setContentView(R.layout.menu_principal); bt_beneficios=findViewById(R.id.bt_beneficios); bt_beneficios.setOnClickListener(this); bt_lactancia=findViewById(R.id.bt_lactancia); bt_lactancia.setOnClickListener(this); bt_extraccion=findViewById(R.id.bt_extraccion); bt_extraccion.setOnClickListener(this); bt_donacion=findViewById(R.id.bt_donacion); bt_donacion.setOnClickListener(this); bt_higiene=findViewById(R.id.bt_higiene); bt_higiene.setOnClickListener(this); bt_mitos=findViewById(R.id.bt_mitos); bt_mitos.setOnClickListener(this); redimensionar(); } public void onClick(View v) { switch(v.getId()) { case R.id.bt_beneficios: //Toast.makeText (getApplicationContext (), "boton beneficios" , Toast.LENGTH_SHORT) .show (); siguiente = new Intent(MenuPrincipal.this, Beneficios.class); this.finish(); startActivity(siguiente); break; case R.id.bt_lactancia: siguiente = new Intent(MenuPrincipal.this, MenuLactancia.class); this.finish(); startActivity(siguiente); break; case R.id.bt_extraccion: siguiente = new Intent(MenuPrincipal.this, MenuExtraccion.class); this.finish(); startActivity(siguiente); break; case R.id.bt_donacion: siguiente = new Intent(MenuPrincipal.this, Donacion.class); this.finish(); startActivity(siguiente); break; case R.id.bt_higiene: siguiente = new Intent(MenuPrincipal.this, Higiene.class); this.finish(); startActivity(siguiente); break; case R.id.bt_mitos: siguiente = new Intent(MenuPrincipal.this, MitosVerdades.class); this.finish(); startActivity(siguiente); break; default: break; } } public void redimensionar(){ DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int ancho = dm.widthPixels; int alto = dm.heightPixels; //Toast.makeText (getApplicationContext (), "ancho: " +ancho + " alto: "+alto , Toast.LENGTH_SHORT) .show (); int enc = 100; int marg_lat = 40; int ancho_disp = ancho - marg_lat; int ancho_2 = ancho_disp /2; int alto_disp = alto - enc; int esp = (int) Math.round(alto_disp * 0.1); //int margin_b = esp / 6; int margin_b = 0; alto_disp = alto_disp - esp; int alto_3 = alto_disp / 3; //Toast.makeText (getApplicationContext (), "espacio: " +esp + " margin: "+margin_b , Toast.LENGTH_SHORT) .show (); int ancho_bt = ancho_2 - 30; int alto_bt = alto_3; int dif = alto_bt - ancho_bt; int ax = 0; int ay = 0; //Toast.makeText (getApplicationContext (), "La diferencia es : "+dif , Toast.LENGTH_SHORT) .show (); if (dif < 50){ ax = 50 - dif; }else if (dif > 50){ ay = dif - 50; } ancho_bt = ancho_bt - ax; alto_bt = alto_bt - ay; //Toast.makeText (getApplicationContext (), "El ancho de botones será: "+ancho_bt , Toast.LENGTH_SHORT) .show (); //Toast.makeText (getApplicationContext (), "El alto de botones será: "+alto_bt , Toast.LENGTH_SHORT) .show (); ConstraintLayout.LayoutParams params_1 = (ConstraintLayout.LayoutParams) bt_beneficios.getLayoutParams(); ConstraintLayout.LayoutParams params_2 = (ConstraintLayout.LayoutParams) bt_lactancia.getLayoutParams(); ConstraintLayout.LayoutParams params_3 = (ConstraintLayout.LayoutParams) bt_extraccion.getLayoutParams(); ConstraintLayout.LayoutParams params_4 = (ConstraintLayout.LayoutParams) bt_donacion.getLayoutParams(); ConstraintLayout.LayoutParams params_5 = (ConstraintLayout.LayoutParams) bt_higiene.getLayoutParams(); ConstraintLayout.LayoutParams params_6 = (ConstraintLayout.LayoutParams) bt_mitos.getLayoutParams(); params_1.width = ancho_bt; params_1.height = alto_bt; params_1.bottomMargin = margin_b; params_2.width = ancho_bt; params_2.height = alto_bt; params_2.bottomMargin = margin_b; params_3.width = ancho_bt; params_3.height = alto_bt; params_3.bottomMargin = margin_b; params_4.width = ancho_bt; params_4.height = alto_bt; params_4.bottomMargin = margin_b; params_5.width = ancho_bt; params_5.height = alto_bt; params_5.bottomMargin = margin_b; params_6.width = ancho_bt; params_6.height = alto_bt; params_6.bottomMargin = margin_b; /*if(ancho<= 480){ params_1.width = 200; params_2.width = 200; params_3.width = 200; params_4.width = 200; params_5.width = 200; params_6.width = 200; }else if(ancho > 480 && ancho <= 600){ params_1.width = 250; params_2.width = 250; params_3.width = 250; params_4.width = 250; params_5.width = 250; params_6.width = 250; }else if(ancho > 600 && ancho <= 720){ params_1.width = 300; params_2.width = 300; params_3.width = 300; params_4.width = 300; params_5.width = 300; params_6.width = 300; }else if(ancho > 720 && ancho <= 840){ params_1.width = 300; params_2.width = 300; params_3.width = 300; params_4.width = 300; params_5.width = 300; params_6.width = 300; }else if(ancho > 840 && ancho <= 960){ params_1.width = 400; params_2.width = 400; params_3.width = 400; params_4.width = 400; params_5.width = 400; params_6.width = 400; }else if(ancho > 960 && ancho <= 1080){ params_1.width = 450; params_2.width = 450; params_3.width = 450; params_4.width = 450; params_5.width = 450; params_6.width = 450; }else if(ancho > 1080 && ancho <= 1200){ params_1.width = 500; params_2.width = 500; params_3.width = 500; params_4.width = 500; params_5.width = 500; params_6.width = 500; }else if(ancho > 1200 && ancho <= 1320){ params_1.width = 550; params_2.width = 550; params_3.width = 550; params_4.width = 550; params_5.width = 550; params_6.width = 550; }else if(ancho > 1320 && ancho <= 1440){ params_1.width = 600; params_2.width = 600; params_3.width = 600; params_4.width = 600; params_5.width = 600; params_6.width = 600; }else if(ancho > 1440){ params_1.width = 600; params_2.width = 600; params_3.width = 600; params_4.width = 600; params_5.width = 600; params_6.width = 600; }*/ /* if(alto<= 800){ params_1.height = 200; params_1.bottomMargin = 10; params_2.height = 200; params_2.bottomMargin = 10; params_3.height = 200; params_3.bottomMargin = 10; params_4.height = 200; params_4.bottomMargin = 10; params_5.height = 200; params_5.bottomMargin = 30; params_6.height = 200; params_6.bottomMargin = 30; }else if(alto > 800 && alto <= 1280){ params_1.height = 300; params_1.bottomMargin = 20; params_2.height = 300; params_2.bottomMargin = 20; params_3.height = 300; params_3.bottomMargin = 20; params_4.height = 300; params_4.bottomMargin = 20; params_5.height = 300; params_5.bottomMargin = 50; params_6.height = 300; params_6.bottomMargin = 50; }else if(alto > 1080 && alto <= 1280){ params_1.height = 350; params_1.bottomMargin = 20; params_2.height = 350; params_2.bottomMargin = 20; params_3.height = 350; params_3.bottomMargin = 20; params_4.height = 350; params_4.bottomMargin = 20; params_5.height = 350; params_5.bottomMargin = 50; params_6.height = 350; params_6.bottomMargin = 50; }else if(alto > 1280 && alto <= 1920){ params_1.height = 400; params_1.bottomMargin = 30; params_2.height = 400; params_2.bottomMargin = 30; params_3.height = 400; params_3.bottomMargin = 30; params_4.height = 400; params_4.bottomMargin = 30; params_5.height = 400; params_5.bottomMargin = 50; params_6.height = 400; params_6.bottomMargin = 50; }else if(alto > 1920 && alto <= 2260){ params_1.height = 520; params_1.bottomMargin = 30; params_2.height = 520; params_2.bottomMargin = 30; params_3.height = 520; params_3.bottomMargin = 30; params_4.height = 520; params_4.bottomMargin = 30; params_5.height = 520; params_5.bottomMargin = 70; params_6.height = 520; params_6.bottomMargin = 70; }else if(alto > 2260 && alto <= 2560) { params_1.height = 600; params_1.bottomMargin = 50; params_2.height = 600; params_2.bottomMargin = 50; params_3.height = 600; params_3.bottomMargin = 50; params_4.height = 600; params_4.bottomMargin = 50; params_5.height = 600; params_5.bottomMargin = 50; params_6.height = 600; params_6.bottomMargin = 50; }else if(alto > 2560) { params_1.height = 600; params_1.bottomMargin = 50; params_2.height = 600; params_2.bottomMargin = 50; params_3.height = 600; params_3.bottomMargin = 50; params_4.height = 600; params_4.bottomMargin = 50; params_5.height = 600; params_5.bottomMargin = 50; params_6.height = 600; params_6.bottomMargin = 50; } bt_beneficios.setLayoutParams(params_1); bt_beneficios.setScaleType(ImageView.ScaleType.CENTER_CROP); bt_lactancia.setLayoutParams(params_2); bt_lactancia.setScaleType(ImageView.ScaleType.CENTER_CROP); bt_extraccion.setLayoutParams(params_3); bt_extraccion.setScaleType(ImageView.ScaleType.CENTER_CROP); bt_donacion.setLayoutParams(params_4); bt_donacion.setScaleType(ImageView.ScaleType.CENTER_CROP); bt_higiene.setLayoutParams(params_5); bt_higiene.setScaleType(ImageView.ScaleType.CENTER_CROP); bt_mitos.setLayoutParams(params_6); bt_mitos.setScaleType(ImageView.ScaleType.CENTER_CROP);*/ } @Override public void onBackPressed(){ super.onDestroy(); System.exit(0); } }
de286543b4a7b64a8010156918de22a6202f5d5d
72b48949dc3752556c8d5bdf5aa3d241a814e12c
/Project-Code-v0.4/Sales.java
91ebb250856d858973b405a9c34a1a9bed92ce1b
[]
no_license
iliaspapad/NatKet
aa59bbfb18d1049cc1707c7203863e5230d7750c
07441cd74931295b690715a65c392527b7c9e90b
refs/heads/main
2023-05-10T12:11:38.510493
2021-06-11T09:42:02
2021-06-11T09:42:02
356,650,047
0
0
null
null
null
null
UTF-8
Java
false
false
7,322
java
package natket; public class Sales extends javax.swing.JFrame { public Sales() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { back = new javax.swing.JLabel(); catalogs = new javax.swing.JLabel(); insprod = new javax.swing.JLabel(); inscatalog = new javax.swing.JLabel(); products = new javax.swing.JLabel(); marketing = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); back.setText(" "); back.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { backMouseClicked(evt); } }); getContentPane().add(back, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 490, 60, 30)); catalogs.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { catalogsMouseClicked(evt); } }); getContentPane().add(catalogs, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 300, 160, 140)); insprod.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { insprodMouseClicked(evt); } }); getContentPane().add(insprod, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 110, 170, 140)); inscatalog.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { inscatalogMouseClicked(evt); } }); getContentPane().add(inscatalog, new org.netbeans.lib.awtextra.AbsoluteConstraints(600, 110, 160, 140)); products.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { productsMouseClicked(evt); } }); getContentPane().add(products, new org.netbeans.lib.awtextra.AbsoluteConstraints(300, 300, 170, 140)); marketing.setIcon(new javax.swing.ImageIcon(getClass().getResource("/natket/Sales.jpg"))); // NOI18N marketing.setText(" "); getContentPane().add(marketing, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 860, 550)); pack(); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void catalogsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_catalogsMouseClicked }//GEN-LAST:event_catalogsMouseClicked private void insprodMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_insprodMouseClicked // TODO add your handling code here: }//GEN-LAST:event_insprodMouseClicked private void inscatalogMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_inscatalogMouseClicked // TODO add your handling code here: }//GEN-LAST:event_inscatalogMouseClicked private void productsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_productsMouseClicked // TODO add your handling code here: }//GEN-LAST:event_productsMouseClicked private void backMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_backMouseClicked HomePage a = new HomePage(); a.setVisible(true); this.dispose(); }//GEN-LAST:event_backMouseClicked /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Sales.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Sales.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Sales.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Sales.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> //</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 Sales().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel back; private javax.swing.JLabel catalogs; private javax.swing.JLabel inscatalog; private javax.swing.JLabel insprod; private javax.swing.JLabel marketing; private javax.swing.JLabel products; // End of variables declaration//GEN-END:variables }
e6b38ee7cd980d9341bea9b9498513fbde879ef4
15f4fc5632f21e6e0d407c3440cac911c379a8bb
/app/src/main/java/com/okq/pestcontrol/adapter/listener/OnItemClickListener.java
41acbe8b0f1123b5639d7f3f4dbd2e3e8fc1442d
[ "Apache-2.0" ]
permissive
SageTripp/PestControl
799d26aa6f101e46b7e7a7e6f4f10b64cbcdfd55
8a603d4c02a56446767e694fa110f238d44eea4a
refs/heads/master
2021-01-09T20:53:50.963164
2016-07-27T08:38:40
2016-07-27T08:38:40
59,530,102
1
0
null
null
null
null
UTF-8
Java
false
false
207
java
package com.okq.pestcontrol.adapter.listener; /** * adapter点击事件监听器 * Created by Administrator on 2015/12/18. */ public interface OnItemClickListener { void onItemClick(int position); }
7df21cc3ca6c752c5dedcd35eb17fa15de822f76
ec9bf57a07b7b06134ec7a21407a11f69cc644f7
/src/afr$9.java
9de91a7a1de3cdbb1ce71f45721678bb57f6ee77
[]
no_license
jzarca01/com.ubercab
f95c12cab7a28f05e8f1d1a9d8a12a5ac7fbf4b1
e6b454fb0ad547287ae4e71e59d6b9482369647a
refs/heads/master
2020-06-21T04:37:43.723581
2016-07-19T16:30:34
2016-07-19T16:30:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
515
java
import java.util.Map; final class afr$9 implements afs { public final void a(ajm paramajm, Map<String, String> paramMap) { paramMap = paramajm.h(); if (paramMap != null) { paramMap.a(); return; } paramajm = paramajm.i(); if (paramajm != null) { paramajm.a(); return; } ain.d("A GMSG tried to close something that wasn't an overlay."); } } /* Location: * Qualified Name: afr.9 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
6803a5fe9d0e9936d10a723e687d8444832ef112
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13708-7-22-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/observation/internal/DefaultObservationManager_ESTest_scaffolding.java
31e3f4e3fb01ffe97d07e9a8a81dc1e3cbfc7ec2
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
460
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Apr 07 23:55:57 UTC 2020 */ package org.xwiki.observation.internal; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DefaultObservationManager_ESTest_scaffolding { // Empty scaffolding for empty test suite }
7d319ed6dae42077434a1129b94d00a9bec7f1f6
c17b1e792103a32533fcd6a854562338cf09a66b
/src/main/java/cabinet/dao/EventDAO.java
d31a97c21bf7d010db1ee7763afbbd6063ae319b
[]
no_license
abudimirov/deutsche_telekom
b2057fbe420d8205a5ba4baaff97b3613386025b
f6f1b31139ce69516eb57d8340918404eedf1533
refs/heads/main
2023-06-09T01:41:54.232620
2021-07-01T07:55:47
2021-07-01T07:55:47
357,221,146
0
0
null
null
null
null
UTF-8
Java
false
false
330
java
package cabinet.dao; import cabinet.model.Event; import cabinet.model.Patient; import java.util.List; public interface EventDAO { List<Event> allEvents(); List<Event> getEventsByPatient(Patient patient); void add(Event event); void delete(Event event); void edit(Event event); Event getById(int id); }
7b1d28dd3c55461ba221b5a44c612b6d157b5d87
d15e4905fbfce06ccc891664cbb3306ccd436f25
/library/src/androidTest/java/id/pahlevikun/highlightbannerslider/ExampleInstrumentedTest.java
2556cef0b6d70526dc90f7747a0b2f77ab644ae0
[]
no_license
pahlevikun/BannerSliderView
ff9640125e67ea3c115ea9f4617743ba67bc8733
76d19ac45864059c1b7dcbf84dc9c0209240f5ec
refs/heads/master
2020-04-14T01:42:01.957467
2018-12-30T07:14:39
2018-12-30T07:14:39
163,567,101
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package id.pahlevikun.highlightbannerslider; 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.*; /** * 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() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.library.test", appContext.getPackageName()); } }
f6f44df6a98a70c246b7287b77bd93ce57af7d8c
704d812bd607aa7d290648cc5e442b82bae512d0
/src/test/java/cn/xutingyin/springbootjenkins/SpringbootJenkinsApplicationTests.java
bd307d02b936412c083a733448878fd7a2ca73a5
[]
no_license
xutingyin/springboot-jenkins-demo
b8e18ad0083855bc02a53b67e4c4281e4e32e100
cad89819bc5a8f0b4af088d67188079532bfb0ea
refs/heads/master
2020-12-02T12:57:19.766175
2020-01-03T03:42:19
2020-01-03T03:42:19
231,013,293
0
0
null
null
null
null
UTF-8
Java
false
false
237
java
package cn.xutingyin.springbootjenkins; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class SpringbootJenkinsApplicationTests { @Test void contextLoads() {} }
7fa780c5885e304964ed6e2c837ed9a364b3a3f4
45b0f3e5827da724ac4eaf2fb28636e73041b269
/rear-end/src/main/java/com/yubin/hotelSys/dao/RoomTypeMapper.java
2945cb86fc6ed7551561550229b3174995e58632
[ "MIT" ]
permissive
yubinCloud/hotel-manage-system
864feb3b9d0798203df673464667041febe97c70
000e0319961dbae17f97f4e8ca2661628c6e0ce0
refs/heads/master
2023-02-17T03:12:33.183228
2021-01-01T02:48:15
2021-01-01T02:48:15
325,905,849
4
0
MIT
2021-01-01T02:48:16
2021-01-01T02:37:00
Vue
UTF-8
Java
false
false
676
java
package com.yubin.hotelSys.dao; import com.yubin.hotelSys.dto.RoomTypeSearchFormDTO; import com.yubin.hotelSys.model.RoomType; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; import java.util.List; @Mapper @Repository public interface RoomTypeMapper { // 修改一个房间的价格 public void modifyStdPrice(@Param("typeId") int typeId, @Param("price") double price); // 查看一个房间的全部类型 public List<RoomType> queryAllRoomType(); // 根据条件查询房间类型 public List<RoomType> selectRoomType(RoomTypeSearchFormDTO roomType); }
3259590f7359cd7ba7e43dbd1e98dcfcde79730d
9790acdbebe160b7b06858dcc912dca6bb952cdc
/src/main/java/com/nirensinha/myproject/service/KeyAccomplishmentService.java
e7d310ab6d2bd843845c724ca25913fd70bc9d0e
[]
no_license
nirensinha/myproject
0c14685636a1ec0736c61d47edfe707d842284be
18d3fdc686ad3160796f156eed0747225442923a
refs/heads/master
2020-09-21T14:35:54.152209
2014-07-27T15:01:45
2014-07-27T15:01:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
433
java
package com.nirensinha.myproject.service; import java.util.List; import com.nirensinha.myproject.model.KeyAccomplishment; import com.nirensinha.myproject.model.Model; public interface KeyAccomplishmentService { public String delete(Long id); public List<Model> findAll(Long projectId); public KeyAccomplishment findOne(Long id); public KeyAccomplishment save(KeyAccomplishment keyAccomplishment); }
eafb867adc1ab9b3b2eee3ab39af9f4c858c1cfc
4196305da535b8a7bf43781afe4ab0e2fe613cea
/src/main/java/inno/edu/api/domain/profile/interest/repositories/InterestRepository.java
ea9afc310b9cd69f8e2a220f0840996c3a378564
[]
no_license
gustavodomenico/inno-api
3ac2b3f294e6dc60e960da9de224785250ae3ea6
319ff4b3ff092942f384a42ad478f686340e6ba8
refs/heads/master
2020-05-25T04:16:21.853648
2018-02-01T01:44:14
2018-02-01T01:44:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
359
java
package inno.edu.api.domain.profile.interest.repositories; import inno.edu.api.domain.profile.interest.models.Interest; import org.springframework.data.repository.CrudRepository; import java.util.List; import java.util.UUID; public interface InterestRepository extends CrudRepository<Interest, UUID> { List<Interest> findByProfileId(UUID profileId); }
5b7309ac4848a0e88e480dabf4dbd66aa7298ff5
eadd96a893f957995ca2e568caeb0e048b8529da
/ax-db/src/main/java/org/linlinjava/ax/db/dao/AxUserFormidMapper.java
e4270b4d783110f7a63d722e245432ede500c220
[ "CC-BY-ND-4.0", "MIT" ]
permissive
SiriusQiu/ax_mall
2f361c7a76ede637d04c2e6dbc5c42170a77e6cc
123d23f993c623b6a4e293974eb32257d9cf37d2
refs/heads/master
2022-06-30T12:15:02.336406
2019-10-08T03:48:06
2019-10-08T03:48:06
210,342,550
0
0
MIT
2022-06-21T01:55:46
2019-09-23T11:52:11
Java
UTF-8
Java
false
false
4,724
java
package org.linlinjava.ax.db.dao; import java.util.List; import org.apache.ibatis.annotations.Param; import org.linlinjava.ax.db.domain.AxUserFormid; import org.linlinjava.ax.db.domain.AxUserFormidExample; public interface AxUserFormidMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ long countByExample(AxUserFormidExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int deleteByExample(AxUserFormidExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int deleteByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int insert(AxUserFormid record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int insertSelective(AxUserFormid record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ AxUserFormid selectOneByExample(AxUserFormidExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ AxUserFormid selectOneByExampleSelective(@Param("example") AxUserFormidExample example, @Param("selective") AxUserFormid.Column ... selective); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ List<AxUserFormid> selectByExampleSelective(@Param("example") AxUserFormidExample example, @Param("selective") AxUserFormid.Column ... selective); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ List<AxUserFormid> selectByExample(AxUserFormidExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ AxUserFormid selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") AxUserFormid.Column ... selective); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ AxUserFormid selectByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ AxUserFormid selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int updateByExampleSelective(@Param("record") AxUserFormid record, @Param("example") AxUserFormidExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int updateByExample(@Param("record") AxUserFormid record, @Param("example") AxUserFormidExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int updateByPrimaryKeySelective(AxUserFormid record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int updateByPrimaryKey(AxUserFormid record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int logicalDeleteByExample(@Param("example") AxUserFormidExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table ax_user_formid * * @mbg.generated */ int logicalDeleteByPrimaryKey(Integer id); }
c1ba03ddb40f6b9dfd3dbd0e70df33596b0a8d32
81812606c9a8585dc095fe49dd6681615142e0b3
/order-biz/order-service/src/main/java/com/tqz/order/controller/OrderController.java
7ed27066aa1ff6a5ace386c8c8f23e4694a6ef68
[]
no_license
sedricdhyh/spring-cloud-alibaba-demo
b4abd203ddc09b9236335d729435b87dac0779c0
f351264912198a021c9b0e142e7b982bbef6ad41
refs/heads/master
2023-05-31T23:44:34.512604
2021-06-18T08:03:53
2021-06-18T08:03:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,667
java
package com.tqz.order.controller; import com.tqz.order.dto.OrderDTO; import com.tqz.order.service.OrderService; import com.tqz.common.base.ResultData; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; import java.util.UUID; /** * <p> * order控制器 * </p> * * @author tianqingzhao * @since 2021/2/26 9:59 */ @Api(value = "订单接口", tags = "订单接口") @RestController @Log4j2 @RequiredArgsConstructor(onConstructor = @__(@Autowired) ) public class OrderController { private final OrderService orderService; @ApiOperation(value = "下单", notes = "下单接口") @PostMapping("/order/create") public ResultData<OrderDTO> create(OrderDTO orderDTO){ log.info("create order:{}",orderDTO); orderDTO.setOrderNo(UUID.randomUUID().toString()); orderDTO.setAmount(orderDTO.getPrice().multiply(new BigDecimal(orderDTO.getCount()))); return orderService.createOrder(orderDTO); } /** * 根据订单号删除订单 * @param orderNo 订单编号 */ @PostMapping("/order/delete") public ResultData<String> delete(@RequestParam String orderNo){ log.info("delete order id is {}",orderNo); orderService.delete(orderNo); return ResultData.success("订单删除成功"); } }
7ddc88376c01fc8c12a9187af14a3d511d2ecf3d
62b99b7fcf75821b65b9226fad26b3aecf9c31c6
/sakai/src/test/java/Tests/WhenHomePageIsLoaded.java
83c3304247b4336c7f8a5554e76d545d40e55cd1
[]
no_license
inpas-test/sakai-oae
86d0a52c2eb1cecf07a0c82e8412cc6d4bb21300
c88379fec4ea9c57c8fb5f1bf24f7f1b8d4b4d57
refs/heads/master
2021-01-19T09:38:53.138283
2013-01-14T09:28:58
2013-01-14T09:28:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,303
java
package Tests; import org.junit.After; import org.junit.Before; //import org.junit.Ignore; import org.junit.Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import Pages.PageHeader; import WebElements.LoginForm; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; public class WhenHomePageIsLoaded { private WebDriver driver = new FirefoxDriver(); private PageHeader pageHeader = new PageHeader(driver); private LoginForm loginForm = new LoginForm(driver); @Before public void LoadHomePage(){ try{ driver.get("http://uos-centos:8080"); //driver.wait(); driver.manage().window().maximize(); }catch(Exception e){ System.out.println(e.getMessage()); } } @Test public void aUserShouldLogging(){ loginForm.login("admin", "admin", driver); assertThat(driver.getTitle(), containsString("User")); } @Test public void aUserShouldSearhByString() throws InterruptedException{ try{ System.out.println("Bigin test!"); pageHeader.search("sakai"); pageHeader.viewResults(); }catch(Exception e){ System.out.println(e.getMessage()); } } @After public void closePage(){ //driver.quit(); } }
b303dfff62afde40ca04f9b81c5229fc8f5d46a8
fc160694094b89ab09e5c9a0f03db80437eabc93
/java-dialogflow-cx/samples/snippets/generated/com/google/cloud/dialogflow/cx/v3/experiments/getexperiment/SyncGetExperimentExperimentname.java
f975be8646827814bde7825e6eae090377e7ffd0
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/google-cloud-java
4f4d97a145e0310db142ecbc3340ce3a2a444e5e
6e23c3a406e19af410a1a1dd0d0487329875040e
refs/heads/main
2023-09-04T09:09:02.481897
2023-08-31T20:45:11
2023-08-31T20:45:11
26,181,278
1,122
685
Apache-2.0
2023-09-13T21:21:23
2014-11-04T17:57:16
Java
UTF-8
Java
false
false
1,903
java
/* * Copyright 2023 Google LLC * * 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.cloud.dialogflow.cx.v3.samples; // [START dialogflow_v3_generated_Experiments_GetExperiment_Experimentname_sync] import com.google.cloud.dialogflow.cx.v3.Experiment; import com.google.cloud.dialogflow.cx.v3.ExperimentName; import com.google.cloud.dialogflow.cx.v3.ExperimentsClient; public class SyncGetExperimentExperimentname { public static void main(String[] args) throws Exception { syncGetExperimentExperimentname(); } public static void syncGetExperimentExperimentname() throws Exception { // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ExperimentsClient experimentsClient = ExperimentsClient.create()) { ExperimentName name = ExperimentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]", "[EXPERIMENT]"); Experiment response = experimentsClient.getExperiment(name); } } } // [END dialogflow_v3_generated_Experiments_GetExperiment_Experimentname_sync]
c57d8a1b2e7f28c5fd727a95eb144f62d23dcd21
a58e912ff9a6742b29b94d6fc038e5362f752927
/SpringBoot/src/test/java/com/yany/configure/ymlTest.java
8df8f38f618fcdfa7da257a9c3ea1c0da4d20a7c
[]
no_license
yany8060/SpringDemo
19bcbbd716f749a2a0746e5cf2ae5dbafeb47ac7
8c10270c8ded063c65f93e0a448319dd76ee93ff
refs/heads/master
2021-01-11T17:57:52.036722
2017-09-25T06:38:31
2017-09-25T06:38:31
79,883,852
3
2
null
null
null
null
UTF-8
Java
false
false
708
java
package com.yany.configure; import com.yany.Application; import com.yany.dao.single.UseDao; import com.yany.module.UserModel; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.annotation.Resource; /** * Created by yanyong on 2017/1/25. */ @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = Application.class) public class ymlTest { // @Resource // AdsDataSourceConfig adsDataSourceConfig; @Resource UseDao useDao; @Test public void getConfig() { System.out.println(useDao.selectCount()); } }
fc57877180a999fef2a91f3ab1c23dccaf320181
3328ffc47e011d00f475f5ab1459db34c7d3458c
/java/com/example/deebika/stayhealthy/v12.java
36c5edd6473eecae3705f34b6e35cf061cfc4dc0
[]
no_license
DeebikaMeenakshisundaram/Stayhealthy
7e55a6cd55e3e1ebc4e70e5cc3f902c6b75ed1c5
556d3ffb2fd392a1072766bd93efb3fb53d85b7d
refs/heads/master
2020-03-15T21:50:51.709104
2018-05-07T05:40:46
2018-05-07T05:40:46
132,362,810
0
0
null
null
null
null
UTF-8
Java
false
false
434
java
package com.example.deebika.stayhealthy; import android.app.Activity; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.Button; import android.widget.EditText; public class v12 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.v12); } }
2d98caa738b5cb05e10273b54f71a7ff851403d6
bf1adda72df9def3ba4d390e9bac682c4faf102c
/src/main/java/thread/threadPool/ThreadFactory.java
412d3cae064b719801fc0518aadc142edb9e1ff6
[]
no_license
Asura7969/Netty-Demon
e2c772d64a1f08415819d0a552fa5762e4f28e7c
e79c28f34376ef0745160f1e465f8be1c3d6df49
refs/heads/master
2020-03-27T12:26:11.682027
2018-09-11T13:52:29
2018-09-11T13:52:29
146,546,199
0
0
null
null
null
null
UTF-8
Java
false
false
128
java
package thread.threadPool; @FunctionalInterface public interface ThreadFactory { Thread createThread(Runnable runnable); }
092336912bbefbece3bce2e4a7e3c4ee9fdd1ed6
f85b54589867d2919331e10af10970b430fbb5b1
/src/main/java/org/apache/naming/resources/DirContextURLConnection.java
5442c12c508eb3e24c89e23a6bb9d813fa586ac0
[]
no_license
qiuzj/HowTomcatWorks
4b2285f2f29a28da4647ffbc100dc1f1209f8ec3
71efb5d1db299a41ae4af1e18dc649f832242ee5
refs/heads/main
2023-07-14T19:28:48.160957
2021-08-29T14:02:20
2021-08-29T14:02:20
401,041,182
0
0
null
null
null
null
UTF-8
Java
false
false
11,527
java
/* * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/resources/DirContextURLConnection.java,v 1.12 2001/06/22 20:18:24 glenn Exp $ * $Revision: 1.12 $ * $Date: 2001/06/22 20:18:24 $ * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. 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. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact [email protected]. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR * ITS 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. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.naming.resources; import java.net.URL; import java.net.URLConnection; import java.io.IOException; import java.io.InputStream; import java.io.FileNotFoundException; import java.security.Permission; import java.util.Date; import java.util.Enumeration; import java.util.Vector; import javax.naming.NamingException; import javax.naming.NamingEnumeration; import javax.naming.NameClassPair; import javax.naming.directory.DirContext; import javax.naming.directory.Attribute; import javax.naming.directory.Attributes; import org.apache.naming.JndiPermission; import org.apache.naming.resources.Resource; import org.apache.naming.resources.ResourceAttributes; /** * Connection to a JNDI directory context. * <p/> * Note: All the object attribute names are the WebDAV names, not the HTTP * names, so this class overrides some methods from URLConnection to do the * queries using the right names. Content handler is also not used; the * content is directly returned. * * @author <a href="mailto:[email protected]">Remy Maucherat</a> * @version $Revision: 1.12 $ */ public class DirContextURLConnection extends URLConnection { // ----------------------------------------------------------- Constructors public DirContextURLConnection(DirContext context, URL url) { super(url); if (context == null) throw new IllegalArgumentException ("Directory context can't be null"); if (System.getSecurityManager() != null) { this.permission = new JndiPermission(url.toString()); } this.context = context; } // ----------------------------------------------------- Instance Variables /** * Directory context. */ protected DirContext context; /** * Associated resource. */ protected Resource resource; /** * Associated DirContext. */ protected DirContext collection; /** * Other unknown object. */ protected Object object; /** * Attributes. */ protected Attributes attributes; /** * Date. */ protected long date; /** * Permission */ protected Permission permission; // ------------------------------------------------------------- Properties /** * Connect to the DirContext, and retrive the bound object, as well as * its attributes. If no object is bound with the name specified in the * URL, then an IOException is thrown. * * @throws IOException Object not found */ public void connect() throws IOException { if (!connected) { try { date = System.currentTimeMillis(); String path = getURL().getFile(); if (context instanceof ProxyDirContext) { ProxyDirContext proxyDirContext = (ProxyDirContext) context; String hostName = proxyDirContext.getHostName(); String contextName = proxyDirContext.getContextName(); if (hostName != null) { if (!path.startsWith("/" + hostName + "/")) return; path = path.substring(hostName.length()+ 1); } if (contextName != null) { if (!path.startsWith(contextName + "/")) { return; } else { path = path.substring(contextName.length()); } } } object = context.lookup(path); attributes = context.getAttributes(path); if (object instanceof Resource) resource = (Resource) object; if (object instanceof DirContext) collection = (DirContext) object; } catch (NamingException e) { // Object not found } connected = true; } } /** * Return the content length value. */ public int getContentLength() { return getHeaderFieldInt(ResourceAttributes.CONTENT_LENGTH, -1); } /** * Return the content type value. */ public String getContentType() { return getHeaderField(ResourceAttributes.CONTENT_TYPE); } /** * Return the last modified date. */ public long getDate() { return date; } /** * Return the last modified date. */ public long getLastModified() { if (!connected) { // Try to connect (silently) try { connect(); } catch (IOException e) { } } if (attributes == null) return 0; Attribute lastModified = attributes.get(ResourceAttributes.LAST_MODIFIED); if (lastModified != null) { try { Date lmDate = (Date) lastModified.get(); return lmDate.getTime(); } catch (Exception e) { } } return 0; } /** * Returns the name of the specified header field. */ public String getHeaderField(String name) { if (!connected) { // Try to connect (silently) try { connect(); } catch (IOException e) { } } if (attributes == null) return (null); Attribute attribute = attributes.get(name); try { return attribute.get().toString(); } catch (Exception e) { // Shouldn't happen, unless the attribute has no value } return (null); } /** * Get object content. */ public Object getContent() throws IOException { if (!connected) connect(); if (resource != null) return getInputStream(); if (collection != null) return collection; if (object != null) return object; throw new FileNotFoundException(); } /** * Get object content. */ public Object getContent(Class[] classes) throws IOException { Object object = getContent(); for (int i = 0; i < classes.length; i++) { if (classes[i].isInstance(object)) return object; } return null; } /** * Get input stream. */ public InputStream getInputStream() throws IOException { if (!connected) connect(); if (resource == null) { throw new FileNotFoundException(); } else { // Reopen resource try { resource = (Resource) context.lookup(getURL().getFile()); } catch (NamingException e) { } } return (resource.streamContent()); } /** * Get the Permission for this URL */ public Permission getPermission() { return permission; } // --------------------------------------------------------- Public Methods /** * List children of this collection. The names given are relative to this * URI's path. The full uri of the children is then : path + "/" + name. */ public Enumeration list() throws IOException { if (!connected) { connect(); } if ((resource == null) && (collection == null)) { throw new FileNotFoundException(); } Vector result = new Vector(); if (collection != null) { try { NamingEnumeration enume = context.list(getURL().getFile()); while (enume.hasMoreElements()) { NameClassPair ncp = (NameClassPair) enume.nextElement(); result.addElement(ncp.getName()); } } catch (NamingException e) { // Unexpected exception throw new FileNotFoundException(); } } return result.elements(); } }
3e1afa26486001e2ca42203c5120b2945b1218ba
e6f76fe0310e734beea1146bb9d7bbb125cc1dbd
/java/java_demo1/src/TestTradeinfo.java
6e54683da7b53b0a2b81f5a572d0049fb797676b
[]
no_license
quguoxin/all_study
d8f5039e57fe33e186561ae58316c67716f5f38e
886a2352c80d93f0ee8932d00193b83cbe0b8f9c
refs/heads/master
2022-12-21T12:04:28.132289
2019-10-10T17:55:50
2019-10-10T17:55:50
214,220,625
0
0
null
null
null
null
UTF-8
Java
false
false
613
java
import dao.impl.TradeinfoDaoImpl; import entity.Tradeinfo; import java.util.List; public class TestTradeinfo { public static void main(String[] args) { TradeinfoDaoImpl tradeinfoDaoImpl=new TradeinfoDaoImpl(); // 分页查询 List<Tradeinfo> list= tradeinfoDaoImpl.findTradeinfoByPageNo(2,10); for(Tradeinfo temp:list){ System.out.println(temp.toString()); } //找出本月单笔交易信息中金额最大的卡号 System.out.println("月单笔交易信息中金额最大的卡号为:"+tradeinfoDaoImpl.findTopMoneyToBankNo()); } }
3e56ff6a9bcece6098eafbf0fc7a9f81a3348801
1d344797c9278f975f21415c12507c6b55073fb3
/src/main/java/br/com/monitorweb/business/MonitoramentoSwapBO.java
777cf01c5bd430cfa9ad278cb69c9d6b115f228f
[]
no_license
Eduardobalan/MonitorWeb-api
930bde729e3e67cb3b16981fea9ff49618c500b5
2d3ba1402fe161fbabe4dee53fff07c4b8dd5f23
refs/heads/master
2021-09-07T14:04:14.462764
2018-02-24T01:01:01
2018-02-24T01:01:01
119,914,414
1
0
null
2018-02-07T19:12:32
2018-02-02T01:20:34
Java
UTF-8
Java
false
false
421
java
package br.com.monitorweb.business; import br.com.monitorweb.business.generic.GenericBO; import br.com.monitorweb.entity.MonitoramentoSwap; import br.com.monitorweb.repository.MonitoramentoSwapRepository; import org.springframework.stereotype.Component; /** * Created by Eduardo Balan on 07/07/2017. */ @Component public class MonitoramentoSwapBO extends GenericBO<MonitoramentoSwap, MonitoramentoSwapRepository> { }
504be7261867682ba2d065e6f51099dec01e2eb1
7d33831cbe16886a21f620877237750920664830
/SwipeFlip/mobile/src/main/java/com/tenghan/swipeflip/DemoPeel2Command.java
3ce67b049bb40578895dc655fdd98973939147ff
[]
no_license
hanteng1/Text_Read_Entry
e0bb349b9d54e6d4a998792ee33c98ec1865af2b
0c27f4fbe07790c1b15c096a579f4cac6b695782
refs/heads/master
2021-06-27T04:30:26.983444
2017-09-19T02:58:06
2017-09-19T02:58:06
88,791,826
0
0
null
null
null
null
UTF-8
Java
false
false
13,019
java
package com.tenghan.swipeflip; import android.content.Context; import android.graphics.Point; import android.graphics.PointF; import android.util.Log; import com.eschao.android.widget.pageflip.GLPoint; import com.eschao.android.widget.pageflip.PageFlipState; import com.eschao.android.widget.pageflip.modify.PageModify; /** * Created by hanteng on 2017-08-18. */ public class DemoPeel2Command extends PageFlipModifyAbstract{ private final static String TAG = "DemoPeel2Command"; //first page as main content, second page as command private final static int pageSize = 3; public DemoPeel2Command(Context context) { super(context, pageSize); } public void computeScrollPointsForAutoFlip(boolean isForward, Point start, Point end) { } /** * Handle finger moving event * * this is set the drawing state, but not drawing * @param touchX x of finger moving point * @param touchY y of finger moving point * @return true if moving will trigger to draw a new frame for page flip, * False means the movement should be ignored. */ public boolean onFingerMove(float touchX, float touchY) { touchX = mViewRect.toOpenGLX(touchX); touchY = mViewRect.toOpenGLY(touchY); float dy = (touchY - mStartTouchP.y); float dx = (touchX - mStartTouchP.x); // begin to flip if (mFlipState == PageFlipState.BEGIN_FLIP // && (Math.abs(dx) > mViewRect.width * 0.05f) ) { //for (int itrp = 0; itrp < PAGE_SIZE; itrp++) { PageModify page = mPages[currentPageLock]; GLPoint originP = page.originP; GLPoint diagonalP = page.diagonalP; // set OriginP and DiagonalP points //page.setOriginAndDiagonalPoints(dy); page.setOriginAndDiagonalPoints(dx, dy, mStartTouchP.x, mStartTouchP.y); //clear the variables MainActivity.getSharedInstance().mGestureService.reset(); //starting from one page singlePageMode = true; //set origin MainActivity.getSharedInstance().mGestureService.setOrigin(new float[]{touchX, touchY}); MainActivity.getSharedInstance().mGestureService.handleData(new float[]{touchX, touchY}); // compute max degree between X axis and line from TouchP to OriginP // and max degree between X axis and line from TouchP to // (OriginP.x, DiagonalP.Y) float y2o = Math.abs(mStartTouchP.y - originP.y); float y2d = Math.abs(mStartTouchP.y - diagonalP.y); page.mMaxT2OAngleTan = page.computeTanOfCurlAngle(y2o); page.mMaxT2DAngleTan = page.computeTanOfCurlAngle(y2d); // moving at the top and bottom screen have different tan value of // angle if ((originP.y < 0 && page.right > 0) || (originP.y > 0 && page.right <= 0)) { page.mMaxT2OAngleTan = -page.mMaxT2OAngleTan; } else { page.mMaxT2DAngleTan = -page.mMaxT2DAngleTan; } if (0 == FIRST_PAGE) //first page { // determine if it is moving backward or forward if(Math.abs(dx) > Math.abs(dy)) { if (dx > 0 && mListener != null && mListener.canFlipBackward()) { mStartTouchP.x = originP.x; dx = (touchX - mStartTouchP.x); mFlipState = PageFlipState.BACKWARD_FLIP; //Log.d(TAG, "back FLIP"); } else if (mListener != null && mListener.canFlipForward() && (dx < 0 && originP.x > 0 || dx > 0 && originP.x < 0)) { mFlipState = PageFlipState.FORWARD_FLIP; //Log.d(TAG, "forward FLIP"); } }else { if(mListener != null) { mFlipState = PageFlipState.UPWARD_FLIP; } } } //} // end of for loop } // in moving, compute the TouchXY if (mFlipState == PageFlipState.FORWARD_FLIP || mFlipState == PageFlipState.BACKWARD_FLIP || mFlipState == PageFlipState.UPWARD_FLIP || mFlipState == PageFlipState.RESTORE_FLIP) { MainActivity.getSharedInstance().mGestureService.handleData(new float[]{touchX, touchY}); //temporary solution if(Math.abs(dy) <= 0.1f) dy = dy > 0 ? 0.11f : -0.11f; if(Math.abs(dx) <= 0.1f) dx = dx > 0 ? 0.11f : -0.11f; mIsVertical = Math.abs(dy) <= 0.1f; if(mIsVertical == false) { //Log.d(TAG, "abs dx " + Math.abs(dx)); mIsHorizontal = Math.abs(dx) <= 0.1f; } //skip the calculation when the flip is either horizontal or vertical if(mIsHorizontal || mIsVertical) { Log.d(TAG, "skipping a frame .............."); return false; } // multiply a factor to make sure the touch point is always head of // finger point //there could be two conditions //second page flip only //all previous page flip togeter if(singlePageMode) { dx = (touchX - mStartTouchP.x) * (float)Math.pow(TOUCH_DIFF_COEFFICIENT, FIRST_PAGE); //forwards or backwards dy = (touchY - mStartTouchP.y) * (float)Math.pow(TOUCH_DIFF_COEFFICIENT, FIRST_PAGE); //upwards or downwards if (PageFlipState.FORWARD_FLIP == mFlipState || PageFlipState.BACKWARD_FLIP == mFlipState || PageFlipState.UPWARD_FLIP == mFlipState) { dx *= 1.2f; dy *= 1.2f; } else { dx *= 1.1f; dy *= 1.1f; } PageModify page = mPages[currentPageLock]; GLPoint originP = page.originP; GLPoint diagonalP = page.diagonalP; // moving direction is changed: // 1. invert max curling angle // 2. invert Y of original point and diagonal point if(mFlipState == PageFlipState.FORWARD_FLIP || mFlipState == PageFlipState.BACKWARD_FLIP) { if ((dy < 0 && originP.y < 0) || (dy > 0 && originP.y > 0) ) { float t = page.mMaxT2DAngleTan; page.mMaxT2DAngleTan = page.mMaxT2OAngleTan; page.mMaxT2OAngleTan = t; page.invertYOfOriginPoint(); } }else if(mFlipState == PageFlipState.UPWARD_FLIP) { if((dx < 0 && originP.x < 0) || (dx > 0 && originP.x > 0)) { //invert the x of original point and diagonal point page.invertXOfOriginPoint(); } } // set touchP(x, y) and middleP(x, y) if(0 == FIRST_PAGE) { mLastTouchP.set(dx + originP.x, dy + originP.y); //used to store the value temporarily } mTouchP.set(dx + originP.x, dy + originP.y); //Log.d(TAG, "origin point" + originP.x); //Log.d(TAG, "moving touch point " + mTouchP.x); page.mFakeTouchP.set(mTouchP.x, mTouchP.y); page.mMiddleP.x = (mTouchP.x + originP.x) * 0.5f; page.mMiddleP.y = (mTouchP.y + originP.y) * 0.5f; //detect whether the back page has reached front page float travelDis = calDistance(dx, dy); if(travelDis > maxTravelDis) { maxTravelDis = travelDis; //Log.d(TAG, "max travel " + maxTravelDis); singlePageMode = false; } }else { for (int itrp = 0; itrp < currentPageLock + 1; itrp++) { //differentiate dx //the 0.9 can be adjusted dx = (touchX - mStartTouchP.x) * (float)Math.pow(TOUCH_DIFF_COEFFICIENT, itrp); //forwards or backwards dy = (touchY - mStartTouchP.y) * (float)Math.pow(TOUCH_DIFF_COEFFICIENT, itrp); //upwards or downwards if (PageFlipState.FORWARD_FLIP == mFlipState || PageFlipState.BACKWARD_FLIP == mFlipState || PageFlipState.UPWARD_FLIP == mFlipState) { dx *= 1.2f; dy *= 1.2f; } else { dx *= 1.1f; dy *= 1.1f; } PageModify page = mPages[itrp]; GLPoint originP = page.originP; GLPoint diagonalP = page.diagonalP; if(mFlipState == PageFlipState.FORWARD_FLIP || mFlipState == PageFlipState.BACKWARD_FLIP) { if ((dy < 0 && originP.y < 0) || (dy > 0 && originP.y > 0) ) { float t = page.mMaxT2DAngleTan; page.mMaxT2DAngleTan = page.mMaxT2OAngleTan; page.mMaxT2OAngleTan = t; page.invertYOfOriginPoint(); } }else if(mFlipState == PageFlipState.UPWARD_FLIP) { if((dx < 0 && originP.x < 0) || (dx > 0 && originP.x > 0)) { //invert the x of original point and diagonal point page.invertXOfOriginPoint(); } } // set touchP(x, y) and middleP(x, y) if(itrp == FIRST_PAGE) { mLastTouchP.set(dx + originP.x, dy + originP.y); //used to store the value temporarily } mTouchP.set(dx + originP.x, dy + originP.y); page.mFakeTouchP.set(mTouchP.x, mTouchP.y); page.mMiddleP.x = (mTouchP.x + originP.x) * 0.5f; page.mMiddleP.y = (mTouchP.y + originP.y) * 0.5f; if(itrp == FIRST_PAGE) { //detect whether the back page has reached front page float travelDis = calDistance(dx, dy); if(travelDis > maxTravelDis) { maxTravelDis = travelDis; //Log.d(TAG, "new max travel " + maxTravelDis); } } } //end of for loop } mTouchP.set(mLastTouchP.x, mLastTouchP.y); mLastTouchP.set(touchX, touchY); // continue to compute points to drawing flip computeVertexesAndBuildPage(); return true; } return false; } //calculate a distance from dx and dy private float calDistance(float disx, float disy) { return (float)Math.sqrt(disx * disx + disy * disy); } /** * Compute vertexes of page */ public void computeVertexesAndBuildPage() { //Log.d(TAG, "called"); if(singlePageMode) { mPages[currentPageLock].computeKeyVertexesWhenSlope(); mPages[currentPageLock].computeVertexesWhenSlope(); }else { for(int itrp = 0; itrp < (currentPageLock + 1); itrp++) { if (mIsVertical) { //mPages[itrp].computeKeyVertexesWhenVertical(); //mPages[itrp].computeVertexesWhenVertical(); } else if (mIsHorizontal) { //mPages[itrp].computeKeyVertexesWhenHorizontal(); //mPages[itrp].computeVertexesWhenHorizontal(); } else { mPages[itrp].computeKeyVertexesWhenSlope(); mPages[itrp].computeVertexesWhenSlope(); } } } } }
0c162c9eb422568749b671f210d76f49f47d2382
e51e11dccbdd0f35adfef7e2c0a135fe8f054ca5
/android/app/src/main/java/com/gorillabusmobile/MainActivity.java
98f6f41df2b640104a50ad8512771c8cc7bc35da
[ "CC-BY-3.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
chugachski/gorilla-bus-mobile
4b74ccfc111d7a7fbbe25f36c97753c39f412c89
115687db7e29d0539ccfd7b24c4b0afce22bd3f3
refs/heads/master
2021-01-16T20:33:40.290077
2016-09-02T14:05:02
2016-09-02T14:05:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package com.gorillabusmobile; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "gorillaBusMobile"; } }
18fe52d472ad0244a940fe052ab47012a3242938
ee2a7e91080ce5f0cadef433022bdc788a0a09f2
/src/main/java/com/cn/cms/controller/CaptchaController.java
d832dc2631d313c205b343ea20fe8a8b23da529c
[]
no_license
Maybe728/CMS
7c0151bae8d8ae9eb23a0c604686e1777504d803
6160307dd497961ddaf384fbf95bf060a619a99b
refs/heads/master
2022-07-04T05:39:58.069751
2019-11-21T02:54:12
2019-11-21T02:54:12
160,485,809
0
0
null
2022-06-17T02:02:19
2018-12-05T08:31:27
Java
UTF-8
Java
false
false
2,223
java
package com.cn.cms.controller; import com.google.code.kaptcha.Constants; import com.google.code.kaptcha.Producer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.awt.image.BufferedImage; @Controller @RequestMapping("/kaptcha") public class CaptchaController { @Autowired private Producer captchaProducer; @RequestMapping("/getKaptchaImage") public void getKaptchaImage(HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); response.setDateHeader("Expires", 0); // Set standard HTTP/1.1 no-cache headers. response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate"); // Set IE extended HTTP/1.1 no-cache headers (use addHeader). response.addHeader("Cache-Control", "post-check=0, pre-check=0"); // Set standard HTTP/1.0 no-cache header. response.setHeader("Pragma", "no-cache"); // return a jpeg response.setContentType("image/jpeg"); // create the text for the image String capText = captchaProducer.createText(); System.out.println("******************验证码是: " + capText + "******************"); // store the text in the session session.setAttribute(Constants.KAPTCHA_SESSION_KEY, capText); // create the image with the text BufferedImage bi = captchaProducer.createImage(capText); ServletOutputStream out = response.getOutputStream(); // write the data out ImageIO.write(bi, "jpg", out); try { out.flush(); } finally { out.close(); } } }
0bf19f5b105dc46c36e2eaf04d62d9602cd788bb
83030561100036f7276317364a9ae289dc8ead3d
/VakyaYanntra_VirtualKB_Samasa/WebContent/WEB-INF/classes/wordProcessor/saveMeaning.java
540c2289bddef12c9572dfcea8cd9b2722395198
[]
no_license
surajmunale/VakyaYantra-NLP
b8b62681d0c18f829ad4cccae0921c460455ce79
62e1985450e4ed4b417e370118243c0d7b4faa8a
refs/heads/master
2016-09-05T23:30:11.744713
2015-07-12T01:07:01
2015-07-12T01:07:01
38,944,459
0
0
null
null
null
null
UTF-8
Java
false
false
9,065
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * saveMeaning.java * * Created on Apr 5, 2012, 6:53:25 PM */ package wordProcessor; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import transliteration.*; /** * * @author Priya */ public class saveMeaning extends javax.swing.JDialog { /** Creates new form saveMeaning */ public saveMeaning(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jLabel1.setText("Sanskrit Text"); jLabel2.setText("Enter meaning"); jTextField1.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { jTextField1KeyReleased(evt); } }); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane1.setViewportView(jTextArea1); jButton1.setText("Add to Dictionary\n"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jLabel3.setText("Parts of Speech "); jTextField2.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { jTextField2KeyReleased(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel3)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE) .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE) .addComponent(jButton1)))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(25, 25, 25) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(31, 31, 31) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(27, 27, 27) .addComponent(jButton1) .addGap(59, 59, 59)) ); pack(); }// </editor-fold>//GEN-END:initComponents choose_encoding encod=new choose_encoding(); private void jTextField1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1KeyReleased String str1 = "";//(tf1.getText().toString()).trim(); if (evt.getComponent() == this.jTextField1) { str1 = jTextField1.getText(); jTextField1.setText(encod.get_raw_to_dvn_view(jTextField1.getText())); } }//GEN-LAST:event_jTextField1KeyReleased private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed String word=jTextField1.getText(); String meaning=jTextArea1.getText(); String pos=jTextField2.getText(); join j=new join(); String translation=j.StoE(word); String Query="INSERT INTO Dict(word,translation,meaning,pos) VALUES('" + word+ "','" + translation+ "','" +meaning+ "','" +pos+ "' )"; //"+word+","+translation+","+meaning+","+pos+")"; connect c = new connect(); try { c.insert(Query); } catch (SQLException ex) { Logger.getLogger(saveMeaning.class.getName()).log(Level.SEVERE, null, ex); } JOptionPane.showMessageDialog(null,"Word Added Successfully!!"); this.dispose(); }//GEN-LAST:event_jButton1ActionPerformed private void jTextField2KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField2KeyReleased // TODO add your handling code here: }//GEN-LAST:event_jTextField2KeyReleased /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(saveMeaning.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(saveMeaning.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(saveMeaning.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(saveMeaning.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the dialog */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { saveMeaning dialog = new saveMeaning(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextArea1; public javax.swing.JTextField jTextField1; public javax.swing.JTextField jTextField2; // End of variables declaration//GEN-END:variables }
84d2af6cdc452670a99b758a198aacdba7fe7600
02759d8f73eb15dd39573a6fad7e6fb1edcc4821
/java/biddingSoft/src/main/java/com/project/biddingSoft/domain/BidDTO.java
d568e7cada9d4e6e799619be3579d0ecab256e5f
[]
no_license
nkatz01/StuProj
c487cda97ed540252abfb9e61d8e4564c9995a99
ef3387a10cd679fbdeb3e7f1ba910f5e982f0a2a
refs/heads/master
2023-06-09T15:31:36.832215
2021-06-15T12:35:29
2021-06-15T12:35:29
263,856,514
0
0
null
null
null
null
UTF-8
Java
false
false
213
java
package com.project.biddingSoft.domain; import lombok.Getter; import lombok.Setter; @Setter @Getter public class BidDTO extends StorableDTO{ private User bidder; private Lot lot; private Double amount; }
68602b023f92a07504d152401e780f1a0fb46ba2
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
/checkstyle_cluster/12453/tar_2.java
0d7b0086aeca9c05ca465cff0c10a130c9d84d16
[]
no_license
martinezmatias/GenPat-data-C3
63cfe27efee2946831139747e6c20cf952f1d6f6
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
refs/heads/master
2022-04-25T17:59:03.905613
2020-04-15T14:41:34
2020-04-15T14:41:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,547
java
//////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. // Copyright (C) 2001-2005 Oliver Burn // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //////////////////////////////////////////////////////////////////////////////// package com.puppycrawl.tools.checkstyle.checks.imports; import java.io.Serializable; import java.util.HashMap; import java.util.Map; /** * Represents the result of an access check. * * @author Oliver Burn */ final class AccessResult implements Serializable { /** Numeric value for access result ALLOWED. */ private static final int CODE_ALLOWED = 10; /** Numeric value for access result DISALLOWED. */ private static final int CODE_DISALLOWED = 20; /** Numeric value for access result UNKNOWN. */ private static final int CODE_UNKNOWN = 30; /** Label for access result ALLOWED. */ private static final String LABEL_ALLOWED = "ALLOWED"; /** Label for access result DISALLOWED. */ private static final String LABEL_DISALLOWED = "DISALLOWED"; /** Label for access result UNKNOWN. */ private static final String LABEL_UNKNOWN = "UNKNOWN"; /** Represents that access is allowed. */ public static final AccessResult ALLOWED = new AccessResult(CODE_ALLOWED, LABEL_ALLOWED); /** Represents that access is disallowed. */ public static final AccessResult DISALLOWED = new AccessResult( CODE_DISALLOWED, LABEL_DISALLOWED); /** Represents that access is unknown. */ public static final AccessResult UNKNOWN = new AccessResult(CODE_UNKNOWN, LABEL_UNKNOWN); /** map from results names to the respective result */ private static final Map NAME_TO_LEVEL = new HashMap(); static { NAME_TO_LEVEL.put(LABEL_ALLOWED, ALLOWED); NAME_TO_LEVEL.put(LABEL_DISALLOWED, DISALLOWED); NAME_TO_LEVEL.put(LABEL_UNKNOWN, UNKNOWN); } /** Code for the access result. */ private final int mCode; /** Label for the access result. */ private final String mLabel; /** * Constructs an instance. * * @param aCode the code for the result. * @param aLabel the label for the result. */ private AccessResult(final int aCode, final String aLabel) { mCode = aCode; mLabel = aLabel.trim(); } /** * @return the label for the result. */ String getLabel() { return mLabel; } /** {@inheritDoc} */ public String toString() { return getLabel(); } /** {@inheritDoc} */ public boolean equals(Object aObj) { boolean result = false; if ((aObj instanceof AccessResult) && (((AccessResult) aObj).mCode == this.mCode)) { result = true; } return result; } /** {@inheritDoc} */ public int hashCode() { return mCode; } /** * SeverityLevel factory method. * * @param aName access result name. * @return the {@link AccessResult} associated with the supplied name. */ public static AccessResult getInstance(String aName) { // canonicalize argument final String arName = aName.trim(); final AccessResult retVal = (AccessResult) NAME_TO_LEVEL.get(arName); if (retVal == null) { throw new IllegalArgumentException(arName); } return retVal; } /** * Ensures that we don't get multiple instances of one SeverityLevel * during deserialization. See Section 3.6 of the Java Object * Serialization Specification for details. * * @return the serialization replacement object */ private Object readResolve() { return getInstance(mLabel); } }
79d9b93fa031d9ae2cb3c6db1469c6857387916d
b36a4b3073900a7666136bf69962669021f9080d
/app/src/main/java/com/example/lokovoznje/LoginActivity.java
acff47e2d007490c9e1cf38d5adced1a44ffcce1
[]
no_license
MarkoKljucar/LokoVoznje
629477d036e6300126b44712d3cc4d2e08db211a
1015e440ecfc73dcf4ff3e7fd8d423c851bb6920
refs/heads/master
2023-02-27T16:18:24.135057
2021-02-08T20:16:56
2021-02-08T20:16:56
332,723,671
0
0
null
null
null
null
UTF-8
Java
false
false
3,302
java
package com.example.lokovoznje; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; public class LoginActivity extends AppCompatActivity { FirebaseAuth fAuth; EditText mEmail, mPassword; Button mLoginButton; TextView logirajButton; ProgressBar mProgressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); mEmail = findViewById(R.id.textinptEmail); mPassword = findViewById(R.id.textinptPassword); logirajButton = findViewById(R.id.registerBtn); fAuth = FirebaseAuth.getInstance(); mLoginButton = findViewById(R.id.logirajButton); mProgressBar = findViewById(R.id.progressBarLogin); mLoginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String email = mEmail.getText().toString().trim(); String password = mPassword.getText().toString().trim(); if(TextUtils.isEmpty(email)){ mEmail.setError("Unesite email!"); return; } if(TextUtils.isEmpty(password)){ mPassword.setError("Unesite lozinku!"); return; } if(password.length() < 6){ mPassword.setError("Lozinka mora biti duža od 6 znamenaka!"); return; } mProgressBar.setVisibility(View.VISIBLE); fAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if(task.isSuccessful()){ mProgressBar.setVisibility(View.INVISIBLE); Toast.makeText(LoginActivity.this, "Uspješno logiran korisnik!.", Toast.LENGTH_SHORT).show(); startActivity(new Intent(getApplicationContext(), MainActivity.class)); } else{ mProgressBar.setVisibility(View.INVISIBLE); Toast.makeText(LoginActivity.this, "Error! " + task.getException().getMessage(), Toast.LENGTH_SHORT).show(); } } }); } }); logirajButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(new Intent(getApplicationContext(), RegisterActivity.class)); } }); } }
1d7190d03724c222aedc09b969e883f0a1cde441
d5bb9b8871018a719e0cbdd5e25cc8ee71d96fb0
/tags/ASM_3_0_BETA2_1/asm/src/org/objectweb/asm/tree/analysis/SimpleVerifier.java
e0738f6a43ea033a015520012deceb384cdbc7d1
[ "BSD-3-Clause" ]
permissive
tempbottle/ASM
04b3e01cba7a933994d0a674ec17c5527644ba39
1100dab0b30114410ac88c9478e21cb1b666d730
refs/heads/master
2020-04-03T10:06:23.469409
2015-01-17T08:23:15
2015-01-17T08:23:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,954
java
/*** * ASM: a very small and fast Java bytecode manipulation framework * Copyright (c) 2000-2005 INRIA, France Telecom * 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 the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ package org.objectweb.asm.tree.analysis; import java.util.List; import org.objectweb.asm.Type; /** * An extended {@link BasicVerifier} that performs more precise verifications. * This verifier computes exact class types, instead of using a single "object * reference" type (as done in the {@link BasicVerifier}). * * @author Eric Bruneton * @author Bing Ran */ public class SimpleVerifier extends BasicVerifier { /** * The class that is verified. */ private final Type currentClass; /** * The super class of the class that is verified. */ private final Type currentSuperClass; /** * The interfaces implemented by the class that is verified. */ private final List currentClassInterfaces; /** * Constructs a new {@link SimpleVerifier}. */ public SimpleVerifier() { this(null, null); } /** * Constructs a new {@link SimpleVerifier} to verify a specific class. This * class will not be loaded into the JVM since it may be incorrect. * * @param currentClass the class that is verified. * @param currentSuperClass the super class of the class that is verified. */ public SimpleVerifier( final Type currentClass, final Type currentSuperClass) { this(currentClass, currentSuperClass, null); } /** * Constructs a new {@link SimpleVerifier} to verify a specific class. This * class will not be loaded into the JVM since it may be incorrect. * * @param currentClass the class that is verified. * @param currentSuperClass the super class of the class that is verified. * @param currentClassInterfaces the interfaces implemented by the class * that is verified. * @param isInterface if the class that is verified is an interface. */ public SimpleVerifier( final Type currentClass, final Type currentSuperClass, final List currentClassInterfaces) { this.currentClass = currentClass; this.currentSuperClass = currentSuperClass; this.currentClassInterfaces = currentClassInterfaces; } public Value newValue(final Type type) { if (type == null) { return BasicValue.UNINITIALIZED_VALUE; } boolean isArray = type.getSort() == Type.ARRAY; if (isArray) { switch (type.getElementType().getSort()) { case Type.BOOLEAN: case Type.CHAR: case Type.BYTE: case Type.SHORT: return new BasicValue(type); } } Value v = super.newValue(type); if (v == BasicValue.REFERENCE_VALUE) { if (isArray) { v = newValue(type.getElementType()); String desc = ((BasicValue) v).getType().getDescriptor(); for (int i = 0; i < type.getDimensions(); ++i) { desc = "[" + desc; } v = new BasicValue(Type.getType(desc)); } else { v = new BasicValue(type); } } return v; } protected boolean isArrayValue(final Value value) { Type t = ((BasicValue) value).getType(); return t != null && (t.getDescriptor().equals("Lnull;") || t.getSort() == Type.ARRAY); } protected Value getElementValue(final Value objectArrayValue) throws AnalyzerException { Type arrayType = ((BasicValue) objectArrayValue).getType(); if (arrayType != null) { if (arrayType.getSort() == Type.ARRAY) { return newValue(Type.getType(arrayType.getDescriptor() .substring(1))); } else if (arrayType.getDescriptor().equals("Lnull;")) { return objectArrayValue; } } throw new Error("Internal error"); } protected boolean isSubTypeOf(final Value value, final Value expected) { Type expectedType = ((BasicValue) expected).getType(); Type type = ((BasicValue) value).getType(); switch (expectedType.getSort()) { case Type.INT: case Type.FLOAT: case Type.LONG: case Type.DOUBLE: return type == expectedType; case Type.ARRAY: case Type.OBJECT: if (type.getDescriptor().equals("Lnull;")) { return true; } else if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) { return isAssignableFrom(expectedType, type); } else { return false; } default: throw new Error("Internal error"); } } public Value merge(final Value v, final Value w) { if (!v.equals(w)) { Type t = ((BasicValue) v).getType(); Type u = ((BasicValue) w).getType(); if (t != null && (t.getSort() == Type.OBJECT || t.getSort() == Type.ARRAY)) { if (u != null && (u.getSort() == Type.OBJECT || u.getSort() == Type.ARRAY)) { if (t.getDescriptor().equals("Lnull;")) { return w; } if (u.getDescriptor().equals("Lnull;")) { return v; } if (isAssignableFrom(t, u)) { return v; } if (isAssignableFrom(u, t)) { return w; } // TODO case of array classes of the same dimension // TODO should we look also for a common super interface? // problem: there may be several possible common super // interfaces do { if (t == null || isInterface(t)) { return BasicValue.REFERENCE_VALUE; } t = getSuperClass(t); if (isAssignableFrom(t, u)) { return newValue(t); } } while (true); } } return BasicValue.UNINITIALIZED_VALUE; } return v; } protected boolean isInterface(final Type t) { if (currentClass != null && t.equals(currentClass)) { return false; } return getClass(t).isInterface(); } protected Type getSuperClass(final Type t) { if (currentClass != null && t.equals(currentClass)) { return currentSuperClass; } Class c = getClass(t).getSuperclass(); return c == null ? null : Type.getType(c); } protected boolean isAssignableFrom(final Type t, final Type u) { if (t.equals(u)) { return true; } if (currentClass != null && t.equals(currentClass)) { if (getSuperClass(u) == null) { return false; } else { return isAssignableFrom(t, getSuperClass(u)); } } if (currentClass != null && u.equals(currentClass)) { if (isAssignableFrom(t, currentSuperClass)) { return true; } if (currentClassInterfaces != null) { for (int i = 0; i < currentClassInterfaces.size(); ++i) { Type v = (Type) currentClassInterfaces.get(i); if (isAssignableFrom(t, v)) { return true; } } } return false; } return getClass(t).isAssignableFrom(getClass(u)); } protected Class getClass(final Type t) { try { if (t.getSort() == Type.ARRAY) { return Class.forName(t.getDescriptor().replace('/', '.')); } return Class.forName(t.getClassName()); } catch (ClassNotFoundException e) { throw new RuntimeException(e.toString()); } } }
[ "(no author)@271bd773-ee82-43a6-9b2b-1890ed8ce7f9" ]
(no author)@271bd773-ee82-43a6-9b2b-1890ed8ce7f9
a41c75e506c13c0175b7be6dfae8cc526e578646
e9e1d4b5d29318560b2a61de03f881d92db0be56
/src/main/java/headfirst/designpatterns/combining/_05observer/duck/RedheadDuck.java
64b43ceaec0b799f6ba66e37c772656dc11b962f
[]
no_license
yzhang921/Head-First-Design-Patterns
e620b7cbb5ce5a1fe38e233cb53534c03e9b4ad2
d4564c921e962a4070e2192744f951283016971b
refs/heads/master
2021-01-12T12:09:40.534431
2017-03-17T07:47:17
2017-03-17T07:47:17
72,322,908
2
2
null
2016-10-30T03:31:11
2016-10-30T03:31:11
null
UTF-8
Java
false
false
720
java
package headfirst.designpatterns.combining._05observer.duck; import headfirst.designpatterns.combining._05observer.observer.Observable; import headfirst.designpatterns.combining._05observer.observer.Observer; public class RedheadDuck implements Quackable { Observable observable; public RedheadDuck() { observable = new Observable(this); } public void quack() { System.out.println("Quack"); notifyObservers(); } public void registerObserver(Observer observer) { observable.registerObserver(observer); } public void notifyObservers() { observable.notifyObservers(); } public String toString() { return "Redhead Duck"; } }
11024189ba3678c5c7968c49d8f3d77a9fc9c59d
55ac295211f3fdbf052dd5458e621e852361d270
/src/main/java/com/chnghx/web/common/config/WeChatConfig.java
8ca16f098be928ac654ab9114f8a372751ca6f06
[]
no_license
hnhx166/demo
0334baae1053db52144ac6fb341a6d7e75b7ff46
05ae7bd103f22f913266360ba9cb501dfbeb85aa
refs/heads/master
2021-04-12T03:44:54.116947
2018-06-11T08:55:17
2018-06-11T08:55:17
125,962,399
0
0
null
null
null
null
UTF-8
Java
false
false
1,076
java
package com.chnghx.web.common.config; import java.io.IOException; import java.util.Properties; import com.chnghx.web.common.utils.LoggerUtils; /** * * 项目名称:demo * 类名称:WeChatConfig * 类描述: * 创建人:guohaixiang * 创建时间:2018年3月19日 上午11:22:45 * 修改人:Administrator * 修改时间:2018年3月19日 上午11:22:45 * 修改备注: * @version 1.0 * */ public class WeChatConfig { /** * 配置文件 */ private static Properties prop = null; /** * 配置文件名称 */ private final static String FILE_NAME = "/wechat.properties"; private WeChatConfig() { } static{ prop = new Properties(); try { prop.load(WeChatConfig.class.getResourceAsStream(FILE_NAME)); } catch (IOException e) { e.printStackTrace(); LoggerUtils.error(WeChatConfig.class, "配置文件读取出现IOException异常", e); } } public static String getProperty(String key){ String value = prop.getProperty(key); return value; } }
ed3d3a72c25eb624b3d0a7091234e969297083cd
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-ocr/src/main/java/com/aliyuncs/ocr/model/v20191230/RecognizeDriverLicenseResponse.java
739f12ac87caa5181a7cd3318ecd58625b5d3501
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
3,718
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.aliyuncs.ocr.model.v20191230; import com.aliyuncs.AcsResponse; import com.aliyuncs.ocr.transform.v20191230.RecognizeDriverLicenseResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class RecognizeDriverLicenseResponse extends AcsResponse { private String requestId; private Data data; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public Data getData() { return this.data; } public void setData(Data data) { this.data = data; } public static class Data { private FaceResult faceResult; private BackResult backResult; public FaceResult getFaceResult() { return this.faceResult; } public void setFaceResult(FaceResult faceResult) { this.faceResult = faceResult; } public BackResult getBackResult() { return this.backResult; } public void setBackResult(BackResult backResult) { this.backResult = backResult; } public static class FaceResult { private String name; private String licenseNumber; private String vehicleType; private String startDate; private String endDate; private String issueDate; private String address; private String gender; public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getLicenseNumber() { return this.licenseNumber; } public void setLicenseNumber(String licenseNumber) { this.licenseNumber = licenseNumber; } public String getVehicleType() { return this.vehicleType; } public void setVehicleType(String vehicleType) { this.vehicleType = vehicleType; } public String getStartDate() { return this.startDate; } public void setStartDate(String startDate) { this.startDate = startDate; } public String getEndDate() { return this.endDate; } public void setEndDate(String endDate) { this.endDate = endDate; } public String getIssueDate() { return this.issueDate; } public void setIssueDate(String issueDate) { this.issueDate = issueDate; } public String getAddress() { return this.address; } public void setAddress(String address) { this.address = address; } public String getGender() { return this.gender; } public void setGender(String gender) { this.gender = gender; } } public static class BackResult { private String archiveNumber; public String getArchiveNumber() { return this.archiveNumber; } public void setArchiveNumber(String archiveNumber) { this.archiveNumber = archiveNumber; } } } @Override public RecognizeDriverLicenseResponse getInstance(UnmarshallerContext context) { return RecognizeDriverLicenseResponseUnmarshaller.unmarshall(this, context); } @Override public boolean checkShowJsonItemName() { return false; } }
56b6a203af7e1a83b800e62e23c7f4a8bde921fc
bdd80b36d7e67d3eb447edd0cdca6b939e039805
/health_parent/health_web/src/main/java/com/itheima/health/controller/ProportionController.java
fd5a20d00bfc4cafafa1510a5e25be9d74790100
[]
no_license
bo91678/itheima_health
05b36019720fc92159ac49d8dbe7451247607eba
02abaac635c90e9ca3f5404fb50ac1bc419a348b
refs/heads/master
2023-01-06T14:36:52.293835
2020-11-07T08:55:08
2020-11-07T08:55:08
307,044,773
0
0
null
null
null
null
UTF-8
Java
false
false
2,379
java
package com.itheima.health.controller; import com.alibaba.dubbo.config.annotation.Reference; import com.itheima.health.entity.Result; import com.itheima.health.service.ProportionService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @RestController @RequestMapping("/proportion") public class ProportionController { @Reference private ProportionService proportionService; /** * 获得会员性别占比 * @return */ @GetMapping("/getMenberGenderProportion") public Result getMenberGenderProportion(){ //调用服务查询会员总数量 List<Map<String,Object>> genderCount = proportionService.findMenberCount(); //性别名称集合 List<String> gender = new ArrayList<String>(); //抽取性别 if (null != genderCount){ for (Map<String, Object> map : genderCount) { //获取性别 gender.add((String) map.get("name")); } } //封装返回的结果 Map<String,Object> resultMap = new HashMap<String, Object>(); resultMap.put("gender",gender); resultMap.put("genderCount",genderCount); return new Result(true,"查询会员所有性别占比成功",resultMap); } /** * 获得会员年龄占比 * @return */ @GetMapping("/getMenberAgeProportion") public Result getMenberAgeProportion(){ //调用服务层查询所有年龄的集合 List<Map<String,Object>> ageCount = proportionService.findMemberAgeCount(); //年龄名称集合 List<String> age = new ArrayList<String>(); //抽取各个年龄 if (null != ageCount){ for (Map<String, Object> map : ageCount) { //获取各个年龄展示在页面 age.add((String) map.get("name")); } } //封装返回的结果 Map<String,Object> resultMap = new HashMap<String, Object>(); resultMap.put("age",age); resultMap.put("ageCount",ageCount); return new Result(true,"查询所有年龄占比成功",resultMap); } }
[ "" ]
a570e2e9bbb1837945cb66d5cb4ba9b5ca5d0bd7
e5578e842a5daa7a38dce0c78b2c0ca0051fcba3
/ERR2d2w/Sources/er/r2d2w/assignments/R2DDelayedUserPreferenceAssignment.java
4e889efd2aa6a3c3c8758420c2ec8a4a9df64391
[]
no_license
nullterminated/ponder
26c90ded5cdbd852c5b4a75092d7f0fe2a040418
c65982541c2c28899751933a67160160489a6b33
refs/heads/master
2021-01-01T17:06:16.457396
2015-06-05T15:24:39
2015-06-05T15:24:39
1,534,832
7
3
null
2014-03-08T23:52:13
2011-03-28T01:31:26
Java
UTF-8
Java
false
false
2,412
java
package er.r2d2w.assignments; import com.webobjects.directtoweb.D2WContext; import com.webobjects.eocontrol.EOKeyValueArchiver; import com.webobjects.eocontrol.EOKeyValueUnarchiver; import com.webobjects.foundation.NSKeyValueCoding; import er.directtoweb.assignments.delayed.ERDDelayedAssignment; import er.extensions.ERXExtensions; public class R2DDelayedUserPreferenceAssignment extends ERDDelayedAssignment { /** * Do I need to update serialVersionUID? * See section 5.6 <cite>Type Changes Affecting Serialization</cite> on page 51 of the * <a href="http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf">Java Object Serialization Spec</a> */ private static final long serialVersionUID = 1L; public static final String UserPreferencesKey = "userPreferences"; private static final String default_key = "default"; public R2DDelayedUserPreferenceAssignment(EOKeyValueUnarchiver u) { super(u); } public R2DDelayedUserPreferenceAssignment(String key, Object value) { super(key, value); } public void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver) { super.encodeWithKeyValueArchiver(archiver); } public static Object decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver unarchiver) { return new R2DDelayedUserPreferenceAssignment(unarchiver); } /** * The rhsKey is the preference key. Default values are defined using a * similarly named default key in the D2WContext. The preference key * and the default key should be named using a xxx, defaultXxx naming * convention. Examples are batchSize, defaultBatchSize and sortOrdering, * defaultSortOrdering. * @return the user preference value for the preference key or the default * value if no user preference value is found. */ @Override public Object fireNow(D2WContext c) { String rhsKey = keyPath(); // Get the default value StringBuffer sb = new StringBuffer(rhsKey); sb.setCharAt(0, Character.toUpperCase(sb.charAt(0))); sb.insert(0, default_key); Object result = c.valueForKey(sb.toString()); // Get the preference for the RHS key String prefKey = ERXExtensions.userPreferencesKeyFromContext(rhsKey, c); NSKeyValueCoding userPreferences = (NSKeyValueCoding) c.valueForKey(UserPreferencesKey); if (userPreferences != null) { Object pref = userPreferences.valueForKey(prefKey); if(pref != null) { result = pref; } } // Return the preference return result; } }
063e13c2cbeb4ff67156be664360e8a3a5536a39
c3f07f1e7788d47a6ac620501b4e51ec13d044a7
/OpenFeintAPI/src/com/openfeint/internal/ui/IntroFlow.java
d90bf92d99510a8dab9c429a17f3f9fa0416b8f6
[]
no_license
drbobrinkman/Growth-and-Decay
0efcc5d68a8938fa064b3b883bb69797ffa86261
a18af466de1db9e4c9dc74689a0255fa0fd5495a
refs/heads/master
2020-04-13T20:49:54.080325
2011-02-23T21:06:08
2011-02-23T21:06:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,978
java
package com.openfeint.internal.ui; import java.util.List; import java.util.Map; import android.content.Intent; import android.graphics.Bitmap; import com.openfeint.api.OpenFeint; import com.openfeint.internal.ImagePicker; import com.openfeint.internal.OpenFeintInternal; import com.openfeint.internal.Util; import com.openfeint.internal.request.IRawRequestDelegate; public class IntroFlow extends WebNav { Bitmap cachedImage; @Override protected String initialContentPath() { String contentName = getIntent().getStringExtra("content_name"); if (contentName != null) { return "intro/"+ contentName; } else { return "intro/index"; } } @Override public void onActivityResult(int requestCode, int resultCode, Intent returnedIntent) { if (ImagePicker.isImagePickerActivityResult(requestCode)) { cachedImage = ImagePicker.onImagePickerActivityResult(this, resultCode, 152, returnedIntent); } } @Override protected ActionHandler createActionHandler(WebNav webNav) { return new IntroFlowActionHandler(webNav); } private class IntroFlowActionHandler extends ActionHandler { public IntroFlowActionHandler(WebNav webNav) { super(webNav); } @Override protected void populateActionList(List<String> actionList) { super.populateActionList(actionList); actionList.add("createUser"); actionList.add("loginUser"); actionList.add("cacheImage"); actionList.add("uploadImage"); actionList.add("clearImage"); actionList.add("decline"); actionList.add("getEmail"); } @SuppressWarnings("unused") final public void createUser(final Map<String,String> options) { OpenFeintInternal.getInstance().createUser( options.get("name"), options.get("email"), options.get("password"), options.get("password_confirmation"), new IRawRequestDelegate() { public void onResponse(int status, String response) { String js = String.format("%s('%d', %s)", options.get("callback"), status, response.trim()); mWebNav.executeJavascript(js); } } ); } @SuppressWarnings("unused") final public void loginUser(final Map<String,String> options) { OpenFeintInternal.getInstance().loginUser( options.get("email"), options.get("password"), options.get("user_id"), new IRawRequestDelegate() { public void onResponse(int status, String response) { String js = String.format("%s('%d', %s)", options.get("callback"), status, response.trim()); mWebNav.executeJavascript(js); } } ); } @SuppressWarnings("unused") final public void cacheImage(final Map<String,String> options) { ImagePicker.show(IntroFlow.this); } @SuppressWarnings("unused") final public void uploadImage(final Map<String,String> options) { //get the image that was stored and upload it if(null != cachedImage) { String apiUrl = "/xp/users/"+ OpenFeintInternal.getInstance().getCurrentUser().resourceID() +"/profile_picture"; ImagePicker.compressAndUpload(cachedImage, apiUrl, null); } } @SuppressWarnings("unused") final public void clearImage(final Map<String,String> options) { cachedImage = null; } @SuppressWarnings("unused") public void decline(final Map<String, String> options) { OpenFeint.userDeclinedFeint(); finish(); } @SuppressWarnings("unused") public void getEmail(final Map<String, String> options) { if (Util.isEclairOrLater()) { /*String account = Util5.getAccountNameEclair(IntroFlow.this); if (account != null) { executeJavascript(String.format("%s('%s');", options.get("callback"), account)); }*/ } } }; }
de1adff4f8c07c5349113aed62bd9eb7e56f69c5
9ff24df5cae83f49402db58101dc7546e25eb4e2
/base_library/src/androidTest/java/com/wyl/baselibrary/ExampleInstrumentedTest.java
5fe8016174f796bed0b7d354f8b5ff7895f0872e
[]
no_license
YouLe2016/ComponentCC
481184ab874536ca059f65325cca37c976d1f744
b6482258a39b5771c2cb17f1f670cc7eef3215ba
refs/heads/master
2020-05-26T19:08:24.470889
2019-06-08T02:54:50
2019-06-08T02:54:50
188,344,242
1
0
null
null
null
null
UTF-8
Java
false
false
727
java
package com.wyl.baselibrary; 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.*; /** * 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.getTargetContext(); assertEquals("com.wyl.baselibrary.test", appContext.getPackageName()); } }
939c4d969014ec9452914075147e7a22302fc65e
ec4328518661be2c0a41ff9f5261b2453bcd4e15
/src/main/java/com/flymatcher/itinerary/domain/ItineraryRequest.java
39ffde3e219f3bdf8ebccdf62d4407c414820bd9
[]
no_license
nsterg/flymatcher-itinerary-service
377644c2b38666e7c0dd687450c10289e9b110ec
53d9d99b3cf21f6fbcc9280b2c0dcaa4e7ef0277
refs/heads/master
2018-02-14T21:20:11.099709
2017-06-17T21:25:56
2017-06-17T21:25:56
60,419,711
0
0
null
2017-03-07T15:47:08
2016-06-04T16:31:49
Java
UTF-8
Java
false
false
2,618
java
package com.flymatcher.itinerary.domain; import static java.time.LocalDate.parse; import static org.apache.commons.lang.builder.EqualsBuilder.reflectionEquals; import static org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode; import static org.apache.commons.lang.builder.ToStringBuilder.reflectionToString; import java.time.LocalDate; import java.util.List; import com.flymatcher.itinerary.exception.BadRequestException; public class ItineraryRequest { private String market; private List<String> origins; private String currency; private String locale; private LocalDate outboundPartialDate; private LocalDate inboundPartialDate; public static ItineraryRequest valueOf(final String market, final String currency, final String locale, final List<String> origins, final String outboundPartialDate, final String inboundPartialDate) { final ItineraryRequest request = new ItineraryRequest(); request.market = market; request.origins = origins; request.currency = currency; request.locale = locale; try { request.outboundPartialDate = parse(outboundPartialDate); request.inboundPartialDate = parse(inboundPartialDate); } catch (final Exception e) { throw new BadRequestException("Request date was not in the expected format: yyyy-mm-dd"); } return request; } public String getMarket() { return market; } public void setMarket(final String market) { this.market = market; } public List<String> getOrigins() { return origins; } public void setOrigins(final List<String> origins) { this.origins = origins; } public String getCurrency() { return currency; } public void setCurrency(final String currency) { this.currency = currency; } public String getLocale() { return locale; } public void setLocale(final String locale) { this.locale = locale; } public LocalDate getOutboundPartialDate() { return outboundPartialDate; } public void setOutboundPartialDate(final LocalDate outboundPartialDate) { this.outboundPartialDate = outboundPartialDate; } public LocalDate getInboundPartialDate() { return inboundPartialDate; } public void setInboundPartialDate(final LocalDate inboundPartialDate) { this.inboundPartialDate = inboundPartialDate; } @Override public int hashCode() { return reflectionHashCode(this); } @Override public boolean equals(final Object obj) { return reflectionEquals(this, obj); } @Override public String toString() { return reflectionToString(this); } }
4e49b58f0db3cab062b1d634e6da08bc2d78ff29
3776dc9348d58beacdfbfb99a22ab43f95a8e737
/src/main/java/com/qf/utils/MailUtils.java
d4d8b756bda89194655e411ac6587de2db513600
[]
no_license
jirowang666/video
f24f1eb473ff672e75d216d5996fa9fcfc19ec48
62167c97c247ce48b73c29b1925c7febdfd63c02
refs/heads/master
2022-11-28T08:07:42.206104
2020-08-04T09:04:47
2020-08-04T09:04:47
284,931,721
0
0
null
2020-08-04T09:12:37
2020-08-04T09:12:36
null
UTF-8
Java
false
false
3,126
java
package com.qf.utils; import javax.mail.*; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import java.util.Properties; import java.util.Random; /** * 发邮件工具类 */ public final class MailUtils { private static final String USER = "[email protected]"; // 发件人称号,同邮箱地址 private static final String PASSWORD = "MLTPNFZJRQSEYXWE"; // 如果是qq邮箱可以使户端授权码 /** * @param to 收件人邮箱 * @param text 邮件正文 * @param title 标题 */ /* 发送验证信息的邮件 */ public static boolean sendMail(String to, String text, String title) { try { final Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.host", "smtp.126.com"); // 发件人的账号 props.put("mail.user", USER); //发件人的密码 props.put("mail.password", PASSWORD); // 构建授权信息,用于进行SMTP进行身份验证 Authenticator authenticator = new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { // 用户名、密码 String userName = props.getProperty("mail.user"); String password = props.getProperty("mail.password"); return new PasswordAuthentication(userName, password); } }; // 使用环境属性和授权信息,创建邮件会话 Session mailSession = Session.getInstance(props, authenticator); // 创建邮件消息 MimeMessage message = new MimeMessage(mailSession); // 设置发件人 String username = props.getProperty("mail.user"); InternetAddress form = new InternetAddress(username); message.setFrom(form); // 设置收件人 InternetAddress toAddress = new InternetAddress(to); message.setRecipient(Message.RecipientType.TO, toAddress); // 设置邮件标题 message.setSubject(title); // 设置邮件的内容体 message.setContent(text, "text/html;charset=UTF-8"); // 发送邮件 Transport.send(message); return true; } catch (Exception e) { e.printStackTrace(); } return false; } public static String getValidateCode(int num) { Random random = new Random(); String validateCode = ""; for (int i = 0; i < num; i++) { int result = random.nextInt(10); validateCode += result; } return validateCode; } public static void main(String[] args) throws Exception { // 做测试用 MailUtils.sendMail("[email protected]", "你好,这是一封测试邮件,无需回复。", "测试邮件随机生成的验证码是:" + getValidateCode(6)); System.out.println("发送成功"); } }
d65b2d44fba413243f18182a8a1020e8510e1ea4
0f34641896d1b98f68c5e76d30443663bd723790
/demo-common-query/src/main/java/com/liucccc/demo/commonquery/entity/SysQueryTemplate.java
f45c86d214aaa253188f15e2b12b6810ab30a853
[]
no_license
Liucccc/demo-partent
28f423262ead33c0d551c8c70928c4f2e42f3236
dcecaac50c58d47524dbc1e4fd6b5f0e96b3702c
refs/heads/master
2022-07-07T06:20:23.268775
2020-04-16T07:09:35
2020-04-16T07:09:35
227,377,604
0
0
null
2022-06-21T02:55:46
2019-12-11T13:53:49
Java
UTF-8
Java
false
false
1,606
java
package com.liucccc.demo.commonquery.entity; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.extension.activerecord.Model; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; /** * <p> * 查询模板参数表 * </p> * * @author mybatis-plus * @since 2020-02-18 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) public class SysQueryTemplate extends Model<SysQueryTemplate> { private static final long serialVersionUID=1L; /** * 模板标识 */ @TableId(value = "template_id") private String templateId; /** * 模板名称 */ private String templateName; /** * 菜单节点ID */ private String menuId; /** * 固定列 */ private String fixedCols; /** * 表集合及关系 */ private String tabLst; /** * 初始查询条件 */ private String sqlWhere; /** * 初始排序条件 */ private String sqlOrderBy; /** * 录入人ID */ private String inputUserId; /** * 录入人 */ private String inputUserName; /** * 录入时间 */ private LocalDateTime inputTime; /** * 启用标志 1启用、0停用 */ private BigDecimal enabled; /** * 停用备注 */ private String enabledRemark; @Override protected Serializable pkVal() { return this.templateId; } }
[ "“[email protected]”" ]
50026623f924c83ea706c9e6cadfbc183ad47c62
4946e3f3c2dc8f9c55efb8e4e9f3e0cc9886f0e7
/src/HashExam4/HashExam4.java
d567dec616bdd61eaa93250ba137950723b3bad9
[]
no_license
olympia-guk/programmersSolution
01672629a131bc82241195f595cbe8fe27ae0032
f1118d34edabd0595b43271ee86511cc0a86ae4b
refs/heads/master
2023-07-06T20:08:52.210728
2019-01-21T11:21:34
2019-01-21T11:21:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,543
java
/* 베스트앨범 문제 설명 스트리밍 사이트에서 장르 별로 가장 많이 재생된 노래를 두 개씩 모아 베스트 앨범을 출시하려 합니다. 노래는 고유 번호로 구분하며, 노래를 수록하는 기준은 다음과 같습니다. 속한 노래가 많이 재생된 장르를 먼저 수록합니다. 장르 내에서 많이 재생된 노래를 먼저 수록합니다. 장르 내에서 재생 횟수가 같은 노래 중에서는 고유 번호가 낮은 노래를 먼저 수록합니다. 노래의 장르를 나타내는 문자열 배열 genres와 노래별 재생 횟수를 나타내는 정수 배열 plays가 주어질 때, 베스트 앨범에 들어갈 노래의 고유 번호를 순서대로 return 하도록 solution 함수를 완성하세요. 제한사항 genres[i]는 고유번호가 i인 노래의 장르입니다. plays[i]는 고유번호가 i인 노래가 재생된 횟수입니다. genres와 plays의 길이는 같으며, 이는 1 이상 10,000 이하입니다. 장르 종류는 100개 미만입니다. 장르에 속한 곡이 하나라면, 하나의 곡만 선택합니다. 모든 장르는 재생된 횟수가 다릅니다. 입출력 예 genres plays return [classic, pop, classic, classic, pop] [500, 600, 150, 800, 2500] [4, 1, 3, 0] 입출력 예 설명 classic 장르는 1,450회 재생되었으며, classic 노래는 다음과 같습니다. 고유 번호 3: 800회 재생 고유 번호 0: 500회 재생 고유 번호 2: 150회 재생 pop 장르는 3,100회 재생되었으며, pop 노래는 다음과 같습니다. 고유 번호 4: 2,500회 재생 고유 번호 1: 600회 재생 따라서 pop 장르의 [4, 1]번 노래를 먼저, classic 장르의 [3, 0]번 노래를 그다음에 수록합니다. */ package HashExam4; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; public class HashExam4 { public int[] solution(String[] genres, int[] plays) { if (genres.length == 1) return plays; int[] answer = {}; //가장 많이 재생된 장르 선정 HashMap<String, Integer> hmTotCnt = new HashMap(); for(int i = 0 ; i < genres.length; i++) { if(hmTotCnt.containsKey(genres[i])) { hmTotCnt.replace(genres[i], hmTotCnt.get(genres[i])+plays[i]); }else hmTotCnt.put(genres[i], plays[i]); } Iterator<String> hmIterator = sortByValue(hmTotCnt).iterator(); List<String> genresRanking = new ArrayList<String>(); while(hmIterator.hasNext()){ String key = (String) hmIterator.next(); genresRanking.add(key); } //장르 내에서 많이 재생된 노래 먼저 수록 return answer; } public static List<String> sortByValue(final Map<String, Integer> map){ List<String> list = new ArrayList<String>(); list.addAll(map.keySet()); Collections.sort(list,new Comparator<Object>(){ public int compare(Object o1,Object o2){ Object v1 = map.get(o1); Object v2 = map.get(o2); return ((Comparable<Object>) v1).compareTo(v2); } }); Collections.reverse(list); // 주석시 오름차순 return list; } public static void main(String args[]) { HashExam4 he = new HashExam4(); String[] genres = {"classic", "pop", "classic", "classic", "pop", "kpop"}; int[] plays = {500,600,150,800,2500,700}; he.solution(genres, plays); } }
3b26458082c90df30b1fd5545a2cee763cd3be80
d15902d3100a322ba90c7eaa1f8232ed5561f2f5
/video-api/src/main/java/com/video/WebMvcConfig.java
4c45ff7ce10af1be705a28b483679066b9bbc8b9
[]
no_license
CheungChingYin/video
4101d6a8e15c4be9a4e4b5205de71ed5ac3e77b6
5739034e6f4437d35db81c2a604e7043dcfaec38
refs/heads/master
2020-03-30T06:31:52.358313
2018-11-14T01:01:11
2018-11-14T01:01:11
150,868,017
0
0
null
null
null
null
UTF-8
Java
false
false
598
java
package com.video; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/**")// 访问所有资源 .addResourceLocations("classpath:/META-INF/resources/").addResourceLocations("file:D:/svideos_res/"); } }
2eba869cc01b59c14bd78700ec6c767769a36e51
0bffa6858041f2325af3f513ed4208bb5b586a70
/src/java/com/copyright/ccc/web/actions/coi/BasicTransactionAction.java
d00174d64d4e8c64ab7a3ec3be6c404112258d20
[]
no_license
aputtur/ccc
d8d6912f7e920459c5e9c23356c731b57c77c795
c106da8bba275b5c5551448d0c0dedb5393778e9
refs/heads/master
2020-12-24T15:22:24.167234
2013-11-01T18:20:01
2013-11-01T18:20:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
43,614
java
package com.copyright.ccc.web.actions.coi; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessages; import com.copyright.ccc.business.data.CCUser; import com.copyright.ccc.business.data.OrderPurchase; import com.copyright.ccc.business.data.OrderPurchases; import com.copyright.ccc.business.data.PublicationPermission; import com.copyright.ccc.business.data.RLinkPublisher; import com.copyright.ccc.business.data.TransactionItem; import com.copyright.ccc.business.security.UserContextService; import com.copyright.ccc.business.services.ServiceInvocationException; import com.copyright.ccc.business.services.cart.CartServices; import com.copyright.ccc.business.services.cart.ChangedToRegularOrderException; import com.copyright.ccc.business.services.cart.ContactRHDirectlyLimitsExceededException; import com.copyright.ccc.business.services.cart.DeniedLimitsExceededException; import com.copyright.ccc.business.services.cart.IncompatibleOrderAndPurchasablePermissionException; import com.copyright.ccc.business.services.cart.InvalidAttributesException; import com.copyright.ccc.business.services.cart.ItemCannotBePurchasedException; import com.copyright.ccc.business.services.cart.PurchasablePermission; import com.copyright.ccc.business.services.cart.PurchasablePermissionFactory; import com.copyright.ccc.business.services.cart.SpecialOrderLimitsExceededException; import com.copyright.ccc.business.services.cart.SystemLimitsExceededException; import com.copyright.ccc.business.services.order.OrderPurchaseServices; import com.copyright.ccc.business.services.order.OrderPurchasesException; import com.copyright.ccc.business.services.user.RLinkPublisherServices; import com.copyright.ccc.util.LogUtil; import com.copyright.ccc.web.CCAction; import com.copyright.ccc.web.WebConstants; import com.copyright.ccc.web.forms.SearchForm; import com.copyright.ccc.web.forms.coi.BasicTransactionForm; import com.copyright.ccc.web.transaction.ContactRHDirectlyUnavailableException; import com.copyright.ccc.web.transaction.DeniedUnavailableException; import com.copyright.ccc.web.transaction.OutsideBiactiveDateRangeException; import com.copyright.ccc.web.transaction.PricingError; import com.copyright.ccc.web.transaction.PricingErrorFactory; import com.copyright.ccc.web.transaction.SpecialOrderUnavailableException; import com.copyright.ccc.web.transaction.TransactionConstants; import com.copyright.ccc.web.transaction.coi.TransactionAJAXUtils; import com.copyright.ccc.web.transaction.coi.TransactionItemTypeOfUseMapper; import com.copyright.ccc.web.transaction.coi.TransactionUtils; import com.copyright.ccc.web.util.WebUtils; public abstract class BasicTransactionAction extends CCAction { //ActionForward names protected final static String SUBMIT = "submit"; protected final static String SPECIAL_ORDER = "specialOrder"; protected final static String RIGHTSLINK = "_rightslink"; protected static final Logger _logger = Logger.getLogger( BasicTransactionAction.class ); //abstract methods protected abstract ActionForward performTransaction(TransactionItem transactionItem, PurchasablePermission purchasablePermissionInCart, int orderPurchaseID, ActionMapping mapping, HttpServletRequest request, int scrollPage, String returnTab, boolean searchFlag ) throws InvalidAttributesException, DeniedLimitsExceededException, SpecialOrderLimitsExceededException, ContactRHDirectlyLimitsExceededException, ChangedToRegularOrderException, IncompatibleOrderAndPurchasablePermissionException, ItemCannotBePurchasedException; protected abstract TransactionItem getTransactionItemForTypeOfUseCode(TransactionItem transactionItem, int typeOfUseCode) throws DeniedUnavailableException, SpecialOrderUnavailableException, ContactRHDirectlyUnavailableException, OutsideBiactiveDateRangeException; protected abstract String getCancelPath( TransactionItem transactionItem, int orderPurchaseId, int scrollPage, String tabPage, boolean searchFlag ); protected abstract boolean isFirstAcademicItem( TransactionItem transactionItem ); //public methods public ActionForward defaultOperation( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) { BasicTransactionForm basicTransactionFormCOI = castForm( BasicTransactionForm.class, form ); basicTransactionFormCOI.setFormPath( mapping.getPath() ); boolean fromSearch; if( request.getAttribute( WebConstants.RequestKeys.TRANSACTION_ITEM) != null) { populateFormFromNonSearch( request, basicTransactionFormCOI ); fromSearch = false; Boolean isPD = (Boolean)request.getAttribute(WebConstants.RequestKeys.PERMISSIONS_DIRECT_TRANSACTION_ITEM); if ( isPD != null ) { fromSearch = true; request.removeAttribute(WebConstants.RequestKeys.PERMISSIONS_DIRECT_TRANSACTION_ITEM); } } else { populateFormFromSearch( request, basicTransactionFormCOI ); fromSearch = true; } TransactionItem transactionItem = basicTransactionFormCOI.getTransactionItem(); // Prepopulate the form with the skipQuickprice value. CCUser ccUser = UserContextService.getActiveAppUser(); //basicTransactionFormCOI.setSkipQuickprice(ccUser.skipQuickprice()); //Look for the Skip Quick Price flag for Academic (APS/ECCS) and Photocopy (TRS) types if (transactionItem.isAcademic() || transactionItem.isPhotocopy()) { if (request.getSession().getAttribute(WebConstants.SessionKeys.SKIP_QUICKPRICE) != null) { boolean flag = (request.getSession().getAttribute(WebConstants.SessionKeys.SKIP_QUICKPRICE).toString().equalsIgnoreCase("true")) ? true : false; basicTransactionFormCOI.setSkipQuickprice(flag); basicTransactionFormCOI.setExpanded(flag); } else { basicTransactionFormCOI.setSkipQuickprice(false); basicTransactionFormCOI.setExpanded(false); } } else { basicTransactionFormCOI.setSkipQuickprice(false); basicTransactionFormCOI.setExpanded(false); } // boolean photoCopy = transactionItem.isPhotocopy(); //Added this flag for the check box if (transactionItem.getWorkInst() != null && (transactionItem.getWorkInst().longValue() == 4195313 || transactionItem.getWorkInst().longValue() == 3182308 )) { basicTransactionFormCOI.setUseOnlyInNA(true); } else { basicTransactionFormCOI.setUseOnlyInNA(false); } basicTransactionFormCOI.setCancelPath( this.getCancelPath( transactionItem, basicTransactionFormCOI.getOrderPurchaseID(), basicTransactionFormCOI.getCp(), basicTransactionFormCOI.getRp(), basicTransactionFormCOI.isSf() )); basicTransactionFormCOI.setFirstAcademicItem( this.isFirstAcademicItem( transactionItem ) ); if (fromSearch) { SearchForm searchForm = (SearchForm) request.getSession().getAttribute( WebConstants.SessionKeys.SEARCH_FORM ); transactionItem.setCategoryName( searchForm.getSelectedPermCatDisplay().getCategoryDescription()); transactionItem.setTouName(UserContextService.getSearchState().getSelectedTou()); if (searchForm.getIsBiactive()) { transactionItem.setPublicationYearOfUse(searchForm.getSelectedPubYear()); basicTransactionFormCOI.setBiactive(true); } else { basicTransactionFormCOI.setBiactive(false); } } basicTransactionFormCOI.setTransactionItem(transactionItem); boolean test = transactionItem.isEmail(); //For RLS/DPS instead of getting Type Of Use Code from dropdown in QP page, get it before hand by TOU selected previously if ( transactionItem.isRepublication() ) { String republicationTypeOfUse = transactionItem.getRepublicationTypeOfUse(); basicTransactionFormCOI.setTypeOfUseCode( TransactionItemTypeOfUseMapper.getRepublicationTypeOfUseTransactionConstants(transactionItem.getRepublicationTypeOfUse())); //basicTransactionFormCOI.setTypeOfUseCode( TransactionItemTypeOfUseMapper.( republicationTypeOfUse )); } /* if (transactionItem instanceof PurchasablePermission && ((PurchasablePermission)transactionItem).getRightFromWeb() != null) { basicTransactionFormCOI.setRightPermissionType(((PurchasablePermission)transactionItem).getRightFromWeb().getPermission().getCode()); } else if (!(transactionItem instanceof PurchasablePermission) && transactionItem.getRight() != null) { basicTransactionFormCOI.setRightPermissionType(transactionItem.getRight().getPermission().getPermissionValueCode()); }*/ basicTransactionFormCOI.setRightPermissionType(transactionItem.getItemAvailabilityCd()); /* String price1 = transactionItem.getPrice(); boolean specialOrder = transactionItem.isSpecialOrderFromScratch(); boolean photocopy = transactionItem.isPhotocopy(); long pages = transactionItem.getNumberOfPages(); String pubYear = transactionItem.getPublicationYearOfUse(); long numPages = transactionItem.getNumberOfPages(); long numCopies = transactionItem.getNumberOfCopies(); */ // String price2 = transactionItem.ge return mapping.findForward( SHOW_MAIN ); } public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { BasicTransactionForm basicTransactionForm = castForm( BasicTransactionForm.class, form ); TransactionItem transactionItem = basicTransactionForm.getTransactionItem(); // boolean photoCopy = transactionItem.isPhotocopy(); // 2009-05-07 MSJ // Is this a RIGHTSLINK rightsholder? I probably could have done // the integration in about 5 lines of code, setting a flag in the // session back in the search action, but decided we should, perhaps, // make the integration with RIGHTSLINK a little more OBVIOUS... // does that make sense? Anyway, we basically check to see if the // permission is owned by a rightsholder that is also listed in our // RIGHTSLINK cross-reference table. If so, we set a flag. This is // used to set error messages specific to RIGHTSLINK. On the order // pages we must also check for a RIGHTSLINK rightsholder in order // to display the "blue box of RIGHTSLINK information." long ptyInst = transactionItem.getRightsholderInst(); RLinkPublisher pub = null; boolean hasRightslink = false; try { pub = RLinkPublisherServices.getRLinkPublisherByPtyInst(ptyInst); if (pub != null) hasRightslink = true; } catch(Exception e) { _logger.error( LogUtil.getStack(e)); } //get correct transaction item for given type of use try { transactionItem = getTransactionItemForTypeOfUseCode( transactionItem, basicTransactionForm.getTypeOfUseCode() ); } catch( OutsideBiactiveDateRangeException e) { saveErrors( request, TransactionUtils.getDateNotInBiactiveRangeError() ); return mapping.findForward( SHOW_MAIN ); } catch (ContactRHDirectlyUnavailableException e) { TransactionItem contactRHItem = e.getTransactionItem(); if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyErrorWithRightslink(contactRHItem) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyError(contactRHItem) ); } basicTransactionForm.setTransactionItem( contactRHItem ); return mapping.findForward( SHOW_MAIN ); } catch (SpecialOrderUnavailableException e) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableSpecialOrderErrorWithRightslink() ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableSpecialOrderError() ); } basicTransactionForm.setTransactionItem( e.getTransactionItem() ); return mapping.findForward( SHOW_MAIN ); } catch (DeniedUnavailableException e) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedErrorWithRightslink() ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedError() ); } basicTransactionForm.setTransactionItem( e.getTransactionItem() ); return mapping.findForward( SHOW_MAIN ); } //attempt to first calculate price because if i try to just perform the transaction and there is a special order limits exceeded, it will //alter the isSpecialOrder boolean of the permission request, which I don't want to do, until I place the special order try { String test = TransactionUtils.getItemPrice( transactionItem ); } catch (InvalidAttributesException e) { if( TransactionUtils.isSystemLimitsExceededError(e) ) { basicTransactionForm.setPricingError( PricingErrorFactory.constructSystemLimitsExceededError() ); return mapping.findForward( SHOW_MAIN ); } else { saveErrors( request, TransactionUtils.getInvalidAttributeValidationErrors(e) ); return mapping.findForward( SHOW_MAIN ); } } catch (ContactRHDirectlyLimitsExceededException e) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyErrorWithRightslink(transactionItem) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyError(transactionItem) ); } return mapping.findForward( SHOW_MAIN ); } catch (DeniedLimitsExceededException e) { String reason = TransactionUtils.getReasonForLimitsExceededException( e ); if( reason.equals( TransactionConstants.REASON_UNKNOWN) ) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedErrorWithRightslink() ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedError() ); } } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededDeniedError(reason) ); } return mapping.findForward( SHOW_MAIN ); } catch (SpecialOrderLimitsExceededException e) { String reason = TransactionUtils.getReasonForLimitsExceededException( e ); String reasonMessage = e.getLimitsExceededException().getMessage(); if( reason.equals( TransactionConstants.REASON_UNKNOWN) ) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableSpecialOrderErrorWithRightslink() ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableSpecialOrderError() ); } } else { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededSpecialOrderErrorWithRightslink(reason) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededSpecialOrderError(reasonMessage) ); } } return mapping.findForward( SHOW_MAIN ); } catch (SystemLimitsExceededException e) { basicTransactionForm.setPricingError( PricingErrorFactory.constructSystemLimitsExceededError() ); return mapping.findForward( SHOW_MAIN ); } catch (ServiceInvocationException e) { _logger.error( LogUtil.getStack(e)); basicTransactionForm.setPricingError( PricingErrorFactory.constructServiceInvocationExceptionError() ); return mapping.findForward( SHOW_MAIN ); } // MSJ 2008/01/22 // If the "skip quickprice" flag was set in the transaction form, we want // to flip the flag from false to true and save the user information. /* CCUser ccUser = UserContextService.getActiveAppUser(); if (ccUser.skipQuickprice() != basicTransactionForm.getSkipQuickprice()) { UserServices.updateCurrentUserSkipQuickprice(basicTransactionForm.getSkipQuickprice()); } */ //If the Skip Quick Price flag is turned ON, then save it for the session //Look for the Skip Quick Price flag for Academic (APS/ECCS) and Photocopy (TRS) types if (transactionItem.isAcademic() || transactionItem.isPhotocopy()) { request.getSession().setAttribute(WebConstants.SessionKeys.SKIP_QUICKPRICE, basicTransactionForm.getSkipQuickprice()); } //if reaches here, no limits exceeded or unavailable errors, so go ahead and perform the transaction. try { ActionForward forward = performTransaction( transactionItem, basicTransactionForm.getPurchasablePermissionInCart(), basicTransactionForm.getOrderPurchaseID(), mapping, request, basicTransactionForm.getCp(), basicTransactionForm.getRp(), basicTransactionForm.isSf()); WebUtils.clearActionFormFromSession( request, mapping ); return forward; } //these exceptions should theoretically never be thrown because it should have been caught by the above call to calculateTranscationItemPrice //but show errors just in case catch (InvalidAttributesException e) { if( TransactionUtils.isSystemLimitsExceededError(e) ) { basicTransactionForm.setPricingError( PricingErrorFactory.constructSystemLimitsExceededError() ); return mapping.findForward( SHOW_MAIN ); } else { saveErrors( request, TransactionUtils.getInvalidAttributeValidationErrors(e) ); return mapping.findForward( SHOW_MAIN ); } } catch (ChangedToRegularOrderException e) { basicTransactionForm.setPricingError( PricingErrorFactory.constructChangedToRegularOrderError() ); return mapping.findForward( SHOW_MAIN ); } catch (ContactRHDirectlyLimitsExceededException e) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyErrorWithRightslink(transactionItem) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyError(transactionItem) ); } return mapping.findForward( SHOW_MAIN ); } catch (SpecialOrderLimitsExceededException e) { String reason = TransactionUtils.getReasonForLimitsExceededException( e ); if( reason.equals( TransactionConstants.REASON_UNKNOWN) ) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableSpecialOrderErrorWithRightslink() ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableSpecialOrderError() ); } } else { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededSpecialOrderErrorWithRightslink(reason) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededSpecialOrderError(reason) ); } } return mapping.findForward( SHOW_MAIN ); } catch (DeniedLimitsExceededException e) { String reason = TransactionUtils.getReasonForLimitsExceededException( e ); if( reason.equals( TransactionConstants.REASON_UNKNOWN) ) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedErrorWithRightslink() ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedError() ); } } else { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededDeniedErrorWithRightslink(reason) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededDeniedError(reason) ); } } return mapping.findForward( SHOW_MAIN ); } catch (IncompatibleOrderAndPurchasablePermissionException e) { ActionMessages incorrectOrderItemTypeError = TransactionUtils.getIncorrectOrderItemTypeError(); saveErrors( request, incorrectOrderItemTypeError ); return mapping.findForward( SHOW_MAIN ); } catch (ItemCannotBePurchasedException e) { ActionMessages itemCannotBePurchasedError = TransactionUtils.getItemCannotBePurchasedError( e ); saveErrors( request, itemCannotBePurchasedError ); return mapping.findForward( SHOW_MAIN ); } } public ActionForward placeSpecialOrder( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) { BasicTransactionForm basicTransactionForm = castForm( BasicTransactionForm.class, form ); TransactionItem transactionItem = basicTransactionForm.getTransactionItem(); // 2009-05-07 MSJ // Is this a RIGHTSLINK rightsholder? long ptyInst = transactionItem.getRightsholderInst(); RLinkPublisher pub = null; boolean hasRightslink = false; try { pub = RLinkPublisherServices.getRLinkPublisherByPtyInst(ptyInst); if (pub != null) hasRightslink = true; } catch(Exception e) { _logger.error( LogUtil.getStack(e)); } //get correct transaction item for given type of use try { transactionItem = getTransactionItemForTypeOfUseCode( transactionItem, basicTransactionForm.getTypeOfUseCode() ); } catch( OutsideBiactiveDateRangeException e) { saveErrors( request, TransactionUtils.getDateNotInBiactiveRangeError() ); return mapping.findForward( SHOW_MAIN ); } catch (ContactRHDirectlyUnavailableException e) { TransactionItem contactRHItem = e.getTransactionItem(); if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyErrorWithRightslink(contactRHItem) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyError(contactRHItem) ); } basicTransactionForm.setTransactionItem( contactRHItem ); return mapping.findForward( SHOW_MAIN ); } catch (DeniedUnavailableException e) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedErrorWithRightslink() ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedError() ); } basicTransactionForm.setTransactionItem( e.getTransactionItem() ); return mapping.findForward( SHOW_MAIN ); } catch (SpecialOrderUnavailableException e) { TransactionItem specialOrderTransactionItem = e.getTransactionItem(); request.setAttribute( WebConstants.RequestKeys.TRANSACTION_ITEM, specialOrderTransactionItem ); request.setAttribute( WebConstants.RequestKeys.PURCHASABLE_PERMISSION_IN_CART, basicTransactionForm.getPurchasablePermissionInCart() ); request.setAttribute( WebConstants.RequestKeys.PURCHASE_ID, String.valueOf(basicTransactionForm.getOrderPurchaseID()) ); WebUtils.clearActionFormFromSession( request, mapping ); return mapping.findForward( SPECIAL_ORDER ); } //if gets here, item is available so calculate price and see if it's a special order limits exceeded try { TransactionUtils.getItemPrice( transactionItem ); //if gets to this point, it means it's a regular order so just return back to regular order and set errors to empty basicTransactionForm.setPricingError( null ); return mapping.findForward( SHOW_MAIN ); } catch (InvalidAttributesException e) { if( TransactionUtils.isSystemLimitsExceededError(e) ) { basicTransactionForm.setPricingError( PricingErrorFactory.constructSystemLimitsExceededError() ); return mapping.findForward( SHOW_MAIN ); } else { saveErrors( request, TransactionUtils.getInvalidAttributeValidationErrors(e) ); return mapping.findForward( SHOW_MAIN ); } } catch (ContactRHDirectlyLimitsExceededException e) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyErrorWithRightslink(transactionItem) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructContactRHDirectlyError(transactionItem) ); } return mapping.findForward( SHOW_MAIN ); } catch (DeniedLimitsExceededException e) { String reason = TransactionUtils.getReasonForLimitsExceededException( e ); if( reason.equals( TransactionConstants.REASON_UNKNOWN) ) { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedErrorWithRightslink() ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructNotAvailableDeniedError() ); } } else { if (hasRightslink) { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededDeniedErrorWithRightslink(reason) ); } else { basicTransactionForm.setPricingError( PricingErrorFactory.constructLimitsExceededDeniedError(reason) ); } } return mapping.findForward( SHOW_MAIN ); } catch (SpecialOrderLimitsExceededException e) { transactionItem.setSpecialOrderLimitsExceeded( true ); request.setAttribute( WebConstants.RequestKeys.TRANSACTION_ITEM, transactionItem ); request.setAttribute( WebConstants.RequestKeys.PURCHASABLE_PERMISSION_IN_CART, basicTransactionForm.getPurchasablePermissionInCart() ); request.setAttribute( WebConstants.RequestKeys.PURCHASE_ID, String.valueOf(basicTransactionForm.getOrderPurchaseID()) ); WebUtils.clearActionFormFromSession( request, mapping ); return mapping.findForward( SPECIAL_ORDER ); } catch (SystemLimitsExceededException e) { basicTransactionForm.setPricingError( PricingErrorFactory.constructSystemLimitsExceededError() ); return mapping.findForward( SHOW_MAIN ); } catch (ServiceInvocationException e) { _logger.error( LogUtil.getStack(e)); basicTransactionForm.setPricingError( PricingErrorFactory.constructServiceInvocationExceptionError()); return mapping.findForward( SHOW_MAIN ); } } /** * This method will be called by both the "continue" and "update price" button. * It is the method called by the ajax function. **/ public void calculatePrice(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException { BasicTransactionForm basicTransactionForm = castForm( BasicTransactionForm.class, form ); //from now on, display publication year range of current publication (i.e. even for biactive DPS and RLS) basicTransactionForm.setDisplayPublicationYearRange( true ); String xmlResponse = ""; TransactionItem transactionItem = basicTransactionForm.getTransactionItem(); int typeOfUseCode = basicTransactionForm.getTypeOfUseCode(); // 2009-05-07 MSJ // Is this a RIGHTSLINK rightsholder? long ptyInst = transactionItem.getRightsholderInst(); RLinkPublisher pub = null; boolean hasRightslink = false; try { pub = RLinkPublisherServices.getRLinkPublisherByPtyInst(ptyInst); if (pub != null) hasRightslink = true; } catch(Exception e) { _logger.error( LogUtil.getStack(e)); } //get correct transaction item for given type of use try { transactionItem = getTransactionItemForTypeOfUseCode( transactionItem, typeOfUseCode ); try { String price = TransactionUtils.getItemPrice( transactionItem ); xmlResponse = TransactionAJAXUtils.generateSuccessResponse( price, transactionItem ); } catch (InvalidAttributesException e) { if( TransactionUtils.isSystemLimitsExceededError(e) ) { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructSystemLimitsExceededError(), transactionItem ); } else { xmlResponse = TransactionAJAXUtils.generateXMLInvalidAttributesErrorResponse( e, transactionItem ); } } catch (ContactRHDirectlyLimitsExceededException e) { if (hasRightslink) { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructContactRHDirectlyErrorWithRightslink(transactionItem), transactionItem ); } else { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructContactRHDirectlyError(transactionItem), transactionItem ); } } catch (DeniedLimitsExceededException e) { String reason = e.getLimitsExceededException().getMessage(); PricingError pricingError = null; if (hasRightslink) { pricingError = reason.equals( TransactionConstants.REASON_UNKNOWN) ? PricingErrorFactory.constructNotAvailableDeniedErrorWithRightslink() : PricingErrorFactory.constructLimitsExceededDeniedErrorWithRightslink(reason); } else { pricingError = reason.equals( TransactionConstants.REASON_UNKNOWN) ? PricingErrorFactory.constructNotAvailableDeniedError() : PricingErrorFactory.constructLimitsExceededDeniedError(reason); } xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), pricingError, transactionItem ); } catch (SpecialOrderLimitsExceededException e) { String reason = e.getLimitsExceededException().getMessage(); PricingError pricingError = null; if (hasRightslink) { pricingError = reason.equals( TransactionConstants.REASON_UNKNOWN ) ? PricingErrorFactory.constructNotAvailableSpecialOrderErrorWithRightslink() : PricingErrorFactory.constructLimitsExceededSpecialOrderErrorWithRightslink(reason); } else { pricingError = reason.equals( TransactionConstants.REASON_UNKNOWN ) ? PricingErrorFactory.constructNotAvailableSpecialOrderError() : PricingErrorFactory.constructLimitsExceededSpecialOrderError(reason); } xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), pricingError, transactionItem ); } catch (SystemLimitsExceededException e) { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructSystemLimitsExceededError(), transactionItem ); } catch (ServiceInvocationException e) { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructServiceInvocationExceptionError(), transactionItem ); } } catch( OutsideBiactiveDateRangeException e ) { xmlResponse = TransactionAJAXUtils.generateDateNotInBiactiveRangeXMLErrorResponse( getResources(request), transactionItem ); } catch (ContactRHDirectlyUnavailableException e) { TransactionItem contactRHItem = e.getTransactionItem(); if (hasRightslink) { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructContactRHDirectlyErrorWithRightslink(contactRHItem), contactRHItem); } else { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructContactRHDirectlyError(contactRHItem), contactRHItem); } } catch (DeniedUnavailableException e) { if (hasRightslink) { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructNotAvailableDeniedErrorWithRightslink(), e.getTransactionItem() ); } else { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructNotAvailableDeniedError(), e.getTransactionItem() ); } } catch (SpecialOrderUnavailableException e) { if (hasRightslink) { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructNotAvailableSpecialOrderErrorWithRightslink(), e.getTransactionItem() ); } else { xmlResponse = TransactionAJAXUtils.generateXMLPricingErrorResponse( getResources(request), PricingErrorFactory.constructNotAvailableSpecialOrderError(), e.getTransactionItem() ); } } response.setContentType("text/xml"); PrintWriter out = response.getWriter(); out.write(xmlResponse); out.close(); } //private methods private void populateFormFromSearch( HttpServletRequest request, BasicTransactionForm basicTransactionForm ) { PublicationPermission publicationPermission = (PublicationPermission)request.getAttribute( WebConstants.RequestKeys.PUBLICATION_PERMISSION ); PurchasablePermission purchasablePermission = PurchasablePermissionFactory.createPurchasablePermission( publicationPermission ); purchasablePermission.getItem().setIsSpecialOrder(false); basicTransactionForm.setTransactionItem( purchasablePermission ); if (_logger.isDebugEnabled()) { _logger.debug("PopulateFormFromSearch -> purchasablePermission.getTypeOfContent:" + purchasablePermission.getTypeOfContent()); } // MSJ 2008/01/22 // If the user is a "power user", that is, the SKIP_QUICKPRICE flag is set, // we want to have the form pre-expanded. Otherwise, go through the usual // quickprice routine. if (basicTransactionForm.getSkipQuickprice()) { basicTransactionForm.setExpanded( true ); } else { basicTransactionForm.setExpanded( false ); } //basicTransactionForm.setExpanded( false ); int typeOfUseCode = ( purchasablePermission.isRepublication() ) ? -1 : TransactionItemTypeOfUseMapper.getTypeOfUseCodeForTransactionItem( purchasablePermission ); basicTransactionForm.setTypeOfUseCode( typeOfUseCode ); boolean displayPublicationYearRange = TransactionUtils.displayInitialPublicationYearRange( publicationPermission, purchasablePermission ); basicTransactionForm.setDisplayPublicationYearRange( displayPublicationYearRange ); populateFormWithOtherRequestParameters( request, basicTransactionForm ); populateNumberOfStudentsFromCourseHeader( basicTransactionForm ); } private void populateFormFromNonSearch( HttpServletRequest request, BasicTransactionForm basicTransactionForm ) { TransactionItem transactionItem = (TransactionItem)request.getAttribute( WebConstants.RequestKeys.TRANSACTION_ITEM ); basicTransactionForm.setTransactionItem( transactionItem ); basicTransactionForm.setExpanded( true ); basicTransactionForm.setTypeOfUseCode( TransactionItemTypeOfUseMapper.getTypeOfUseCodeForTransactionItem( transactionItem ) ); basicTransactionForm.setDisplayPublicationYearRange( true ); populateFormWithOtherRequestParameters( request, basicTransactionForm ); } private void populateFormWithOtherRequestParameters( HttpServletRequest request, BasicTransactionForm basicTransactionForm ) { Object purchasablePermissionInCartObj = request.getAttribute( WebConstants.RequestKeys.PURCHASABLE_PERMISSION_IN_CART ); PurchasablePermission purchasablePermissionInCart = (purchasablePermissionInCartObj == null) ? null : (PurchasablePermission)purchasablePermissionInCartObj; basicTransactionForm.setPurchasablePermissionInCart( purchasablePermissionInCart ); Object orderPurchaseIdObj = request.getAttribute( WebConstants.RequestKeys.PURCHASE_ID ); int orderPurchaseId = (orderPurchaseIdObj == null) ? 0 : Integer.parseInt( (String)request.getAttribute(WebConstants.RequestKeys.PURCHASE_ID) ); basicTransactionForm.setOrderPurchaseID( orderPurchaseId ); Object selectPermissionPathFromSpecialObj = request.getAttribute( WebConstants.RequestKeys.SELECT_PERMISSION_PATH ); String selectPermissionPath = (selectPermissionPathFromSpecialObj == null ) ? "" : (String)selectPermissionPathFromSpecialObj; basicTransactionForm.setSelectPermissionPathFromSpecial( selectPermissionPath ); Object pricingErrorObj = request.getAttribute( WebConstants.RequestKeys.PRICING_ERROR ); if( pricingErrorObj == null ) { basicTransactionForm.setPricingError( null ); Object calculatePriceOnLoadObj = request.getAttribute( WebConstants.RequestKeys.RECALCULATE_PRICE ); if( calculatePriceOnLoadObj != null && ((Boolean)calculatePriceOnLoadObj).booleanValue() ) basicTransactionForm.setCalculatePriceOnLoad( true ); else basicTransactionForm.setCalculatePriceOnLoad( false ); } else { PricingError pricingError = (PricingError)pricingErrorObj; basicTransactionForm.setPricingError( pricingError ); boolean calculatePriceOnLoad = (pricingError.getErrorAction() == TransactionConstants.PRICING_ERROR_ACTION_REGULAR_ORDER); basicTransactionForm.setCalculatePriceOnLoad( calculatePriceOnLoad ); } } private void populateNumberOfStudentsFromCourseHeader( BasicTransactionForm basicTransactionForm ) { TransactionItem transactionItem = basicTransactionForm.getTransactionItem(); if( transactionItem.isAcademic() ) { int orderPurchaseId = basicTransactionForm.getOrderPurchaseID(); if( orderPurchaseId > 0 ) { try { OrderPurchases orderPurchases = OrderPurchaseServices.getOrderPurchasesForConfNum( orderPurchaseId ); if( orderPurchases != null ) { OrderPurchase orderPurchase = orderPurchases.getOrderPurchase( 0 ); if( orderPurchase != null ) transactionItem.setNumberOfStudents( (int)orderPurchase.getNumberOfStudents() ); } } catch (OrderPurchasesException e) { _logger.error( LogUtil.getStack(e)); } } else { // CourseDetails courseDetails = CartServices.getCourseDetails(); // if( courseDetails != null ) transactionItem.setNumberOfStudents( CartServices.getNumberOfStudentsFromCourseDetails() ); } } basicTransactionForm.setTransactionItem( transactionItem ); } }
cec696e9ba658b20d1f248995bfa357d4f10bfcd
4b9cb238b9d1c44151f96c27a796d688c629fb7d
/NewJenkinTest/src/main/java/integration/testrail/Integration.java
c8b2bd45c2a82df862a7f284dfd77870d3e13ca8
[]
no_license
chauhanK/Jenkins
e7c322068efaf62fb6cc01011cc8fb67a63cb82b
8f097a723f0ee841fb3d4e1338e115e9ce11564c
refs/heads/master
2021-01-17T18:27:03.688630
2016-10-26T10:45:00
2016-10-26T10:45:00
68,592,041
0
0
null
null
null
null
UTF-8
Java
false
false
970
java
package integration.testrail; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.testng.TestNG; public class Integration { public static void main(String[] args) throws IOException, APIException { // Create object of TestNG Class TestNG runner=new TestNG(); // Create a list of String List<String> suitefiles=new ArrayList<String>(); System.out.println("Execute xml"); // Add xml file which you have to execute String path = Integration.class.getClassLoader().getResource("./").getPath(); path = path.replaceAll("bin", "testng.xml"); System.out.println(path); //File excel = new File(path + "Report.xlsx"); suitefiles.add(path); System.out.println("Execute xml end"); // now set xml file for execution runner.setTestSuites(suitefiles); // finally execute the runner using run method runner.run(); ExcelReportGenerator RG = new ExcelReportGenerator(); System.out.println("Executing main"); //RG.main(String); } }
bb0b2105dd0a0ee8a433c24d91fdac1835f8296a
70ae003f1c1625bdc46cf897a107e619bb8019a7
/ezoQC/src/test/java/ca/qc/ezo/functions/binary/test/BinaryFunctionsTest.java
09eebb0004f08eee88dab4a11993f8e9c84998d0
[]
no_license
daniel3322612/ezoQc
34a1d8e3c3063561000fecd7df3c2b26a60c4ce4
6d4f17c2f2cbdc3e75ebda2c08e4ae019522d8f7
refs/heads/master
2022-12-01T21:34:53.409734
2020-08-13T02:44:00
2020-08-13T02:44:00
287,110,463
0
0
null
null
null
null
UTF-8
Java
false
false
737
java
package ca.qc.ezo.functions.binary.test; import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import ca.qc.ezo.functions.unary.Sqrt; import ca.qc.ezo.functions.unary.UnaryMinus; import ca.qc.ezo.functions.unary.UnaryPlus; public class BinaryFunctionsTest { @DisplayName("+1") @Test void testUnaryPlus() { assertEquals(1.0d, new UnaryPlus().apply(1.0d).doubleValue()); } @DisplayName("-1") @Test void testUnaryMinus() { assertEquals(-1.0d, new UnaryMinus().apply(1.0d).doubleValue()); } @DisplayName("sqrt(2)") @Test void testSqrt() { assertEquals(2.0d, new Sqrt().apply(4.0d).doubleValue()); } }
75b5aadc5493384f86fc04e0628791a131c8fa4f
b218986c48c75687a3a6383364637bb99f630d85
/src/main/java/fatiny/myTest/design/event/simple/police/DrugEvent.java
556285e59cbf1b52ee7cc8b1ab5528afbfcf3d6f
[]
no_license
f361600134/Jella
77a399b455b3cdc31464331090f4b2df88b67f66
2b667106e41c46804e9a64dc70749418fd829756
refs/heads/master
2022-06-29T19:16:58.952502
2019-08-05T12:07:04
2019-08-05T12:07:04
158,496,751
0
0
null
2022-06-29T17:04:14
2018-11-21T05:42:23
Java
UTF-8
Java
false
false
239
java
package fatiny.myTest.design.event.simple.police; public class DrugEvent extends EventMsg{ public DrugEvent(String name) { super(name); } public DrugEvent(String name, String message) { super(name, message); } }
[ "Administrator@SKY-20120726JWU" ]
Administrator@SKY-20120726JWU
818e9ffadd5a8991428420ca3a5e406e0b56831d
6b28da1e7393d7fbc8abfcbc66ddb919917014f1
/service/service_edu/src/main/java/com/hsx/eduservice/entity/EduCourse.java
3a3dbb0224d01a9b9b2d5e63ec01137fd2bdcdf8
[]
no_license
hexionly/online_course
834649f07a83111421c7614f83c9c0072914b366
9cddd1ee44801d71bab68083865d57c1b6e547fb
refs/heads/master
2023-06-18T09:53:27.123388
2021-07-19T08:59:40
2021-07-19T08:59:40
368,482,810
2
0
null
null
null
null
UTF-8
Java
false
false
2,223
java
package com.hsx.eduservice.entity; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.IdType; import java.util.Date; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <p> * 课程 * </p> * * @author HEXIONLY * @since 2021-04-09 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @ApiModel(value="EduCourse对象", description="课程") public class EduCourse implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "课程ID") @TableId(value = "id", type = IdType.ID_WORKER_STR) private String id; @ApiModelProperty(value = "课程讲师ID") private String teacherId; @ApiModelProperty(value = "二级分类ID") private String subjectId; @ApiModelProperty(value = "一级分类ID") private String subjectParentId; @ApiModelProperty(value = "课程标题") private String title; @ApiModelProperty(value = "课程销售价格,设置为0则可免费观看") private BigDecimal price; @ApiModelProperty(value = "总课时") private Integer lessonNum; @ApiModelProperty(value = "课程封面图片路径") private String cover; @ApiModelProperty(value = "销售数量") private Long buyCount; @ApiModelProperty(value = "浏览数量") private Long viewCount; @ApiModelProperty(value = "乐观锁") private Long version; @ApiModelProperty(value = "课程状态 Draft未发布 Normal已发布") private String status; @ApiModelProperty(value = "逻辑删除 1(true)已删除, 0(false)未删除") private Integer isDeleted; @ApiModelProperty(value = "创建时间") @TableField(fill = FieldFill.INSERT) private Date gmtCreate; @ApiModelProperty(value = "更新时间") @TableField(fill = FieldFill.INSERT_UPDATE) private Date gmtModified; }
b8a43a407e34995af5d0ea5973f44a8e4d9ae6af
792fd919046364cfcfd3762f6d58ca30e83129fe
/src/main/java/com/bakery/dtos/BakeryCmd.java
98f0e8cb43b285805d433ddf161c3bd5618ddbda
[]
no_license
Rameez102/Bakery
a0228b073c4baab6c6f99dcbf57138fd8618327c
610d6148769acb1f6a6c4230fe85de802da5228f
refs/heads/master
2020-06-30T13:56:41.389133
2019-08-07T13:42:10
2019-08-07T13:42:10
200,847,651
0
0
null
null
null
null
UTF-8
Java
false
false
383
java
package com.bakery.dtos; public class BakeryCmd { private String code; private Integer orderQuantity; public String getCode() { return code; } public void setCode(String code) { this.code = code; } public Integer getOrderQuantity() { return orderQuantity; } public void setOrderQuantity(Integer orderQuantity) { this.orderQuantity = orderQuantity; } }
919ad529837dfaad3d3bdf3232411470481cce00
57edcfaacc526308bd6685546b4f842ba187bee8
/app/src/main/java/com/mathandoro/coachplus/helpers/RecycleViewStack.java
65bb2e82cf2a348f8700fa51c47ba68ea8a799ed
[ "MIT" ]
permissive
coach-plus/android
e962989ae7d8c454ef6e83da3b6034ab2bccc788
4b77077add5438c3096c12bcff311186a64d4796
refs/heads/master
2021-01-23T03:12:53.947117
2020-03-08T20:38:47
2020-03-08T20:38:47
86,054,054
0
1
MIT
2018-10-28T10:46:06
2017-03-24T10:04:49
Java
UTF-8
Java
false
false
1,786
java
package com.mathandoro.coachplus.helpers; import java.util.ArrayList; import java.util.List; public class RecycleViewStack { class Section { public Section(int id, int size) { this.id = id; this.size = size; } private int id; private int size; public int getId() { return id; } public int getSize() { return size; } public void setSize(int size) { this.size = size; } } private List<Section> sections = new ArrayList<>(); public void addSection(int sectionId, int size){ this.sections.add(new Section(sectionId, size)); } public void updateSection(int sectionId, int size){ for (Section section: sections) { if(section.id == sectionId){ section.setSize(size); break; } } } public int getSectionIdAt(int position){ int tempPosition = -1; int sectionIndex = 0; for (Section section : sections) { tempPosition += section.getSize(); if(position <= tempPosition) { break; } sectionIndex++; } return sections.get(sectionIndex).getId(); } public int positionInSection(int sectionId, int position){ int base = 0; for (Section section : sections) { if(section.getId() == sectionId){ return position - base; } base += section.getSize(); } return -1; } public int size(){ int stackSize = 0; for (Section section : sections) { stackSize += section.getSize(); } return stackSize; } }
d8bef09b66b959f9154ff84863543665b3711ecd
a3875090a38fc3733e6c88e49596cc682aede397
/app/src/main/java/com/example/quanlychitieu/DataBase.java
2cd7d8639bbe84ba6fe7403ebc1c1821231dfd8f
[]
no_license
MrTom2020/duachocong
93e81c027bf65d239c8de7909705d38ddac9b73c
255df3606864b31952e9ae69b68b1a4a8b6bad5b
refs/heads/main
2023-03-18T18:04:57.048417
2021-03-16T08:49:29
2021-03-16T08:49:29
348,274,074
0
0
null
null
null
null
UTF-8
Java
false
false
934
java
package com.example.quanlychitieu; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import androidx.annotation.Nullable; public class DataBase extends SQLiteOpenHelper { public DataBase(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) { super(context, name, factory, version); } public void QueryData(String sql) { SQLiteDatabase database = getWritableDatabase(); database.execSQL(sql); } public Cursor GetData(String sql){ SQLiteDatabase database = getReadableDatabase(); return database.rawQuery(sql,null); } @Override public void onCreate(SQLiteDatabase sqLiteDatabase) { } @Override public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) { } }
ba30d66c35bf6e4c49c05b61a19a9bfb518c4a56
4b57dee33c3755b58b8e32fe6695920921904040
/TW/src/com/tw/codingsubmission/Orientation.java
524180d8dd08c1dc293c2e50a577a913f4b1e475
[]
no_license
dilzio/CTest
51356b945052b11fa03bb5947b057a6801083b2c
857dd58c32bda2d1635d93d63383732142152d19
refs/heads/master
2020-04-09T05:51:48.665098
2012-10-26T13:09:06
2012-10-26T13:09:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,987
java
package com.tw.codingsubmission; /** * State and behavior pertaining to a given orientation * * @author mtc * */ public class Orientation { private static final int NORTHCODE = 0; private static final int EASTCODE = 1; private static final int SOUTHCODE = 2; private static final int WESTCODE = 3; private final Object _rotateMutex = new Object(); private int _currentOrientation; public Orientation(OrientationEnum direction) { if (null == direction) { throw new IllegalArgumentException( "Failed to create Orientation object - null direction parameter"); } _currentOrientation = resolveEnumToInternal(direction); } public OrientationEnum getCurrentOrientation() { return resolveInternalToEnum(_currentOrientation); } public OrientationEnum turnRight() { synchronized (_rotateMutex) { if (WESTCODE == _currentOrientation) { _currentOrientation = NORTHCODE; } else { _currentOrientation++; } return resolveInternalToEnum(_currentOrientation); } } public OrientationEnum turnLeft() { synchronized (_rotateMutex) { if (NORTHCODE == _currentOrientation) { _currentOrientation = WESTCODE; } else { _currentOrientation--; } return resolveInternalToEnum(_currentOrientation); } } private int resolveEnumToInternal(OrientationEnum direction) { switch (direction) { case NORTH: return NORTHCODE; case SOUTH: return SOUTHCODE; case EAST: return EASTCODE; case WEST: return WESTCODE; default: throw new IllegalStateException("unknown orientation enum value: " + direction); } } private OrientationEnum resolveInternalToEnum(int code) { switch (code) { case NORTHCODE: return OrientationEnum.NORTH; case SOUTHCODE: return OrientationEnum.SOUTH; case EASTCODE: return OrientationEnum.EAST; case WESTCODE: return OrientationEnum.WEST; default: throw new IllegalStateException( "unknown internal orientation value: " + code); } } }
7053f439749a612c87fd80128dd8da9520f9f955
5b8337c39cea735e3817ee6f6e6e4a0115c7487c
/sources/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializer.java
3b229216894bc5ed85ac64c42c6f1b543f209a90
[]
no_license
karthik990/G_Farm_Application
0a096d334b33800e7d8b4b4c850c45b8b005ccb1
53d1cc82199f23517af599f5329aa4289067f4aa
refs/heads/master
2022-12-05T06:48:10.513509
2020-08-10T14:46:48
2020-08-10T14:46:48
286,496,946
1
0
null
null
null
null
UTF-8
Java
false
false
4,079
java
package com.google.api.client.googleapis.services; import java.io.IOException; public class CommonGoogleClientRequestInitializer implements GoogleClientRequestInitializer { private static final String REQUEST_REASON_HEADER_NAME = "X-Goog-Request-Reason"; private static final String USER_PROJECT_HEADER_NAME = "X-Goog-User-Project"; private final String key; private final String requestReason; private final String userAgent; private final String userIp; private final String userProject; public static class Builder { private String key; private String requestReason; private String userAgent; private String userIp; private String userProject; /* access modifiers changed from: protected */ public Builder self() { return this; } public Builder setKey(String str) { this.key = str; return self(); } public String getKey() { return this.key; } public Builder setUserIp(String str) { this.userIp = str; return self(); } public String getUserIp() { return this.userIp; } public Builder setUserAgent(String str) { this.userAgent = str; return self(); } public String getUserAgent() { return this.userAgent; } public Builder setRequestReason(String str) { this.requestReason = str; return self(); } public String getRequestReason() { return this.requestReason; } public Builder setUserProject(String str) { this.userProject = str; return self(); } public String getUserProject() { return this.userProject; } public CommonGoogleClientRequestInitializer build() { return new CommonGoogleClientRequestInitializer(this); } protected Builder() { } } @Deprecated public CommonGoogleClientRequestInitializer() { this(newBuilder()); } @Deprecated public CommonGoogleClientRequestInitializer(String str) { this(str, null); } @Deprecated public CommonGoogleClientRequestInitializer(String str, String str2) { this(newBuilder().setKey(str).setUserIp(str2)); } protected CommonGoogleClientRequestInitializer(Builder builder) { this.key = builder.getKey(); this.userIp = builder.getUserIp(); this.userAgent = builder.getUserAgent(); this.requestReason = builder.getRequestReason(); this.userProject = builder.getUserProject(); } public static Builder newBuilder() { return new Builder(); } public void initialize(AbstractGoogleClientRequest<?> abstractGoogleClientRequest) throws IOException { String str = this.key; if (str != null) { abstractGoogleClientRequest.put("key", (Object) str); } String str2 = this.userIp; if (str2 != null) { abstractGoogleClientRequest.put("userIp", (Object) str2); } if (this.userAgent != null) { abstractGoogleClientRequest.getRequestHeaders().setUserAgent(this.userAgent); } if (this.requestReason != null) { abstractGoogleClientRequest.getRequestHeaders().set(REQUEST_REASON_HEADER_NAME, (Object) this.requestReason); } if (this.userProject != null) { abstractGoogleClientRequest.getRequestHeaders().set(USER_PROJECT_HEADER_NAME, (Object) this.userProject); } } public final String getKey() { return this.key; } public final String getUserIp() { return this.userIp; } public final String getUserAgent() { return this.userAgent; } public final String getRequestReason() { return this.requestReason; } public final String getUserProject() { return this.userProject; } }
f1cfc7514feae90ecc7195dff22fb5d726973e46
666cd1b6fbca80244ca257abe92f721620a40cee
/LV-Master3000/src/student/tugraz/at/lv_master3000/Activities/HomeworkActivity.java
ed689b4945d015b53d27d0ae87a5246dce9121db
[]
no_license
dopedi/LV-Master3000
d10312f8913e104839a3c3f9130d0956233e7702
5878a52c9d5200a6f5a9eaa48993677485ae7fee
refs/heads/master
2021-03-12T19:42:39.890439
2013-06-17T16:21:35
2013-06-17T16:21:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
424
java
package student.tugraz.at.lv_master3000.Activities; import android.app.Activity; import android.os.Bundle; /** * Created with IntelliJ IDEA. * User: dzom-dzom * Date: 6/15/13 * Time: 4:56 PM * To change this template use File | Settings | File Templates. */ public class HomeworkActivity extends BaseActivity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } }
4881d913591b6c0d7997dec2570c6fe91c474ade
d57214d69bddcea3c4bec26c15a30faf08fcf6f9
/app/src/main/java/com/webviewdemo/WebViewDemoActivity.java
be612d2fbc56cd3803b3bc690a1fc9d23cc43d03
[]
no_license
hiral1987/WebviewDemo
b4082f82e787ae68096bf5cc660d149b76198768
93958fca40b038850a58ed167f28dc2594b66aef
refs/heads/master
2021-01-10T10:00:40.325940
2016-02-07T15:52:39
2016-02-07T15:52:39
51,206,796
0
0
null
null
null
null
UTF-8
Java
false
false
4,231
java
package com.webviewdemo; import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.graphics.Bitmap; import android.net.http.SslError; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.Window; import android.webkit.JavascriptInterface; import android.webkit.SslErrorHandler; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class WebViewDemoActivity extends Activity { WebView webView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_web_view_demo); webView = (WebView)findViewById(R.id.webview); WebSettings webSettings = webView.getSettings(); webSettings.setJavaScriptEnabled(true); webView.addJavascriptInterface(new WebAppInterface(this), "Android"); //webView.loadUrl("file:///android_asset/www/yr1955.html"); webView.setWebViewClient(new MyWebViewClient()); webView.loadUrl("https://in.yahoo.com"); findViewById(R.id.previous_btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (webView.canGoBack()) webView.goBack(); else Toast.makeText(WebViewDemoActivity.this , "No back history available",Toast.LENGTH_SHORT).show(); } }); findViewById(R.id.next_btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(webView.canGoForward())webView.goForward(); else Toast.makeText(WebViewDemoActivity.this , "No forward history available",Toast.LENGTH_SHORT).show(); } }); findViewById(R.id.pdown_btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { webView.pageDown(true); } }); findViewById(R.id.pup_btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { webView.pageUp(true); } }); findViewById(R.id.refresh_btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { webView.reload(); } }); } private class MyWebViewClient extends WebViewClient { ProgressDialog progressDialog; @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { super.onPageStarted(view, url, favicon); progressDialog = ProgressDialog.show(WebViewDemoActivity.this , "" , "Please wait..." , false , false); } @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if(progressDialog!=null && progressDialog.isShowing())progressDialog.cancel(); } @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { super.onReceivedSslError(view, handler, error); view.loadUrl("https://in.yahoo.com"); handler.proceed(); } } public class WebAppInterface { Context mContext; /** Instantiate the interface and set the context */ WebAppInterface(Context c) { mContext = c; } /** Show a toast from the web page */ @JavascriptInterface public void showToast(String toast) { Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show(); } } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { super.onKeyDown(keyCode, event); if(keyCode == KeyEvent.KEYCODE_BACK) { if(webView.canGoBack()) { webView.goBack(); } else finish(); } return false; } }