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
a926e20f07a73117d21581cd4cb35ad70fe9297d
4df8ecf0ba3d8a38dd8d2122675de679b47e355b
/AccountSystemWebSpringBoot/src/main/java/za/ac/nwu/web/sb/exception/RestServiceApplication.java
a209c94eba5fb4a8ab92d0fb01b49596efe8d9cd
[]
no_license
TawandaEmmauel/CMPG323_Project1
dac835a7385b3a97ef98cb36e9fecacb27876ce6
1d1fcd196687adc324f09981274d534adf412e5e
refs/heads/master
2023-09-01T16:42:02.948268
2021-10-11T05:57:18
2021-10-11T05:57:18
415,818,020
0
0
null
null
null
null
UTF-8
Java
false
false
361
java
//package za.ac.nwu.web.sb.exception; // //import org.springframework.boot.SpringApplication; //import org.springframework.boot.autoconfigure.SpringBootApplication; //@SpringBootApplication // //public class RestServiceApplication { // public static void main(String[] args) { // SpringApplication.run(RestServiceApplication.class, args); // } //}
002e285f4050489487eb098fb0dc1e70de35d4d2
29633c8b3a521021fd4dfc71a7dc1dfab6b0a1e9
/src/main/java/com/kurianski/comidinhasbank/model/request/TransferMoneyRequest.java
e6a6fd947a6e3e55bf8f1fee594c1693fe9c515e
[]
no_license
MatKurianski/ComidinhasBank
7c6958b8e95fe3376ee4b9199b9b54e240b8217c
30bf9b923967768fc12eb6f9d24adf37d0111d36
refs/heads/main
2023-01-19T17:29:02.942949
2020-11-29T22:04:11
2020-11-29T22:04:11
315,384,389
5
0
null
null
null
null
UTF-8
Java
false
false
643
java
package com.kurianski.comidinhasbank.model.request; import lombok.Getter; import lombok.RequiredArgsConstructor; import javax.validation.constraints.DecimalMin; import javax.validation.constraints.Digits; import javax.validation.constraints.NotNull; import java.math.BigDecimal; @Getter @RequiredArgsConstructor public class TransferMoneyRequest { @NotNull private final String toCpf; @DecimalMin(value = "0.0", inclusive = false, message = "Não é possível inserir números negativos") @Digits(integer = 10, fraction = 2, message = "Somente até duas casas decimais é permitido") private final BigDecimal amount; }
cebb2dcfa708966b45e1af7328df4dca5c9d9fc1
e2c883f52109815f7c410159692bd05eec3290ca
/utfpl/src/jats/utfpl/tree/Test_01.java
af15f835d3b7208e91fdf4fdafc90eed84978265
[]
no_license
alex-ren/org.ats-lang.postiats.jats
ae2ba41b68443fb9cfbd006889fe84631c949864
38b5a9e27a63ca2cc49d4bb9b6437bcf9c278976
refs/heads/master
2020-04-16T01:46:07.657517
2015-01-19T19:02:58
2015-01-19T19:02:58
7,862,346
0
0
null
null
null
null
UTF-8
Java
false
false
5,829
java
package jats.utfpl.tree; import jats.utfpl.ccomp.CCompUtils; import jats.utfpl.instruction.TID; import jats.utfpl.parser.NamingVisitor; import jats.utfpl.parser.UtfplLexer; import jats.utfpl.parser.UtfplParser; import jats.utfpl.parser.Utfpl_tree; import jats.utfpl.stfpl.StfplProgramParserJson; import jats.utfpl.stfpl.dynexp.ProgramStfpl2; import jats.utfpl.stfpl.dynexp.ProgramStfpl2Printer; import jats.utfpl.utils.FilenameUtils; import jats.utfpl.utils.MapScope; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import org.antlr.runtime.ANTLRFileStream; import org.antlr.runtime.CommonTokenStream; import org.antlr.runtime.RecognitionException; import org.antlr.runtime.TokenStream; import org.antlr.runtime.tree.CommonTree; import org.antlr.runtime.tree.CommonTreeNodeStream; public class Test_01 { /** * @param args * @throws IOException * @throws RecognitionException * @throws InterruptedException */ public static void main(String[] args) throws IOException, RecognitionException, InterruptedException { String [] paths = { // "test/src_mutfpl/17_extcode.mutfpl" // "test/src_ats/demo_mc_dyn.dats" // "test/src_ats/51_2_4_slots.dats" // "test/test_temp.utfpl" "test/src_ats/54_peterson.dats" }; for (String strPath: paths) { System.out.println("==Processing file " + strPath + "=========="); System.out.println(""); File path = new File(strPath); ProgramTree prog = null; if (FilenameUtils.isATS(path)) { path = FilenameUtils.toJson(path); String cmd = "patsopt -o " + path.getPath() + " --jsonize-2 -d " + strPath; System.out.println("cmd is " + cmd); Process child = Runtime.getRuntime().exec(cmd); int returnCode = child.waitFor(); System.out.println("returnCode is " + returnCode); if (0 == returnCode) { FileReader fReader = new FileReader(path); StfplProgramParserJson utfplParser = new StfplProgramParserJson(); ProgramStfpl2 uProg = utfplParser.trans(fReader); ProgramStfpl2Printer uPrinter = new ProgramStfpl2Printer(); String outputUTFPL = uPrinter.print(uProg); System.out.println("==utfpl's ast code (layer 01) is =========================="); System.out.println(outputUTFPL); //x UtfplProgramProcessor processor = new UtfplProgramProcessor(); //x uProg = processor.removeProof(uProg); outputUTFPL = uPrinter.print(uProg); System.out.println("==utfpl's ast code (layer 02) is =========================="); System.out.println(outputUTFPL); FileWriter fwUTFPL = new FileWriter(FilenameUtils.changeExt(path, FilenameUtils.cUTFPL)); BufferedWriter bwUTFPL = new BufferedWriter(fwUTFPL); bwUTFPL.write(outputUTFPL); bwUTFPL.close(); TreeFromUtfpl treeV = new TreeFromUtfpl(); prog = treeV.trans(uProg); } else { String line; BufferedReader reader = new BufferedReader(new InputStreamReader(child.getInputStream())); while ((line = reader.readLine()) != null) { System.err.println(line); } return; } } else { ANTLRFileStream fileStream = new ANTLRFileStream(path.getPath()); /* ******** ******** */ // lexing UtfplLexer lexer = new UtfplLexer(fileStream); TokenStream tokenStream = new CommonTokenStream(lexer); // System.out.println(tokenStream.toString()); /* ******** ******** */ // parsing UtfplParser parser = new UtfplParser(tokenStream); // create worker UtfplParser.rule_return parser_ret = parser.rule(); // worker works CommonTree tree = (CommonTree)parser_ret.getTree(); CommonTreeNodeStream nodes = new CommonTreeNodeStream(tree); /* ******** ******** */ // tree parsing Utfpl_tree walker = new Utfpl_tree(nodes); // create worker prog = walker.rule(); // worker works } /* ***************** ****************** */ // naming construction MapScope<TID> libScope = new MapScope<TID>(); CCompUtils.populateAllFunctions(libScope); NamingVisitor nameV = new NamingVisitor(libScope); prog.accept(nameV); /* ***************** ****************** */ // print tree TreePrinter tp = new TreePrinter(); // create worker String output1 = tp.print(prog); // worker works System.out.println("==program is =========================="); System.out.println(output1); System.out.println("\n" + "==" + strPath + " is O.K. " + " ==============================================================================\n"); } } }
f19e5eda502812caefc19f8c60d70f23a46b63a2
32b9dde3ec23c0796381c539827878c6283612e4
/后端/xc_parent/xc_model/src/main/java/com/czxy/xuecheng/domain/cms/CmsPageParam.java
f749925c1f77aab0c301f6b47c63f29321237083
[]
no_license
githubitzdh/xuecheng
703fd2f43e21d5ca34308f8c62948613976ad30e
e4b4769e36dd73bfa3af12388d8b2ac811b78748
refs/heads/master
2022-11-29T19:04:12.432341
2020-08-14T07:50:15
2020-08-14T07:50:15
287,469,294
1
0
null
null
null
null
UTF-8
Java
false
false
245
java
package com.czxy.xuecheng.domain.cms; import lombok.Data; import lombok.ToString; /** * */ @Data @ToString public class CmsPageParam { //参数名称 private String pageParamName; //参数值 private String pageParamValue; }
[ "‘[email protected]’" ]
596e8ff068dd5bc062e50002abdab10cd04cea29
691fd959f9a5d1646a7b33e39ae8ba7a86102407
/src/java/org/fancygiraffe/locations/LocationServlet.java
36c011e8059348ad78d360cdcd841ff5172e7d3e
[]
no_license
Jimmydalecleveland/FancyGiraffe
fa13145585455b9ea024a6e31de55ea66c2505ba
2d29439e35640774c5d2b7992af8f8478886f423
refs/heads/master
2020-04-16T15:45:22.158293
2013-06-14T05:03:54
2013-06-14T05:03:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,287
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.fancygiraffe.locations; import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.rowset.CachedRowSet; /** * * @author Erik */ @WebServlet("/locations") public class LocationServlet extends HttpServlet { /** * Processes requests for both HTTP * <code>GET</code> and * <code>POST</code> methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); //Get list of locations by name LocationModel lm = new LocationModel(); CachedRowSet crs = lm.getUniqueLocations(); request.setAttribute("locations", crs); RequestDispatcher view = request.getRequestDispatcher("locations.jsp"); view.forward(request, response); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * * Handles the HTTP * <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String action = request.getParameter("action"); if(action != null) { if(action.equals("add")) addLocation(request); else if(action.equals("edit")) editLocation(request); else if(action.equals("delete")) deleteLocation(request); } processRequest(request, response); } /** * asks the model to add a location to the database add results to the request object * @param request */ private void addLocation(HttpServletRequest request) { LocationModel lm = new LocationModel(); Map<String,String> map = new HashMap<String,String>() {}; Map<String,String[]> requestMap = request.getParameterMap(); int i = -1; if(requestMap.containsKey("location")) { if(lm.getLocationByName(requestMap.get("location")[0]).size() == 0) { map.put("location_name", requestMap.get("location")[0]); if(requestMap.containsKey("address")) map.put("address", requestMap.get("address")[0]); if(requestMap.containsKey("city")) map.put("city", requestMap.get("city")[0]); if(requestMap.containsKey("state")) map.put("state", requestMap.get("state")[0]); if(requestMap.containsKey("zip")) map.put("zip", requestMap.get("zip")[0]); if(requestMap.containsKey("phone")) map.put("phone", requestMap.get("phone")[0]); if(requestMap.containsKey("district")) map.put("district", requestMap.get("district")[0]); i = lm.addLocation(map); } } request.setAttribute("newLocationId", i); } /** * asks the model to update a location in the database add results to the request object * @param request */ private void editLocation(HttpServletRequest request) { LocationModel lm = new LocationModel(); Map<String,String> map = new HashMap<String,String>() {}; Map<String,String[]> requestMap = request.getParameterMap(); int i = -1; if(requestMap.containsKey("address")) map.put("address", requestMap.get("address")[0]); if(requestMap.containsKey("city")) map.put("city", requestMap.get("city")[0]); if(requestMap.containsKey("state")) map.put("state", requestMap.get("state")[0]); if(requestMap.containsKey("zip")) map.put("zip", requestMap.get("zip")[0]); if(requestMap.containsKey("phone")) map.put("phone", requestMap.get("phone")[0]); if(requestMap.containsKey("district")) map.put("district", requestMap.get("district")[0]); if(requestMap.containsKey("location")) { map.put("location_name", requestMap.get("location")[0]); i = lm.editLocation(map); } request.setAttribute("editRowsAffected", i); request.setAttribute("activeTab", 2); } /** * asks the model to delete a location from the database add results to the request object * @param request */ private void deleteLocation(HttpServletRequest request) { LocationModel lm = new LocationModel(); String location = request.getParameter("location");//name of location to be deleted int i = -1; if(location != null && location.length() > 0) { i = lm.deleteLocation(location); } request.setAttribute("deleteRowsAffected", i); request.setAttribute("activeTab", 3); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; } }
829ad36c98f5852a7731d2ab7b7f1cf02611e8a3
bbe34278f3ed99948588984c431e38a27ad34608
/sources/de/danoeh/antennapod/core/storage/EpisodeCleanupAlgorithm.java
893c6fee0b334321ac18098bd1f35aa0c0a7447f
[]
no_license
sapardo10/parcial-pruebas
7af500f80699697ab9b9291388541c794c281957
938a0ceddfc8e0e967a1c7264e08cd9d1fe192f0
refs/heads/master
2020-04-28T02:07:08.766181
2019-03-10T21:51:36
2019-03-10T21:51:36
174,885,553
0
0
null
null
null
null
UTF-8
Java
false
false
1,226
java
package de.danoeh.antennapod.core.storage; import android.content.Context; import de.danoeh.antennapod.core.preferences.UserPreferences; public abstract class EpisodeCleanupAlgorithm { protected abstract int getDefaultCleanupParameter(); public abstract int getReclaimableItems(); protected abstract int performCleanup(Context context, int i); public int performCleanup(Context context) { return performCleanup(context, getDefaultCleanupParameter()); } public int makeRoomForEpisodes(Context context, int amountOfRoomNeeded) { return performCleanup(context, getNumEpisodesToCleanup(amountOfRoomNeeded)); } int getNumEpisodesToCleanup(int amountOfRoomNeeded) { if (amountOfRoomNeeded >= 0) { if (UserPreferences.getEpisodeCacheSize() != UserPreferences.getEpisodeCacheSizeUnlimited()) { int downloadedEpisodes = DBReader.getNumberOfDownloadedEpisodes(); if (downloadedEpisodes + amountOfRoomNeeded >= UserPreferences.getEpisodeCacheSize()) { return (downloadedEpisodes + amountOfRoomNeeded) - UserPreferences.getEpisodeCacheSize(); } } } return 0; } }
4009d9b1916a69c980574566284777dcaf9bff56
5f02dc0858a36c63fbc086e967a4864c9c9e6847
/springTests/src/main/java/br/com/reschoene/springTests/wrappers/RestResponsePage.java
0d08b15df8b2b8a23f748a9e60add004e2c0f73d
[]
no_license
reschoene/springExperiences
7774bbc7239d65cb2778a2dc235df0d34dabd516
755edcc0be028166ddc00a1d41fee5e92853eec8
refs/heads/main
2023-02-09T07:53:34.270787
2021-01-02T18:35:26
2021-01-02T18:35:26
312,672,563
1
0
null
null
null
null
UTF-8
Java
false
false
1,665
java
package br.com.reschoene.springTests.wrappers; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import java.util.ArrayList; import java.util.List; //Classe necessaria para poder consumir uma API que retorna um Pageable via RestTemplate.exchange public class RestResponsePage<T> extends PageImpl<T> { @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) public RestResponsePage(@JsonProperty("content") List<T> content, @JsonProperty("number") int number, @JsonProperty("size") int size, @JsonProperty("totalElements") Long totalElements, @JsonProperty("pageable") JsonNode pageable, @JsonProperty("last") boolean last, @JsonProperty("totalPages") int totalPages, @JsonProperty("sort") JsonNode sort, @JsonProperty("first") boolean first, @JsonProperty("numberOfElements") int numberOfElements) { super(content, PageRequest.of(number, size), totalElements); } public RestResponsePage(List<T> content, Pageable pageable, long total) { super(content, pageable, total); } public RestResponsePage(List<T> content) { super(content); } public RestResponsePage() { super(new ArrayList<>()); } }
24f63517d09702c5b0c6a5f92f1cf95c5a2deb6a
2838969d389280cffe8dde8ca7d3fde6a1ce8605
/kth-smallest-element-in-a-sorted-matrix/kth-smallest-element-in-a-sorted-matrix.java
b34063b93bd2e4d7fd2c4108db87288d6c201629
[]
no_license
shrutie/https-github.com-shrutie-leetcode-stats_migrate
13eac960c0e72c40f43c1d392b6e4d7471e708ab
74238149c2cf56bcec808d6732fc761c5302fc1e
refs/heads/main
2023-06-09T13:24:43.407066
2021-07-02T17:19:44
2021-07-02T17:19:44
361,144,229
0
0
null
null
null
null
UTF-8
Java
false
false
447
java
class Solution { public int kthSmallest(int[][] matrix, int k) { PriorityQueue<Integer> minHeap = new PriorityQueue<>( (a,b) -> a-b); for(int i =0;i< matrix.length;i++){ for(int j=0;j<matrix[0].length;j++){ minHeap.add(matrix[i][j]); } } while(k-1 > 0){ minHeap.poll(); k--; } return minHeap.peek(); } }
a5b600b28e3ae617ba068a10c8ec2dd385396097
bdfbc61b3219f5a00c48ead2a829686e2c51aca7
/ALM_UI_Automation/src/main/java/com/alm/automation/reportutils/EnvironmentVariableReport.java
e993b04ac0d816e5ff06f77346c95ef2d14a4767
[]
no_license
Rituparna1991/ALM_UI_Automation
7abc35d5737d463902406e8e54ff0e0bff97ffd9
703d8f083389b830da7e91786eef6206f01dae1f
refs/heads/master
2022-12-21T23:51:10.420096
2020-09-22T16:54:13
2020-09-22T16:54:13
297,631,464
0
0
null
null
null
null
UTF-8
Java
false
false
2,117
java
package com.alm.automation.reportutils; import com.alm.automation.globalvariables.EnvironmentVariables; import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; import com.aventstack.extentreports.Status; import com.aventstack.extentreports.reporter.ExtentHtmlReporter; public class EnvironmentVariableReport { private ExtentReportUtils extentReportUtils=new ExtentReportUtils(); private ExtentHtmlReporter extentHtmlReporter; private ExtentReports extentReports= null; ExtentTest extentTest; public void environmentVariableInitialization() { extentHtmlReporter=extentReportUtils.reportInitialization(); extentReports = new ExtentReports(); extentReports.attachReporter(extentHtmlReporter); } public void environmentVariableReport() { environmentVariableInitialization(); extentTest= extentReports.createTest("Envirnoment Variable Details"); extentTest.log(Status.INFO, "Application URL : "+EnvironmentVariables.APPLICATION_URL+""); extentTest.log(Status.INFO, "Browser : "+EnvironmentVariables.BROWSER+""); extentTest.log(Status.INFO, "User Name : "+EnvironmentVariables.USER_NAME+""); extentTest.log(Status.INFO, "Password : "+EnvironmentVariables.PASSWORD+""); extentTest.log(Status.INFO, "DataBase Server IP : "+EnvironmentVariables.DATABASEIP+""); extentTest.log(Status.INFO, "DataBase Server Database : "+EnvironmentVariables.DATABASESCHEMA+""); extentTest.log(Status.INFO, "DataBase Server Port : "+EnvironmentVariables.DATABASEPORT+""); extentTest.log(Status.INFO, "DataBase Server Config UserName : "+EnvironmentVariables.DATABASECONFIGUSERNAME+""); extentTest.log(Status.INFO, "DataBase Server Config Password : "+EnvironmentVariables.DATABASECONFIGPASSWORD+""); extentTest.log(Status.INFO, "DataBase Server Atomic UserName : "+EnvironmentVariables.DATABASECONFIGUSERNAME+""); extentTest.log(Status.INFO, "DataBase Server Atomic Password : "+EnvironmentVariables.DATABASEATOMICPASSWORD+""); extentTest.log(Status.INFO, "DataBase Driver Path : "+EnvironmentVariables.DATABASEDRIVERPATH+""); extentReports.flush(); } }
39f7faec6ed429a0b72769981db22108c00c2839
2509e7d284e84d9b6023b8b9018182270da20a2b
/lab7/src/main/java/org/vladimirg/wst/lab7/generated/OperationStatus.java
2544510c07325ccdeac10caf3e1faa1ef97698b7
[]
no_license
VGubarev/WST
111d4b9f838f6fc65fe6ae5581bda87c3a16cabb
a1a8e8b178994cfca04f558debb42f513c2a195f
refs/heads/master
2020-04-24T20:28:43.044449
2019-05-18T00:21:45
2019-05-18T00:21:45
172,245,183
0
0
null
null
null
null
UTF-8
Java
false
false
1,769
java
package org.vladimirg.wst.lab7.generated; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for operationStatus complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="operationStatus"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="success" type="{http://www.w3.org/2001/XMLSchema}boolean"/> * &lt;element name="error" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "operationStatus", propOrder = { "success", "error" }) public class OperationStatus { protected boolean success; protected String error; /** * Gets the value of the success property. * */ public boolean isSuccess() { return success; } /** * Sets the value of the success property. * */ public void setSuccess(boolean value) { this.success = value; } /** * Gets the value of the error property. * * @return * possible object is * {@link String } * */ public String getError() { return error; } /** * Sets the value of the error property. * * @param value * allowed object is * {@link String } * */ public void setError(String value) { this.error = value; } }
1d251db38928ae281758d8b5e930476eb380eaf6
9b3047437021d91af538315b62a23f273e58a521
/hello-spring-cloud-alibaba-nacos-provider/src/main/java/com/halo/hello/spring/cloud/alibaba/nacos/provider/controller/NacosProviderController.java
d84f0ce7787947667a94d2f526b6e0c62eb67401
[]
no_license
arrowfeng/springcloud
ecb196c2363988ab8ad8fa420f125b4d154ce316
db0ad610b959251f95311b27cb290b854b459cf0
refs/heads/master
2020-04-30T17:30:36.978885
2019-03-28T08:15:19
2019-03-28T08:15:19
176,982,017
0
0
null
null
null
null
UTF-8
Java
false
false
541
java
package com.halo.hello.spring.cloud.alibaba.nacos.provider.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RestController; /** * @Author: zdf * @Description: * @Date:Created in 22:07 2019/3/20 **/ @RestController public class NacosProviderController { @GetMapping(value = "/echo/{message}") public String echo(@PathVariable(value = "message") String message){ return "Hello Nacos3 " + message; } }
3152f07d2757ba02eded6eb58e553cae35f967de
2d1c81de8f131e1576777c6aa32afd64129e4389
/src/main/java/com/invillia/acme/rest/dao/OrderDAO.java
1d31c9dc9ada4f1d77b70f0e06ceee2cd30f361f
[]
no_license
fbrito2000/backend-challenge
2710f9d48a39ff054ba629a5ea19ed787f577cc2
230ca455da6644fea21e6c7375a76489ce620a77
refs/heads/master
2020-04-29T05:20:36.801580
2019-03-26T12:59:02
2019-03-26T12:59:02
175,879,352
0
0
null
2019-03-15T19:26:41
2019-03-15T19:26:41
null
UTF-8
Java
false
false
678
java
package com.invillia.acme.rest.dao; import java.util.List; import com.invillia.acme.rest.exception.DataAccessException; import com.invillia.acme.rest.filter.OrderFilter; import com.invillia.acme.rest.model.Order; public interface OrderDAO { public Order getById(String orderId) throws DataAccessException; public List<Order> query(OrderFilter order) throws DataAccessException; public Order createOrUpdate(Order order) throws DataAccessException; //public List<Order> query(String storeName, String id, Date initialDate, Date finalDate, String situation) throws DataAccessException; //public boolean exists(String storeName, String id); }
4258f1fc7f044f518938212e3fa29b752f0dbe3c
a7bba9c086ab7527c144e8a705ff0baf818aa06d
/spring_prj_shop/src/main/java/com/human/shop/dto/Member.java
eca1cc10afdf6a0c97aed1b1546ee66943b50c02
[]
no_license
uandi2020/git_study
0bb596e3ad8372b96d0118de2942c24d56d3116c
267b3c6184b39641711c9a8c861392c234a28ed7
refs/heads/master
2023-03-28T16:43:05.355321
2021-03-29T06:11:48
2021-03-29T06:11:48
352,294,190
0
0
null
null
null
null
UTF-8
Java
false
false
2,597
java
package com.human.shop.dto; public class Member { public String m_id; public String member_pw; public String member_date; public String member_name; public String member_gene; public String member_birth; public String member_mail; public String member_mobile; public String member_adress; public Member() {} public String getM_id() { return m_id; } public String getMember_pw() { return member_pw; } public String getMember_date() { return member_date; } public String getMember_name() { return member_name; } public String getMember_gene() { return member_gene; } public String getMember_birth() { return member_birth; } public String getMember_mail() { return member_mail; } public String getMember_mobile() { return member_mobile; } public String getMember_adress() { return member_adress; } public void setM_id(String m_id) { this.m_id = m_id; } public void setMember_pw(String member_pw) { this.member_pw = member_pw; } public void setMember_date(String member_date) { this.member_date = member_date; } public void setMember_name(String member_name) { this.member_name = member_name; } public void setMember_gene(String member_gene) { this.member_gene = member_gene; } public void setMember_birth(String member_birth) { this.member_birth = member_birth; } public void setMember_mail(String member_mail) { this.member_mail = member_mail; } public void setMember_mobile(String member_mobile) { this.member_mobile = member_mobile; } public void setMember_adress(String member_adress) { this.member_adress = member_adress; } public Member(String m_id, String member_pw, String member_date, String member_name, String member_gene, String member_birth, String member_mail, String member_mobile, String member_adress) { super(); this.m_id = m_id; this.member_pw = member_pw; this.member_date = member_date; this.member_name = member_name; this.member_gene = member_gene; this.member_birth = member_birth; this.member_mail = member_mail; this.member_mobile = member_mobile; this.member_adress = member_adress; } }
[ "seungmi1995#gmail.com" ]
seungmi1995#gmail.com
2f478e524bd0699ca134f9f22d916ee69d75020c
efbe47ad48c469191c63fdd8c8f72aae93fe586a
/src/main/java/com/briup/lb/service/WaybillService.java
6bfd90a9af7006a372c2e9d6f0bf2a431b51eebf
[]
no_license
ZengQinghui/-
f942e00a6b542a8655fffff07a241033faa1985a
2f026d0071f258aee62fb4f3682258a1167199a8
refs/heads/master
2021-01-24T08:16:04.930554
2017-06-05T07:10:20
2017-06-05T07:10:20
93,374,975
0
0
null
null
null
null
UTF-8
Java
false
false
1,601
java
package com.briup.lb.service; import java.io.Serializable; import java.util.List; import java.util.Map; import com.briup.lb.bean.Contract; import com.briup.lb.bean.Waybill; import com.briup.lb.common.pagination.Page; public interface WaybillService { public List<Waybill> findPage(Page page); // 分页查询 public List<Waybill> find(Map paraMap); // 带条件查询,条件可以为null,既没有条件;返回list对象集合 public Waybill get(String id); // 只查询一个,常用于修改 public void insert(String[] contractIds); // 插入 public void update(Waybill waybill, //修改,用实体作为参数 String[] mr_id, Integer[] mr_orderNo, Integer[] mr_cnumber, Double[] mr_grossWeight, Double[] mr_netWeight, Double[] mr_sizeLength, Double[] mr_sizeWidth, Double[] mr_sizeHeight, Double[] mr_exPrice, Double[] mr_tax ); public void deleteById(Serializable id); // 按id删除,删除一条;支持整数型和字符串类型ID public void delete(Serializable[] ids); // 批量删除;支持整数型和字符串类型ID public void submit(Serializable[] ids); // 上报 public void cancel(Serializable[] ids); // 取消 public List<Contract> getContracts(); // 获取已上报的购销合同列表 public String getMrecordData(String waybillId); //拼接js串 public void packingList(Serializable[] ids); public void entrust(Serializable[] ids); public void invoice(Serializable[] ids); public void finance(Serializable[] ids); }
5f91a1d92a094d098c2dd09c648188501fa4c30a
219ee705d1ebe4d6109387110c2ee5647c9548ab
/app/src/main/java/com/edfadsfxample/petik/kuker/RegisterActivity.java
6bcab044390c4d534f55f9e3755ae98c411b092c
[]
no_license
AliSunan/Kuker
4a99d0b8fc4314ecd851c69950d253829c44c41a
6dbcebf5fb8644c5d2d073d27603504b72a575c5
refs/heads/master
2020-06-14T12:54:36.524295
2019-07-14T05:01:37
2019-07-14T05:01:37
195,009,704
0
0
null
null
null
null
UTF-8
Java
false
false
5,020
java
package com.edfadsfxample.petik.kuker; import android.app.ProgressDialog; import android.content.Intent; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import java.util.HashMap; public class RegisterActivity extends AppCompatActivity { private Button CreateAccountButton; private EditText InputId, InputPassword, InputPhoneNumber; private ProgressDialog loadingbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); CreateAccountButton = (Button) findViewById(R.id.create_btn); InputId = (EditText) findViewById(R.id.create_id); InputPassword = (EditText) findViewById(R.id.create_password); InputPhoneNumber = (EditText) findViewById(R.id.create_phone_number); loadingbar = new ProgressDialog(this); CreateAccountButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CreateAccount(); } }); } private void CreateAccount() { String id = InputId.getText().toString(); String password = InputPassword.getText().toString(); String phone = InputPhoneNumber.getText().toString(); if (TextUtils.isEmpty(id)) { Toast.makeText(this, "Please write your id...", Toast.LENGTH_SHORT).show(); } else if (TextUtils.isEmpty(password)) { Toast.makeText(this, "Please write your password...", Toast.LENGTH_SHORT).show(); } else if (TextUtils.isEmpty(phone)) { Toast.makeText(this, "Please write your phone number...", Toast.LENGTH_SHORT).show(); } else { loadingbar.setTitle("Create Account"); loadingbar.setMessage("Please wait, while we are checking the credentials."); loadingbar.setCanceledOnTouchOutside(false); loadingbar.show(); ValidateId(id, password, phone); } } private void ValidateId(final String id, final String password, final String phone) { final DatabaseReference RootRef; RootRef = FirebaseDatabase.getInstance().getReference(); RootRef.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { if (!(dataSnapshot.child("Users").child(id).exists())) { HashMap<String, Object> userDataMap = new HashMap<>(); userDataMap.put("id", id); userDataMap.put("password", password); userDataMap.put("phone", phone); RootRef.child("Users").child(id).updateChildren(userDataMap) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { Toast.makeText(RegisterActivity.this, "Congratulations, your account has been created.", Toast.LENGTH_SHORT).show(); loadingbar.dismiss(); Intent intent = new Intent(RegisterActivity.this, LoginActivity.class); startActivity(intent); } else { loadingbar.dismiss(); Toast.makeText(RegisterActivity.this, "Network error : Please try again after some time...", Toast.LENGTH_SHORT).show(); } } }); } else { Toast.makeText(RegisterActivity.this, "This " + id + " already exists", Toast.LENGTH_SHORT).show(); loadingbar.dismiss(); Toast.makeText(RegisterActivity.this, "Please try again using another your email.", Toast.LENGTH_SHORT).show(); Intent intent = new Intent(RegisterActivity.this, MainActivity.class); startActivity(intent); } } @Override public void onCancelled(@NonNull DatabaseError databaseError) { } }); } }
5b7faa758996dc871fa8afdd9b68959c0d45b1a3
49ffa2bbdc9478b0088f6811c4b1114a195ea026
/state/CopyDouble.java
0a8f6bec52632162a5381f08b37edde148a68ed8
[]
no_license
fserret/MiniCPBP
f3e8b65e2949d3e9069f460ea9f1eff643aea6a5
aa2544b147d4342469cf0b7a46716955839e109f
refs/heads/master
2022-12-02T03:20:54.091538
2020-08-18T20:36:09
2020-08-18T20:36:09
275,345,942
0
0
null
2020-06-27T10:10:12
2020-06-27T10:10:11
null
UTF-8
Java
false
false
1,510
java
/* * mini-cp is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License v3 * as published by the Free Software Foundation. * * mini-cp is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY. * 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 mini-cp. If not, see http://www.gnu.org/licenses/lgpl-3.0.en.html * * Copyright (c) 2018. by Laurent Michel, Pierre Schaus, Pascal Van Hentenryck */ package minicp.state; /** * Implementation of {@link StateDouble} with copy strategy * @see Copier * @see StateManager#makeStateDouble(double) */ public class CopyDouble implements Storage, StateDouble { class CopyDoubleStateEntry implements StateEntry { private final double v; CopyDoubleStateEntry(double v) { this.v = v; } @Override public void restore() { CopyDouble.this.v = v; } } private double v; protected CopyDouble(double initial) { v = initial; } @Override public double setValue(double v) { this.v = v; return v; } @Override public double value() { return v; } @Override public String toString() { return String.valueOf(v); } @Override public StateEntry save() { return new CopyDoubleStateEntry(v); } }
8f19c0c137662c4541a1ae86a52d35bfecb7bea3
5212ad8b0837304bac8fef8c2cc3eb19a60acfb6
/src/main/java/com/cityconnect/service/RouterService.java
9bdc1fb4a93289d704dbcb6c1e52f3fc69b66f51
[]
no_license
iamohammed/cityconnect
13b8c6ce0ffd65c3872afe3f24a15e0a1da678bc
8f4337f173168eee841fede229e02de65c8ff8b0
refs/heads/master
2020-04-04T21:55:33.535054
2018-11-05T23:56:55
2018-11-05T23:56:55
156,303,376
0
0
null
null
null
null
UTF-8
Java
false
false
807
java
package com.cityconnect.service; import java.util.Map; import java.util.Set; import org.springframework.stereotype.Service; import com.cityconnect.util.RouteUtility; @Service public class RouterService { public boolean checkRouteAvailablity(String origin, String destination){ Map<String,String> connectionMap = RouteUtility.getConnectivityMap(); int count = 0; String key = origin; boolean result = false; while (count <= connectionMap.keySet().size()) { if (null != key && null != destination) { if (connectionMap.get(key).equals(destination)) { result = true; break; } else if (connectionMap.get(destination).equals(key)) { result = true; break; } else { key = connectionMap.get(key); count++; } } } return result; } }
4660a21dfe4b392da9823066093d08eea0da1429
de8707830a7388075c8b5332a99eb0bc89cf4dfb
/Variabler/src/variabler/Variabler.java
13a57fe8b3e4adceb670846f547b7b226f0d6c5d
[]
no_license
ChrisRuLee/SkoleDAPE1400
2bb47f79bf0b8e1533f3c607e797b19b0327d1bf
43f9e033d31017c1810e2ed6f34f7cccda1aa5db
refs/heads/main
2023-08-17T13:05:26.648797
2021-09-20T19:07:52
2021-09-20T19:07:52
408,567,999
0
0
null
null
null
null
UTF-8
Java
false
false
1,351
java
package variabler; import javax.swing.*; import static javax.swing.JOptionPane.showMessageDialog; public class Variabler { public static void main(String [] args){ //oppgave1 String forNavn = JOptionPane.showInputDialog("Skriv ditt fornavn:"); String etterNavn = JOptionPane.showInputDialog("Skriv ditt etternavn:"); //showMessageDialog (null,forNavn+" "+etterNavn); //Oppgave 2 String alder = JOptionPane.showInputDialog("Skriv din alder:"); //showMessageDialog (null,"Alderen til "+forNavn+" "+etterNavn+" er"+alder+" år"); //Oppgave 3 String adresse = JOptionPane.showInputDialog("Skriv din adresse:"); String postNr = JOptionPane.showInputDialog("Post Nr:"); String postSted = JOptionPane.showInputDialog("Poststed:"); //Oppgave 3 //showMessageDialog (null,forNavn+" "+etterNavn+" bor i "+adresse+", "+postNr+" "+postSted+". "+forNavn+" er "+alder+"år"); //Oppgave 4 //showMessageDialog (null, "Navn: "+forNavn+" "+etterNavn+"\n"+"Adresse: "+adresse+"\n"+"Postnummer: "+postNr+"\n"+"Poststed: "+postSted+"\n"+"Alder: "+alder); //Oppgave 5 System.out.println("Navn: "+forNavn+" "+etterNavn+"\n"+"Adresse: "+adresse+"\n"+"Postnummer: "+postNr+"\n"+"Poststed: "+postSted+"\n"+"Alder: "+alder); } }
c38f93618236c6e98dc5995508c27d70b559473d
3db6ee232a85c1c184cde1bbd050b63bdef4243b
/Snap2Pay/src/main/java/com/snap2buy/webservice/util/ImageResizer.java
b3838683ace34083019372074eb28dd8dfcfdbcb
[]
no_license
praveengsnap2/scripts
b5ca1a5608adfa11b8e885d71dbcca7267f59ca7
d58900252176690619244f92914b98175d011e42
refs/heads/master
2021-01-12T03:13:16.382829
2017-01-06T05:19:57
2017-01-06T05:19:57
78,178,857
0
0
null
null
null
null
UTF-8
Java
false
false
8,726
java
//package com.snap2buy.webservice.util; // //import com.drew.imaging.ImageMetadataReader; //import com.drew.imaging.ImageProcessingException; //import com.drew.metadata.Directory; //import com.drew.metadata.Metadata; //import com.drew.metadata.MetadataException; //import com.drew.metadata.Tag; //import com.drew.metadata.exif.ExifIFD0Directory; //import org.imgscalr.Scalr; // //import javax.imageio.ImageIO; //import java.awt.*; //import java.awt.image.BufferedImage; //import java.io.File; //import java.io.IOException; // //public class ImageResizer { // // public static void resize(String inputImagePath, String outputImagePath, int scaledWidth, int scaledHeight) throws IOException { // // reads input image // File inputFile = new File(inputImagePath); // BufferedImage inputImage = ImageIO.read(inputFile); // // // creates output image // BufferedImage outputImage = new BufferedImage(scaledWidth, // scaledHeight, inputImage.getType()); // // // scales the input image to the output image // Graphics2D g2d = outputImage.createGraphics(); // g2d.drawImage(inputImage, 0, 0, scaledWidth, scaledHeight, null); // g2d.dispose(); // // // extracts extension of output file // String formatName = outputImagePath.substring(outputImagePath // .lastIndexOf(".") + 1); // // // writes to output file // ImageIO.write(outputImage, formatName, new File(outputImagePath)); // } // // public static void resize(String inputImagePath, String outputImagePath, double percent) throws IOException { // File inputFile = new File(inputImagePath); // BufferedImage inputImage = ImageIO.read(inputFile); // int scaledWidth = (int) (inputImage.getWidth() * percent); // int scaledHeight = (int) (inputImage.getHeight() * percent); // resize(inputImagePath, outputImagePath, scaledWidth, scaledHeight); // } // // public static void fixedWidthResize(String inputImagePath, String outputImagePath, int scaledWidth) throws IOException { // // reads input image // File inputFile = new File(inputImagePath); // BufferedImage inputImage = ImageIO.read(inputFile); // // int originalHeight=inputImage.getHeight(); // int originalWidth=inputImage.getWidth(); // // int scaledHeight=(int)(((double)scaledWidth/(double)originalWidth)*(double)originalHeight); // // // creates output image // BufferedImage outputImage = new BufferedImage(scaledWidth, // scaledHeight, inputImage.getType()); // // // scales the input image to the output image // Graphics2D g2d = outputImage.createGraphics(); // g2d.drawImage(inputImage, 0, 0, scaledWidth, scaledHeight, null); // g2d.dispose(); // // // extracts extension of output file // String formatName = outputImagePath.substring(outputImagePath // .lastIndexOf(".") + 1); // // // writes to output file // ImageIO.write(outputImage, formatName, new File(outputImagePath)); // } // // public static void origResize(String inputImagePath, String outputImagePath) throws IOException { // // reads input image // File inputFile = new File(inputImagePath); // BufferedImage inputImage = ImageIO.read(inputFile); // // int originalHeight=inputImage.getHeight(); // int originalWidth=inputImage.getWidth(); // // System.out.println("original :\noriginalHeight="+originalHeight+"\noriginalWidth="+originalWidth); // // // creates output image // BufferedImage outputImage = new BufferedImage(originalWidth, // originalHeight, inputImage.getType()); // // // scales the input image to the output image // Graphics2D g2d = outputImage.createGraphics(); // g2d.drawImage(inputImage, 0, 0, originalWidth, originalHeight, null); // g2d.dispose(); // // // extracts extension of output file // String formatName = outputImagePath.substring(outputImagePath // .lastIndexOf(".") + 1); // // // writes to output file // ImageIO.write(outputImage, formatName, new File(outputImagePath)); // } // public static void origRotateResize(String inputImagePath, String outputImagePath) throws IOException, ImageProcessingException, MetadataException { // // reads input image // File inputFile = new File(inputImagePath); // BufferedImage inputImage = ImageIO.read(inputFile); // // int originalHeight=inputImage.getHeight(); // int originalWidth=inputImage.getWidth(); // System.out.println("before Rotation: \noriginalHeight="+originalHeight+"\noriginalWidth="+originalWidth); // if (originalHeight<originalWidth){ // System.out.println("image is rotated "); // Scalr.Rotation rotation = rotateImage(inputFile); // rotation. // } // System.out.println("after Rotation: \noriginalHeight="+originalHeight+"\noriginalWidth="+originalWidth); // // // creates output image // BufferedImage outputImage = new BufferedImage(originalWidth, // originalHeight, inputImage.getType()); // // // scales the input image to the output image // Graphics2D g2d = outputImage.createGraphics(); // g2d.drawImage(inputImage, 0, 0, originalWidth, originalHeight, null); // g2d.dispose(); // // // extracts extension of output file // String formatName = outputImagePath.substring(outputImagePath // .lastIndexOf(".") + 1); // // // writes to output file // ImageIO.write(outputImage, formatName, new File(outputImagePath)); // } // // public static Scalr.Rotation rotateImage(File inputFile) throws ImageProcessingException, IOException, MetadataException { // Metadata metadata = ImageMetadataReader.readMetadata(inputFile); // for (Directory directory : metadata.getDirectories()) { // for (Tag tag : directory.getTags()) { // System.out.println(tag); // } // } // ExifIFD0Directory exifIFD0 = metadata.getDirectory(ExifIFD0Directory.class); // int orientation = exifIFD0.getInt(ExifIFD0Directory.TAG_ORIENTATION); // // switch (orientation) { // case 1: // [Exif IFD0] Orientation - Top, left side (Horizontal / normal) // return null; // case 6: // [Exif IFD0] Orientation - Right side, top (Rotate 90 CW) // return Scalr.Rotation.CW_90; // case 3: // [Exif IFD0] Orientation - Bottom, right side (Rotate 180) // return Scalr.Rotation.CW_180; // case 8: // [Exif IFD0] Orientation - Left side, bottom (Rotate 270 CW) // return Scalr.Rotation.CW_270; // } // } // // public static void main(String[] args) throws ImageProcessingException, MetadataException { // String filename ="f89fcb55-ccc5-4e28-89d0-afcda50eb36d"; // String inputImagePath = "/Users/sachin/Desktop/snap/"+filename+".jpg"; // String outputImagePath = "/Users/sachin/Desktop/snap/"+filename+"-orig.jpg"; // String outputImagePath1 = "/Users/sachin/Desktop/snap/"+filename+"-fixed.jpg"; // String outputImagePath2 = "/Users/sachin/Desktop/snap/"+filename+"-fixedWidth.jpg"; // String outputImagePath3 = "/Users/sachin/Desktop/snap/"+filename+"-smaller.jpg"; // String outputImagePath4 = "/Users/sachin/Desktop/snap/"+filename+"-bigger.jpg"; // String outputImagePath5 = "/Users/sachin/Desktop/snap/"+filename+"-rotate.jpg"; // // try { // ImageResizer.origResize(inputImagePath, outputImagePath1); // ImageResizer.origRotateResize(inputImagePath, outputImagePath5); // // // resize to a fixed width (not proportional) // int scaledWidth = 2448; // int scaledHeight = 3264; // ImageResizer.resize(inputImagePath, outputImagePath1, scaledWidth, scaledHeight); // // int scaledWidth1 = 900; // ImageResizer.fixedWidthResize(inputImagePath, outputImagePath2, scaledWidth1); // //// // resize smaller by 50% //// double percent = 0.5; //// ImageResizer.resize(inputImagePath, outputImagePath3, percent); //// //// // resize bigger by 50% //// percent = 1.5; //// ImageResizer.resize(inputImagePath, outputImagePath4, percent); // // // } catch (IOException ex) { // System.out.println("Error resizing the image."); // ex.printStackTrace(); // } // } // // //}
928aec12a1b90fbeaecabe865425b708aec17b1c
1c1eb038bd3407a0da8a8ce34f17f384dda367f3
/Migrated/CrackCode/src/solvedTopcoder/RectangleGroups.java
e2ff028fd9de7c78f4b4f5f2e504b29d669030fa
[]
no_license
afaly/CrackCode
ae6e7fcd82a250a1332d55e0a7b0040f63f66b55
3a6cda4e7d9252e496956c88de6e27c3a6bc9dd7
refs/heads/master
2021-01-10T14:04:24.452808
2016-01-04T07:12:58
2016-01-04T07:12:58
45,332,601
0
0
null
null
null
null
UTF-8
Java
false
false
770
java
package solvedTopcoder; import java.util.Arrays; public class RectangleGroups { public String maximalIndexed(String[] rectangles) { Arrays.sort(rectangles); String maxName = null; int maxIndex = -1; int index = -1; for (int i = 0; i <= rectangles.length; i++) { int area = -1; if (i < rectangles.length) { String fields[] = rectangles[i].split(" "); area = Integer.parseInt(fields[1]) * Integer.parseInt(fields[2]); } if (i < rectangles.length && i > 0 && rectangles[i].charAt(0) == rectangles[i - 1].charAt(0)) { index += area; } else { if (i > 0 && index > maxIndex) { maxIndex = index; maxName = rectangles[i - 1].charAt(0) + ""; } index = area; } } return maxName + " " + maxIndex; } }
6347988c5ae527c6f65689d65e4b2acda6bf5efe
658ea653380d707d13b6725fda500c35ee66cff2
/src/Factorial.java
c2c6268c0034ed90d9096d4dde43d3832828383f
[]
no_license
HFrejlev/StudentA_LoopAssignment
6a5730ca74d2029121489c08f68a381e55a83970
9eb8b3e3dd3b1d2bc6999150392a29def49d4466
refs/heads/master
2020-08-01T20:04:02.510031
2019-09-26T13:50:30
2019-09-26T13:50:30
211,100,534
0
0
null
null
null
null
UTF-8
Java
false
false
336
java
public class Factorial { public static int calc(int i) { int result = 0; if (i<0){ return -1; } else if (i >= 100000){ return -1; } else { for (int x = i; x>=0;x--){ result = result*x; } return result; } } }
0cf1ca905d8160b0ecbbf64256b4cd2b60658581
753b27aa994444d27289b2814b8c11701b146e12
/src/main/java/org/my431/util/excel/ReadExcel.java
7e245800b16d04fef6f2bdcd293cdb8d089cc6aa
[]
no_license
jiaojing0558/kettle-1
1c2c2898521d53f1a3fed8d4bd664fb2c0b22bda
352f165cfc8e64f414ac49fb1730f0a84e5beab4
refs/heads/master
2020-07-07T07:56:27.988081
2018-04-12T03:10:38
2018-04-12T03:10:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
21,417
java
package org.my431.util.excel; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.util.CellReference; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import com.itextpdf.text.pdf.PdfStructTreeController.returnType; public class ReadExcel { /** * 不区分版本读取EXCEL * @param filename,sheetname(用来读取特定标记工作簿) * @return * @throws IOException */ public static List<Object[]> read(String filename,String sheetname) throws IOException{ try{ if(isExcel2003(filename)){ return readByHSSF(filename,sheetname); }else { return readByXSSF(filename,sheetname); } }catch(Exception ex){ ex.printStackTrace(); return null; } } /** * 读取2007EXCEL 后缀xlsx * @param filename * @return * @throws IOException * 修改 过滤空白数据<br/> * */ public static List<Object[]> readByXSSF(String filename,String sheetname) throws IOException{ List<Object[]> list = new ArrayList<Object[]>(); /******************读取本地文件start**********************************************/ //指定要读取的Excel文件 //File file = new File(filename); //创建输入流 //FileInputStream fis = new FileInputStream(file); /******************读取本地文件end**********************************************/ /******************读取网络文件start**********************************************/ URL url =new URL(filename); // 创建URL URLConnection urlconn = url.openConnection(); // 试图连接并取得返回状态码 urlconn.connect(); HttpURLConnection httpconn =(HttpURLConnection)urlconn; int httpResult = httpconn.getResponseCode(); InputStream fis=null; if(httpResult != HttpURLConnection.HTTP_OK){ // 不等于HTTP_OK说明连接不成功 System.out.print("无法连接到"); }else { //urlconn.getInputStream(); fis=urlconn.getInputStream(); } /******************读取网络文件end**********************************************/ //创建XSSFWorkbook对象 //读写xls和xlsx格式时,HSSFWorkbook针对xls,XSSFWorkbook针对xlsx XSSFWorkbook wb = new XSSFWorkbook(fis); XSSFSheet childSheet = null; if(sheetname!=null && !"".equals(sheetname)){ childSheet = wb.getSheet(sheetname); }else{ //获得第一个sheet工作表 childSheet = wb.getSheetAt(0); } //从第一行开始 A1 表头 CellReference cellReference = new CellReference("A1"); //显示行数(如果中间隔行的话getPhysicalNumberOfRows就不能读取到所有的行) //System.out.println(childSheet.getPhysicalNumberOfRows()); //有行数 /** 得到Excel的行数 */ System.out.println("从0开始有行数:"+childSheet.getLastRowNum()+";从1开始有行数:"+childSheet.getPhysicalNumberOfRows()); //该标记是判断是否是空白值 boolean flag = false; for (int r = 0; r < childSheet.getPhysicalNumberOfRows();r++) { //获取表格中的行 XSSFRow row = childSheet.getRow(r); int allColumnNum= childSheet.getRow(0).getLastCellNum()+1;//从0开始 Object[] obj = new Object[allColumnNum]; //检查是否是空行(即没有任何数据、格式) if(row == null){ // 如果是空行(即没有任何数据、格式),直接把它以下的数据往上移动 //childSheet.shiftRows(i+1, childSheet.getLastRowNum(),-1); list.add(obj); continue; } flag = false; //循环检查该行是否都是空白值 for(Cell c:row){ if(c.getCellType() != Cell.CELL_TYPE_BLANK){ flag = true; break; } } //定义数组保存一行数据 根据标题的列数而定 //有不是空白值循环 if(flag){ //遍历每个单元格 for(int c = 0; c < row.getPhysicalNumberOfCells(); c++){ //获取行中的单元格 XSSFCell cell = row.getCell(c); //如果数值类型不为空值 执行 if(null!=cell){ switch (cell.getCellType()) { case XSSFCell.CELL_TYPE_NUMERIC: // 数字 // System.out.print(cell.getNumericCellValue() + " "); //obj[j] = cell.getNumericCellValue(); if(HSSFDateUtil.isCellDateFormatted(cell)){ Date date = (Date) cell.getDateCellValue(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); obj[c] = sdf.format(date); //obj[j] = cell.getDateCellValue(); }else{ //obj[j] = cell.getNumericCellValue(); String str=""; double doubleValue = cell.getNumericCellValue(); // 是否为数值型 if (doubleValue - (int) doubleValue < Double.MIN_VALUE) { // 是否为int型 str = Integer.toString((int) doubleValue); } else { //System.out.println("double....."); // 是否为double型 str = Double.toString(cell.getNumericCellValue()); DecimalFormat df = new DecimalFormat("#"); str= df.format(cell.getNumericCellValue()); } obj[c] = "" + str; } break; case XSSFCell.CELL_TYPE_STRING: // 字符串 //System.out.print(cell.getStringCellValue()+ " "); obj[c] = cell.getStringCellValue(); break; case XSSFCell.CELL_TYPE_BOOLEAN: // Boolean obj[c] = cell.getBooleanCellValue(); break; case XSSFCell.CELL_TYPE_FORMULA: // 公式 obj[c] = cell.getCellFormula(); break; case XSSFCell.CELL_TYPE_BLANK: // 空值 obj[c] = ""; break; case XSSFCell.CELL_TYPE_ERROR: // 故障 obj[c] = "-1"; break; default: obj[c] = "-1"; break; } }else{ //System.out.print("- "); obj[c] = ""; } } //list添加值 list.add(obj); //i++; //continue; }else{//如果是空白行(即可能没有数据,但是有一定格式) /*if(i == childSheet.getLastRowNum())//如果到了最后一行,直接将那一行remove掉 childSheet.removeRow(row); else//如果还没到最后一行,则数据往上移一行 childSheet.shiftRows(i+1, childSheet.getLastRowNum(),-1);*/ list.add(obj); } } System.out.println("检查后总行数:"+(childSheet.getLastRowNum()+1)); System.out.println("检查后集合的数量:"+list.size()); fis.close(); return list; } /** * 读取2003EXCEL 后缀xls * @param filename * @return * @throws IOException * */ public static List<Object[]> readByHSSF(String filename,String sheetname) throws IOException{ List<Object[]> list = new ArrayList<Object[]>(); //指定要读取的Excel文件 //File file = new File(filename); //创建输入流 //FileInputStream fis = new FileInputStream(file); /******************读取网络文件start**********************************************/ URL url =new URL(filename); // 创建URL URLConnection urlconn = url.openConnection(); // 试图连接并取得返回状态码 urlconn.connect(); HttpURLConnection httpconn =(HttpURLConnection)urlconn; int httpResult = httpconn.getResponseCode(); InputStream fis=null; if(httpResult != HttpURLConnection.HTTP_OK){ // 不等于HTTP_OK说明连接不成功 System.out.print("无法连接到"); }else { //urlconn.getInputStream(); fis=urlconn.getInputStream(); } /******************读取网络文件end**********************************************/ //创建HSSFWorkbook对象 HSSFWorkbook wb = new HSSFWorkbook(fis); HSSFSheet childSheet = null; if(sheetname!=null && !"".equals(sheetname)){ childSheet = wb.getSheet(sheetname); }else{ //获得第一个sheet工作表 childSheet = wb.getSheetAt(0); } //从第一行开始 A1 表头 CellReference cellReference = new CellReference("A1"); //显示行数(如果中间隔行的话getPhysicalNumberOfRows就不能读取到所有的行) //System.out.println(childSheet.getPhysicalNumberOfRows()); /** 得到Excel的行数 */ System.out.println("从0开始有行数:"+childSheet.getLastRowNum()+";从1开始有行数:"+childSheet.getPhysicalNumberOfRows()); //该标记是判断是否是空白值 boolean flag = true; //遍历EXCEL数据 childSheet.getPhysicalNumberOfRows() 原来写的 //qyb 修改 childSheet.getLastRowNum() 2014.11.12 //for (int i = cellReference.getRow(); i <= childSheet.getLastRowNum();) { for (int r = 0; r < childSheet.getPhysicalNumberOfRows();r++) { //获取表格中的行 HSSFRow row = childSheet.getRow(r); int allColumnNum= childSheet.getRow(0).getLastCellNum()+1;//从0开始 Object[] obj = new Object[allColumnNum]; //System.out.println(row.getPhysicalNumberOfCells());//从1开始 //显示列数 //System.out.println("列数:"+row.getLastCellNum()); //检查是否是空行(即没有任何数据、格式) if(row == null){ // 如果是空行(即没有任何数据、格式),直接把它以下的数据往上移动 //childSheet.shiftRows(i+1, childSheet.getLastRowNum(),-1); list.add(obj); continue; } flag = false; //循环检查该行是否都是空白值 for(Cell c:row){ if(c.getCellType() != Cell.CELL_TYPE_BLANK){ flag = true; break; } } //有不是空白值循环 if(flag){ //遍历每个单元格 for(int c = 0; c < row.getPhysicalNumberOfCells(); c++){ //获取行中的单元格 HSSFCell cell = row.getCell(c); //如果数值类型不为空值 执行 if(null!=cell){ switch (cell.getCellType()) { case XSSFCell.CELL_TYPE_NUMERIC: // 数字 // System.out.print(cell.getNumericCellValue() + " "); //obj[j] = cell.getNumericCellValue(); if(HSSFDateUtil.isCellDateFormatted(cell)){ Date date = (Date) cell.getDateCellValue(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); obj[c] = sdf.format(date); //obj[j] = cell.getDateCellValue(); }else{ //obj[j] = cell.getNumericCellValue(); String str=""; double doubleValue = cell.getNumericCellValue(); // 是否为数值型 if (doubleValue - (int) doubleValue < Double.MIN_VALUE) { // 是否为int型 str = Integer.toString((int) doubleValue); } else { //System.out.println("double....."); // 是否为double型 str = Double.toString(cell.getNumericCellValue()); DecimalFormat df = new DecimalFormat("#"); str= df.format(cell.getNumericCellValue()); } obj[c] = "" + str; } break; case XSSFCell.CELL_TYPE_STRING: // 字符串 //System.out.print(cell.getStringCellValue()+ " "); obj[c] = cell.getStringCellValue(); break; case XSSFCell.CELL_TYPE_BOOLEAN: // Boolean //System.out.println(cell.getBooleanCellValue() + " "); obj[c] = cell.getBooleanCellValue(); break; case XSSFCell.CELL_TYPE_FORMULA: // 公式 //System.out.print(cell.getCellFormula() + " "); obj[c] = cell.getCellFormula(); break; case XSSFCell.CELL_TYPE_BLANK: // 空值 obj[c] = ""; break; case XSSFCell.CELL_TYPE_ERROR: // 故障 obj[c] = "-1"; break; default: //System.out.print("未知类型 "); obj[c] = "-1"; break; } }else{ //System.out.print("- "); obj[c] = ""; } } //list添加值 list.add(obj); //r++; //continue; }else{//如果是空白行(即可能没有数据,但是有一定格式) /*if(r == childSheet.getLastRowNum())//如果到了最后一行,直接将那一行remove掉 childSheet.removeRow(row); else//如果还没到最后一行,则数据往上移一行 childSheet.shiftRows(r+1, childSheet.getLastRowNum(),-1);*/ list.add(obj); } } System.out.println("检查后总行数:"+(childSheet.getLastRowNum()+1)); System.out.println("检查后集合的数量:"+list.size()); fis.close(); return list; } /** * * 函 数 名 :main * 功能描述:测试方法 * 参数描述: * 返回值 :void * 创 建 人:秦岩宾 * 日 期:2014-11-15 上午11:54:01 * 修 改 人: * 日 期: */ public static void main(String[] args) { List<Object[]> list = new ArrayList<Object[]>(); //创建XSSFWorkbook对象 //读写xls和xlsx格式时,HSSFWorkbook针对xls,XSSFWorkbook针对xlsx HSSFWorkbook wb = null; try { wb = new HSSFWorkbook(new FileInputStream("E:\\d.xls")); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } HSSFSheet childSheet = null; //获得第一个sheet工作表 childSheet = wb.getSheetAt(0); //从第一行开始 A1 CellReference cellReference = new CellReference("A1"); //显示行数(如果中间隔行的话getPhysicalNumberOfRows就不能读取到所有的行) System.out.println(childSheet.getPhysicalNumberOfRows()); //有行数 System.out.println("有行数:"+childSheet.getLastRowNum()); boolean flag = false; //遍历EXCEL数据 childSheet.getPhysicalNumberOfRows() 原来写的 //qyb 修改 childSheet.getLastRowNum() 2014.11.12 for (int i = cellReference.getRow(); i <= childSheet.getLastRowNum();) { //获取表格中的行 HSSFRow row = childSheet.getRow(i); //显示列数(如果中间隔列的话getPhysicalNumberOfCells就不能读取到所有列) //System.out.println(row.getPhysicalNumberOfCells()); //显示列数 //System.out.println("列数:"+row.getLastCellNum()); //检查是否是空行(即没有任何数据、格式) if(row == null){ // 如果是空行(即没有任何数据、格式),直接把它以下的数据往上移动 childSheet.shiftRows(i+1, childSheet.getLastRowNum(),-1); continue; } flag = false; for(Cell c:row){ if(c.getCellType() != Cell.CELL_TYPE_BLANK){ flag = true; break; } } //定义数组保存一行数据 根据标题的列数而定 Object[] obj = new Object[childSheet.getRow(0).getLastCellNum()+1];//childSheet.getRow(0).getLastCellNum()+1 if(flag){ //遍历每个单元格 for(int j = 0; j < row.getLastCellNum(); j++){ //获取行中的单元格 HSSFCell cell = row.getCell(j); //如果数值类型不为空值 执行 if(null!=cell){ switch (cell.getCellType()) { case XSSFCell.CELL_TYPE_NUMERIC: // 数字 // System.out.print(cell.getNumericCellValue() + " "); //obj[j] = cell.getNumericCellValue(); if(HSSFDateUtil.isCellDateFormatted(cell)){ Date date = (Date) cell.getDateCellValue(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); obj[j] = sdf.format(date); //obj[j] = cell.getDateCellValue(); }else{ obj[j] = cell.getNumericCellValue(); } break; case XSSFCell.CELL_TYPE_STRING: // 字符串 //System.out.print(cell.getStringCellValue()+ " "); obj[j] = cell.getStringCellValue(); break; case XSSFCell.CELL_TYPE_BOOLEAN: // Boolean //System.out.println(cell.getBooleanCellValue() + " "); obj[j] = cell.getBooleanCellValue(); break; case XSSFCell.CELL_TYPE_FORMULA: // 公式 //System.out.print(cell.getCellFormula() + " "); obj[j] = cell.getCellFormula(); break; case XSSFCell.CELL_TYPE_BLANK: // 空值 obj[j] = ""; break; case XSSFCell.CELL_TYPE_ERROR: // 故障 obj[j] = "-1"; break; default: obj[j] = "-1"; break; } }else{ //System.out.print("- "); obj[j] = ""; break; } } list.add(obj); i++; continue; }else{//如果是空白行(即可能没有数据,但是有一定格式) if(i == childSheet.getLastRowNum())//如果到了最后一行,直接将那一行remove掉 childSheet.removeRow(row); else//如果还没到最后一行,则数据往上移一行 childSheet.shiftRows(i+1, childSheet.getLastRowNum(),-1); } } System.out.println("检查后总行数:"+(childSheet.getLastRowNum()+1)); System.out.println(list.size()); } public static boolean isExcel2003(String filePath){ return filePath.matches("^.+\\.(?i)(xls)$"); } public static boolean isExcel2007(String filePath){ return filePath.matches("^.+\\.(?i)(xlsx)$"); } }
0874abbf7f3fe168145243cde1f222d6c378d18b
c58cd5450029120b2dd976abac0307d795918c12
/src/main/java/com/fdm04/auditApp/model/Audit.java
6c3f531ee1bcfb54d588bc65628584581a170471
[]
no_license
NikiRoss/AuditApplication
64e491826cab8a1d7cc8a71ea0f3a9cd4f7bacc5
b92885c483f9551850830e0ae299935564aa753d
refs/heads/master
2021-07-12T03:08:05.835120
2019-10-29T23:20:22
2019-10-29T23:20:22
210,680,820
0
0
null
2020-10-13T17:00:11
2019-09-24T19:23:36
Java
UTF-8
Java
false
false
1,924
java
package com.fdm04.auditApp.model; import java.util.ArrayList; import com.fdm04.auditApp.database.util.DataTransferObject; import com.fdm04.auditApp.util.AuditConstants; public class Audit implements DataTransferObject{ private int id; private double score = 100; private String projectName; private String projectManager; private String auditor; private String summary; private ArrayList<String> categories = new ArrayList<String>(); public Audit() { categories.add(AuditConstants.ACCESS_EGRESS); categories.add(AuditConstants.COSHH); categories.add(AuditConstants.FIRST_AID); categories.add(AuditConstants.RAMS); categories.add(AuditConstants.TEMP_WORKS); categories.add(AuditConstants.WORK_AT_HEIGHT); } public int getId() { return id; } public void setId(int id) { this.id = id; } public double getScore() { return score; } public void setScore(double score) { this.score = score; } public String getProjectName() { return projectName; } public void setProjectName(String projectName) { this.projectName = projectName; } public String getProjectManager() { return projectManager; } public void setProjectManager(String projectManager) { this.projectManager = projectManager; } public String getAuditor() { return auditor; } public void setAuditor(String auditor) { this.auditor = auditor; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public ArrayList<String> getCategories() { return categories; } public void setCategories(ArrayList<String> categories) { this.categories = categories; } @Override public String toString() { return "Audit [id=" + id + ", score=" + score + ", projectName=" + projectName + ", projectManager=" + projectManager + ", auditor=" + auditor + ", summary=" + summary + ", categories=" + categories + "]"; } }
024f3d97e3c90b0a12cee3446e2cea8e1decc2eb
d1bb46c9e95fa22ae149031ac7c6d651503b1d91
/src/main/java/com/mmall/service/IShippingService.java
d4f782698e7547455c4e3d2d52be10a90870e25d
[]
no_license
monxiaolee/mmall
2fb43d1668eacec9e90dab7d99be7496c8937f14
a3d493ef7c2c46474ee66079b61addd8a9d7b4ee
refs/heads/master
2020-03-22T19:55:32.926347
2018-10-15T08:03:46
2018-10-15T08:03:46
140,560,862
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
package com.mmall.service; import com.github.pagehelper.PageInfo; import com.mmall.common.ServerResponse; import com.mmall.pojo.Shipping; /** * Created by limengxiao on 2018/10/11. */ public interface IShippingService { ServerResponse add(Integer userId, Shipping shipping); ServerResponse<String> del(Integer userId,Integer shippingId); ServerResponse update(Integer userId, Shipping shipping); ServerResponse<Shipping> select(Integer userId, Integer shippingId); ServerResponse<PageInfo> list(Integer userId, int pageNum, int pageSize); }
[ "15893623902Lee" ]
15893623902Lee
7220642c25dfa48c9b594e28c9dd2cce8d6a87f9
3fb0d25e3890d3b142175c51a9a0c3d997acb3c9
/src/it/colasuonno/cli/lib/WebPage.java
5b6622c61de2d1aafdea416a1bbf9fc4e876d80b
[]
no_license
Colasuonno/colasuonno-cli
7cd30d28a647138bd1905fe6058a305a4b918ef7
01465761844c7bdf7df9bc524698b15aaf3602e8
refs/heads/master
2020-04-29T04:34:56.818193
2019-03-19T19:28:12
2019-03-19T19:28:12
175,851,359
1
0
null
null
null
null
UTF-8
Java
false
false
3,330
java
package it.colasuonno.cli.lib; import it.colasuonno.cli.logger.CLILogger; import it.colasuonno.cli.manager.CLIManager; import it.colasuonno.cli.objects.CLIInput; import it.colasuonno.cli.objects.CLIObject; import it.colasuonno.cli.objects.sub.CLIExpectedSubComponent; import it.colasuonno.cli.objects.sub.CLIFollowedExpectedSubCommand; import it.colasuonno.cli.objects.sub.CLIOutput; import it.colasuonno.cli.objects.sub.CLISubType; import org.apache.commons.io.IOUtils; import java.net.HttpURLConnection; import java.net.InetAddress; import java.net.URL; import java.util.Arrays; public class WebPage extends CLIObject { public WebPage() { super(CLIManager.buildInput("webpage", "<value>", "<value>"), new CLIExpectedSubComponent("--status", CLISubType.NOTHING), build(), build() ); } @Override public void output(String value, CLIExpectedSubComponent expected) { } private static CLIExpectedSubComponent build() { return new CLIExpectedSubComponent("<value>", CLISubType.VALUE, (value, totalArgs) -> { String ip = totalArgs[totalArgs.length-1]; boolean self = false; try { if (ip.equalsIgnoreCase("me")) { ip = InetAddress.getLocalHost().getHostAddress(); self = true; } } catch (Exception e) { e.printStackTrace(); } try { InetAddress address = self ? InetAddress.getLocalHost() : InetAddress.getByName(new URL(ip).getHost()); if (!self) { CLILogger.green("Loading page with ip: " + ip); HttpURLConnection connection = (HttpURLConnection) new URL(ip).openConnection(); connection.setRequestMethod("HEAD"); CLILogger.green("Connecting to " + ip); int responseCode = connection.getResponseCode(); if (responseCode != 200) { CLILogger.red("Page might have some problems"); } else { CLILogger.i("Webpage seems online!"); CLILogger.i("Response message: " + connection.getResponseMessage()); CLILogger.green("Trying to fetch InetAddress by URL(" + ip + ")"); CLILogger.i("InetAddress (ip): " + address.getHostAddress()); CLILogger.i("Hostname: " + address.getHostName()); } CLILogger.i("WebResponse (code): " + responseCode); } else{ CLILogger.green("Found local webpage check"); CLILogger.i("InetAddress (ip): " + address.getHostAddress()); CLILogger.i("Hostname: " + address.getHostName()); } if (totalArgs.length == 3 && totalArgs[1].equalsIgnoreCase("-json")) { String genreJson = IOUtils.toString(new URL("http://ip-api.com/json/" + address.getHostAddress())); CLILogger.i("JSON (output): " + genreJson); } } catch (Exception e) { CLILogger.red("Something went wrong: " + e.getMessage()); } }); } }
f1132ab46410d3033f821bef597d77d4216919cb
4d7d5e7542827b126fe70dd50fb598bbbbd07b52
/Ventas/src/model/Client.java
85ba370df0a5a8b0da28cb8dfa088e50967a34e6
[]
no_license
AlvinPech/Ventas
712d78dca14a5bdf2ac05920a664d049d8fe2457
e6f3028c2f1a9c43ad97140e14f9b9d3702d7c52
refs/heads/main
2023-06-16T03:48:50.481467
2021-07-03T19:37:46
2021-07-03T19:37:46
376,636,766
0
0
null
2021-06-25T04:17:04
2021-06-13T20:43:01
null
UTF-8
Java
false
false
1,188
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 model; /** * * @author alvin */ public class Client { int IdCliente; String Dni; String Nombres; String Direccion; public Client(){ } public Client(int IdCliente, String Dni, String Nombres, String Direccion) { this.IdCliente = IdCliente; this.Dni = Dni; this.Nombres = Nombres; this.Direccion = Direccion; } public int getIdCliente() { return IdCliente; } public void setIdCliente(int IdCliente) { this.IdCliente = IdCliente; } public String getDni() { return Dni; } public void setDni(String Dni) { this.Dni = Dni; } public String getNombres() { return Nombres; } public void setNombres(String Nombres) { this.Nombres = Nombres; } public String getDireccion() { return Direccion; } public void setDireccion(String Direccion) { this.Direccion = Direccion; } }
bc9653e072d21b39e2e25934a675d49787598f00
f8781777aa73558d30e805a5d7b0f405a72dd0e1
/src/main/java/com/java_feature/jdk8/lambda/other_experience/TestSort.java
f06435bfdee5a96b271e7de5f093b02ad87cf458
[]
no_license
Mengbuxiu/demo-springboot-interview
26a0c28ec1ee792e58f3a446e7d29591456e3fda
71f9404748af5c123bf7285b3618b3f6388564f0
refs/heads/master
2022-12-24T20:49:00.821630
2021-09-06T09:37:56
2021-09-06T09:37:56
163,373,909
0
0
null
2022-10-05T18:22:29
2018-12-28T06:21:02
JavaScript
UTF-8
Java
false
false
790
java
package com.java_feature.jdk8.lambda.other_experience; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.function.Function; /** * @author king_zl * @version 1.0 * @description // TODO * @date 2019/4/10 16:27 */ public class TestSort { public static void main(String[] args) { List<String> list = Arrays.asList("a", "q", "d", "s", "r", "y"); // list.sort(list, new Comparator<String>() { // @Override // public int compare(String o1, String o2) { // return o2.compareTo(o1); // } // }); //list.sort((o1, o2) -> o2.compareTo(o1)); list.sort(Comparator.reverseOrder()); list.forEach(System.out::println); } }
d92995d435d411ef5be4056f82202a3569176862
30fd295978d3ae294044a88f1c6aa81c2284e42a
/src/com/erenerdilli/Utilities.java
55d4f4d8ab5df02daa1da9270e70bab4342b53ba
[]
no_license
erenerdilli/GenDemo
51fef93428fcd1c94cf136ff0e0fb2a2e24342fa
91bded19bd7f92e24dd9fdc373d8ff915967c284
refs/heads/master
2020-04-25T11:56:04.820601
2019-02-28T21:47:50
2019-02-28T21:47:50
172,761,692
0
0
null
null
null
null
UTF-8
Java
false
false
1,084
java
package com.erenerdilli; import org.w3c.dom.Document; import java.util.List; import static com.erenerdilli.Strings.TAG_ID; public enum Utilities { /* * @Author erenerdilli * The class for basic utility methods */ INITIALIZE; public static void populateList(Document doc, List<String> pList){ for (int i=0; i<doc.getElementsByTagName(TAG_ID).getLength(); i++){ pList.add(doc.getElementsByTagName(TAG_ID).item(i).getTextContent()); } } public static boolean isDocEmpty(Document doc){ if (doc.getElementsByTagName(TAG_ID).getLength() == 0) return true; return false; } public static void printListElements(List<String> list){ for (String s : list){ System.out.println(s); } } // Get the links in the Arraylist and put them in a string with new lines for each. public static String getLinksAsString(List<String> list){ String content = ""; for (String s : list) content+= s+"\n"; return content; } }
62cbfb5876de87c4943f8f3680b9da2426ded3af
e46d071f49bbc6d8266fe5d84d104827945bdf26
/src/main/java/chd/shoppingonline/service/basic/ConsigneeInformationService.java
3dcb425c4a9f3f6878492150fb74bedd22b0e18b
[]
no_license
CongLinDev/OnlineShopping
f484f5e7abbc45a0ef53dd268ce6d5ee1af77d45
1e343f924c0f983fdc75442a02badd0b6a458c7a
refs/heads/master
2020-04-28T21:33:35.369134
2019-06-21T06:23:44
2019-06-21T06:23:44
175,586,702
0
0
null
null
null
null
UTF-8
Java
false
false
1,643
java
package chd.shoppingonline.service.basic; /* * @ClassName ConsigneeInformationService * @Author 从林 * @Date 2019-03-24 14:10 * @Description 收货信息服务接口 */ import chd.shoppingonline.entity.ConsigneeInformation; import java.util.List; public interface ConsigneeInformationService { /** * 添加收货信息 * @param consigneeName 收货人姓名 * @param consigneeAddress 收货人地址 * @param consigneePhoneNumber 收货人手机号 * @return */ ConsigneeInformation addConsigneeInformation(String consigneeName, String consigneeAddress, String consigneePhoneNumber); /** * 添加收货信息 * @param consigneeInformation 收货信息 * @return */ ConsigneeInformation addConsigneeInformation(ConsigneeInformation consigneeInformation); /** * 通过收货信息id查询 * @param consigneeInformationId * @return */ ConsigneeInformation findConsigneeInformation(Long consigneeInformationId); /** * 删除收货信息 * @param consigneeInformationId 收货信息ID */ void deleteConsigneeInformation(Long consigneeInformationId); /** * 获取可见的收货信息 * @return */ List<ConsigneeInformation> getVisibleConsigneeInformations(); /** * 更新收货地址 * 将原来的收货地址置为不可见 * 返回一个新的收货地址 * @param consigneeInformation * @return */ ConsigneeInformation updateConsigneeInformation(ConsigneeInformation consigneeInformation); }
d60d76a8e6b2973e4e0534463801d0d28466d25f
3a68bf2dbb928976714366709955a45e8b6ae5a7
/src/main/java/com/apakgroup/recall/defaults/StaticMethodObjectBuilder.java
76bda33217703f1bbe0c2b519802061108e7e5bf
[]
no_license
DanielStephens/Recall
3baa252a94ec75549947caee982f78f68ef2e951
191c8b329343dd7465942f49ba4989938eccd626
refs/heads/master
2021-01-01T17:34:13.339011
2017-07-23T13:33:48
2017-07-23T13:33:48
98,099,578
0
0
null
null
null
null
UTF-8
Java
false
false
2,221
java
package com.apakgroup.recall.defaults; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; import java.util.Collection; import com.google.common.base.Optional; import com.google.common.base.Predicate; import com.google.common.collect.Collections2; public class StaticMethodObjectBuilder implements DefaultOptionalResolver { private final DefaultResolver delegateBuilder; public StaticMethodObjectBuilder(final DefaultResolver delegateBuilder) { this.delegateBuilder = delegateBuilder; } @Override public <T> Optional<T> generateDefaultFor(final Class<T> clazz) { for (Method method : staticBuildingMethods(clazz)) { boolean accessibility = method.isAccessible(); try { method.setAccessible(true); return Optional .of((T) method.invoke(null, generateDefaultsFor(delegateBuilder, method.getParameterTypes()))); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { continue; } finally { method.setAccessible(accessibility); } } return Optional.absent(); } private Object[] generateDefaultsFor(final DefaultResolver builder, final Class<?>[] classes) { Object[] proxies = new Object[classes.length]; for (int i = 0; i < classes.length; i++) { proxies[i] = builder.generateDefaultFor(classes[i]); } return proxies; } private <T> Collection<Method> staticBuildingMethods(final Class<T> clazz){ Collection<Method> allMethods = Arrays.asList(clazz.getDeclaredMethods()); return Collections2.filter(allMethods, staticBuildMethod(clazz)); } private <T> Predicate<Method> staticBuildMethod(final Class<T> clazz) { return new Predicate<Method>() { @Override public boolean apply(final Method input) { return Modifier.isStatic(input.getModifiers()) && clazz.isAssignableFrom(input.getReturnType()); } }; } }
bfd879eed64f314ba0887a2cee4869ea640b1799
c53a1d0e9a95276c7ad0f8573a82f6e06e438011
/blgroup-osp-reconf-web/overlays/com.bailiangroup.osp.blgroup-osp-common-web-1.0.2-20160805.081608-39/WEB-INF/classes/com/bailiangroup/osp/modules/sys/web/AreaController.java
0780a71324395c2dcf40ed129d14da908db50324
[]
no_license
lastbus/recommend-conf
141523860ee044ef0e82054057513115da2ceea0
faf14997263c581ae1375af962cb65110100b322
refs/heads/master
2021-01-13T17:31:46.293135
2017-02-13T09:28:30
2017-02-13T09:28:30
81,806,375
0
0
null
null
null
null
UTF-8
Java
false
false
4,775
java
/** * Copyright &copy; 2014-2020 <a href="https://www.bailiangroup.com/osp">Bailian Group OSP</a> All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); */ package com.bailiangroup.osp.modules.sys.web; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresUser; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; 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.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.bailiangroup.osp.base.core.service.ctx.ContextService; import com.bailiangroup.osp.base.core.util.CacheUtils; import com.bailiangroup.osp.common.config.Global; import com.bailiangroup.osp.common.domain.entity.Area; import com.bailiangroup.osp.common.domain.entity.User; import com.bailiangroup.osp.common.service.AreaService; import com.bailiangroup.osp.common.web.BaseController; import com.google.common.collect.Lists; import com.google.common.collect.Maps; /** * 区域Controller * @author IBM Consultant Team * @version 2013-5-15 */ @Controller @RequestMapping(value = "${adminPath}/sys/area") public class AreaController extends BaseController { @Inject private ContextService contextService; @Inject private AreaService areaService; @ModelAttribute("area") public Area get(@RequestParam(required=false) String id) { if (StringUtils.isNotBlank(id)){ return areaService.get(id); }else{ return new Area(); } } @RequiresPermissions("sys:area:view") @RequestMapping(value = {"list", ""}) public String list(Area area, Model model) { // User user = UserUtils.getUser(); // if(user.isAdmin()){ area.setId("1"); // }else{ // area.setId(user.getArea().getId()); // } model.addAttribute("area", area); List<Area> list = (List<Area>) CacheUtils.get("AreaCache.areaSortedList"); if ( list == null || list.isEmpty()) { list = Lists.newArrayList(); List<Area> sourcelist = areaService.findAll(); Area.sortList(list, sourcelist, area.getId()); CacheUtils.put("AreaCache.areaSortedList", list); } model.addAttribute("list", list); return "modules/sys/areaList"; } @RequiresPermissions("sys:area:view") @RequestMapping(value = "form") public String form(Area area, Model model) { User currentUser = contextService.<User>getCurrentUser(); if (area.getParent()==null||area.getParent().getId()==null){ area.setParent(currentUser.getOffice().getArea()); } area.setParent(areaService.get(area.getParent().getId())); model.addAttribute("area", area); return "modules/sys/areaForm"; } @RequiresPermissions("sys:area:edit") @RequestMapping(value = "save") public String save(Area area, Model model, RedirectAttributes redirectAttributes) { if (!beanValidator(model, area)){ return form(area, model); } areaService.save(area); addMessage(redirectAttributes, "保存区域'" + area.getName() + "'成功"); return "redirect:"+Global.getAdminPath()+"/sys/area/"; } @RequiresPermissions("sys:area:edit") @RequestMapping(value = "delete") public String delete(String id, RedirectAttributes redirectAttributes) { if (Area.isAdmin(id)){ addMessage(redirectAttributes, "删除区域失败, 不允许删除顶级区域或编号为空"); }else{ areaService.delete(id); addMessage(redirectAttributes, "删除区域成功"); } return "redirect:"+Global.getAdminPath()+"/sys/area/"; } @RequiresUser @ResponseBody @RequestMapping(value = "treeData") public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId, HttpServletResponse response) { response.setContentType("application/json; charset=UTF-8"); List<Map<String, Object>> mapList = Lists.newArrayList(); // User user = UserUtils.getUser(); List<Area> list = areaService.findAll(); for (int i=0; i<list.size(); i++){ Area e = list.get(i); if (extId == null || (extId!=null && !extId.equals(e.getId()) && e.getParentIds().indexOf(","+extId+",")==-1)){ Map<String, Object> map = Maps.newHashMap(); map.put("id", e.getId()); // map.put("pId", !user.isAdmin()&&e.getId().equals(user.getArea().getId())?0:e.getParent()!=null?e.getParent().getId():0); map.put("pId", e.getParent()!=null?e.getParent().getId():0); map.put("name", e.getName()); mapList.add(map); } } return mapList; } }
3dedea7dc0095730f1cbfce72937a9206a080cc0
42ea82481e8389f3a4011fef270302fb99c73bf5
/app/src/main/java/dicoders/com/login/Main4ActivityLogIn.java
9ed18f45b60159cfaad4beed114d258089969445
[]
no_license
monassar97/Registration
1fee06f5fbbb0745a9a58a1daa16480f29c65024
d43c011f5a1ad6584ae6203f04e9bd126a332ee9
refs/heads/master
2020-04-27T03:04:25.594252
2019-03-05T20:20:55
2019-03-05T20:20:55
174,014,433
0
0
null
null
null
null
UTF-8
Java
false
false
441
java
package dicoders.com.login; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.Toast; public class Main4ActivityLogIn extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main4_log_in); Toast.makeText(this,"Welcome!",Toast.LENGTH_LONG).show(); } }
6c5347b4e7957e2cb00e4f44d0a04a7b43025f3f
60c7d8b2e8ae1d547f6cfc52b81d2eade1faf31d
/reportProject/st-js-stjs-3.3.0/generator/src/test/java/org/stjs/generator/writer/names/Names5.java
5639fe5ce16611675e7dea4e0b20c48cbcfc744c
[ "Apache-2.0" ]
permissive
dovanduy/Riddle_artifact
851725d9ac1b73b43b82b06ff678312519e88941
5371ee83161f750892d4f7720f50043e89b56c87
refs/heads/master
2021-05-18T10:00:54.221815
2019-01-27T10:10:01
2019-01-27T10:10:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
149
java
package org.stjs.generator.writer.names; public class Names5 { private int field = 1; public int method(Names5 THIS) { return THIS.field; } }
047ebbe12ad6a1331bf2e6e539c659f327c91521
1341d30e1e5ed9df40bea9c542c5f4ad53b882a2
/Task_2_2_6.java
f8ac382ec7e0f879ae9df368ba067194b622efec
[]
no_license
ToxaRyd/Introduction-to-Java.-General-Programming
27ba6d40ce8a5667f7ff21c0d21b3366b9a42fb5
04b71df96a19fcf52d0f9722ce9c52c44e03ecba
refs/heads/main
2023-05-29T20:28:06.246292
2021-06-07T18:17:29
2021-06-07T18:17:29
350,740,541
0
0
null
null
null
null
UTF-8
Java
false
false
1,018
java
package com.company; import java.util.*; import java.lang.*; class Main { public static void main (String[] args) { Scanner num = new Scanner(System.in); int[][] a; int n, x=1, y=0; System.out.print("Введите порядок: "); n = num.nextInt(); if (n%2 != 0) { System.out.println("Число должно быть четным!"); System.exit(1); } a = new int[n][n]; for (int i = 0; i < n; i++) { for (int j = y; j < n-y; j++) { a[i][j] = x; } if (i<n/2) { if (y < n/2-1) { x++; y++; } } else { x--; y--; } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) System.out.print(a[i][j] + " "); System.out.println(); } } }
d429c1d36ac7d2981efccda88d5b14f372141f55
e9f730daae9fec2fe8dd278ad87caee83f461105
/app_upperair/src/main/java/cwb/cmt/upperair/utils/ParseStnXml.java
491381448910c00e556e12fc7f161de6183381e9
[]
no_license
StellaChieh/annual-report-builder
16112fcb046c871100e8c3a5833dc3cbc8e5417d
e0aa9e90a4842b604e1d9a8e54cc92e8bbb8e12b
refs/heads/master
2020-11-24T12:01:18.599246
2019-12-15T05:32:35
2019-12-15T05:32:35
228,133,836
1
0
null
null
null
null
UTF-8
Java
false
false
1,002
java
package cwb.cmt.upperair.utils; import java.io.FileInputStream; import java.io.IOException; import java.util.List; import javax.xml.transform.stream.StreamSource; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.oxm.Unmarshaller; import org.springframework.stereotype.Service; import cwb.cmt.upperair.model.Station; import cwb.cmt.upperair.model.StationList; @Service public class ParseStnXml { @Autowired private Unmarshaller castorMarshaller; private static final Logger logger = LogManager.getLogger(); public List<Station> getStns(String stnXmlPath) throws IOException { StationList list = null; try (FileInputStream is = new FileInputStream(stnXmlPath)){ logger.info("Parse " + stnXmlPath + "."); list = (StationList)castorMarshaller.unmarshal(new StreamSource(is)); logger.debug("Parsed stations: " + list); } return list.getStns(); } }
e61fad1f8f99bc0ebb95c21c904867dc0e215a26
d2f2c3b120a15f15fbd6f1f1e271c38aaa77fb3f
/src/proxy/statics/StaticProcyDemo.java
76577c1efe9f9cb50262acd39cc306715090c75a
[]
no_license
chenkangqin/DesignPattern
7fdf4f348852ceb9e5e80d45f6f86398cee72252
e9866a6389baad88defbae46778f25b4d4d4b542
refs/heads/master
2020-05-06T13:30:10.145659
2019-04-09T12:45:03
2019-04-09T12:45:03
180,133,182
0
0
null
null
null
null
UTF-8
Java
false
false
312
java
package proxy.statics; import proxy.statics.UserProcy.UserProcy; import proxy.statics.impl.UserImpl; import proxy.statics.inteface.UserMapper; public class StaticProcyDemo { public static void main(String[] args){ UserMapper mapper = new UserProcy(new UserImpl()); mapper.insert(); } }
53e5bb9845c461321cb1e85b8688562311c07cc8
fda85640143d9605415e8a9e7968b66d10eab7a0
/src/main/java/com/kodilla/drinks_backend/mapper/TrelloMapper.java
eded62d5b0c1c71c62866093139ae7f2fdba3c30
[]
no_license
MarcinSkrzecz/Drinks-Application-Backend
8223a4e4f17fc4f7b6afc1ca2ecd90537307e3d6
c24f0e1c92ff663f1e16c1dd7f5a32d2d0b1e898
refs/heads/master
2023-01-27T23:11:05.666179
2020-11-25T17:35:40
2020-11-25T17:35:40
313,381,853
0
0
null
null
null
null
UTF-8
Java
false
false
1,798
java
package com.kodilla.drinks_backend.mapper; import com.kodilla.drinks_backend.domain.drink.Drink; import com.kodilla.drinks_backend.domain.RP.proposedIngredients.ProposedIngredients; import com.kodilla.drinks_backend.service.ProposedIngredientsService; import com.kodilla.drinks_backend.service.DrinkService; import com.kodilla.drinks_backend.domain.trello.TrelloMessageDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class TrelloMapper { @Autowired private DrinkService drinkService; @Autowired private ProposedIngredientsService proposedIngredientsService; public TrelloMessageDto mapDrinkDataToSend(final Long drinkToSendId) { Drink drinkToSend = drinkService.getDrink(drinkToSendId); Drink drink = new Drink.DrinkBuilder() .id(drinkToSend.getId()) .username(drinkToSend.getUsername()) .drinkName(drinkToSend.getDrinkName()) .recipe(drinkToSend.getRecipe()) .ingredients(drinkToSend.getIngredients()) .build(); System.out.println(drink); return new TrelloMessageDto( drinkToSend.getDrinkName(), drink.toString() ); } public TrelloMessageDto mapProposedIngredientDataToSend(Long proposedIngredientId) { ProposedIngredients proposedIngredientsDB = proposedIngredientsService.getIngredient(proposedIngredientId); String title = "Drinks Application - Ingredient reached enough votes"; String content = "Ingredient " + proposedIngredientsDB.getDescription() + " has reached 5 votes!"; return new TrelloMessageDto( title, content ); } }
bb2b68833ffe079d5a9fd141b5ae5afc0e6c2f82
720a7fcc567fab882fbee67f94860975f2555546
/collections/collections-app1/src/com/lara/pack1/M3.java
3f8f7bfb9c16eaea108d99acb217619079b22d28
[]
no_license
Peddaraju/core-java-advanced
4f4b1bdf20c9f63bdac5e8f630f2107d5b4d4755
bb0e3978450567c58c4f6cd2f4bd3e18eaf9a8f8
refs/heads/main
2023-08-07T03:33:19.105831
2021-10-03T03:42:17
2021-10-03T03:42:17
412,963,785
0
0
null
null
null
null
UTF-8
Java
false
false
444
java
package com.lara.pack1; import java.util.HashMap; public class M3 { public static void main(String[] args) { HashMap map1 = new HashMap(); map1.put(null, 23344); map1.put(345, "rty"); map1.put(3.4, true); map1.put('a', null); map1.put(null, 456); System.out.println(map1); String s1 = (String) map1.get(345); System.out.println(s1); String s2 = (String) map1.get("xyz"); System.out.println(s2); } }
dd36828f768928b1d13c8c6ed5aefefaf0519fc7
31c4a2f6894cc74339f23d01c38d8daab19cd844
/Vaccination/src/main/java/be/ulb/polytech/infoh400project/view/FHIRSearchWindow.java
0d6c1c004e3020e3f23f4a7efa4c2dd1a2223dd5
[]
no_license
Ahget/ProjectVaccine
7f7a6bd690ea7e7e0bb1e9ea047bc677a859d5c9
24d114972287e5301def9935cd044df3f1423d6a
refs/heads/main
2023-04-19T21:24:14.033802
2021-05-21T13:06:24
2021-05-21T13:06:24
363,946,218
0
0
null
2021-05-11T20:23:23
2021-05-03T13:53:19
Java
UTF-8
Java
false
false
8,338
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 be.ulb.polytech.infoh400project.view; import be.ulb.polytech.infoh400project.services.FHIRServices; import java.util.List; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import be.ulb.polytech.infoh400project.controller.PatientJpaController; import be.ulb.polytech.infoh400project.controller.PersonJpaController; import be.ulb.polytech.infoh400project.model.Patient; import be.ulb.polytech.infoh400project.controller.GlobalProperties; /** * * @author 8Utilisateur */ public class FHIRSearchWindow extends javax.swing.JFrame { private final EntityManagerFactory emfac = Persistence.createEntityManagerFactory("be.ulb.polytech.infoh400project_Vaccination_jar_1.0-SNAPSHOTPU"); private final PatientJpaController patientCtrl = new PatientJpaController(emfac); private final PersonJpaController personCtrl = new PersonJpaController(emfac); private final FHIRServices fhirServices = new FHIRServices(); /** * Creates new form FHIRSearchWindow */ public FHIRSearchWindow() { initComponents(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); fhirHostTextField = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); familyNameTextField = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); searchResultsList = new javax.swing.JList<>(); doSearchButton = new javax.swing.JButton(); saveToDatabaseButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel1.setText("Search Patient"); jLabel2.setText("FHIR Host:"); fhirHostTextField.setText(GlobalProperties.getProperties().getProperty("fhir.defaultHost")); jLabel3.setText("Family Name:"); jScrollPane1.setViewportView(searchResultsList); doSearchButton.setText("Search"); doSearchButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { doSearchButtonActionPerformed(evt); } }); saveToDatabaseButton.setText("Save to Database"); saveToDatabaseButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveToDatabaseButtonActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(layout.createSequentialGroup() .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(fhirHostTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(familyNameTextField))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(doSearchButton)) .addComponent(saveToDatabaseButton)) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent(fhirHostTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(familyNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(doSearchButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(saveToDatabaseButton)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void doSearchButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doSearchButtonActionPerformed List<Patient> patients = fhirServices.searchByFamilyName(familyNameTextField.getText(), fhirHostTextField.getText()); EntityListModel<Patient> listModel = new EntityListModel(patients); searchResultsList.setModel(listModel); }//GEN-LAST:event_doSearchButtonActionPerformed private void saveToDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveToDatabaseButtonActionPerformed if( searchResultsList.getSelectedIndex() < 0 ){ return; } EntityListModel<Patient> model = (EntityListModel) searchResultsList.getModel(); Patient selected = model.getList().get(searchResultsList.getSelectedIndex()); personCtrl.create(selected.getIdperson()); patientCtrl.create(selected); dispose(); }//GEN-LAST:event_saveToDatabaseButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton doSearchButton; private javax.swing.JTextField familyNameTextField; private javax.swing.JTextField fhirHostTextField; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton saveToDatabaseButton; private javax.swing.JList<String> searchResultsList; // End of variables declaration//GEN-END:variables }
4df2517014ea8c2419417d5db9187753c28e499a
8cc440953018526ccf13d3a336f67bc4eec8849e
/src/main/gui_construct.java
5602db75abb5739d2022126786db689231883b95
[]
no_license
smx-smx/Decrypt_RBI_Firmware_Utility
fb67e48044687fd120f9786b6533438bca2f4909
80b64c78eab6cd359510d2045395c4284aa6b1b5
refs/heads/master
2020-08-29T19:59:05.767489
2019-10-28T22:31:32
2019-10-28T22:31:32
218,157,187
0
0
null
2019-10-28T22:30:29
2019-10-28T22:30:29
null
UTF-8
Java
false
false
7,880
java
package main; import java.io.File; import java.util.Map; import java.util.function.UnaryOperator; import java.util.regex.Pattern; import javafx.geometry.Insets; import javafx.geometry.Orientation; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.control.ScrollPane; import javafx.scene.control.Separator; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.control.TextFormatter; import javafx.scene.control.TitledPane; import javafx.scene.control.ToggleGroup; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.FontWeight; public class gui_construct { private final Scene scene; private rbi_info rbi_constructor; public static enum State { LOADED, DECRYPTED, IDLE }; private State state = State.IDLE; TextField FileInputText; TextArea log; StackPane buttonPanel; Button decryptFile; Button encryptFile; Button loadFile; TitledPane OsckInputPanel; ComboBox<String> OsckSelect; Label ModelLabel; Label OsckManualinfotext; TextField OsckInput; HBox HeaderSubPanel; ToggleGroup OsckGroup; public gui_construct() { BorderPane root = new BorderPane(); root.setPadding(new Insets(20, 10, 10, 10)); this.scene = new Scene(root); scene.getStylesheets().add(Main.class.getResource("/modena_dark.css").toExternalForm()); root.setTop(Header()); root.setCenter(Content()); root.setBottom(Footer()); } button_listners Listners = new button_listners(this); private Node Header() { final StackPane headPanel = new StackPane(); headPanel.setPadding(new Insets(0 , 0 , 20 , 0 )); final Label head = new Label("Utility to decrypt Technicolor RBI firmware files"); head.setFont(Font.font("Arial", FontWeight.NORMAL, 20)); headPanel.getChildren().add(head); return headPanel; } private Node Content() { VBox content = new VBox(); content.getChildren().add(InputFilePanel()); content.getChildren().add(InputOsckPanel()); content.getChildren().add(InputManualOsckPanel()); content.getChildren().add(InfoLogPanel()); return content; } private Node Footer() { VBox footer = new VBox(); footer.getChildren().add(Separator()); footer.getChildren().add(ButtonPanel()); return footer; } private Node InputFilePanel() { final HBox fileSubPanel = new HBox(); FileInputText = new TextField(); FileInputText.setEditable(false); Button input = new Button("Select File"); input.setOnAction(Listners.getInputFileEventHandler()); fileSubPanel.getChildren().add(FileInputText); fileSubPanel.getChildren().add(input); HBox.setHgrow(FileInputText, Priority.ALWAYS); TitledPane filePanel = new TitledPane("RBI firmware File", fileSubPanel); filePanel.setCollapsible(false); filePanel.setPadding(new Insets(0,0,10,0)); return filePanel; } private Node InputOsckPanel() { final HBox InputOsckSubPanel = new HBox(); OsckSelect = new ComboBox<>(); OsckSelect.getItems().addAll(board.getMap().keySet()); OsckSelect.getItems().add(0, "Manual"); OsckSelect.setOnAction(Listners.getcheckOsckSelectHandler()); ModelLabel = new Label("Please select"); ModelLabel.setPadding(new Insets(0,0,0,10)); InputOsckSubPanel.getChildren().add(OsckSelect); InputOsckSubPanel.getChildren().add(ModelLabel); TitledPane osckInputPanel = new TitledPane("Model Select", InputOsckSubPanel); osckInputPanel.setCollapsible(false); osckInputPanel.setPadding(new Insets(0,0,10,0)); return osckInputPanel; } private Node InputManualOsckPanel() { VBox InputManualOsckSubPanel = new VBox(); OsckManualinfotext = new Label("Insert the extracted OSCK key (64 char long)"); OsckManualinfotext.setVisible(false); OsckManualinfotext.managedProperty().bind(OsckManualinfotext.visibleProperty()); OsckInput = new TextField(); Pattern pattern = Pattern.compile(".{0,64}"); TextFormatter<TextFormatter.Change> formatter = new TextFormatter<>((UnaryOperator<TextFormatter.Change>) change -> { return pattern.matcher(change.getControlNewText()).matches() ? change : null; }); OsckInput.setTextFormatter(formatter); InputManualOsckSubPanel.getChildren().add(OsckManualinfotext); InputManualOsckSubPanel.getChildren().add(OsckInput); OsckInputPanel = new TitledPane("OSCK Key", InputManualOsckSubPanel); OsckInputPanel.setCollapsible(false); OsckInputPanel.setPadding(new Insets(0,0,10,0)); OsckInputPanel.setVisible(false); OsckInputPanel.managedProperty().bind(OsckInputPanel.visibleProperty()); return OsckInputPanel; } public void updateHeaderSubPanel() { Map<String,String> header = rbi_constructor.getHeaderTable(); VBox HeaderLegend = new VBox(); VBox HeaderValue = new VBox(); for (Map.Entry<String, String> entry : header.entrySet()) { HeaderLegend.getChildren().add(new Label(entry.getKey())); HeaderValue.getChildren().add(new Label(entry.getValue())); } HeaderSubPanel.getChildren().clear(); HeaderSubPanel.getChildren().add(HeaderLegend); HeaderSubPanel.getChildren().add(HeaderValue); } private Node InfoLogPanel() { HeaderSubPanel = new HBox(); log = new TextArea(); log.setEditable(false); TitledPane logPanel = new TitledPane("Log", new ScrollPane(log)); logPanel.setCollapsible(false); logPanel.setPadding(new Insets(0,5,0,0)); TitledPane HeaderPanel = new TitledPane("Header Info", HeaderSubPanel); HeaderPanel.setCollapsible(false); HeaderPanel.setPadding(new Insets(0,0,0,5)); HeaderSubPanel.setPrefWidth(350); HeaderSubPanel.setPrefHeight(350); HBox infoPanel = new HBox(); infoPanel.getChildren().add(logPanel); infoPanel.getChildren().add(HeaderPanel); return infoPanel; } private Node ButtonPanel() { buttonPanel = new StackPane(); decryptFile = new Button("Decrypt"); decryptFile.setDisable(true); decryptFile.setOnAction(Listners.getDecryptFileEventHandler()); buttonPanel.getChildren().add(decryptFile); return buttonPanel; } private Node Separator() { final HBox SeparatorPanel = new HBox(); SeparatorPanel.setPadding(new Insets(20, 0, 10, 0)); final Separator LineSeparator = new Separator(); LineSeparator.setOrientation(Orientation.HORIZONTAL); final Label Version = new Label("Version "+gui_inizializer.Version); Version.setPadding(new Insets(-10, 0, 0, 0)); Version.setTextFill(Color.GRAY); SeparatorPanel.getChildren().add(LineSeparator); SeparatorPanel.getChildren().add(Version); HBox.setHgrow(LineSeparator, Priority.ALWAYS); return SeparatorPanel; } public void setRbiConstructor(File file) { rbi_constructor = new rbi_info(file); } public void setState(String state) { this.state = State.valueOf(state); } public rbi_info getRbiConstructor() { return rbi_constructor; } public Scene getScene() { return scene; } public State getState() { return state; } }
e84fc876350f304f2588cb196ca3bf0741e87c70
dfcee574e2a33160d5cef4523e987fed7f628b4a
/src/main/java/com/ducon/daelimpick/user/UserRepository.java
8199dce79fe17d04bb7b7c7deabd3c10cf923e56
[]
no_license
DuYeong0020/2021_Summer_Daelimpick
f98bdb590c89504ea81a118659ab069055de6951
fa5728671805fa20d8557e531ce9be6865465802
refs/heads/main
2023-05-30T18:27:02.921011
2021-07-07T09:21:34
2021-07-07T09:21:34
383,718,718
0
0
null
null
null
null
UTF-8
Java
false
false
223
java
package com.ducon.daelimpick.user; // 인터페이스랑 구현체랑 같은 패키지에 있는 것이 별로라고 한다. public interface UserRepository { void save(User user); User findById(String userId); }
aac596e9b0c0fbd3798e4249b1b2e5e725790546
6497d71845bf5f60ca6c0138f5cc760153a89c48
/MyTestJar/app/src/main/java/com/wildwolf/mytestjar/MainActivity.java
2bba5c092719c96fc12fe97fd6233dcd9a3ec962
[]
no_license
1008611/AndroidStudio-makeJar
988fa7a2010a2d078ac03b7f93822367ae3b6f2e
f05897e587e4930f7559ae65a3ff90edb1c78035
refs/heads/master
2021-01-19T05:59:49.408038
2016-08-12T07:41:56
2016-08-12T07:41:56
65,533,063
0
0
null
null
null
null
UTF-8
Java
false
false
364
java
package com.wildwolf.mytestjar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
cc4c5c5e02e71f792b22b057610bfcb7b52489cc
8e8d0df13fb2d2cd28103aea9f08acb6e129ccc8
/app/src/main/java/com/example/recyclerview_testapi/model/response/Article.java
8e8e20dd0349f41548526db9df87f8f7ced870a9
[]
no_license
phuctran141/NewsApi
a654427e2e18800a32e83d4ad55324579080be17
20d210a72f55afc78f3b1b6f93263046be338fa5
refs/heads/master
2022-04-18T12:14:04.558194
2020-04-16T15:39:08
2020-04-16T15:39:08
256,257,608
0
0
null
null
null
null
UTF-8
Java
false
false
1,603
java
package com.example.recyclerview_testapi.model.response; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Article { @SerializedName("source") @Expose private Source source; @SerializedName("author") @Expose private String author; @SerializedName("title") @Expose private String title; @SerializedName("description") @Expose private String description; @SerializedName("url") @Expose private String url; @SerializedName("urlToImage") @Expose private String urlToImage; @SerializedName("publishedAt") @Expose private String publishedAt; @SerializedName("content") @Expose private String content; public Source getSource() { return source; } public void setSource(Source source) { this.source = source; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getUrlToImage() { return urlToImage; } public void setUrlToImage(String urlToImage) { this.urlToImage = urlToImage; } public String getPublishedAt() { return publishedAt; } public void setPublishedAt(String publishedAt) { this.publishedAt = publishedAt; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } }
d7d8a5470cafc04b7a5b9f3f6ffa38b3e147ed3c
47c5177fc6667ce608d39e0c061d872d174288b2
/src/at/easydiet/teamb/domain/object/NutritionProtocolDO.java
13966a357d9108548efdf7d41cc6212830a1ab5f
[]
no_license
manuelTscholl/easydiet-team-c
3819ea56a703c90e23f928865a234e75643a60fb
4a65467e4022511cd9c0df040651faae65d6426c
refs/heads/master
2021-01-10T00:52:58.080446
2011-06-11T12:58:20
2011-06-11T12:58:20
32,137,119
0
0
null
null
null
null
UTF-8
Java
false
false
2,568
java
package at.easydiet.teamb.domain.object; import java.util.GregorianCalendar; import org.apache.log4j.Logger; import at.easydiet.teamb.domain.INutritionProtocol; import at.easydiet.teamb.domain.util.CalendarUtil; import at.easydiet.teamb.domain.util.ClobConverter; import at.easydiet.model.NutritionProtocol; /** * Represents a NutritionProtocol in the domain layer */ public class NutritionProtocolDO extends DietPlanDO implements INutritionProtocol { private static Logger LOGGER = Logger.getLogger(NutritionProtocolDO.class); private NutritionProtocol _nutritionProtocol; /** * Instantiates a new nutrition protocol. * * @param nutritionProtocol * the nutrition protocol */ public NutritionProtocolDO(NutritionProtocol nutritionProtocol) { if (nutritionProtocol == null) { LOGGER.debug("NutritionProtocol is null"); } _nutritionProtocol = nutritionProtocol; } /* * (non-Javadoc) * @see at.easydiet.domain.object.INutritionProtocol#getDate() */ @Override public GregorianCalendar getDate() { return CalendarUtil.ConvertDateToGregorianCalendar(_nutritionProtocol.getDate()); } /* * (non-Javadoc) * @see at.easydiet.domain.object.INutritionProtocol#setDate(java.util.GregorianCalendar) */ @Override public void setDate(GregorianCalendar date) { _nutritionProtocol.setDate(CalendarUtil.ConvertGregorianCalendarToDate(date)); } /* * (non-Javadoc) * @see at.easydiet.domain.object.INutritionProtocol#getContact() */ @Override public String getContact() { return _nutritionProtocol.getContact(); } /* * (non-Javadoc) * @see at.easydiet.domain.object.INutritionProtocol#setContact(java.lang.String) */ @Override public void setContact(String contact) { _nutritionProtocol.setContact(contact); } /* * (non-Javadoc) * @see at.easydiet.domain.object.INutritionProtocol#getNotice() */ @Override public String getNotice() { return ClobConverter.ClobToString(_nutritionProtocol.getNotice()); } /* * (non-Javadoc) * @see at.easydiet.domain.object.INutritionProtocol#setNotice(java.lang.String) */ @Override public void setNotice(String notice) { _nutritionProtocol.setNotice(ClobConverter.StringToClob(notice)); } /* * (non-Javadoc) * @see at.easydiet.domain.object.INutritionProtocol#isSet() */ @Override public boolean isSet() { return !(_nutritionProtocol == null); } public NutritionProtocol getModel() { return _nutritionProtocol; } }
[ "[email protected]@4feab3de-de25-87cd-0e07-2f1f9e466e77" ]
[email protected]@4feab3de-de25-87cd-0e07-2f1f9e466e77
8e314785f2068aa92b4cec94e9b5d98ca3e56b75
ffecdb7b9fcc0a4ba5dc29af4fc5c9bc3f8d5827
/Source/h2bi.desif/h2bi.desif/src/br/gov/pbh/desif/model/pojo/IndicesMonetarios.java
f2201f64c69c753cc3783614467d48fb2a82d940
[]
no_license
jhenriquecosta/java-desif
742bc3700b28947fed3af1c9e1d0324b88a6951e
2ebdb0771b37cb88a75e5ff009051a8101b694d9
refs/heads/main
2023-07-01T06:02:03.201337
2021-08-11T01:56:59
2021-08-11T01:56:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
492
java
package br.gov.pbh.desif.model.pojo; import br.gov.pbh.desif.model.pojo.base.AbstractIndicesMonetarios; import java.io.Serializable; // Referenced classes of package br.gov.pbh.desif.model.pojo: // IndicesMonetariosId public class IndicesMonetarios extends AbstractIndicesMonetarios implements Serializable { public IndicesMonetarios() { } public IndicesMonetarios(IndicesMonetariosId id, Double valIndiMone) { super(id, valIndiMone); } }
c7874131357ea760a3f08aeef0caa968f4388fc1
820d90d7752585d5769237015e019719527513f5
/src/test/java/org/unclazz/parsec/MappersTest.java
f31076880cb52c1f8661b02eec5be10f8772aa3b
[ "MIT" ]
permissive
unclazz/unclazz-parsec
5777fb4829e488815416c58eb02581d209361813
eaca02c3cc945fe565b4ef6eef3c24e101f45e66
refs/heads/master
2021-05-05T04:26:42.018858
2017-10-16T12:50:30
2017-10-16T12:50:30
105,376,592
0
0
null
2017-10-01T11:03:52
2017-09-30T14:45:55
Java
UTF-8
Java
false
false
898
java
package org.unclazz.parsec; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; import org.junit.Test; public class MappersTest { @Test public void testJavaString() { assertThat(Mappers.javaString("abc"), is("abc")); assertThat(Mappers.javaString("\\r\\n"), is("\r\n")); assertThat(Mappers.javaString("a\\rb\\nc"), is("a\rb\nc")); assertThat(Mappers.javaString("\\\\\\\""), is("\\\"")); assertThat(Mappers.javaString("\\u0041\\u0061"), is("Aa")); assertThat(Mappers.javaString("\\061\\61\\101\\141"), is("11Aa")); } @Test public void testDigits() { assertThat(Mappers.digits("1234"), is(1234)); assertThat(Mappers.digits("-1234"), is(-1234)); assertThat(Mappers.floatingPoint("-12.34"), is(-12.34)); } @Test public void testFloatingPoint() { assertThat(Mappers.floatingPoint("-12.34"), is(-12.34)); } }
9a4865247535da3298376b0bf78b951088dc249a
99ca36cf040c7fdc3547e23180e30557cdbaf8b5
/SpringCloud系列第10节之服务网关Zuul文件上传/spring-cloud-demo-10/sping-cloud-eureka-server-upload/src/main/java/com/example/spingcloudeurekaserverupload/SpingCloudEurekaServerUploadApplication.java
ef2828f2444b4cc0c58a7af4a931c887c48fd32f
[]
no_license
Fillavacancy/spring-cloud-demo
48e987673301c90b7485034ae8106c65c73ba05a
25957c91400c9943840e44af87b5e7c5a3ed7d8a
refs/heads/master
2021-04-03T08:20:03.430402
2018-03-12T08:29:00
2018-03-12T08:29:06
124,856,974
0
0
null
null
null
null
UTF-8
Java
false
false
604
java
package com.example.spingcloudeurekaserverupload; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; @EnableEurekaClient @EnableHystrixDashboard // Hystrix 仪表盘 @SpringBootApplication public class SpingCloudEurekaServerUploadApplication { public static void main(String[] args) { SpringApplication.run(SpingCloudEurekaServerUploadApplication.class, args); } }
9fe673943c2c8f10736032e0c216fb12b28689fc
72a7d36b1812869ee6e7b6f8af817a52e8e4e082
/yapin-api/src/main/java/com/lf/yapin/pms/service/ProductCategoryService.java
766b64292a64be93e21c79d2e7982ad4dc7f0345
[]
no_license
genuinefun/yapin-mall-admin
92a9a09c0c8bbd1e246e29c0e8b7d843f31f63b9
748dc228595dbbb21fb7cadbcb48fbccbee4429a
refs/heads/master
2022-07-12T19:51:19.457533
2020-03-20T15:43:59
2020-03-20T15:43:59
246,858,054
0
0
null
2022-06-21T03:01:36
2020-03-12T14:41:22
Java
UTF-8
Java
false
false
310
java
package com.lf.yapin.pms.service; import com.lf.yapin.pms.entity.ProductCategory; import com.baomidou.mybatisplus.extension.service.IService; /** * <p> * 产品分类 服务类 * </p> * * @author lf * @since 2020-03-12 */ public interface ProductCategoryService extends IService<ProductCategory> { }
ead54db179899440333df50c7c7064c746c97c9b
511ddd9226636ea54a29036593bb79d6f5c6ca0b
/src/com/hotelProject/controller/CreateRentServlet.java
59c4e427e33a57029de15d83c39328268968e7ec
[]
no_license
YesmineZribi/ehotel
c9da9742b27fd02cbf4a88c360c16f418c75fc15
9a5ee8239bf47caa959851f84d1111f94b82cd9c
refs/heads/master
2020-07-26T11:41:15.439162
2019-09-16T14:57:12
2019-09-16T14:57:12
208,632,792
3
0
null
null
null
null
UTF-8
Java
false
false
6,814
java
package com.hotelProject.controller; import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.sql.Date; import java.sql.SQLException; import java.util.List; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.hotelProject.Classes.Address; import com.hotelProject.Classes.Amenity; import com.hotelProject.Classes.Booking; import com.hotelProject.Classes.Employee; import com.hotelProject.Classes.Rent; import com.hotelProject.Classes.Room; import com.hotelProject.model.AccountManagement; import com.hotelProject.model.HotelAndRoomManagement; import com.hotelProject.model.SearchRooms; /** * Servlet implementation class CreateRentServlet */ @WebServlet("/CreateRentServlet") public class CreateRentServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static String ipAddress = "http://192.168.0.38"; /** * @see HttpServlet#HttpServlet() */ public CreateRentServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { SearchRooms sr = new SearchRooms(); AccountManagement ac = new AccountManagement(); String availRooms = request.getParameter("avail_rooms_button"); String hotelID = request.getParameter("hotel_id"); String ssn = request.getParameter("ssn"); System.out.println("Employee SSN "+ssn); System.out.println("Hotel ID "+hotelID); String sDate = request.getParameter("start_date"); String eDate = request.getParameter("end_date"); request.setAttribute("start_date", sDate); request.setAttribute("end_date", eDate); //Get employee object Employee employee = ac.getEmployee(ssn); if (availRooms != null) { java.util.Date startDate = null; java.util.Date endDate = null; try { startDate = new SimpleDateFormat("yyyy-MM-dd").parse(sDate); endDate = new SimpleDateFormat("yyyy-MM-dd").parse(eDate); if (endDate.before(startDate) || endDate.equals(startDate)) { throw new ParseException("Illegal date format",0); } } catch (ParseException e) { // TODO Auto-generated catch block e.getStackTrace(); String message = ""; String failedMessage = "Illegal date format"; response.sendRedirect("EmployeeProfileDisplayServlet?ssn="+employee.getSsn()+"&password="+employee.getPassword()+"&user=employee&message="+message+"&failedMessage="+failedMessage); return; } //Get rooms available btwn start date and end date List<Room> roomsAvailable = null; try { Date s = new java.sql.Date(startDate.getTime()); Date ed = new java.sql.Date(endDate.getTime()); roomsAvailable = sr.searchRoomsByDate(s,ed ); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } //Get rooms from that that belong to this hotel List<Room> roomsAvailableInThisHotel = new ArrayList<Room>(); for (Room r: roomsAvailable) { if (r.getHotelID().contentEquals(hotelID)) { roomsAvailableInThisHotel.add(r); } } //Get employee address Address address = employee.getAddress(); //Get bookings for hotel employee works ag List<Booking> bookings = ac.getBookingsForHotel(employee.getHotelID()); //Get rents employee is taking care of List<Rent> employeeRents = ac.getRentsForHotel(ssn); //Get rents to archive List<Rent> pastRents = ac.getPastRents(employee.getHotelID()); //Get archived bookings for this hotel List<Booking> archivedBookings = ac.getArchivedBookings(employee.getHotelID()); //Get archived rents for this hotel List<Rent> archivedRents = ac.getArchivedRents(employee.getHotelID()); request.setAttribute("employee", employee); request.setAttribute("address", address); request.setAttribute("bookings", bookings); request.setAttribute("rents", employeeRents); request.setAttribute("past_rents", pastRents); request.setAttribute("archived_bookings", archivedBookings); request.setAttribute("archived_rents", archivedRents); request.setAttribute("archived_bookings", archivedBookings); //Add this list to the request request.setAttribute("rooms_avail", roomsAvailableInThisHotel); RequestDispatcher dispatcher = request.getRequestDispatcher("employee_profile.jsp"); dispatcher.forward(request, response); } else { //one of the select buttons was hit //Step (a) : Find which select button was pushed //get hotel rooms List<Room> roomsInThisHotel = sr.getRoomsForHotel(hotelID); Room roomSelected = roomsInThisHotel.get(0); String temporaryButton; for(Room r: roomsInThisHotel) { temporaryButton = request.getParameter(r.getRoomNumber()+"-to-add"); if (temporaryButton != null) { roomSelected = r; //Get amenities of this room: HotelAndRoomManagement hr = new HotelAndRoomManagement(); List<Amenity> roomAmenities = hr.getAmenitiesForRoom(hotelID, roomSelected.getRoomNumber()); String amenities = "Room includes "; for (Amenity a : roomAmenities) { amenities += a.getType()+" for $"+a.getPrice(); } amenities += " (price of amenities is already included)"; response.sendRedirect("http://"+ipAddress+":8080/HotelProject/add_rent.jsp?employee_ssn="+ssn+"&hotel_id="+hotelID+"&room_number="+roomSelected.getRoomNumber()+"&room_price="+roomSelected.getPrice()+"&room_capacity="+roomSelected.getCapacity()+"&view_type="+roomSelected.getViewType()+"&is_extended="+roomSelected.getIsExtended()+"&problem="+roomSelected.getProblem()+"&employee_password="+employee.getPassword()+"&start_date="+sDate+"&end_date="+eDate+"&amenities="+amenities); } } } try { sr.getConnection().close(); ac.getConnection().close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
764288e0057173b9facdc1f156ebd0745a82e712
5d886e65dc224924f9d5ef4e8ec2af612529ab93
/sources/kotlin/sequences/SequencesKt__SequencesKt$asSequence$$inlined$Sequence$1.java
fcf2b391e531978f5a286afc42832c06143d87bb
[]
no_license
itz63c/SystemUIGoogle
99a7e4452a8ff88529d9304504b33954116af9ac
f318b6027fab5deb6a92e255ea9b26f16e35a16b
refs/heads/master
2022-05-27T16:12:36.178648
2020-04-30T04:21:56
2020-04-30T04:21:56
260,112,526
3
1
null
null
null
null
UTF-8
Java
false
false
474
java
package kotlin.sequences; import java.util.Iterator; /* compiled from: Sequences.kt */ public final class SequencesKt__SequencesKt$asSequence$$inlined$Sequence$1 implements Sequence<T> { final /* synthetic */ Iterator $this_asSequence$inlined; public SequencesKt__SequencesKt$asSequence$$inlined$Sequence$1(Iterator it) { this.$this_asSequence$inlined = it; } public Iterator<T> iterator() { return this.$this_asSequence$inlined; } }
69956c198863a3b84be3356817cf45837f6db269
b2f07f3e27b2162b5ee6896814f96c59c2c17405
/java/lang/CharacterData01.java
c797db3b325e6a021bc5f99da9d94b133f084227
[]
no_license
weiju-xi/RT-JAR-CODE
e33d4ccd9306d9e63029ddb0c145e620921d2dbd
d5b2590518ffb83596a3aa3849249cf871ab6d4e
refs/heads/master
2021-09-08T02:36:06.675911
2018-03-06T05:27:49
2018-03-06T05:27:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
19,274
java
/* */ package java.lang; /* */ /* */ class CharacterData01 extends CharacterData /* */ { /* */ static final CharacterData instance; /* */ static final char[] X; /* */ static final char[] Y; /* */ static final int[] A; /* */ static final String A_DATA = ""; /* */ static final char[] B; /* */ /* */ int getProperties(int paramInt) /* */ { /* 71 */ int i = (char) paramInt; /* 72 */ int j = A[(Y[(X[(i >> 5)] << '\004' | i >> 1 & 0xF)] << '\001' | i & 0x1)]; /* 73 */ return j; /* */ } /* */ /* */ int getPropertiesEx(int paramInt) { /* 77 */ int i = (char) paramInt; /* 78 */ int j = B[(Y[(X[(i >> 5)] << '\004' | i >> 1 & 0xF)] << '\001' | i & 0x1)]; /* 79 */ return j; /* */ } /* */ /* */ int getType(int paramInt) { /* 83 */ int i = getProperties(paramInt); /* 84 */ return i & 0x1F; /* */ } /* */ /* */ boolean isOtherLowercase(int paramInt) { /* 88 */ int i = getPropertiesEx(paramInt); /* 89 */ return (i & 0x1) != 0; /* */ } /* */ /* */ boolean isOtherUppercase(int paramInt) { /* 93 */ int i = getPropertiesEx(paramInt); /* 94 */ return (i & 0x2) != 0; /* */ } /* */ /* */ boolean isOtherAlphabetic(int paramInt) { /* 98 */ int i = getPropertiesEx(paramInt); /* 99 */ return (i & 0x4) != 0; /* */ } /* */ /* */ boolean isIdeographic(int paramInt) { /* 103 */ int i = getPropertiesEx(paramInt); /* 104 */ return (i & 0x10) != 0; /* */ } /* */ /* */ boolean isJavaIdentifierStart(int paramInt) { /* 108 */ int i = getProperties(paramInt); /* 109 */ return (i & 0x7000) >= 20480; /* */ } /* */ /* */ boolean isJavaIdentifierPart(int paramInt) { /* 113 */ int i = getProperties(paramInt); /* 114 */ return (i & 0x3000) != 0; /* */ } /* */ /* */ boolean isUnicodeIdentifierStart(int paramInt) { /* 118 */ int i = getProperties(paramInt); /* 119 */ return (i & 0x7000) == 28672; /* */ } /* */ /* */ boolean isUnicodeIdentifierPart(int paramInt) { /* 123 */ int i = getProperties(paramInt); /* 124 */ return (i & 0x1000) != 0; /* */ } /* */ /* */ boolean isIdentifierIgnorable(int paramInt) { /* 128 */ int i = getProperties(paramInt); /* 129 */ return (i & 0x7000) == 4096; /* */ } /* */ /* */ int toLowerCase(int paramInt) { /* 133 */ int i = paramInt; /* 134 */ int j = getProperties(paramInt); /* */ /* 136 */ if ((j & 0x20000) != 0) { /* 137 */ int k = j << 5 >> 23; /* 138 */ i = paramInt + k; /* */ } /* 140 */ return i; /* */ } /* */ /* */ int toUpperCase(int paramInt) { /* 144 */ int i = paramInt; /* 145 */ int j = getProperties(paramInt); /* */ /* 147 */ if ((j & 0x10000) != 0) { /* 148 */ int k = j << 5 >> 23; /* 149 */ i = paramInt - k; /* */ } /* 151 */ return i; /* */ } /* */ /* */ int toTitleCase(int paramInt) { /* 155 */ int i = paramInt; /* 156 */ int j = getProperties(paramInt); /* */ /* 158 */ if ((j & 0x8000) != 0) /* */ { /* 160 */ if ((j & 0x10000) == 0) /* */ { /* 163 */ i = paramInt + 1; /* */ } /* 165 */ else if ((j & 0x20000) == 0) /* */ { /* 168 */ i = paramInt - 1; /* */ } /* */ /* */ } /* 176 */ else if ((j & 0x10000) != 0) /* */ { /* 179 */ i = toUpperCase(paramInt); /* */ } /* 181 */ return i; /* */ } /* */ /* */ int digit(int paramInt1, int paramInt2) { /* 185 */ int i = -1; /* 186 */ if ((paramInt2 >= 2) && (paramInt2 <= 36)) { /* 187 */ int j = getProperties(paramInt1); /* 188 */ int k = j & 0x1F; /* 189 */ if (k == 9) { /* 190 */ i = paramInt1 + ((j & 0x3E0) >> 5) & 0x1F; /* */ } /* 192 */ else if ((j & 0xC00) == 3072) /* */ { /* 194 */ i = (paramInt1 + ((j & 0x3E0) >> 5) & 0x1F) + 10; /* */ } /* */ } /* 197 */ return i < paramInt2 ? i : -1; /* */ } /* */ /* */ int getNumericValue(int paramInt) { /* 201 */ int i = getProperties(paramInt); /* 202 */ int j = -1; /* */ /* 204 */ switch (i & 0xC00) { /* */ case 0: /* */ default: /* 207 */ j = -1; /* 208 */ break; /* */ case 1024: /* 210 */ j = paramInt + ((i & 0x3E0) >> 5) & 0x1F; /* 211 */ break; /* */ case 2048: /* 213 */ switch (paramInt) { case 65811: /* 214 */ j = 40; break; /* */ case 65812: /* 215 */ j = 50; break; /* */ case 65813: /* 216 */ j = 60; break; /* */ case 65814: /* 217 */ j = 70; break; /* */ case 65815: /* 218 */ j = 80; break; /* */ case 65816: /* 219 */ j = 90; break; /* */ case 65817: /* 220 */ j = 100; break; /* */ case 65818: /* 221 */ j = 200; break; /* */ case 65819: /* 222 */ j = 300; break; /* */ case 65820: /* 223 */ j = 400; break; /* */ case 65821: /* 224 */ j = 500; break; /* */ case 65822: /* 225 */ j = 600; break; /* */ case 65823: /* 226 */ j = 700; break; /* */ case 65824: /* 227 */ j = 800; break; /* */ case 65825: /* 228 */ j = 900; break; /* */ case 65826: /* 229 */ j = 1000; break; /* */ case 65827: /* 230 */ j = 2000; break; /* */ case 65828: /* 231 */ j = 3000; break; /* */ case 65829: /* 232 */ j = 4000; break; /* */ case 65830: /* 233 */ j = 5000; break; /* */ case 65831: /* 234 */ j = 6000; break; /* */ case 65832: /* 235 */ j = 7000; break; /* */ case 65833: /* 236 */ j = 8000; break; /* */ case 65834: /* 237 */ j = 9000; break; /* */ case 65835: /* 238 */ j = 10000; break; /* */ case 65836: /* 239 */ j = 20000; break; /* */ case 65837: /* 240 */ j = 30000; break; /* */ case 65838: /* 241 */ j = 40000; break; /* */ case 65839: /* 242 */ j = 50000; break; /* */ case 65840: /* 243 */ j = 60000; break; /* */ case 65841: /* 244 */ j = 70000; break; /* */ case 65842: /* 245 */ j = 80000; break; /* */ case 65843: /* 246 */ j = 90000; break; /* */ case 66339: /* 247 */ j = 50; break; /* */ case 65860: /* 249 */ j = 50; break; /* */ case 65861: /* 250 */ j = 500; break; /* */ case 65862: /* 251 */ j = 5000; break; /* */ case 65863: /* 252 */ j = 50000; break; /* */ case 65866: /* 253 */ j = 50; break; /* */ case 65867: /* 254 */ j = 100; break; /* */ case 65868: /* 255 */ j = 500; break; /* */ case 65869: /* 256 */ j = 1000; break; /* */ case 65870: /* 257 */ j = 5000; break; /* */ case 65873: /* 258 */ j = 50; break; /* */ case 65874: /* 259 */ j = 100; break; /* */ case 65875: /* 260 */ j = 500; break; /* */ case 65876: /* 261 */ j = 1000; break; /* */ case 65877: /* 262 */ j = 10000; break; /* */ case 65878: /* 263 */ j = 50000; break; /* */ case 65894: /* 264 */ j = 50; break; /* */ case 65895: /* 265 */ j = 50; break; /* */ case 65896: /* 266 */ j = 50; break; /* */ case 65897: /* 267 */ j = 50; break; /* */ case 65898: /* 268 */ j = 100; break; /* */ case 65899: /* 269 */ j = 300; break; /* */ case 65900: /* 270 */ j = 500; break; /* */ case 65901: /* 271 */ j = 500; break; /* */ case 65902: /* 272 */ j = 500; break; /* */ case 65903: /* 273 */ j = 500; break; /* */ case 65904: /* 274 */ j = 500; break; /* */ case 65905: /* 275 */ j = 1000; break; /* */ case 65906: /* 276 */ j = 5000; break; /* */ case 65908: /* 277 */ j = 50; break; /* */ case 66369: /* 278 */ j = 90; break; /* */ case 66378: /* 279 */ j = 900; break; /* */ case 66517: /* 280 */ j = 100; break; /* */ case 67677: /* 281 */ j = 100; break; /* */ case 67678: /* 282 */ j = 1000; break; /* */ case 67679: /* 283 */ j = 10000; break; /* */ case 67865: /* 284 */ j = 100; break; /* */ case 68166: /* 285 */ j = 100; break; /* */ case 68167: /* 286 */ j = 1000; break; /* */ case 68222: /* 287 */ j = 50; break; /* */ case 68446: /* 288 */ j = 100; break; /* */ case 68447: /* 289 */ j = 1000; break; /* */ case 68478: /* 290 */ j = 100; break; /* */ case 68479: /* 291 */ j = 1000; break; /* */ case 69228: /* 292 */ j = 40; break; /* */ case 69229: /* 293 */ j = 50; break; /* */ case 69230: /* 294 */ j = 60; break; /* */ case 69231: /* 295 */ j = 70; break; /* */ case 69232: /* 296 */ j = 80; break; /* */ case 69233: /* 297 */ j = 90; break; /* */ case 69234: /* 298 */ j = 100; break; /* */ case 69235: /* 299 */ j = 200; break; /* */ case 69236: /* 300 */ j = 300; break; /* */ case 69237: /* 301 */ j = 400; break; /* */ case 69238: /* 302 */ j = 500; break; /* */ case 69239: /* 303 */ j = 600; break; /* */ case 69240: /* 304 */ j = 700; break; /* */ case 69241: /* 305 */ j = 800; break; /* */ case 69242: /* 306 */ j = 900; break; /* */ case 69726: /* 307 */ j = 40; break; /* */ case 69727: /* 308 */ j = 50; break; /* */ case 69728: /* 309 */ j = 60; break; /* */ case 69729: /* 310 */ j = 70; break; /* */ case 69730: /* 311 */ j = 80; break; /* */ case 69731: /* 312 */ j = 90; break; /* */ case 69732: /* 313 */ j = 100; break; /* */ case 69733: /* 314 */ j = 1000; break; /* */ case 119660: /* 315 */ j = 40; break; /* */ case 119661: /* 316 */ j = 50; break; /* */ case 119662: /* 317 */ j = 60; break; /* */ case 119663: /* 318 */ j = 70; break; /* */ case 119664: /* 319 */ j = 80; break; /* */ case 119665: /* 320 */ j = 90; break; /* */ default: /* 321 */ j = -2; } break; /* */ case 3072: /* 326 */ j = (paramInt + ((i & 0x3E0) >> 5) & 0x1F) + 10; /* */ } /* */ /* 329 */ return j; /* */ } /* */ /* */ boolean isWhitespace(int paramInt) { /* 333 */ int i = getProperties(paramInt); /* 334 */ return (i & 0x7000) == 16384; /* */ } /* */ /* */ byte getDirectionality(int paramInt) { /* 338 */ int i = getProperties(paramInt); /* 339 */ byte b = (byte) ((i & 0x78000000) >> 27); /* 340 */ if (b == 15) { /* 341 */ b = -1; /* */ } /* 343 */ return b; /* */ } /* */ /* */ boolean isMirrored(int paramInt) { /* 347 */ int i = getProperties(paramInt); /* 348 */ return (i & 0x80000000) != 0; /* */ } /* */ static { /* 351 */ instance = new CharacterData01(); /* */ /* 358 */ X = "".toCharArray(); /* */ /* 470 */ Y = "".toCharArray(); /* */ /* 576 */ A = new int[292]; /* */ /* 622 */ B = "".toCharArray(); /* */ /* 644 */ char[] arrayOfChar = "".toCharArray(); /* 645 */ assert (arrayOfChar.length == 584); /* 646 */ int i = 0; int j = 0; /* 647 */ while (i < 584) { /* 648 */ int k = arrayOfChar[(i++)] << '\020'; /* 649 */ A[(j++)] = (k | arrayOfChar[(i++)]); /* */ } /* */ } /* */ } /* Location: C:\Program Files\Java\jdk1.7.0_79\jre\lib\rt.jar * Qualified Name: java.lang.CharacterData01 * JD-Core Version: 0.6.2 */
15ee4d0ac1b4dd7c321127ee91147d9e87f6f056
74b966cf026a0b9e2e1fc57dfb1be0f3a681c4c6
/ContractManage/src/main/java/cn/com/kxcomm/contractmanage/dao/ContractOrderRelationshipDAO.java
238eb6dbee96ec3f5f5a8abcd8856f82b5b211b3
[]
no_license
liveqmock/Projects
6f75cdb7e59015aed3ad851619676c392ea7fdec
0b416e76f38dd7f21062199f0dcf6f893e111eca
refs/heads/master
2021-01-14T12:31:44.197040
2015-04-12T08:38:19
2015-04-12T08:38:19
33,808,969
0
0
null
2015-04-12T08:21:07
2015-04-12T08:21:07
null
UTF-8
Java
false
false
282
java
package cn.com.kxcomm.contractmanage.dao; import org.springframework.stereotype.Repository; import cn.com.kxcomm.contractmanage.entity.TbContractOrderRelationship; @Repository public class ContractOrderRelationshipDAO extends CommonDAO<TbContractOrderRelationship>{ }
52c64139e31c73f712ac21e7a5bd2a080351df67
20117161564cee68ff5a669965757c495cda97d9
/javacopy/OOPExamples/Child.java
4782e04b50be6f5859589766b1f9460dc39d17b4
[]
no_license
movshevam/LOA2017
33b8680b606649fc4574155bfe89eb6a492f78f7
07e706e6d99bea55dc8becc5db30e95d4067bc65
refs/heads/master
2020-07-23T00:26:27.714081
2017-07-08T08:55:03
2017-07-08T08:55:03
94,347,115
0
0
null
null
null
null
UTF-8
Java
false
false
881
java
//Child class. Contains a new function: multiplication. class Child extends Parent{ public void multiplication(int x, int y){ z = x*y; //no need to declare zs again! System.out.println("The product of the given numbers: "+z); } //---- int num = 10; public void display(){ System.out.println("This is child display"); } public void testingSuper(){ Child kid = new Child(0); kid.display(); //invoke display method of Child class display(); //same thing? super.display(); //invoke display of parent class System.out.println("Value of variable \"num\" in Child class: "+kid.num); System.out.println("Value of variable \"num\" in Child class: "+num); System.out.println("Value of variable \"num\" in Parent class: "+super.num); } //-------- Child(int age){ super(age); } }
4f653a5abf57441297f4464d171d4ebaa2f30e19
4fde9df228d887ffda44bb1ccc604882ebce7549
/pentaho-report-generator/src/main/java/com/amazonaws/lambda/pentahoreporting/ReportGenerator.java
f87886c053ef5e41929a133936b2a067ab795345
[ "Apache-2.0" ]
permissive
innoventsolutions/pentaho-lambda-report-gen
3f6c0e30809a35326c11ae4b89a38561932e331a
e7b21471e7191446946a8aac000ee851300fc545
refs/heads/master
2018-10-25T22:54:59.507792
2018-08-21T20:56:57
2018-08-21T20:56:57
105,681,247
4
2
null
null
null
null
UTF-8
Java
false
false
3,353
java
/** * */ package com.amazonaws.lambda.pentahoreporting; import java.net.URL; import java.util.HashMap; import java.util.Map; import org.pentaho.reporting.engine.classic.core.DataFactory; import org.pentaho.reporting.engine.classic.core.MasterReport; import org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.DriverConnectionProvider; import org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.sql.SQLReportDataFactory; import org.pentaho.reporting.libraries.resourceloader.Resource; import org.pentaho.reporting.libraries.resourceloader.ResourceException; import org.pentaho.reporting.libraries.resourceloader.ResourceManager; /** * @author Jaret * */ public class ReportGenerator extends AbstractReportGenerator { private final URL mReport; private final Map<String, Object> mParameters; private final Map<String, String> mDBQueries = new HashMap<String, String>(); private final String mDBDriver; private final String mDBUrl; private final String mDBUser; private final String mDBPassword; public ReportGenerator(URL report, Map<String, Object> parameters, String dbDriver, String dbUrl, String dbUser, String dbPassword) { mReport = report; mParameters = parameters; mDBDriver = dbDriver; mDBUrl = dbUrl; mDBUser = dbUser; mDBPassword = dbPassword; } public void addQuery(String aName, String aQuery) { mDBQueries.put(aName, aQuery); } /* (non-Javadoc) * @see com.amazonaws.lambda.pentahosyncreporting.AbstractReportGenerator#getReportDefinition() */ @Override public MasterReport getReportDefinition() throws ResourceException { System.out.println("Entering getReportDefinition."); // Parse the report file final ResourceManager resourceManager = new ResourceManager(); Resource directly; // try { System.out.println("Calling createDirectly with " + mReport + "."); directly = resourceManager.createDirectly(mReport, MasterReport.class); return (MasterReport) directly.getResource(); // } catch (ResourceException e) { // System.out.println("Encountered error locating the report definition."); // System.out.println("Error Message: " + e.getMessage()); // } // return null; } /* (non-Javadoc) * @see com.amazonaws.lambda.pentahosyncreporting.AbstractReportGenerator#getDataFactory() */ @Override public DataFactory getDataFactory() { if (mDBUrl != null) { System.out.println("Configuring data factory."); final DriverConnectionProvider sampleDriverConnectionProvider = new DriverConnectionProvider(); sampleDriverConnectionProvider.setDriver(mDBDriver); sampleDriverConnectionProvider.setUrl(mDBUrl); sampleDriverConnectionProvider.setProperty("user", mDBUser); sampleDriverConnectionProvider.setProperty("password", mDBPassword); final SQLReportDataFactory dataFactory = new SQLReportDataFactory(sampleDriverConnectionProvider); for (String dbName : mDBQueries.keySet()) { dataFactory.setQuery(dbName, mDBQueries.get(dbName)); } return dataFactory; } else { System.out.println("No db information defined."); return null; } } /* (non-Javadoc) * @see com.amazonaws.lambda.pentahosyncreporting.AbstractReportGenerator#getReportParameters() */ @Override public Map<String, Object> getReportParameters() { return mParameters; } }
fbb193af40f3a63db7787aac03b30640781ed9cd
66ab16d5fa69fff4598998eeb0c76677f8087bdb
/src/main/java/br/com/gigio/fxportal/domain/Operation.java
c82ca435789653d5be3640cbcd23f7818e94698a
[]
no_license
Ribeiro/fxportal
96399c3efb68ecd382ebdc216ae2ca166391973f
775140190a5553e724603824ffc2c22dd85bc8ad
refs/heads/master
2016-09-06T09:38:47.816469
2013-08-17T19:11:40
2013-08-17T19:11:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
67
java
package br.com.gigio.fxportal.domain; public class Operation { }
437bb13f620d339f40a9350bd5fbc2b0368ba35d
e4b095396f798ebbcc8149d2a37ef05753fec50e
/CPU sheduler/src/cpu/sheduler/NewJFrame5.java
cfcbbeefa7465b534471374d334f1ac8b13dbb93
[]
no_license
HadeerSamir/CPU-Scheduler
d1ef9ebf5f5bcde69ee4c035ff9e94e460d089a8
755738963f82b258145d946038b05d6a800547ff
refs/heads/master
2021-05-05T04:54:41.559731
2018-01-23T17:39:15
2018-01-23T17:39:15
118,644,663
0
0
null
null
null
null
UTF-8
Java
false
false
20,740
java
package cpu.sheduler; import java.util.LinkedList; import javax.swing.table.DefaultTableModel; public class NewJFrame5 extends javax.swing.JFrame { LinkedList<Process> list = new LinkedList<Process>(); LinkedList<Process> list1 = new LinkedList<Process>(); Process p = new Process(); Process p1 = new Process(); DefaultTableModel model; float processno; float quantamTime; float waiting[] = new float[list.size()]; public NewJFrame5() { initComponents(); model = (DefaultTableModel) jTableRR.getModel(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jTextRRNoOfProcess = new javax.swing.JTextField(); jTextRRProcessId = new javax.swing.JTextField(); jTextRRBurst = new javax.swing.JTextField(); jTextRRArrival = new javax.swing.JTextField(); jButtonRRNewProcess = new javax.swing.JButton(); jButtonRRSave = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); jTableRR = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jLabel7 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jTextQuantam = new javax.swing.JTextField(); jButton4 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); jScrollPane1.setViewportView(jTable1); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setFont(new java.awt.Font("Tahoma", 3, 24)); // NOI18N jLabel1.setText("Round Robin Scheduling \" Preemptive \""); jLabel2.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N jLabel2.setText("Enter Number Of Process"); jLabel3.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N jLabel3.setText("Process_ID"); jLabel4.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N jLabel4.setText("Burst_Time"); jLabel5.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N jLabel5.setText("Arrival_Time"); jTextRRProcessId.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextRRProcessIdActionPerformed(evt); } }); jTextRRBurst.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextRRBurstActionPerformed(evt); } }); jButtonRRNewProcess.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N jButtonRRNewProcess.setText("Save Process"); jButtonRRNewProcess.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonRRNewProcessActionPerformed(evt); } }); jButtonRRSave.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N jButtonRRSave.setText("Result"); jButtonRRSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonRRSaveActionPerformed(evt); } }); jTableRR.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Process|_ID", "Burst_Time", "Arrival_Time", "Waiting_Time" } ) { boolean[] canEdit = new boolean [] { false, false, false, false }; public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); jScrollPane2.setViewportView(jTableRR); jButton1.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N jButton1.setText("Back"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N jButton2.setText("Help"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jButton3.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N jButton3.setText("Close"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jLabel7.setFont(new java.awt.Font("Tahoma", 2, 18)); // NOI18N jLabel7.setText("Results:-"); jLabel6.setText("Enter Quantam_Time"); jButton4.setFont(new java.awt.Font("Tahoma", 2, 18)); // NOI18N jButton4.setText("Average Waiting Time"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3) .addGap(31, 31, 31)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(14, 14, 14) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel6) .addComponent(jLabel3)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel4) .addComponent(jLabel5)) .addGap(79, 79, 79))) .addGap(33, 33, 33) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextRRArrival, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE) .addComponent(jTextRRProcessId, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE) .addComponent(jTextRRNoOfProcess, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE) .addComponent(jTextRRBurst, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE) .addComponent(jTextQuantam))) .addGroup(layout.createSequentialGroup() .addGap(54, 54, 54) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel7) .addComponent(jButtonRRSave)) .addGap(55, 55, 55) .addComponent(jButtonRRNewProcess)) .addGroup(layout.createSequentialGroup() .addGap(39, 39, 39) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jButton4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addGap(28, 28, 28) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 490, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton3) .addComponent(jButton2) .addComponent(jButton1)) .addGap(19, 19, 19) .addComponent(jLabel1) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel2) .addComponent(jTextRRNoOfProcess, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(26, 26, 26) .addComponent(jLabel6) .addGap(18, 18, 18) .addComponent(jLabel3)) .addGroup(layout.createSequentialGroup() .addComponent(jTextQuantam, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jTextRRProcessId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jTextRRBurst, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(jTextRRArrival, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButtonRRSave) .addComponent(jButtonRRNewProcess)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel7) .addGap(18, 18, 18) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(34, 34, 34) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton4) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(34, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jTextRRBurstActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextRRBurstActionPerformed }//GEN-LAST:event_jTextRRBurstActionPerformed private void jButtonRRNewProcessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRRNewProcessActionPerformed jButtonRRNewProcess.setVisible(true); jButtonRRSave.setVisible(true); processno = Float.parseFloat(jTextRRNoOfProcess.getText()); int id = Integer.parseInt(jTextRRProcessId.getText()); float burst = Float.parseFloat(jTextRRBurst.getText()); float arrival = Float.parseFloat(jTextRRArrival.getText()); quantamTime = Float.parseFloat(jTextQuantam.getText()); p = new Process(id, burst, arrival); list.add(p); jTextRRProcessId.setText(""); jTextRRBurst.setText(""); jTextRRArrival.setText(""); }//GEN-LAST:event_jButtonRRNewProcessActionPerformed private void jTextRRProcessIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextRRProcessIdActionPerformed }//GEN-LAST:event_jTextRRProcessIdActionPerformed private void jButtonRRSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRRSaveActionPerformed int i; float time; //server time of process int remain; int completed = 0; float waitingTime[] = new float[list.size()]; float burst[] = new float[list.size()]; //time reminder of process time remain = list.size(); for (i = 0; i < list.size(); i++) { burst[i] = list.get(i).burstTime; } for (time = 0, i = 0; remain != 0;) { if (burst[i] <= quantamTime && burst[i] > 0) { time += burst[i]; burst[i] = 0; completed = 1; } else if (burst[i] > 0) { burst[i] -= quantamTime; time += quantamTime; } if (burst[i] == 0 && completed == 1) { remain--; waitingTime[i] += time - list.get(i).arrivalTime - list.get(i).burstTime; // p1 = new Process(list.get(i).processId, burst[i], list.get(i).arrivalTime, waitingTime[i]); p1 = new Process(list.get(i).processId, list.get(i).burstTime, list.get(i).arrivalTime, waitingTime[i]); list1.add(p1); completed = 0; } if (i == list.size() - 1) { i = 0; } else if (list.get(i + 1).arrivalTime <= time) { i++; } else { i = 0; } } Object rowData[] = new Object[4]; for (int j = 0; j < list1.size(); j++) { rowData[0] = list1.get(j).processId; rowData[1] = list1.get(j).burstTime; rowData[2] = list1.get(j).arrivalTime; rowData[3] = list1.get(j).waitingTime; model.addRow(rowData); } jButtonRRSave.setVisible(false); jTextRRNoOfProcess.setText(""); jButtonRRNewProcess.setVisible(false); }//GEN-LAST:event_jButtonRRSaveActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed new NewJFrame1().setVisible(true); this.setVisible(false); }//GEN-LAST:event_jButton1ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed System.exit(0); }//GEN-LAST:event_jButton3ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed float totalWaitingTime = 0; float averageWaitingTime; for (int i = 0; i < list1.size(); i++) { totalWaitingTime += list1.get(i).waitingTime; } averageWaitingTime = totalWaitingTime / list1.size(); jTextField1.setText(Float.toString(averageWaitingTime)); }//GEN-LAST:event_jButton4ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed new NewJFrame13().setVisible(true); this.setVisible(false); }//GEN-LAST:event_jButton2ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(NewJFrame5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(NewJFrame5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(NewJFrame5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(NewJFrame5.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new NewJFrame5().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButtonRRNewProcess; private javax.swing.JButton jButtonRRSave; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable jTable1; private javax.swing.JTable jTableRR; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextQuantam; private javax.swing.JTextField jTextRRArrival; private javax.swing.JTextField jTextRRBurst; private javax.swing.JTextField jTextRRNoOfProcess; private javax.swing.JTextField jTextRRProcessId; // End of variables declaration//GEN-END:variables }
4e51721fb8364704850df81c65ddcee1f27b675d
c83cbc5851c9072211e9a565977e5ad51f669fd4
/src/test/java/Registration.java
5f451373f9d5f054eb1d9a57f6ea5486e8d9e04d
[]
no_license
svpolishchuk/javaexample_last
34e35cd4a388e78066eb9a78fa48fae560cddfa6
ca6d96b6e1e06c83066954d7915c25cfb86176b2
refs/heads/master
2020-12-28T21:18:05.265256
2017-02-19T14:02:40
2017-02-19T14:02:40
80,736,071
0
0
null
null
null
null
UTF-8
Java
false
false
5,650
java
import object.RegistrationUser; import org.junit.Test; import org.openqa.selenium.Alert; import org.openqa.selenium.WebElement; import static maps.RegistrationPage.*; import static object.TestBase.getElement; import static object.TestBase.getText; import static object.TestBase.isElementPresent; import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent; import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs; import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOf; import static org.testng.AssertJUnit.assertFalse; import static org.testng.AssertJUnit.assertTrue; /** * Created by polis on 31.01.2017. */ public class Registration extends TestBase { private String login = "tyusqwerty"; private String email = "[email protected]"; private String password = "1234567"; private String passwordConfirmation = "1234567"; @Test public void CreateNewUser() { start(); driver.get("https://exmo.com/ru/"); wait.until(titleIs("Eхmо.com | Биржа криптовалют. Купить и продать BTC, ETH, DOGE, LTC")); wait.until(visibilityOf(getElement(driver,START.by()))); RegistrationUser user = new RegistrationUser(driver, wait); user.clickStartButton(); assertTrue(isElementPresent(driver, REGISTRATION_BUTTON.by())); user.elementDisabled(REGISTRATION_BUTTON.by()); user.inputFieldEmpty(LOGIN.by()); user.inputFieldEmpty(EMAIL.by()); user.inputFieldEmpty(PASSWORD.by()); user.inputFieldEmpty(PASSWORD_CONFIRMATION.by()); // verification form with empty fields or any field user.clickRegistrationButton(); assertTrue(isElementPresent(driver, LOGIN_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, EMAIL_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, PASSWORD_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, PASSWORD_CONFIRMATION_ERROR_MESSAGE.by())); user.typeLogin(login); user.clickRegistrationButton(); assertFalse(isElementPresent(driver, LOGIN_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, EMAIL_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, PASSWORD_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, PASSWORD_CONFIRMATION_ERROR_MESSAGE.by())); user.typeEmail(email); user.clickRegistrationButton(); assertFalse(isElementPresent(driver, LOGIN_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, EMAIL_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, PASSWORD_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, PASSWORD_CONFIRMATION_ERROR_MESSAGE.by())); user.typePassword(password); user.clickRegistrationButton(); assertFalse(isElementPresent(driver, LOGIN_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, EMAIL_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, PASSWORD_ERROR_MESSAGE.by())); assertTrue(isElementPresent(driver, PASSWORD_CONFIRMATION_ERROR_MESSAGE.by())); user.typePasswordConfirmation(passwordConfirmation); user.clickRegistrationButton(); assertFalse(isElementPresent(driver, LOGIN_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, EMAIL_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, PASSWORD_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, PASSWORD_CONFIRMATION_ERROR_MESSAGE.by())); user.clearField(driver, LOGIN.by()); user.clickRegistrationButton(); assertTrue(isElementPresent(driver, LOGIN_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, EMAIL_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, PASSWORD_ERROR_MESSAGE.by())); assertFalse(isElementPresent(driver, PASSWORD_CONFIRMATION_ERROR_MESSAGE.by())); // verification form with all filled fields user.clearField(driver, LOGIN.by()); user.clearField(driver, EMAIL.by()); user.clearField(driver, PASSWORD.by()); user.clearField(driver, PASSWORD_CONFIRMATION.by()); user.typeLogin(login); user.typeEmail(email); user.typePassword(password); user.typePasswordConfirmation(passwordConfirmation); user.click(driver,CHECKBOX_AGREE.by()); user.clickRegistrationButton(); wait.until(titleIs("Защищенный кошелек")); //validation pass registration user.click(driver, LOGOUT.by()); Alert alert = wait.until(alertIsPresent()); alert.dismiss(); wait.until(titleIs("Защищенный кошелек")); user.click(driver, LOGOUT.by()); Alert alert1 = wait.until(alertIsPresent()); alert1.accept(); wait.until(titleIs("Eхmо.com | Биржа криптовалют. Купить и продать BTC, ETH, DOGE, LTC")); user.click(driver, LOGIN.by()); user.typeText(driver, LOGIN_EMAIL.by(), email); user.typeText(driver, LOGIN_PASSWORD.by(), password); user.click(driver, LOGIN.by()); wait.until(titleIs("Защищенный кошелек")); stop(); } }
ff1775ae821deb0084a36426f9deca32e10220e5
141014d3ec1f31a0dd8ede19aa082be38a771b77
/app/src/main/java/com/example/javapro/general/forgetpassword.java
b9230fe034229760d3a0a8f9dcd8814308acd48e
[]
no_license
MuniraMS/JavaProV2
428c1cd2d1372225df83517e9e3b2217ccffe0b3
5455bd4d1211be164248d77976d8f25926cae3a6
refs/heads/master
2023-01-24T07:51:34.817119
2020-11-23T12:19:08
2020-11-23T12:19:08
295,539,538
0
0
null
null
null
null
UTF-8
Java
false
false
2,019
java
package com.example.javapro.general; import androidx.appcompat.app.AppCompatActivity; import com.example.javapro.R; import android.graphics.Color; import android.os.Bundle; import android.text.SpannableString; import android.text.Spanned; import android.text.style.ForegroundColorSpan; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; public class forgetpassword extends AppCompatActivity { EditText editEmail; Button send_pass; FirebaseAuth mFirebaseAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_forgetpassword); mFirebaseAuth = FirebaseAuth.getInstance(); editEmail = (EditText) findViewById(R.id.editEmail_2); send_pass = (Button) findViewById(R.id.send_pass); } public void Send_Pass(View view) { String email = editEmail.getText().toString(); mFirebaseAuth.sendPasswordResetEmail(email) .addOnCompleteListener(this, new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if(task.isSuccessful()){ Toast.makeText(getApplicationContext(),"A reset link has been sent to your email.",Toast.LENGTH_LONG).show(); finish(); }else { Toast.makeText(getApplicationContext(),"Please enter a valid email",Toast.LENGTH_LONG).show(); editEmail.setText(""); } } }); } }
6bcb08d5c499bd8a100020874605b39f3ab3a968
dd3512eebf95368c377960a609fcb09ef17ca6d9
/CN1AppleSignInDemo/native/internal_tmp/com/codename1/auth/apple/WebViewBrowserWindow.java
4053a5e87495ce86e69bfd6251fec525b67f0d56
[]
no_license
shannah/cn1-applesignin
e8bfed3109e1c960286d97d48b5489a66ee15653
52af35d27dcd26136dc645880badab240742bf85
refs/heads/master
2021-07-03T17:29:29.605751
2021-04-29T19:46:01
2021-04-29T19:46:01
233,143,319
0
1
null
2021-04-29T19:29:20
2020-01-10T22:50:33
HTML
UTF-8
Java
false
false
2,185
java
package com.codename1.auth.apple; import ca.weblite.webview.WebViewCLIClient; import ca.weblite.webview.WebViewClient; import com.codename1.impl.javase.*; import com.codename1.io.Log; import com.codename1.ui.BrowserWindow; import com.codename1.ui.events.ActionEvent; /** * A wrapper for the native webview window. This will use the native browser window * of the platform (WebKit on MacOS and Linux, and either EDGE Chromium, or EDGE on Windows). * Uses https://github.com/shannah/webviewjar * @author shannah */ public class WebViewBrowserWindow extends AbstractBrowserWindowSE { WebViewCLIClient webview; WebViewCLIClient.Builder builder; private boolean closed; public WebViewBrowserWindow(String startURL) { System.out.println("Creating new browser window for "+startURL); builder = (WebViewCLIClient.Builder)new WebViewCLIClient.Builder().url(startURL); } public void show() { if (webview == null) { webview = builder.build(); webview.addLoadListener(new WebViewClient.WebEventListener<WebViewClient.OnLoadWebEvent>() { @Override public void handleEvent(WebViewClient.OnLoadWebEvent evt) { fireLoadEvent(new ActionEvent(evt.getURL())); } }); } } public void setSize(final int width, final int height) { builder.size(width, height); } public void setTitle(final String title) { builder.title(title); } public void hide() { if (!closed) { closed = true; if (webview != null) { try { webview.close(); } catch (Exception ex) { Log.e(ex); } } } } public void cleanup() { hide(); } public void eval(BrowserWindow.EvalRequest req) { if (webview != null) { webview.eval(req.getJS()).thenAccept(str->{ if (!req.isDone()) { req.complete(str); } }); } } }
12ca4280e7fa7bc971ebeaf5d10658a092cac40c
31f843a7f4690d3ba01d601cb21013561b649678
/Lab6/exercitii_curs6_javaio/src/Ex1.java
144d5f3a7d343ce464e90a777dc9e79497cd134c
[]
no_license
andreixxi/PAO
38cf84e8a2163453e077e2d7c3f5edfdfcdec1bf
dbabd6d2c573d96cbf8f8c796df20426e9683343
refs/heads/master
2021-03-02T05:15:57.346188
2020-06-07T13:57:59
2020-06-07T13:57:59
245,840,563
0
0
null
null
null
null
UTF-8
Java
false
false
819
java
import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class Ex1 { public static void main(String[] args) { new Ex1().findString(); } public String findString() { String answer = ""; String current; try { Scanner in = new Scanner(new File("test.txt.")); while (in.hasNext()) { current = in.next(); current = current.replaceAll(",$", ""); if(current.length() > answer.length()) { answer = current; } } System.out.println("cel mai lung cuvant " + answer); } catch (FileNotFoundException e) { e.printStackTrace(); } return answer; } }
830b12b39a996528ee1ab2c32a2bdf490f1d6335
8870fa16fe6f0fe3e791c1463c5ee83c46f86839
/mmoarpg/mmoarpg-game/src/main/java/com/wanniu/game/recent/RecentChatCenter.java
15f0efcde2f9a440ce66129e75e8b443cf038315
[]
no_license
daxingyou/yxj
94535532ea4722493ac0342c18d575e764da9fbb
91fb9a5f8da9e5e772e04b3102fe68fe0db5e280
refs/heads/master
2022-01-08T10:22:48.477835
2018-04-11T03:18:37
2018-04-11T03:18:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,040
java
package com.wanniu.game.recent; import java.util.HashMap; import java.util.Map; import com.wanniu.game.common.ConstsTR; import com.wanniu.game.poes.RecentChatPO; import com.wanniu.redis.PlayerPOManager; /** * 最近联系人管理中心 * * @author jjr * */ public class RecentChatCenter { private static RecentChatCenter instance; private Map<String, RecentChatMgr> recentChatMgrs; // 所有好友数据 private RecentChatCenter() { recentChatMgrs = new HashMap<String, RecentChatMgr>(); } public static RecentChatCenter getInstance() { if (null == instance) { instance = new RecentChatCenter(); } return instance; } public RecentChatMgr getRecentChatMgr(String playerId) { if (recentChatMgrs.containsKey(playerId)) { return recentChatMgrs.get(playerId); } RecentChatPO po = PlayerPOManager.findPO(ConstsTR.playerRecentChatTR, playerId, RecentChatPO.class); RecentChatMgr recentChatMgr = new RecentChatMgr(playerId, po); recentChatMgrs.put(playerId, recentChatMgr); return recentChatMgr; } }
df295ea6a145bc440059917ca986cbf1eac929eb
bd347d60da2055b3e5984173d29cc24d3c2f1106
/server/src/main/java/com/project/doc_trade/controller/ArticleController.java
f97383cd80b83aa92f544acbd6b11c5cd93cd074
[]
no_license
wzl521/Blockchain-document-transaction-system
da77cc52e0e94c4af01cee5e9f830974fd690902
5833992f5dacf60c475bbd30600db30b7888a1b6
refs/heads/master
2023-03-19T17:08:44.640630
2021-03-09T05:50:38
2021-03-09T05:50:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
9,809
java
package com.project.doc_trade.controller; import com.project.doc_trade.entity.*; import com.project.doc_trade.exception.MyException; import com.project.doc_trade.service.ArticleService; import com.project.doc_trade.util.ListRtn; import com.project.doc_trade.util.RtnMsg; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.util.ArrayList; import java.util.List; @RestController @RequestMapping("/article") public class ArticleController { @Autowired ArticleService articleService; /** * 文档搜索 URL:/article/getArticleByScreen * * @param articleScreen 文档搜索内容 * @return 返回文档搜索结果列表ListRtn<ArticleInfo> */ @RequestMapping(value = "/getArticleByScreen", method = RequestMethod.POST) public ListRtn<ArticleInfo> getArticleByScreen(@RequestBody ArticleScreen articleScreen) { try { return articleService.getArticleByScreen(articleScreen); } catch (MyException e) { return new ListRtn<>(0, new ArrayList<>()); } } /** * 获取推荐文档 URL:/article/getRecommendArticle * * @param id 待推荐的用户id * @return 返回文档推荐结果列表List<ArticleInfo> */ @RequestMapping(value = "/getRecommendArticle", method = RequestMethod.GET) public List<ArticleInfo> getRecommendArticle(@RequestParam(value = "id") Serializable id) { try { return articleService.getRecommendArticle(id); } catch (MyException e) { System.out.println(e.getMessage()); return new ArrayList<>(); } } /** * 获取最热门的10篇文档 URL:/article/getPopularArticle * * @return 返回文档结果列表List<ArticleInfo> */ @RequestMapping(value = "/getPopularArticle", method = RequestMethod.GET) public List<ArticleInfo> getPopularArticle() { try { return articleService.getPopularArticle(); } catch (MyException e) { return new ArrayList<>(); } } /** * 获取文档详情 URL:/article/getArticleDetail * * @param article_id 文档id * @param user_id 用户id * @return 返回文档详情ArticleDetail对象 */ @RequestMapping(value = "/getArticleDetail", method = RequestMethod.GET) public ArticleDetail getArticleDetail(@RequestParam(value = "article_id") int article_id, @RequestParam(value = "user_id") int user_id) { try { return articleService.getArticleDetail(new User2Article(article_id, user_id)); } catch (MyException e) { System.out.println(e.getMessage()); return new ArticleDetail(); } } /** * 购买文档 URL:/article/purchaseArticle * * @param article_id 文档id * @param user_id 用户id * @return 返回购买结果消息对象RtnMsg */ @RequestMapping(value = "/purchaseArticle", method = RequestMethod.GET) public RtnMsg purchaseArticle(@RequestParam(value = "article_id") int article_id, @RequestParam(value = "user_id") int user_id) { try { articleService.purchaseArticle(new PurchasedArticle(article_id, user_id)); return new RtnMsg(1, "文档购买成功!"); } catch (MyException e) { return new RtnMsg(0, e.getMessage()); } } /** * 添加购物车 URL:/article/addCart * * @param article_id 文档id * @param user_id 用户id * @return 返回添加购物车结果消息对象RtnMsg */ @RequestMapping(value = "/addCart", method = RequestMethod.GET) public RtnMsg addCart(@RequestParam(value = "article_id") int article_id, @RequestParam(value = "user_id") int user_id) { try { articleService.addCart(new User2Article(article_id, user_id)); return new RtnMsg(1, "添加购物车成功!"); } catch (MyException e) { return new RtnMsg(0, e.getMessage()); } } /** * 删除购物车 URL:/article/deleteCart * * @param article_id 文档id * @param user_id 用户id * @return 返回删除购物车结果消息对象RtnMsg */ @RequestMapping(value = "/deleteCart", method = RequestMethod.GET) public RtnMsg deleteCart(@RequestParam(value = "article_id") int article_id, @RequestParam(value = "user_id") int user_id) { try { articleService.deleteCart(new User2Article(article_id, user_id)); return new RtnMsg(1, "删除购物车成功!"); } catch (MyException e) { return new RtnMsg(0, e.getMessage()); } } /** * 查看购物车 URL:/article/getCart * * @param id 用户id * @return 购物车内文档信息 */ @RequestMapping(value = "/getCart", method = RequestMethod.GET) public List<ArticleInfo> getCart(@RequestParam(value = "id") Serializable id) { try { return articleService.getCart(id); } catch (MyException e) { System.out.println(e.getMessage()); return new ArrayList<>(); } } /** * 处理购物车 URL:/article/dealCart * * @param cart 购物车对象 * @return 返回处理结果消息对象RtnMsg */ @RequestMapping(value = "/dealCart", method = RequestMethod.POST) public RtnMsg dealCart(@RequestBody Cart cart) { try { articleService.dealCart(cart); return new RtnMsg(1, "处理购物车成功!"); } catch (MyException e) { return new RtnMsg(0, e.getMessage()); } } /** * 下载文档 URL:/article/downloadArticle * * @param response 响应对象 * @param id 待下载的文档id * @return 返回下载结果消息对象RtnMsg */ @RequestMapping(value = "/downloadArticle", method = RequestMethod.GET) public String downloadArticle(HttpServletResponse response, @RequestParam(value = "id") Serializable id) { try { return articleService.downloadArticle(response, id); } catch (MyException e) { return "download fail"; } } /** * 上传文档 URL:/article/uploadArticle * * @param articleTitle 标题 * @param authorId id * @param articleAuthor 作者 * @param articlePrice 价格 * @param articleType 类型 * @param articleAbstract 摘要 * @param file 文件 * @return 自定义返回对象 */ @RequestMapping(value = "/uploadArticle", method = RequestMethod.POST,produces="application/json;charset=UTF-8") public RtnMsg uploadArticle( @RequestParam("articleTitle") String articleTitle, @RequestParam("authorId") int authorId, @RequestParam("articleAuthor") String articleAuthor, @RequestParam("articlePrice") double articlePrice, @RequestParam("articleType") String articleType, @RequestParam("articleAbstract") String articleAbstract, @RequestParam("file") MultipartFile file ) { try { ArticleUpload articleUpload = new ArticleUpload(articleTitle, authorId, articleAuthor, articlePrice, articleType, articleAbstract, file ); articleService.uploadArticle(articleUpload); return new RtnMsg(1, "文档上传成功"); } catch (MyException e) { System.out.println(e.getMessage()); return new RtnMsg(0, e.getMessage()); } } /** * 收藏文档 URL:/article/storeArticle * * @param article_id 文档id * @param user_id 用户id * @return 返回收藏结果消息对象RtnMsg */ @RequestMapping(value = "/storeArticle", method = RequestMethod.GET) public RtnMsg storeArticle(@RequestParam(value = "article_id") int article_id, @RequestParam(value = "user_id") int user_id) { try { articleService.storeArticle(new StoreArticle(article_id, user_id)); return new RtnMsg(1, "文档收藏成功!"); } catch (MyException e) { return new RtnMsg(0, e.getMessage()); } } /** * 取消收藏 URL:/article/storeCancel * * @param article_id 文档id * @param user_id 用户id * @return 返回取消收藏结果消息对象RtnMsg */ @RequestMapping(value = "/storeCancel", method = RequestMethod.GET) public RtnMsg storeCancel(@RequestParam(value = "article_id") int article_id, @RequestParam(value = "user_id") int user_id) { try { articleService.storeCancel(new StoreArticle(article_id, user_id)); return new RtnMsg(1, "取消收藏成功!"); } catch (MyException e) { return new RtnMsg(0, e.getMessage()); } } /** * 文档评分 URL:/article/rateArticle * * @param articleRate 文档评分对象 * @return 返回评分结果消息对象RtnMsg */ @RequestMapping(value = "/articleRate", method = RequestMethod.POST) public RtnMsg rateArticle(@RequestBody ArticleRate articleRate) { try { articleService.rateArticle(articleRate); return new RtnMsg(1, "评分成功"); } catch (MyException e) { return new RtnMsg(0, e.getMessage()); } } }
2ec2871c9374b372eb8c241aa3766c9305b50c00
8be3aa9490194dd71f318ff61dee0ff7a0ceeb0c
/AutoFramework/src/test/java/com/cucumber/steps/AutoCucumberSteps.java
8aecd1cd53c1a84179e8d6610c4f75a403a2c624
[]
no_license
vchavda/sandbox
4f5e91f8e7214313a5a728101193c4136e35b64a
5e5d69f41d065a2171a56b7975bd31e71e89e0a0
refs/heads/master
2020-05-24T17:35:37.493010
2019-05-18T18:16:16
2019-05-18T18:16:16
187,389,025
0
0
null
null
null
null
UTF-8
Java
false
false
231
java
package com.cucumber.steps; import cucumber.api.java.en.When; public class AutoCucumberSteps { @When("^user makes an API call then they get a valid status code back$") public void verifyValid_APICall() { assert(true); } }
[ "=" ]
=
f26e761be8d987259bcbb49630f7e9b9ca1769ce
3634f5e03035d1f3f583c776b5555ceb24b8c331
/sparkmall-commons/src/main/java/com/tingyu/sparkmall/commons/utils/Query.java
336b0c6d444d27c9883033f9e0b59d951efd7f5f
[]
no_license
Essionshy/sparkmall
591a0a5f48010e880ebf7bcb58b01d920317f4bb
5208897ebe6c8223fd5c337c61e5acaa3503839f
refs/heads/master
2023-04-23T22:22:59.854714
2020-12-15T05:42:02
2020-12-15T05:42:02
263,085,093
0
0
null
2020-07-01T19:16:28
2020-05-11T15:38:40
JavaScript
UTF-8
Java
false
false
2,259
java
/** * Copyright (c) 2016-2019 人人开源 All rights reserved. * <p> * https://www.renren.io * <p> * 版权所有,侵权必究! */ package com.tingyu.sparkmall.commons.utils; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.tingyu.sparkmall.commons.filter.SQLFilter; import org.apache.commons.lang.StringUtils; import java.util.Map; /** * 查询参数 * * @author Mark [email protected] */ public class Query<T> { public IPage<T> getPage(Map<String, Object> params) { return this.getPage(params, null, false); } public IPage<T> getPage(Map<String, Object> params, String defaultOrderField, boolean isAsc) { //分页参数 long curPage = 1; long limit = 10; if (params.get(Constant.PAGE) != null) { curPage = Long.parseLong((String) params.get(Constant.PAGE)); } if (params.get(Constant.LIMIT) != null) { limit = Long.parseLong((String) params.get(Constant.LIMIT)); } //分页对象 Page<T> page = new Page<>(curPage, limit); //分页参数 params.put(Constant.PAGE, page); //排序字段 //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) String orderField = SQLFilter.sqlInject((String) params.get(Constant.ORDER_FIELD)); String order = (String) params.get(Constant.ORDER); //前端字段排序 if (StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)) { if (Constant.ASC.equalsIgnoreCase(order)) { return page.addOrder(OrderItem.asc(orderField)); } else { return page.addOrder(OrderItem.desc(orderField)); } } //没有排序字段,则不排序 if (StringUtils.isBlank(defaultOrderField)) { return page; } //默认排序 if (isAsc) { page.addOrder(OrderItem.asc(defaultOrderField)); } else { page.addOrder(OrderItem.desc(defaultOrderField)); } return page; } }
e876bd9fd5c413528c04efef56061a9fc6c1c10f
d3477b37d551c46af2e3e0177f8734b3cda4b673
/client/src/com/blu3flux/Main.java
3710e25587fd96f72375e6530f9bd67abc5b6033
[ "Apache-2.0" ]
permissive
abelacosta/SnakeOnline
393151f2a026d11fcd55755f5826cb0fd0e4ba2b
77a5d837502d7478253f7ab78e22fac28da2d567
refs/heads/master
2022-11-06T09:25:57.040951
2020-06-14T05:23:50
2020-06-14T05:23:50
155,019,899
0
1
null
null
null
null
UTF-8
Java
false
false
2,069
java
package com.blu3flux; import java.awt.Dimension; import javax.swing.ImageIcon; import javax.swing.JFrame; import com.blu3flux.GUI.SnakePanel; import com.blu3flux.game.LocalPlayer; import com.blu3flux.game.OnlineMode; import com.blu3flux.game.SinglePlayer; public class Main { // Window Properties static JFrame frame; static SnakePanel panel; static ImageIcon imgIcon; static int WIDTH = 1200; static int HEIGHT = 900; // Game Modes public static SinglePlayer singleGame; public static LocalPlayer localGame; public static OnlineMode onlineGame; // Threads public static Thread singleThread; public static Thread localThread; public static Thread onlineThread; public static void main(String[] args) { init(); configureWindow(); run(); } private static void run() { while(true) { render(); } } private static void init() { frame = new JFrame("Snake Online"); panel = new SnakePanel(); imgIcon = new ImageIcon("res/icon.png"); singleGame = new SinglePlayer(); localGame = new LocalPlayer(); onlineGame = new OnlineMode(); singleThread = new Thread(singleGame); localThread = new Thread(localGame); onlineThread = new Thread(onlineGame); } private static void configureWindow() { // Panel properties panel.setPreferredSize(new Dimension(WIDTH, HEIGHT)); // Frame properties frame.setIconImage(imgIcon.getImage()); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(panel); frame.pack(); } public static void startSinglePlayer() { singleGame.reset(); singleThread = new Thread(singleGame); singleThread.start(); } public static void startLocalPlayer() { localGame.reset(); localThread = new Thread(localGame); localThread.start(); } public static void startOnlineGame(String host) { onlineGame.setIP(host); onlineThread= new Thread(onlineGame); onlineThread.start(); } public static void render() { panel.repaint(); } }
509b38ac5af43854730bc0d2b7887253fe6f9221
458fe3e3b5e6fb37a7ff9938c09eeec4472cf70c
/p022_jincheng_baohuo/src/main/java/com/example/p022_jincheng_baohuo/MainActivity.java
a30e1602c981dea16429753afa1d15b9936d4de2
[]
no_license
imgt/myapplication2018
5cbebc825094927514ae56f2970452221eed5f72
4599093c12a7850499118589d362ed74539b2363
refs/heads/master
2020-04-10T16:18:11.701456
2018-08-08T02:24:50
2018-08-08T02:24:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
942
java
package com.example.p022_jincheng_baohuo; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import com.example.p022_jincheng_baohuo.demo1.MainActivity1; import com.example.p022_jincheng_baohuo.demo2.MainActivity2; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void DEMO1(View view) { startActivity(new Intent(MainActivity.this, MainActivity1.class)); } public void DEMO2(View view) { startActivity(new Intent(MainActivity.this, MainActivity2.class)); } @Override public void onBackPressed() { super.onBackPressed(); // android.os.Process.killProcess(android.os.Process.myPid()); // System.exit(0); } }
f4e10358cde26a4c351e29538f060cc6dcd829a4
8766eaec564f8d104583be96975245869ec46c9e
/app/src/test/java/com/example/vishal/ExampleUnitTest.java
69aefd3ecb3f032b5b839bc609b841a0c9045e00
[]
no_license
VishalSolanki135/MultipurposeApplication
a082dcf09e0c64557188cc2a673545341597d86e
5edc15a3506e790f4c4cc8b43cb63d6be0f150a4
refs/heads/master
2023-07-08T22:55:51.925644
2021-08-05T05:01:35
2021-08-05T05:01:35
392,904,835
0
0
null
null
null
null
UTF-8
Java
false
false
379
java
package com.example.vishal; 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); } }
e516c7c16f5d0617754dd3fb619a58f2e2be0d5e
5eed3e3e5dce1fd81d12ad7fe6164c8c2d7723be
/flip-concept/src/main/java/com/vpaliy/flip_concept/BounceOvershootInterpolator.java
ac5d47ee8cf930643b7a654b508aab1b28816fbf
[ "MIT" ]
permissive
juhitiwari/boozingo
94e1d5ca6dab5e6958478436ed19457cd9b6bbcc
b7ae50e3ed1cae41bb6f7b726c0cee71e3773872
refs/heads/master
2020-04-10T14:03:59.805708
2018-12-19T16:47:23
2018-12-19T16:47:23
161,066,448
0
1
MIT
2018-12-19T16:47:24
2018-12-09T17:58:42
Java
UTF-8
Java
false
false
747
java
package com.vpaliy.flip_concept; import android.view.animation.BounceInterpolator; import android.view.animation.Interpolator; import android.view.animation.OvershootInterpolator; public class BounceOvershootInterpolator implements Interpolator { private OvershootInterpolator overshootInterpolator; private BounceInterpolator bounceInterpolator; public BounceOvershootInterpolator(float tension){ overshootInterpolator=new OvershootInterpolator(tension); bounceInterpolator=new BounceInterpolator(); } @Override public float getInterpolation(float input) { if(input>.99f) return bounceInterpolator.getInterpolation(input); return overshootInterpolator.getInterpolation(input); } }
37656c1783c31804365bb2d46846b1a1aee2567b
3e65b71bb99b15dc799853756c34a62258d900a8
/src/main/java/com/cafeManagerAssignment/cafeManager/dto/ProductInOrderDto.java
e11f8a123618dd52c02df24da4fd5f1f48c1d2f6
[]
no_license
ArtyomManasyan/cafe-manager
c06e2aac3723faf96a9b160426371e2a8f1b0cac
3352f1249bdabdad6a36d574f08762bf15b41610
refs/heads/master
2022-11-19T05:37:23.667908
2020-07-21T10:22:49
2020-07-21T10:22:49
281,356,957
0
0
null
null
null
null
UTF-8
Java
false
false
410
java
package com.cafeManagerAssignment.cafeManager.dto; import com.cafeManagerAssignment.cafeManager.model.enums.ProductInOrderStatus; import lombok.Data; import lombok.experimental.Accessors; @Accessors(chain = true) @Data public class ProductInOrderDto { private Long id; private ProductInOrderStatus status; private Integer count; private OrderDto order; private ProductDto product; }
949457ff44697ee820c59e2579b2377acc50467d
4c711e6728ccd95487ceb3b29dbc83b9b284f68a
/src/test/java/com/ucla/shopyourlikes/payload/internal/testGenerateLinkResponse.java
2aefb434a2ebb43b5a5d262751e2c0aaa1d12aa7
[]
no_license
allenwbw/ShopYourLikes
b86b90b01fc0beec81c5db4c748cea8cd3d9deef
547b2c397fc9412c08acd8bc4fa30340fc26a1ae
refs/heads/master
2020-03-10T20:15:11.071457
2018-06-08T01:20:33
2018-06-08T01:20:33
129,566,494
2
1
null
2018-05-05T11:30:24
2018-04-15T01:11:39
CSS
UTF-8
Java
false
false
688
java
package com.ucla.shopyourlikes.payload.internal; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; public class testGenerateLinkResponse { private GenerateLinkResponse generateLinkResponse; @Before public void setUp() { this.generateLinkResponse = new GenerateLinkResponse(); } @Test public void testGenerateLinkResponseObjCreation() { this.generateLinkResponse.setEcpc(1); this.generateLinkResponse.setLink("www.warriors.com"); assertEquals(new Integer(1),this.generateLinkResponse.getEcpc()); assertEquals("www.warriors.com",this.generateLinkResponse.getLink()); } }
c1daa80b516673c989db8a97cb8b8d36010ff146
20bfd34a7f09565bda4c6490799d71c26a22d974
/r2db/src/main/java/com/codekutter/r2db/driver/model/Searchable.java
7d1e54061fa0d2a8d993fbb78c8acc5a3d58a2c8
[ "Apache-2.0" ]
permissive
subhagho/codekutter
e0dba77d8ddb9e41bff79ab01ea0e018614cbf31
0715300a7c953d4c02bb386d58a2fcc9789d6508
refs/heads/master
2023-08-07T20:19:22.910659
2021-07-06T06:01:16
2021-07-06T06:01:16
224,968,407
3
3
Apache-2.0
2023-08-24T20:27:42
2019-11-30T06:12:54
Java
UTF-8
Java
false
false
897
java
/* * Copyright (2020) Subhabrata Ghosh (subho dot ghosh at outlook dot com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package com.codekutter.r2db.driver.model; import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD}) @Inherited public @interface Searchable { boolean ignore() default false; boolean faceted() default false; }
1259044f43c6415e5324979480d713c95b672315
bbff23795584111838b25a579fe6a37848d6dd2e
/example/src/main/java/com/theone/example/foobar/param/FooBarPageParam.java
6cf92601ce1994f1cf647c34bd7b4456dd81eeb8
[]
no_license
xiao1tt/spring-boot-scaffolding
51454e480ce24c6fe7a599b97186b0ad6f2a5c22
ebb1f66014371beecc14b36459c786663b76c9fe
refs/heads/main
2023-03-27T19:54:49.359618
2021-03-28T12:01:30
2021-03-28T12:01:30
352,316,774
0
0
null
null
null
null
UTF-8
Java
false
false
1,120
java
/* * Copyright 2019-2029 geekidea(https://github.com/geekidea) * * 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.theone.example.foobar.param; import com.theone.scaffolding.framework.core.pagination.BasePageOrderParam; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * <pre> * FooBar 分页参数对象 * </pre> * * @author geekidea * @date 2020-03-24 */ @Data @Accessors(chain = true) @EqualsAndHashCode(callSuper = true) public class FooBarPageParam extends BasePageOrderParam { private static final long serialVersionUID = 1L; }
a1507b6d96838abf4f5bd3f017275782d51a544c
518dee83afdf857dff674a2d7711f2f404b5de64
/src/multithreading/J18_11.java
7e18af027811ff164df4184a3a840d8f9d004729
[ "Apache-2.0" ]
permissive
csitedexperts/CSE1322S02_Spring2019
33bea87a6fa5f7291e336133e02a25fa4d7bf8bc
427efebccc6f10bc3eec8bfcc7fdc78e8af3c226
refs/heads/master
2020-04-15T18:18:26.169144
2019-04-23T00:46:45
2019-04-23T00:46:45
164,909,251
5
2
null
null
null
null
UTF-8
Java
false
false
1,617
java
package multithreading; /* J18_11.java */ /* Using yield(), stop() and sleep() Methods with try and catch Statements */ class A1811 extends Thread // Thread A1811 { public void run(){ for(int i= 1; i<=5; i=i+2) { System.out.println("Inside Thread A1811 : i = " +i); if(i==3) yield(); } System.out.println("Exit From A1811."); } } class B1811 extends Thread // Thread B1811 { public void run() { for(int j= 2; j<=6; j=j+2) { System.out.println("Inside Thread B : j = " +j); if(j==4) stop(); } System.out.println("Exit From B."); } } class C1811 extends Thread // Thread C1811 { public void run() { for(int k= 1; k<=5; k=k+2) { System.out.println("Inside Thread C1811 : k = " +k); try{ sleep(1000); // Causes wait of 1 Sec. } catch(Exception E) { System.out.println("Eception Caught."); } } System.out.println("Exit From C1811."); } } public class J18_11 // Main Thread { public static void main(String args[]) { A1811 Th1 = new A1811(); //Creating Object of Thread A1811 B1811 Th2 = new B1811(); //Creating Object of Thread B1811 C1811 Th3 = new C1811(); //Creating Object of Thread C1811 System.out.println("Starting Thread A1811:"); Th1.start(); // Calls run() Method of Thread A1811 System.out.println("Starting Thread B1811:"); Th2.start(); // Calls run() Method of Thread B1811 System.out.println("Starting Thread C1811:"); Th3.start(); // Calls run() Method of Thread C1811 System.out.println("Exit From Main Thread."); } }
9d1bfb0fe87761dcc4dbb8f23e0fa9f68c69f754
a12a08d2e54937d088c1ea6357f8dc0125f89640
/src/main/java/com/mediateka/service/UserService.java
ab786bf00c91701a5dda63d5e96a0ce382399497
[]
no_license
borshch-yaroslav/mediateka
34b5ee50f649c7baf54021dd10cbba2c54ab491a
0d539e528f4eb9c0d510acaacdaec6477a8e5633
refs/heads/master
2021-01-21T06:55:17.814982
2015-08-20T13:11:26
2015-08-20T13:11:26
41,093,893
0
0
null
null
null
null
UTF-8
Java
false
false
3,166
java
package com.mediateka.service; import java.sql.SQLException; import java.util.List; import com.mediateka.dao.UserDAO; import com.mediateka.model.User; import com.mediateka.model.enums.Role; import com.mediateka.model.enums.State; public class UserService { public static void saveUser(User user) throws SQLException, ReflectiveOperationException { UserDAO.saveUser(user); } public static User getUserById(Integer userId) throws ReflectiveOperationException, SQLException { return UserDAO.getUserById(userId); } public static void updateUser(User user) throws SQLException, ReflectiveOperationException { UserDAO.updateUser(user); } public static User getUserByEmail(String email) throws ReflectiveOperationException, SQLException { return UserDAO.getUserByEmail(email); } public static List<User> getUserByState(State state) throws ReflectiveOperationException, SQLException { return UserDAO.getUserByState(state); } public static List<User> getUserByFormActivity(Boolean formActivity) throws ReflectiveOperationException, SQLException { return UserDAO.getUserByFormActivity(formActivity); } public static List<User> getUserByRole(Role role) throws ReflectiveOperationException, SQLException { return UserDAO.getUserByRole(role); } public static User getUserByFormId(Integer formId) throws ReflectiveOperationException, SQLException { return UserDAO.getUserByFormId(formId); } public static List<User> getUserByProfession(String profession) throws ReflectiveOperationException, SQLException { return UserDAO.getUserByProfession(profession); } public static List<User> getUserByNationality(String nationality) throws ReflectiveOperationException, SQLException { return UserDAO.getUserByNationality(nationality); } public static User getUserByToken(String token) throws ReflectiveOperationException, SQLException { return UserDAO.getUserByToken(token); } public static List<User> getUserAll() throws ReflectiveOperationException, SQLException { return UserDAO.getUserAll(); } public static List<User> getUsersByOneRegexp(String regexp, int offset, int limit) throws SQLException, ReflectiveOperationException { return UserDAO.getUsersByOneRegexp(regexp, offset, limit); } public static List<User> getUsersByTwoRegexp(String firstRegexp, String secondRegexp, int offset, int limit) throws SQLException, ReflectiveOperationException { return UserDAO.getUsersByTwoRegexp(firstRegexp, secondRegexp, offset, limit); } public static List<User> getUsersByThreeRegexp(String firstRegexp, String secondRegexp, String thirdRegexp, int offset, int limit) throws SQLException, ReflectiveOperationException { return UserDAO.getUsersByThreeRegexp(firstRegexp, secondRegexp, thirdRegexp, offset, limit); } public static User getUserBySocialId(String socialId) throws SQLException, ReflectiveOperationException { return UserDAO.getUserBySocialId(socialId); } public static List<User> getUsersLimited(int offset, int limit) throws SQLException, ReflectiveOperationException { return UserDAO.getUsersByStateLimited(offset, limit); } }
5c86954caa39d00fbd864c1ac08ab1d0a64f27f9
b1875b82ee2d1ecda2d21dfd79c080b9c61a9844
/src/fakescript/command.java
40c305f9dc59e5f4ca5f7d1f5f60feefb2fa4ab8
[ "MIT" ]
permissive
mingyuanwang/fakescript-java
12bc2873c96751fb4314f599a576bdcb8c54c4db
af471fab74fad122cb16130fab29700fd253991d
refs/heads/master
2021-07-10T22:20:24.968386
2017-10-11T08:25:41
2017-10-11T08:25:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,649
java
package fakescript; public class command { public static final long EMPTY_CMD = -1; public static final int COMMAND_OPCODE = 0; public static final int COMMAND_ADDR = 1; public static final int COMMAND_POS = 2; public static final int OPCODE_ASSIGN = 0; public static final int OPCODE_PLUS = 1; public static final int OPCODE_MINUS = 2; public static final int OPCODE_MULTIPLY = 3; public static final int OPCODE_DIVIDE = 4; public static final int OPCODE_DIVIDE_MOD = 5; public static final int OPCODE_STRING_CAT = 6; public static final int OPCODE_PLUS_ASSIGN = 7; public static final int OPCODE_MINUS_ASSIGN = 8; public static final int OPCODE_MULTIPLY_ASSIGN = 9; public static final int OPCODE_DIVIDE_ASSIGN = 10; public static final int OPCODE_DIVIDE_MOD_ASSIGN = 11; public static final int OPCODE_RETURN = 12; public static final int OPCODE_JNE = 13; public static final int OPCODE_JMP = 14; public static final int OPCODE_FORBEGIN = 15; public static final int OPCODE_FORLOOP = 16; public static final int OPCODE_AND = 17; public static final int OPCODE_OR = 18; public static final int OPCODE_LESS = 19; public static final int OPCODE_MORE = 20; public static final int OPCODE_EQUAL = 21; public static final int OPCODE_MOREEQUAL = 22; public static final int OPCODE_LESSEQUAL = 23; public static final int OPCODE_NOTEQUAL = 24; public static final int OPCODE_NOT = 25; public static final int OPCODE_AND_JNE = 26; public static final int OPCODE_OR_JNE = 27; public static final int OPCODE_LESS_JNE = 28; public static final int OPCODE_MORE_JNE = 29; public static final int OPCODE_EQUAL_JNE = 30; public static final int OPCODE_MOREEQUAL_JNE = 31; public static final int OPCODE_LESSEQUAL_JNE = 32; public static final int OPCODE_NOTEQUAL_JNE = 33; public static final int OPCODE_NOT_JNE = 34; public static final int OPCODE_CALL = 35; public static final int OPCODE_SLEEP = 36; public static final int OPCODE_YIELD = 37; public static final int OPCODE_MAX = 38; public static final int ADDR_STACK = 0; public static final int ADDR_CONST = 1; public static final int ADDR_CONTAINER = 2; public static final int CALL_NORMAL = 0; public static final int CALL_FAKE = 1; public static final int CALL_CLASSMEM = 2; public static long MAKEINT64(int high, int low) { return ((long) ((low) | ((long) (high)) << 32)); } public static int HIINT32(long i) { return ((int) (((long) (i) >> 32) & 0xFFFFFFFF)); } public static int LOINT32(long i) { return ((int) (i)); } public static int MAKEINT32(int high, int low) { return ((int) (((short) (low)) | ((int) ((short) (high))) << 16)); } public static short HIINT16(int i) { return ((short) (((int) (i) >> 16) & 0xFFFF)); } public static short LOINT16(int i) { return ((short) (i)); } public static long MAKE_COMMAND(int type, int code) { return MAKEINT64(type, code); } public static long MAKE_OPCODE(int op) { return MAKE_COMMAND(COMMAND_OPCODE, op); } public static long MAKE_POS(int pos) { return MAKE_COMMAND(COMMAND_POS, pos); } public static long MAKE_ADDR(int addrtype, int pos) { return MAKE_COMMAND(COMMAND_ADDR, MAKEINT32(addrtype, pos)); } public static int COMMAND_TYPE(long cmd) { return HIINT32(cmd); } public static int COMMAND_CODE(long cmd) { return LOINT32(cmd); } public static short ADDR_TYPE(int code) { return HIINT16(code); } public static short ADDR_POS(int code) { return LOINT16(code); } }
c1d7af26cf2a7ef0f6f6b97cb811b664bd7f01be
7d14577ca270e85dcccf6d02fa4c18ac66e276d1
/src/main/java/br/com/telesul/reporting/dao/SubGrupoGraficoDAO.java
f9028e428cc9193d20628b73bf391e8b82d51aa2
[]
no_license
felippefloriani/CoreTelesul-Reporting
2e17fbbd2f4670c9e3a52654fbc87f20b62e8bc7
5366bd670c825f5444a0f8c563ece6c654c44d5d
refs/heads/master
2020-12-02T19:19:56.528775
2017-08-15T19:49:44
2017-08-15T19:49:44
96,326,225
0
0
null
null
null
null
UTF-8
Java
false
false
891
java
package br.com.telesul.reporting.dao; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import br.com.telesul.core.util.HibernateUtil; import br.com.telesul.reporting.model.GrupoGrafico; import br.com.telesul.reporting.model.SubGrupoGrafico; public class SubGrupoGraficoDAO extends GenericDAO<SubGrupoGrafico>{ public List<SubGrupoGrafico> buscaPorGrupoGrafico(GrupoGrafico grupoGrafico){ Session sessao = HibernateUtil.getFabricaDeSessoes().openSession(); List<SubGrupoGrafico> listaSubGrupoGrafico = null; try { Query query = sessao.createQuery("FROM SubGrupoGrafico WHERE grupoGrafico.codigo = :code "); query.setParameter("code", grupoGrafico.getCodigo()); listaSubGrupoGrafico = query.list(); } catch (RuntimeException ex) { throw ex; } finally { sessao.close(); } return listaSubGrupoGrafico; } }
4eb6f18d1edf5e0913dbd0920b8b2f91b612820d
77e975957d31c1267508d72ca036671ec4ba9192
/src/main/java/cn/com/tojob/serviceImp/UserServiceImp.java
b92da9307d2a06b6edb504d3bf3a1eea1735b905
[]
no_license
xiezhengsu/managesys_java
d4d08ecbd54b760c11d9e9d44966ac1b449b30a8
f961f7153b463866a04ed0431f3832db89082174
refs/heads/master
2020-03-29T07:40:35.203515
2017-06-28T13:47:03
2017-06-28T13:47:03
94,663,179
0
0
null
null
null
null
UTF-8
Java
false
false
2,852
java
package cn.com.tojob.serviceImp; import javax.annotation.Resource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import cn.com.tojob.dao.UserDao; import cn.com.tojob.service.UserService; import cn.com.tojob.util.Page; @Service(value = "userService") public class UserServiceImp implements UserService{ @Resource(name = "userDao") public UserDao userDao; @Override public JSONObject addUserInfo(JSONObject user) { JSONObject json = new JSONObject(); boolean check = userDao.checkUserName(user.getString("username")); if (check) { boolean temp = userDao.addUser(user); if (temp) { //int userid = userDao.getUserIdByname(user.getString("username")); //userDao.addUserAccess(userid,user.getJSONArray("access")); json.put("succ", true); json.put("message", "用户添加成功"); }else{ json.put("succ", false); json.put("message", "用户添加失败"); } return json; }else{ json.put("succ", false); json.put("message", "用户名存在"); return json; } //return false } @Override public JSONObject deleteUser(String userId) { int temp = userDao.deleteUserByid(userId); JSONObject json =new JSONObject(); if(temp>0){ json.put("succ", true); json.put("message", "删除用户成功"); }else{ json.put("succ", false); json.put("message", "删除用户失败"); } return json; } @Override public JSONObject getUserList(String name, String page) { JSONObject json = new JSONObject(); int count = userDao.getUserCount(name); Page page1 = new Page(count,10); json.put("page", page); json.put("totalcount", page1.getResultCount()); json.put("totalpage", page1.getTotalPage()); JSONArray jsarray = userDao.getUserLists(name,Integer.parseInt(page)); json.put("list", jsarray); return json; } @Override public JSONObject getUserById(String id) { JSONObject json = new JSONObject(); JSONObject user = userDao.getUserByid(id); if(user!=null){ JSONArray access = new JSONArray(); //access = userDao.getUserAccess(id); user.put("access", access); json.put("succ", true); json.put("message", user); return json; }else{ json.put("succ", false); json.put("message", "获取用户失败"); } return json; } @Transactional(rollbackFor = Exception.class) @Override public JSONObject updateUser(JSONObject user) { JSONObject json = new JSONObject(); boolean temp = userDao.updateUser(user); if(temp){ //userDao.updateUserAccess(user); json.put("succ", true); json.put("message", "用户修改成功"); }else{ json.put("succ", false); json.put("message", "用户修改失败"); } return json; } }
82d2517bc959f1f84ad7d369c323e53dfa73431e
2453d186b4015672c0a2a1eb74c58c96a0b4b614
/src/com/auto/client/entity/reader/AbstractJsonReader.java
d358bb0a78fbe3f6e4c66c20ff1fc62b08970dae
[]
no_license
zhanghuan824/icar
75d711541ea1258113adb5557edfd6b458e4c0ff
41605cbc17a23a21727d377dca94a97204d2a005
refs/heads/master
2016-09-05T23:24:41.505897
2014-05-25T05:26:00
2014-05-25T05:26:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
990
java
package com.auto.client.entity.reader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.List; import com.auto.client.common.NetResourceManager; public abstract class AbstractJsonReader { public List<Object> get(String url) throws Exception { InputStream in = NetResourceManager.getHttpInputStream(url); return readObjectList(in); } protected String readData(InputStream in) throws Exception { InputStreamReader isr = new InputStreamReader(in, "UTF-8"); StringBuilder sbJson = new StringBuilder(); int data = -1; while((data = isr.read()) != -1) { sbJson.append((char)data); } return sbJson.toString(); } protected List<Object> readObjectList(InputStream in) throws Exception { String strJson = readData(in); if(strJson.length() > 0) { return readObjectList(strJson); } else return null; } public abstract List<Object> readObjectList(String json) throws Exception; }
fdd6b03e5ad2bf4820b84f6401e537ced34b292f
0f0ffd74bf18976bbea7990fad4090ab406341e7
/capstone/workspace/task1/task1-group2-2-hadoop/src/main/java/TopDestMapper.java
d746c5b2c6155db962c4192cc9eff2213ce9edaf
[ "MIT" ]
permissive
winston86zhu/cloud-computing-specialization
5c10b5011f1b60e27be9d6359e99097537e8bb79
7c332312e9550d76baad4db4256dacd9ee84ac00
refs/heads/master
2023-02-14T20:14:31.488434
2020-04-14T08:31:53
2020-04-14T08:31:53
251,163,357
0
0
MIT
2020-03-30T00:26:46
2020-03-30T00:26:45
null
UTF-8
Java
false
false
853
java
import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import java.io.IOException; /** * @author <a href="mailto:[email protected]">Krzysztof Grodzicki</a> 28/01/16. */ public class TopDestMapper extends Mapper<Object, Text, Text, TextArrayWritable> { @Override protected void map(Object key, Text value, Context context) throws IOException, InterruptedException { String[] split = value.toString().split("\\t"); String originCarrierKey = split[0]; String origin = origin(originCarrierKey); String dest = dest(originCarrierKey); context.write(new Text(origin), new TextArrayWritable(new String[]{dest, split[1]})); } private String dest(String s) { return s.split("-")[1]; } private String origin(String s) { return s.split("-")[0]; } }
3624c9e53101976d8c103cb56b0eea9c0abc3076
876a8591a5a62499ad20fe94be99ccc7bdbebb00
/Demo TP/src/tp/framework/elementos/Pawn.java
cc08adb07e1ba92040ea5353d1841e2ff3516ff4
[]
no_license
nnico15m/tpAlgoritmos2
d4de32e01fd7be24f5b01907e3342ac56ea5570b
7eacee5bab12b91875dffd4c3b4deb7aec139cea
refs/heads/master
2021-01-10T06:23:02.454852
2015-11-24T01:53:16
2015-11-24T01:53:16
44,826,554
0
0
null
null
null
null
UTF-8
Java
false
false
4,873
java
package tp.framework.elementos; /* G Chess version 1.0 Copyright (c) 2010 Gary Menezes Copyright Notice You may not use this code for any commercial purpose. */ import java.awt.*; import java.util.*; @SuppressWarnings("serial") public class Pawn extends PiezaAjedrez { private boolean doubleMove; public Pawn(boolean isWhite, Localizacion loc) { super(isWhite, loc); } public void draw(Graphics g) { final int x = 20; final int y = 40; final int width = 40; Polygon p = new Polygon(); p.addPoint(30,0); p.addPoint(5,50); p.addPoint(55,50); if(getColor()) { g.setColor(Color.WHITE); g.setFont(new Font("Courier", g.getFont().getStyle(), width)); g.fillPolygon(p); g.setColor(Color.BLACK); } else { g.setColor(Color.BLACK); g.setFont(new Font("Courier", g.getFont().getStyle(), width)); g.fillPolygon(p); g.setColor(Color.WHITE); } g.drawString("P", x, y); } public boolean getDoubleMove() { return doubleMove; } public void setDoubleMove(boolean input) { doubleMove=input; } public ArrayList<Localizacion> getMoves(EstadoTableroAjedrez board) { ArrayList<Localizacion> possibleMoves = new ArrayList<Localizacion>(); int y = getLocation().getRow(); int x = getLocation().getCol(); Localizacion whiteOne = new Localizacion(y-1,x); Localizacion whiteTwo = new Localizacion(y-2,x); Localizacion whiteLeft = new Localizacion(y-1,x-1); Localizacion whiteRight = new Localizacion(y-1,x+1); Localizacion enPassantLeft = new Localizacion(y,x-1); Localizacion enPassantRight = new Localizacion(y,x+1); Localizacion blackOne = new Localizacion(y+1,x); Localizacion blackTwo = new Localizacion(y+2,x); Localizacion blackLeft = new Localizacion(y+1,x-1); Localizacion blackRight = new Localizacion(y+1,x+1); if(getColor()) { if(y!=0) { if(board.isValid(whiteOne) && board.isEmpty(whiteOne)) possibleMoves.add(whiteOne); if(board.isValid(whiteTwo) && getLocation().getRow()==6 && board.isEmpty(whiteTwo) && board.isEmpty(whiteOne)) possibleMoves.add(whiteTwo); if(board.isValid(whiteLeft) && !board.isEmpty(whiteLeft) && !board.isPieceWhite(whiteLeft)) possibleMoves.add(whiteLeft); if(board.isValid(whiteRight) && !board.isEmpty(whiteRight) && !board.isPieceWhite(whiteRight)) possibleMoves.add(whiteRight); if(board.isValid(whiteRight) && board.isEmpty(whiteRight) && board.isValid(enPassantRight) && !board.isEmpty(enPassantRight) && !board.isPieceWhite(enPassantRight) && board.getState()[enPassantRight.getRow()][enPassantRight.getCol()] instanceof Pawn) if(enPassantRight.getRow()==3 && ((Pawn)board.getState()[enPassantRight.getRow()][enPassantRight.getCol()]).getDoubleMove()) possibleMoves.add(whiteRight); if(board.isValid(whiteLeft) && board.isEmpty(whiteLeft) && board.isValid(enPassantLeft) && !board.isEmpty(enPassantLeft) && !board.isPieceWhite(enPassantLeft) && board.getState()[enPassantLeft.getRow()][enPassantLeft.getCol()] instanceof Pawn) if(enPassantLeft.getRow()==3 && ((Pawn)board.getState()[enPassantLeft.getRow()][enPassantLeft.getCol()]).getDoubleMove()) possibleMoves.add(whiteLeft); } } else { if(y!=7) { if(board.isValid(blackOne) && board.isEmpty(blackOne)) possibleMoves.add(blackOne); if(board.isValid(blackTwo) && getLocation().getRow()==1 && board.isEmpty(blackTwo) && board.isEmpty(blackOne)) possibleMoves.add(blackTwo); if(board.isValid(blackLeft) && !board.isEmpty(blackLeft) && board.isPieceWhite(blackLeft)) possibleMoves.add(blackLeft); if(board.isValid(blackRight) && !board.isEmpty(blackRight) && board.isPieceWhite(blackRight)) possibleMoves.add(blackRight); if(board.isValid(blackRight) && board.isEmpty(blackRight) && board.isValid(enPassantRight) && !board.isEmpty(enPassantRight) && board.isPieceWhite(enPassantRight) && board.getState()[enPassantRight.getRow()][enPassantRight.getCol()] instanceof Pawn) if(enPassantRight.getRow()==4 && ((Pawn)board.getState()[enPassantRight.getRow()][enPassantRight.getCol()]).getDoubleMove()) possibleMoves.add(blackRight); if(board.isValid(blackLeft) && board.isEmpty(blackLeft) && board.isValid(enPassantLeft) && !board.isEmpty(enPassantLeft) && board.isPieceWhite(enPassantLeft) && board.getState()[enPassantLeft.getRow()][enPassantLeft.getCol()] instanceof Pawn) if(enPassantLeft.getRow()==4 && ((Pawn)board.getState()[enPassantLeft.getRow()][enPassantLeft.getCol()]).getDoubleMove()) possibleMoves.add(blackLeft); } } return possibleMoves; } public void moveTo(Localizacion moveLoc) { if((int)Math.abs(getLocation().getRow()-moveLoc.getRow()) > 1) doubleMove = true; else doubleMove = false; setLocation(moveLoc); } public String toString() { return super.toString()+" Pawn"; } }
2a9ef48a6a148dd5d7ee575116597686f3694bf0
1ab4c1651fa2d05c178397c248994264756f8341
/src/GUI/MenuPanel.java
d10b404022f1d8acbce639616dcbede67abc654c
[]
no_license
Xylor1712/Megaman
60f03915f9c6019f2972fdd72ae753df2fdbafa9
9e5da32df54ca1ec2a0c9999c966a1740e898e73
refs/heads/master
2020-06-02T02:53:51.103069
2013-06-20T07:38:07
2013-06-20T07:38:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,768
java
package GUI; import images.ImageLoader; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class MenuPanel extends JPanel implements ActionListener{ private static final long serialVersionUID = -6374418949813550261L; private ImageIcon buttonIcon = ImageLoader.getIcon("BlockoG.png"); private BoxLayout layout; private JButton singleplayer; private JButton multiplayer; private JButton options; private JButton exit; public MenuPanel(){ layout = new BoxLayout(this, BoxLayout.PAGE_AXIS); this.setLayout(layout); initButtons(); initLayout(); } private void initLayout() { this.add(Box.createVerticalGlue()); this.add(singleplayer); this.add(Box.createVerticalGlue()); this.add(multiplayer); this.add(Box.createVerticalGlue()); this.add(options); this.add(Box.createVerticalGlue()); this.add(exit); this.add(Box.createVerticalGlue()); } private void initButtons(){ singleplayer = new JButton("Singleplayer"); singleplayer.setMnemonic('S'); singleplayer.setActionCommand("singleplayer"); singleplayer.addActionListener(this); singleplayer.setIcon(buttonIcon); singleplayer.setAlignmentX(CENTER_ALIGNMENT); singleplayer.setAlignmentY(CENTER_ALIGNMENT); multiplayer = new JButton("Multiplayer"); multiplayer.setMnemonic('M'); multiplayer.setActionCommand("multiplayer"); multiplayer.addActionListener(this); multiplayer.setAlignmentX(CENTER_ALIGNMENT); multiplayer.setAlignmentY(CENTER_ALIGNMENT); options = new JButton("Options"); options.setMnemonic('O'); options.setActionCommand("options"); options.addActionListener(this); options.setAlignmentX(CENTER_ALIGNMENT); options.setAlignmentY(CENTER_ALIGNMENT); exit = new JButton("Exit"); exit.setMnemonic('E'); exit.setActionCommand("exit"); exit.addActionListener(this); exit.setAlignmentX(CENTER_ALIGNMENT); exit.setAlignmentY(CENTER_ALIGNMENT); } @Override public void actionPerformed(ActionEvent e) { switch(e.getActionCommand()){ case "singleplayer": break; case "multiplayer": break; case "options": break; case "exit": break; } } public static void main(String[] args){ new JFrame("Test"){ private static final long serialVersionUID = 8620900696432559397L; { this.add(new MenuPanel()); this.setSize(400, 400); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setVisible(true); } }; } }
6703c967bd71e4402da1d25853fc6052c642ba24
ab9418ea68e056297792cd1eee6fee051d340bbe
/src/main/java/com/enjoy/cap5/config/LinuxCondition.java
6fef97faba340989a9c7a743adf04a19b5ddbe8a
[ "Apache-2.0" ]
permissive
cczuwangkun/springanno
6df41103c19747ac42dbefb253b8362d2591312e
d99617eeada527b2c2320cf250ec178ca85d5585
refs/heads/master
2022-06-25T02:26:17.009374
2019-06-20T07:30:25
2019-06-20T07:30:25
188,249,587
0
0
Apache-2.0
2022-06-21T01:17:50
2019-05-23T14:24:56
Java
UTF-8
Java
false
false
962
java
package com.enjoy.cap5.config; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; import org.springframework.core.env.Environment; import org.springframework.core.type.AnnotatedTypeMetadata; /** * @Author:waken * @Date: Created in 2019/4/25 21:12 * @Description: */ public class LinuxCondition implements Condition { public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) { //获取IOC容器正在使用的BeanFactory ConfigurableListableBeanFactory beanFactory = conditionContext.getBeanFactory(); Environment environment = conditionContext.getEnvironment(); String property = environment.getProperty("os.name"); if (property.contains("Linux")) { return true; } return false; } }
b46300d648a013263f83e12a35f49c68c51ccb2c
c59c34289ed8279a333811a0c618b552dce3b0e5
/Android Market/app/src/main/java/com/cenk/marketsmi/database/InfoDatabase.java
9380ac3f0f09c694b183de8b9fc7f437f9508436
[]
no_license
cnkrb/Market
7288c4c7aabde90d8f8c1d5c269d07bad894b18f
52208465da108db3dab131e994981d1f829eac74
refs/heads/main
2023-03-28T06:40:56.442152
2021-03-29T20:23:53
2021-03-29T20:23:53
352,717,109
0
0
null
null
null
null
UTF-8
Java
false
false
4,187
java
package com.cenk.marketsmi.database; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import java.util.ArrayList; import java.util.HashMap; public class InfoDatabase extends SQLiteOpenHelper { // Database Version private static final int DATABASE_VERSION = 1; // Database Name private static final String DATABASE_NAME = "sqllite_database_info";//database adı private static final String TABLE_NAME = "bilgi"; private static String ID = "id"; private static String NAME = "name"; private static String ADDRESS = "address"; private static String NUMBER = "number"; public InfoDatabase(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { // Databesi oluşturuyoruz.Bu methodu biz çağırmıyoruz. Databese de obje oluşturduğumuzda otamatik çağırılıyor. String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + "(" + ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + NAME + " TEXT," + ADDRESS + " TEXT," + NUMBER + " TEXT" + ")"; db.execSQL(CREATE_TABLE); } public void addressDelete(int id) { //id si belli olan row u silmek için SQLiteDatabase db = this.getWritableDatabase(); db.delete(TABLE_NAME, ID + " = ?", new String[]{String.valueOf(id)}); db.close(); } public void addressAdd(String name, String address, String number) { //kitapEkle methodu ise adı üstünde Databese veri eklemek için SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(NAME, name); values.put(ADDRESS, address); values.put(NUMBER, number); db.insert(TABLE_NAME, null, values); db.close(); //Database Bağlantısını kapattık*/ } public ArrayList<HashMap<String, String>> getAddress() { //Bu methodda ise tablodaki tüm değerleri alıyoruz //ArrayList adı üstünde Array lerin listelendiği bir Array.Burda hashmapleri listeleyeceğiz //Herbir satırı değer ve value ile hashmap a atıyoruz. Her bir satır 1 tane hashmap arrayı demek. //olusturdugumuz tüm hashmapleri ArrayList e atıp geri dönüyoruz(return). SQLiteDatabase db = this.getReadableDatabase(); String selectQuery = "SELECT * FROM " + TABLE_NAME; Cursor cursor = db.rawQuery(selectQuery, null); ArrayList<HashMap<String, String>> kitaplist = new ArrayList<HashMap<String, String>>(); // looping through all rows and adding to list if (cursor.moveToFirst()) { do { HashMap<String, String> map = new HashMap<String, String>(); for (int i = 0; i < cursor.getColumnCount(); i++) { map.put(cursor.getColumnName(i), cursor.getString(i)); } kitaplist.add(map); } while (cursor.moveToNext()); } db.close(); // return kitap liste return kitaplist; } public void resetTables() { //Bunuda uygulamada kullanmıyoruz. Tüm verileri siler. tabloyu resetler. SQLiteDatabase db = this.getWritableDatabase(); // Delete All Rows db.delete(TABLE_NAME, null, null); db.close(); } public void addressEdit(String name, String address, String number, int id) { SQLiteDatabase db = this.getWritableDatabase(); //Bu methodda ise var olan veriyi güncelliyoruz(update) ContentValues values = new ContentValues(); values.put(NAME, name); values.put(ADDRESS, address); values.put(NUMBER, number); // updating row db.update(TABLE_NAME, values, ID + " = ?", new String[] { String.valueOf(id) }); } @Override public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) { // TODO Auto-generated method stub } }
c5eda6ba42c970ac02f1692b65389c68daf7ab3e
d2dccd5ee5262e01c402565386b98015f5dd7101
/HiWorld/src/main/java/com/hiworld/minihp/service/MiniHpNeighborListServiceImpl.java
9242f1baef3c2beb00b11727c292f21b84028bb7
[]
no_license
eaglesv2/Hi-World
e3401d39868652b7865bf925c95286ffd74da068
6f33ed6dcf88592aa5be1a19ea418cccbd2bbe91
refs/heads/master
2023-04-08T06:27:57.609396
2021-04-16T14:32:43
2021-04-16T14:32:43
347,938,286
0
0
null
2021-04-16T14:14:21
2021-03-15T11:13:13
Java
UTF-8
Java
false
false
1,580
java
package com.hiworld.minihp.service; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hiworld.minihp.dao.MiniHpNeighborListDAO; import com.hiworld.minihp.vo.MiniHpNeighborListVO; import com.hiworld.minihp.vo.MiniHpNeighborVO; @Service public class MiniHpNeighborListServiceImpl implements MiniHpNeighborListService { @Autowired private MiniHpNeighborListDAO neighborListDAO; MiniHpNeighborListVO neighborListVO; MiniHpNeighborVO neighborVO; /*이웃 신청 정보 테이블에 저장*/ @Override public void insertNeighborList(MiniHpNeighborListVO neighborListVO) { neighborListDAO.insertNeighborList(neighborListVO); } /*이웃 신청 목록 불러오기*/ @Override public List<MiniHpNeighborListVO> getRegisterList(int userSerial) { List<MiniHpNeighborListVO> list = neighborListDAO.getRegisterList(userSerial); if(list.size() == 0) { list = null; } /*System.out.println(list);*/ return list; } /*이웃 신청 정보 불러오기*/ @Override public MiniHpNeighborListVO getRegisterCheck(int senderSerial, int receiverSerial) { neighborListVO = neighborListDAO.getData(senderSerial, receiverSerial); return neighborListVO; } /*이웃 신청 여부 확인*/ @Override public int neighborListCheck(int userSerial, int neighborSerial) { int result = 0; int check = neighborListDAO.listCheck(userSerial, neighborSerial); if(check == 0) { result = 0; } else { result = 1; } return result; } }
63e3a5d6f6ac485dac721b81978f80803eda7a6e
56c2e5b6bbbbb00b622f69d14515a9f4f4a028da
/app/src/main/java/demo/mark/com/xposedpluginsearch/IntervalThread.java
36346092d8290a741e33e0e63169a10ad71de523
[]
no_license
ariesy313/XposedPluginSearch
2c49e59ad690e25a1d409594bde4a6e299fdd602
a7751802bf32913571c3571649b39b7046773985
refs/heads/master
2021-01-01T03:52:36.878731
2016-05-24T15:54:14
2016-05-24T15:54:14
59,579,142
1
0
null
null
null
null
UTF-8
Java
false
false
3,913
java
package demo.mark.com.xposedpluginsearch; import org.json.JSONArray; import org.json.JSONObject; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import de.robv.android.xposed.XposedBridge; import demo.mark.com.xposedpluginsearch.models.wandoujia.Tweet; /** * Created by chiontang on 2/4/16. */ public class IntervalThread extends Thread { ArrayList<Tweet> tweetList; IntervalThread(ArrayList<Tweet> tweetList) { this.tweetList = tweetList; } @Override public void run() { super.run(); while (true) { try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } if (!Config.enabled || !Config.ready) { return; } saveToFile(); } } private void saveToFile() { JSONArray tweetListJSON = new JSONArray(); for (int tweetIndex=0; tweetIndex<tweetList.size(); tweetIndex++) { Tweet currentTweet = tweetList.get(tweetIndex); if (!currentTweet.ready) { continue; } JSONObject tweetJSON = new JSONObject(); JSONArray commentsJSON = new JSONArray(); JSONArray likesJSON = new JSONArray(); JSONArray mediaListJSON = new JSONArray(); try { tweetJSON.put("snsId", currentTweet.id); tweetJSON.put("authorName", currentTweet.author); tweetJSON.put("authorId", currentTweet.authorId); tweetJSON.put("content", currentTweet.content); for (int i = 0; i < currentTweet.comments.size(); i++) { JSONObject commentJSON = new JSONObject(); commentJSON.put("authorName", currentTweet.comments.get(i).authorName); commentJSON.put("authorId", currentTweet.comments.get(i).authorId); commentJSON.put("content", currentTweet.comments.get(i).content); commentJSON.put("toUserName", currentTweet.comments.get(i).toUser); commentJSON.put("toUserId", currentTweet.comments.get(i).toUserId); commentsJSON.put(commentJSON); } tweetJSON.put("comments", commentsJSON); for (int i = 0; i < currentTweet.likes.size(); i++) { JSONObject likeJSON = new JSONObject(); likeJSON.put("userName", currentTweet.likes.get(i).userName); likeJSON.put("userId", currentTweet.likes.get(i).userId); likesJSON.put(likeJSON); } tweetJSON.put("likes", likesJSON); for (int i = 0; i < currentTweet.mediaList.size(); i++) { mediaListJSON.put(currentTweet.mediaList.get(i)); } tweetJSON.put("mediaList", mediaListJSON); tweetJSON.put("rawXML", currentTweet.rawXML); tweetJSON.put("timestamp", currentTweet.timestamp); tweetListJSON.put(tweetJSON); } catch (Exception exception) { XposedBridge.log(exception.getMessage()); } } File jsonFile = new File(Config.outputFile); if (!jsonFile.exists()) { try { jsonFile.createNewFile(); } catch (IOException e) { XposedBridge.log(e.getMessage()); } } try { FileWriter fw = new FileWriter(jsonFile.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw); bw.write(tweetListJSON.toString()); bw.close(); } catch (IOException e) { XposedBridge.log(e.getMessage()); } } }
7478e2a154eda2be90d372399f44ab6b18cbeddf
0687e3bf22a094a4caa369f9421c5a2dce3da309
/app/src/main/java/com/example/mynotesapp/db/NoteHelper.java
b8b0e8e00b9f2c20909389406e4ccea034b1fce3
[]
no_license
idhamozi/MyNotesApp
8f810aa69912fd38163416ebf04f0fa7265e67f4
5a92a256b444e865b21d88204a557c75285d09f2
refs/heads/master
2021-01-06T17:36:22.200495
2020-02-18T17:11:27
2020-02-18T17:11:27
241,420,226
0
0
null
null
null
null
UTF-8
Java
false
false
2,189
java
package com.example.mynotesapp.db; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import static android.provider.BaseColumns._ID; import static com.example.mynotesapp.db.DatabaseContract.TABLE_NAME; public class NoteHelper { private static final String DATABASE_TABLE = TABLE_NAME; private static DatabaseHelper dataBaseHelper; private static NoteHelper INSTANCE; private static SQLiteDatabase database; public NoteHelper(Context context) { dataBaseHelper = new DatabaseHelper(context); } public static NoteHelper getInstance(Context context) { if (INSTANCE == null) { synchronized (SQLiteOpenHelper.class) { if (INSTANCE == null) { INSTANCE = new NoteHelper(context); } } } return INSTANCE; } public void open() throws SQLException { database = dataBaseHelper.getWritableDatabase(); } public void close() { dataBaseHelper.close(); if (database.isOpen()) database.close(); } public Cursor queryAll() { return database.query( DATABASE_TABLE, null, null, null, null, null, _ID + " ASC"); } public Cursor queryById(String id) { return database.query( DATABASE_TABLE, null, _ID + " = ?", new String[]{id}, null, null, null, null); } public long insert(ContentValues values) { return database.insert(DATABASE_TABLE, null, values); } public int update(String id, ContentValues values) { return database.update(DATABASE_TABLE, values, _ID + " = ?", new String[]{id}); } public int deleteById(String id) { return database.delete(DATABASE_TABLE, _ID + " = ?", new String[]{id}); } }
aaa2ea363466466fac43d849d57bf3273b41c8af
141377646308d5659ec92730fb40e45d463c6dd8
/container/src/main/resources/com/douzone/container/config/user/Config.java
fc9baf5a93598f8d5e148e580dde34b34d3e64d8
[]
no_license
JeonJieun/spring-practices
ed20cd0b000944fb907acb7adcca674e14408988
7bca2e13d40a39be7fb70f939dca83740a267962
refs/heads/master
2023-08-30T23:04:25.065510
2021-10-28T10:46:16
2021-10-28T10:46:16
417,350,278
0
0
null
null
null
null
UTF-8
Java
false
false
69
java
package com.douzone.container.config.user; public class Config { }
665d99df538ebec8203f2777281aed6c605c663b
baae803dd03964504ef27c22ecac51ca5a80dec3
/src/protocolmeet/index.java
58bae842fe4e515ae90813683b9331876d709be5
[]
no_license
Juan-Pablo-20/Simulador-de-Protocolmeet
9e8c079bf946d1356093d396567c490c6e770b8d
5b9f4e1ae7dcffd35fab5f9d2015423f79bf28ab
refs/heads/master
2023-02-17T12:06:39.884412
2021-01-19T19:50:16
2021-01-19T19:50:16
312,659,194
0
0
null
null
null
null
UTF-8
Java
false
false
27,017
java
package protocolmeet; import com.j256.ormlite.dao.Dao; import com.j256.ormlite.dao.DaoManager; import com.j256.ormlite.jdbc.JdbcConnectionSource; import com.j256.ormlite.support.ConnectionSource; import java.awt.Color; import java.awt.Font; import java.awt.Image; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.ImageIcon; import javax.swing.JComboBox; import javax.swing.JLabel; /** * * @author Juan Pablo Ballesteros Obando Software diseñado para el registro de * personas que asisten a eucaristias a las parroquias de Colombia según la hora * y la fecha que dessen, ofreciendo una encuesta para conocer el estado de * salud de las personas */ /* 1. Corregir lo de las tildes en las barra de busqueda */ public class index extends javax.swing.JFrame { static Dao<persona, Long> base; static Dao<parroquia, Long> base2; static Dao<asistencia, String> base3; private int j = 0; static boolean visible = true; static String nombPq2; static String nombPq3; static boolean buscado; static JComboBox combo = new JComboBox(); static String titleBtn; public index() { initComponents(); this.setLocationRelativeTo(null); this.setResizable(false); entrada.setText("Busca por ciudad o parroquia..."); entrada.setForeground(Color.gray); combo.setBounds(30, 20, 287, 30); panelGrande.setOpaque(false); combo(); mostrarPanel(); comboListen(); buscaListen(); } @Override public Image getIconImage() { Image retValue = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("imagenes/ico.png")); return retValue; } public void combo() { combo.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 13)); jPanel3.setLayout(null); try { combo.removeAllItems(); for (parroquia pa : base2.queryForAll()) { combo.addItem(pa.getNombreP()); System.out.println("EL NIT ES " + pa.getNit()); System.out.println("LA CONTRASEÑA " + pa.getPass()); } jPanel3.add(combo); } catch (SQLException ex) { Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex); } } private void mostrarPanel() { try { if (base2.countOf() != 0) { int i = 0; for (parroquia pr : base2.queryForAll()) { Panel pa = new Panel(); if (i < 4) { pa.paneles(i, j, pr.getNombreP(), pr.getDirecc(), pr.getDiocesis(), pr.getParroco()); listen(); Panel.nombres[i] = pr.getNombreP(); } j += 330; i++; panelGrande.add(Panel.panel); } } else { JLabel adLabel = new JLabel(); adLabel.setBounds(0, 40, 500, 50); adLabel.setText("¡No hay parroquias registradas actualmente!"); adLabel.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 20)); panelGrande.add(adLabel); } } catch (SQLException ex) { Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex); } } public void listen() { ActionListener accionBtn = (ActionEvent evento) -> { //esta es una forma actual (2020) de escribir ActionListener, sin su metodo ActionPerformed evento.setSource(Panel.botones[0]); //esto solo lo pongo aca para que me deje funcionar todos los botones de cada panel y no solo uno if (evento.getSource() == Panel.botones[0]) { nombPq2 = Panel.nombres[0]; titleBtn = "Quiero asistir"; visible = false; reservar rv = new reservar(); rv.pintar("Cedula", "Contraseña", "Volver", "Ingresar", "No estoy registrado"); rv.setVisible(true); this.hide(); /*puse este metodo listen(); aca en index.java y no en el objeto Panel.java para que me funcionen bien todos los botones y para que se cierren y abran las ventanas correspondientes*/ } }; ActionListener accionBtn2 = (ActionEvent evento) -> { evento.setSource(Panel.botones[1]); if (evento.getSource() == Panel.botones[1]) { nombPq2 = Panel.nombres[1]; titleBtn = "Quiero asistir"; visible = false; reservar rv = new reservar(); rv.pintar("Cedula", "Contraseña", "Volver", "Ingresar", "No estoy registrado"); rv.setVisible(true); this.hide(); } }; ActionListener accionBtn3 = (ActionEvent evento) -> { evento.setSource(Panel.botones[2]); if (evento.getSource() == Panel.botones[2]) { nombPq2 = Panel.nombres[2]; titleBtn = "Quiero asistir"; visible = false; reservar rv = new reservar(); rv.pintar("Cedula", "Contraseña", "Volver", "Ingresar", "No estoy registrado"); rv.setVisible(true); this.hide(); } }; ActionListener accionBtn4 = (ActionEvent evento) -> { evento.setSource(Panel.botones[3]); if (evento.getSource() == Panel.botones[3]) { nombPq2 = Panel.nombres[3]; titleBtn = "Quiero asistir"; visible = false; reservar rv = new reservar(); rv.pintar("Cedula", "Contraseña", "Volver", "Ingresar", "No estoy registrado"); rv.setVisible(true); this.hide(); } }; Panel.botones[0].addActionListener(accionBtn); Panel.botones[1].addActionListener(accionBtn2); Panel.botones[2].addActionListener(accionBtn3); Panel.botones[3].addActionListener(accionBtn4); } public void comboListen() { ItemListener itm = new ItemListener() { Panel pb = new Panel(); @Override public void itemStateChanged(ItemEvent e) { if (visible == true) { buscado = true; panelGrande.removeAll();//para "remover" el contenido del panel panelGrande.setVisible(false); try { String igls = ""; try { igls = combo.getSelectedItem().toString(); } catch (Exception ec) { mostrarPanel(); } nombPq3 = igls; for (parroquia pq : base2.queryForAll()) { if (pq.getNombreP().equals(igls)) { pb.paneles(0, 0, pq.getNombreP(), pq.getDirecc(), pq.getDiocesis(), pq.getParroco()); panelGrande.add(Panel.panel); listen();//este metodo siempre debe estar junto a paneles(); } } } catch (SQLException ex) { Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex); } panelGrande.setVisible(true);//para desaparecerlo y hacerlo aparecer vacio nuevamente } } }; combo.addItemListener(itm); } private void buscaListen() { KeyListener buscar = new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { } @Override public void keyReleased(KeyEvent e) { buscado = true;//para definir que si se uso la caja de texto int k = 0; int lon = 0; if (!entrada.getText().equals("")) { panelGrande.removeAll(); panelGrande.setVisible(false); k = 0; lon = 0; lon = entrada.getText().length(); String en = entrada.getText(); String[] st = new String[lon]; for (int i = 0; i < lon; i++) { k = 0; st[i] = en.substring(0, lon); try { for (parroquia b : base2.queryForAll()) { try { if (b.getNombreP().substring(0, lon).equalsIgnoreCase(st[i]) || b.getCiudad().substring(0, lon).equalsIgnoreCase(st[i])) { nombPq3 = b.getNombreP(); panelGrande.setVisible(true); Panel p = new Panel(); p.paneles(0, k, b.getNombreP(), b.getDirecc(), b.getDiocesis(), b.getParroco()); panelGrande.add(Panel.panel); listen(); k += 330; } } catch (Exception exc) { } } } catch (SQLException ex) { Logger.getLogger(index.class.getName()).log(Level.SEVERE, null, ex); } } } else { panelGrande.removeAll(); panelGrande.setVisible(false); panelGrande.setVisible(true); mostrarPanel(); } } }; entrada.addKeyListener(buscar); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); jButton2 = new javax.swing.JButton(); entrada = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jButton6 = new javax.swing.JButton(); jButton7 = new javax.swing.JButton(); panelGrande = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jLabel3 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Bienvenido"); setIconImage(getIconImage()); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel1.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Protocolmeet"); getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 30, -1, -1)); jPanel3.setBackground(new java.awt.Color(255, 255, 255)); jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jButton2.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/reservasBtn.png"))); // NOI18N jButton2.setContentAreaFilled(false); jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jButton2MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jButton2MouseExited(evt); } }); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); entrada.setToolTipText(""); entrada.setName(""); // NOI18N entrada.setOpaque(false); entrada.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { entradaMouseClicked(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { entradaMouseExited(evt); } }); entrada.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { entradaActionPerformed(evt); } }); jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/lupa.png"))); // NOI18N javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap(371, Short.MAX_VALUE) .addComponent(entrada, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel4) .addGap(75, 75, 75) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32)) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addGap(16, 16, 16) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(entrada) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(16, Short.MAX_VALUE)) ); getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(29, 86, 960, 70)); jButton6.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/regisBtn.png"))); // NOI18N jButton6.setBorder(null); jButton6.setContentAreaFilled(false); jButton6.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton6.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jButton6MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jButton6MouseExited(evt); } }); jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); } }); getContentPane().add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(45, 540, 270, 60)); jButton7.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/salirBtn.png"))); // NOI18N jButton7.setBorder(null); jButton7.setContentAreaFilled(false); jButton7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton7.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jButton7MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jButton7MouseExited(evt); } }); jButton7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton7ActionPerformed(evt); } }); getContentPane().add(jButton7, new org.netbeans.lib.awtextra.AbsoluteConstraints(1035, 540, 270, 60)); javax.swing.GroupLayout panelGrandeLayout = new javax.swing.GroupLayout(panelGrande); panelGrande.setLayout(panelGrandeLayout); panelGrandeLayout.setHorizontalGroup( panelGrandeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1280, Short.MAX_VALUE) ); panelGrandeLayout.setVerticalGroup( panelGrandeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 367, Short.MAX_VALUE) ); getContentPane().add(panelGrande, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 168, 1280, -1)); jButton1.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/editBtn.png"))); // NOI18N jButton1.setBorder(null); jButton1.setContentAreaFilled(false); jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jButton1MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jButton1MouseExited(evt); } }); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(375, 540, 270, 60)); jButton3.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/asisBtn.png"))); // NOI18N jButton3.setBorder(null); jButton3.setContentAreaFilled(false); jButton3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseEntered(java.awt.event.MouseEvent evt) { jButton3MouseEntered(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jButton3MouseExited(evt); } }); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); getContentPane().add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(705, 540, 270, 60)); jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/ico.png"))); // NOI18N getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(1100, 30, 130, 120)); jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/fondo.jpg"))); // NOI18N getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1350, 640)); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed regisParr vr = new regisParr(); vr.setVisible(true); visible = false; this.hide(); }//GEN-LAST:event_jButton6ActionPerformed private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed System.exit(0); }//GEN-LAST:event_jButton7ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed titleBtn = "Editar parroquia"; reservar rv = new reservar(); rv.pintar("NIT de la parroquia", "Contraseña", "Volver", "Entrar", "Registrar parroquia"); rv.setVisible(true); this.hide(); visible = false; }//GEN-LAST:event_jButton1ActionPerformed private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed titleBtn = "Asistencia"; reservar as = new reservar(); as.pintar("Nit de la parroquia", "Contraseña", "Volver", "Ver asistencia", "Soy colaborador"); as.setVisible(true); this.hide(); visible = false; }//GEN-LAST:event_jButton3ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed titleBtn = "Ver mis reservas"; reservar vmr = new reservar(); vmr.pintar("Cedula", "Contraseña", "Volver", "Ver reservas", "No estoy registrado"); vmr.setVisible(true); this.hide(); visible = false; }//GEN-LAST:event_jButton2ActionPerformed private void entradaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_entradaActionPerformed }//GEN-LAST:event_entradaActionPerformed private void jButton6MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton6MouseEntered jButton6.setBounds(jButton6.getX(), jButton6.getY() - 7, 270, 60); }//GEN-LAST:event_jButton6MouseEntered private void jButton6MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton6MouseExited jButton6.setBounds(jButton6.getX(), jButton6.getY() + 7, 270, 60); }//GEN-LAST:event_jButton6MouseExited private void jButton1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseEntered jButton1.setBounds(jButton1.getX(), jButton1.getY() - 7, 270, 60); }//GEN-LAST:event_jButton1MouseEntered private void jButton1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseExited jButton1.setBounds(jButton1.getX(), jButton1.getY() + 7, 270, 60); }//GEN-LAST:event_jButton1MouseExited private void jButton3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseEntered jButton3.setBounds(jButton3.getX(), jButton3.getY() - 7, 270, 60); }//GEN-LAST:event_jButton3MouseEntered private void jButton3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseExited jButton3.setBounds(jButton3.getX(), jButton3.getY() + 7, 270, 60); }//GEN-LAST:event_jButton3MouseExited private void jButton7MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton7MouseEntered jButton7.setBounds(jButton7.getX(), jButton7.getY() - 7, 270, 60); }//GEN-LAST:event_jButton7MouseEntered private void jButton7MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton7MouseExited jButton7.setBounds(jButton7.getX(), jButton7.getY() + 7, 270, 60); }//GEN-LAST:event_jButton7MouseExited private void jButton2MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseEntered jButton2.setRolloverIcon(new ImageIcon(index.class.getResource("/imagenes/reservasBtnO.png"))); }//GEN-LAST:event_jButton2MouseEntered private void jButton2MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseExited jButton2.setRolloverIcon(new ImageIcon(index.class.getResource("/imagenes/reservasBtn.png"))); }//GEN-LAST:event_jButton2MouseExited private void entradaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_entradaMouseClicked entrada.setFocusable(true); entrada.setText(""); entrada.setForeground(Color.black); }//GEN-LAST:event_entradaMouseClicked private void entradaMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_entradaMouseExited if (entrada.getText().equals("")) { entrada.setText("Busca por ciudad o parroquia..."); entrada.setForeground(Color.gray); entrada.setFocusable(false); } }//GEN-LAST:event_entradaMouseExited public static void main(String args[]) throws SQLException { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(index.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } String archivo = "jdbc:h2:./baseDatosPerson"; ConnectionSource conexion = new JdbcConnectionSource(archivo); base = DaoManager.createDao(conexion, persona.class); String archivoDos = "jdbc:h2:./baseParroquia2"; ConnectionSource conexion2 = new JdbcConnectionSource(archivoDos); base2 = DaoManager.createDao(conexion2, parroquia.class); String archivo3 = "jdbc:h2:./baseDatosAsist"; ConnectionSource conexion3 = new JdbcConnectionSource(archivo3); base3 = DaoManager.createDao(conexion3, asistencia.class); java.awt.EventQueue.invokeLater(() -> { new index().setVisible(true); }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTextField entrada; private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton6; private javax.swing.JButton jButton7; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JPanel jPanel3; private javax.swing.JPanel panelGrande; // End of variables declaration//GEN-END:variables }
4ee4dec55146b676c6c920a3008def8dc8d1ad70
9b8a86c9d2d212dbbfcc83103769654f959863fe
/src/main/java/com/config/HiberConfig.java
3a7e51b8a4da7cd34adc8b7f460f448d07bba820
[]
no_license
vishlesh319/backend
84e03a036a48c81406bc36b912d61efcdd0b7316
da0e7f42434e787d20d14e33dec1a2174d3ab3ac
refs/heads/master
2021-04-03T05:31:27.269122
2018-03-14T07:25:47
2018-03-14T07:25:47
125,171,719
0
0
null
null
null
null
UTF-8
Java
false
false
3,817
java
package com.config; import java.util.Properties; import javax.sql.DataSource; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.orm.hibernate5.HibernateTransactionManager; import org.springframework.orm.hibernate5.LocalSessionFactoryBuilder; import org.springframework.transaction.annotation.EnableTransactionManagement; import com.dao.*; import com.daoimpl.*; import com.model.*; @Configuration @ComponentScan("com") @EnableTransactionManagement public class HiberConfig { @Autowired @Bean(name="datasource") public DataSource getH2Data() { DriverManagerDataSource dsource=new DriverManagerDataSource(); dsource.setDriverClassName("org.h2.Driver"); dsource.setUrl("jdbc:h2:tcp://localhost/~/HOMEDECORS1backend"); dsource.setUsername("sa"); dsource.setPassword(""); System.out.println("H2 connected"); return dsource; } private Properties getHiber() { Properties p= new Properties(); p.put("hibernate.dialect","org.hibernate.dialect.H2Dialect");//hibernate knows what kind of lang is to be use to talk to DBC p.put("hibernate.hbm2ddl.auto","update"); p.put("hibernate.show_sql","true"); System.out.println("Hibernate Config"); return p; } @Autowired @Bean(name="sessionFactory") public SessionFactory getHibersession(DataSource datasource) { LocalSessionFactoryBuilder lsfb= new LocalSessionFactoryBuilder(datasource); lsfb.addProperties(getHiber()); lsfb.addAnnotatedClass(User.class);// mapping classes mapping model objects lsfb.addAnnotatedClass(Supplier.class); lsfb.addAnnotatedClass(Category.class); lsfb.addAnnotatedClass(Product.class); lsfb.addAnnotatedClass(Cart.class); lsfb.addAnnotatedClass(Address.class); lsfb.addAnnotatedClass(Orders.class); lsfb.addAnnotatedClass(Payment.class); return lsfb.buildSessionFactory(); } @Autowired @Bean(name="transactionManager") public HibernateTransactionManager getTrans(SessionFactory sessionFactory) { HibernateTransactionManager tm= new HibernateTransactionManager(sessionFactory); return tm; } @Autowired @Bean(name = "userDAO") public UserDAO getUserDAO(SessionFactory sessionFactory) { return new UserDAOImpl(sessionFactory); } @Autowired @Bean(name = "supplierDAO") public SupplierDAO saveSuppData(SessionFactory sessionFactory) { return new SupplierDAOImpl(sessionFactory); } @Autowired @Bean(name = "categoryDAO") public CategoryDAO saveCatData(SessionFactory sessionFactory) { return new CategoryDAOImpl(sessionFactory); } @Autowired @Bean(name = "productDAO") public ProductDAO saveProduct(SessionFactory sessionFactory) { return new ProductDAOImpl(sessionFactory); } @Autowired @Bean(name="cartDAO") public CartDAO getCart(SessionFactory sessionFactory) { return new CartDAOImpl(sessionFactory); } @Autowired @Bean(name = "addressDAO") public AddressDAO getAddressDAO(SessionFactory sessionFactory) { return new AddressDAOImpl(sessionFactory); } @Autowired @Bean(name = "orderDAO") public OrdersDAO getOrdersDAO(SessionFactory sessionFactory) { return new OrdersDAOImpl(sessionFactory); } @Autowired @Bean(name = "paymentDAO") public PaymentDAO getPaymentDAO(SessionFactory sessionFactory) { return new PaymentDAOImpl(sessionFactory); } }
f1c816c6009b682010d8ef17daf6ba5d9bb80360
bfc56b6be5b78daa348ff1be8b9b95b5968ac99b
/src/main/test/br/com/semcodar/integration/CustomerEndpointTest.java
31fd3a12320d8749bf764de8ba59359253a55cda
[]
no_license
fabriciossouza/integration-services
4553b4b62c5ed0a7b86cc7efb0d2c81b1098605a
f5e22bd6700b21430e11c2c893d021fe1623f33e
refs/heads/master
2022-12-26T14:39:13.453762
2020-07-17T20:00:56
2020-07-17T20:00:56
280,514,395
0
0
null
2020-10-13T23:40:09
2020-07-17T20:01:48
Java
UTF-8
Java
false
false
1,118
java
package br.com.semcodar.integration; import org.junit.Before; import org.junit.Test; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; public class CustomerEndpointTest extends AbstractTest{ @Override @Before public void setUp() { super.setUp(); } @Test public void shouldReturnAllCustomers() throws Exception { String uri = "/rs/customers"; String jsonExpected = "[{'id':1,'name':'Jose Maria','cpf':'05249509545','rg':'564565550','age':19},{'id':2,'name':'Felipe Santos','cpf':'73156073741','rg':'54345559','age':24},{'id':3,'name':'Ronaldo Jose','cpf':'49576402891','rg':'8459450004','age':46}]"; mvc.perform(MockMvcRequestBuilders.get(uri) .accept(MediaType.APPLICATION_JSON_VALUE)) .andExpect(status().isOk()) .andExpect(content().json(jsonExpected)); } }
6c4c38c20b0650a6bc8408c4425f3423efe73ccb
dcd7b673962ee97781edc1318544df8f2a55bad7
/carrito/carrito-ejb/src/main/java/com/mycompany/interfaces/ProductoFacadeLocal.java
e76ed61bb23e16ac79c2f11a6bd76463bb8568e7
[]
no_license
HernanYohan/carrito
33d78dce4cff7237670512acc0e7ddef6dd074c2
defedf5e57126825538de07cfbb029b456008fa7
refs/heads/master
2022-08-11T21:37:52.848076
2019-10-02T20:30:40
2019-10-02T20:30:40
211,501,801
0
0
null
2022-07-06T20:47:14
2019-09-28T13:06:57
Java
UTF-8
Java
false
false
654
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.mycompany.interfaces; import com.mycompany.entity.Producto; import java.util.List; import javax.ejb.Local; /** * * @author Hernan */ @Local public interface ProductoFacadeLocal { void create(Producto producto); void edit(Producto producto); void remove(Producto producto); Producto find(Object id); List<Producto> findAll(); List<Producto> findRange(int[] range); int count(); }
c69df00a4e851a9c02fefb88485ade72908aaf56
ad33b778118be4a59d6a7b17e135376a08247a53
/Android/doraemonkit/src/main/java/com/didichuxing/doraemonkit/kit/alignruler/AlignRulerMarkerDokitView.java
c748f72451242215108df8d4b913a682a8eb7933
[ "Apache-2.0" ]
permissive
KnightGuard/DoraemonKit
50b96e4db68344b3085e39c601c8cb70a705440f
a1107c585b2f32d764c5a74735cd0135d56b4dd1
refs/heads/master
2021-03-26T13:26:41.418193
2020-03-16T06:52:24
2020-03-16T06:52:24
247,708,079
1
1
Apache-2.0
2020-03-16T13:22:48
2020-03-16T13:22:47
null
UTF-8
Java
false
false
4,033
java
package com.didichuxing.doraemonkit.kit.alignruler; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; import android.widget.FrameLayout; import com.didichuxing.doraemonkit.DoraemonKit; import com.didichuxing.doraemonkit.R; import com.didichuxing.doraemonkit.ui.base.AbsDokitView; import com.didichuxing.doraemonkit.ui.base.DokitViewLayoutParams; import com.didichuxing.doraemonkit.util.UIUtils; import java.util.ArrayList; import java.util.List; /** * Created by jintai on 2019/09/26. */ public class AlignRulerMarkerDokitView extends AbsDokitView { private List<OnAlignRulerMarkerPositionChangeListener> mPositionChangeListeners = new ArrayList<>(); @Override public View onCreateView(Context context, FrameLayout view) { return LayoutInflater.from(context).inflate(R.layout.dk_float_align_ruler_marker, null); } @Override public void onViewCreated(FrameLayout view) { } @Override public void initDokitViewLayoutParams(DokitViewLayoutParams params) { params.height = DokitViewLayoutParams.WRAP_CONTENT; params.width = DokitViewLayoutParams.WRAP_CONTENT; params.x = UIUtils.getWidthPixels() / 2; params.y = UIUtils.getHeightPixels() / 2; } @Override public void onCreate(Context context) { } @Override public void onDestroy() { super.onDestroy(); removePositionChangeListeners(); } @Override public void onMove(int x, int y, int dx, int dy) { super.onMove(x, y, dx, dy); for (OnAlignRulerMarkerPositionChangeListener listener : mPositionChangeListeners) { if (isNormalMode()) { listener.onPositionChanged(getNormalLayoutParams().leftMargin + getRootView().getWidth() / 2, getNormalLayoutParams().topMargin + getRootView().getHeight() / 2); } else { listener.onPositionChanged(getSystemLayoutParams().x + getRootView().getWidth() / 2, getSystemLayoutParams().y + getRootView().getHeight() / 2); } } } @Override public void updateViewLayout(String tag, boolean isActivityResume) { super.updateViewLayout(tag, isActivityResume); //更新标尺的位置信息 for (OnAlignRulerMarkerPositionChangeListener listener : mPositionChangeListeners) { if (isNormalMode()) { listener.onPositionChanged(getNormalLayoutParams().leftMargin + getRootView().getWidth() / 2, getNormalLayoutParams().topMargin + getRootView().getHeight() / 2); } else { listener.onPositionChanged(getSystemLayoutParams().x + getRootView().getWidth() / 2, getSystemLayoutParams().y + getRootView().getHeight() / 2); } } } public interface OnAlignRulerMarkerPositionChangeListener { void onPositionChanged(int x, int y); } public void addPositionChangeListener(OnAlignRulerMarkerPositionChangeListener positionChangeListener) { mPositionChangeListeners.add(positionChangeListener); //更新标尺的位置信息 for (OnAlignRulerMarkerPositionChangeListener listener : mPositionChangeListeners) { if (isNormalMode()) { listener.onPositionChanged(getNormalLayoutParams().leftMargin + getRootView().getWidth() / 2, getNormalLayoutParams().topMargin + getRootView().getHeight() / 2); } else { listener.onPositionChanged(getSystemLayoutParams().x + getRootView().getWidth() / 2, getSystemLayoutParams().y + getRootView().getHeight() / 2); } } } public void removePositionChangeListener(OnAlignRulerMarkerPositionChangeListener positionChangeListener) { mPositionChangeListeners.remove(positionChangeListener); } private void removePositionChangeListeners() { mPositionChangeListeners.clear(); } @Override public boolean restrictBorderline() { return false; } }
dc5bd4596ebe8002512ce0eb4b0b63e5da6149ae
4d420e53c2bb7ab33f566530ecb43201f17b7135
/com.poolborges.example.jboss/com.poolborges.example.microcontainer/src/test/java/com/poolborges/example/microcontainer/AppTest.java
91483aff991963f383c9fd39d15b6929b694044d
[]
no_license
poolborges/com-poolborges-example
ab1c0210a906bca1590e93478af3bb356f1d2794
5454df67a87f14c54a38bad7941177884e0154a4
refs/heads/master
2021-07-11T10:26:53.312231
2020-07-31T10:54:00
2020-07-31T10:54:00
3,800,563
1
0
null
2020-07-31T10:54:01
2012-03-22T18:01:23
Java
UTF-8
Java
false
false
665
java
package com.poolborges.example.microcontainer; 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 ); } }
3bff64ad115377a69ba2e8f4672f1c57418a03eb
f72debfddd0bfce0b7e94bcb912c3269b710ee46
/spring_web_mvc/java-servlet-demo/src/main/java/me/yjs/WebApplication.java
6432536aab1499926dcbc7f8cec309679e5d8926
[]
no_license
yjs2952/inflearn_study
c2d965cbcbd8ddd6ee1fdfe33934072b0b253ab4
cad959441af8dfea41fbdf1adcbc7576d59f3b2d
refs/heads/master
2022-12-21T20:52:21.639859
2020-02-18T15:52:38
2020-02-18T15:52:38
175,658,593
0
0
null
2022-12-15T23:47:41
2019-03-14T16:21:54
Java
UTF-8
Java
false
false
993
java
package me.yjs; import org.springframework.web.WebApplicationInitializer; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.servlet.DispatcherServlet; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRegistration; public class WebApplication implements WebApplicationInitializer { @Override public void onStartup(ServletContext servletContext) throws ServletException { AnnotationConfigWebApplicationContext ac = new AnnotationConfigWebApplicationContext(); // ac.setServletContext(servletContext); // servletContext를 참조하기 때문에 반드시 설정해야 한다. ac.register(WebConfig.class); ac.refresh(); DispatcherServlet dispatcherServlet = new DispatcherServlet(ac); ServletRegistration.Dynamic app = servletContext.addServlet("app", dispatcherServlet); app.addMapping("/app/*"); } }
ad7c55da9aa0763946ecf5b226529e7f7e54ec31
ea24f671d967819d1a71e98f1312f73e3b9b9ee9
/konstrukcja_ssuer/Pielegniarka.java
ad7a258163fe816530ef2a6b97d8b13286b912e4
[]
no_license
Pawlik123/repo
2263b53077e20cd0863ab1bc49c79dcda080fd0c
5d8d351a818d119088cae65dd513f263a1d0b959
refs/heads/master
2020-04-25T05:39:51.746435
2020-02-06T11:21:39
2020-02-06T11:21:39
172,550,946
0
0
null
null
null
null
WINDOWS-1250
Java
false
false
337
java
package konstrukcja_ssuer; public class Pielegniarka extends Pracownik{ private int nadgodziny; public Pielegniarka(String imie, String nazwisko,double wypłata){ super(imie,nazwisko,wypłata); nadgodziny=0; } public int getNadgodziny() { return nadgodziny; } public void setNadgodziny(int n) { nadgodziny +=n; } }
4b2e8f7b71f57a205b93b1c0103b7a143e11dc06
59ea1498eb3e577f6f5c0769260169c56849c5de
/latte-core/src/main/java/com/lxj/latte/ui/launcher/ILauncherListener.java
b7d8b257ee18cf8746fd48398395978d2dd887c5
[ "Apache-2.0" ]
permissive
chinaliuxiaojun/FestEC
ea2889c058ee1bf03d714e29772581805cd4e323
db9268425151b130c1744976e8f25cf711510e83
refs/heads/master
2020-03-19T16:14:49.803040
2018-06-19T14:32:57
2018-06-19T14:32:57
136,707,457
0
0
null
null
null
null
UTF-8
Java
false
false
244
java
package com.lxj.latte.ui.launcher; /** * Created by lxj on 2018/6/19. * 轮播时间监听 */ public interface ILauncherListener { /** * 轮播是否完成 **/ void onLauncherFinsh(OnLauncherFinshTag tag); }
0435d51557ea4d53c5909528b3652fbeb11bcba3
4688d19282b2b3b46fc7911d5d67eac0e87bbe24
/aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/model/CreateImageBuilderStreamingURLRequest.java
e0a22b96e224741464a6a153e6a1818097a70547
[ "Apache-2.0" ]
permissive
emilva/aws-sdk-java
c123009b816963a8dc86469405b7e687602579ba
8fdbdbacdb289fdc0ede057015722b8f7a0d89dc
refs/heads/master
2021-05-13T17:39:35.101322
2018-12-12T13:11:42
2018-12-12T13:11:42
116,821,450
1
0
Apache-2.0
2018-09-19T04:17:41
2018-01-09T13:45:39
Java
UTF-8
Java
false
false
5,572
java
/* * Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.appstream.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateImageBuilderStreamingURL" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateImageBuilderStreamingURLRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The name of the image builder. * </p> */ private String name; /** * <p> * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The * default is 3600 seconds. * </p> */ private Long validity; /** * <p> * The name of the image builder. * </p> * * @param name * The name of the image builder. */ public void setName(String name) { this.name = name; } /** * <p> * The name of the image builder. * </p> * * @return The name of the image builder. */ public String getName() { return this.name; } /** * <p> * The name of the image builder. * </p> * * @param name * The name of the image builder. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageBuilderStreamingURLRequest withName(String name) { setName(name); return this; } /** * <p> * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The * default is 3600 seconds. * </p> * * @param validity * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. * The default is 3600 seconds. */ public void setValidity(Long validity) { this.validity = validity; } /** * <p> * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The * default is 3600 seconds. * </p> * * @return The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. * The default is 3600 seconds. */ public Long getValidity() { return this.validity; } /** * <p> * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. The * default is 3600 seconds. * </p> * * @param validity * The time that the streaming URL will be valid, in seconds. Specify a value between 1 and 604800 seconds. * The default is 3600 seconds. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageBuilderStreamingURLRequest withValidity(Long validity) { setValidity(validity); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getValidity() != null) sb.append("Validity: ").append(getValidity()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateImageBuilderStreamingURLRequest == false) return false; CreateImageBuilderStreamingURLRequest other = (CreateImageBuilderStreamingURLRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getValidity() == null ^ this.getValidity() == null) return false; if (other.getValidity() != null && other.getValidity().equals(this.getValidity()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getValidity() == null) ? 0 : getValidity().hashCode()); return hashCode; } @Override public CreateImageBuilderStreamingURLRequest clone() { return (CreateImageBuilderStreamingURLRequest) super.clone(); } }
[ "" ]
2149471102deb4c5e17358c578d3ec2495db55c0
05b232cef1358446d2e17eb6a07382824cc9024f
/app/src/test/java/com/example/echomax/justjavaappupdated/ExampleUnitTest.java
47f1d2a5c714a3a4ffb4cfb586be96aa5e4d788b
[]
no_license
Nyomax/JustJavaAppUpdated
392301b9b7d2a185d8014bc0fc21ba4136d0ca2d
14e92945c7517f4057b0bbe5fe7466ad92a2e23f
refs/heads/master
2020-03-22T02:07:59.456767
2018-07-01T18:19:25
2018-07-01T18:19:25
139,351,292
0
0
null
null
null
null
UTF-8
Java
false
false
399
java
package com.example.echomax.justjavaappupdated; 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); } }
81fbc0dfd1cab6c7dab34872d9f764c1b5e699c5
7d6d11603dc726834a7b5e2de4a7fd2f9c4a49ef
/Final Project/src/java/TestInput/Bean.java
56fef316d4259f845272a8c734d275e45d1ceb8e
[]
no_license
TomSedgman/FinalProject
ea1690575b53772ea39de719c96e58c53a69a6a6
ad2c1fba8336ca5e15f1efa03e311556fa3a5504
refs/heads/master
2021-01-20T05:31:52.946916
2014-09-30T14:46:52
2014-09-30T14:46:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,794
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package TestInput; import Entity.Nodes; import Entity.Projects; import PersistedVariables.PCoordinates; import PersistedVariables.PProject; import Session.DataValuesFacade; import Session.NodesFacade; import Session.ProjectsFacade; import com.google.gson.Gson; import com.google.gson.annotations.Expose; import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import javax.ejb.EJB; import javax.faces.bean.SessionScoped; /** * * @author t_sedgman */ @SessionScoped public class Bean { @EJB private DataValuesFacade dataValuesFacade; @EJB private NodesFacade nodesFacade; @EJB private ProjectsFacade projectsFacade; @EJB private PersistedVariables.PProjects projectList; @EJB private PersistedVariables.PProject currProject; @EJB private PersistedVariables.PNodes currentNodes; @EJB private PersistedVariables.PCoordinates coordinates; private String fileContent; private String fileContent2; private ArrayList<String> fileContentArray = new ArrayList<>();; private int counter = 0; public int getCounter() { return counter; } public void setCounter(int counter) { this.counter = counter; } public ArrayList<String> getFileContentArray() { return fileContentArray; } public void setFileContentArray(ArrayList<String> fileContentArray) { this.fileContentArray = fileContentArray; } public String getFileContent() { return fileContent; } public void setFileContent(String fileContent) { this.fileContent = fileContent; } public String getFileContent2() { return fileContent2; } public void setFileContent2(String fileContent2) { this.fileContent2 = fileContent2; } public void upload() { File file = new File("/Users/t_sedgman/Desktop/FinalProject/test_output_data_small.rtf"); FileInputStream fis = null; BufferedInputStream bis = null; DataInputStream dis = null; ArrayList<String> tempArray = new ArrayList<>(); try { fis = new FileInputStream(file); // Here BufferedInputStream is added for fast reading. bis = new BufferedInputStream(fis); dis = new DataInputStream(bis); // dis.available() returns 0 if the file does not have more lines. while (dis.available() != 0) { // this statement reads the line from the file and print it to // the console. tempArray.add(dis.readLine()); } // dispose all the resources after using them. fis.close(); bis.close(); dis.close(); setFileContentArray(tempArray); String tempString = tempArray.get(tempArray.size()-3); List<String> Record = Arrays.asList(tempString.split(",")); dataValuesFacade.RecordData(Record); for (int i = 8; i < tempArray.size();i++) //FIXME hack because of input headders; { fileContent = tempArray.get(i); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } public void next() { List returnedData = dataValuesFacade.findVariables(null, 0, 8); fileContent2 = returnedData.get(counter).toString(); counter++; } public void loadProject(String username) { List projects = projectsFacade.findProjectsByUser(username); projectList.setProjects(projects); } public void loadNodes(int index) { List projects = projectList.getProjects(); int i = index; Projects project = (Projects) projects.get(i); currProject.setCurrentProject(project); List<Nodes> nodes = nodesFacade.nodesList(project); currentNodes.setCurrentNodes(nodes); } public void GPSLat() { ArrayList gPSLat = new ArrayList(); List<Nodes> nodes = currentNodes.getCurrentNodes(); for (int i = 0; i < nodes.size();i++) { gPSLat.add(nodes.get(i).getgPSLat()); } coordinates.setGPSLat(gPSLat); } public void GPSLong() { ArrayList gPSLong = new ArrayList(); List<Nodes> nodes = currentNodes.getCurrentNodes(); for (int i = 0; i < nodes.size();i++) { gPSLong.add(nodes.get(i).getgPSLong()); } coordinates.setGPSLong(gPSLong); } public String CentrePoint() { List gpsLat = coordinates.getGPSLat(); List gpsLong = coordinates.getGPSLong(); Double centreLat = average(gpsLat); Double centreLong = average(gpsLong); String centre = centreLat.toString(); centre = centre.concat(" , "); centre = centre.concat(centreLong.toString()); return centre; } public static Double average(List<BigDecimal> list) { // 'average' is undefined if there are no elements in the list. if (list == null || list.isEmpty()) return 0.0; // Calculate the summation of the elements in the list Double sum = 0.0; int n = list.size(); // Iterating manually is faster than using an enhanced for loop. for (int i = 0; i < n; i++) { Double temp = list.get(i).doubleValue(); sum += temp; } // We don't want to perform an integer division, so the cast is mandatory. return ((Double) sum) / n; } }
23f8afe8acb3068ebb6c66514cf3e8b1c4694f36
173213fa4fdbdbb0c10592c9e2f19edef9313e14
/SRAFarmer/app/src/main/java/com/example/micha/srafarmer/Forum/ForumPostsAdapter.java
9cfbf3a66a625a022fbd3baefcc5a482d0b6b0a5
[]
no_license
jartantupjar/2-SRA-Mobile-App
2ddf9d96d26ac8f9e8ec321bebb8761e0a07ecf8
c5db5c2f301346f5c606ddfc204cb6c7d6075af5
refs/heads/master
2020-03-08T22:07:27.362278
2018-04-06T17:03:12
2018-04-06T17:03:12
128,422,592
0
0
null
null
null
null
UTF-8
Java
false
false
2,309
java
package com.example.micha.srafarmer.Forum; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CheckBox; import android.widget.TextView; import com.example.micha.srafarmer.Entity.Post; import com.example.micha.srafarmer.R; import java.util.ArrayList; public class ForumPostsAdapter extends RecyclerView.Adapter<ForumPostsAdapter.PostsViewHolder>{ ArrayList<Post> posts; public ForumPostsAdapter (ArrayList<Post> posts){ this.posts = posts;} @Override public PostsViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_posts, parent, false); return new PostsViewHolder(itemView); } @Override public void onBindViewHolder(PostsViewHolder holder, int position) { Post post = posts.get(position); holder.title.setText(post.getTitle()); holder.postedBy.setText("Posted By: "+ post.getFarmersName()+" " + post.getDatePosted()); holder.container.setTag(post); holder.container.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (mOnItemClickListener!=null){ Post p = (Post) view.getTag(); mOnItemClickListener.onItemClick(p); } } }); } @Override public int getItemCount() { return posts.size(); } public class PostsViewHolder extends RecyclerView.ViewHolder{ View container; TextView title, postedBy; public PostsViewHolder(View itemView) { super(itemView); container= itemView.findViewById(R.id.list_posts_container); title = (TextView) itemView.findViewById(R.id.list_posts_title); postedBy = (TextView) itemView.findViewById(R.id.list_posts_postedby); } } private OnItemClickListener mOnItemClickListener; public void setmOnItemClickListener(OnItemClickListener onItemClickListener){ mOnItemClickListener = onItemClickListener; } public interface OnItemClickListener{ public void onItemClick(Post post); } }