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
70023b7772f10ea1d8d23d3513c2c81538417e11
91b4d4799bb4cd9dda2d74001143f7821b22eb73
/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSideWithCoprocessor4.java
6fd0c1904810c89d75f94f17842170957a4fa3ec
[ "CC-BY-3.0", "Apache-2.0", "BSD-3-Clause", "BSD-2-Clause", "LicenseRef-scancode-protobuf", "MIT" ]
permissive
apache/hbase
dce46e0c368a0aacee2ca414edfdbd6159059800
121c8e17ecea66267fe77bab078f79d14a74a832
refs/heads/master
2023-09-04T10:46:40.146897
2023-08-31T13:33:45
2023-08-31T13:33:45
20,089,857
5,493
3,991
Apache-2.0
2023-09-14T14:55:43
2014-05-23T07:00:07
Java
UTF-8
Java
false
false
2,450
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.hbase.client; import java.util.Arrays; import java.util.Collection; import org.apache.hadoop.hbase.HBaseClassTestRule; import org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint; import org.apache.hadoop.hbase.regionserver.NoOpScanPolicyObserver; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.LargeTests; import org.junit.AfterClass; import org.junit.ClassRule; import org.junit.experimental.categories.Category; import org.junit.runners.Parameterized; /** * Test all client operations with a coprocessor that just implements the default flush/compact/scan * policy. * <p> * Base class was split into three so this class got split into three. */ @Category({ LargeTests.class, ClientTests.class }) public class TestFromClientSideWithCoprocessor4 extends TestFromClientSide4 { @ClassRule public static final HBaseClassTestRule CLASS_RULE = HBaseClassTestRule.forClass(TestFromClientSideWithCoprocessor4.class); // Override the parameters from the parent class. We just want to run it for the default // param combination. @Parameterized.Parameters public static Collection parameters() { return Arrays .asList(new Object[][] { { MasterRegistry.class, 1 }, { ZKConnectionRegistry.class, 1 } }); } @AfterClass public static void tearDownAfterClass() throws Exception { afterClass(); } public TestFromClientSideWithCoprocessor4(Class registry, int numHedgedReqs) throws Exception { initialize(registry, numHedgedReqs, NoOpScanPolicyObserver.class, MultiRowMutationEndpoint.class); } }
911a591651dfbe9b5626188331012401f937258a
d1720381e108d70d4ddc58bdaaf800fb57559410
/crutch/crutch-war/src/main/java/com/crutchclothing/security/config/SpringSecurityInitializer.java
3c889a71951d9b85bc5feb93480bba7d055d997c
[]
no_license
RobertgPatch/crutch-google
e5b85922c6971831349602dc1e8183e9e33c6e24
629238d30c03187e800e893e5c761472a70ad912
refs/heads/master
2016-09-05T18:26:58.504661
2015-04-11T04:38:35
2015-04-11T04:38:35
32,254,781
0
0
null
2015-03-15T12:14:25
2015-03-15T10:30:47
Java
UTF-8
Java
false
false
378
java
package com.crutchclothing.security.config; import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; import com.crutchclothing.config.SecurityConfig; public class SpringSecurityInitializer extends AbstractSecurityWebApplicationInitializer { public SpringSecurityInitializer() { super(SecurityConfig.class); } }
4f82cef559897ff4ad4371d36436dd10b665c4d5
1537fc7453cdc7a64cde072ba4b458a22e402e44
/sqlite/src/main/java/kelijun/com/sqlite/annotation/sqlite/Table.java
011bf213561c21a6ecfa74702b0f4a47aeed8e96
[]
no_license
447857062/notes
c2d57fe80c63d9820406fc729477b4e05fa55b70
30284d613e6aeca40fd78caa39758f8dcd76561b
refs/heads/master
2020-03-21T01:48:54.674587
2018-06-20T09:28:37
2018-06-20T09:28:37
137,964,195
0
0
null
null
null
null
UTF-8
Java
false
false
963
java
/** * Copyright (c) 2012-2013, Michael Yang 杨福海 (www.yangfuhai.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package kelijun.com.sqlite.annotation.sqlite; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Table { public String name(); }
7a8ebebdacebc3f61c0e451860e172d08b8ea81b
a53e9e70c63e07055b17406d03de0ea44672d63d
/algo/src/algo5/SortTask.java
9c674df9a2d119bc9309b5e7ccc78de18d2324ca
[]
no_license
astro-snail/otus-algo-2020-04-eilyukhina
50aededfc9fb158121c73af2f77133c7e40cbbc2
24cd3fbb828c03a4fca0c91640c56c39048426ab
refs/heads/master
2022-12-31T06:30:26.804956
2020-10-20T16:42:20
2020-10-20T16:42:20
262,892,223
0
0
null
2020-10-22T18:47:05
2020-05-10T23:12:08
Java
UTF-8
Java
false
false
310
java
package algo5; import tester.Task; public abstract class SortTask implements Sort, Task { protected int[] arr; @Override public String[] run(String[] data) { arr = SortUtils.testInputToIntArray(data); sort(); return SortUtils.intArrayToTestOutput(arr); } @Override public void sort() { } }
5bb4f55520659bd7f50378f70899695aa524dec5
d9efa698030dc8cc3e95fea58c5e03ab201f54b3
/univitrina-backend/src/main/java/ru/hh/univitrina/client/HhApiClient.java
373c2f13acca88ac33ba36b9b7017a0e49ff9a00
[]
no_license
a812hub/univitrina
497aa45cad85c1d3a1720c3ecd0838eb2adb6939
09676a69880ad3151311fbd949202aa2dcec9a49
refs/heads/master
2023-06-05T13:24:22.958856
2021-06-14T10:50:10
2021-06-14T10:50:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,236
java
package ru.hh.univitrina.client; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestTemplate; import ru.hh.nab.common.properties.FileSettings; import ru.hh.univitrina.dto.AreaDto; public class HhApiClient { private final String hhServer; private final String russiaArea; private final RestTemplate rest; public HhApiClient(FileSettings fileSettings) { this.hhServer = fileSettings.getString("hhServer"); this.russiaArea = fileSettings.getString("russiaArea"); this.rest = new RestTemplate(); } public AreaDto getRussiaArea() { HttpHeaders headers = new HttpHeaders(); headers.add("Content-Type", "application/json"); headers.add("Accept", "application/json"); headers.add("User-Agent", "Univitrina"); HttpEntity<String> requestEntity = new HttpEntity<>("", headers); ResponseEntity<AreaDto> responseEntity = rest.exchange(hhServer + russiaArea, HttpMethod.GET, requestEntity, AreaDto.class); return responseEntity.getBody(); } }
d65487f4bdcac852a823dc9967f81efa7073cd5a
c5e17eaac1c5ae423d3dca05ff9517530e540ea4
/src/apotek/PrintPenjualanRetur.java
0552fbba7a0239b8ec884140efc510dd2db98b00
[]
no_license
ustadho/haris
6c46f22b3baf237194df9b60c5e453c65ff933cb
3f77f1ad78602d4cb4da9d1f81cab9b36a5edc8e
refs/heads/master
2021-01-01T17:17:34.360634
2015-06-27T06:03:17
2015-06-27T06:03:17
34,225,971
0
0
null
null
null
null
UTF-8
Java
false
false
13,122
java
/* * PrintKwtUM.java * * Created on November 14, 2006, 11:48 AM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package apotek; import main.MainForm; import java.awt.print.PrinterJob; import java.io.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import javax.print.*; import javax.print.attribute.*; import main.SysConfig; /** * * @author root */ public class PrintPenjualanRetur { private Connection conn; private String sReturNo; private SimpleDateFormat clockFormat; private String nama_unit="",username=""; private Boolean okCpy; private String usr_trx; /** Creates a new instance of PrintKwtUM */ public PrintPenjualanRetur(Connection newCon, String sNo,String sUser, PrintService service) { conn=newCon; // nama_unit=namaUnit; sReturNo=sNo; usr_trx=sUser; printFile(saveToTmpFile(),service); } private File saveToTmpFile() { try{ File temp = File.createTempFile("kwt", ".tmp"); // File fileT = new File("C:/KWT/"); // File temp = File.createTempFile("ReturPenjualan", ".tmp",fileT); // Delete temp file when program exits. temp.deleteOnExit(); // Write to temp file BufferedWriter out = new BufferedWriter(new FileWriter(temp)); out.write(resetPrn()); out.write(draft()); out.write(condenced()); out.write(cpi20()); out.write(Line_Space_1_per_6()); NumberFormat nFormat=new DecimalFormat("#,##0"); ResultSet rs =conn.createStatement().executeQuery( "select * from fn_retur_penjualan_print('"+sReturNo+"') as (jenis text, " + "potongan double precision, tanggal date, user_ins varchar,sales_no varchar, " + "kode_cust varchar, nama_Cust varchar, no_retur varchar, " + "kode_item varchar, nama_item varchar, qty double precision, sat_kecil varchar, " + "unit_price double precision, sub_total double precision)"); String sNoKoreksi=""; int i = 1; int qty=0; double total=0, potongan=0; String no; while(rs.next()){ // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 //12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 // KWITANSI | if (i==1){ out.write(MainForm.sNamaUsaha); out.newLine(); //7 out.write(MainForm.sAlamat); out.newLine(); //8 No: 123456789012 out.write(MainForm.sTelp); out.newLine(); //8 No: 123456789012 out.newLine(); //9 out.write(" RETUR PENJUALAN");out.newLine(); //11 out.write("Penjualan#: "+rs.getString("sales_no")); out.newLine(); //12 out.write("No. : "+sReturNo+" "+rataKanan("("+rs.getString("user_ins")+")", 18)); out.newLine(); //12 out.write("Tgl.: "+new SimpleDateFormat("dd/MM/yy").format(rs.getDate("tanggal")) ); out.newLine(); out.write("Cust: "+rs.getString("nama_cust")+" ("+rs.getString("kode_cust")+")"); out.newLine(); //11 out.newLine(); potongan=rs.getDouble("potongan"); } i++; out.write(padString(rs.getString("nama_item"),40)); out.newLine(); out.write(rataKanan(nFormat.format(rs.getInt("qty")), 4)+" "+ padString(rs.getString("sat_kecil"), 6)+" X "+ rataKanan(nFormat.format(rs.getDouble("unit_price")), 12)+ " = "+rataKanan(nFormat.format(rs.getDouble("sub_total")),11)); out.newLine(); //out.write(padString(rs.getString("nama_item"),30)); out.newLine(); total+=(rs.getDouble("sub_total")); } total= roundUp(Math.abs(total),50d) * (total>0? 1: -1); out.write(" ==============="); out.newLine(); out.newLine(); //19 out.write(padString("",15)+" TOTAL :"); out.write(bold()); //out.write(cpi10()); out.write(rataKanan(nFormat.format(total), 15)); //out.write(cpi20()); out.write(cancelBold()); out.newLine(); //20 out.write(padString("",15)+" POTONGAN:"+rataKanan(nFormat.format(potongan),15)); out.newLine(); out.write(padString("",15)+" NET :"+rataKanan(nFormat.format(total-potongan), 15)); out.newLine(); rs.close(); if(sNoKoreksi.length()>0){ out.write("Ket : Koreksi dari No. "+sNoKoreksi); out.newLine(); //21 } int s=0; out.newLine(); // out.write("Terima Kasih"); out.newLine(); // out.write("Barang yang sudah dibeli tidak dapat"); out.newLine(); // out.write("Ditukar atau Dikembalikan"); out.newLine(); // out.newLine(); // out.newLine(); // out.newLine(); // out.newLine(); // out.newLine(); out.newLine(); out.newLine(); out.write(printCutPaper()); //out.write(drawKick()); out.close(); return temp.getCanonicalFile(); }catch(IOException io){ System.err.println(io.getMessage()); }catch(SQLException se){ System.err.println(se.getMessage()); } return null; } private String printCutPaper(){ String str; str = String.valueOf((char)29) + String.valueOf((char)'V')+ String.valueOf((char)66)+ String.valueOf((char)0); // str = String.valueOf((char)29) +String.valueOf((char)'i'); return str; } private String drawKick(){ String str; str = String.valueOf((char)27) + String.valueOf((char)112)+ String.valueOf((char)0)+ String.valueOf((char)60)+ String.valueOf((char)120); return str; } private Double roundUp(Double dNum,Double dUp){ Double ret = dNum; if (dNum==null) dNum=0.0; Double sisa = dNum%dUp; if (sisa>0){ ret = (dNum-sisa)+dUp; } return ret; } private String rataKanan(String sTeks,int panjang){ String newText; newText=space(panjang-sTeks.length())+sTeks; return newText; } private String padString(String sTeks,int panjang){ String newText; String jmSpace=""; if (sTeks.length()>panjang){ newText=sTeks.trim().substring(0, panjang); }else{newText=sTeks.trim();} for(int i=0;i<(panjang-sTeks.trim().length());i++){ newText=newText+" "; } return newText; } private String space(int iSpc){ String s=""; for(int i=1;i<=iSpc;i++){ s=s+" "; } return s; } private String tengah(String sStr){ String s=""; int iTengah = (80-sStr.length())/2; s=s+space(iTengah)+sStr; return s; } private void printFile(File fileToPrint, PrintService service){ //int yesNo = JOptionPane.showConfirmDialog(this,"Siapkan Printer",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE); //if(yesNo == JOptionPane.YES_OPTION){ try { // Open the text file FileInputStream fs = new FileInputStream(fileToPrint); // Find the default service DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE; //PrintService service = PrintServiceLookup.lookupDefaultPrintService(); // Create the print job DocPrintJob job = service.createPrintJob(); Doc doc = new SimpleDoc(fs, flavor, null); // Monitor print job events // See "Determining When a Print Job Has Finished" // for the implementation of PrintJobWatcher // PrintJobWatcher pjDone = new PrintJobWatcher(job); // Print it job.print(doc, null); // Wait for the print job to be done // pjDone.waitForDone(); // It is now safe to close the input stream fs.close(); } catch (PrintException e) {System.out.println(e.getMessage()); } catch (IOException e) {System.out.println(e.getMessage()); } } public void setUser(String sUser){ username=sUser; } private String resetPrn(){ String str; str = String.valueOf((char)27) + String.valueOf((char)64); return str; } private String draft(){ String str; str = String.valueOf((char)27) + String.valueOf((char)48); return str; } private String LQ(){ String str; str = String.valueOf((char)27) + String.valueOf((char)49); return str; } private String bold(){ String str; str = String.valueOf((char)27) + String.valueOf((char)69); return str; } private String cancelBold(){ String str; str = String.valueOf((char)27) + String.valueOf((char)70); return str; } private String italic(){ String str; str = String.valueOf((char)27) + String.valueOf((char)52); return str; } private String cancelItalic(){ String str; str = String.valueOf((char)27) + String.valueOf((char)53); return str; } private String underLine(){ String str; str = String.valueOf((char)27) + String.valueOf((char)45) + String.valueOf((char)49); return str; } private String cancelUnderLine(){ String str; str = String.valueOf((char)27) + String.valueOf((char)45) + String.valueOf((char)48); return str; } private String cpi10(){ String str; str = String.valueOf((char)27) + String.valueOf((char)80); return str; } private String cpi12(){ String str; str = String.valueOf((char)27) + String.valueOf((char)77); return str; } private String cpi15(){ String str; str = String.valueOf((char)27) + String.valueOf((char)103); return str; } private String cpi20(){ String str; str = String.valueOf((char)27) + String.valueOf((char)77)+ String.valueOf((char)15); return str; } private String condenced(){ String str; str = String.valueOf((char)27) + String.valueOf((char)15); return str; } private String cancelCondenced(){ String str; str = String.valueOf((char)18); return str; } private String loadFront(){ String str; str = String.valueOf((char)27) + String.valueOf((char)25) + String.valueOf((char)70); return str; } private String DoubleStrike(){ String str; str = String.valueOf((char)27) + String.valueOf((char)71) ; return str; } private String CancelDoubleStrike(){ String str; str = String.valueOf((char)27) + String.valueOf((char)72) ; return str; } private String Space_1_per_36(){ String str; str = String.valueOf((char)27) + String.valueOf((char)51) + String.valueOf((char)5); return str; } private String Space_1_per_72(){ String str; str = String.valueOf((char)27) + String.valueOf((char)51) + String.valueOf((char)45); return str; } private String Line_Space_1_per_8(){ String str; str = String.valueOf((char)27) + String.valueOf((char)48); return str; } private String Line_Space_1_per_6(){ String str; str = String.valueOf((char)27) + String.valueOf((char)50); return str; } private String doubleWide(){ String str; str = String.valueOf((char)27) + String.valueOf((char)14); return str; } public static void main(String[] args) { SysConfig sc=new SysConfig(); Connection conn; String url = "jdbc:postgresql://localhost/"+sc.getDBName(); try{ Class.forName("org.postgresql.Driver"); } catch(ClassNotFoundException ce) { System.out.println(ce.getMessage()); } PrinterJob job = PrinterJob.getPrinterJob(); DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE; PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); PrintServiceAttributeSet pset = new HashPrintServiceAttributeSet(); PrintService[] services = PrintServiceLookup.lookupPrintServices(flavor, null); int i=0; // for(i=0;i<services.length;i++){ // if(services[i].getName().equalsIgnoreCase(sc.getValue("printer_kwt"))){ try { conn = DriverManager.getConnection(url, "tadho", "123"); PrintPenjualanRetur pn = new PrintPenjualanRetur(conn, "RJ-110002", "dwikk", services[i]); } catch (SQLException se) { System.out.println(se.getMessage()); } // break; // } // } } }
6fd3257c734f3524a6d8eff8660a490392a49995
ef0c1514e9af6de3ba4a20e0d01de7cc3a915188
/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/fluent/models/ServerUpgradeParametersProperties.java
01fbcdb771fb8d0becc7584ffb0ef87f9bc63e6a
[ "MIT", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-unknown-license-reference", "LGPL-2.1-or-later", "CC0-1.0", "BSD-3-Clause", "UPL-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "LicenseRef-scancode-generic-cla" ]
permissive
Azure/azure-sdk-for-java
0902d584b42d3654b4ce65b1dad8409f18ddf4bc
789bdc6c065dc44ce9b8b630e2f2e5896b2a7616
refs/heads/main
2023-09-04T09:36:35.821969
2023-09-02T01:53:56
2023-09-02T01:53:56
2,928,948
2,027
2,084
MIT
2023-09-14T21:37:15
2011-12-06T23:33:56
Java
UTF-8
Java
false
false
1,630
java
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.mysql.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties that can be updated for a server. */ @Fluent public final class ServerUpgradeParametersProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerUpgradeParametersProperties.class); /* * Represents an server storage profile. */ @JsonProperty(value = "targetServerVersion") private String targetServerVersion; /** * Get the targetServerVersion property: Represents an server storage profile. * * @return the targetServerVersion value. */ public String targetServerVersion() { return this.targetServerVersion; } /** * Set the targetServerVersion property: Represents an server storage profile. * * @param targetServerVersion the targetServerVersion value to set. * @return the ServerUpgradeParametersProperties object itself. */ public ServerUpgradeParametersProperties withTargetServerVersion(String targetServerVersion) { this.targetServerVersion = targetServerVersion; return this; } /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { } }
98b8577c8fd5b6979edaa668ee397c38e90f4111
25ef5bc38685e6d14db754f00b3ad1d26d74981b
/sc.modelica.xtext.ui/src/sc/modelica/xtext/ui/outline/FilterAnnotationsContribution.java
f63fd4d6edfc13cbe67932dfbb007d3a7e566f86
[]
no_license
cooked/modelica-xtext
3e8f253f3163a74a7f378529c4ed5d690c4d5882
7f76619432b7898d16a6955551e6c8bbbaf1e4c7
refs/heads/master
2021-01-10T13:14:25.603360
2016-02-16T00:40:39
2016-02-16T00:40:39
51,796,400
0
0
null
null
null
null
UTF-8
Java
false
false
1,397
java
package sc.modelica.xtext.ui.outline; import org.eclipse.jface.action.Action; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.xtext.ui.PluginImageHelper; import org.eclipse.xtext.ui.editor.outline.IOutlineNode; import org.eclipse.xtext.ui.editor.outline.actions.AbstractFilterOutlineContribution; import org.eclipse.xtext.ui.editor.outline.impl.EObjectNode; import com.google.inject.Inject; import sc.modelica.xtext.modelicaMo.ModelicaMoPackage; public class FilterAnnotationsContribution extends AbstractFilterOutlineContribution { public static final String PREFERENCE_KEY = "ui.outline.filterAnnotations"; @Inject private PluginImageHelper imageHelper; @Override protected boolean apply(IOutlineNode node) { return !(node instanceof EObjectNode) || !((EObjectNode) node).getEClass() .equals(ModelicaMoPackage.Literals.ANNOTATION); } @Override public String getPreferenceKey() { return PREFERENCE_KEY; } @Override protected void configureAction(Action action) { action.setText("Hide annotations"); action.setDescription("Hide annotations"); action.setToolTipText("Hide annotations"); //action.setChecked(true); stateChanged(true); action.setImageDescriptor(getImageDescriptor()); } protected ImageDescriptor getImageDescriptor() { return ImageDescriptor.createFromImage( imageHelper.getImage("page_white_text.png")); } }
9ac6b733f00ef0b86aa828cac78a7f7efcdf57b3
7584251fe4b24165b2935894f0a997461f7f5c33
/src/edu/rit/se/security/fuzzer/SanatizationFuzzer.java
83aa26f7e2fd8abfe7d6424379f2257f6103192f
[]
no_license
zachberger/fuzzer
6528abb59ce187009363e3d21bec3e559514a814
cca6f2582aded1ee7a6fa06ee3d05ca2828cfea2
refs/heads/master
2021-01-22T14:33:23.522166
2013-05-09T01:48:15
2013-05-09T01:48:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,539
java
package edu.rit.se.security.fuzzer; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Set; import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; import com.gargoylesoftware.htmlunit.HttpMethod; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.util.Cookie; import com.gargoylesoftware.htmlunit.util.NameValuePair; public class SanatizationFuzzer extends Object implements Fuzzer { public static List<String> xss_vectors; public static List<String> sql_vectors; private WebClient wc; public SanatizationFuzzer(WebClient wc){ this.wc = wc; } @Override public void fuzz(Set<PageInfo> pages) { try { if (xss_vectors == null || sql_vectors == null) { File xss_file = new File("resources/fuzz_vectors_xss.txt"); File sql_file = new File("resources/fuzz_vectors_sql.txt"); xss_vectors = PageEnumerator.getLines(xss_file); sql_vectors = PageEnumerator.getLines(sql_file); } for(String xss_vec : xss_vectors){ for(PageInfo page : pages){ for(HttpMethod action : page.supportedActions.keySet()){ if(page.supportedActions.get(action).size() > 0){ executeVector(xss_vec, action, page); if(wc.getCookieManager().getCookie("xss") != null){ // The XSS was executed Cookie cookie = wc.getCookieManager().getCookie("xss"); wc.getCookieManager().removeCookie(cookie); System.out.println("Found XSS vulnerability on page: "+page.rootURL.toString()); if(!"".equals(page.query)) System.out.println("\twith query: "+page.query); System.out.println("\tUsing vector: " + xss_vec); } } } } } for(String sql_vec : sql_vectors){ for(PageInfo page : pages){ for(HttpMethod action : page.supportedActions.keySet()){ if(page.supportedActions.get(action).size() > 0){ HtmlPage result = executeVector(sql_vec, action, page); if(result != null && result.asText().contains("MySQL ")){ System.out.println("Potential SQL Injection vulnerability on page: "+page.rootURL.toString()); if(!"".equals(page.query)) System.out.println("\twith query: "+page.query); System.out.println("\tUsing vector: " + sql_vec); } } } } } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } private HtmlPage executeVector(String vector, HttpMethod action, PageInfo pageInfo){ // Instead of requesting the page directly we create a WebRequestSettings object WebRequest request = new WebRequest( pageInfo.rootURL, action); List<NameValuePair> inputs = new LinkedList<NameValuePair>(); for(String input : pageInfo.supportedActions.get(action)){ inputs.add(new NameValuePair(input, vector)); } // Then we set the request parameters request.setRequestParameters(inputs); // Finally, we can get the page try { return wc.getPage(request); } catch (FailingHttpStatusCodeException e) { return null; } catch (IOException e) { return null; } } }
5b2fe2f9048cbbb0aaf7e771d6ed58bd39d57b5d
0bf6ddf985b480fc7c761472919979d5c7af331c
/src/main/java/br/com/alura/student/service/TopicoService.java
f26516ba40474dfe624c854d35e249d89505ef61
[]
no_license
felipeesc/Financas-API
e518631d6cae256d024f670f2d9e21828a4c4bc8
9b8b875a8151e3edc45454f2cf8d54aa636cb466
refs/heads/master
2020-09-22T15:07:40.880138
2019-12-04T04:44:24
2019-12-04T04:44:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,169
java
package br.com.alura.student.service; import br.com.alura.student.model.Topico; import br.com.alura.student.model.dto.AtualizacaoTopicoForm; import br.com.alura.student.model.dto.DetalhesTopicoDto; import br.com.alura.student.model.dto.TopicoDto; import br.com.alura.student.model.dto.TopicoForm; import br.com.alura.student.repository.CursoRepository; import br.com.alura.student.repository.TopicoRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import java.util.Optional; @Service public class TopicoService { @Autowired private TopicoRepository topicoRepository; @Autowired private CursoRepository cursoRepository; public Page<TopicoDto> listaTopicos(String nomeCurso, Pageable paginacao) { // PageRequest paginacao = PageRequest.of(pagina, qtd, Sort.Direction.ASC, ordenacao); if (nomeCurso == null) { Page<Topico> topicos = topicoRepository.findAll(paginacao); return TopicoDto.converter(topicos); } else { Page<Topico> topicos = topicoRepository.findByTitulo(nomeCurso, paginacao); return TopicoDto.converter(topicos); } } public Topico cadastrar(TopicoForm topicoForm) { Topico topico = topicoForm.converter(cursoRepository); return topicoRepository.save(topico); } public ResponseEntity<DetalhesTopicoDto> filtraPorId(Long id) { Optional<Topico> topico = topicoRepository.findById(id); if (topico.isPresent()) { return ResponseEntity.ok(new DetalhesTopicoDto(topico.get())); } return ResponseEntity.notFound().build(); } public Topico atualizaTopico(Long id, AtualizacaoTopicoForm form) { Topico topico = topicoRepository.getOne(id); topico.setTitulo(form.getTitulo()); topico.setMensagme(form.getMensagem()); return topico; } public void removendo(Long id) { topicoRepository.deleteById(id); } }
bb9fc34bc9440c7f37b605af57624a4bc8d729f0
0193680be75171cd64433657ee3c9e2340408f1c
/ServerFullStack/myshop/src/main/java/com/kevin/myshop/entity/dao/IClientsDao.java
10a10b4d7351b81717d185dd7d129371c58be4d2
[]
no_license
Udorki/FullStackProject
c77f02c386e8193d90982aaacf60c81daf6bef99
71e42d9a70d55c720022f109f3af3031263e448f
refs/heads/master
2020-04-09T20:01:47.907268
2018-12-17T03:35:46
2018-12-17T03:35:46
160,561,478
0
0
null
2018-12-16T02:45:54
2018-12-05T18:31:31
Java
UTF-8
Java
false
false
218
java
package com.kevin.myshop.entity.dao; import org.springframework.data.repository.CrudRepository; import com.kevin.myshop.entity.models.Clients; public interface IClientsDao extends CrudRepository<Clients, Long> { }
5cf92b0183d97587b5d716352d3790472cb9d23f
f444378be6a26d08374aae66c0f6f0c916f48ec2
/PruebaDormir.java
6240682e415c2752e14fa0a882d06ec60089a371
[]
no_license
yud-cumba/ProgramacionII-JAVA
f3d5390d6b7585bd9acacbc5f0b9c3ef0e6b398b
f48a4e2ea3dba015ca560b3f66e4c2b981e7d0d4
refs/heads/master
2022-08-02T05:34:23.973406
2020-05-25T21:28:39
2020-05-25T21:28:39
266,883,303
0
0
null
null
null
null
UTF-8
Java
false
false
147
java
public class PruebaDormir{ public static void main(String args[]){ Dormir cama =new Dormir(); cama.verDormir(); cama.vamoJugar(); } }
73a1247602115ff25f98c58e4dfd6ffcdd495ee4
d8aa49cdeb147ec33ad8c72bdf8d638ce20a63a6
/spring-ajt-solved/src/main/java/pl/vavatech/auction/blc/repo/OrderDir.java
0411e732b87867eee7f37a4ccc30895f66cee156
[]
no_license
MirekSz/spring-auction
650aca0e5a615020943dbff9f76cae438d9d6c11
ac6d73af2560fd46bd938be0eb46722c89f0193e
refs/heads/master
2020-04-06T07:05:52.411822
2016-09-03T14:17:21
2016-09-03T14:17:21
64,677,968
0
1
null
null
null
null
UTF-8
Java
false
false
75
java
package pl.vavatech.auction.blc.repo; public enum OrderDir { ASC, DESC }
[ "m.szajo" ]
m.szajo
bbfc308841ca1f0d484909ba2546530a8c208459
6b340ab44fa80e4ce15691126e02024b9c95c2b8
/teams/lazer1/BasePlayer.java
3c43cff9351612fbcab4a8e48b2769d6d5d1df82
[]
no_license
Cixelyn/bcode2010
2ad2cd364cc20cdbf3df4d4ea404d01c8b226b2a
12d10f142c20ba136f179045403c200137ee081c
refs/heads/master
2022-11-14T22:27:23.721239
2020-06-29T04:21:34
2020-06-29T04:21:34
275,728,597
0
0
null
null
null
null
UTF-8
Java
false
false
235
java
package lazer1; import battlecode.common.*; public abstract class BasePlayer implements Runnable{ protected final RobotController rc; //Constructor public BasePlayer(RobotController r) { this.rc = r; } }
ec4ccaec00b6cea30bfbcf4874eecfbc172b8ac1
b73850e700f878597e052d610c874c7d34d5879e
/src/main/java/controller/UsuarioController.java
85d23d38b8052bf9ad8db48759114adf506687b9
[]
no_license
brenherrera/ProyectoBarcelo
04ed3a93af466aa575217633edd3d7a8c6a53ee4
0c538d2f51bea6f7c6bdbb3217c200d04f70f27b
refs/heads/main
2023-04-05T20:19:12.629784
2021-04-22T05:18:53
2021-04-22T05:18:53
359,314,188
0
0
null
null
null
null
UTF-8
Java
false
false
1,011
java
package controller; import gestion.UsuarioGestion; import javax.inject.Named; import javax.enterprise.context.SessionScoped; import java.io.Serializable; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import model.Usuario; @Named(value = "usuarioController") @SessionScoped public class UsuarioController extends Usuario implements Serializable { public UsuarioController() { } public String getUsuario() { Usuario usuario = UsuarioGestion.getUsuario(this.getIdUsuario(), this.getPwUsuario()); if (usuario != null) { this.setNombreUsuario(usuario.getNombreUsuario()); this.setIdRol(usuario.getIdRol()); return "inicio.xhtml"; } else { FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Usuario o contraseña invalida"); FacesContext.getCurrentInstance().addMessage("loginForm:clave", msg); return "index.xhtml"; } } }
9a463ccb69a0e4807e45c41ca7cc9263050d12a5
bca1951699cbee62a97031a060b330e88df514e8
/Vegetable Management system - BACKEND/VegetableManagementSystem/src/main/java/com/hexaware/vegetablemanagement/entity/Customer.java
7b9b28536cf0d5f56dea521e2f9b5f9d1bcc31e6
[]
no_license
itachiuchihamadara/Vegetable-Management-Project
5722ccd6b1bc1b81b02b686b2e8a4e84ab7564a7
5d942d9ad20d852e32531b7e6d8c622882bb1eca
refs/heads/master
2023-09-06T03:18:14.032393
2021-11-19T12:03:41
2021-11-19T12:03:41
429,777,122
0
0
null
null
null
null
UTF-8
Java
false
false
1,676
java
package com.hexaware.vegetablemanagement.entity; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; import javax.persistence.Table; @Entity public class Customer { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private long Id; private String Name; private String Password; private String Phn; private String Email; private String Address; private float Wallet; public Customer() { super(); } public Customer(long id, String name, String password, String phn, String email, String address, float wallet) { super(); Id = id; Name = name; Password = password; Phn = phn; Email = email; Address = address; Wallet=wallet; } public long getId() { return Id; } public void setId(long id) { Id = id; } public String getName() { return Name; } public void setName(String name) { Name = name; } public String getPassword() { return Password; } public void setPassword(String password) { Password = password; } public String getPhn() { return Phn; } public void setPhn(String phn) { Phn = phn; } public String getEmail() { return Email; } public void setEmail(String email) { Email = email; } public String getAddress() { return Address; } public void setAddress(String address) { Address = address; } public float getWallet() { return Wallet; } public void setWallet(float wallet) { this.Wallet = wallet; } }
144ca4e09661972304b08c5148693dba2acd9736
2a80c8f3004960d07f3461ab7f32072095fd3a67
/src/main/java/com/tencentcloudapi/live/v20180801/models/UpdateLiveWatermarkResponse.java
974d38e44ba6d6136a992c38c5e3a6358f5c9b5e
[ "Apache-2.0" ]
permissive
kennyshittu/tencentcloud-sdk-java-intl-en
495a6e9cf3936406a0d95974aee666ded6632118
2ed6e287c3f451e3709791a3c7ac4b5316205670
refs/heads/master
2022-04-15T06:59:48.967043
2020-04-02T14:13:10
2020-04-02T14:13:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,056
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tencentcloudapi.live.v20180801.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class UpdateLiveWatermarkResponse extends AbstractModel{ /** * The unique request ID, which is returned for each request. RequestId is required for locating a problem. */ @SerializedName("RequestId") @Expose private String RequestId; /** * Get The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @return RequestId The unique request ID, which is returned for each request. RequestId is required for locating a problem. */ public String getRequestId() { return this.RequestId; } /** * Set The unique request ID, which is returned for each request. RequestId is required for locating a problem. * @param RequestId The unique request ID, which is returned for each request. RequestId is required for locating a problem. */ public void setRequestId(String RequestId) { this.RequestId = RequestId; } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "RequestId", this.RequestId); } }
311f8d5af5aa8507c5f10939589fc30cf1b80307
9ab91b074703bcfe9c9407e1123e2b551784a680
/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/matrix/Matrix.java
fdf4b6fee01a6ec4a6202e6a349f97a7cddd1bc9
[]
no_license
pkdevbox/osee
7ad9c083c3df8a7e9ef6185a419680cc08e21769
7e31f80f43d6d0b661af521fdd93b139cb694001
refs/heads/master
2021-01-22T00:30:05.686402
2015-06-08T21:19:57
2015-06-09T18:42:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,515
java
/******************************************************************************* * Copyright (c) 2004, 2007 Boeing. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Boeing - initial API and implementation *******************************************************************************/ package org.eclipse.osee.framework.ui.skynet.util.matrix; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.osee.framework.jdk.core.util.AHTML; /** * Creates HTML matrix * * @author Donald G. Dunne */ public class Matrix { private final String title; private final ArrayList<MatrixItem> items; private final Map<String, MatrixItem> nameToItem = new HashMap<String, MatrixItem>(); private final Set<String> values = new HashSet<String>(); private final Map<String, Set<String>> nameToValues = new HashMap<String, Set<String>>(); // Names with no values will be listed at the bottom of the report so they don't take up space private final Set<String> noValueNames = new HashSet<String>(); private boolean useNameAsMark = false; private IProgressMonitor monitor; public Matrix(String title, ArrayList<MatrixItem> items) { this.title = title; this.items = items; } public String getMatrix() { StringBuilder sb = new StringBuilder(); sb.append(AHTML.heading(3, title)); sb.append(getMatrixBody()); return sb.toString(); } private void processData() { for (MatrixItem item : items) { nameToItem.put(item.getName(), item); values.addAll(item.getValues()); if (nameToValues.containsKey(item.getName())) { Set<String> vals = nameToValues.get(item.getName()); vals.addAll(item.getValues()); nameToValues.remove(item.getName()); nameToValues.put(item.getName(), vals); } else { nameToValues.put(item.getName(), item.getValues()); } } } private String getMatrixBody() { processData(); StringBuilder sb = new StringBuilder(); sb.append(AHTML.beginMultiColumnTable(100, 1)); // Determine all the names to deal with Set<String> names = new HashSet<String>(); // Don't want to take up valuable table space with names that have no values; keep track // of them and print them at the end of the report for (String name : nameToItem.keySet()) { System.out.println("nameToValues.get(name) *" + nameToValues.get(name) + "*"); if (nameToValues.get(name) == null || nameToValues.get(name).isEmpty()) { noValueNames.add(name); } else { names.add(name); } } // Create sortedNames for use in looping through String[] sortedNames = names.toArray(new String[names.size()]); Arrays.sort(sortedNames); // Create headerNames with one more field due to value name column names.add(" "); String[] headerNames = names.toArray(new String[names.size()]); Arrays.sort(headerNames); // Add header names to table sb.append(AHTML.addHeaderRowMultiColumnTable(headerNames)); int x = 1; // Create sorted list of values String[] sortedValues = values.toArray(new String[values.size()]); Arrays.sort(sortedValues); for (String value : sortedValues) { String str = String.format("Processing %s/%s \"%s\"", x++ + "", values.size(), value); System.out.println(str); if (monitor != null) { monitor.subTask(str); } List<String> marks = new ArrayList<String>(); marks.add(value); for (String name : sortedNames) { if (nameToValues.get(name) != null && nameToValues.get(name).contains(value)) { marks.add(useNameAsMark ? name : "X"); } else { marks.add("."); } } String[] colOptions = new String[marks.size()]; int i = 0; colOptions[i] = ""; for (i = 1; i < marks.size(); i++) { colOptions[i] = " align=center"; } sb.append(AHTML.addRowMultiColumnTable(marks.toArray(new String[marks.size()]), colOptions)); } sb.append(AHTML.endMultiColumnTable()); if (noValueNames.size() > 0) { sb.append(AHTML.newline(2) + AHTML.bold("Items with no values: ")); String[] sortedItems = noValueNames.toArray(new String[noValueNames.size()]); Arrays.sort(sortedItems); for (String str : sortedItems) { sb.append(AHTML.newline() + str); } sb.append(AHTML.newline()); } return sb.toString(); } /** * @return Returns the useNameAsMark. */ public boolean isUseNameAsMark() { return useNameAsMark; } /** * @param useNameAsMark The useNameAsMark to set. */ public void setUseNameAsMark(boolean useNameAsMark) { this.useNameAsMark = useNameAsMark; } public IProgressMonitor getMonitor() { return monitor; } public void setMonitor(IProgressMonitor monitor) { this.monitor = monitor; } }
[ "rbrooks@ee007c2a-0a25-0410-9ab9-bf268980928c" ]
rbrooks@ee007c2a-0a25-0410-9ab9-bf268980928c
7343b3d7b66df70d74e5a62490ce6fd009d26007
7657aa2e7a8be2c0263816576fb6d326facb4013
/app/src/main/java/kiky/beam/lilly/th/ac/rmutk/fruitqr/TutorialProductFragment.java
6e1d8bf0b477a277f1cb23a152282300f3ec229e
[]
no_license
huamenglilly/FruitQRv2_20MayV1
ee04df2447e55a15a2d052b99d97319ce7dcd939
4f0e659834ebae5ddf6a0f282693f0028d39de98
refs/heads/master
2020-05-25T03:28:10.832253
2019-07-18T17:13:30
2019-07-18T17:13:30
187,602,821
0
3
null
null
null
null
UTF-8
Java
false
false
5,819
java
package kiky.beam.lilly.th.ac.rmutk.fruitqr; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; /** * A simple {@link Fragment} subclass. */ public class TutorialProductFragment extends Fragment { public TutorialProductFragment() { // Required empty public constructor } @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); buttonnClick(); } private void buttonnClick() { Button button1 = getView().findViewById(R.id.iconhome); button1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity() .getSupportFragmentManager() .beginTransaction() .replace(R.id.contentServiceFragment,new TutorialFramerFragment()).commit(); } }); Button button2 = getView().findViewById(R.id.iconqrcode); button2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(getActivity(), QRActivity.class); intent.putExtra("Login", false); startActivity(intent); } }); Button button3 = getView().findViewById(R.id.iconaddproduct); button3.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity() .getSupportFragmentManager() .beginTransaction() .replace(R.id.contentServiceFragment,new AddProductFragment()).commit(); } }); Button button4 = getView().findViewById(R.id.iconproduct); button4.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity() .getSupportFragmentManager() .beginTransaction() .replace(R.id.contentServiceFragment,new ShowListProductFragment2()).commit(); } }); Button button5 = getView().findViewById(R.id.iconlistqrcode); button5.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity() .getSupportFragmentManager() .beginTransaction() .replace(R.id.contentServiceFragment,new ShowListProductFragment()).commit(); } }); Button button6 = getView().findViewById(R.id.iconregister); button6.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity() .getSupportFragmentManager() .beginTransaction() .replace(R.id.contentServiceFragment,new InfoLoginFragment()).commit(); } }); Button button7 = getView().findViewById(R.id.iconmanual); button7.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity() .getSupportFragmentManager() .beginTransaction() .replace(R.id.contentServiceFragment,new ManualFragment()).commit(); } }); Button button8 = getView().findViewById(R.id.iconaboutme); button8.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { getActivity() .getSupportFragmentManager() .beginTransaction() .replace(R.id.contentServiceFragment,new AboutMeFragment()).commit(); } }); Button button9 = getView().findViewById(R.id.iconexit); button9.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle("แจ้งเตือน..!"); builder.setMessage("คุณต้องการออกจากแอพพลิเคชันใช่หรือไม่"); builder.setNegativeButton("ยกเลิก", new DialogInterface.OnClickListener() {//ปุ่มที่1 @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); // builder.setPositiveButton("ยืนยัน", new DialogInterface.OnClickListener() {//ปุ่มที่2 @Override public void onClick(DialogInterface dialog, int which) { getActivity().finish(); } }); builder.show(); } }); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_tutorial_product, container, false); } }
c58703b7c1f56276bcc4bde544fbe9ca0956dbe1
a37b4d27ba55470ec0f3bf2c8c8215374732232f
/common/quickshare-common-bean/src/main/java/com/quickshare/common/bean/web/ArrayData.java
199409b92dfc16ac5561176cd5ddd44d6cf6b04a
[]
no_license
iMliuYong/Springboot-framework
e76844fb0a209ceffccfad10c45226a0cae99f02
4b65a7921af503501251d51ddeb13327cede5940
refs/heads/master
2023-05-30T20:52:20.787102
2021-06-10T01:52:13
2021-06-10T01:52:13
375,539,533
0
0
null
null
null
null
UTF-8
Java
false
false
274
java
package com.quickshare.common.bean.web; import java.util.List; /** * ArrayData */ public class ArrayData<T> { private List<T> data; public List<T> getData() { return data; } public void setData(List<T> data) { this.data = data; } }
4587ae8f3874ddab543529588d554eb086c6c291
eee3d8434f02db9849cb1c0a9b5b8e0b209b158c
/src/com/kos/ktodo/DBHelper.java
5210040e404beed4bded748ee70b0ebd817a0421
[]
no_license
appCodeandroid/KTodo
cb5cc14514fa34fde64192484fb6fe17e20703ed
9a8bdfc58d3e9bf447cc19d43b9f1d7355397f37
refs/heads/master
2021-01-18T13:29:48.152077
2015-01-20T08:10:38
2015-01-20T08:10:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,646
java
package com.kos.ktodo; import android.content.ContentValues; import android.content.Context; import android.content.res.Resources; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; /** * SQLite helper. * * @author <a href="mailto:[email protected]">Konstantin Sobolev</a> */ public class DBHelper extends SQLiteOpenHelper { private static final String TAG = "DBHelper"; private static final String DB_NAME = "ktodo.db"; private static final int DB_VERSION = 7; public static final int ALL_TAGS_METATAG_ID = 1; public static final int UNFILED_METATAG_ID = 2; public static final String TAG_TABLE_NAME = "tag"; public static final String TAG_ID = "_id"; public static final String TAG_TAG = "tag"; public static final String TAG_ORDER = "tag_order"; //not visible anywhere. Used to make "All" first and "Unfiled" last public static final String TODO_TABLE_NAME = "todo"; public static final String TODO_ID = "_id"; public static final String TODO_TAG_ID = "tag_id"; public static final String TODO_DONE = "done"; public static final String TODO_SUMMARY = "summary"; public static final String TODO_BODY = "body"; public static final String TODO_PRIO = "prio"; public static final String TODO_PROGRESS = "progress"; public static final String TODO_DUE_DATE = "due_date"; public static final String TODO_CARET_POSITION = "caret_pos"; public static final String WIDGET_TABLE_NAME = "widget"; public static final String WIDGET_ID = "_id"; public static final String WIDGET_TAG_ID = "tag_id"; public static final String WIDGET_HIDE_COMPLETED = "hide_completed"; public static final String WIDGET_SHOW_ONLY_DUE = "show_only_due"; public static final String WIDGET_SHOW_ONLY_DUE_IN = "show_only_due_in"; public static final String WIDGET_SORTING_MODE = "sorting_mode"; public static final String WIDGET_CONFIGURED = "configured"; private static final String CREATE_TAG_TABLE = "create table if not exists " + TAG_TABLE_NAME + " (" + TAG_ID + " integer primary key autoincrement, " + TAG_ORDER + " integer default 10 not null, " + TAG_TAG + " text not null);"; private static final String CREATE_TODO_TABLE = "create table if not exists " + TODO_TABLE_NAME + " (" + TODO_ID + " integer primary key autoincrement, " + TODO_TAG_ID + " integer not null, " + TODO_DONE + " boolean not null, " + TODO_SUMMARY + " text not null, " + TODO_PRIO + " integer default 1 not null, " + TODO_PROGRESS + " integer default 0 not null, " + TODO_DUE_DATE + " integer null, " + TODO_BODY + " text null, " + TODO_CARET_POSITION + " integer default 0 null);"; private static final String CREATE_WIDGET_TABLE = "create table if not exists " + WIDGET_TABLE_NAME + " (" + WIDGET_ID + " integer primary key autoincrement, " + WIDGET_TAG_ID + " integer default 1 not null, " + WIDGET_CONFIGURED + " boolean default 0 not null, " + WIDGET_SHOW_ONLY_DUE + " boolean default 0 not null, " + WIDGET_SHOW_ONLY_DUE_IN + " integer default -1 not null, " + WIDGET_SORTING_MODE + " integer default " + TodoItemsSortingMode.PRIO_DUE_SUMMARY.ordinal() + " not null, " + WIDGET_HIDE_COMPLETED + " boolean default 1 not null);"; private final Context context; private boolean needToRecreateAllItems = false; public DBHelper(final Context context) { super(context, DB_NAME, null, DB_VERSION); this.context = context; } @Override public void onCreate(final SQLiteDatabase sqLiteDatabase) { sqLiteDatabase.execSQL(CREATE_TAG_TABLE); sqLiteDatabase.execSQL(CREATE_TODO_TABLE); sqLiteDatabase.execSQL(CREATE_WIDGET_TABLE); final ContentValues cv = new ContentValues(); cv.put(TAG_ID, ALL_TAGS_METATAG_ID); cv.put(TAG_TAG, context.getString(R.string.all_untranslated)); //will be localized in KTodo cv.put(TAG_ORDER, 1); sqLiteDatabase.insert(TAG_TABLE_NAME, null, cv); cv.put(TAG_ID, UNFILED_METATAG_ID); cv.put(TAG_TAG, context.getString(R.string.unfiled_untranslated)); //will be localized in KTodo cv.put(TAG_ORDER, 100); sqLiteDatabase.insert(TAG_TABLE_NAME, null, cv); final Resources r = context.getResources(); cv.clear(); cv.put(TODO_TAG_ID, UNFILED_METATAG_ID); cv.put(TODO_DONE, false); cv.put(TODO_SUMMARY, r.getString(R.string.help_summary)); cv.put(TODO_BODY, r.getString(R.string.help_body)); cv.put(TODO_PRIO, 1); cv.put(TODO_PROGRESS, 0); cv.putNull(TODO_DUE_DATE); sqLiteDatabase.insert(TODO_TABLE_NAME, null, cv); } @Override public void onUpgrade(final SQLiteDatabase sqLiteDatabase, final int oldv, final int newv) { Log.i(TAG, "onUpgrade: " + oldv + " -> " + newv); if (oldv == 1) sqLiteDatabase.execSQL("alter table " + TODO_TABLE_NAME + " add " + TODO_DUE_DATE + " integer null;"); if (oldv <= 2) sqLiteDatabase.execSQL(CREATE_WIDGET_TABLE); if (oldv == 3) sqLiteDatabase.execSQL("alter table " + WIDGET_TABLE_NAME + " add " + WIDGET_SORTING_MODE + " integer default " + TodoItemsSortingMode.PRIO_DUE_SUMMARY.ordinal() + " not null"); if (oldv <= 4) sqLiteDatabase.execSQL("alter table " + TODO_TABLE_NAME + " add " + TODO_CARET_POSITION + " integer default 0 null;"); if (oldv < 7) needToRecreateAllItems = true; } public boolean isNeedToRecreateAllItems() { return needToRecreateAllItems; } public void resetNeedToRecreateAllItems() { this.needToRecreateAllItems = false; } public static boolean isNullable(final String tableName, final String columnName) { //noinspection SimplifiableIfStatement if (TODO_TABLE_NAME.equals(tableName)) return TODO_DUE_DATE.equals(columnName) || TODO_BODY.equals(columnName) || TODO_CARET_POSITION.equals(columnName); return false; } }
97dce6b828679c14b681b5283a854893e604b3ee
f8b3a38ece5e93d9905d7fcedd3323f98c5758ca
/src/main/java/com/example/twu/controller/UserController.java
3ee4f92f9a1491ed2405ef577e975a2c149aa514
[]
no_license
DH-TB/twu-Biblioteca-spring
94ed8bbddcd3a4cef3a6af0fbfe842fd069f7bee
e7efabe2bbe478d4710e54df87859e7f41f03551
refs/heads/master
2020-03-29T13:44:48.628621
2018-09-24T16:44:32
2018-09-24T16:44:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,352
java
package com.example.twu.controller; import com.example.twu.entities.User; import com.example.twu.repository.UserRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/api") public class UserController { @Autowired private UserRepository userRepository; @PostMapping("/users") public ResponseEntity addUser(@RequestBody User user) { return new ResponseEntity<>(userRepository.addUser(user), HttpStatus.CREATED); } @GetMapping("/users") public ResponseEntity loginUser(@RequestParam(value = "name") String name, @RequestParam(value = "password") String password) { if(userRepository.loginUser(name, password)){ return new ResponseEntity<>("login success", HttpStatus.OK); } return new ResponseEntity<>("login fail", HttpStatus.UNAUTHORIZED); } @GetMapping("/user-info") public ResponseEntity getUserInfo() { User loggedUser = userRepository.getLoggedUser(); if(loggedUser == null) { return new ResponseEntity<>("please login first", HttpStatus.BAD_REQUEST); } return new ResponseEntity<>(loggedUser, HttpStatus.OK); } }
b01689f3545d1ea23a0bc2c6ebbde39a032211ad
12af86640321ec9e671bfeac477d8ce1a2fc4bbf
/src/main/java/com/wqg/blog/service/TypeService.java
7d260529a507c75b934c35f8ba69c17fbadaec5d
[]
no_license
EthanQG/myblog-jpa
23739481a511226a49879b3f9ebf852a36b76a4c
a2af1a1e6be3d69d43c64f9357f22604191985a5
refs/heads/master
2023-04-09T11:51:18.747179
2020-08-08T03:13:53
2020-08-08T03:13:53
269,990,320
1
0
null
2021-04-22T19:12:04
2020-06-06T13:30:58
JavaScript
UTF-8
Java
false
false
708
java
package com.wqg.blog.service; import com.wqg.blog.po.Type; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.util.List; /** * @Auther: wqg * @Description: */ public interface TypeService { //新增接口 Type saveType(Type type); //查询接口 Type getType(Long id); //分页查询 Page<Type> listType(Pageable pageable); //修改接口 Type updateType(Long id,Type type); //删除删除 void deleteType(Long id); //通过名称查询分类名 Type getTypeByName(String name); //获取所有分类 List<Type> listType(); //获取size条type List<Type> listTypeTop(Integer size); }
f4321755be2a97b1c99dd6205e0dccc87506c488
495059b852462a36f9d4b3e0a9fff0f1c1eb9805
/Core/src/main/java/caJava/core/extensions/ExtensionWrapper.java
095d5306938afc31dbade4cce478a9a826fa75df
[ "Apache-2.0" ]
permissive
svkreml/KrekerCA
15d97c14ed41bab43ef0165e15f5e9def569a9b5
9bba9f771410cc846ea04bef771a9dc0174bd83b
refs/heads/master
2020-03-21T23:31:06.460448
2019-05-07T14:32:15
2019-05-07T14:32:15
139,191,798
4
1
Apache-2.0
2018-11-20T22:40:50
2018-06-29T20:17:49
Java
UTF-8
Java
false
false
934
java
package caJava.core.extensions; import org.bouncycastle.asn1.ASN1Encodable; import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.asn1.x509.Extension; import java.io.IOException; import java.security.cert.X509Extension; public class ExtensionWrapper { ASN1ObjectIdentifier oid; boolean isCritical; ASN1Encodable value; public ExtensionWrapper(ASN1ObjectIdentifier oid, boolean isCritical, ASN1Encodable value) { this.oid = oid; this.isCritical = isCritical; this.value = value; } public ASN1ObjectIdentifier getOid() { return oid; } public boolean isCritical() { return isCritical; } public ASN1Encodable getValue() { return value; } public Extension getExtension() throws IOException { return new Extension(oid, isCritical, value.toASN1Primitive().getEncoded());//todo проверить } }
40c37ebf171f5c1bfd93f29dc71677f6a1d8930f
dffa93ff8398e9d1aa0fea63e361949f70441a4e
/Practice/src/com/example/stack/StackUsingLinkedList.java
692cebd02b8a83700a0767afcd622bdbb7429e58
[]
no_license
vishalkukkar/Data-Structure
98e9775d018bc7f9676d89e1674812bb52697b78
0af923f2a66c00d55225c0689b22cc61676bd559
refs/heads/master
2022-01-13T14:46:42.994612
2019-06-21T21:11:37
2019-06-21T21:11:37
102,991,877
0
0
null
null
null
null
UTF-8
Java
false
false
151
java
package com.example.stack; public class StackUsingLinkedList { public static void main(String[] args) { // TODO Auto-generated method stub } }
edd5ff1131c370c7c12fc4c5eca86da3ee5c0eba
4ad519019d2ebcfdee00a7094ca0d7e861f51366
/40.组合总和-ii.java
2573395c4c4f736769f447b33eb09e8e46a73df8
[]
no_license
amusement1234/LeetCode_Java
c69eab1c6db20dad8d4634efca98072408265008
e8feb787b32e53bc534f079ca55d6063be6847f6
refs/heads/master
2021-11-02T12:36:36.316074
2021-09-10T13:15:03
2021-09-10T13:15:03
216,771,913
0
0
null
null
null
null
UTF-8
Java
false
false
1,142
java
/* * @lc app=leetcode.cn id=40 lang=java * * [40] 组合总和 II */ // @lc code=start class Solution { public List<List<Integer>> combinationSum2(int[] candidates, int target) { int len = candidates.length; List<List<Integer>> res = new ArrayList<>(); if (len == 0) { return res; } Arrays.sort(candidates); Deque<Integer> path = new ArrayDeque<>(len); dfs(candidates, len, 0, target, path, res); return res; } private void dfs(int[] candidates, int len, int begin, int target, Deque<Integer> path, List<List<Integer>> res) { if (target == 0) { res.add(new ArrayList<>(path)); return; } for (int i = begin; i < len; i++) { if (target - candidates[i] < 0) { break; } if (i > begin && candidates[i] == candidates[i - 1]) { continue; } path.addLast(candidates[i]); dfs(candidates, len, i + 1, target - candidates[i], path, res); path.removeLast(); } } } // @lc code=end
5c6d685cce2dad45a3c143601a52c9534ea415ef
e2151990aeac2d9ceb3df6f7573961fe1aacfff1
/src/test/java/com/dudii/tz/TzApplicationTests.java
af3d1a29ec8a1cf51b48c654a4414418c4ed0122
[]
no_license
Yuliasik/TypicalTask-MedicalCards
d4d270a6f9ef9fb526001a93d389c305edec686b
ed7e7987134a229fb2deea6316bbced524720720
refs/heads/master
2023-07-09T18:03:44.016342
2021-08-06T11:24:25
2021-08-06T11:24:25
385,420,882
0
0
null
null
null
null
UTF-8
Java
false
false
209
java
package com.dudii.tz; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class TzApplicationTests { @Test void contextLoads() { } }
49dbc1dcf81ab6ca597bc5ad453ed010b81e0d94
c6479c5e410edf461e98d76532c64b7d50aadbc4
/app/src/main/java/com/freak/android/getpricturedemo/MainActivity.java
ecf9b271e92cbf99e8dd79411b38f141378c5fbf
[]
no_license
freakcsh/GetPrictureDemo
ed22c2dbf559d0d297edac96d9f2804d523d81ba
3aa4eb3c80ff9745b1f40e03587eed51e4fa3b50
refs/heads/master
2020-03-22T17:19:26.062523
2018-07-10T06:40:26
2018-07-10T06:40:26
140,388,420
0
0
null
null
null
null
UTF-8
Java
false
false
3,641
java
package com.freak.android.getpricturedemo; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.ImageView; import java.io.File; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity { private Button btn_select; private ImageView img_text; private File userImgFile; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); btn_select = findViewById(R.id.btn_select); img_text = findViewById(R.id.img_text); btn_select.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { selectImgPop(); } }); } public void selectImgPop() { PopupGetPictureView popupGetPictureView = new PopupGetPictureView(this, new PopupGetPictureView.GetPicture() { @Override public void takePhoto(View v) { if (PermissionUtils.checkTakePhotoPermission(MainActivity.this)) { userImgFile = GetPictureUtils.takePicture(MainActivity.this, IETConstant.GETPICTURE_TAKEPHOTO); } } @Override public void selectPhoto(View v) { if (PermissionUtils.checkAlbumStroagePermission(MainActivity.this)) { GetPictureUtils.selectPhoto(MainActivity.this, IETConstant.GETPICTURE_SELECTPHOTO); } } }); popupGetPictureView.showPop(btn_select); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == 0) { return; } switch (requestCode) { //拍照 case IETConstant.GETPICTURE_TAKEPHOTO: userImgFile = GetPictureUtils.cutPicture(MainActivity.this, userImgFile); break; //选择照片 case IETConstant.GETPICTURE_SELECTPHOTO: userImgFile = GetPictureUtils.getPhotoFromIntent(data, MainActivity.this); userImgFile = GetPictureUtils.cutPicture(MainActivity.this, userImgFile); break; //裁剪照片 case IETConstant.CUT_PHOTO: if (resultCode == Activity.RESULT_OK) { compressAndcommitImg(userImgFile); } break; default: break; } } public void compressAndcommitImg(File file) { List<File> list = new ArrayList<>(); list.add(file); BitmapUtil.compressFiles(list, new BitmapUtil.CompressImageResponse() { @Override public void onSuccess(List<File> imgs) { File imgFile = imgs.get(0); Uri uri = Uri.fromFile(imgFile); img_text.setImageURI(uri); } @Override public void onDo() { // showLoading(view.getMContext()); } @Override public void onFail() { } @Override public void onFinish() { } }); } }
c5328933ae14cc7fc6479b9802ab157c172c907b
9d2809ee4669e3701884d334c227c68a24c5787f
/marketingcenter/marketing-core/src/main/java/com/mockuai/marketingcenter/core/service/action/coupon/GrantActivityCouponBatchAction.java
abc87f75de6da4cabf3a37a7fffdfdecba2103f8
[]
no_license
vinfai/hy_project
5370367876fe6bcb4109f2af9391b9d817c320b5
8fd99f23cf83b1b3f7bec9560fbd2edc46621d0b
refs/heads/master
2021-01-19T00:58:26.436196
2017-03-01T16:47:22
2017-03-01T16:49:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,311
java
//package com.mockuai.marketingcenter.core.service.action.coupon; // //import com.mockuai.marketingcenter.common.api.MarketingResponse; //import com.mockuai.marketingcenter.common.constant.ActionEnum; //import com.mockuai.marketingcenter.common.constant.ActivityCouponStatus; //import com.mockuai.marketingcenter.common.constant.CouponType; //import com.mockuai.marketingcenter.common.constant.ResponseCode; //import com.mockuai.marketingcenter.common.constant.UserCouponStatus; //import com.mockuai.marketingcenter.common.domain.dto.GrantCouponInfoDTO; //import com.mockuai.marketingcenter.common.domain.qto.GrantedCouponQTO; //import com.mockuai.marketingcenter.core.domain.ActivityCouponDO; //import com.mockuai.marketingcenter.core.domain.GrantedCouponDO; //import com.mockuai.marketingcenter.core.domain.MarketActivityDO; //import com.mockuai.marketingcenter.core.exception.MarketingException; //import com.mockuai.marketingcenter.core.manager.ActivityCouponManager; //import com.mockuai.marketingcenter.core.manager.GrantedCouponManager; //import com.mockuai.marketingcenter.core.manager.MarketActivityManager; //import com.mockuai.marketingcenter.core.service.RequestContext; //import com.mockuai.marketingcenter.core.service.action.TransAction; //import org.apache.commons.lang3.time.DateUtils; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.stereotype.Controller; // //import java.util.ArrayList; //import java.util.Date; //import java.util.List; // ///** // * Created by edgar.zr on 7/15/2016. // */ //@Controller //public class GrantActivityCouponBatchAction extends TransAction { // // @Autowired // private MarketActivityManager marketActivityManager; // @Autowired // private ActivityCouponManager activityCouponManager; // @Autowired // private GrantedCouponManager grantedCouponManager; // // @Override // protected MarketingResponse doTransaction(RequestContext context) throws MarketingException { // // List<GrantCouponInfoDTO> grantCouponInfoDTOs = (List<GrantCouponInfoDTO>) context.getRequest().getParam("grantCouponInfoDTOs"); // String bizCode = (String) context.get("bizCode"); // // ActivityCouponDO activityCouponDO = activityCouponManager.getActivityCoupon(activityCouponId, null, bizCode); // // if (activityCouponDO.getCouponType().intValue() != CouponType.TYPE_NO_CODE.getValue()) // return new MarketingResponse(ResponseCode.BIZ_E_NOT_THE_SAME_COUPON_TYPE); // // // 失效的优惠券 // if (activityCouponDO.getStatus().intValue() == ActivityCouponStatus.INVALID.getValue().intValue()) { // LOGGER.error("can not grant the activity coupon because of valid status of the coupon, activityCouponId : {}", // activityCouponId); // return new MarketingResponse(ResponseCode.BIZ_E_ACTIVITY_COUPON_STATUS_ILLEGAL); // } // // MarketActivityDO marketActivityDO = // marketActivityManager.getActivity(activityCouponDO.getActivityId().longValue(), bizCode); // // Date now = new Date(); // if ((now.compareTo(marketActivityDO.getEndTime()) > 0)) { // return new MarketingResponse(ResponseCode.BIZ_ACTIVITY_COUPON_OVER); // } // // // TODO 判断当前优惠券数量以及发放优惠券需要放到一个事务中处理,避免多个用户争取同一个优惠券的时候出现问题, // // 发放量不能超过总量 // if (activityCouponDO.getTotalCount().longValue() != -1 // && activityCouponDO.getGrantedCount().longValue() + num > activityCouponDO.getTotalCount().longValue()) { // return new MarketingResponse(ResponseCode.NO_ENOUGH_COUPON); // } // // // 每个用户的领取不能超过单人限量 // GrantedCouponQTO grantedCouponQTO = new GrantedCouponQTO(); // grantedCouponQTO.setCouponId(activityCouponDO.getId()); // grantedCouponQTO.setReceiverId(receiverId); // // // 查询所有的该用户在指定优惠券下领的数量,不区分优惠券的状态 // Integer countOfReceived = grantedCouponManager.queryGrantedCouponCount(grantedCouponQTO); // // if (activityCouponDO.getUserReceiveLimit().intValue() != 0 // && countOfReceived.intValue() >= activityCouponDO.getUserReceiveLimit().intValue()) { // return new MarketingResponse(ResponseCode.ACTIVITY_COUPON_RECEIVED_OUT_OF_LIMIT); // } // // grantCoupon(receiverId, num, activityCouponDO, bizCode, marketActivityDO); // // int opNum = activityCouponManager.increaseGrantedCount( // activityCouponId.longValue(), activityCouponDO.getActivityCreatorId(), num); // // if (opNum < 1) { // LOGGER.error("error of increaseGrantedCount, activityCountId : {}, creatorId : {}, num : {}", // activityCouponId, 0, num); // return new MarketingResponse(ResponseCode.SERVICE_EXCEPTION); // } // // activityCouponManager.increaseUserCountOfGranted(activityCouponId, receiverId, bizCode); // // return null; // } // private void grantCoupon(Long userId, Integer count, ActivityCouponDO activityCouponDO, // String bizCode, MarketActivityDO marketActivityDO) throws MarketingException { // // List grantedCouponList = new ArrayList(); // Date invalidTime = activityCouponDO.getValidDuration() != null // ? DateUtils.addDays(new Date(), activityCouponDO.getValidDuration()) : null; // for (int i = 0; i < count; i++) { // GrantedCouponDO grantedCoupon = new GrantedCouponDO(); // grantedCoupon.setCouponId(activityCouponDO.getId()); // grantedCoupon.setCouponCreatorId(marketActivityDO.getCreatorId()); // grantedCoupon.setGranterId(marketActivityDO.getCreatorId()); // grantedCoupon.setReceiverId(userId); // grantedCoupon.setStatus(UserCouponStatus.UN_USE.getValue()); // grantedCoupon.setActivityId(activityCouponDO.getActivityId()); // grantedCoupon.setActivityCreatorId(activityCouponDO.getActivityCreatorId()); // grantedCoupon.setEndTime(marketActivityDO.getEndTime()); // grantedCoupon.setStartTime(marketActivityDO.getStartTime()); // grantedCoupon.setBizCode(bizCode); // grantedCoupon.setToolCode(marketActivityDO.getToolCode()); // grantedCoupon.setInvalidTime(invalidTime); // grantedCouponList.add(grantedCoupon); // } // // grantedCouponManager.batchAddGrantedCoupon(grantedCouponList); // } // @Override // public String getName() { // return ActionEnum.GRANT_ACTIVITY_COUPON_BATCH.getActionName(); // } //}
03526fafdc2a4a0735e93aeff21e2f504805b8ac
ec03fbe4eaf712ed61bd46ef1b00a8c692aa343d
/buttonlistener/Interface/src/Viewer.java
c6e072afe228e1050da21051305a0f8be8919c8a
[]
no_license
michaeldrews7/CS176L01
3f24aee5c1052e40924e59aa95798b28ad75a2c1
59e4abba549885c8dc548a1099c7344c89e922bf
refs/heads/master
2020-12-22T01:21:32.313938
2020-04-29T21:13:57
2020-04-29T21:13:57
236,628,778
0
0
null
null
null
null
UTF-8
Java
false
false
2,704
java
import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import java.util.Scanner; /** This program demonstrates how an action listener can be used to trigger a variable from a surrounding block. */ public class Viewer { private static final int FRAME_WIDTH = 240; private static final int FRAME_HEIGHT = 120; public static void main(String[] args) { Scanner in = new Scanner(System.in); Measurable[] accounts = new Measurable[3]; accounts[0] = new BankAccount(0); accounts[1] = new BankAccount(10000); accounts[2] = new BankAccount(2000); Measurable[] countries = new Measurable[3]; countries[0] = new Country("Uruguay", 176220); countries[1] = new Country("Thailand", 513120); countries[2] = new Country("Belgium", 30510); Measurable[] scores = new Measurable[5]; scores[0] = new Quiz("Joe", 60); scores[1] = new Quiz("Sally", 90); scores[2] = new Quiz("Jane", 100); scores[3] = new Quiz("Billy", 85); scores[4] = new Quiz("Sue", 75); System.out.print("Enter metric to use, 1 for maximum, 2 for minimum, 3 for average: "); int whichMetric = in.nextInt(); String metricToUse="average"; if (whichMetric == 1) {metricToUse = "Maximum";} if (whichMetric == 2) {metricToUse = "Minimum";} if (whichMetric == 3) {metricToUse = "Average";} //Create frame and panel where buttons will be shown JPanel panel = new JPanel(); JFrame frame = new JFrame(); frame.add(panel); //Create button and listener for BankAccount JButton button = new JButton("Get " + metricToUse + " Balance"); panel.add(button); frame.add(panel); ActionListener listener = new ButtonListener(accounts,metricToUse); button.addActionListener(listener); //Create button and listener for Country JButton button2 = new JButton("Get " + metricToUse + " Area"); panel.add(button2); ActionListener listener2 = new ButtonListener(countries,metricToUse); button2.addActionListener(listener2); //Create button and listener for Quiz JButton button3 = new JButton("Get " + metricToUse + " Score"); panel.add(button3); ActionListener listener3 = new ButtonListener(scores,metricToUse); button3.addActionListener(listener3); //Now display frame with buttons frame.setSize(FRAME_WIDTH, FRAME_HEIGHT); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }
f81889194c486c358cb12e132806283ee98bde81
d67c5538c5fad6c8d1c8406a49d2c1b6b264dbf7
/onlinebackend/src/test/java/com/rjs/onlinebackend/AppTest.java
8cedeeddd7212640c518bcd173c9efda7e81780f
[]
no_license
rajesh8297/online-shoppin
a154cb477733826a2a357277ed6c57918cbff6ae
0ab9fbb1450346b440dfe0432297f29519e2cefb
refs/heads/master
2020-03-20T20:56:40.942013
2018-06-28T04:56:00
2018-06-28T04:56:00
137,715,609
0
0
null
null
null
null
UTF-8
Java
false
false
687
java
package com.rjs.onlinebackend; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
9b383c00bdde2b1d1e7f6d36d9bc2c09e10061ec
2a49d54a9a0dc1e892cd5d1b5bc2056839e78adb
/src/main/java/com/pushkar/exercise1/Exercise1Application.java
7f32745869cca387724bdc9b5c3183cba811d7e0
[]
no_license
pushkar-saraf/Spring-Exercise1
4db2d2dc10b6e50555b3d7eefef119c1e3646d6b
0e52d9e9ee9525192a1be9e31e0fdc365f64bbfc
refs/heads/master
2020-08-16T05:28:33.092591
2019-10-16T05:02:30
2019-10-16T05:02:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
330
java
package com.pushkar.exercise1; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Exercise1Application { public static void main(String[] args) { SpringApplication.run(Exercise1Application.class, args); } }
ff1d8d8bb41b5405fba45c12a53abf8ca92ed76c
884f85db711b4992fa04c968daac2c20f02ea170
/mySolutions/1167. Minimum Cost to Connect Sticks/1167. Minimum Cost to Connect Sticks.java
6574977ec933621a532079d718593b4dbb6d2308
[]
no_license
brandonhyc/note_collection
32bfcc4f2f81386f60f5ce49cea2c15554d5305f
c2fbf457d5da366c67c7a1f17fb2be9b2833d441
refs/heads/master
2023-08-28T03:41:36.356702
2021-10-23T19:05:16
2021-10-23T19:05:16
113,705,752
0
0
null
null
null
null
UTF-8
Java
false
false
521
java
class Solution { public int connectSticks(int[] sticks) { PriorityQueue<Integer> minheap = new PriorityQueue<>(); for (int num : sticks) { minheap.offer(num); } int total = 0; while (minheap.size() >= 2) { int num1 = minheap.poll(); int num2 = minheap.poll(); int sum = num1 + num2; minheap.offer(sum); total += sum; } return total; } }
3e00e1369edbf99ec7e6a375cd8605e5e2c3f57e
e4aea93f2988e2cf1be4f96a39f6cc3328cbbd50
/src/org/agilemore/agilegrid/a/i.java
49b07cfa7ec5f8c1e45634e961e92d49efe66b19
[]
no_license
lannerate/ruleBuilder
18116282ae55e9d56e9eb45d483520f90db4a1a6
b5d87495990aa1988adf026366e92f7cbb579b19
refs/heads/master
2016-09-05T09:13:43.879603
2013-11-10T08:32:58
2013-11-10T08:32:58
14,231,127
0
1
null
null
null
null
UTF-8
Java
false
false
458
java
package org.agilemore.agilegrid.a; import org.eclipse.swt.events.KeyAdapter; import org.eclipse.swt.events.KeyEvent; class i extends KeyAdapter { i(g paramg) { } public void keyReleased(KeyEvent paramKeyEvent) { if (paramKeyEvent.character == '\033') g.d(this.a); } } /* Location: D:\Dev_tools\ruleEngine\rbuilder.jar * Qualified Name: org.agilemore.agilegrid.a.i * JD-Core Version: 0.6.0 */
288d93327039d013679dce632df63a281f74119e
7f017ee1ba2bdd433494d37095bfd32d86cb2d3c
/MainConcepts/src/main/java/Abstraction/Abstraction.java
d8e3ead17181ffc0482fb7f44955631cc60a4afe
[]
no_license
mveeprojects/Java
86e7b86254c62d42088559c4196752565d6f7468
559f16a6a14f425b73e810339d41ae0f669ad030
refs/heads/master
2022-10-31T20:58:00.817342
2022-10-07T08:34:12
2022-10-07T08:34:12
131,760,176
0
0
null
2022-10-07T08:34:13
2018-05-01T20:32:26
Java
UTF-8
Java
false
false
823
java
package Abstraction; public class Abstraction { public Abstraction(){ System.out.println("\nAbstraction:\n"); useMountainBike(); useRoadBike(); } private void useMountainBike() { MountainBike mountainBike = new MountainBike(); mountainBike.printBikeBrand("Boardman"); mountainBike.bikeModelName("Comp 650b"); mountainBike.setNumofgears(12); System.out.println("Number of gears: " + mountainBike.getNumofgears() + "\n"); } private void useRoadBike() { RoadBike roadBike = new RoadBike(); roadBike.printBikeBrand(); roadBike.printBikeBrand("Raleigh"); roadBike.bikeModelName("Falcon"); roadBike.setNumofgears(24); System.out.println("Number of gears: " + roadBike.getNumofgears()); } }
6621f860751c924dfcac538d56a55508d376ab70
923149d72b9e1453f92b32e7799640ce88657632
/src_code/Demo20210206.java
1a66ae3ff25f9d49dab036d99340f1b397fcd775
[]
no_license
xiaodong-a/Java_DataStructure
d293a7501ae7cc25fb6e86b29ccaabcd0aae9b1e
f274b43a1391d788d84500d5680d5cd04f11604b
refs/heads/main
2023-03-21T04:47:58.075597
2021-03-10T10:09:51
2021-03-10T10:09:51
312,820,329
0
0
null
null
null
null
UTF-8
Java
false
false
18,327
java
package com.xdwang; import org.junit.Test; import javax.sound.midi.Soundbank; import java.math.BigInteger; import java.util.*; import java.util.concurrent.CountDownLatch; /** * @author xdwang * @create 2021-02-06 8:56 */ public class Demo20210206 { //40 public void FindNumsAppearOnce(int[] array, int num1[], int num2[]) { int n = 0; for (int i = 0; i < array.length; i++) { n ^= array[i]; } // n = n ^ (n - 1); // n = (n >> 1) + 1; n &= (-n); num1[0] = 0; num2[0] = 0; for (int i = 0; i < array.length; i++) { if ((array[i] & n) == 0) { num1[0] ^= array[i]; } else { num2[0] ^= array[i]; } } } //哈希法 public void FindNumsAppearOnce2(int[] array, int num1[], int num2[]) { HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(); for (int i = 0; i < array.length; i++) { if (map.get(array[i]) == null) { map.put(array[i], 1); } else { map.put(array[i], 2); } } int i = 0; for (; i < array.length; i++) { if (map.get(array[i]) == 1) { num1[0] = array[i]; break; } } i = i + 1; for (; i < array.length; i++) { if ((int) map.get(array[i]) == 1) { num2[0] = array[i]; break; } } } @Test public void test1() { int[] array = new int[]{2, 4, 3, 6, 3, 2, 5, 5}; int[] n1 = new int[1]; int[] n2 = new int[1]; FindNumsAppearOnce(array, n1, n2); System.out.println(n1[0]); System.out.println(n2[0]); } public ArrayList<ArrayList<Integer>> FindContinuousSequence(int sum) { ArrayList<ArrayList<Integer>> ress = new ArrayList<>(); ArrayList<Integer> res = new ArrayList<>(); if (sum < 3) return ress; int target = 0; for (int i = 1, j = 1; i < (sum + 1) >> 1; ) { if (target <= sum) { if (target == sum) ress.add(new ArrayList<>(res)); target += j; res.add(j++); } else if (target > sum) { target -= i++; res.remove(0); } } return ress; } //利用等差数列的求和公式 public ArrayList<ArrayList<Integer>> FindContinuousSequence2(int sum) { ArrayList<ArrayList<Integer>> ress = new ArrayList<>(); if (sum < 3) return ress; int num = (int) Math.sqrt(2 * sum); for (int i = num; i >= 2; i--) { int temp = (i - 1) * i / 2; if ((sum - temp) % i != 0) continue; int first = (sum - temp) / i; ArrayList<Integer> list = new ArrayList<>(); for (int j = 0; j < i; j++) { list.add(first + j); } ress.add(list); } return ress; } //42 public ArrayList<Integer> FindNumbersWithSum(int[] array, int sum) { ArrayList<Integer> res = new ArrayList<>(); if (array == null || array.length < 2) return res; for (int i = 0, j = array.length - 1; i < j; ) { int s = array[i] + array[j]; if (s == sum) { res.add(array[i]); res.add(array[j]); break; } else if (s > sum) j--; else i++; } return res; } public ArrayList<Integer> FindNumbersWithSum2(int[] array, int sum) { ArrayList<Integer> res = new ArrayList<>(); if (array == null || array.length < 2) return res; for (int i = 0, j = array.length - 1; i < j; ) { int s = array[i] + array[j]; if (s == sum) { if (res.size() == 0) { res.add(array[i]); res.add(array[j]); } else { res.set(0, array[i]); res.set(1, array[j]); } i++; j--; } else if (s > sum) { j--; } else i++; } return res; } //43 public String LeftRotateString(String str, int n) { if (str == null || str.length() == 0) return str; n = n % str.length(); return str.substring(n, str.length()) + str.substring(0, n); } public String ReverseSentence(String str) { StringBuffer str1 = new StringBuffer(); int j = str.length(); for (int i = str.length() - 1; i >= 0; i--) { if (' ' == str.charAt(i)) { str1.append(str.substring(i + 1, j)); str1.append(" "); j = i; } } str1.append(str.substring(0, j)); return str1.toString(); } //45 public boolean IsContinuous(int[] numbers) { if (numbers == null || numbers.length != 5) return false; int count0 = 0; Arrays.sort(numbers); for (; count0 < numbers.length; count0++) { if (numbers[count0] != 0) break; } int loc = count0 + 1; for (; loc < numbers.length; loc++) { if (numbers[loc] == numbers[loc - 1]) return false; count0 = count0 - (numbers[loc] - numbers[loc - 1] - 1); } if (count0 < 0) return false; return true; } public boolean IsContinuous2(int[] numbers) { if (numbers == null || numbers.length < 5) return false; Arrays.sort(numbers); int i = 0; for (; i < numbers.length; i++) { if (numbers[i] > 0) break; } if (numbers[numbers.length - 1] - numbers[i] >= 5) return false; for (; i < numbers.length - 1; i++) { if (numbers[i] == numbers[i + 1]) return false; } return true; } @Test public void test2() { ArrayList<Integer> res = new ArrayList<>(); res.add(0, 1); } //46 public int LastRemaining_Solution(int n, int m) { if (n < 1 || m < 1) return -1; int res = 0; for (int i = 2; i <= n; i++) { res = (res + m) % i; } return res; } //47 public int Sum_Solution(int n) { boolean x = (n > 1 && (n += Sum_Solution(n - 1)) != 0); return n; } //48 public int Add(int num1, int num2) { while (num2 != 0) { int c = (num1 & num2) << 1; num1 = num1 ^ num2; num2 = c; } return num1; } //49 public int StrToInt(String str) { if (str == null || str.length() == 0) return 0; int flag = 1; if (str.charAt(0) == '-') flag = -1; int begin = 0; if (str.charAt(0) == '-' || str.charAt(0) == '+') begin = 1; int res = 0; for (; begin < str.length(); begin++) { int n = str.charAt(begin) - '0'; if (n < 0 || n > 9) return 0; res = res * 10 + n; } return res * flag; } //50 public boolean duplicate(int numbers[], int length, int[] duplication) { if (length < 2) return false; int[] arr = new int[length]; for (int i = 0; i < numbers.length; i++) { arr[numbers[i]]++; if (arr[numbers[i]] > 1) { duplication[0] = numbers[i]; return true; } } return false; } //51 public int[] multiply(int[] A) { int len = A.length; int[] left = new int[len]; int[] right = new int[len]; left[0] = 1; right[len - 1] = 1; for (int i = 1; i < len; i++) { left[i] = A[i - 1] * left[i - 1]; right[len - 1 - i] = A[len - i] * right[len - i]; } for (int i = 0; i < len; i++) { left[i] = left[i] * right[i]; } return left; } //52 public boolean match(char[] str, char[] pattern) { if (str == null || pattern == null) return false; return match2(str, 0, pattern, 0); } public boolean match2(char[] str, int ss, char[] pattern, int sp) { if (ss == str.length && sp == pattern.length) return true; if (sp < pattern.length - 1 && pattern[sp + 1] == '*') { if ((ss < str.length && str[ss] == pattern[sp]) || (ss < str.length && pattern[sp] == '.')) { return match2(str, ss + 1, pattern, sp + 2) || match2(str, ss, pattern, sp + 2) || match2(str, ss + 1, pattern, sp); } return match2(str, ss, pattern, sp + 2); } else { if (ss == str.length || sp == pattern.length) return false; if (str[ss] == pattern[sp] || pattern[sp] == '.') return match2(str, ss + 1, pattern, sp + 1); return false; } } // public boolean match(char[] str, char[] pattern) { // if (str == null || pattern == null) return false; // int strs = 0; // int pats = 0; // return match2(str, strs, pattern, pats); // } // // public boolean match2(char[] str, int strs, char[] pattern, int pats) { // if (str.length == strs && pattern.length == pats) { // return true; // } // if(pats+1<pattern.length && pattern[pats+1]=='*'){ // if(strs!=str.length && (pattern[pats]=='.' || str[strs]==pattern[pats])){ // return match2(str,strs+1,pattern,pats) || match2(str,strs,pattern,pats+2) ||match2(str,strs+1,pattern,pats+2); // }else{ // return match2(str,strs,pattern,pats+2); // } // }else{ // if(strs!=str.length && pats!=pattern.length && (pattern[pats]==str[strs]||pattern[pats]=='.')){ // return match2(str,strs+1,pattern,pats+1); // }else{ // return false; // } // } // } //53 public boolean isNumeric(char[] str) { if (str == null || str.length == 0) return false; boolean flage = false; //e 是否出现过 boolean flagpoint = false; // . 是否出现过 boolean preNum = false; //是否出现过数字 for (int i = 0; i < str.length; i++) { char c = str[i]; if (c >= '0' && c <= '9') { preNum = true; } else if (c == '.' && !flagpoint) { flagpoint = true; } else if ((c == 'E' || c == 'e') && !flage && preNum && i != str.length - 1) { flage = true; flagpoint = true; } else if ((c == '+' || c == '-') && (i == 0 || str[i - 1] == 'e' || str[i - 1] == 'E') && i != str.length - 1) { continue; } else return false; } if (preNum) return true; return false; } @Test public void test4() { String a = "ad "; } HashMap<Character, Integer> hashMap = new HashMap<>(); Queue<Character> queue = new LinkedList<>(); //Insert one char from stringstream public void Insert(char ch) { if (hashMap.get(ch) == null) { hashMap.put(ch, 1); queue.add(ch); } else { hashMap.put(ch, 2); } } //return the first appearence once char in current stringstream public char FirstAppearingOnce() { while (!queue.isEmpty()) { char c = queue.peek(); if (hashMap.get(c) == 1) return c; queue.poll(); } return '#'; } //55 public ListNode EntryNodeOfLoop(ListNode pHead) { if (pHead == null || pHead.next == null) return null; ListNode fast = pHead.next; ListNode slow = pHead; while (fast != slow) { if (fast.next == null || fast.next.next == null) return null; fast = fast.next.next; slow = slow.next; } fast = pHead; slow = slow.next; while (fast != slow) { fast = fast.next; slow = slow.next; } return fast; } //哈希法 public ListNode EntryNodeOfLoop2(ListNode pHead) { ListNode res = null; HashMap<ListNode, Integer> map = new HashMap<ListNode, Integer>(); while (pHead != null) { if (map.get(pHead) != null) return pHead; map.put(pHead, 1); pHead = pHead.next; } return res; } //56 public ListNode deleteDuplication(ListNode pHead) { if (pHead == null) return null; ListNode head = new ListNode(0); head.next = pHead; ListNode pre = head; while (pHead != null) { while (pHead.next != null && pHead.val == pHead.next.val) pHead = pHead.next; if (pre.next == pHead) { pre = pHead; pHead = pHead.next; } else { pHead = pHead.next; pre.next = pHead; } } return head.next; } //57、 class TreeLinkNode { int val; TreeLinkNode left = null; TreeLinkNode right = null; TreeLinkNode next = null; TreeLinkNode(int val) { this.val = val; } } public TreeLinkNode GetNext(TreeLinkNode pNode) { TreeLinkNode res = null; if (pNode == null) return res; if (pNode.right != null) { res = pNode.right; while (res.left != null) res = res.left; return res; } res = pNode.next; while (res != null) { if (res.left == pNode) return res; pNode = res; res = res.next; } return null; } //好像这个更快点 public TreeLinkNode GetNext2(TreeLinkNode pNode) { if (pNode == null) return null; if (pNode.right != null) { pNode = pNode.right; while (pNode.left != null) pNode = pNode.left; return pNode; } while (pNode.next != null && pNode.next.right == pNode) { pNode = pNode.next; } if (pNode.next == null) return null; return pNode.next; } //58 递归 boolean isSymmetrical(TreeNode pRoot) { if (pRoot == null) return true; return isSymmertical2(pRoot.left, pRoot.right); } boolean isSymmertical2(TreeNode left, TreeNode right) { if (left == null && right == null) return true; if (left == null || right == null || left.val != right.val) return false; return isSymmertical2(left.left, right.right) && isSymmertical2(left.right, right.left); } // 非递归,左子树逆先序, 右子树先序 boolean isSymmetrical_2(TreeNode pRoot) { Stack<TreeNode> integerStack1 = new Stack<>(); Stack<TreeNode> integerStack2 = new Stack<>(); if (pRoot != null) { integerStack1.add(pRoot); integerStack2.add(pRoot); } while (!integerStack1.empty()) { TreeNode num1 = integerStack1.pop(); TreeNode num2 = integerStack2.pop(); if (num1.val != num2.val) return false; if (num1.left != null || num2.right != null) { if (num1.left == null || num2.right == null) return false; integerStack1.add(num1.left); integerStack2.add(num2.right); } if (num1.right != null || num2.left != null) { if (num1.right == null || num2.left == null) return false; integerStack1.add(num1.right); integerStack2.add(num2.left); } } return true; } //59 public ArrayList<ArrayList<Integer>> Print(TreeNode pRoot) { ArrayList<ArrayList<Integer>> result = new ArrayList<>(); if (pRoot == null) return result; Stack<TreeNode> stack1 = new Stack<TreeNode>(); Stack<TreeNode> stack2 = new Stack<TreeNode>(); stack1.add(pRoot); while (!stack1.empty()) { ArrayList<Integer> line = new ArrayList<Integer>(); while (!stack1.empty()) { TreeNode treenode = stack1.pop(); line.add(treenode.val); if (treenode.left != null) stack2.add(treenode.left); if (treenode.right != null) stack2.add(treenode.right); } if (line.size() == 0) return result; result.add(line); line = new ArrayList<Integer>(); while (!stack2.empty()) { TreeNode treenode = stack2.pop(); line.add(treenode.val); if (treenode.right != null) stack1.add(treenode.right); if (treenode.left != null) stack1.add(treenode.left); } if (line.size() == 0) return result; result.add(line); } return result; } //60 public ArrayList<ArrayList<Integer>> Print60(TreeNode pRoot) { ArrayList<ArrayList<Integer>> res = new ArrayList<>(); if (pRoot == null) return res; LinkedList<TreeNode> queue = new LinkedList<>(); queue.add(pRoot); while (!queue.isEmpty()){ ArrayList<Integer> list = new ArrayList<>(); int size = queue.size(); while (size-->0){ pRoot = queue.poll(); list.add(pRoot.val); if (pRoot.left != null) queue.add(pRoot.left); if (pRoot.right != null) queue.add(pRoot.right); } res.add(list); } return res; } }
d6df94f65e24fc13d5f0a83c51d2a57dd686e865
845fd286f717cb85400a6f77bb6242c2317952e9
/app/src/main/java/com/secure/pricekey/graph.java
e0b3324fa2f454a53f5840b996f2c188ea364ba4
[]
no_license
SatyamSoni23/Price-Key
5858b8c69b4ef645252bf792557412bcad50023d
06ecbec21446f6b3e40d2503249964937a5b64a6
refs/heads/master
2023-07-15T08:23:26.764884
2021-08-19T11:08:05
2021-08-19T11:08:05
397,680,992
2
0
null
null
null
null
UTF-8
Java
false
false
328
java
package com.secure.pricekey; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class graph extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_graph); } }
717229dfd654c4bd15fadd3de4a7b16acf624734
eb82eceff14ab180af3e98b13a61a1aefa74a4df
/app/src/main/java/com/codepath/apps/restclienttemplate/TweetsAdapter.java
2b712d3144a497e1b585a2319dbf4e18d8fb6993
[ "Apache-2.0", "MIT" ]
permissive
SDOsmany/SimpleTweet
8b89ba20d72a0e314f39f11f18448ac481383f54
77de3fc27bb5d72392c3dcf751dd80857a12eb0f
refs/heads/main
2023-08-11T05:11:08.529031
2021-09-27T03:13:06
2021-09-27T03:13:06
408,222,668
0
0
null
null
null
null
UTF-8
Java
false
false
2,641
java
package com.codepath.apps.restclienttemplate; import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.bumptech.glide.Glide; import com.codepath.apps.restclienttemplate.models.Tweet; import java.util.List; public class TweetsAdapter extends RecyclerView.Adapter<TweetsAdapter.ViewHolder>{ Context context; List<Tweet> tweets; public TweetsAdapter (Context context, List<Tweet> tweets){ this.context = context; this.tweets = tweets; } //For each row, inflate the layout @NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(context).inflate(R.layout.item_tweet, parent, false); return new ViewHolder(view); //Pass in the context and list of tweets; } //Bind values based on the position of the element @Override public void onBindViewHolder(@NonNull ViewHolder holder, int position) { //Get the data at position Tweet tweet = tweets.get(position); //Bind tweet with view holder holder.bind(tweet); } @Override public int getItemCount() { return tweets.size(); } //clean all the elements of the recycler public void clear(){ tweets.clear(); notifyDataSetChanged(); } //add a list of items public void addAll(List<Tweet> tweetList){ tweets.addAll(tweetList); notifyDataSetChanged(); } //Define a viewholder public class ViewHolder extends RecyclerView.ViewHolder{ ImageView ivProfileImage; TextView tvBody; TextView tvScreenName; TextView tvTimeStamp; public ViewHolder(@NonNull View itemView) { super(itemView); ivProfileImage = itemView.findViewById(R.id.ivProfileImage); tvBody = itemView.findViewById(R.id.tvBody); tvScreenName = itemView.findViewById(R.id.tvScreenName); tvTimeStamp = itemView.findViewById(R.id.tvTimeStamp); } public void bind(Tweet tweet) { tvBody.setText(tweet.body); tvScreenName.setText(tweet.user.screenName); Log.i("Tweets created at",tweet.createdAt); tvTimeStamp.setText(tweet.createdAt); Glide.with(context).load(tweet.user.profileImageUrl).into(ivProfileImage); } } }
53bdeb638bb106a750dcd8a4930cebc48f283881
ff3cf0b03f5424778f80a6bd6ca9bb3fcbcd1ac1
/src/opt/easyjmetal/util/distance/DistanceNodeComparator.java
447a15ae88ec5bcb808b82ac3543df108cda9e2e
[]
no_license
jack13163/OilScheduleOperationPlatform
c3a395777d137e0f9c0edc39ddc849630cf16511
ae69f4e465b21d130d0b92ddbac44d5d38d3089b
refs/heads/master
2022-12-21T13:42:49.162696
2021-03-25T01:44:57
2021-03-25T01:44:57
197,735,331
3
3
null
2022-12-16T05:00:31
2019-07-19T08:35:30
Java
UTF-8
Java
false
false
1,949
java
// DistanceNodeComparator.java // // Author: // Antonio J. Nebro <[email protected]> // Juan J. Durillo <[email protected]> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program 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 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. package opt.easyjmetal.util.distance; import java.util.Comparator; /** * This class implements a <code>Comparator</code> to compare instances of * <code>DistanceNode</code>. */ public class DistanceNodeComparator implements Comparator { /** * Compares two <code>DistanceNode</code>. * * @param o1 Object representing a DistanceNode * @param o2 Object representing a DistanceNode * @return -1 if the distance of o1 is smaller than the distance of o2, * 0 if the distance of both are equals, and * 1 if the distance of o1 is bigger than the distance of o2 */ @Override public int compare(Object o1, Object o2) { DistanceNode node1 = (DistanceNode) o1; DistanceNode node2 = (DistanceNode) o2; double distance1, distance2; distance1 = node1.getDistance(); distance2 = node2.getDistance(); if (distance1 < distance2) { return -1; } else if (distance1 > distance2) { return 1; } else { return 0; } } }
d142ebcade1e80117a9d6d50cdc8413909ba2268
7bb1694ad5cc809712a5914dfac5162f8646d0c9
/app/src/main/java/com/example/zhangjunjun/imageloader/PhotoWallActivity.java
4cb057f102d6c1802a65de8e5de6866062a56c25
[]
no_license
google2720/ImageLoader
d26e4ff6184109961d9f4b090a4ed3c48cade750
a83ea54c8ce06492c2d0728de1b7c9747bd5df09
refs/heads/master
2021-01-19T01:25:11.691208
2017-06-15T15:55:11
2017-06-15T15:55:11
65,299,651
1
0
null
null
null
null
UTF-8
Java
false
false
2,729
java
package com.example.zhangjunjun.imageloader; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; import imageengine.DoubleCache; import imageengine.ImageLoader; public class PhotoWallActivity extends AppCompatActivity { public final static String[] imageThumbUrls = new String[]{ "http://img-download.pchome.net/download/1k0/ma/3r/o73pp8-1daf.jpg", "http://img-download.pchome.net/download/1k0/ma/3r/o73pp8-q9a.jpg", "http://img-download.pchome.net/download/1k0/ma/3r/o73pp8-c6g.jpg", "http://img-download.pchome.net/download/1k0/ma/3r/o73pp9-1x8u.jpg", "http://img-download.pchome.net/download/1k0/mb/41/o75n9f-pqd.jpg", "http://img-download.pchome.net/download/1k0/mb/41/o75n9f-1fhm.jpg", "http://download.pchome.net/wallpaper/info-10672-3-1.html", "http://img-download.pchome.net/download/1k0/mn/3g/o7rp7o-9hw.jpg", }; private android.widget.GridView photowall; private ImageLoader imageLoader; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_photo_wall); this.photowall = (GridView) findViewById(R.id.photo_wall); imageLoader = new ImageLoader(); imageLoader.setMemoryCache(new DoubleCache(this)); photowall.setAdapter(new BaseAdapter() { @Override public int getCount() { return imageThumbUrls.length; } @Override public String getItem(int position) { return imageThumbUrls[position]; } @Override public long getItemId(int position) { return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { final String url = getItem(position); View view; if (convertView == null) { view = LayoutInflater.from(PhotoWallActivity.this).inflate(R.layout.photo_layout, null); } else { view = convertView; } final ImageView imageView = (ImageView) view.findViewById(R.id.photo); // 给ImageView设置一个Tag,保证异步加载图片时不会乱序 imageLoader.displayImage(PhotoWallActivity.this,url,imageView); return view; } }); } }
37d7692ccc76036706e3aa8ada2a47d2051e43d4
1d1f34b1b8e87e5cbe19fc49dcb690b1eb0694e3
/hpatch/src/main/java/com/samsung/slsi/HPatchError.java
352deb1241a315fdd6bad4b32f415a15f4f4d79e
[]
no_license
leeadra/Novel-T
568ebb3e70bfb87d2299fc70839c1ff87a84a595
881f49d54f95f1662c241864aa70009c27517c78
refs/heads/master
2022-04-23T06:02:44.724034
2020-04-23T05:03:41
2020-04-23T05:03:41
258,093,735
1
0
null
null
null
null
UTF-8
Java
false
false
128
java
package com.samsung.slsi; /** * Created by ch36.park on 2017. 2. 28.. */ public enum HPatchError { RegistrationDenied }
d1bb37c437b81fae0d22876a55020e3928b14005
2ecc1746690170cd0b1e91db571b6e6b23b7a594
/GDCL-VLOCAL/Hibernate One-to-Many Mapping Project/src/str/ForOurLogic.java
bd87029bc4638db8a11482cbaa6cd572c3ea41b4
[]
no_license
vinoth2426/JavaTrainingNotes
44e6f6d76240773cb512e82abd1adf1fd2b28122
78f146c939ae7a821bbfb31fdb996e6fc2fee98a
refs/heads/master
2020-03-18T06:37:58.848127
2019-03-26T10:56:54
2019-03-26T10:56:54
134,406,744
0
0
null
2018-05-22T12:04:28
2018-05-22T11:41:30
null
UTF-8
Java
false
false
1,213
java
package str; import java.util.HashSet; import java.util.Set; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.AnnotationConfiguration; public class ForOurLogic { public static void main(String[] args) { AnnotationConfiguration cfg = new AnnotationConfiguration(); cfg.configure("hibernate.cfg.xml"); SessionFactory factory = new AnnotationConfiguration().configure().buildSessionFactory(); Session session = factory.openSession(); Vendor v=new Vendor(); v.setVendorId(100); v.setVendorName("java4s"); Customers c1=new Customers(); c1.setCustomerId(500); c1.setCustomerName("customer1"); Customers c2=new Customers(); c2.setCustomerId(501); c2.setCustomerName("customer2"); Set s=new HashSet(); s.add(c1); s.add(c2); v.setChildren(s); Transaction tx=session.beginTransaction(); session.save(v); tx.commit(); session.close(); System.out.println("One to Many Annotatios Done...!!!!!!"); factory.close(); } }
c1983825c77ed536fbc3448e92cf00ebc6ff15e5
c1fdad0b8ff7d887d37252f50be3c1f9132e5916
/src/main/java/com/grain/service/impl/CkLineServiceImpl.java
2fa8d096005a67ea56b08dba0a4ea12c74659338
[]
no_license
sisylpy/chainPro
8bb9814aea891f22072c2beefecbb1c7d25bbdad
562fd16d25b3dc584c88630973e91fd8406e54f4
refs/heads/master
2022-12-21T06:28:13.835541
2020-01-09T13:41:38
2020-01-09T13:41:38
218,976,558
0
0
null
2022-12-16T08:06:36
2019-11-01T11:55:50
CSS
UTF-8
Java
false
false
1,227
java
package com.grain.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; import java.util.Map; import com.grain.dao.CkLineDao; import com.grain.entity.CkLineEntity; import com.grain.service.CkLineService; @Service("ckLineService") public class CkLineServiceImpl implements CkLineService { @Autowired private CkLineDao ckLineDao; @Override public CkLineEntity queryObject(Integer lineId){ return ckLineDao.queryObject(lineId); } @Override public List<CkLineEntity> queryList(Map<String, Object> map){ return ckLineDao.queryList(map); } @Override public int queryTotal(Map<String, Object> map){ return ckLineDao.queryTotal(map); } @Override public void save(CkLineEntity ckLine){ ckLineDao.save(ckLine); } @Override public void update(CkLineEntity ckLine){ ckLineDao.update(ckLine); } @Override public void delete(Integer lineId){ ckLineDao.delete(lineId); } @Override public void deleteBatch(Integer[] lineIds){ ckLineDao.deleteBatch(lineIds); } @Override public List<CkLineEntity> queryLineList(Map<String, Object> map) { return ckLineDao.querLineList(); } }
68079658b356275a245e647127ce2c640e4fe60a
5344518b7681a861a83e384c288d6e66f7f72b9e
/tools/src/MotivatingExample.java
176a6d0bdc37174c60beb2d63837784184ce39bf
[]
no_license
zihangs/fp1189_aamas2020
c8e0b32446498f45f44434b6026e8b3b3768fc78
c9966fd863a6cc1e5914553b04a38b944f43ba4c
refs/heads/master
2022-12-20T17:38:30.641612
2022-12-19T08:21:47
2022-12-19T08:21:47
242,276,461
4
1
null
null
null
null
UTF-8
Java
false
false
2,295
java
import java.io.FileWriter; import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; public class MotivatingExample { @SuppressWarnings({ "unchecked" }) public static void main(String[] args) throws IOException, ClassNotFoundException, SQLException { // =============================== variables need to config ======================================= int plan_num = Integer.parseInt(args[0]); // 0 is irrational; 1 is rational String dir_prefix = "../training_examples/"; String traces_dir = dir_prefix + "fig1/traces_in_plan_format/"; String models_dir = dir_prefix + "fig2/"; // index the petri net models, using "XES" parameter for .xes.pnml files @SuppressWarnings("rawtypes") alignmentTool alignmentTool = new alignmentTool(6, models_dir.toString(), "XES"); // output file name FileWriter csvWriter = null; if (plan_num == 0) { csvWriter = new FileWriter(dir_prefix + "irrational.csv"); } if (plan_num == 1) { csvWriter = new FileWriter(dir_prefix + "rational.csv"); } // ================================================================================================= String flag_cost = "IncreasingCost"; //IncreasingCost or FlatCost XESGenerator xes_generator = new XESGenerator(); System.out.println(traces_dir.toString()); Sequence s = xes_generator.pick_sequence(traces_dir.toString(), plan_num); int steps = s.sequence.size(); // csvWriter.append("MoL_Boltzmann_Probability\n"); csvWriter.append(",Goal0,Goal1,Goal2,Goal3,Goal4,Goal5\n"); for (int step = 0; step < steps; step++) { ArrayList<Integer> costs = null; ArrayList<Double> probabilities = null; costs = alignmentTool.allCosts(s, step, "MoLDiagonal", flag_cost); probabilities = alignmentTool.probabilities(costs); System.out.println(costs); System.out.println(probabilities); if (step == steps-1) { // the last step reach to the goal state, which is goal E (the fifth goal) csvWriter.append(step+",0,0,0,0,1,0"); }else { csvWriter.append(step+","+ probabilities.get(0)+","+probabilities.get(1)+","+probabilities.get(2)+","+probabilities.get(3)+","+probabilities.get(4)+","+probabilities.get(5)+"\n"); } } csvWriter.flush(); csvWriter.close(); } }
edfc1143d6137c2acfdf868dac13e4e5c64c6da8
71a7c06bbac9fda7512a72a4a8a7f3af79961c03
/BaseValueManagement/BYEProcess/BaseYearEventCommon/src/gov/laca/amp/bvm/model/BVMEventHandler.java
5399cbe38d393d6c62138978c35611da4b5bbf53
[]
no_license
kishanpeddaboina/oracle
33b65117f1d6ca2a368ff46ab7e8f921dfac4d5c
a094622693ea1906a5c3372a56ea58a96198b13a
refs/heads/master
2020-03-30T19:28:52.989304
2018-10-04T09:14:19
2018-10-04T09:14:19
151,544,922
0
0
null
null
null
null
UTF-8
Java
false
false
5,108
java
package gov.laca.amp.bvm.model; import gov.laca.amp.bvm.util.BaseYearEventUtils; import gov.laca.amp.fwk.logger.AmpLogger; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; import javax.faces.event.ActionEvent; import oracle.adf.view.rich.component.rich.nav.RichCommandToolbarButton; /** * @author * @version */ public class BVMEventHandler { private static final AmpLogger LOGGER = new AmpLogger(BVMEventHandler.class); public BVMEventHandler() { super(); } public void handleFireSubmit() { LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Perform BPM Submit Action"); FacesContext facesContext = FacesContext.getCurrentInstance(); UIViewRoot root = facesContext.getViewRoot(); /**Pass ctb1(buttonId) if page is not in taskflow, else if page is inside region then pass rgionid:buttonId*/ RichCommandToolbarButton submitButton = (RichCommandToolbarButton)root.findComponent("submitBtn"); ActionEvent actionEvent = new ActionEvent(submitButton); actionEvent.queue(); } public void handleFireApprove() { LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Perform BPM Approve Action"); FacesContext facesContext = FacesContext.getCurrentInstance(); UIViewRoot root = facesContext.getViewRoot(); /**Pass ctb1(buttonId) if page is not in taskflow, else if page is inside region then pass rgionid:buttonId*/ RichCommandToolbarButton approveBtn = (RichCommandToolbarButton)root.findComponent("approveBtn"); ActionEvent actionEvent = new ActionEvent(approveBtn); actionEvent.queue(); } public void handleFireReject() { LOGGER.info(BaseYearEventUtils.LOGGER_PREFIX + "Perform BPM Reject Action"); FacesContext facesContext = FacesContext.getCurrentInstance(); UIViewRoot root = facesContext.getViewRoot(); /**Pass ctb1(buttonId) if page is not in taskflow, else if page is inside region then pass rgionid:buttonId*/ RichCommandToolbarButton rejectBtn = (RichCommandToolbarButton)root.findComponent("rejectBtn"); ActionEvent actionEvent = new ActionEvent(rejectBtn); actionEvent.queue(); } public void handleFireCancel() { LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Perform BPM Cancel Action"); FacesContext facesContext = FacesContext.getCurrentInstance(); UIViewRoot root = facesContext.getViewRoot(); /**Pass ctb1(buttonId) if page is not in taskflow, else if page is inside region then pass rgionid:buttonId*/ RichCommandToolbarButton cancelBtn = (RichCommandToolbarButton)root.findComponent("cancelBtn"); ActionEvent actionEvent = new ActionEvent(cancelBtn); actionEvent.queue(); } public void handleFireSave(Object payLoad){ LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Perform BPM Save Action"); FacesContext facesContext = FacesContext.getCurrentInstance(); UIViewRoot root = facesContext.getViewRoot(); /**Pass ctb1(buttonId) if page is not in taskflow, else if page is inside region then pass rgionid:buttonId*/ RichCommandToolbarButton updateBtn = (RichCommandToolbarButton)root.findComponent("updateBtn"); ActionEvent actionEvent = new ActionEvent(updateBtn); actionEvent.queue(); // OperationBinding update = ADFUtils.getOperationBinding("update"); // update.execute(); // if(payLoad instanceof FacesCtrlAttrsBinding){ // FacesCtrlAttrsBinding eventModfied = (FacesCtrlAttrsBinding )payLoad; // eventModfied.setInputValue(Boolean.TRUE); // } // if(payLoad instanceof Boolean){ // Boolean eventModfied =(Boolean)payLoad; // eventModfied = Boolean.TRUE; // } LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Perform BPM Save"); } /** * Publihs method for firing Approve event * @param payload * @return */ public Object fireApprove(Object payload){ LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Fire Approve Event"); return payload; } /** * Publihs method for firing Reject event * @param payload * @return */ public Object fireReject(Object payload){ LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Fire Reject Event"); return payload; } /** * Publihs method for firing Cancel event * @param payload * @return */ public Object fireCancel(Object payload){ LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Fire Cancel Event"); return payload; } /** * Publihs method for firing Cancel event * @param payload * @return */ public Object fireSubmit(Object payload){ LOGGER.fine(BaseYearEventUtils.LOGGER_PREFIX + "Fire Submit Event"); return payload; } }
665d3c537c03dcaf2069edd60d797e74b12f29d3
0d4a2464c0fec2288f868cc19f76bc377c9ad24f
/shopping_protal/shopping_protal_web/src/main/java/com/shopping/shopping_protal_web/vo/LoginVo.java
4e6c6180ea6b08d0d4279f934c89558bb0b54b37
[]
no_license
albertmaxwell/NewShopping
b940b07b9457d690a610f3dca07e78f97eb26637
c5ded1845404c7de1c53e57b8cb9be302c3911e1
refs/heads/master
2022-07-16T09:03:37.686020
2019-12-20T10:37:34
2019-12-20T10:37:34
202,852,094
0
0
null
2022-06-29T17:37:08
2019-08-17T07:51:39
HTML
UTF-8
Java
false
false
682
java
package com.shopping.shopping_protal_web.vo; import io.swagger.annotations.ApiModelProperty; /** * @author 金海洋 * @date 2019/8/18 -22:54 */ public class LoginVo { //用户账号 @ApiModelProperty(value = "用户账号", required = true, example = "jinhiayng") public String username; //用户密码 @ApiModelProperty(value = "用户密码", required = true, example = "123456") public String password; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "jhy..1008611" ]
jhy..1008611
0294a570d6c5ec95a36b003706fe92adee3a992b
86fa67369e29c0086601fad2d5502322f539a321
/subprojects/kernel/doovos-kernel-vanilla/src/org/doovos/kernel/vanilla/jvm/interpreter/switchinterpreter/instr/KJVM_I2L.java
79f16570ece0b1d61e4f2f981d7a5b017e641da0
[]
no_license
thevpc/doovos
05a4ce98825bf3dbbdc7972c43cd15fc18afdabb
1ae822549a3a546381dbf3b722814e0be1002b11
refs/heads/master
2021-01-12T14:56:52.283641
2020-08-22T12:37:40
2020-08-22T12:37:40
72,081,680
1
0
null
null
null
null
UTF-8
Java
false
false
3,693
java
///** // * ==================================================================== // * Doovos (Distributed Object Oriented Operating System) // * // * Doovos is a new Open Source Distributed Object Oriented Operating System // * Design and implementation based on the Java Platform. // * Actually, it is a try for designing a distributed operation system in // * top of existing centralized/network OS. // * Designed OS will follow the object oriented architecture for redefining // * all OS resources (memory,process,file system,device,...etc.) in a highly // * distributed context. // * Doovos is also a distributed Java virtual machine that implements JVM // * specification on top the distributed resources context. // * // * Doovos Kernel is the heart of Doovos OS. It implements also the Doovos JVM // * Doovos Kernel code is executed on host JVM // * // * Copyright (C) 2008-2010 Taha BEN SALAH // * // * This program is free software; you can redistribute it and/or modify // * it under the terms of the GNU General Public License as published by // * the Free Software Foundation; either version 2 of the License, or // * (at your option) any later version. // * // * This program is distributed in the hope that it will be useful, // * but WITHOUT ANY WARRANTY; without even the implied warranty of // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // * GNU General Public License for more details. // * // * You should have received a copy of the GNU General Public License along // * with this program; if not, write to the Free Software Foundation, Inc., // * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // * ==================================================================== // */ //package org.doovos.kernel.vanilla.jvm.interpreter.switchinterpreter.instr; // //import org.doovos.kernel.api.jvm.bytecode.KOperator; //import org.doovos.kernel.api.jvm.interpreter.KFrame; //import org.doovos.kernel.api.jvm.reflect.KInstruction; //import org.doovos.kernel.api.jvm.reflect.KMethod; //import org.doovos.kernel.api.memory.KLong; //import org.doovos.kernel.api.process.KProcess; //import org.doovos.kernel.vanilla.jvm.interpreter.jitsrcinterpreter.JITContext; //import org.doovos.kernel.vanilla.jvm.interpreter.jitsrcinterpreter.JITJavaSource; //import org.doovos.kernel.vanilla.jvm.interpreter.jitsrcinterpreter.JITJavaSourceImpl; // //import java.rmi.RemoteException; // ///** // * Created by IntelliJ IDEA. // * User: vpc // * Date: 22 févr. 2009 // * Time: 14:21:52 // * To change this template use File | Settings | File Templates. // */ //public final class KJVM_I2L extends KInstructionSwitch implements Cloneable { // public static final KJVM_I2L INSTANCE = new KJVM_I2L(); // protected KInstruction next; // // private KJVM_I2L() { // super(KOperator.I2L); // } // // public int run(KFrame frame) throws RemoteException { // frame.push(new KLong(frame.popInt())); // return KProcess.NEXT_STATEMENT; // } // // public KInstruction runDirect(KFrame frame) throws RemoteException { // frame.push(new KLong(frame.popInt())); // frame.setInstruction(ordinal + 1); // return next; // } // // public void relink(int index, KInstruction[] code, KMethod method) { // this.ordinal = index; // this.next = code[index + 1]; // } // // public JITJavaSource toJITJavaSource(JITContext jitContext) { // return new JITJavaSourceImpl( // null, // null, null, // " " + jitContext.pushConsumed("new KLong(" + jitContext.popInt() + ")") // , null, null, null // ); // } // // //}
d1dca8bbbdc932f34e2dccfd3d83effef88e0a12
1d01d6b8672d3eda61237b54f7262c624bedfff0
/rtmd/RTMD_JAR/src/edu/lehigh/nees/util/filefilter/SDAPFileFilter.java
0bd791c3ad471ae3b7327003b56381ed9e444e5e
[]
no_license
zhangyongbing2009/rtmd
bc90c825871d23c372c1373f7698c32db044cb0d
661ec2868e08f242a0406b56fe7a0cd86cbcc8e0
refs/heads/master
2021-01-10T01:44:17.943761
2012-08-30T20:03:54
2012-08-30T20:03:54
36,001,779
0
0
null
null
null
null
UTF-8
Java
false
false
716
java
package edu.lehigh.nees.util.filefilter; import java.io.File; /********************************* * SDAPFileFilter * <p> * SDAP FileFilter extension class * <p> * @author Thomas Marullo * <p> * <b><u>Revisions</u></b><br> * 28 Feb 11 T. Marullo Initial * *********************************/ public class SDAPFileFilter extends FileFilterExtended { public boolean accept(File f) { if (f.isDirectory()) return true; String exten = getExtension(f); if (exten != null && exten.equalsIgnoreCase("sdap")) return true; return false; } public String getDescription() { return "sDAP files (*.sdap)"; } public String getExtensionType() { return ".sdap"; } }
[ "[email protected]@7f3166ef-3b52-0410-ad74-e9bab01e5e52" ]
[email protected]@7f3166ef-3b52-0410-ad74-e9bab01e5e52
c9137609d48d88c49ac730599913cc19be0a2e29
434c15a20113757503e229d7cc7c3714186043e9
/src/main/java/ru/goluzov/se/player/Human.java
50c35ef04830bc99a8b0d75aae1e6e20840c5e56
[]
no_license
Alecsgol/Example8
946c0771c119308af07f677754f7365947b15ef6
1f0462d25d86b50014f8a8312a7ad45d9d2e96e4
refs/heads/master
2020-04-08T13:09:56.125733
2018-11-27T18:08:54
2018-11-27T18:08:54
159,378,154
0
0
null
null
null
null
UTF-8
Java
false
false
266
java
package ru.goluzov.se.player; import ru.goluzov.se.constant.Dot; import javax.swing.*; public class Human extends Player { public Human(String dot) { super(dot); } @Override public void turn(JButton btn) { btn.setText(dot); } }
7dbb332461e05d92d46d122b1121c11d05871421
3317086b844369385140b511bdd5833c10800476
/simplemvplibrary/src/main/java/com/cheng/simplemvplibrary/View.java
8332e3db7684648dcc96b950930e6fa3f5b29080
[]
no_license
cammingcai/MvpDemo
34dab4323827a59f6634331f4864d72823576365
4e266fa1a002b81bfc09af719132ef1e7a727241
refs/heads/master
2020-04-25T14:16:17.689480
2019-02-27T03:29:17
2019-02-27T03:29:17
172,835,820
2
0
null
null
null
null
UTF-8
Java
false
false
122
java
package com.cheng.simplemvplibrary; public interface View { void showToast(String info); void showProgress(); }
3cb353fc1c87e0f2925a6b9327d33c41bffea5ad
a349ca28934e92d20f0c67d221c6b5efb298003f
/android/app/src/main/java/com/todo_list_react/MainApplication.java
5f7ef4d68c21cacee46b2c7220c5ebf895640450
[]
no_license
KamilCetiner/TODO--REACT--NATIVE
4e7028115be123cb11d9e9a380ce2bde85fadffe
eabb2162d30e04271e67790190d09781c080ad2c
refs/heads/main
2022-12-29T10:34:51.521789
2020-10-20T20:42:53
2020-10-20T20:42:53
305,816,706
0
0
null
null
null
null
UTF-8
Java
false
false
2,613
java
package com.todo_list_react; import android.app.Application; import android.content.Context; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List<ReactPackage> packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); } /** * Loads Flipper in React Native templates. Call this in the onCreate method with something like * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); * * @param context * @param reactInstanceManager */ private static void initializeFlipper( Context context, ReactInstanceManager reactInstanceManager) { if (BuildConfig.DEBUG) { try { /* We use reflection here to pick up the class that initializes Flipper, since Flipper library is not available in release mode */ Class<?> aClass = Class.forName("com.todo_list_react.ReactNativeFlipper"); aClass .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) .invoke(null, context, reactInstanceManager); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } } }
008b976bcd868078b341ff8bbca736c30459b814
c4eaa631459eebd3f644a68e4cb663fe9072ca5b
/HW9/src/edu/umb/cs681/hw09/APFS.java
ece86a3460df43df0a1924df3271b68de22d8848
[]
no_license
kedar03/CS681
ac0fe392065eb36bc59e644c0747537d5b0b2cd8
95b81bb5caa323a30d1bde773bcb98c7d2577f0e
refs/heads/main
2023-02-04T14:45:44.122338
2020-12-21T20:06:42
2020-12-21T20:06:42
302,164,972
0
0
null
null
null
null
UTF-8
Java
false
false
2,699
java
package edu.umb.cs681.hw09; import java.time.LocalDateTime; import java.util.LinkedList; public class APFS extends FileSystem implements Runnable { private String ownerName; private LocalDateTime lastModified; private static APFS instance = null; public APFS(String ownerName) { this.ownerName = ownerName; this.lastModified = LocalDateTime.now(); } public APFS getInstance() { if (instance == null) { instance = new APFS(ownerName); } return instance; } @Override protected FSElement createDefaultRoot() { return new ApfsDirectory(null, "root"); } public ApfsDirectory getRootDir() { ApfsDirectory root = (ApfsDirectory) this.getRoot(); return root; } public void setRootDir(ApfsDirectory root) { super.setRoot(root); } public String getOwnerName() { return this.ownerName; } public LocalDateTime getLastModified() { return this.lastModified; } public void run() { System.out.println("\nThread #" + Thread.currentThread().getId()); System.out.println("Size of " + getRootDir().getName() + " dir: " + getRootDir().getTotalSize()); LinkedList<ApfsElement> rootChildren = getRootDir().getChildren(); for (ApfsElement child : rootChildren) { System.out.println("\n-->"+child.getName()); LinkedList<ApfsElement> child1Children =child.getChildren(); for (ApfsElement child1 : child1Children) { System.out.println("------>"+child1.getName()); LinkedList<ApfsElement> child2Children =child1.getChildren(); for (ApfsElement child2 : child2Children) { System.out.println("------>"+child2.getName()); } } } } public static void main(String args[]) { APFS apfs = new APFS("APFS File System"); apfs.initFileSystem("Local Disk", 10000); ApfsDirectory root = apfs.getRootDir(); ApfsDirectory applications = new ApfsDirectory(root, "applications"); root.appendChild(applications); ApfsFile f1, f2; f1 = new ApfsFile(applications, "f1", 40); f2 = new ApfsFile(applications, "f2", 40); applications.appendChild(f1); applications.appendChild(f2); Thread t1 = new Thread(apfs); t1.start(); try { t1.join(); } catch (InterruptedException e1) { e1.printStackTrace(); } ApfsDirectory home = new ApfsDirectory(root, "home"); root.appendChild((home)); ApfsFile f3, f4; f3 = new ApfsFile(home, "f3", 200); f4 = new ApfsFile(home, "f4", 300); home.appendChild(f3); home.appendChild(f4); Thread t2 = new Thread(apfs); t2.start(); try { t2.join(); } catch (InterruptedException e1) { e1.printStackTrace(); } } }
78d141922e5a7d6f7a70f3dfb2d4402422282f3f
bffb5f53abdd430b80503e66076dce585a8fdae5
/src/main/java/shoe/store/server/security/services/UserDetailsImpl.java
b845ba35e2d864e8fb8a38582bdb74082b616d7a
[]
no_license
duc20497/server-shoe-store
807245d3bcdeffe367f5fcaec199bdd404db6f3f
769ba965240ce569ed3b9de862bed76fca623428
refs/heads/master
2023-09-05T02:09:38.957025
2021-11-12T00:26:15
2021-11-12T00:26:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,064
java
package shoe.store.server.security.services; import java.util.Collection; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import shoe.store.server.models.User; import com.fasterxml.jackson.annotation.JsonIgnore; public class UserDetailsImpl implements UserDetails { private static final long serialVersionUID = 1L; private String id; private String username; @JsonIgnore private String password; private Collection<? extends GrantedAuthority> authorities; public UserDetailsImpl(String id, String username, String password, Collection<? extends GrantedAuthority> authorities) { this.id = id; this.username = username; this.password = password; this.authorities = authorities; } public static UserDetailsImpl build(User user) { List<GrantedAuthority> authorities = user.getRoles().stream() .map(role -> new SimpleGrantedAuthority(role.getName().name())) .collect(Collectors.toList()); return new UserDetailsImpl( user.getId(), user.getUsername(), user.getPassword(), authorities); } @Override public Collection<? extends GrantedAuthority> getAuthorities() { return authorities; } public String getId() { return id; } @Override public String getPassword() { return password; } @Override public String getUsername() { return username; } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserDetailsImpl user = (UserDetailsImpl) o; return Objects.equals(id, user.id); } }
a459411ed9958d2764bfba20c93dd6af68f2417b
a6cc41703eeb97e0d5caa1ab9d3df45576f8caf6
/CIMS-Shared/src/main/java/Shared/Users/IHQUser.java
c0dbc7be58afc6c481cb0040d4c4e500cadab535
[]
no_license
Alexandervc/CIMS2
bc47c5a69c12afa3a7af258223c5cfab368088c9
32f34cdacbefa220aed8fbb9bb27c718cbeccfc3
refs/heads/master
2021-01-13T00:49:21.553419
2015-06-30T11:27:16
2015-06-30T11:27:50
36,871,097
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Shared.Users; /** * * @author Alexander */ public interface IHQUser extends IUser { }
6f55764160ed436fbf6f003efd9f2da5d80dc94b
33f22b251ff654b5a069561b7d2455b880ceb74f
/Allister-Rooke-U2-M2-Summative/comment-queue-consumer/src/main/java/com/trilogyed/commentqueueconsumer/MessageListener.java
c7e49fe8a9505e9f0b3a141694d3fccb5a873bc3
[]
no_license
allistergg/Java_Projects
ed55096cd7ba8e7cac3c52413c9cf3e28d0aa34e
ef795ddc3339604325d1e77d74d6d6829b2f262a
refs/heads/master
2022-11-25T20:02:49.870724
2020-04-24T18:06:03
2020-04-24T18:06:03
223,300,659
0
0
null
2022-11-16T09:26:32
2019-11-22T01:48:01
Java
UTF-8
Java
false
false
593
java
package com.trilogyed.commentqueueconsumer; import com.trilogyed.commentqueueconsumer.model.Comment; import com.trilogyed.commentqueueconsumer.util.feign.CommentClient; import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class MessageListener { @Autowired CommentClient client; @RabbitListener(queues = CommentQueueConsumerApplication.QUEUE_NAME) public void receiveMessage(Comment msg) { client.createComment(msg); } }
eab4ace6dc123bcd66f8b55ab6b2877f8e2d1225
148e98a0f2e3142ead96b407c812f0d77be06b51
/OFM/src/com/net/multiway/ofm/entities/DataEvent.java
6863ef1ade6de4b53e6b42a7515d83dfba896412
[]
no_license
phelipefabres/OFM_SQL
955e475cbc22813393147ce605501c505ba2dd70
89952c6c516e4f418f29f9b5ff86db958e64ff3e
refs/heads/master
2020-04-05T23:47:44.019476
2016-10-24T17:39:37
2016-10-24T17:39:37
58,819,430
0
2
null
2016-05-22T14:22:03
2016-05-14T16:58:16
Java
UTF-8
Java
false
false
13,332
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.net.multiway.ofm.entities; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.Table; import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; /** * * @author joshua */ @Entity @Access(AccessType.PROPERTY) @Table(name = "data_event") @NamedQueries({ @NamedQuery(name = "DataEvent.findAll", query = "SELECT d FROM DataEvent d"), @NamedQuery(name = "DataEvent.findByDataEventId", query = "SELECT d FROM DataEvent d WHERE d.dataEventId = :dataEventId"), @NamedQuery(name = "DataEvent.findByDistance", query = "SELECT d FROM DataEvent d WHERE d.distance = :distance"), @NamedQuery(name = "DataEvent.findByType", query = "SELECT d FROM DataEvent d WHERE d.type = :type"), @NamedQuery(name = "DataEvent.findByEchoLoss", query = "SELECT d FROM DataEvent d WHERE d.echoLoss = :echoLoss"), @NamedQuery(name = "DataEvent.findByInsertionLoss", query = "SELECT d FROM DataEvent d WHERE d.insertionLoss = :insertionLoss"), @NamedQuery(name = "DataEvent.findByAverageAttenuationCoefficient", query = "SELECT d FROM DataEvent d WHERE d.averageAttenuationCoefficient = :averageAttenuationCoefficient"), @NamedQuery(name = "DataEvent.findByAcumulativeLoss", query = "SELECT d FROM DataEvent d WHERE d.acumulativeLoss = :acumulativeLoss")}) public class DataEvent implements Externalizable { private static final long serialVersionUID = 1L; public DataEvent() { this.distance = new SimpleObjectProperty<>(); this.type = new SimpleObjectProperty<>(); this.echoLoss = new SimpleObjectProperty<>(); this.insertionLoss = new SimpleObjectProperty<>(); this.averageAttenuationCoefficient = new SimpleObjectProperty<>(); this.acumulativeLoss = new SimpleObjectProperty<>(); } public DataEvent(Integer dataEventId, Float distance, Integer type, Float echoLoss, Float insertionLoss, Float averageAttenuationCoefficient, Float acumulativeLoss) { this.dataEventId = new SimpleObjectProperty<>(dataEventId); this.distance = new SimpleObjectProperty<>(distance); this.type = new SimpleObjectProperty<>(type); this.echoLoss = new SimpleObjectProperty<>(echoLoss); this.insertionLoss = new SimpleObjectProperty<>(insertionLoss); this.averageAttenuationCoefficient = new SimpleObjectProperty<>(averageAttenuationCoefficient); this.acumulativeLoss = new SimpleObjectProperty<>(acumulativeLoss); this._dataEventId = dataEventId; this._distance = distance; this._type = type; this._echoLoss = echoLoss; this._insertionLoss = insertionLoss; this._averageAttenuationCoefficient = averageAttenuationCoefficient; this._acumulativeLoss = acumulativeLoss; } public DataEvent(Float distance, Integer type, Float echoLoss, Float insertionLoss, Float averageAttenuationCoefficient, Float acumulativeLoss) { this.distance = new SimpleObjectProperty<>(distance); this.type = new SimpleObjectProperty<>(type); this.echoLoss = new SimpleObjectProperty<>(echoLoss); this.insertionLoss = new SimpleObjectProperty<>(insertionLoss); this.averageAttenuationCoefficient = new SimpleObjectProperty<>(averageAttenuationCoefficient); this.acumulativeLoss = new SimpleObjectProperty<>(acumulativeLoss); this._distance = distance; this._type = type; this._echoLoss = echoLoss; this._insertionLoss = insertionLoss; this._averageAttenuationCoefficient = averageAttenuationCoefficient; this._acumulativeLoss = acumulativeLoss; } private ObjectProperty<Integer> dataEventId; private Integer _dataEventId; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "data_event_id", nullable = false) public Integer getDataEventId() { if (dataEventId == null) { return _dataEventId; } else { return dataEventId.get(); } } public void setDataEventId(Integer dataEventId) { if (this.dataEventId == null) { this._dataEventId = dataEventId; } else { this.dataEventId.set(dataEventId); } } public ObjectProperty<Integer> dataEventIdProperty() { if (dataEventId == null) { dataEventId = new SimpleObjectProperty<>(_dataEventId); } return dataEventId; } private ObjectProperty<Float> distance; private Float _distance; @Basic(optional = false) @Column(name = "distance", nullable = false) public Float getDistance() { if (distance == null) { return _distance; } else { return distance.get(); } } public void setDistance(Float distance) { if (this.distance == null) { this._distance = distance; } else { this.distance.set(distance); } } public ObjectProperty<Float> distanceProperty() { if (distance == null) { distance = new SimpleObjectProperty<>(_distance); } return distance; } private ObjectProperty<Integer> type; private Integer _type; @Basic(optional = false) @Column(name = "type", nullable = false) public Integer getType() { if (type == null) { return _type; } else { return type.get(); } } public void setType(Integer type) { if (this.type == null) { this._type = type; } else { this.type.set(type); } } public SimpleStringProperty typeProperty() { if (type.get() == 0) { return new SimpleStringProperty("Início"); } else if (type.get() == 1) { return new SimpleStringProperty("Reflexão"); } else if (type.get() == 2) { return new SimpleStringProperty("Não-Reflexão"); } else if (type.get() == 3) { return new SimpleStringProperty("Fim"); } return null; } private ObjectProperty<Float> echoLoss; private Float _echoLoss; @Basic(optional = false) @Column(name = "echo_loss", nullable = false) public Float getEchoLoss() { if (echoLoss == null) { return _echoLoss; } else { return echoLoss.get(); } } public void setEchoLoss(Float echoLoss) { if (this.echoLoss == null) { this._echoLoss = echoLoss; } else { this.echoLoss.set(echoLoss); } } public ObjectProperty<Float> echoLossProperty() { if (echoLoss == null) { echoLoss = new SimpleObjectProperty<>(_echoLoss); } return echoLoss; } private ObjectProperty<Float> insertionLoss; private Float _insertionLoss; @Basic(optional = false) @Column(name = "insertion_loss", nullable = false) public Float getInsertionLoss() { if (insertionLoss == null) { return _insertionLoss; } else { return insertionLoss.get(); } } public void setInsertionLoss(Float insertionLoss) { if (this.insertionLoss == null) { this._insertionLoss = insertionLoss; } else { this.insertionLoss.set(insertionLoss); } } public ObjectProperty<Float> insertionLossProperty() { if (insertionLoss == null) { insertionLoss = new SimpleObjectProperty<>(_insertionLoss); } return insertionLoss; } private ObjectProperty<Float> averageAttenuationCoefficient; private Float _averageAttenuationCoefficient; @Basic(optional = false) @Column(name = "average_attenuation_coefficient", nullable = false) public Float getAverageAttenuationCoefficient() { if (averageAttenuationCoefficient == null) { return _averageAttenuationCoefficient; } else { return averageAttenuationCoefficient.get(); } } public void setAverageAttenuationCoefficient(Float averageAttenuationCoefficient) { if (this.averageAttenuationCoefficient == null) { this._averageAttenuationCoefficient = averageAttenuationCoefficient; } else { this.averageAttenuationCoefficient.set(averageAttenuationCoefficient); } } public ObjectProperty<Float> averageAttenuationCoefficientProperty() { if (averageAttenuationCoefficient == null) { averageAttenuationCoefficient = new SimpleObjectProperty<>(_averageAttenuationCoefficient); } return averageAttenuationCoefficient; } private ObjectProperty<Float> acumulativeLoss; private Float _acumulativeLoss; @Basic(optional = false) @Column(name = "acumulative_loss", nullable = false) public Float getAcumulativeLoss() { if (acumulativeLoss == null) { return _acumulativeLoss; } else { return acumulativeLoss.get(); } } public void setAcumulativeLoss(Float acumulativeLoss) { if (this.acumulativeLoss == null) { this._acumulativeLoss = acumulativeLoss; } else { this.acumulativeLoss.set(acumulativeLoss); } } public ObjectProperty<Float> acumulativeLossProperty() { if (acumulativeLoss == null) { acumulativeLoss = new SimpleObjectProperty<>(_acumulativeLoss); } return acumulativeLoss; } private ObjectProperty<Data> data; private Data _data; @JoinColumn(name = "data_id", referencedColumnName = "data_id", nullable = false) @ManyToOne(optional = false, fetch = FetchType.EAGER) @NotFound(action = NotFoundAction.IGNORE) public Data getData() { if (data == null) { return _data; } else { return data.get(); } } public void setData(Data data) { if (this.data == null) { this._data = data; } else { this.data.set(data); } } public ObjectProperty<Data> dataProperty() { if (data == null) { data = new SimpleObjectProperty<>(this, "data", _data); } return data; } @Override public int hashCode() { Integer hash = 0; hash += (_dataEventId != null ? _dataEventId.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof DataEvent)) { return false; } DataEvent other = (DataEvent) object; if ((this._dataEventId == null && other._dataEventId != null) || (this._dataEventId != null && !this._dataEventId.equals(other._dataEventId))) { return false; } return true; } @Override public String toString() { return "ofm.model.entities.DataEvent[ dataEventId=" + _dataEventId + " - data=" + _data.toString() + " ]"; } @Override public void writeExternal(ObjectOutput out) throws IOException { out.writeObject(getDataEventId()); out.writeObject(getDistance()); out.writeObject(getType()); out.writeObject(getEchoLoss()); out.writeObject(getInsertionLoss()); out.writeObject(getAverageAttenuationCoefficient()); out.writeObject(getAcumulativeLoss()); out.writeObject(getData()); } @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { setDataEventId((Integer) in.readObject()); setDistance((Float) in.readObject()); setType((Integer) in.readObject()); setEchoLoss((Float) in.readObject()); setInsertionLoss((Float) in.readObject()); setAverageAttenuationCoefficient((Float) in.readObject()); setAcumulativeLoss((Float) in.readObject()); setData((Data) in.readObject()); } }
17a3349ea1ed058ba6718e769284f9bb492cbf5e
25aa07d7c731bee843660fde4ad5e9c28cea2105
/src/com/example/Happy/HappyActivity.java
d691c4a0e96b37e63c645d815a0780bb9f2f0a73
[]
no_license
sree-ksl/Happy
40c61190850a57a7ba67c018dde6ec9ff5ec9ed3
f5162b72c03fccd7dcd7a69aa66653348dc4524c
refs/heads/master
2021-01-10T21:16:04.075550
2014-12-05T11:32:30
2014-12-05T11:32:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,471
java
package com.example.Happy; import android.app.ActionBar; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import com.parse.ParseAnalytics; public class HappyActivity extends Activity { protected TextView mTodayActivity; protected TextView mKarmaActivity; public static final String TAG = HappyActivity.class.getSimpleName(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ParseAnalytics.trackAppOpened(getIntent()); //hide the action bar ActionBar actionBar = getActionBar(); actionBar.hide(); mTodayActivity = (TextView)findViewById(R.id.todayAct); mTodayActivity.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intentToday = new Intent(HappyActivity.this,TodayActivity.class); startActivity(intentToday); } }); mKarmaActivity = (TextView)findViewById(R.id.karma); mKarmaActivity.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intentKarma = new Intent(HappyActivity.this,KarmaActivity.class); startActivity(intentKarma); } }); } }
3f8b97ca9ebb0d06b6fc896a290613afd87147f2
f28d2a8b20c9113d143a42a80f59b90a7ed01554
/src/main/java/com/ds/tarefa/exceptions/DatabaseException.java
ba79c0f43e206e86c6a94542b93a8ce035670bd0
[]
no_license
vitorpl/ds-tarefa1
e6b7311a8101bc54a7ea2757ca1f262298280d6c
14e4e1334f5879ef56f10caa1e1798e780c2b548
refs/heads/main
2023-05-12T08:22:21.382757
2021-06-03T19:41:48
2021-06-03T19:41:48
373,615,815
0
0
null
null
null
null
UTF-8
Java
false
false
225
java
package com.ds.tarefa.exceptions; public class DatabaseException extends RuntimeException { private static final long serialVersionUID = 5172298641329460495L; public DatabaseException(String msg) { super(msg); } }
9c8e3a69e2751e00ac27dcfc6269e75e3012ee1e
3f0a7dc1c7ff402834d73fbad69b56598f846e76
/Layouts/Ex3CavanhasGourmet/app/src/test/java/com/example/cavanhaman/ex3cavanhasgourmet/ExampleUnitTest.java
238e9cc7c8450b365627e0b3e5532d9382b9832c
[]
no_license
CavanhaMan/DDM
fd55d0235da414a449330dcc3e755bf4b6819a66
a3849266da29832d82d113af7c5d539e5d608575
refs/heads/master
2020-03-26T09:09:13.275110
2018-09-10T18:00:43
2018-09-10T18:00:43
144,737,726
0
1
null
null
null
null
UTF-8
Java
false
false
418
java
package com.example.cavanhaman.ex3cavanhasgourmet; import org.junit.Test; import static org.junit.Assert.*; /** * Example local unit test, which will execute on the development machine (host). * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ public class ExampleUnitTest { @Test public void addition_isCorrect() { assertEquals(4, 2 + 2); } }
9b215da7ecbc4ba9d8cb6114cbbf1fbc07b0ac2f
3bfccc8d9c2a1978d8d3320e0fd6ea7f4715e3e9
/app/src/main/java/com/mmgct/quitguide2/fragments/HistoryBarGraphFragment.java
252def3560103ba017cf4f5df6d5e632b7d7a4b4
[]
no_license
irakligeo/quiteguide
4c73c1d8996c65ad31b47368dd22a90b402c4a1e
ce8fbf9d5eee2a39dd2c42a928c64a1616e0ceb6
refs/heads/master
2021-01-11T22:59:29.638487
2017-02-09T14:34:43
2017-02-09T14:34:43
78,531,165
0
0
null
null
null
null
UTF-8
Java
false
false
3,564
java
package com.mmgct.quitguide2.fragments; import android.os.Bundle; import android.support.annotation.Nullable; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; import com.mmgct.quitguide2.R; import com.mmgct.quitguide2.managers.DbManager; import com.mmgct.quitguide2.utils.Common; import com.mmgct.quitguide2.utils.Constants; import java.util.List; /** * Created by 35527 on 12/16/2015. */ public class HistoryBarGraphFragment extends BaseFragment { private static final String TAG = "HistoryChartFragment"; public static final String URL_KEY = "url"; public static final String LABEL_TOKEN = "#LABEL_TOKEN#"; // See html file, line.html public static final String DATA_TOKEN = "#DATA_TOKEN#"; public static final String WIDTH_TOKEN = "#WIDTH_TOKEN#"; public static final String HEIGHT_TOKEN = "#HEIGHT_TOKEN#"; private View rootView; private String mUrl; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.fragment_chart_line_history, null, false); WebView webView = (WebView) rootView.findViewById(R.id.plot_web_view); Bundle args = getArguments(); if (args != null && args.containsKey(URL_KEY)) { mUrl = args.getString(URL_KEY); } // Settings webView.getSettings().setAllowUniversalAccessFromFileURLs(true); webView.getSettings().setAllowFileAccessFromFileURLs(true); webView.getSettings().setJavaScriptEnabled(true); if (mUrl != null) { StringBuilder html = new StringBuilder(Common.assetFileToString(mUrl, getActivity())); List<DbManager.BarGraphItem> graphItems = DbManager.getInstance().getBarItems(); StringBuilder labels = new StringBuilder(); StringBuilder data = new StringBuilder(); for (DbManager.BarGraphItem item : graphItems) { labels.append("\""); labels.append(item.getLabel()); labels.append("\""); labels.append(","); data.append("\""); data.append(item.getValue()); data.append("\""); data.append(","); } // Remove trailing comma if (labels.length() > 0 && data.length() > 0) { labels.deleteCharAt(labels.length()-1); data.deleteCharAt(data.length()-1); } DisplayMetrics dm = getResources().getDisplayMetrics(); int substringStart; html.replace(substringStart = html.indexOf(WIDTH_TOKEN), substringStart + WIDTH_TOKEN.length(), String.valueOf(Math.floor(dm.widthPixels/dm.density-8*dm.density))); html.replace(substringStart = html.indexOf(HEIGHT_TOKEN), substringStart + HEIGHT_TOKEN.length(), String.valueOf(Math.floor(dm.widthPixels/dm.density-14*dm.density))); html.replace(substringStart = html.indexOf(LABEL_TOKEN), substringStart + LABEL_TOKEN.length(), labels.toString()); html.replace(substringStart = html.indexOf(DATA_TOKEN), substringStart + DATA_TOKEN.length(), data.toString()); webView.loadDataWithBaseURL("file:///android_asset/", html.toString(), "text/html", "UTF-8", null); } webView.setBackgroundColor(getResources().getColor(R.color.transparent)); return rootView; } }
787bab710e30e5538ef31e749f0a661d7e3d3b8c
8cf4faee1d8389907fd8d5a179343f6d5e1380c8
/src/main/java/org/apache/maven/wrapper/cli/ProjectPropertiesCommandLineConverter.java
8b1a110f8762f135f15b9cf5e2c358a99390c9a6
[ "Apache-2.0" ]
permissive
mkazi1903/mvnw
0b414d819e001c975a15c3f69a7ce8cdfc543cd9
ce736a94b3c5feb89494fad8f4b0fcf02c7ea818
refs/heads/master
2021-04-26T15:02:01.655162
2017-01-28T19:24:04
2017-01-28T19:24:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,121
java
/* * Copyright 2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.maven.wrapper.cli; public class ProjectPropertiesCommandLineConverter extends AbstractPropertiesCommandLineConverter { @Override protected String getPropertyOption() { return "P"; } @Override protected String getPropertyOptionDetailed() { return "project-prop"; } @Override protected String getPropertyOptionDescription() { return "Set project property for the build script (e.g. -Pmyprop=myvalue)."; } }
831eab3c913aa4e5690501c5df01ad1a437c4fb7
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-422-8-1-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/parser/wikimodel/DefaultXWikiGeneratorListener_ESTest.java
cf1681cc7fa77bbb3a12d489b1ea338ad71c7e7f
[]
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
610
java
/* * This file was automatically generated by EvoSuite * Wed Apr 08 17:42:30 UTC 2020 */ package org.xwiki.rendering.internal.parser.wikimodel; 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 DefaultXWikiGeneratorListener_ESTest extends DefaultXWikiGeneratorListener_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
f88fb4bfae5bde50912e3782f7503d3428ef697b
b2d347537cc28147de422f6ec980f272e9d15fb8
/src/test/java/com/shipyard/domain/builder/ShipBuilder.java
b5b6b907d97068979816910d4f86a15b46700cc4
[]
no_license
vpeurala/viiksiniekka
ee627b5ee20bff512d4f5a34fb3176367a15abe8
4c01c651ae09ef510b40eecaaf161519f5fc9c7d
refs/heads/master
2020-04-06T04:12:47.329546
2019-01-28T07:44:21
2019-01-28T07:44:21
83,014,078
0
0
null
null
null
null
UTF-8
Java
false
false
1,119
java
package com.shipyard.domain.builder; import com.shipyard.domain.data.Ship; import java.util.Objects; public class ShipBuilder { private Long id; private String code; private String description; public static ShipBuilder from(Ship ship) { return new ShipBuilder() .withId(ship.getId()) .withCode(ship.getCode()) .withDescription(ship.getDescription()); } /** * Surrogate key. */ public ShipBuilder withId(Long id) { Objects.requireNonNull(id); this.id = id; return this; } /** * The ship code, for example "N 2". */ public ShipBuilder withCode(String code) { Objects.requireNonNull(code); this.code = code; return this; } /** * The ship description, for example "Ship 2". */ public ShipBuilder withDescription(String description) { Objects.requireNonNull(description); this.description = description; return this; } public Ship build() { return new Ship(id, code, description); } }
451a79c43c32f1fc243c62a4c904237b687d491f
ac0a5574bc05367d57d49366a10d6be884b4841f
/src/main/java/com/datastructure/recursion/MergeApp.java
2027dec3e45a2a16ecff00a6115f7ba762c10d04
[]
no_license
stupidcupid/algorithm
c6ca4a5e1fbf6cab26c786c95871584a8f90feff
62e2981a89d1f719335bebce9dd4379d96274edc
refs/heads/master
2021-06-22T10:09:10.211352
2017-08-08T02:55:34
2017-08-08T02:55:34
97,787,563
0
0
null
null
null
null
UTF-8
Java
false
false
1,221
java
package com.datastructure.recursion; /** * Created by nanzhou on 2017/7/31. */ public class MergeApp { /** * 归并算法 * * @param args */ public static void main(String[] args) { int[] arrayA = new int[]{ 23, 44, 56, 90 }; int[] arrayB = new int[]{ 2, 6, 43, 234, 244, 668 }; int[] arrayC = new int[10]; merge(arrayA, 4, arrayB, 6, arrayC); for (int i = 0; i < 10; i++) { System.out.print(arrayC[i] + " ,"); } } /** * 看不懂 妈的 * * @param arrayA * @param sizeA * @param arrayB * @param sizeB * @param arrayC */ public static void merge(int[] arrayA, int sizeA, int[] arrayB, int sizeB, int[] arrayC) { int aDex = 0, bDex = 0, cDex = 0; while (aDex < sizeA && bDex < sizeB) if (arrayA[aDex] < arrayB[bDex]) arrayC[cDex++] = arrayA[aDex++]; else arrayC[cDex++] = arrayB[bDex++]; while (aDex < sizeA) arrayC[cDex++] = arrayA[aDex++]; while (bDex < sizeB) arrayC[cDex++] = arrayB[bDex++]; } }
b1e55726b8cbfa72fa6cf9ff94dc131c31180daa
fcb2986504f025f9ed7edfe61500857afb20791c
/src/teste/Teste.java
e9c08fee5cf48823d3222e609df56943e7d0df65
[]
no_license
vikpixels/teste
0900d1a4a387cf48545c2fc9cf3f12efac8d28fa
f0d34f77df0fb7eec86ee36a75b4019f457b6b1d
refs/heads/master
2020-03-16T17:10:43.521129
2018-05-09T22:45:53
2018-05-09T22:45:53
132,820,152
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package teste; /** * * @author Vitor */ public class Teste { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here } }
[ "Vitor@DESKTOP-57CAVKC" ]
Vitor@DESKTOP-57CAVKC
b6b966f3830e6c315ef439f0907318f37c12e471
35dc4c7a30e7e132875be7a1f825ff948dc4cebe
/top_web/yujia-top-bang-api/api/src/main/java/com/yujia/topbang/api/service/IProductService.java
88a6b377f034984b72a8160c3e491a7593261732
[]
no_license
youinmelin/git_mine
c5133878c6a871d2c8e77a124095285f98e9343c
6f8b1a5249078542c741ea8a6c2fb363a1097515
refs/heads/master
2022-12-25T11:04:16.860096
2020-11-16T14:07:42
2020-11-16T14:07:42
216,978,421
0
0
null
2022-12-16T00:39:57
2019-10-23T05:51:47
JavaScript
UTF-8
Java
false
false
2,541
java
package com.yujia.topbang.api.service; import com.alibaba.fastjson.JSONObject; import com.yujia.topbang.api.entity.ProductDO; import com.baomidou.mybatisplus.extension.service.IService; import com.yujia.topbang.api.entity.UserProductBrowseHistoryDO; import com.yujia.topbang.api.entity.UserProductCollectionDO; import org.springframework.transaction.annotation.Transactional; /** * <p> * 产品 服务类 * </p> * * @author caorui * @since 2020-08-07 */ public interface IProductService extends IService<ProductDO> { /** * 产品分页 * * @param productDO * @return */ JSONObject getMgrPageList(ProductDO productDO); /** * 产品审核 * * @param productDO */ void auditProduct(ProductDO productDO); /** * 前端产品分页 * * @param productDO * @return */ JSONObject getWebPageList(ProductDO productDO); /** * 产品发布 * * @param productDO */ void releaseProduct(ProductDO productDO); /** * 获取产品详情 * * @param prodId * @return */ JSONObject getProductInfo(Long prodId); /** * 编辑时获取产品详情 * * @param prodId * @return */ JSONObject getEditProductInfo(Long prodId); /** * 删除产品 * * @param userId * @param prodId */ void deleteProduct(Long userId, Long prodId); /** * 获取卖家管理中心首页 * * @param userId * @return */ JSONObject getSellerIndex(Long userId); /** * 获取买家管理中心首页 * * @param userId * @return */ JSONObject getBuyerIndex(Long userId); /** * 产品试用申请 * * @param prodId * @param userId */ void productGiveTrial(Long prodId, Long userId); /** * 获取企业用户信息 * * @param userId * @return */ JSONObject getCompanyInfo(Long userId); /** * 前端产品浏览记录分页 * * @param userProductBrowseHistoryDO * @return */ JSONObject getWebProductHistoryList(UserProductBrowseHistoryDO userProductBrowseHistoryDO); /** * 前端产品收藏分页 * * @param userProductCollectionDO * @return */ JSONObject getWebProductCollectionList(UserProductCollectionDO userProductCollectionDO); /** * 行业产品 * * @param id * @return */ JSONObject getIndustryProdList(Long id); }
e2d4ccbe063c491782cf4c2991bcd6f6a3c20213
21274c867d395496cb7b06024e1268cd8a55ded0
/Week02-32805/src/Week02/GerySantoso/id/ac/umn/Tugas2.java
61e6d3b8ffa37d4c463bef0d050af4dbdac5c911
[]
no_license
gerysantoso03/OOP-in-Java
81beb10e0b89c9b73c1caf564445162a47a5b8d9
31dfddb749f0d4e9b52d5500ca2ac9d0a159a792
refs/heads/master
2022-12-17T12:42:22.762699
2020-09-21T16:37:45
2020-09-21T16:37:45
297,225,405
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
package Week02.GerySantoso.id.ac.umn; import java.util.Scanner; public class Tugas2 { public static void main(String[] args) { // TODO Auto-generated method stub int temp; boolean isPrime=true; Scanner scan= new Scanner(System.in); System.out.println("Masukan angka :"); int num = scan.nextInt(); for(int i=2;i<=num/2;i++) { temp=num%i; if(temp==0) { isPrime=false; break; } } //If isPrime is true then the number is prime else not if(isPrime) System.out.println(num + " adalah bilangan prima"); else System.out.println(num + " adalah bukan bilangan prima"); } }
16a16b3d82b7a355640e939213ce6e637dcfdec9
bc9b06bfeaad4c89b8338aee776456fefcf23cc4
/src/main/java/warmachine/mcqueen/prueba/controller/DevolucionController.java
6339522666686b5ff2fc96435951262d54cf0391
[]
no_license
israel0903/proyectocar
5375b31a286ff15f890d041bc4fdcd3839b3a3c2
35aa060860d5c50bcd9ef244a4157eade33dcf40
refs/heads/master
2020-03-20T22:02:18.365741
2018-06-21T15:32:30
2018-06-21T15:32:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,839
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package warmachine.mcqueen.prueba.controller; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RequestMapping; import java.util.List; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import warmachine.mcqueen.prueba.model.ArriendoModel; import warmachine.mcqueen.prueba.model.DevolucionModel; /** * * @author Fritang4 */ @RestController @RequestMapping("/devolucion") public class DevolucionController { @GetMapping() public List<DevolucionModel> list() { return DevolucionModel.devoluciones; } @GetMapping("/{id}") public DevolucionModel get(@PathVariable String id) { DevolucionModel devolucion = new DevolucionModel(); return devolucion.buscaDevolucion(Integer.parseInt(id)); } @PutMapping("/{id}") public ResponseEntity<DevolucionModel> put(@PathVariable String id, @RequestBody DevolucionModel devolucionEditar) { DevolucionModel devolucion = new DevolucionModel(); return new ResponseEntity<>(devolucion.editarDevolucion(Integer.parseInt(id), devolucionEditar), HttpStatus.OK); } @PostMapping public ResponseEntity<?> post(@RequestBody DevolucionModel nuevaDevolucion) { DevolucionModel devolucion = new DevolucionModel(); ArriendoModel a = new ArriendoModel(); nuevaDevolucion.setArriendo(a.buscaArriendo(nuevaDevolucion.getArriendo().getIdArriendo())); if (devolucion.nuevaDevolucion(nuevaDevolucion)) { return new ResponseEntity<>(HttpStatus.CREATED); }else{ return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE); } } @DeleteMapping("/{id}") public ResponseEntity<?> delete(@PathVariable String id) { DevolucionModel devolucion = new DevolucionModel(); if (devolucion.eliminarDevolucion(Integer.parseInt(id))) { return new ResponseEntity<>(HttpStatus.OK); }else{ return new ResponseEntity<>(HttpStatus.EXPECTATION_FAILED); } } }
60ce3ede50fb6a11a906b3bf80403645a27d35be
9231c744f49cbcec9e03c0ea25b516273bb6a6d1
/app/src/main/java/delilah/inuappcenter/mapus/OfficeActivity.java
580cfba6ac9ae66e88d63ac4fdaea0b9ce6fc8aa
[]
no_license
delilah1004/PreviousMapus
3486f41f08854b3ac28765acd83a33ae30e0571f
36fd70df518c1344eb61528878d63ce42533d94e
refs/heads/master
2020-04-25T14:04:32.930802
2019-08-03T08:38:06
2019-08-03T08:38:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,958
java
package delilah.inuappcenter.mapus; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import java.util.ArrayList; import delilah.inuappcenter.mapus.model.OfficeModel; import delilah.inuappcenter.mapus.network.NetworkController; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; public class OfficeActivity extends AppCompatActivity { RecyclerView officeRecyclerView; RecyclerView.LayoutManager officeLayoutManager; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activitiy_office); officeRecyclerView = findViewById(R.id.office_recycler_view); officeRecyclerView.setHasFixedSize(true); officeLayoutManager = new LinearLayoutManager(this); officeRecyclerView.setLayoutManager(officeLayoutManager); ArrayList<OfficeListInfo> officeInfoArrayList = new ArrayList<>(); officeInfoArrayList.add(new OfficeListInfo("건물이름","건물번호")); OfficeAdapter officeAdapter = new OfficeAdapter(officeInfoArrayList); officeRecyclerView.setAdapter(officeAdapter); OfficeInformation(); clickListenerSetting(); } public void OfficeInformation() { Call<ArrayList<OfficeModel>> office = NetworkController.getInstance().getNetworkInterface().getOfficeInfo(); office.enqueue(new Callback<ArrayList<OfficeModel>>() { @Override public void onResponse(Call<ArrayList<OfficeModel>> call, Response<ArrayList<OfficeModel>> response) { ArrayList<OfficeModel> office = response.body(); ArrayList<OfficeListInfo> officeInfoArrayList = new ArrayList<>(); for (int i = 0; i < office.size(); i++) { Log.d("사무실.번호", office.get(i).roomId); Log.d("사무실.이름", String.valueOf(office.get(i).title)); officeInfoArrayList.add(new OfficeListInfo(office.get(i).roomId, String.valueOf(office.get(i).title))); } OfficeAdapter officeAdapter = new OfficeAdapter(officeInfoArrayList); officeRecyclerView.setAdapter(officeAdapter); } @Override public void onFailure(Call<ArrayList<OfficeModel>> call, Throwable t) { } }); } private void clickListenerSetting() { /* button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(OfficeActivity.this, EmployeeActivity.class); startActivity(intent); } }); */ } }
f97f85a7fc1694995be491bb2ade3b9f2beda414
e4a6849d35055846b301c6933162e96a27238f03
/src/com/jihe/ParallelStream_test.java
815ca8bbd56937a4a8c5631c27a06c3dc39c02e1
[]
no_license
zsh1127104426/18rj2b
afcfc8bb7b227b88604da0a7a90e3f5bb1472786
91d0fcdf720d8dcf6436139474a2fd7bf35f624e
refs/heads/master
2020-11-25T18:18:44.002900
2019-12-18T08:11:07
2019-12-18T08:11:07
228,789,981
0
0
null
null
null
null
UTF-8
Java
false
false
549
java
package com.jihe; import java.util.Arrays; import java.util.List; import java.util.stream.Stream; public class ParallelStream_test { public static void main(String[] args) { List<String>list=Arrays.asList("张三","李四","张小明","张阳"); Stream<String>ps=list.parallelStream(); if(ps.isParallel()) { System.out.println("只是一个并行流"); } Stream<String>stream=Stream.of("张三","李四","张小明","张阳"); Stream<String>p=stream.parallel(); System.out.println(p.isParallel()); } }
c7a71fe1354107708ed3feddc547d6adcb34fc01
6f3db497af248f0bc79fc6dee737afea0e216631
/src/main/java/edu/wpi/first/jni/net/fornwall/jelf/ElfException.java
fff9b03a586c227602e7be40a6b4a79e4814fd1b
[]
no_license
wpilibsuite/gradle-jni
428658fb9021cfdaa287ff6c19283b23f690804f
e6ff198e86072c02b71bfeb65860a33661abf50f
refs/heads/main
2022-11-21T23:14:20.574055
2022-11-10T15:26:44
2022-11-10T15:26:44
128,705,462
13
6
null
2022-11-10T15:26:45
2018-04-09T02:49:01
Java
UTF-8
Java
false
false
581
java
package edu.wpi.first.jni.net.fornwall.jelf; /** * Generic exception class for all exceptions which occur in this package. Since * there is no mechanism built into this library for recovering from errors, the * best clients can do is display the error string. */ public class ElfException extends RuntimeException { private static final long serialVersionUID = 1L; public ElfException(String message) { super(message); } public ElfException(Throwable cause) { super(cause); } public ElfException(String message, Throwable cause) { super(message, cause); } }
685965e2fdd961ff2c73c830b0e2dae45218b633
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Jsoup-87/org.jsoup.parser.Tag/BBC-F0-opt-30/19/org/jsoup/parser/Tag_ESTest_scaffolding.java
2f195f5f90cc28a22997295454eed635dc020163
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
4,490
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Oct 20 17:32:23 GMT 2021 */ package org.jsoup.parser; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class Tag_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.jsoup.parser.Tag"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { /*No java.lang.System property to set*/ } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(Tag_ESTest_scaffolding.class.getClassLoader() , "org.jsoup.helper.Validate", "org.jsoup.parser.ParseSettings", "org.jsoup.parser.Tag", "org.jsoup.internal.Normalizer" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(Tag_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.jsoup.helper.Validate", "org.jsoup.parser.Tag", "org.jsoup.parser.ParseSettings", "org.jsoup.internal.Normalizer", "org.jsoup.nodes.Attributes", "org.jsoup.nodes.Attributes$Dataset", "org.jsoup.internal.StringUtil", "org.jsoup.nodes.Node", "org.jsoup.nodes.Element", "org.jsoup.nodes.Document", "org.jsoup.nodes.Document$OutputSettings", "org.jsoup.nodes.Document$OutputSettings$Syntax", "org.jsoup.nodes.Entities", "org.jsoup.parser.CharacterReader", "org.jsoup.nodes.Entities$EscapeMode", "org.jsoup.nodes.Document$QuirksMode", "org.jsoup.nodes.Attributes$1", "org.jsoup.nodes.Attribute", "org.jsoup.parser.Parser", "org.jsoup.parser.Tokeniser", "org.jsoup.parser.ParseErrorList", "org.jsoup.parser.TokeniserState", "org.jsoup.parser.Token", "org.jsoup.parser.Token$Tag", "org.jsoup.parser.Token$StartTag", "org.jsoup.parser.Token$TokenType", "org.jsoup.parser.Token$EndTag", "org.jsoup.parser.Token$Character", "org.jsoup.parser.Token$Doctype", "org.jsoup.parser.Token$Comment", "org.jsoup.nodes.Entities$CoreCharset", "org.jsoup.nodes.Entities$1", "org.jsoup.nodes.BooleanAttribute" ); } }
d15ee6ff76fbb686a7e4307e39873bdd3f0451b6
ee68d6a0f9b2b0d3a1f2a9b3a3a8a2f80209d464
/src/main/java/pl/poznan/put/service/UserService.java
6b31643f5374ac7f7ff3eff84e40f68a050b6287
[]
no_license
epatsli/NewVersionJPA
6e2e30651715823bdfa60c3847afd8c25f96ec46
f760b9efc12ccc8cff45bf05303c9205c508f20d
refs/heads/master
2020-04-14T21:38:37.157661
2019-01-08T15:40:45
2019-01-08T15:40:45
164,135,050
0
0
null
null
null
null
UTF-8
Java
false
false
137
java
package pl.poznan.put.service; import pl.poznan.put.model.User; public interface UserService { User findByLogin(String login); }
6e4c0c52bee9dc56d299a1e43e8c27e40f107ccc
d7ec8b77e2b97a42306283e0f42b9902a3d8b97b
/src/com/robot/pojo/Account.java
62fccccadbc88ee3c2b8fc6d218a5cfc90326162
[]
no_license
RobotCloud/Bank-ATM
6abedffb02be721473a313e9094ff8e0ba1d2ee5
4c1e6ef63592967fc33e3b692353bcccb0ce704a
refs/heads/master
2022-12-05T07:34:15.400099
2020-08-22T09:24:15
2020-08-22T09:24:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,564
java
package com.robot.pojo; import java.math.BigDecimal; /** * 实体类,对应数据库的账户表。 * * @author 张宝旭 */ public class Account { private Integer id; private String name; private String cardNo; private String password; private BigDecimal money; public Account() { } public Account(Integer id, String name, String cardNo, String password, BigDecimal money) { this.id = id; this.name = name; this.cardNo = cardNo; this.password = password; this.money = money; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCardNo() { return cardNo; } public void setCardNo(String cardNo) { this.cardNo = cardNo; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public BigDecimal getMoney() { return money; } public void setMoney(BigDecimal money) { this.money = money; } @Override public String toString() { return "Account{" + "id=" + id + ", name='" + name + '\'' + ", cardNo='" + cardNo + '\'' + ", password='" + password + '\'' + ", money=" + money + '}'; } }
593d65a29bad7342a2d985127735231f8da60e36
702bf80c22d37b204de2c572e62039fe70f7cb01
/src/main/java/com/example/demo/service/UserService.java
b17c92325611cbfc24f18a3921ca641c09882623
[]
no_license
monsterLau/swaggerDemo
8640b77d30944722dbcc649ee95d58667b443e86
63460e28ebb6603a4356b32e8da1e6479a92cc59
refs/heads/master
2020-04-29T02:32:09.448970
2019-03-15T09:06:12
2019-03-15T09:06:12
175,772,572
0
0
null
null
null
null
UTF-8
Java
false
false
1,532
java
package com.example.demo.service; import com.example.demo.entity.User; import com.example.demo.mapper.UserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class UserService { @Autowired private UserMapper userMapper; public List<User> allUser() { List<User> userList = this.userMapper.allUser(); return userList; } public User getUserById(Integer id) { User user = userMapper.getUserById(id); return user; } public User userLogin(String username, String password) { User user = userMapper.userLogin(username, password); return user; } public void deleteUserByUsername(String username) { userMapper.deleteUserByUsername(username); } public User findUserByUsername(String usernmae) { User user = userMapper.findUserByUsername(usernmae); return user; } public int sameUsername(String username) { int sameUsername = userMapper.sameUsername(username); return sameUsername; } public int samePassword(String id, String password) { int samePassword = userMapper.samePassword(id, password); return samePassword; } public void insertUser(String username, String password) { userMapper.insertUser(username, password); } public void updateUserById(Integer id, String password) { userMapper.updateUserById(id, password); } }
2632dc9fa697e57bc99a0877a17159d983a2d2c9
7a69870d1365a26551aa3cbc7cb6dc8d889ec8c7
/Pratica/Resolucoes/Ficha11b/src/ContactPkg/InternationalContact.java
eae026576db8e26b39d2677f46cd4188bb3ac35c
[]
no_license
MoreiraJorge/Java-OOP-resources
cd86b8a6ce4fced4673ff152f227d31fce403dc3
35f48a8f8fe3e1f135c3d04ca9d485d83d18858a
refs/heads/master
2022-12-17T07:25:22.382790
2020-09-17T15:23:26
2020-09-17T15:23:26
176,912,705
0
0
null
null
null
null
UTF-8
Java
false
false
1,824
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ContactPkg; import CustomExceptions.CountryCodeException; import CustomExceptions.MultipleWordsException; import CustomExceptions.NotCapitalCharException; import CustomExceptions.NumberLengthException; /** * * @author Jorge Moreira */ public class InternationalContact extends Contact{ private String code; private String country; /** * * @param code * @param country * @param name * @param surName * @param phoneNmbr * @throws MultipleWordsException * @throws NotCapitalCharException * @throws NumberLengthException * @throws CountryCodeException */ public InternationalContact(String code, String country, String name, String surName, String phoneNmbr) throws MultipleWordsException, NotCapitalCharException, NumberLengthException, CountryCodeException { super(name, surName, phoneNmbr); if (!code.startsWith("00")){ throw new CountryCodeException("Os primeiros 2 digitos tem de ser 00 "); } for (int i = 0; i < country.length(); i++) { if (country.charAt(i) == ' ') { if (country.charAt(i + 1) != ' ') { throw new MultipleWordsException("O nome tem mais de uma palavra!!"); } } } this.code = code; this.country = country; } @Override public String toString() { String text = ""; text += super.toString(); text += "Pais : " + country + "\n"; text += "Codigo : " + code + "\n"; return text; } }
7023c535b47804a1c859cdf5c568803f2e17f3cb
3eb8ec6b1bd01b1d20e89b72e6d968db269b0906
/UF1/20170203_Inflate/App/app/src/main/java/net/iesmila/inflateapplication/PersonaListener.java
0e57eb9b299c6a95bd034f3cf380d7b85c8ffa61
[]
no_license
infomila/dam_m08
a4250b774ad7d1c337d05222a2c605509363fa89
db5bc7a00ade36e1e44f6dba5fb839f06fc72f3e
refs/heads/master
2021-01-11T21:50:43.565457
2017-04-12T05:02:06
2017-04-12T05:02:06
78,864,965
0
0
null
null
null
null
UTF-8
Java
false
false
905
java
package net.iesmila.inflateapplication; import android.text.Editable; import android.text.TextWatcher; import android.widget.RatingBar; import net.iesmila.inflateapplication.model.Persona; /** * Created by BERNAT on 09/02/2017. */ public class PersonaListener implements TextWatcher, RatingBar.OnRatingBarChangeListener { private Persona mPersona; public PersonaListener(Persona pPersona) { mPersona = pPersona; } @Override public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {} @Override public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {} @Override public void afterTextChanged(Editable editable) { mPersona.setNom(editable.toString()); } @Override public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) { mPersona.setRating(rating); } }
5664b0a11f5d9c5e1195639ad1a3d7f7315e3b9e
58423288dc7d87251cfb4bbafdba813d233346dc
/Grokking Coding Interview/12 Pattern Modified Binary Search/2 Ceiling of a Number (medium) 1.java
fc59e29b0234f016b8d20fd1fc06caa211c470bd
[]
no_license
odelrioa/code-learning
b02d633b028629af1e4a59fb2e351aef288f4383
8d1259987d38ba27482dd8e6166615b3336805b3
refs/heads/master
2023-06-23T10:36:26.296494
2021-07-17T15:49:15
2021-07-17T15:49:15
386,978,169
0
0
null
null
null
null
UTF-8
Java
false
false
1,142
java
class CeilingOfANumber { public static int searchCeilingOfANumber(int[] arr, int key) { if (key > arr[arr.length - 1]) // if the 'key' is bigger than the biggest element return -1; int start = 0, end = arr.length - 1; while (start <= end) { int mid = start + (end - start) / 2; if (key < arr[mid]) { end = mid - 1; } else if (key > arr[mid]) { start = mid + 1; } else { // found the key return mid; } } // since the loop is running until 'start <= end', so at the end of the while loop, 'start == end+1' // we are not able to find the element in the given array, so the next big number will be arr[start] return start; } public static void main(String[] args) { System.out.println(CeilingOfANumber.searchCeilingOfANumber(new int[] { 4, 6, 10 }, 6)); System.out.println(CeilingOfANumber.searchCeilingOfANumber(new int[] { 1, 3, 8, 10, 15 }, 12)); System.out.println(CeilingOfANumber.searchCeilingOfANumber(new int[] { 4, 6, 10 }, 17)); System.out.println(CeilingOfANumber.searchCeilingOfANumber(new int[] { 4, 6, 10 }, -1)); } }
95103323f6713ed091aa864f038d3bd19cfc44d3
d15803d5b16adab18b0aa43d7dca0531703bac4a
/com/whatsapp/_v.java
82be0de14b9623e5d69d4f846446f1f4bec54143
[]
no_license
kenuosec/Decompiled-Whatsapp
375c249abdf90241be3352aea38eb32a9ca513ba
652bec1376e6cd201d54262cc1d4e7637c6334ed
refs/heads/master
2021-12-08T15:09:13.929944
2016-03-23T06:04:08
2016-03-23T06:04:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
377
java
package com.whatsapp; import android.view.View; import android.view.View.OnClickListener; class _v implements OnClickListener { final NewGroup a; _v(NewGroup newGroup) { this.a = newGroup; } public void onClick(View view) { NewGroup.a(this.a).q = NewGroup.c(this.a).getText().toString(); r.a(NewGroup.a(this.a), this.a, 12); } }
10a7a3056f9dfd9d35bafca3a161814ecc99de0d
5c669eff2cf09c567da80d74883a9f4f6c761d5f
/src/main/java/com/example/demo/dto/UsersDto.java
a6d2a2098646e924ab8e4b41fa094deeecf15fe2
[]
no_license
azatgg/sample
8a7d2bdbb6ad33ed082a74b1a6cc927a006c5794
7a29b21afba9b2e86b9b4995f47dd4485d493e9d
refs/heads/master
2022-11-26T06:59:56.171389
2020-07-28T16:46:46
2020-07-28T16:46:46
283,253,612
0
0
null
null
null
null
UTF-8
Java
false
false
319
java
package com.example.demo.dto; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; import java.util.UUID; @JsonInclude(JsonInclude.Include.NON_NULL) @Data public class UsersDto { private UUID userId; private String lastName; private String firstName; private String patramonic; }
f82920e3189a889c7ab9e23347b2170ce44020d5
1fa0bad7ed5404b420a1bba9812143207c96da2e
/app/src/main/java/com/vince/mvp/WeatherModule/Model/HttpUtil.java
aab7b8bffc57e35cb0ead93fb14263a0f68d1581
[ "Apache-2.0" ]
permissive
AoMiao/MVP
20c467e90ebaac99e79acb5d853cd9d946d533ee
093d43727ea1b39621cdae803688bd71c32304aa
refs/heads/master
2021-01-18T15:45:19.228349
2017-04-07T15:38:08
2017-04-07T15:38:08
86,679,220
0
0
null
null
null
null
UTF-8
Java
false
false
1,017
java
package com.vince.mvp.WeatherModule.Model; import com.google.gson.Gson; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import okhttp3.Callback; import okhttp3.OkHttpClient; import okhttp3.Request; /** * Created by Administrator on 2017/3/30. */ public class HttpUtil { public static void sendHttpURL(String address, Callback callback){ OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder().url(address).build(); client.newCall(request).enqueue(callback); } public static Weather handleWeatherCode(String address){ try { JSONObject jsonObject = new JSONObject(address); JSONArray jsonArray = jsonObject.getJSONArray("HeWeather5"); String weatherContent = jsonArray.get(0).toString(); return new Gson().fromJson(weatherContent,Weather.class); } catch (JSONException e) { e.printStackTrace(); } return null; } }
3238001f9a8eaf8987ea7fe7630509d5bd63e93e
85f370adb976e0ae402c2baff0fcb41e4b037ad6
/JTalk/src/com/jtalk/dto/StudyDTO.java
6bad731920eed31daa44ab371af0bcae5769a707
[]
no_license
10milin/JTalk
a8f20a3fafd10a266acf28c4be91dbfe4174196a
0afc556971ad28debd5a7ace85a8ab4f0ce23158
refs/heads/master
2021-01-21T02:19:48.129068
2018-07-20T14:40:28
2018-07-20T14:40:28
101,888,083
1
1
null
2018-07-20T13:20:30
2017-08-30T13:58:06
Java
UTF-8
Java
false
false
2,667
java
package com.jtalk.dto; import java.sql.Date; import java.sql.Timestamp; public class StudyDTO { private int num; private String title; private String content; private String writerId; private String writerName; private String fileName; private String originFileName; private Timestamp writeDate; private int hit; private int period; private String category; private int recruitNum; private Date closingDate; public StudyDTO() {} public StudyDTO(int num, String title, String content, String writerId, String writerName, String fileName, String originFileName, Timestamp writeDate, int hit) { this.num = num; this.title = title; this.content = content; this.writerId = writerId; this.writerName = writerName; this.fileName = fileName; this.originFileName = originFileName; this.writeDate = writeDate; this.hit = hit; } public String getOriginFileName() { return originFileName; } public void setOriginFileName(String originFileName) { this.originFileName = originFileName; } public int getNum() { return num; } public void setNum(int num) { this.num = num; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getWriterId() { return writerId; } public void setWriterId(String writerId) { this.writerId = writerId; } public String getWriterName() { return writerName; } public void setWriterName(String writerName) { this.writerName = writerName; } public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } public Timestamp getWriteDate() { return writeDate; } public void setWriteDate(Timestamp writeDate) { this.writeDate = writeDate; } public int getHit() { return hit; } public void setHit(int hit) { this.hit = hit; } public int getPeriod() { return period; } public void setPeriod(int period) { this.period = period; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public int getRecruitNum() { return recruitNum; } public void setRecruitNum(int recruitNum) { this.recruitNum = recruitNum; } public Date getClosingDate() { return closingDate; } public void setClosingDate(Date closingDate) { this.closingDate = closingDate; } }
19ac0bcba6b185ff225ea01521c4074857be9ee0
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/MOCKITO-16b-2-17-Single_Objective_GGA-WeightedSum/org/mockito/internal/MockitoCore_ESTest_scaffolding.java
6a9ec85b5fd255d9b244ae36dc226fca1064bec5
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
5,050
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Tue Mar 31 12:27:59 UTC 2020 */ package org.mockito.internal; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class MockitoCore_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.mockito.internal.MockitoCore"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(MockitoCore_ESTest_scaffolding.class.getClassLoader() , "org.mockito.cglib.proxy.Callback", "org.mockito.configuration.AnnotationEngine", "org.mockito.exceptions.misusing.UnfinishedVerificationException", "org.mockito.exceptions.Reporter", "org.mockito.exceptions.verification.VerificationInOrderFailure", "org.mockito.configuration.DefaultMockitoConfiguration", "org.mockito.exceptions.misusing.NullInsteadOfMockException", "org.mockito.stubbing.VoidMethodStubbable", "org.mockito.internal.util.StringJoiner", "org.mockito.exceptions.misusing.NotAMockException", "org.mockito.internal.progress.MockingProgress", "org.mockito.internal.util.MockitoLogger", "org.mockito.exceptions.misusing.MissingMethodInvocationException", "org.mockito.exceptions.verification.SmartNullPointerException", "org.mockito.exceptions.verification.TooLittleActualInvocations", "org.mockito.internal.progress.MockingProgressImpl", "org.mockito.internal.configuration.GlobalConfiguration", "org.mockito.stubbing.DeprecatedOngoingStubbing", "org.mockito.cglib.proxy.MethodInterceptor", "org.mockito.internal.reporting.PrintingFriendlyInvocation", "org.mockito.exceptions.verification.TooManyActualInvocations", "org.mockito.exceptions.verification.ArgumentsAreDifferent", "org.mockito.exceptions.misusing.MockitoConfigurationException", "org.mockito.internal.progress.IOngoingStubbing", "org.hamcrest.SelfDescribing", "org.mockito.configuration.MockitoConfiguration", "org.mockito.exceptions.misusing.InvalidUseOfMatchersException", "org.mockito.internal.invocation.Invocation", "org.mockito.exceptions.misusing.UnfinishedStubbingException", "org.mockito.internal.debugging.DebuggingInfo", "org.mockito.exceptions.verification.NoInteractionsWanted", "org.mockito.internal.MockitoCore", "org.mockito.exceptions.PrintableInvocation", "org.mockito.internal.configuration.ClassPathLoader", "org.mockito.exceptions.base.MockitoException", "org.mockito.stubbing.Stubber", "org.mockito.internal.exceptions.base.ConditionalStackTraceFilter", "org.mockito.stubbing.Answer", "org.mockito.internal.exceptions.base.StackTraceFilter", "org.mockito.invocation.InvocationOnMock", "org.mockito.internal.progress.ArgumentMatcherStorageImpl", "org.mockito.exceptions.verification.WantedButNotInvoked", "org.mockito.internal.progress.ThreadSafeMockingProgress", "org.mockito.internal.verification.api.VerificationMode", "org.mockito.configuration.IMockitoConfiguration", "org.mockito.InOrder", "org.mockito.internal.MockitoInvocationHandler", "org.mockito.exceptions.misusing.WrongTypeOfReturnValue", "org.mockito.MockSettings", "org.mockito.stubbing.OngoingStubbing", "org.mockito.internal.progress.ArgumentMatcherStorage", "org.mockito.exceptions.base.MockitoAssertionError", "org.mockito.internal.util.MockUtil", "org.mockito.exceptions.verification.NeverWantedButInvoked", "org.mockito.internal.util.CreationValidator", "org.hamcrest.Matcher" ); } }
16138517cb9834f2efb2a80975c4c44db5436aaa
40fff6fbfbd2410cb653e117baae0dd8fc5018df
/ec-core/ec-core-dao/src/main/java/ai/yunxi/core/domain/mapper/TbOrderShippingMapper.java
4463e2de9f3ceb4b1439cd85793832be50cc4e8c
[]
no_license
yejunyang/easy-product
23418253ad50734ca535eaa338d2ad591768c735
9121fee6e3ea17600b7a6e1b08cd79fd571120d8
refs/heads/master
2022-12-13T10:23:18.904156
2020-08-23T17:02:54
2020-08-23T17:02:54
289,727,337
0
0
null
null
null
null
UTF-8
Java
false
false
1,002
java
package ai.yunxi.core.domain.mapper; import ai.yunxi.core.domain.entity.TbOrderShipping; import ai.yunxi.core.domain.entity.TbOrderShippingExample; import org.apache.ibatis.annotations.Param; import java.util.List; public interface TbOrderShippingMapper { long countByExample(TbOrderShippingExample example); int deleteByExample(TbOrderShippingExample example); int deleteByPrimaryKey(String orderId); int insert(TbOrderShipping record); int insertSelective(TbOrderShipping record); List<TbOrderShipping> selectByExample(TbOrderShippingExample example); TbOrderShipping selectByPrimaryKey(String orderId); int updateByExampleSelective(@Param("record") TbOrderShipping record, @Param("example") TbOrderShippingExample example); int updateByExample(@Param("record") TbOrderShipping record, @Param("example") TbOrderShippingExample example); int updateByPrimaryKeySelective(TbOrderShipping record); int updateByPrimaryKey(TbOrderShipping record); }
8ae584ee633d516d6e69572af07c593c35fb7ee5
fa31d535423e8ae8a1a7b86a47c6a3c0e86c753d
/src/main/java/com/example/demo/jpaEnities/Prospect.java
46711d50715a89092814f265f34b42d28ae396b5
[]
no_license
evyatar11/formsNew
c98b322dfc77a14139c82c22fb0f5f9931401701
6c9ed85df4591d3a83fc157f313f3669f7a4b867
refs/heads/master
2020-03-29T12:09:24.016288
2018-11-17T16:58:56
2018-11-17T17:03:10
149,886,670
0
0
null
2018-10-10T19:36:38
2018-09-22T14:53:33
Java
UTF-8
Java
false
false
1,107
java
package com.example.demo.jpaEnities; import javax.persistence.*; @Entity @Table(name = "Prospects") public class Prospect { @Id @GeneratedValue private Long id; private String prospectName; @OneToOne(cascade = CascadeType.DETACH) @JoinColumn(name = "user_id") private User user; public Prospect() { } public String getProspectName() { return prospectName; } public void setProspectName(String prospectName) { this.prospectName = prospectName; } // Commented out because of an infinity loop bug when unCommented - //TODO investigate why ini loop happens // public User getUser() { // return user; // } public void setUser(User user) { this.user = user; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Override public String toString() { return "Prospect{" + "id=" + id + ", prospectName='" + prospectName + '\'' + ", user=" + user + '}'; } }
bc22d94d257506bb8982ebd462bef78f2fc618f7
fd32ac1e3b090c371e0b6e3e623a54db51db6d0e
/StudentManager_system/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/customview/R.java
d6da132b4268c2a191701b1dfed3676c628b5b59
[]
no_license
Cap-hyperion/StudentManager-System
adae38b64548d7ad1276c86d2c9b986264c5f5e1
cc8ba0690a69a9609035fbf52b218ebfe410befc
refs/heads/master
2021-10-09T14:08:42.284784
2018-12-29T09:11:44
2018-12-29T09:11:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
10,457
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.customview; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f030027; public static final int font = 0x7f0300da; public static final int fontProviderAuthority = 0x7f0300dc; public static final int fontProviderCerts = 0x7f0300dd; public static final int fontProviderFetchStrategy = 0x7f0300de; public static final int fontProviderFetchTimeout = 0x7f0300df; public static final int fontProviderPackage = 0x7f0300e0; public static final int fontProviderQuery = 0x7f0300e1; public static final int fontStyle = 0x7f0300e2; public static final int fontVariationSettings = 0x7f0300e3; public static final int fontWeight = 0x7f0300e4; public static final int ttcIndex = 0x7f03020b; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f05006f; public static final int notification_icon_bg_color = 0x7f050070; public static final int ripple_material_light = 0x7f05007d; public static final int secondary_text_default_material_light = 0x7f05007f; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f060052; public static final int compat_button_inset_vertical_material = 0x7f060053; public static final int compat_button_padding_horizontal_material = 0x7f060054; public static final int compat_button_padding_vertical_material = 0x7f060055; public static final int compat_control_corner_material = 0x7f060056; public static final int compat_notification_large_icon_max_height = 0x7f060057; public static final int compat_notification_large_icon_max_width = 0x7f060058; public static final int notification_action_icon_size = 0x7f0600cc; public static final int notification_action_text_size = 0x7f0600cd; public static final int notification_big_circle_margin = 0x7f0600ce; public static final int notification_content_margin_start = 0x7f0600cf; public static final int notification_large_icon_height = 0x7f0600d0; public static final int notification_large_icon_width = 0x7f0600d1; public static final int notification_main_column_padding_top = 0x7f0600d2; public static final int notification_media_narrow_margin = 0x7f0600d3; public static final int notification_right_icon_size = 0x7f0600d4; public static final int notification_right_side_padding_top = 0x7f0600d5; public static final int notification_small_icon_background_padding = 0x7f0600d6; public static final int notification_small_icon_size_as_large = 0x7f0600d7; public static final int notification_subtext_size = 0x7f0600d8; public static final int notification_top_pad = 0x7f0600d9; public static final int notification_top_pad_large_text = 0x7f0600da; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f07006e; public static final int notification_bg = 0x7f07006f; public static final int notification_bg_low = 0x7f070070; public static final int notification_bg_low_normal = 0x7f070071; public static final int notification_bg_low_pressed = 0x7f070072; public static final int notification_bg_normal = 0x7f070073; public static final int notification_bg_normal_pressed = 0x7f070074; public static final int notification_icon_background = 0x7f070075; public static final int notification_template_icon_bg = 0x7f070076; public static final int notification_template_icon_low_bg = 0x7f070077; public static final int notification_tile_bg = 0x7f070078; public static final int notify_panel_notification_icon_bg = 0x7f070079; } public static final class id { private id() {} public static final int action_container = 0x7f08000d; public static final int action_divider = 0x7f08000f; public static final int action_image = 0x7f080010; public static final int action_text = 0x7f080016; public static final int actions = 0x7f080017; public static final int async = 0x7f080034; public static final int blocking = 0x7f080038; public static final int chronometer = 0x7f080041; public static final int forever = 0x7f080062; public static final int icon = 0x7f080069; public static final int icon_group = 0x7f08006a; public static final int info = 0x7f08006e; public static final int italic = 0x7f080070; public static final int line1 = 0x7f080075; public static final int line3 = 0x7f080076; public static final int normal = 0x7f08008b; public static final int notification_background = 0x7f08008c; public static final int notification_main_column = 0x7f08008d; public static final int notification_main_column_container = 0x7f08008e; public static final int right_icon = 0x7f08009e; public static final int right_side = 0x7f08009f; public static final int tag_transition_group = 0x7f0800de; public static final int tag_unhandled_key_event_manager = 0x7f0800df; public static final int tag_unhandled_key_listeners = 0x7f0800e0; public static final int text = 0x7f0800e1; public static final int text2 = 0x7f0800e2; public static final int time = 0x7f0800ea; public static final int title = 0x7f0800eb; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f09000e; } public static final class layout { private layout() {} public static final int notification_action = 0x7f0b0031; public static final int notification_action_tombstone = 0x7f0b0032; public static final int notification_template_custom_big = 0x7f0b0033; public static final int notification_template_icon_group = 0x7f0b0034; public static final int notification_template_part_chronometer = 0x7f0b0035; public static final int notification_template_part_time = 0x7f0b0036; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0d0036; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0e0115; public static final int TextAppearance_Compat_Notification_Info = 0x7f0e0116; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0e0117; public static final int TextAppearance_Compat_Notification_Time = 0x7f0e0118; public static final int TextAppearance_Compat_Notification_Title = 0x7f0e0119; public static final int Widget_Compat_NotificationActionContainer = 0x7f0e01bf; public static final int Widget_Compat_NotificationActionText = 0x7f0e01c0; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030027 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f0300dc, 0x7f0300dd, 0x7f0300de, 0x7f0300df, 0x7f0300e0, 0x7f0300e1 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300da, 0x7f0300e2, 0x7f0300e3, 0x7f0300e4, 0x7f03020b }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
5748deb6c9ae8e68c64d0d7a5c25018108337bb2
ce4b5cf93f27ca374ec2c6ae1b5a4477a7208df9
/BasicJava_chap14/src/funcinterface/andthentest/hoo/Main.java
6b9394cc117b82542c36f42b201a0d01b79e02ab
[]
no_license
younghoo88/practice_java
19e46677d3580250df9ae9611a5916cf64cdbd9f
443dc3d94502d2f57d2fcaeef53cb5d02d56640a
refs/heads/master
2021-01-10T01:09:13.395574
2015-11-14T08:10:22
2015-11-14T08:10:22
36,857,509
1
0
null
null
null
null
UTF-8
Java
false
false
414
java
package funcinterface.andthentest.hoo; public class Main { public static void main(String[] args) { TestInterface<Member> test = (t) -> { t.showInfo(); }; TestInterface<Member> test2 = (t) -> { System.out.println("test2 호출"); }; TestInterface<Member> test12 = test.andThen(test2); test12.foo(new Member("후")); System.out.println(test12.toString()); } }
2a9492868f06aff3cea5352ad4ff7576ca56de6a
9b0df4d4ae7ce204cb6726d21cb782500298bfc0
/src/main/java/com/ssi/BankController.java
248bb6c2d4e92280142c55fe7014d6f61577da56
[]
no_license
ayushi0298/Day-16-21-09-2019
591ee1506d442f3c478f8d4d3bbe4c2881983101
927cd970e224f3afccb4588aff864eeb678e0ace
refs/heads/master
2022-12-23T22:58:20.673789
2019-09-26T12:56:22
2019-09-26T12:56:22
210,998,449
0
0
null
2022-12-16T13:43:18
2019-09-26T04:18:37
Java
UTF-8
Java
false
false
2,316
java
package com.ssi; import java.util.List; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; @Controller public class BankController { @Autowired private ServiceInterface service; @RequestMapping("insertconfirm") public ModelAndView enterEmployee(@ModelAttribute("employee") DetailsModel emp) { service.insertEmployee(emp); ModelAndView mv = new ModelAndView("redirect:viewall"); return mv; } @RequestMapping("insertForm") public ModelAndView insertEmployee(@ModelAttribute("employee") DetailsModel emp) { ModelAndView mv = new ModelAndView("insert"); return mv; } @RequestMapping("delete") public ModelAndView deleteEmployee(@RequestParam("eno") int eno) { service.deleteEmployee(eno); ModelAndView mv = new ModelAndView("redirect:viewall"); return mv; } @RequestMapping("viewall") public ModelAndView showAllRecords() { List<DetailsModel> employees = service.getAllEmployee(); ModelAndView mv = new ModelAndView("view"); mv.addObject("employees", employees); return mv; } @RequestMapping("update") public ModelAndView getEmployee(@RequestParam("eno") int eno) { DetailsModel detail = service.getEmployee(eno); ModelAndView mv = new ModelAndView("update"); mv.addObject("updates", detail); return mv; } @RequestMapping("up") public ModelAndView updateEmployee(@ModelAttribute("employee") DetailsModel emp) { service.updateEmployee(emp); ModelAndView mv = new ModelAndView("redirect:viewall"); return mv; } @RequestMapping("savemp") public ModelAndView insertconfirm(@Valid @ModelAttribute("employee") DetailsModel model, BindingResult result) { if (result.hasErrors()) { ModelAndView mv = new ModelAndView("insert"); return mv; } // saving data service.insertEmployee(model); ModelAndView mv = new ModelAndView("redirect:viewall"); return mv; } }
[ "Ayushi@DESKTOP-OU0TTSG" ]
Ayushi@DESKTOP-OU0TTSG
64d4e7e298e689d172a63189b7fc87f140a4986f
820f193ba387ddfa13858048f8d3db08b21bbe16
/src/main/java/com/nju/yummy/controller/LoginController.java
98b835191e88598913ba7dfa26be407de1298db3
[]
no_license
hclbighomework/Yummy
87b82de1c62d4d2ced2546ee2274f1a95903ffcd
5dfbea29d6dcac7077329463358d977c39e8796d
refs/heads/master
2022-07-02T03:15:23.425105
2019-06-30T07:55:48
2019-06-30T07:55:48
192,057,816
0
0
null
null
null
null
UTF-8
Java
false
false
3,245
java
package com.nju.yummy.controller; import com.nju.yummy.model.Members; import com.nju.yummy.model.Restaurants; import com.nju.yummy.service.MembersService; import com.nju.yummy.service.RestaurantService; import org.springframework.http.HttpRequest; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.util.HashMap; import java.util.Map; @RestController public class LoginController { @Resource private MembersService membersService; @Resource private RestaurantService restaurantService; @RequestMapping(value = "/loginForMember", method = RequestMethod.POST) @ResponseBody public Map<String, Object> loginForMember(@RequestParam Map<String, Object> map, HttpServletRequest request) { String email = map.get("userID").toString(); String password = map.get("password").toString(); System.out.println(email + "\t" + password); Members members = membersService.login(email, password); Map<String, Object> res = new HashMap<>(); if (members == null) { res.put("message", "noMember"); } else if (members.getState() == 0) { res.put("message", "inactive"); } else if (members.getState() == -1) { res.put("message", "deleted"); } else { HttpSession session = request.getSession(); session.setAttribute("id", members.getMid()); session.setAttribute("type", "member"); res.put("message", "success"); } return res; } @RequestMapping(value = "/loginForRestaurant", method = RequestMethod.POST) @ResponseBody public Map<String, Object> loginForRestaurant(@RequestParam Map<String, Object> map, HttpServletRequest request) { String rid = map.get("userID").toString(); String password = map.get("password").toString(); Restaurants restaurants = restaurantService.login(rid, password); Map<String, Object> res = new HashMap<>(); if (restaurants == null) { res.put("message", "noRestaurant"); } else if (restaurants.getState() == 0) { res.put("message", "unApproved"); } else { HttpSession session = request.getSession(); session.setAttribute("id", rid); session.setAttribute("type", "restaurant"); res.put("message", "success"); } return res; } @RequestMapping(value = "/loginForManager", method = RequestMethod.POST) @ResponseBody public Map<String, Object> loginForManager(@RequestParam Map<String, Object> map, HttpServletRequest request) { String id = map.get("userID").toString(); String password = map.get("password").toString(); Map<String, Object> res = new HashMap<>(); if (id.equals("admin") && password.equals("admin")) { res.put("message", "success"); } else { res.put("message", "error"); } HttpSession session = request.getSession(); session.setAttribute("id", "admin"); session.setAttribute("type", "manager"); return res; } }
27896c580557a719909090bb80bba0232ca5e733
92c9ca930e062520960fe4290042bd32bc78844e
/SoftwareEvolution/src/test/series/first/SMM/Duplication/Duplication100.java
7a4bdb8b12c34bf7c4f29f83bcb2d009f2449bb0
[]
no_license
ruudvanderweijde/Software-Evolution-2013-2014
94bc84729f042356b82dc3c68c3de9e78b301bfa
054592405949e25637c8c1abc6e8475bd2c7306a
refs/heads/master
2021-01-23T07:20:57.728436
2013-11-19T11:36:44
2013-11-19T11:36:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,138
java
package test.series.first.SMM.Duplication; public class Duplication100 { public void Dummy1 () { int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; int m; int n; int o; int p; int q; int r; int s; int t; int u; int v; int w; int x; int y; int z; } public void Dummy2 () { int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; int m; int n; int o; int p; int q; int r; int s; int t; int u; int v; int w; int x; int y; int z; } public void Dummy3 () { int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; int m; int n; int o; int p; int q; int r; int s; int t; int u; int v; int w; int x; int y; int z; } public void Dummy4 () { int a; int b; int c; int d; int e; int f; int g; int h; int i; int j; int k; int l; int m; int n; int o; int p; int q; int r; int s; // int t; // int u; // int v; // int w; // int x; // int y; // int z; } }
046574a317c8aa4878777d172c5067e7423057ee
f369e33ba348df785e419b15d5655c77260c5667
/mic-demo/mic-demo-test/src/main/java/com/mic/demo/config/ApplicationContextConfig.java
dadbca45622b68f60b8e8129d1f051bf316f4ee6
[ "Apache-2.0" ]
permissive
yuyumimi/mic
3a3e25405baaede2359f86ca0ebcd6f8288105b6
92b6bfcb4f735ad34e9416b81a40c8df0f0ffa2b
refs/heads/master
2022-06-29T21:17:44.295779
2020-04-19T11:18:33
2020-04-19T11:18:33
235,518,628
0
0
Apache-2.0
2022-06-21T02:41:01
2020-01-22T07:11:12
Java
UTF-8
Java
false
false
432
java
package com.mic.demo.config; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.client.RestTemplate; @Configuration public class ApplicationContextConfig { @Bean @LoadBalanced public RestTemplate getRestTemplate(){ return new RestTemplate(); } }
974411fe66b6f0c7130511456148766e94f1d3c0
5f5b93f5b1605fd7c19fa5efcfd01ee3c47d3579
/app-dao/src/main/java/com/epam/brest/courses/dao/UserDaoImpl.java
d8256e10971700fe78496af5144bfc84cab9e52a
[]
no_license
Brest-Java-Course/Vladislav-Nikitin
7318425eb4eef439c18cf3680b42974b6b540bcb
c04bfefc32258d8789a27cd6dbbfd5f55761011b
refs/heads/master
2021-01-21T10:08:34.578418
2014-11-03T15:54:20
2014-11-03T15:54:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,604
java
package com.epam.brest.courses.dao; import com.epam.brest.courses.domain.User; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Value; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.util.Assert; import javax.sql.DataSource; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; public class UserDaoImpl implements UserDao { @Value("#{T(org.apache.commons.io.FileUtils).readFileToString((new org.springframework.core.io.ClassPathResource('${insert_into_user_path}')).file)}") public String addNewUserSql; @Value("#{T(org.apache.commons.io.FileUtils).readFileToString((new org.springframework.core.io.ClassPathResource('${remove_user}')).file)}") public String removeUserSql; public static final String UPDATE_USER_SQL = "update user set name = :name, login = :login where userid = :userid"; public static final String SELECT_USER_BY_LOGIN_SQL = "select userid, login, name from USER where LCASE(login) = ?"; public static final String SELECT_ALL_USERS_SQL = "select userid, login, name from USER"; public static final String SELECT_USER_BY_ID_SQL = "select userId, login, name from USER where userid = ?"; public static final String USER_ID = "userId"; public static final String LOGIN = "login"; public static final String NAME = "name"; private static final Logger LOGGER = LogManager.getLogger(); private JdbcTemplate jdbcTemplate; private NamedParameterJdbcTemplate namedJdbcTemplate; public void setDataSource(DataSource dataSource) { jdbcTemplate = new JdbcTemplate(dataSource); namedJdbcTemplate = new NamedParameterJdbcTemplate(dataSource); } @Override public void addUser(User user) { LOGGER.debug("addUser({}) ", user); Assert.notNull(user); //Assert.isNull(user.getUserId()); Assert.notNull(user.getLogin(), "User login should be specified."); Assert.notNull(user.getName(), "User name should be specified."); Map<String, Object> parameters = new HashMap(3); parameters.put(NAME, user.getName()); parameters.put(LOGIN, user.getLogin()); parameters.put(USER_ID, user.getUserId()); namedJdbcTemplate.update(addNewUserSql, parameters); } @Override public List<User> getUsers() { LOGGER.debug("get users()"); return jdbcTemplate.query(SELECT_ALL_USERS_SQL, new UserMapper()); } @Override public void removeUserById(Long userId) { LOGGER.debug("removeUser(userId={}) ", userId); Map<String, Object> args = new HashMap(1); args.put(USER_ID, userId); namedJdbcTemplate.update(removeUserSql, args); } @Override public User getUserByLogin(String login) { LOGGER.debug("getUserByLogin(login={})", login); return jdbcTemplate.queryForObject(SELECT_USER_BY_LOGIN_SQL, new String[]{login.toLowerCase()}, new UserMapper()); } @Override public User getUserById(long userId) { LOGGER.debug("getUserById(userId={})", userId); return jdbcTemplate.queryForObject(SELECT_USER_BY_ID_SQL, new UserMapper(), userId); } @Override public void updateUser(User user) { LOGGER.debug("updateUser({}).. ", user); Map<String, Object> parameters = new HashMap(3); parameters.put(NAME, user.getName()); parameters.put(LOGIN, user.getLogin()); parameters.put(USER_ID, user.getUserId()); namedJdbcTemplate.update(UPDATE_USER_SQL, parameters); } public class UserMapper implements RowMapper<User> { public User mapRow(ResultSet rs, int i) throws SQLException { User user = new User(); user.setUserId(rs.getLong(USER_ID)); user.setLogin(rs.getString(LOGIN)); user.setName(rs.getString(NAME)); return user; } } public boolean equals (User user1, User user2) { if (user1 == null && user2 == null) return false; if (user1.getClass() != user2.getClass()) { return false; } if (user1.getUserId()==user2.getUserId() && user1.getLogin()==user2.getLogin() && user1.getName()==user2.getName()) { return true; } return false; } }
9db6899d7858607e91b6cbd8875cfdd5f3fe8104
3780c54e1cb26bf657d191b8867c5be3fcbf041e
/app/src/main/java/org/hackathon/activities/PrescriptionActivity.java
2bc573be1f8b5bad978c476f375da19d65e69eef
[]
no_license
vrares/Hackathon-2017-Patient
c0149c0d9d59e57b39ad5d64e429490d5efea74e
2ef4888ed054974079d0860daeba1c4595bdb93f
refs/heads/master
2021-08-16T18:24:38.084076
2017-11-20T07:19:13
2017-11-20T07:19:13
111,375,541
0
0
null
null
null
null
UTF-8
Java
false
false
2,896
java
package org.hackathon.activities; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.widget.TextView; import org.hackathon.R; import org.hackathon.adapters.MedicationAdapter; import org.hackathon.common.model.Consultation; import org.hackathon.common.model.Prescription; import org.hackathon.common.net.Messenger; import org.hackathon.common.store.ConsultationStore; import org.hackathon.common.store.PrescriptionStore; import org.w3c.dom.Text; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Observable; import java.util.Observer; public class PrescriptionActivity extends AppCompatActivity implements Observer { public static final String CONSULTATION_ID = "consultationId"; private int consultationId; private Consultation consultation; private MedicationAdapter medicationAdapter; private TextView tvPrescriptionId; private TextView tvPrescriptionDate; private TextView tvPrescriptionPeriod; private RecyclerView rvMedication; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_prescription); consultationId = getIntent().getIntExtra(CONSULTATION_ID, -1); consultation = ConsultationStore.getInstance().get(consultationId); init(); } private void init() { tvPrescriptionId = findViewById(R.id.prescription_tv_prescription_id); tvPrescriptionDate = findViewById(R.id.prescription_tv_date); rvMedication = findViewById(R.id.medication_rv); List<Prescription> prescriptionList = PrescriptionStore.getInstance().list(new PrescriptionStore.ConsultationFilter(consultationId)); rvMedication = findViewById(R.id.medication_rv); medicationAdapter = new MedicationAdapter(prescriptionList, this); rvMedication.setAdapter(medicationAdapter); LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this); rvMedication.setLayoutManager(linearLayoutManager); medicationAdapter.notifyDataSetChanged(); tvPrescriptionId.setText(Integer.toString(consultationId)); Date prescriptionDate = new Date(consultation.getDate()); String formatPrescriptionDate = new SimpleDateFormat("dd-MMM-yyyy HH:mm").format(prescriptionDate); tvPrescriptionDate.setText(formatPrescriptionDate); } @Override protected void onStart() { super.onStart(); Messenger.getInstance().addObserver(this); } @Override protected void onStop() { super.onStop(); Messenger.getInstance().deleteObserver(this); } @Override public void update(Observable o, Object arg) { } }
5c2ed343e345b24c5cf6c3edede9e4da956bab52
cb5bba13d12f2dbd4dd861ef0ba46c23140703c8
/epps-project-myproject/myproject-system/src/main/java/com.tangbao.eppsprojectmyproject/modules/system/rest/JobController.java
88d986e3a2400edd39226c5dfddf4f8d0c594528
[]
no_license
lovelytangbao/epps-myproject
63d76aadf17a7457fca102081fab48a4016f7a7a
ccc264870341bb9a9a13057e932c622c88daf22e
refs/heads/master
2022-07-27T13:29:25.481132
2020-01-21T14:35:46
2020-01-21T14:35:46
235,358,901
0
0
null
2022-06-29T17:55:22
2020-01-21T14:16:19
Java
UTF-8
Java
false
false
3,416
java
package com.tangbao.eppsprojectmyproject.modules.system.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import com.tangbao.eppsprojectmyproject.aop.log.Log; import com.tangbao.eppsprojectmyproject.config.DataScope; import com.tangbao.eppsprojectmyproject.exception.BadRequestException; import com.tangbao.eppsprojectmyproject.modules.system.domain.Job; import com.tangbao.eppsprojectmyproject.modules.system.service.JobService; import com.tangbao.eppsprojectmyproject.modules.system.service.dto.JobQueryCriteria; import com.tangbao.eppsprojectmyproject.utils.ThrowableUtil; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Set; /** * @author Zheng Jie * @date 2019-03-29 */ @Api(tags = "系统:岗位管理") @RestController @RequestMapping("/api/job") public class JobController { private final JobService jobService; private final DataScope dataScope; private static final String ENTITY_NAME = "job"; public JobController(JobService jobService, DataScope dataScope) { this.jobService = jobService; this.dataScope = dataScope; } @Log("导出岗位数据") @ApiOperation("导出岗位数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('job:list')") public void download(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { jobService.download(jobService.queryAll(criteria), response); } @Log("查询岗位") @ApiOperation("查询岗位") @GetMapping @PreAuthorize("@el.check('job:list','user:list')") public ResponseEntity<Object> getJobs(JobQueryCriteria criteria, Pageable pageable){ // 数据权限 criteria.setDeptIds(dataScope.getDeptIds()); return new ResponseEntity<>(jobService.queryAll(criteria, pageable), HttpStatus.OK); } @Log("新增岗位") @ApiOperation("新增岗位") @PostMapping @PreAuthorize("@el.check('job:add')") public ResponseEntity<Object> create(@Validated @RequestBody Job resources){ if (resources.getId() != null) { throw new BadRequestException("A new "+ ENTITY_NAME +" cannot already have an ID"); } return new ResponseEntity<>(jobService.create(resources), HttpStatus.CREATED); } @Log("修改岗位") @ApiOperation("修改岗位") @PutMapping @PreAuthorize("@el.check('job:edit')") public ResponseEntity<Object> update(@Validated(Job.Update.class) @RequestBody Job resources){ jobService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Log("删除岗位") @ApiOperation("删除岗位") @DeleteMapping @PreAuthorize("@el.check('job:del')") public ResponseEntity<Object> delete(@RequestBody Set<Long> ids){ try { jobService.delete(ids); }catch (Throwable e){ ThrowableUtil.throwForeignKeyException(e, "所选岗位存在用户关联,请取消关联后再试"); } return new ResponseEntity<>(HttpStatus.OK); } }
0e8dbe3307bc458a32216644fc6fd1d322906a21
2dc1003a241352711268ad7e105dfa79221ba921
/Mod06_Spring_Web_MVC/src/main/java/blog/dao/BlogPostDAO.java
5663cfa09d9bcf75ec07b575753014050dd4a149
[]
no_license
Codecenter/courses-spring-framework
b8f4a96766e25ea794c5fc2ed0ed1b7e718c8acc
4946b3607497222422556cad0d3f6fad16c3d5ce
refs/heads/master
2016-09-05T18:21:39.313931
2015-04-03T12:18:14
2015-04-03T12:18:14
17,670,044
0
0
null
null
null
null
UTF-8
Java
false
false
1,210
java
/* * $Id$ * Copyright (c) Codecenter Oy. All rights reserved. * * This software is the proprietary information of Codecenter Oy. * Use is subject to license terms. */ package blog.dao; import java.util.List; import blog.model.BlogPost; public interface BlogPostDAO { /** * Returns a <code>List</code> containing all <code>BlogPost</code>s in the * database. * * @return a <code>List</code> containing <code>BlogPost</code>s */ List<BlogPost> getBlogPosts(); /** * Returns the specified <code>BlogPost</code> from the database. * * @param id an <code>int</code> identifying the <code>BlogPost</code> * @return a <code>BlogPost</code> containing the post */ BlogPost getBlogPost(int id); /** * Stores the <code>BlogPost</code> in the database. * * @param post a <code>BlogPost</code> * @return a <code>BlogPost</code> that has been stored in the database. */ BlogPost storeBlogPost(BlogPost post); /** * Deletes the specified <code>BlogPost</code> from the database. * * @param id an <code>int</code> identifying the <code>BlogPost</code> */ void deleteBlogPost(int id); }
4a2bddc248a078feb54fa91895053288a7a02480
d7d438d6f6d8b2044c2594278ab904561c96f383
/src/dao/TestUserDAO.java
735096272680529d353d630847b89da32442d581
[]
no_license
LZZT/AirLineReservation
9fcf0c73fc4e1ef0f2ffd1f463372642934b24fe
8ca54de55245914ad80270fca42a8fdb4e751e20
refs/heads/master
2021-01-17T14:05:31.520217
2017-05-20T04:32:05
2017-05-20T04:32:05
83,462,040
0
0
null
null
null
null
UTF-8
Java
false
false
2,144
java
package dao; import com.opensymphony.xwork2.util.ResolverUtil; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.query.Query; import util.HibernateUtil; import model.TestUser; /** * Created by QQZhao on 2/28/17. */ public class TestUserDAO { public void saveTestUser(TestUser testUser){ Session session = HibernateUtil.openSession(); Transaction tx = session.beginTransaction(); try{ session.save(testUser); tx.commit(); }catch (Exception ex){ if(null != tx){ tx.rollback(); } }finally { HibernateUtil.close(session); } } public TestUser getTestUser(int primaryKey){ TestUser testUser = null; Session session = HibernateUtil.openSession(); Transaction tx = session.beginTransaction(); try{ testUser = (TestUser) session.get(TestUser.class, primaryKey); tx.commit(); }catch (Exception ex){ if(null != tx){ tx.rollback(); } }finally { HibernateUtil.close(session); } return testUser; } public void deleteTestUser(int primaryKey){ Session session = HibernateUtil.openSession(); Transaction tx = session.beginTransaction(); try{ TestUser testUser = (TestUser) session.get(TestUser.class, primaryKey); session.delete(testUser); tx.commit(); }catch (Exception ex){ if(null != tx){ tx.rollback(); } }finally { HibernateUtil.close(session); } } public void updateTestUser(TestUser testUser){ Session session = HibernateUtil.openSession(); Transaction tx = session.beginTransaction(); try{ session.update(testUser); tx.commit(); }catch (Exception ex){ if(null != tx){ tx.rollback(); } }finally { HibernateUtil.close(session); } } }
fd93bd3172d4669a963d9334c1486fbeaab7c1bd
8265f7cdd685cdb89a5b4ffa16ef50e96f6f44e3
/app/src/main/java/com/kahuanbao/com/model/CoolectionBean.java
d7fb63fe8ebf2098a6bad7aa285ad626743ecb09
[ "Apache-2.0" ]
permissive
xuechenbo/MvpDemo
80ed3ea08f2ad726c8febd7f10959eb87eef36ef
d4fcf36b469c8aef74ee9f2fe6ca1dbb22471c3c
refs/heads/master
2020-05-29T14:15:17.113041
2019-06-04T08:00:32
2019-06-04T08:01:54
189,187,459
1
0
Apache-2.0
2019-05-30T03:49:00
2019-05-29T08:52:33
Java
UTF-8
Java
false
false
5,399
java
package com.kahuanbao.com.model; import java.util.List; /** * Created by Administrator on 2019/4/9. * */ public class CoolectionBean { /** * curPage : 1 * datas : [{"author":"","chapterId":0,"chapterName":"","courseId":13,"desc":"","envelopePic":"","id":54548,"link":"https://www.wanandroid.com/tools/mockapi","niceDate":"2019-03-29","origin":"","originId":-1,"publishTime":1553840893000,"title":"json链接","userId":21434,"visible":0,"zan":0}] * offset : 0 * over : true * pageCount : 1 * size : 20 * total : 1 */ private int curPage; private int offset; private boolean over; private int pageCount; private int size; private int total; private List<DatasBean> datas; public int getCurPage() { return curPage; } public void setCurPage(int curPage) { this.curPage = curPage; } public int getOffset() { return offset; } public void setOffset(int offset) { this.offset = offset; } public boolean isOver() { return over; } public void setOver(boolean over) { this.over = over; } public int getPageCount() { return pageCount; } public void setPageCount(int pageCount) { this.pageCount = pageCount; } public int getSize() { return size; } public void setSize(int size) { this.size = size; } public int getTotal() { return total; } public void setTotal(int total) { this.total = total; } public List<DatasBean> getDatas() { return datas; } public void setDatas(List<DatasBean> datas) { this.datas = datas; } public static class DatasBean { /** * author : * chapterId : 0 * chapterName : * courseId : 13 * desc : * envelopePic : * id : 54548 * link : https://www.wanandroid.com/tools/mockapi * niceDate : 2019-03-29 * origin : * originId : -1 * publishTime : 1553840893000 * title : json链接 * userId : 21434 * visible : 0 * zan : 0 */ private String author; private int chapterId; private String chapterName; private int courseId; private String desc; private String envelopePic; private int id; private String link; private String niceDate; private String origin; private int originId; private long publishTime; private String title; private int userId; private int visible; private int zan; public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public int getChapterId() { return chapterId; } public void setChapterId(int chapterId) { this.chapterId = chapterId; } public String getChapterName() { return chapterName; } public void setChapterName(String chapterName) { this.chapterName = chapterName; } public int getCourseId() { return courseId; } public void setCourseId(int courseId) { this.courseId = courseId; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } public String getEnvelopePic() { return envelopePic; } public void setEnvelopePic(String envelopePic) { this.envelopePic = envelopePic; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } public String getNiceDate() { return niceDate; } public void setNiceDate(String niceDate) { this.niceDate = niceDate; } public String getOrigin() { return origin; } public void setOrigin(String origin) { this.origin = origin; } public int getOriginId() { return originId; } public void setOriginId(int originId) { this.originId = originId; } public long getPublishTime() { return publishTime; } public void setPublishTime(long publishTime) { this.publishTime = publishTime; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } public int getVisible() { return visible; } public void setVisible(int visible) { this.visible = visible; } public int getZan() { return zan; } public void setZan(int zan) { this.zan = zan; } } }
f2ec5f84ebd69669535aa830a81baea4e057bf33
f17244e07e4f920018bfb35c96e953c702f3f272
/src/model/AbstractJoueur.java
3c0534b4d11df8fd2a3f9a385a0a4eb43b43e73b
[]
no_license
Soulnianfo/Wargame
443b0f47205c8a7a418b18191ace77995def7fbc
bf83c44c268f5742c71d30f7fc74835643b572cd
refs/heads/master
2021-06-08T12:18:14.031664
2016-11-22T12:53:07
2016-11-22T12:53:07
null
0
0
null
null
null
null
ISO-8859-1
Java
false
false
456
java
package model; public abstract class AbstractJoueur { protected Partie partie; public AbstractJoueur(Partie p) { this.partie = p; } /** * Appelée à chaque tour d'un joueur * TODO le joueur doit appeler notifierFinDeTour quand il finit son tour */ public abstract void jouerTour(); public abstract void ajouterPartie(Partie p); public void notifierFinDeTour(){ this.partie.notificationFinDeTour(); } }
1158b33a0519f92f86ad2a7fe497ad7bf8632e2a
7ddd192b0c4089a6ce33674104a4ceded0a01206
/ProBro/src/main/Messages.java
15f7bf67cf877dc48f71f71a5d956db1636744d0
[]
no_license
Tunetown/ProBro
cb9876be5891a1ba17eb8826a89e2ee450257cfa
e3bb648a238765e0ffdad5adba91d36b4159239a
refs/heads/master
2021-01-11T03:57:48.522913
2016-10-29T09:26:56
2016-10-29T09:26:56
71,243,167
0
0
null
null
null
null
UTF-8
Java
false
false
2,199
java
package main; import java.util.ResourceBundle; /** * Message handling. Messages and texts are all stored in a properties file. * * @author tweber * */ public class Messages { /** * Name of the resource file holding the messages and texts */ private static final String BUNDLE_NAME = "messages"; /** * Resource bundle for all texts and messages */ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); /** * Prevents instantiation of this class * */ private Messages() {} /** * Message getter (incl. generic variable replacement) * * @param key * @return */ public static String getString(String key) throws Throwable { return getString(key, null, null, null, null); } /** * Message getter (incl. generic variable replacement) * * @param key * @param val1 * @return */ public static String getString(String key, Object val1) throws Throwable { return getString(key, val1, null, null, null); } /** * Message getter (incl. generic variable replacement) * * @param key * @param val1 * @param val2 * @return */ public static String getString(String key, Object val1, Object val2) throws Throwable { return getString(key, val1, val2, null, null); } /** * Message getter (incl. generic variable replacement) * * @param key * @param val1 * @param val2 * @param val3 * @return */ public static String getString(String key, Object val1, Object val2, Object val3) throws Throwable { return getString(key, val1, val2, val3, null); } /** * Message getter (incl. generic variable replacement) * * @param key * @param val1 * @param val2 * @param val3 * @param val4 * @return */ public static String getString(String key, Object val1, Object val2, Object val3, Object val4) throws Throwable { String ret = RESOURCE_BUNDLE.getString(key); // Replace variables if (val1 != null) ret = ret.replace("&1", val1.toString()); if (val2 != null) ret = ret.replace("&2", val2.toString()); if (val3 != null) ret = ret.replace("&3", val3.toString()); if (val4 != null) ret = ret.replace("&4", val4.toString()); return ret; } }
3e0156d337ddac74320cf5ab2154d21b303af340
23a40cf9c868d0c580a1d135b43542f0ba8b09f3
/src/main/java/del/ac/id/demo/jpa/Role.java
efefe6f337b6ab1e3c88f9f0453c2aacbce9e98d
[]
no_license
daniellumbantobing/travellling
c89dc4b1322ce5683539786f4f4a0f70ecc75347
c5847f36dd7b7f9ec7672ea4cfe84e9120a5a5be
refs/heads/master
2022-12-26T19:51:30.940670
2020-10-09T02:25:00
2020-10-09T02:25:00
301,049,885
0
0
null
null
null
null
UTF-8
Java
false
false
742
java
package del.ac.id.demo.jpa; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name = "t_role") public class Role { @Id @Column(name="roleid") private int roleid; @Column(name="roledesc") private String roledesc; protected Role() {} public Role(int roleid, String roledesc) { this.roleid = roleid; this.roledesc = roledesc; } public void setRoleid(int roleid) {this.roleid = roleid;} public void setRoledesc(String roledesc) {this.roledesc = roledesc;} public int getRoleid() {return this.roleid;} public String getRoledesc() {return this.roledesc;} }