blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8e2a6b62cb85b3fe1ee85307d3528257006c849b | fc9ee3227e167f8b3283207a41802680490dc415 | /src/javafxmvc/MainVenda.java | ec8bd2396b8a55a51b571f61a77c87397a45ce3f | [] | no_license | LucasGobbs/javafx-SistemaVidracaria | 4d592842c61339f7db1805d0a8f1bc08c80372ca | c111e2f0456008a496f264bef3a7fa4da2ed9454 | refs/heads/master | 2022-11-27T22:17:27.669779 | 2020-08-10T03:44:08 | 2020-08-10T03:44:08 | 285,979,637 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 667 | java | package javafxmvc;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class MainVenda extends Application {
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("view/FXMLVenda.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setTitle("Sistema de Vendas (JavaFX MVC)");
stage.setResizable(false);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
| [
"llcostagobbi@gmail.com"
] | llcostagobbi@gmail.com |
d011fc54eda5668440b7ab470d1c3e575daf8fd6 | 678ca04590085153844262e345491e6e18eef882 | /src/main/java/com/foxconn/fii/data/primary/repository/TestCpkSyncConfigRepository.java | 8bd31527fd56c6c244dae7abf7f0b063d9b398cd | [] | no_license | nguyencuongat97/test_system | 1e0bbbc404598b9c17c91b04d12ce3f76de315fb | 6d655a202b1f6571e3022dc1c7cfb8cb7e696fd5 | refs/heads/master | 2023-01-21T03:34:07.174133 | 2020-11-24T04:23:09 | 2020-11-24T04:23:09 | 315,518,006 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package com.foxconn.fii.data.primary.repository;
import com.foxconn.fii.data.primary.model.entity.TestCpkSyncConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface TestCpkSyncConfigRepository extends JpaRepository<TestCpkSyncConfig, Long> {
List<TestCpkSyncConfig> findAllByFactory(String factory);
}
| [
"Administrator@V0990891-FII.vn.foxconn.com"
] | Administrator@V0990891-FII.vn.foxconn.com |
1536f9d944595104643f99d122087abdc99f7910 | 1112b050a19ef651879d9ce19ef7f8d64837bf1c | /Server/src/com/anu/Login.java | c9e328e89a04f2b371c68b23544c02e9803aa412 | [] | no_license | xfeier53/Snake | ffdf62279f7dc8aeda1967c5143d8950b5a17aba | ee077be462982384c51bacc5a5b43b066fd480ef | refs/heads/master | 2020-08-22T17:08:10.893425 | 2019-10-21T04:31:48 | 2019-10-21T04:31:48 | 216,443,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,070 | java | /*
Authorship: Feier Xiao
*/
package com.anu;
import java.sql.*;
public class Login {
public boolean userLogin(String account, String password){
boolean isLoginSuccessful = false;
String query = "SELECT * FROM AndroidUser WHERE Account = '" + account + "' and Password = '" + password + "'";
try{
// Get the driver class
Class.forName(CONSTANTS.DRIVER);
// Create connection and retrieve the result
Connection conn = DriverManager.getConnection(CONSTANTS.URL, CONSTANTS.USER, CONSTANTS.PASSWORD);
Statement stm = conn.createStatement();
ResultSet rs = stm.executeQuery(query);
if(rs.next()){
isLoginSuccessful = true;
}
// close Connection and ResultSet
rs.close();
stm.close();
conn.close();
}catch (Exception e) {
System.out.println(e);
}
if(isLoginSuccessful){
return true;
} else {
return false;
}
}
} | [
"u6609337@anu.edu.au"
] | u6609337@anu.edu.au |
546fcd353d1b3c226a8469d38a1983d990d98acc | da51dadb54086687353bedee1ad092a4cf53d5ae | /leetcode/94.二叉树的中序遍历.java | 4e36fecfa343fc3a8ba6c4ac996eb7eae9c98979 | [
"MIT"
] | permissive | liulixiang1988/algorithm | 9672d9fe65f58595a62050a21ab5dcf06e8c3635 | c58e5028651a3a124b90241720592f1a0c01a8fa | refs/heads/master | 2021-10-25T21:47:49.854983 | 2021-10-18T05:20:28 | 2021-10-18T05:20:28 | 199,172,561 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,232 | java | import java.util.ArrayList;
/*
* @lc app=leetcode.cn id=94 lang=java
*
* [94] 二叉树的中序遍历
*
* https://leetcode-cn.com/problems/binary-tree-inorder-traversal/description/
*
* algorithms
* Medium (68.57%)
* Likes: 309
* Dislikes: 0
* Total Accepted: 70.1K
* Total Submissions: 102.2K
* Testcase Example: '[1,null,2,3]'
*
* 给定一个二叉树,返回它的中序 遍历。
*
* 示例:
*
* 输入: [1,null,2,3]
* 1
* \
* 2
* /
* 3
*
* 输出: [1,3,2]
*
* 进阶: 递归算法很简单,你可以通过迭代算法完成吗?
*
*/
// @lc code=start
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
public List<Integer> inorderTraversal(TreeNode root) {
List<Integer> list = new ArrayList<>();
helper(root, list);
return list;
}
private void helper(TreeNode root, List<Integer> list) {
if (root == null) {
return;
}
helper(root.left, list);
list.add(root.val);
helper(root.right, list);
}
}
// @lc code=end
| [
"liulixiang1988@gmail.com"
] | liulixiang1988@gmail.com |
5490278106d8920d77043c4b30a1e3482f579e50 | 01089defe2f0d2baed6609c1128b0b91813f4053 | /src/main/java/com/github/dhaval_mehta/savetogoogledrive/config/SwaggerConfig.java | 8442d2030883cb11361f00fe055be2a11d598e8e | [
"MIT"
] | permissive | Riptide-11/cloud-transfer-backend | c695a388b0429bfa805887442fb94e33d30f306e | d49b210ddea079ea8ad0a6677895befbde9adfbd | refs/heads/master | 2022-12-04T15:41:19.501884 | 2020-08-25T14:37:12 | 2020-08-25T14:37:12 | 290,170,033 | 0 | 0 | MIT | 2020-08-25T09:18:11 | 2020-08-25T09:18:10 | null | UTF-8 | Java | false | false | 1,264 | java | package com.github.dhaval_mehta.savetogoogledrive.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2).useDefaultResponseMessages(false).select()
.apis(RequestHandlerSelectors
.basePackage("com.github.dhavalmehta1997.savetogoogledrive.controller.rest"))
.paths(PathSelectors.any()).build().apiInfo(apiInfo());
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("Save to Drive Rest API")
.description("It is a free to upload file from url directly to Google Drive.")
.contact(new Contact("Riptide", null, "supperlosser26@gmail.com")).version("1.0").build();
}
}
| [
"dhaval.mehta197@gmail.com"
] | dhaval.mehta197@gmail.com |
0b7a9482e96d0f9d8352029c7a69a5135bdf8a66 | 5b84c89465f85417573557b3d4fe0780cf16ae3d | /SCAS/src/java/controller/RelatorioCursosController.java | 101d9f509a1572c98653b0bd31ad7329bb764bfa | [] | no_license | AntonioCelestino/LP | 2f305a23765f16dbdeeeef99dacaf60568f9d1fc | 59d0e4ae5d029d8c9d26ddf1c61f9f094edebdd7 | refs/heads/master | 2021-01-20T19:34:02.631317 | 2017-01-17T13:13:04 | 2017-01-17T13:13:04 | 60,007,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,218 | java | package controller;
import dao.BD;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
public class RelatorioCursosController extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response){
Connection conexao = null;
try{
HashMap parametros = new HashMap();
conexao = BD.getConexao();
//parametro.put ("PAR_codCurso", Integer.parseInt(request.getParameter("txtCodCurso")));
String relatorio = getServletContext().getRealPath ("/WEB-INF")+"//RelatorioCursos.jasper";
JasperPrint jp = JasperFillManager.fillReport(relatorio, parametros, conexao);
byte[] relat = JasperExportManager.exportReportToPdf(jp);
response.setHeader("Content-Disposition", "attachment; filename=RelatorioCursos.pdf");
response.setContentType("application/pdf");
response.getOutputStream().write(relat);
} catch (SQLException ex){
ex.printStackTrace();
} catch (ClassNotFoundException ex){
ex.printStackTrace();
} catch (JRException ex){
ex.printStackTrace();
} catch (IOException ex){
ex.printStackTrace();
} finally{
try{
if (!conexao.isClosed()){
conexao.close();
}
} catch (SQLException ex){
}
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"celestinoweb@gmail.com"
] | celestinoweb@gmail.com |
9ec9d6580c17ec40051ad3b5372071465a77fdcb | 173fbf35be7b965cd1ee997eafcbfd0710bb6196 | /shua/src/leetcode26/Solution.java | c27fcbc6d325cb90a55e4dc0aaf877cc52cfa9cc | [] | no_license | ECNUIDT/mianshi | 74c9a101b762af6456963554844599762fdbb7f5 | e1d4240981625efb31f76a0991301b6f82574252 | refs/heads/master | 2020-03-28T19:43:07.585422 | 2018-09-16T14:52:11 | 2018-09-16T14:52:11 | 149,002,896 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 712 | java | package leetcode26;
import javax.sound.midi.Soundbank;
public class Solution {
public int removeDuplicates(int[] nums) {
if(nums.length<=0){
return 0;
}
int curr=nums[0];
int loc=1;
for(int i=1;i<=nums.length-1;i++){
if(nums[i]!=curr){
nums[loc++]=nums[i];
curr=nums[i];
}
}
return loc;
}
public static void main(String[] args) {
int[] nums={1,1};
Solution sol=new Solution();
int loc=sol.removeDuplicates(nums);
for(int k=0;k<loc;k++){
System.out.println(nums[k]);
}
System.out.println("length: "+loc);
}
}
| [
"248482914@qq.com"
] | 248482914@qq.com |
22de388964dcd5d6b5fda4c0be090b038d1f93f2 | 75907df9261478e35fe7d98d9857400f3fac01b4 | /src/UmlUpdate.java | 235b13d29701b69b64340acf0cfcfd906c9b3bf2 | [] | no_license | prime21/my-UML-parser | 4c7a1d406efc042f20f8ce172c3d0e0224c8f723 | 099aa8e048d22e5bdd4423d2745e42947e297c7a | refs/heads/master | 2020-05-30T03:39:14.191747 | 2019-06-02T09:38:30 | 2019-06-02T09:38:30 | 189,520,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,186 | java | import com.oocourse.uml1.models.common.Direction;
import com.oocourse.uml1.models.common.ElementType;
import com.oocourse.uml1.models.elements.UmlAssociation;
import com.oocourse.uml1.models.elements.UmlAssociationEnd;
import com.oocourse.uml1.models.elements.UmlGeneralization;
import com.oocourse.uml1.models.elements.UmlInterfaceRealization;
import com.oocourse.uml1.models.elements.UmlParameter;
public class UmlUpdate {
private static void updopt(UmlTreeNode now) {
for (UmlTreeNode nxt: now.getSons()) {
if (((UmlParameter)nxt.getElm()).
getDirection().equals(Direction.RETURN)) {
((UmlOptNode)now).markRet();
}
else {
((UmlOptNode) now).markPar();
}
}
}
private static void updass(UmlTreeNode now) {
String end1 = ((UmlAssociation)now.getElm()).getEnd1();
String end2 = ((UmlAssociation)now.getElm()).getEnd2();
UmlTreeNode e1 =
NodePool.getInstance().get(Idmap.getInstance().get(end1));
e1 = NodePool.getInstance().get(Idmap.getInstance().get(
((UmlAssociationEnd)e1.getElm()).getReference()
));
UmlTreeNode e2 =
NodePool.getInstance().get(Idmap.getInstance().get(end2));
e2 = NodePool.getInstance().get(Idmap.getInstance().get(
((UmlAssociationEnd)e2.getElm()).getReference()
));
//System.out.println(e1.getElm().getName() + " " + e2.getElm().getName());
if (e1.getType().equals(ElementType.UML_CLASS)) {
((UmlClassNode) e1).add(e2);
}
else {
((UmlItfNode)e1).addinter(e2);
}
if (e2.getType().equals(ElementType.UML_CLASS)) {
((UmlClassNode) e2).add(e1);
}
else {
((UmlItfNode)e2).addinter(e1);
}
}
private static void updcls(UmlTreeNode now) {
for (UmlTreeNode nxt: now.getSons()) {
switch (nxt.getType()) {
case UML_ATTRIBUTE:
case UML_OPERATION:
((UmlClassNode)now).add(nxt);
break;
default:
break;
}
}
}
private static void updgen(UmlTreeNode now) {
UmlGeneralization g = (UmlGeneralization)(now.getElm());
int src = Idmap.getInstance().get(g.getSource());
int tar = Idmap.getInstance().get(g.getTarget());
UmlTreeNode e1 = NodePool.getInstance().get(src);
UmlTreeNode e2 = NodePool.getInstance().get(tar);
if (e1.getType().equals(ElementType.UML_CLASS)) {
((UmlClassNode)e1).setExtclass(e2);
((UmlClassNode)e2).addsoncls(e1);
}
else {
((UmlItfNode)e1).addup(e2);
((UmlItfNode)e2).adddn(e1);
}
}
private static void updreal(UmlTreeNode now) {
UmlInterfaceRealization g = (UmlInterfaceRealization) now.getElm();
int src = Idmap.getInstance().get(g.getSource());
int tar = Idmap.getInstance().get(g.getTarget());
UmlTreeNode e1 = NodePool.getInstance().get(src);
UmlTreeNode e2 = NodePool.getInstance().get(tar);
((UmlClassNode)e1).addinter(e2);
((UmlItfNode)e2).adddn(e1);
}
public static void upd(UmlTreeNode now) {
switch (now.getType()) {
case UML_ASSOCIATION_END:
case UML_ATTRIBUTE:
case UML_PARAMETER:
break;
case UML_OPERATION: // get all parameter
updopt(now);
break;
case UML_ASSOCIATION: // get two end
updass(now);
break;
case UML_CLASS: // get all operation, attribute
updcls(now);
break;
case UML_GENERALIZATION: // make father
updgen(now);
break;
case UML_INTERFACE_REALIZATION: // get interface realization
updreal(now);
break;
case UML_INTERFACE:
break;
default:
break;
}
}
}
| [
"pmxm7696@gmail.com"
] | pmxm7696@gmail.com |
e8d004c4cae7ad8bdd39f942c87e221a08da1616 | 1f97c624448169b1717a56919fec0e6b6e537399 | /src/main/java/com/github/candyacao/awesomenotes/dao/AttachVoMapper.java | 0dbcaf1a252ad31fb7d5e2273b13c972ac618470 | [
"Apache-2.0"
] | permissive | candyacao/awesomeblog | 39bdfd62015574920a0af611b30fd4b543e76639 | 3615afaa46d2a4392e06c983af375452f9803af9 | refs/heads/master | 2020-04-29T10:20:29.392876 | 2019-05-19T05:13:32 | 2019-05-19T05:13:32 | 176,058,962 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 981 | java | package com.github.candyacao.awesomenotes.dao;
import com.github.candyacao.awesomenotes.model.Vo.AttachVo;
import com.github.candyacao.awesomenotes.model.Vo.AttachVoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@Component
public interface AttachVoMapper {
long countByExample(AttachVoExample example);
int deleteByExample(AttachVoExample example);
int deleteByPrimaryKey(Integer id);
int insert(AttachVo record);
int insertSelective(AttachVo record);
List<AttachVo> selectByExample(AttachVoExample example);
AttachVo selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") AttachVo record, @Param("example") AttachVoExample example);
int updateByExample(@Param("record") AttachVo record, @Param("example") AttachVoExample example);
int updateByPrimaryKeySelective(AttachVo record);
int updateByPrimaryKey(AttachVo record);
} | [
"candyacao@outlook.com"
] | candyacao@outlook.com |
caefcfea1555585258d71f8bc88977b0d2008fae | 5bc9d8f92f38967cc9ecc03000c0606dbbb38f74 | /sca4j/modules/tags/sca4j-modules-parent-pom-0.9.6/runtime/generic/sca4j-generic-runtime-impl/src/main/java/org/sca4/runtime/generic/impl/contribution/ClasspathContributionProcessor.java | 2f6a38e10c577444900e1699abf8fece2a60069f | [] | no_license | codehaus/service-conduit | 795332fad474e12463db22c5e57ddd7cd6e2956e | 4687d4cfc16f7a863ced69ce9ca81c6db3adb6d2 | refs/heads/master | 2023-07-20T00:35:11.240347 | 2011-08-24T22:13:28 | 2011-08-24T22:13:28 | 36,342,601 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,680 | java | /**
* SCA4J
* Copyright (c) 2009 - 2099 Service Symphony Ltd
*
* Licensed to you 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 included in this distrubtion or you may obtain a copy at
*
* http://www.opensource.org/licenses/apache2.0.php
*
* 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.
*
* This project contains code licensed from the Apache Software Foundation under
* the Apache License, Version 2.0 and original code from project contributors.
*
*
* Original Codehaus Header
*
* Copyright (c) 2007 - 2008 fabric3 project contributors
*
* Licensed to you 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 included in this distrubtion or you may obtain a copy at
*
* http://www.opensource.org/licenses/apache2.0.php
*
* 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.
*
* This project contains code licensed from the Apache Software Foundation under
* the Apache License, Version 2.0 and original code from project contributors.
*
* Original Apache Header
*
* Copyright (c) 2005 - 2006 The Apache Software Foundation
*
* Apache Tuscany is an effort undergoing incubation at The Apache Software
* Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
* required of all newly accepted projects until a further review indicates that
* the infrastructure, communications, and decision making process have stabilized
* in a manner consistent with other successful ASF projects. While incubation
* status is not necessarily a reflection of the completeness or stability of the
* code, it does indicate that the project has yet to be fully endorsed by the ASF.
*
* This product includes software developed by
* The Apache Software Foundation (http://www.apache.org/).
*/
package org.sca4.runtime.generic.impl.contribution;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.oasisopen.sca.annotation.EagerInit;
import org.oasisopen.sca.annotation.Reference;
import org.sca4j.fabric.services.contribution.processor.AbstractContributionProcessor;
import org.sca4j.fabric.util.FileHelper;
import org.sca4j.host.contribution.ContributionException;
import org.sca4j.spi.services.contenttype.ContentTypeResolutionException;
import org.sca4j.spi.services.contenttype.ContentTypeResolver;
import org.sca4j.spi.services.contribution.Action;
import org.sca4j.spi.services.contribution.Contribution;
/**
* Contribution processor for tests.
*
*/
@EagerInit
public class ClasspathContributionProcessor extends AbstractContributionProcessor {
@Reference protected ContentTypeResolver contentTypeResolver;
protected URL getManifestUrl(Contribution contribution) throws MalformedURLException {
return new URL(contribution.getLocation().toExternalForm() + "/META-INF/sca-contribution.xml");
}
protected void iterateArtifacts(Contribution contribution, Action action) throws ContributionException {
File root = FileHelper.toFile(contribution.getLocation());
assert root.isDirectory();
iterateArtifactsResursive(contribution, action, root);
}
private void iterateArtifactsResursive(Contribution contribution, Action action, File dir) throws ContributionException {
File[] files = dir.listFiles();
for (File file : files) {
if (file.isDirectory()) {
iterateArtifactsResursive(contribution, action, file);
} else {
try {
URL entryUrl = file.toURI().toURL();
String contentType = contentTypeResolver.getContentType(entryUrl);
action.process(contribution, contentType, entryUrl);
} catch (MalformedURLException e) {
throw new ContributionException(e);
} catch (ContentTypeResolutionException e) {
throw new ContributionException(e);
}
}
}
}
}
| [
"meerajk@15bcc2b3-4398-4609-aa7c-97eea3cd106e"
] | meerajk@15bcc2b3-4398-4609-aa7c-97eea3cd106e |
ace880d1ce340964ff5e3fa89848f1a348ec43a8 | 91e342347bce88e212d3d5d5ce92c26f5dd481cf | /creoson-json-const/src/com/simplifiedlogic/nitro/jshell/json/response/JLInterfaceResponseParams.java | 627264aaabfcf1a6c15797714912c83028757f99 | [
"MIT"
] | permissive | nexiles/creoson | 732d23bda6f59ee47d486b9ae91dee6f485c5a37 | 4e897be91841a5baa4b600097dd91d6140c18c44 | refs/heads/master | 2020-03-29T15:50:54.663265 | 2018-09-05T19:59:47 | 2018-09-05T19:59:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,557 | java | /*
* MIT LICENSE
* Copyright 2000-2018 Simplified Logic, Inc
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions: The above copyright
* notice and this permission notice shall be included in all copies or
* substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS",
* WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
* TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.simplifiedlogic.nitro.jshell.json.response;
/**
* Constants defining the JSON response parameters for the interface command
*
* @author Adam Andrews
*/
public interface JLInterfaceResponseParams {
// response fields
public static final String OUTPUT_FILENAME = "filename";
public static final String OUTPUT_DIRNAME = "dirname";
public static final String OUTPUT_MODEL = "file";
}
| [
"adama@simplifiedlogic.com"
] | adama@simplifiedlogic.com |
86e52cf9bb341bd90fa104afeccd96d1d87b5b5d | 3dcc1b217120706d33c91a43849e3f527bc94c26 | /codingChallenges/src/LinkedQueue.java | 6971a004cf08238ad62549c3b45fe6a76d26a498 | [] | no_license | patelkirtann/codingChallenge | 374457ceab934bcc976e48a75d4848cf38032fa4 | 3d2fcfa74beb418e07c45f305dbbe92150375281 | refs/heads/master | 2021-04-29T07:50:17.650752 | 2017-01-28T08:15:51 | 2017-01-28T08:15:51 | 77,975,830 | 1 | 0 | null | 2017-01-13T06:24:34 | 2017-01-04T03:11:17 | Java | UTF-8 | Java | false | false | 1,778 | java | /**
* Created by kt_ki on 1/17/2017.
*/
class QueueList {
public Main_Link first;
public Main_Link last;
public QueueList() {
first = null;
last = null;
}
public boolean isEmpty() {
return first == null;
}
public void insertLast(double value) {
Main_Link newValue = new Main_Link(value);
if (isEmpty()) {
first = newValue;
last = first;
} else {
last.next = newValue;
last = newValue;
}
}
public double deleteFirst() {
double temp = first.data;
if (first.next == null) {
last = null;
} else {
first = first.next;
}
return temp;
}
public void displayList() {
System.out.print("Queue : ");
Main_Link current = first;
while (current != null) {
current.displayLink();
current = current.next;
}
System.out.println();
}
}
public class LinkedQueue {
public QueueList theList;
public LinkedQueue() {
theList = new QueueList();
}
public boolean isEmpty() {
return theList.isEmpty();
}
public void insert(double value) {
theList.insertLast(value);
}
public double remove() {
return theList.deleteFirst();
}
public void displayQueue() {
theList.displayList();
}
public static void main(String[] args) {
LinkedQueue linkedQueue = new LinkedQueue();
while (linkedQueue.isEmpty())
linkedQueue.insert(55);
linkedQueue.insert(32);
linkedQueue.insert(54);
linkedQueue.displayQueue();
linkedQueue.remove();
linkedQueue.displayQueue();
}
}
| [
"patelkirtann@gmail.com"
] | patelkirtann@gmail.com |
d2d4971b481c57e602a001a701602ee93789c538 | 647762c3d8db6ca417fc9fd1e2ab87688fb0f68c | /app/src/main/java/com/example/fileencrypter/FileEnDecryptManager.java | f74d7dc36400ffc927c7cef27d2e28bd4c8948d7 | [] | no_license | sun98/FileEncrypter | 796ce0f916611cc976d210552cd71ef79bd559e5 | d21bad406ff14d5afa94e05f4db9c6942d8605b3 | refs/heads/master | 2020-03-21T02:07:26.250917 | 2018-06-20T04:47:52 | 2018-06-20T04:47:52 | 137,981,153 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,507 | java | package com.example.fileencrypter;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.LinkedList;
import java.util.List;
import static android.content.Context.MODE_PRIVATE;
/**
* Created by Nibius at 2018/6/7 20:24.
*/
public class FileEnDecryptManager {
public static String key = "wenchen"; // 加密解密key
private String prefKey = "encrypted_files";
private Context context;
FileEnDecryptManager(Context context) {
this.context = context;
}
/**
* 加密入口
*
* @param fileUrl 文件绝对路径
* @return
*/
public boolean doEncrypt(String fileUrl) {
if (isDecrypted(fileUrl)) {
if (encrypt(fileUrl)) {
// 加密文件,同时在SharedPreference设置该文件已被加密过
SharedPreferences encrypted_files = context.getSharedPreferences(prefKey, MODE_PRIVATE);
SharedPreferences.Editor editor = encrypted_files.edit();
editor.putBoolean(fileUrl, false);
editor.apply();Toast.makeText(context, "加密成功!", Toast.LENGTH_LONG).show();
return true;
} else {
Toast.makeText(context, "加密失败!", Toast.LENGTH_LONG).show();
return false;
}
}
Toast.makeText(context, "文件已被加密过!", Toast.LENGTH_LONG).show();
return false;
}
private final int REVERSE_LENGTH = 28; // 加解密长度(Encryption length)
/**
* 加密或解密
*
* @param strFile 源文件绝对路径
* @return
*/
private boolean encrypt(String strFile) {
int len = REVERSE_LENGTH;
try {
File f = new File(strFile);
if (f.exists()) {
RandomAccessFile raf = new RandomAccessFile(f, "rw");
long totalLen = raf.length();
if (totalLen < REVERSE_LENGTH)
len = (int) totalLen;
FileChannel channel = raf.getChannel();
MappedByteBuffer buffer = channel.map(
FileChannel.MapMode.READ_WRITE, 0, REVERSE_LENGTH);
byte tmp;
for (int i = 0; i < len; ++i) {
byte rawByte = buffer.get(i);
if (i <= key.length() - 1) {
tmp = (byte) (rawByte ^ key.charAt(i)); // 异或运算(XOR operation)
} else {
tmp = (byte) (rawByte ^ i);
}
buffer.put(i, tmp);
}
buffer.force();
buffer.clear();
channel.close();
raf.close();
return true;
}
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
/**
* 解密入口
*
* @param fileUrl 源文件绝对路径
*/
public void doDecrypt(String fileUrl) {
try {
if (!isDecrypted(fileUrl)) {
// 如果没有被解密,则解密
decrypt(fileUrl);
Toast.makeText(context, "解密成功!", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(context, "文件未被加密过!", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
private void decrypt(String fileUrl) {
if (encrypt(fileUrl)) {
// 在SharedPreference里设置这个文件已经被解密
SharedPreferences.Editor editor = context.getSharedPreferences(prefKey, MODE_PRIVATE).edit();
editor.putBoolean(fileUrl, true);
editor.apply();
}
}
/**
* fileName 文件是否已经解密
*
* @param filePath
* @return
*/
private boolean isDecrypted(String filePath) {
SharedPreferences encrypted_files = context.getSharedPreferences(prefKey, MODE_PRIVATE);
Log.i("nib", "isDecrypted: " + filePath + encrypted_files.getBoolean(filePath, true));
return encrypted_files.getBoolean(filePath, true);
}
}
| [
"1329575336@qq.com"
] | 1329575336@qq.com |
25146a17c893d6fb990171e5d3b3570eebef2634 | 4b027a96e457f90fdd146c73a92a99a63b5f6cab | /level06/lesson08/task02/Cat.java | 7918c464c49d46ca5b2dd71b360193cdb509a772 | [] | no_license | Byshevsky/JavaRush | c44a3b25afca677bbe5b6c015aec7c2561ca4830 | d8965bc8b5f060af558cc86924ae6488727cdbd4 | refs/heads/master | 2021-05-02T12:17:48.896494 | 2016-12-26T21:56:12 | 2016-12-26T21:56:12 | 52,143,706 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | package com.javarush.test.level06.lesson08.task02;
/* Статические методы: int getCatCount() и setCatCount(int)
Добавить к классу Cat два статических метода: int getCatCount() и setCatCount(int), с помощью которых можно получить/изменить количество котов (переменную catCount)
*/
public class Cat
{
private static int catCount = 0;
public Cat()
{
catCount++;
}
public static int getCatCount()
{
//Напишите тут ваш код
return Cat.catCount;
}
public static void setCatCount(int catCount)
{
//Напишите тут ваш код
Cat.catCount = catCount;
}
}
| [
"igberda2011@gmail.com"
] | igberda2011@gmail.com |
9784166683e45cc3b9a6dddcb17e89f0423c9087 | 747a9fbd3ea6a3d3e469d63ade02b7620d970ca6 | /gmsm/src/main/java/com/getui/gmsm/bouncycastle/asn1/bc/BCObjectIdentifiers.java | 336481cfad17abcf40300a1f224dbdc3ef76c911 | [] | no_license | xievxin/GitWorkspace | 3b88601ebb4718dc34a2948c673367ba79c202f0 | 81f4e7176daa85bf8bf5858ca4462e9475227aba | refs/heads/master | 2021-01-21T06:18:33.222406 | 2019-01-31T01:28:50 | 2019-01-31T01:28:50 | 95,727,159 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,607 | java | package com.getui.gmsm.bouncycastle.asn1.bc;
import com.getui.gmsm.bouncycastle.asn1.DERObjectIdentifier;
public interface BCObjectIdentifiers
{
/**
* iso.org.dod.internet.private.enterprise.legion-of-the-bouncy-castle
*
* 1.3.6.1.4.1.22554
*/
public static final DERObjectIdentifier bc = new DERObjectIdentifier("1.3.6.1.4.1.22554");
/**
* pbe(1) algorithms
*/
public static final DERObjectIdentifier bc_pbe = new DERObjectIdentifier(bc.getId() + ".1");
/**
* SHA-1(1)
*/
public static final DERObjectIdentifier bc_pbe_sha1 = new DERObjectIdentifier(bc_pbe.getId() + ".1");
/**
* SHA-2(2) . (SHA-256(1)|SHA-384(2)|SHA-512(3)|SHA-224(4))
*/
public static final DERObjectIdentifier bc_pbe_sha256 = new DERObjectIdentifier(bc_pbe.getId() + ".2.1");
public static final DERObjectIdentifier bc_pbe_sha384 = new DERObjectIdentifier(bc_pbe.getId() + ".2.2");
public static final DERObjectIdentifier bc_pbe_sha512 = new DERObjectIdentifier(bc_pbe.getId() + ".2.3");
public static final DERObjectIdentifier bc_pbe_sha224 = new DERObjectIdentifier(bc_pbe.getId() + ".2.4");
/**
* PKCS-5(1)|PKCS-12(2)
*/
public static final DERObjectIdentifier bc_pbe_sha1_pkcs5 = new DERObjectIdentifier(bc_pbe_sha1.getId() + ".1");
public static final DERObjectIdentifier bc_pbe_sha1_pkcs12 = new DERObjectIdentifier(bc_pbe_sha1.getId() + ".2");
public static final DERObjectIdentifier bc_pbe_sha256_pkcs5 = new DERObjectIdentifier(bc_pbe_sha256.getId() + ".1");
public static final DERObjectIdentifier bc_pbe_sha256_pkcs12 = new DERObjectIdentifier(bc_pbe_sha256.getId() + ".2");
/**
* AES(1) . (CBC-128(2)|CBC-192(22)|CBC-256(42))
*/
public static final DERObjectIdentifier bc_pbe_sha1_pkcs12_aes128_cbc = new DERObjectIdentifier(bc_pbe_sha1_pkcs12.getId() + ".1.2");
public static final DERObjectIdentifier bc_pbe_sha1_pkcs12_aes192_cbc = new DERObjectIdentifier(bc_pbe_sha1_pkcs12.getId() + ".1.22");
public static final DERObjectIdentifier bc_pbe_sha1_pkcs12_aes256_cbc = new DERObjectIdentifier(bc_pbe_sha1_pkcs12.getId() + ".1.42");
public static final DERObjectIdentifier bc_pbe_sha256_pkcs12_aes128_cbc = new DERObjectIdentifier(bc_pbe_sha256_pkcs12.getId() + ".1.2");
public static final DERObjectIdentifier bc_pbe_sha256_pkcs12_aes192_cbc = new DERObjectIdentifier(bc_pbe_sha256_pkcs12.getId() + ".1.22");
public static final DERObjectIdentifier bc_pbe_sha256_pkcs12_aes256_cbc = new DERObjectIdentifier(bc_pbe_sha256_pkcs12.getId() + ".1.42");
}
| [
"xiex@getui.com"
] | xiex@getui.com |
efc7167403ff1c0b8481b4d4a3c6e82a612846de | 47b0c9b960f342f9d67b871ef76c25850bec76f0 | /ajiML/src/ajiML/Create.java | fe2ac33ad43f629e62153a9c95e478b6ecc9235b | [
"MIT"
] | permissive | SeelabFhdo/AjiL | 7588b386de57d3ed6faae6ccab376c55bc4cb353 | 452893898e51c9091e151fb0dc3b34f3bd3a50f7 | refs/heads/dev | 2021-07-04T08:40:20.909947 | 2019-05-10T12:11:41 | 2019-05-10T12:11:41 | 100,506,558 | 8 | 6 | MIT | 2019-05-10T12:15:17 | 2017-08-16T15:51:39 | Java | UTF-8 | Java | false | false | 274 | java | /**
*/
package ajiML;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Create</b></em>'.
* <!-- end-user-doc -->
*
*
* @see ajiML.AjiMLPackage#getCreate()
* @model
* @generated
*/
public interface Create extends Ability {
} // Create
| [
"jonas.sorgalla@fh-dortmund.de"
] | jonas.sorgalla@fh-dortmund.de |
b9eb7748c33f87e495e1033ceb57964a87c2cbab | a63b30a7873f78e17e5afc6ba6ec49804e3203b6 | /src/com/company/Chicken.java | 3a2485ef9225a8e523ca1720a88ec6234232cbe2 | [] | no_license | polash04/FarmGame | 01bf2f0c98c8b1ff224dd9967a41c1930fad6d69 | d12bd615e84b52d7e77ef2eaa3918aefe001326c | refs/heads/main | 2023-03-04T09:32:21.315538 | 2021-02-21T20:59:09 | 2021-02-21T20:59:09 | 339,205,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package com.company;
import java.util.ArrayList;
public class Chicken extends Animal{
public static int Cost = 100;
public Chicken(boolean aBabyFlag) {
super(aBabyFlag);
myCost = Cost;
myMaxAge = 10;
BabyCount = 4;
FoodTypes = new FoodType[]{FoodType.Seeds, FoodType.Carrots};
}
}
| [
"polash04@yahoo.com"
] | polash04@yahoo.com |
50fda45e46ad06a1b95aca071be1b7069a86ac3c | 6af92a5f278622b2996a31757e91df6542d0095b | /tacos/tacos-backend/src/main/java/tacos/message/jms/JmsConfig.java | 1fa68638de2a8bac39ae0b39c749f1be1eaf1aec | [] | no_license | SuiJN621/spring-in-action | 9158169a91b12990bcc364f8009cd53f999a2838 | ba8e67dc53239f60b22ff83a1fedad66d43ef4c9 | refs/heads/master | 2020-05-09T21:22:56.659228 | 2019-05-27T07:11:59 | 2019-05-27T07:11:59 | 181,441,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,590 | java | package tacos.message.jms;
import java.util.HashMap;
import java.util.Map;
import javax.jms.Destination;
import org.apache.activemq.artemis.jms.client.ActiveMQQueue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.support.converter.MappingJackson2MessageConverter;
import tacos.entity.Order;
/**
* @author Sui
* @date 2019.04.23 9:34
*/
@Configuration
public class JmsConfig {
public static final String ORDER_STRING_DESTINATION = "com.sjn.order";
/**
* 注册新的MessageConverter代替默认的SimpleMessageConverter
*
* @return
*/
@Bean
public MappingJackson2MessageConverter messageConverter() {
MappingJackson2MessageConverter messageConverter = new MappingJackson2MessageConverter();
//设置typeId key值, 接收方根据value值决定将message转换为何种类型, 默认是类的全名
//接收方也需要进行类似配置
messageConverter.setTypeIdPropertyName("_typeId");
//配置type mapping, 避免使用类全名
Map<String, Class<?>> typeIdMappings = new HashMap<>();
typeIdMappings.put("order", Order.class);
messageConverter.setTypeIdMappings(typeIdMappings);
return messageConverter;
}
@Bean
public Destination orderDestination(){
//也可以直接使用String定义目标, 不指定发送目标时需要配置默认目标spring.jms.template.default-destination
return new ActiveMQQueue(ORDER_STRING_DESTINATION);
}
}
| [
"SuiJN93@outlook.com"
] | SuiJN93@outlook.com |
f18bba3d9d48fed98c75bd5cdd450f32035594a5 | e93747633d4b78f586f54cdafa45cf66d90be48a | /menu/src/main/java/com/feasttime/tools/ToastUtil.java | 52467f7e6b683d59f8a24169d6a8badaa4018c97 | [] | no_license | FeastTime/PadMenu | 615f1afe4c989ac0427d2bf7cd40fbf08833e850 | a49efb14e61bcd48633a2db4fd09a6a630494494 | refs/heads/master | 2021-01-01T06:08:02.275508 | 2018-03-16T12:36:54 | 2018-03-16T12:36:54 | 97,363,058 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 547 | java | /*
* Copyright (c) 2017. sheng yan
*/
package com.feasttime.tools;
import android.content.Context;
import android.os.Handler;
import android.widget.Toast;
public class ToastUtil {
public static void showToast(Context mContext, String text, int duration) {
Toast mToast = Toast.makeText(mContext, text, Toast.LENGTH_SHORT);
mToast.setDuration(duration);
mToast.show();
}
public static void showToast(Context mContext, int resId, int duration) {
showToast(mContext, mContext.getResources().getString(resId), duration);
}
}
| [
"xiaoqing.li@ipinyou.com"
] | xiaoqing.li@ipinyou.com |
8904b782a81e7afb4eae93767c945201455c2100 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/12/12_1be45a78cb810cc82998e0eae4072bc635a40331/SellCommand/12_1be45a78cb810cc82998e0eae4072bc635a40331_SellCommand_t.java | 653895fe041f38b64d7e13330dca3e32cf209264 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,580 | java | /*-------------------------------------------------------------------------
svninfo: $Id$
Maarten's Mud, WWW-based MUD using MYSQL
Copyright (C) 1998 Maarten van Leunen
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Maarten van Leunen
Appelhof 27
5345 KA Oss
Nederland
Europe
maarten_l@yahoo.com
-------------------------------------------------------------------------*/
package mmud.commands;
import java.util.Vector;
import java.util.logging.Logger;
import mmud.Constants;
import mmud.MudException;
import mmud.ParseException;
import mmud.characters.Person;
import mmud.characters.Persons;
import mmud.characters.User;
import mmud.database.Database;
import mmud.database.ItemsDb;
import mmud.items.Item;
import mmud.items.ItemException;
/**
* Selling an item to a bot. Syntax : sell <item> to <character>
* @see BuyCommand
*/
public class SellCommand extends NormalCommand
{
public SellCommand(String aRegExpr)
{
super(aRegExpr);
}
/**
* Tries out the sell command. There are a couple of requirements that
* need to be met, before a successful sale takes place.
* <ol><li>command struct. should be "<I>sell
* <item> to <character></I>", for example: "<I>sell gold ring
* to Karcas</I>".
* <li>shopkeeper buying the item should
* <ol><li> exist, <li>be in the same room and<li>
* have a occupation-attribute set to "shopkeeper"
* and<li>has enough money</ol>
* <li>the customer should have the item
* <li>the item itself should <I>NOT</I> have a attribute called "notsellable".
* </ol>
* A best effort is tried, this means the following sequence of events:
* <ol><li>the item is transferred into the inventory of the shopkeeper
* <li>money is transferred into the inventory of the customer
* <li>continue with next item
*</ol>
* @param aUser the character doing the selling.
* @throws ItemException in case the appropriate items could not be
* properly processed.
* @throws ParseException if the item description or the number of
* items requested is illegal.
*/
public boolean run(User aUser)
throws ItemException, ParseException, MudException
{
Logger.getLogger("mmud").finer("");
if (!super.run(aUser))
{
return false;
}
String[] myParsed = getParsedCommand();
// parse command string
if (myParsed.length >= 4 && myParsed[myParsed.length-2].equalsIgnoreCase("to"))
{
// determine if appropriate shopkeeper is found.
Person toChar = Persons.retrievePerson(myParsed[myParsed.length-1]);
if ((toChar == null) || (!toChar.getRoom().equals(aUser.getRoom())))
{
aUser.writeMessage("Cannot find that person.<BR>\r\n");
return true;
}
if ( (!toChar.isAttribute("occupation")) ||
(!"shopkeeper".equals(
toChar.getAttribute("occupation").getValue())) )
{
aUser.writeMessage("That person is not a shopkeeper.<BR>\r\n");
return true;
}
// check for item in posession of customer
Vector stuff = Constants.parseItemDescription(myParsed, 1, myParsed.length - 3);
int amount = ((Integer) stuff.elementAt(0)).intValue();
String adject1 = (String) stuff.elementAt(1);
String adject2 = (String) stuff.elementAt(2);
String adject3 = (String) stuff.elementAt(3);
String name = (String) stuff.elementAt(4);
Vector myItems = aUser.getItems(adject1, adject2, adject3, name);
if (myItems.size() < amount)
{
if (amount == 1)
{
aUser.writeMessage("You do not have that item.<BR>\r\n");
return true;
}
else
{
aUser.writeMessage("You do not have that many items.<BR>\r\n");
return true;
}
}
int sumvalue = 0;
for (int i=0; i<amount; i++)
{
Item myItem = (Item) myItems.elementAt(i);
sumvalue += myItem.getMoney();
}
Logger.getLogger("mmud").finer(aUser.getName() + " has items worth " + sumvalue + " copper");
Logger.getLogger("mmud").finer(toChar.getName() + " has " +
toChar.getMoney() + " copper coins");
if (toChar.getMoney() < sumvalue )
{
aUser.writeMessage(toChar.getName() + " mutters something about not having enough money.<BR>\r\n");
return true;
}
int j = 0;
for (int i = 0; ((i < myItems.size()) && (j != amount)); i++)
{
// here needs to be a check for validity of the item
boolean success = true;
Item myItem = (Item) myItems.elementAt(i);
if (myItem.isAttribute("notsellable"))
{
aUser.writeMessage("You cannot sell that item.<BR>\r\n");
success = false;
}
if (myItem.getMoney() == 0)
{
String message = "That item is not worth anything.";
Persons.sendMessageExcl(toChar, aUser, "%SNAME say%VERB2 [to %TNAME] : " + message + "<BR>\r\n");
aUser.writeMessage(toChar, aUser, "<B>%SNAME say%VERB2 [to %TNAME]</B> : " + message + "<BR>\r\n");
success = false;
}
if (myItem.isWearing())
{
String message = "You cannot sell that, you are wearing or wielding that item.";
aUser.writeMessage(toChar, aUser, message + "<BR>\r\n");
success = false;
}
if (success)
{
// transfer money to user
int totalitemvalue = myItem.getMoney();
// transfer item to shopkeeper
if (success)
{
ItemsDb.transferItem(myItem, toChar);
Database.writeLog(aUser.getName(), "sold " + myItem + " to " + toChar + " in room " + toChar.getRoom().getId());
toChar.transferMoneyTo(totalitemvalue, aUser);
Database.writeLog(aUser.getName(), "received " + totalitemvalue + " copper from " + toChar);
Persons.sendMessage(aUser, toChar, "%SNAME sell%VERB2 " + myItem.getDescription() + " to %TNAME.<BR>\r\n");
j++;
}
}
}
return true;
}
return false;
}
public Command createCommand()
{
return new SellCommand(getRegExpr());
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
675f1b9fbf33e371b037da71878e47fa590deb06 | 5ec8a5ba340b823e47ecc4dc31a7d14276df5910 | /app/src/test/java/com/vikas/videoplayer/ExampleUnitTest.java | f2b04708962a1fbff90a0da29d1cec4f1c852afc | [] | no_license | rohitnotes/vimeo-exo-player | 740ab534d25ddbf7311c767ccea7b43634a09b88 | d4f123c7abc69d59a9f3960ce4881d5dbdfa0fe2 | refs/heads/master | 2022-04-08T13:14:47.083381 | 2020-02-20T07:27:33 | 2020-02-20T07:27:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 382 | java | package com.vikas.videoplayer;
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);
}
} | [
"vickydvlpr@gmail.com"
] | vickydvlpr@gmail.com |
4c4801e0ae7391d0c6790162f7610c41be286bd6 | 524df4196241684fc6d0fa0bff09c6cf5b72fd17 | /RecyclerViewExample2/app/src/main/java/com/nex3z/examples/recyclerview2/rest/RestClient.java | 73713f5d8e3a56ad8b81e5b01721a8c8a8edf060 | [] | no_license | WZFlik/android-examples | 459330f04fe4d374ba00141917487532cd89d142 | 7da7a685d31dac1388406dbaa8ccf5b3109e924a | refs/heads/master | 2020-03-28T21:08:34.649938 | 2018-06-04T14:57:18 | 2018-06-04T14:57:18 | 149,132,237 | 1 | 0 | null | 2018-09-17T13:48:20 | 2018-09-17T13:48:20 | null | UTF-8 | Java | false | false | 2,081 | java | package com.nex3z.examples.recyclerview2.rest;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.nex3z.examples.recyclerview2.BuildConfig;
import com.nex3z.examples.recyclerview2.rest.service.MovieService;
import com.squareup.okhttp.HttpUrl;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import com.squareup.okhttp.logging.HttpLoggingInterceptor;
import java.io.IOException;
import retrofit.GsonConverterFactory;
import retrofit.Retrofit;
public class RestClient {
private static final String BASE_URL = "http://api.themoviedb.org";
private MovieService mMovieService;
public RestClient() {
Gson gson = new GsonBuilder().create();
OkHttpClient httpClient = new OkHttpClient();
httpClient.interceptors().add(
new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY));
httpClient.interceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Request original = chain.request();
HttpUrl originalHttpUrl = original.httpUrl();
HttpUrl.Builder builder = originalHttpUrl.newBuilder()
.addQueryParameter("api_key", BuildConfig.API_KEY);
Request.Builder requestBuilder = original.newBuilder()
.url(builder.build())
.method(original.method(), original.body());
Request request = requestBuilder.build();
return chain.proceed(request);
}
});
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.client(httpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.build();
mMovieService = retrofit.create(MovieService.class);
}
public MovieService getMovieService() { return mMovieService; }
}
| [
"litianxing9@gmail.com"
] | litianxing9@gmail.com |
ec551bba867468c429c828e465c39363eb799e88 | 26a5d590d00707c9215732a9ff04794f2f9ea501 | /src/main/java/de/leeksanddragons/tools/dialog/javafx/FXMLWindow.java | 3763bc29c5db0ca0e1a9f45dea4b1fc2d8cb1c71 | [
"Apache-2.0"
] | permissive | leeks-and-dragons/dialog-tool | 3c8929c38e686ed9ad360d0872a5bac23013b2fc | 90d70e9c38d0bb647b51923661a20f75798e55ec | refs/heads/master | 2021-01-20T21:07:11.842241 | 2017-08-31T16:24:31 | 2017-08-31T16:24:31 | 101,749,852 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,010 | java | package de.leeksanddragons.tools.dialog.javafx;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import java.io.File;
import java.io.IOException;
/**
* Created by Justin on 30.05.2017.
*/
public class FXMLWindow {
//JavaFX stage means an window
protected Stage stage = null;
//JavaFX scene
protected Scene scene = null;
//root AnchorPane
protected Pane rootPane = null;
public FXMLWindow (String title, int width, int height, String fxmlPath, FXMLController controller) {
//create new stage
this.stage = new Stage();
//set title
stage.setTitle(title);
//set width & height
stage.setWidth(width);
stage.setHeight(height);
// load fxml
try {
FXMLLoader loader = new FXMLLoader(new File(fxmlPath).toURI().toURL());
//set controller
if (controller != null) {
loader.setController(controller);
}
rootPane = loader.load();//FXMLLoader.load(new File(fxmlPath).toURI().toURL());
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
}
//add scene
this.scene = new Scene(this.rootPane);
//set scene
stage.setScene(scene);
//initialize controller
if (controller != null) {
controller.init(stage, scene, rootPane);
//run controller logic in new thread
new Thread(controller::run).start();
}
//show window
//stage.show();
}
public FXMLWindow (String title, int width, int height, String fxmlPath) {
this(title, width, height, fxmlPath, null);
}
public Stage getStage () {
return this.stage;
}
public void setVisible (boolean visible) {
if (!visible) {
this.stage.hide();
} else {
this.stage.show();
}
}
}
| [
"kuenzel.justin@t-online.de"
] | kuenzel.justin@t-online.de |
ef537f8342a6e67fb57a3edc8b69d5973b763473 | 7ee27191217553a815458a622a1b7878274f7088 | /src/main/java/jdkguide/nio/buffer/ByteBuffers.java | 401defad5fe1b3cd87abb237ee6ceb8cc8a9529e | [] | no_license | BigPayno/JavaGuide | bd3a14cab15188894ade972201f437cc8ceadbb7 | 512f084343e03de87e4949dd66fba77eb69972ed | refs/heads/master | 2022-12-12T23:29:53.618292 | 2020-05-29T08:30:36 | 2020-05-29T08:30:36 | 221,147,356 | 1 | 0 | null | 2022-12-10T05:44:10 | 2019-11-12T06:34:42 | Java | UTF-8 | Java | false | false | 479 | java | package jdkguide.nio.buffer;
import java.nio.ByteBuffer;
/**
* @author payno
* @date 2019/11/4 14:59
* @description
*/
public final class ByteBuffers {
public static void print(ByteBuffer byteBuffer){
//反转ByteBuffer,转换读写模式
byteBuffer.flip();
//移动指针
while (byteBuffer.hasRemaining()){
System.out.print((char)byteBuffer.get());
}
//清除ByteBuffer
byteBuffer.clear();
}
}
| [
"1361098889@qq.com"
] | 1361098889@qq.com |
6ec25e57665915510a532df965e87f19cfb60d26 | 384711580298c82939264fefe3e0807984ef6ff2 | /src/template/com/ticket/serviceImpl/MyTextServiceImpl.java | 5a61b3506c1004d313ff2647e810e076f95d61ad | [] | no_license | guoyu07/ticket | 3d3ac6e7f74cee900df52ab89100b47da345d24e | beb0207df5a81be1e44d3cdbac0b69b2d2f30f95 | refs/heads/master | 2020-03-17T09:49:22.333539 | 2017-11-29T06:47:06 | 2017-11-29T06:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,407 | java | package com.ticket.serviceImpl;
import java.util.ArrayList;
import java.util.List;
import com.ticket.exception.ServiceException;
import com.ticket.pojo.CommonEntity;
import com.ticket.pojo.EmployeeInfo;
import com.ticket.pojo.MyText;
import com.ticket.pojo.Pagination;
import com.ticket.service.IMyTextService;
import com.ticket.util.DecoderUtil;
import com.ticket.util.GeneralUtil;
import com.ticket.util.PaginationContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* 我的记事本业务接口实现类
* @ClassName: IMyTextService
* @Description: 提供我的记事本操作的增删改查
* @author HiSay
* @date 2016-02-15 11:26:54
*
*/
public class MyTextServiceImpl extends BaseServiceImpl<MyText, String> implements IMyTextService {
@SuppressWarnings("unused")
private static final Log log = LogFactory.getLog(MyTextServiceImpl.class);
@Override
public MyText merge(String id, EmployeeInfo employeeInfo,String title,String content) throws ServiceException {
MyText myText = dbDAO.queryById(this.getTableNameFromEntity(MyText.class), id);
if(employeeInfo != null){
myText.setEmployeeInfo_id(employeeInfo.getId());
}
myText.setTitle(DecoderUtil.UtfDecoder(title));
myText.setContent(DecoderUtil.UtfDecoder(content));
CommonEntity status = myText.getStatus();
status.setVersionFlag(versionFlag);
myText.setStatus(status);
dbDAO.merge(myText);
return myText;
}
@Override
public MyText persist(EmployeeInfo employeeInfo,String title,String content) throws ServiceException {
MyText myText = new MyText();
if(employeeInfo != null){
myText.setEmployeeInfo_id(employeeInfo.getId());
}
myText.setTitle(DecoderUtil.UtfDecoder(title));
myText.setContent(DecoderUtil.UtfDecoder(content));
CommonEntity status = myText.getStatus();
status.setVersionFlag(versionFlag);
myText.setStatus(status);
dbDAO.persist(myText);
return myText;
}
@Override
public boolean remove(String id) throws ServiceException {
MyText myText = dbDAO.queryById(this.getTableNameFromEntity(MyText.class), id);
dbDAO.remove(myText);
return true;
}
@Override
public Pagination queryAll(EmployeeInfo employeeInfo, Integer isRead,
String order, Integer pageSize) throws ServiceException {
try {
StringBuffer sb = new StringBuffer();
List<Object[]> objects = new ArrayList<Object[]>();
sb.append("");
if(employeeInfo != null){
sb.append("and s.employeeInfo_id=?3 ");
objects.add(new Object[]{3,employeeInfo.getId()});
}
if(GeneralUtil.isNotNull(isRead)){
sb.append("and s.isRead=?4 ");
objects.add(new Object[]{4,isRead});
}
if(GeneralUtil.isNull(order)){
order = "s.status.createTime desc,s.isRead asc";
}
return dbDAO.queryByPageModuleNew(MyText.class.getSimpleName(), 0, versionFlag,
sb.toString(), objects, order, PaginationContext.getOffset(), pageSize);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override
public Boolean changeRead(String id, Integer read) throws ServiceException {
try {
MyText myText = queryById(MyText.class.getSimpleName(), id);
myText.setIsRead(read);
this.merge(myText);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
} | [
"tuyou17@lenovo.com"
] | tuyou17@lenovo.com |
6eb227c432d12dd629ef87d90877c706415b592c | d34187f7a890e096b113f7447d37b472825f682f | /app/src/main/java/com/example/ocrdictionary/entity/SearchText.java | edff4f920bb4f741c73267c32be837085cf21e0d | [] | no_license | tuanbmhust/OCRDictionary | d2df4527eae65a1f08b342e8b05db56235eb30a2 | ebac048d190d1313e63232f87fc4da1a4df6aae3 | refs/heads/master | 2020-09-24T15:11:27.912333 | 2019-12-04T05:37:53 | 2019-12-04T05:37:53 | 225,787,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,202 | java | package com.example.ocrdictionary.entity;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class SearchText {
@SerializedName("__v")
@Expose
private Integer v;
@SerializedName("_id")
@Expose
private String id;
@SerializedName("index")
@Expose
private Integer index;
@SerializedName("key")
@Expose
private String key;
@SerializedName("meaning")
@Expose
private List<String> meaning = null;
@SerializedName("trait")
@Expose
private List<String> trait = null;
@SerializedName("type")
@Expose
private String type;
/**
* No args constructor for use in serialization
*
*/
public SearchText() {
}
/**
*
* @param v
* @param meaning
* @param index
* @param trait
* @param id
* @param type
* @param key
*/
public SearchText(Integer v, String id, Integer index, String key, List<String> meaning, List<String> trait, String type) {
super();
this.v = v;
this.id = id;
this.index = index;
this.key = key;
this.meaning = meaning;
this.trait = trait;
this.type = type;
}
public Integer getV() {
return v;
}
public void setV(Integer v) {
this.v = v;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getIndex() {
return index;
}
public void setIndex(Integer index) {
this.index = index;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public List<String> getMeaning() {
return meaning;
}
public void setMeaning(List<String> meaning) {
this.meaning = meaning;
}
public List<String> getTrait() {
return trait;
}
public void setTrait(List<String> trait) {
this.trait = trait;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
| [
"57906444+tuanbmhust@users.noreply.github.com"
] | 57906444+tuanbmhust@users.noreply.github.com |
6cb394ba038e2ce616a517a5bf0f869637b65836 | 97c2cfd517cdf2a348a3fcb73e9687003f472201 | /Java/systematic/src/com/malbec/tsdb/loader/TimeSeriesDataPoint.java | a3293f462fc6f612f0a2a1881569374580ff24d4 | [] | no_license | rsheftel/ratel | b1179fcc1ca55255d7b511a870a2b0b05b04b1a0 | e1876f976c3e26012a5f39707275d52d77f329b8 | refs/heads/master | 2016-09-05T21:34:45.510667 | 2015-05-12T03:51:05 | 2015-05-12T03:51:05 | 32,461,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 420 | java | package com.malbec.tsdb.loader;
import static tsdb.TimeSeries.*;
public class TimeSeriesDataPoint {
private final int id;
private final Double value;
public TimeSeriesDataPoint(int id, Double value) {
this.id = id;
this.value = value;
}
public Double value() {
return value;
}
public int id() {
return id;
}
@Override public String toString() {
return series(id).name() + " " + value;
}
}
| [
"rsheftel@gmail.com"
] | rsheftel@gmail.com |
6463a8b266b8125a974f90ef2dc5d0962ddb1b54 | cbf5aceb17cafdfed825c8fb3434ff0b41eee2db | /src/bol24_1/wformgui/Ventana.java | 31395f97c0c7a618866eb286606614f068dabc94 | [] | no_license | juanmartinezpineiro/Boletin24 | a0be39034edfe48d59de1f068f9888550400c46e | f3f5a8edda5a253181daa4173cf73a39ed5ce1c9 | refs/heads/master | 2020-05-04T07:46:06.968719 | 2019-04-02T08:38:53 | 2019-04-02T08:38:53 | 179,034,709 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,043 | 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 bol24_1.wformgui;
/**
*
* @author jmartinezpineiro
*/
public class Ventana extends javax.swing.JFrame {
/**
* Creates new form Ventana
*/
public Ventana() {
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() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
textFieldName = new javax.swing.JTextField();
buttonPremer = new javax.swing.JButton();
buttonLimpar = new javax.swing.JButton();
textFieldPassword = new javax.swing.JPasswordField();
jPanel2 = new javax.swing.JPanel();
buttonBoton = new javax.swing.JButton();
jScrollPane2 = new javax.swing.JScrollPane();
AreaTexto = new javax.swing.JTextArea();
jScrollPane3 = new javax.swing.JScrollPane();
Lista = new javax.swing.JList<>();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("NOME");
jLabel2.setText("PASSWORD");
buttonPremer.setText("PREMER");
buttonPremer.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonPremerActionPerformed(evt);
}
});
buttonLimpar.setText("LIMPAR");
buttonLimpar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonLimparActionPerformed(evt);
}
});
textFieldPassword.setText("jPasswordField1");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(65, 65, 65)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(buttonPremer)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonLimpar)
.addGap(74, 74, 74))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(66, 66, 66)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(textFieldPassword)
.addComponent(textFieldName))
.addGap(89, 89, 89))))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(62, 62, 62)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(textFieldName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(textFieldPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonPremer)
.addComponent(buttonLimpar))
.addGap(23, 23, 23))
);
buttonBoton.setText("BOTON");
buttonBoton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonBotonActionPerformed(evt);
}
});
AreaTexto.setColumns(20);
AreaTexto.setRows(5);
jScrollPane2.setViewportView(AreaTexto);
Lista.setModel(new javax.swing.AbstractListModel<String>() {
String[] strings = { "ElementoLista 1", "ElementoLista 2", "ElementoLista 3" };
public int getSize() { return strings.length; }
public String getElementAt(int i) { return strings[i]; }
});
jScrollPane3.setViewportView(Lista);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(45, 45, 45)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonBoton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(19, 19, 19))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(27, 27, 27)
.addComponent(buttonBoton))
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane3)
.addComponent(jScrollPane2))))
.addContainerGap(55, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void buttonLimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLimparActionPerformed
// TODO add your handling code here:
textFieldName.setText(null);
textFieldPassword.setText(null);
}//GEN-LAST:event_buttonLimparActionPerformed
private void buttonPremerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPremerActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_buttonPremerActionPerformed
private void buttonBotonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBotonActionPerformed
// TODO add your handling code here:
AreaTexto.setText(textFieldName.getText() +"\n" + Lista.getSelectedValue());
}//GEN-LAST:event_buttonBotonActionPerformed
/**
* @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(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Ventana.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 Ventana().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextArea AreaTexto;
private javax.swing.JList<String> Lista;
private javax.swing.JButton buttonBoton;
private javax.swing.JButton buttonLimpar;
private javax.swing.JButton buttonPremer;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JTextField textFieldName;
private javax.swing.JPasswordField textFieldPassword;
// End of variables declaration//GEN-END:variables
}
| [
"jmartinezpineiro@nautilus16.danielcastelao.org"
] | jmartinezpineiro@nautilus16.danielcastelao.org |
f4206a13b4607fc3357efc4278101f8cb66c85c1 | f6a106f2e7e4567e9439e3310da2460ef154a3c1 | /GOMP_ADMIN_POC/src/main/java/com/omp/dev/settlement/action/dailysale/SettlementDevDailySaleAction.java | 375b263e2720c1b7016c0a6abb165f335ed549e1 | [] | no_license | samsik-kim/rejoice | 285c9595b9c052d38c26e73cf0842f4b94002643 | 214a2efa0b1dbac4865223bb2f049db2b26c4614 | refs/heads/master | 2020-03-30T17:44:57.405306 | 2014-01-04T14:24:36 | 2014-01-04T14:24:36 | 40,213,627 | 0 | 4 | null | null | null | null | UTF-8 | Java | false | false | 5,630 | java | /*
* COPYRIGHT(c) SK telecom 2009
* This software is the proprietary information of SK telecom.
*
* Revision History
* Author Date Description
* -------- ---------- ------------------
*
*/
package com.omp.dev.settlement.action.dailysale;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.omp.commons.action.BaseAction;
import com.omp.commons.exception.ServiceException;
import com.omp.commons.model.PagenateList;
import com.omp.commons.util.DateUtil;
import com.omp.commons.util.SessionUtil;
import com.omp.dev.settlement.model.DailySale;
import com.omp.dev.settlement.model.ProductSale;
import com.omp.dev.settlement.service.dailysale.SettlementDevDailySaleService;
import com.omp.dev.settlement.service.dailysale.SettlementDevDailySaleServiceImpl;
import com.omp.dev.user.model.Session;
/**
* SettlementAdm Action
*
* @version 0.1
*/
@SuppressWarnings("serial")
public class SettlementDevDailySaleAction extends BaseAction {
// service
private SettlementDevDailySaleService service = null;
// param
private DailySale dailySale = null;
// param
private DailySale dailySaleS = null;
// DailySale list
private List<DailySale> dailySaleList = null;
// contents list totalCount
private long totalCount;
/**
*
*/
public SettlementDevDailySaleAction() {
service = new SettlementDevDailySaleServiceImpl();
}
/**
* <b>Action</b>
* Settlement Management :
*
* @return
*/
public String dailySaleList() {
if (dailySaleS == null) {
dailySaleS = new DailySale();
// before 1 days default search
dailySaleS.setStartDate(DateUtil.getAddDay(-7, "yyyy-MM-dd"));
dailySaleS.setEndDate(DateUtil.getAddDay(0, "yyyy-MM-dd"));
}
Session session = (Session) SessionUtil.getMemberSession(this.req);
dailySaleS.setMbrNo(session.getMbrNo());
dailySaleList = service.dailySaleList(dailySaleS);
totalCount = ((PagenateList) dailySaleList).getTotalCount();
return SUCCESS;
}
public String dailySaleDetailList() {
if (dailySaleS == null) {
dailySaleS = new DailySale();
}
dailySaleS.getPage().setRows(10);
Session session = (Session) SessionUtil.getMemberSession(this.req);
dailySaleS.setMbrNo(session.getMbrNo());
dailySaleList = service.dailySaleDetailList(dailySaleS);
dailySale = service.dailySaleDetailCount(dailySaleS);
totalCount = ((PagenateList) dailySaleList).getTotalCount();
return SUCCESS;
}
public String dailySaleExcelList() {
try {
if (dailySaleS == null) {
dailySaleS = new DailySale();
// before 1 days default search
dailySaleS.setStartDate(DateUtil.getAddDay(-7, "yyyy-MM-dd"));
dailySaleS.setEndDate(DateUtil.getAddDay(0, "yyyy-MM-dd"));
}
Session session = (Session) SessionUtil.getMemberSession(this.req);
dailySaleS.setMbrNo(session.getMbrNo());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String yyyymmdd = sdf.format(new Date());
// TODO 조회기간 무력화, 페이징 조건 무력화는 commonDao에서 처리되도록 되어 있슴
this.setDownloadFile(this.service.dailySaleExcelList(this.dailySaleS), "application/vnd.ms-excel; charset=UTF-8", "DailySale-"+yyyymmdd+ ".xls");
return SUCCESS;
} catch (Exception e) {
throw new ServiceException("dailySaleExcelList fail.", e);
}
}
public String dailySaleDetailExcelList() {
try {
if (dailySaleS == null) {
dailySaleS = new DailySale();
return SUCCESS;
}
Session session = (Session) SessionUtil.getMemberSession(this.req);
dailySaleS.setMbrNo(session.getMbrNo());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String yyyymmdd = sdf.format(new Date());
// TODO 조회기간 무력화, 페이징 조건 무력화는 commonDao에서 처리되도록 되어 있슴
this.setDownloadFile(this.service.dailySaleDetailExcelList(this.dailySaleS), "application/vnd.ms-excel; charset=UTF-8", "DailySaleDetail-"+yyyymmdd+ ".xls");
return SUCCESS;
} catch (Exception e) {
throw new ServiceException("dailySaleDetailExcelList fail.", e);
}
}
// ===================== SET/GET =============================================
/**
* list total count
* @return long totalCount
*/
public long getTotalCount() {
return totalCount;
}
/**
* @return the dailySale
*/
public DailySale getDailySale() {
return dailySale;
}
/**
* @param dailySale the dailySale to set
*/
public void setDailySale(DailySale dailySale) {
this.dailySale = dailySale;
}
/**
* @return the dailySaleList
*/
public List<DailySale> getDailySaleList() {
return dailySaleList;
}
/**
* @param dailySaleList the dailySaleList to set
*/
public void setDailySaleList(List<DailySale> dailySaleList) {
this.dailySaleList = dailySaleList;
}
/**
* @return the dailySaleS
*/
public DailySale getDailySaleS() {
return dailySaleS;
}
/**
* @param dailySaleS the dailySaleS to set
*/
public void setDailySaleS(DailySale dailySaleS) {
this.dailySaleS = dailySaleS;
}
/**
* @param totalCount the totalCount to set
*/
public void setTotalCount(long totalCount) {
this.totalCount = totalCount;
}
} | [
"kim.rejoice@gmail.com"
] | kim.rejoice@gmail.com |
b39ce0d06f6904d91b213e7ba3c719c80068f6b7 | d2995ce7487480646e9bbaaec1fca42ff9c471b6 | /Atelier-3/MicroService-ReverseProxy/src/test/java/com/cpe/reverseproxy/MicroServiceReverseProxyApplicationTests.java | 1c08148ad81f9cf65aec1beb1e4813df7f1bdbea | [] | no_license | Nijadev69/ASI-TP | e6f7ec087c06200f5652560fafca44b3b3c36427 | 0be58056a883a63c3f789fbc43856061dadb64bb | refs/heads/master | 2022-09-29T11:07:56.477199 | 2020-06-07T18:02:32 | 2020-06-07T18:02:32 | 265,475,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 230 | java | package com.cpe.reverseproxy;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class MicroServiceReverseProxyApplicationTests {
@Test
void contextLoads() {
}
}
| [
"cyclopedeveloppeur@gmail.com"
] | cyclopedeveloppeur@gmail.com |
31314dd260976b148ecd4e92da3a3fc31d0f917e | 78e613b09584faf243e460fa952d35998d16cecf | /app/src/androidTest/java/com/example/root/jsonparsingapp/ExampleInstrumentedTest.java | 399f23062c702b1584065de2f1c19891022949ce | [] | no_license | suman111/JsonParsingapp | 1dec1d9af0c95ba5fa601d7b4d0ab4a96093a20e | 6f32c2945f07dba0ba437c838d580f8527e6488f | refs/heads/master | 2021-04-25T23:58:37.946008 | 2017-10-17T13:10:47 | 2017-10-17T13:10:47 | 107,269,962 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.example.root.jsonparsingapp;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.root.jsonparsingapp", appContext.getPackageName());
}
}
| [
"space@space-juan"
] | space@space-juan |
d01c6c034574169b2a19ebb5d13ae64ff8c7aa49 | e45f290038946dc567da05ae6491e5a5eae4c2bf | /models/cinematic/plugins/org.obeonetwork.dsl.cinematic.edit/src-gen/org/obeonetwork/dsl/cinematic/flow/components/FlowPropertiesEditionComponent.java | 59ac75b0485a317c046d42f356ea6c0df1a0d64d | [] | no_license | carsonshan/InformationSystem | e54882507d646fe5c706b248a0ebf56498e4722c | 192dd9a6ac71a95d96bf39107790c33450397132 | refs/heads/master | 2020-03-19T07:20:56.817458 | 2017-09-26T09:51:13 | 2017-09-26T12:35:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,355 | java | /**
* Generated with Acceleo
*/
package org.obeonetwork.dsl.cinematic.flow.components;
// Start of user code for imports
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart;
import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
import org.eclipse.emf.eef.runtime.impl.components.ComposedPropertiesEditionComponent;
import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
import org.obeonetwork.dsl.cinematic.flow.Flow;
import org.obeonetwork.dsl.cinematic.flow.parts.FlowPropertiesEditionPart;
import org.obeonetwork.dsl.cinematic.flow.parts.FlowViewsRepository;
import org.obeonetwork.dsl.environment.components.MetadataCptPropertiesEditionComponent;
import org.obeonetwork.dsl.environment.parts.EnvironmentViewsRepository;
// End of user code
/**
*
*
*/
public class FlowPropertiesEditionComponent extends ComposedPropertiesEditionComponent {
/**
* The Flow part
*
*/
private FlowPropertiesEditionPart flowPart;
/**
* The FlowFlowPropertiesEditionComponent sub component
*
*/
protected FlowFlowPropertiesEditionComponent flowFlowPropertiesEditionComponent;
/**
* The MetadataCptPropertiesEditionComponent sub component
*
*/
protected MetadataCptPropertiesEditionComponent metadataCptPropertiesEditionComponent;
/**
* Parameterized constructor
*
* @param flow the EObject to edit
*
*/
public FlowPropertiesEditionComponent(PropertiesEditingContext editingContext, EObject flow, String editing_mode) {
super(editingContext, editing_mode);
if (flow instanceof Flow) {
PropertiesEditingProvider provider = null;
provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt(flow, PropertiesEditingProvider.class);
flowFlowPropertiesEditionComponent = (FlowFlowPropertiesEditionComponent)provider.getPropertiesEditingComponent(editingContext, editing_mode, FlowFlowPropertiesEditionComponent.FLOW_PART, FlowFlowPropertiesEditionComponent.class);
addSubComponent(flowFlowPropertiesEditionComponent);
provider = (PropertiesEditingProvider)editingContext.getAdapterFactory().adapt(flow, PropertiesEditingProvider.class);
metadataCptPropertiesEditionComponent = (MetadataCptPropertiesEditionComponent)provider.getPropertiesEditingComponent(editingContext, editing_mode, MetadataCptPropertiesEditionComponent.METADATAS_PART, MetadataCptPropertiesEditionComponent.class);
addSubComponent(metadataCptPropertiesEditionComponent);
}
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.impl.components.ComposedPropertiesEditionComponent#
* getPropertiesEditionPart(int, java.lang.String)
*
*/
public IPropertiesEditionPart getPropertiesEditionPart(int kind, String key) {
if (FlowFlowPropertiesEditionComponent.FLOW_PART.equals(key)) {
flowPart = (FlowPropertiesEditionPart)flowFlowPropertiesEditionComponent.getPropertiesEditionPart(kind, key);
return (IPropertiesEditionPart)flowPart;
}
return super.getPropertiesEditionPart(kind, key);
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.impl.components.ComposedPropertiesEditionComponent#
* setPropertiesEditionPart(java.lang.Object, int,
* org.eclipse.emf.eef.runtime.api.parts.IPropertiesEditionPart)
*
*/
public void setPropertiesEditionPart(java.lang.Object key, int kind, IPropertiesEditionPart propertiesEditionPart) {
if (FlowViewsRepository.Flow_.class == key) {
super.setPropertiesEditionPart(key, kind, propertiesEditionPart);
flowPart = (FlowPropertiesEditionPart)propertiesEditionPart;
}
}
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.impl.components.ComposedPropertiesEditionComponent#
* initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*
*/
public void initPart(java.lang.Object key, int kind, EObject element, ResourceSet allResource) {
if (key == FlowViewsRepository.Flow_.class) {
super.initPart(key, kind, element, allResource);
}
if (key == EnvironmentViewsRepository.Metadatas.class) {
super.initPart(key, kind, element, allResource);
}
}
}
| [
"mathieu.cartaud@obeo.fr"
] | mathieu.cartaud@obeo.fr |
a3c925583d1091f1821343e270f2a6e1cb746e0a | d5b342dd8e087af7eaca1dad42f3e7b8704ab64a | /app/src/test/java/com/example/android/applifecyclecallbacks/ExampleUnitTest.java | 523880ef47930bc77ba65fdd68783639b0fa598d | [] | no_license | NaotoSama/AppLifecycleCallbacks_Udacity | 47b4f5e4ff8a44155f82d4ca3e72a098561d6f8f | dd6892f4b0e614beb24c473cca11d03a5e7ccfb4 | refs/heads/master | 2020-03-27T07:53:26.029908 | 2018-08-26T17:33:16 | 2018-08-26T17:33:16 | 146,201,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 402 | java | package com.example.android.applifecyclecallbacks;
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);
}
} | [
"42671784+NaotoSama@users.noreply.github.com"
] | 42671784+NaotoSama@users.noreply.github.com |
93ec8db7418b5169a71d1b0ee8164041466f615f | 43ea91f3ca050380e4c163129e92b771d7bf144a | /services/mpc/src/main/java/com/huaweicloud/sdk/mpc/v1/model/CreateMergeChannelsTaskRequest.java | eecb4ac77c08d4b1bf5b415feff277570fc956ef | [
"Apache-2.0"
] | permissive | wxgsdwl/huaweicloud-sdk-java-v3 | 660602ca08f32dc897d3770995b496a82a1cc72d | ee001d706568fdc7b852792d2e9aefeb9d13fb1e | refs/heads/master | 2023-02-27T14:20:54.774327 | 2021-02-07T11:48:35 | 2021-02-07T11:48:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,312 | java | package com.huaweicloud.sdk.mpc.v1.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.huaweicloud.sdk.mpc.v1.model.CreateMergeChannelsReq;
import java.util.function.Consumer;
import java.util.Objects;
/**
* Request Object
*/
public class CreateMergeChannelsTaskRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="body")
private CreateMergeChannelsReq body = null;
public CreateMergeChannelsTaskRequest withBody(CreateMergeChannelsReq body) {
this.body = body;
return this;
}
public CreateMergeChannelsTaskRequest withBody(Consumer<CreateMergeChannelsReq> bodySetter) {
if(this.body == null ){
this.body = new CreateMergeChannelsReq();
bodySetter.accept(this.body);
}
return this;
}
/**
* Get body
* @return body
*/
public CreateMergeChannelsReq getBody() {
return body;
}
public void setBody(CreateMergeChannelsReq body) {
this.body = body;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateMergeChannelsTaskRequest createMergeChannelsTaskRequest = (CreateMergeChannelsTaskRequest) o;
return Objects.equals(this.body, createMergeChannelsTaskRequest.body);
}
@Override
public int hashCode() {
return Objects.hash(body);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateMergeChannelsTaskRequest {\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
7ef18295a22400f9cdf6bb56a6b9e833a52f66f1 | fd981671150bf05f7a19f650e97ad564da7927dd | /src/me/rezscripts/rpg/spells/archer/ExplodingArrow.java | 4cb9323d82126e98a195fbf0e4db0b210ad57c7d | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | RezScripts/RPG | e217e1d223592bf22dbfac070336069624907054 | 0de76e8db32fbf92ec3add35e7afb9023c8e0ebf | refs/heads/master | 2020-05-01T06:25:54.303565 | 2019-03-23T19:26:44 | 2019-03-23T19:26:44 | 177,330,015 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,604 | java | package me.rezscipts.rpg.spells.archer;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.metadata.FixedMetadataValue;
import me.rezscipts.rpg.PlayerDataRPG;
import me.rezscipts.rpg.spells.Spell;
import me.rezscipts.rpg.spells.SpellEffect;
import me.rezscipts.rpgexperience.utils.RMetadata;
public class ExplodingArrow extends SpellEffect {
@Override
public boolean cast(Player p, final PlayerDataRPG pd, int level) {
int damage = pd.getDamage(true);
switch (level) {
case 1:
damage *= 1.3;
break;
case 2:
damage *= 1.5;
break;
case 3:
damage *= 1.7;
break;
case 4:
damage *= 1.9;
break;
case 5:
damage *= 2.1;
break;
case 6:
damage *= 2.3;
break;
case 7:
damage *= 2.5;
break;
case 8:
damage *= 2.7;
break;
case 9:
damage *= 2.9;
break;
case 10:
damage *= 3.1;
break;
}
Projectile arrow = pd.shootArrow();
arrow.setMetadata(RMetadata.META_DAMAGE, new FixedMetadataValue(Spell.plugin, 1));
arrow.setMetadata(RMetadata.META_EXPLODE, new FixedMetadataValue(Spell.plugin, damage));
Spell.notify(p, "You shoot an explosive arrow");
return true;
}
}
| [
"47779938+RezScripts@users.noreply.github.com"
] | 47779938+RezScripts@users.noreply.github.com |
2a45b0dd317f9cc8949c84bb6a992ea05bd7693c | 038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad | /schemaOrgDomaConv/src/org/kyojo/schemaOrg/m3n3/doma/core/container/EqualConverter.java | a394c2303dda0f5eb200405d1cf7a9155362d534 | [
"Apache-2.0"
] | permissive | nagaikenshin/schemaOrg | 3dec1626781913930da5585884e3484e0b525aea | 4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8 | refs/heads/master | 2021-06-25T04:52:49.995840 | 2019-05-12T06:22:37 | 2019-05-12T06:22:37 | 134,319,974 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | package org.kyojo.schemaorg.m3n3.doma.core.container;
import org.seasar.doma.ExternalDomain;
import org.seasar.doma.jdbc.domain.DomainConverter;
import org.kyojo.schemaorg.m3n3.core.impl.EQUAL;
import org.kyojo.schemaorg.m3n3.core.Container.Equal;
@ExternalDomain
public class EqualConverter implements DomainConverter<Equal, String> {
@Override
public String fromDomainToValue(Equal domain) {
return domain.getNativeValue();
}
@Override
public Equal fromValueToDomain(String value) {
return new EQUAL(value);
}
}
| [
"nagai@nagaikenshin.com"
] | nagai@nagaikenshin.com |
2cd66e1599df72c8ca7eab35173aa6410eda35ee | fb81dd63a72f15dd6cc48bcf124e5a05d3bb3bd6 | /Easy/Plus Minus.java | be2141d6ec65e2e2fec887b0b5abb170f6365dce | [] | no_license | emremrah/hackerrank-solutions | 4d43dd7878d48a06bda37be64156f37d2ba3593b | 789771a3910993878a0aebbda01d10bce3f4fe65 | refs/heads/master | 2020-03-16T22:37:37.722683 | 2018-05-12T18:47:58 | 2018-05-12T18:47:58 | 133,046,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,128 | java | /*
https://www.hackerrank.com/challenges/plus-minus/problem
*/
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
import java.util.regex.*;
public class Solution {
/*
* Complete the plusMinus function below.
*/
static void plusMinus(int[] arr) {
int pos=0, neg=0, zer=0;
for (int i = 0; i < arr.length; i++) {
if (arr[i] > 0) pos++;
else if (arr[i] < 0) neg++;
else zer++;
}
System.out.println((float)pos / arr.length);
System.out.println((float)neg / arr.length);
System.out.println((float)zer / arr.length);
}
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
int n = Integer.parseInt(scan.nextLine().trim());
int[] arr = new int[n];
String[] arrItems = scan.nextLine().split(" ");
for (int arrItr = 0; arrItr < n; arrItr++) {
int arrItem = Integer.parseInt(arrItems[arrItr].trim());
arr[arrItr] = arrItem;
}
plusMinus(arr);
}
}
| [
"emre95@gmail.com"
] | emre95@gmail.com |
31c15e56b1bfe2037c2a400f863e842d74bce5ac | 482de50bc1949675afbce93b7064ebe9b283728d | /xc-framework-model/src/main/java/com/xuecheng/framework/domain/course/TeachplanMediaPub.java | 0d7e7d926892119cc5c6d94213a41521e6f2bd6f | [] | no_license | luoyecheng/XcLearining | 6c3950cd593eac75f0a6093385d03a0ece2439c7 | b21c68105c347ec2a79dc80a38fbf089dd180e08 | refs/heads/master | 2023-04-03T19:45:52.239356 | 2021-03-02T14:00:15 | 2021-03-02T14:00:15 | 343,771,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 933 | java | package com.xuecheng.framework.domain.course;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@Data
@ToString
@Entity
@Table(name="teachplan_media_pub")
@GenericGenerator(name = "jpa-assigned", strategy = "assigned")
public class TeachplanMediaPub implements Serializable {
private static final long serialVersionUID = -916357110051689485L;
@Id
@GeneratedValue(generator = "jpa-assigned")
@Column(name="teachplan_id")
private String teachplanId;
@Column(name="media_id")
private String mediaId;
@Column(name="media_fileoriginalname")
private String mediaFileOriginalName;
@Column(name="media_url")
private String mediaUrl;
@Column(name="courseid")
private String courseId;
@Column(name="timestamp")
private Date timestamp;//时间戳
}
| [
"luobolyc@163.com"
] | luobolyc@163.com |
8a316838aa3822fcbb88170f4eb16893676ba934 | ea0d0be52c92131ea5cbe643bdf3647b9e82bc12 | /src/main/java/coding/interview/Factorial.java | eccf41ae92034293a0d45a55b482b8b98a8a70c0 | [] | no_license | tarikadeepak/JavaInterviewPrep | 69249da0a28899402c862117fbf73d6d5dd7f251 | 55110c523d46cc9aa64244182efd79d96f6aad0a | refs/heads/master | 2022-12-11T08:04:36.109531 | 2020-09-17T00:11:36 | 2020-09-17T00:11:36 | 295,919,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 154 | java | package coding.interview;
public class Factorial {
int calculateFactorial(int n) {
if(n == 1)
return n;
return n * calculateFactorial(n-1);
}
}
| [
"tarikadeepak@gmail.com"
] | tarikadeepak@gmail.com |
f61ac8df2d145ddcb015c64400f09f89ef21d95a | c634236c7fb442dde4913c665f89a46a5703583b | /Eem/libs/src/main/java/com/souja/lib/utils/pageTransformer/ZoomInTransform.java | e9f1e4d01b8fccbe687df29e62b010160198e2cb | [] | no_license | souja/EEM | 117850a4089e1bf95ee7a6d7e813bc0775503bf4 | 5f875eb0045260cd7bc0366c2ff0cb72e6a89fe7 | refs/heads/master | 2020-05-03T02:02:01.711413 | 2019-09-24T02:27:17 | 2019-09-24T02:27:17 | 178,355,871 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | package com.souja.lib.utils.pageTransformer;
import android.support.v4.view.ViewPager;
import android.view.View;
import org.xutils.common.util.LogUtil;
public class ZoomInTransform implements ViewPager.PageTransformer {
@Override
public void transformPage(View page, float position) {
int width = page.getWidth();
int height = page.getHeight();
//這裏只對右邊的view做了操作
if (position > 0 && position <= 1) {//right scorlling
//position是1.0->0,但是沒有等於0
LogUtil.e("right----position====" + position);
//設置該view的X軸不動
page.setTranslationX(-width * position);
//設置縮放中心點在該view的正中心
page.setPivotX(width / 2);
page.setPivotY(height / 2);
//設置縮放比例(0.0,1.0]
page.setScaleX(1 - position);
page.setScaleY(1 - position);
} else if (position >= -1 && position < 0) {//left scrolling
} else {//center
}
}
} | [
"782579195@qq.com"
] | 782579195@qq.com |
ee5637d557f5b0e12385a4b77311e823d1f220eb | 2a5c638d9e109488ea2e89e2c28184a3ac48a7c4 | /Perulangan/src/com/dicoding/javafundamental/perulangan/ForBersarang.java | 87e4ebebc4ef1ab60c2d90b393eabf57af5e4e2c | [] | no_license | ArdianChambera/DicodingJava-PBOLanjut | 0602895932d392c72be19e2cddf5bf4cf2468e14 | 788e1663ebff93fe8695ad34f09a5d6dd495ae9b | refs/heads/master | 2023-04-06T18:05:13.780099 | 2021-04-24T14:39:17 | 2021-04-24T14:39:17 | 358,510,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.dicoding.javafundamental.perulangan;
public class ForBersarang {
public static void main(String[] args) {
int a = 5;
for (int i = 0; i <= a; i++){
for (int j = 0; j <= i; j++) {
System.out.print("*");
}
System.out.println("");
}
}
}
| [
"ardiancambera@gmail.com"
] | ardiancambera@gmail.com |
bb99f0bea3eec7e0d48082cd5cf4f2231866746e | 359e5b7842e810a7c5a64e0bc9104618ad7a66e8 | /src/java/Controller/LibroController.java | 116a72416f66171b3404939ad5fbccaa51eec544 | [] | no_license | KOMVA3/TIS-BIBLIOTECA | 9dfe02c2618427c99ca82150370718b58e2c2de5 | e4781289c004d8013e322d91ebcab9f4f4617ba9 | refs/heads/master | 2020-09-10T19:05:42.100228 | 2019-11-15T00:09:14 | 2019-11-15T00:09:14 | 221,808,800 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,342 | 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 Controller;
import model.Libro;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author crfsy
*/
@WebServlet(name = "LibroController", urlPatterns = {"/LibroController"})
public class LibroController 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");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet LibroController</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet LibroController at " + request.getContextPath() + "</h1>");
out.println("</body>");
out.println("</html>");
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String palabra=request.getParameter("palabra");
String accion=request.getParameter("accion");
if (accion.equals("buscar")){
request.getRequestDispatcher("user_view_biblio.jsp").forward(request, response);
}
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"prueba@prueba.com"
] | prueba@prueba.com |
f6814626ebd1067842e4922bfd34618db1fd3c8e | da43836d728650803c8ae5ce776fbcc8c1513f07 | /ace-gate/ace-gateway-v2/src/main/java/com/bitcola/exchange/security/gate/v2/feign/IUserService.java | 9484fe8e418d20f54b31a50b0eaee493039b32a7 | [
"Apache-2.0"
] | permissive | wxpkerpk/exchange-base-examlple | 36253f96a1e478365feabad183636675ee1e4f4c | acb61eb9d8316c5cf290481362560203eaf682a7 | refs/heads/master | 2022-06-28T12:19:17.730542 | 2019-07-11T16:38:51 | 2019-07-11T16:38:51 | 196,430,856 | 1 | 4 | Apache-2.0 | 2022-06-21T01:26:27 | 2019-07-11T16:34:47 | Java | UTF-8 | Java | false | false | 1,206 | java | package com.bitcola.exchange.security.gate.v2.feign;
import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import com.bitcola.exchange.security.gate.v2.fallback.UserServiceFallback;
import com.bitcola.exchange.security.api.vo.authority.PermissionInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;
/**
* ${DESCRIPTION}
*
* @author wx
* @create 2017-06-21 8:11
*/
@FeignClient(value = "ace-admin",fallback = UserServiceFallback.class)
public interface IUserService {
@RequestMapping(value="/api/user/un/{username}/permissions",method = RequestMethod.GET)
@Cached(name="getPermissionByUsername-", key="#username", expire = 120,cacheType = CacheType.LOCAL)
List<PermissionInfo> getPermissionByUsername(@PathVariable("username") String username);
@Cached(name="getAllPermissionInfo", expire = 60,cacheType = CacheType.LOCAL)
@RequestMapping(value="/api/permissions",method = RequestMethod.GET)
List<PermissionInfo> getAllPermissionInfo();
}
| [
"120443910@qq.com"
] | 120443910@qq.com |
40f5e578702a76992e0b6ae8424ca6e2096c5bb9 | 1263588f64861ad6a06571ef31ec52507a92f298 | /app/src/main/java/at/ac/univie/hci/btctracker/Data/Transaction.java | 5007589c7ebdf1c98d5a2c5c2a91cd6fbbe78951 | [] | no_license | zhanata88/bitcoin_tracker | 74ec5424503870b44f1714bb6782c6af4fbfddec | cecf3b4c1c586678fdc13958e67b543422fa86ce | refs/heads/master | 2020-04-21T14:13:28.450371 | 2019-02-07T20:01:05 | 2019-02-07T20:01:05 | 169,627,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,150 | java | package at.ac.univie.hci.btctracker.Data;
import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
/**
* Created by rabizo on 23.04.2018.
*/
public class Transaction implements Serializable{
private int transactionId;
private String currencyId;
private Double priceInBtc;
private Double priceInUsd;
private Double priceInEur;
private int image;
private String date;
private Double amountOfTransaction;
private String buy; //if transaction is sell than buy = false;
public Transaction(int transactionId, String currencyId, Double priceInBtc, Double priceInUsd, Double priceInEur,
Double amountOfTransaction, String buy, int image, String date) {
this.transactionId = transactionId;
this.currencyId = currencyId;
this.priceInBtc = priceInBtc;
this.priceInUsd = priceInUsd;
this.priceInEur = priceInEur;
this.amountOfTransaction = amountOfTransaction;
this.buy = buy;
this.image = image;
this.date = date;
}
public int getTransactionId() {
return transactionId;
}
public void setTransactionId(int transactionId) {
this.transactionId = transactionId;
}
public String getCurrencyId() {
return currencyId;
}
public void setCurrencyId(String currencyId) {
this.currencyId = currencyId;
}
public Double getPriceInBtc() {
return priceInBtc;
}
public void setPriceInBtc(Double priceInBtc) {
this.priceInBtc = priceInBtc;
}
public Double getPriceInUsd() {
return priceInUsd;
}
public void setPriceInUsd(Double priceInUsd) {
this.priceInUsd = priceInUsd;
}
public Double getPriceInEur() {
return priceInEur;
}
public void setPriceInEur(Double priceInEur) {
this.priceInEur = priceInEur;
}
public Double getAmountOfTransaction() {
return amountOfTransaction;
}
public void setAmountOfTransaction(Double amountOfTransaction) {
this.amountOfTransaction = amountOfTransaction;
}
public String getBuy() {
return buy;
}
public void setBuy(String buy) {
this.buy = buy;
}
public int getImage() {
return image;
}
public void setImage(int image) {
this.image = image;
}
public void setDate(String date) {
DateFormat df = new SimpleDateFormat("yyyy.MM.dd");
//Date date1=df.format(date);
}
public String getDate() {
return this.date;
}
@Override
public String toString() {
return "Transaction{" +
"transactionId=" + this.transactionId +
", currencyId='" + this.currencyId + '\'' +
", priceInBtc=" + this.priceInBtc +
", priceInUsd=" + this.priceInUsd +
", priceInEur=" + this.priceInEur +
", amountOfTransaction=" + this.amountOfTransaction +
", buy=" + this.buy +
'}';
}
}
| [
"a01449508@unet.univie.ac.at"
] | a01449508@unet.univie.ac.at |
39d8bd278377d02365a2100900454f84fa2889e8 | 74a56b8e657762f8b03b9b7bcadf74caed868e4b | /src/adrianpaz2.java | 939be9ee524e0f9c7b8f7bb05d4810e4016159fb | [
"Apache-2.0"
] | permissive | mrtnmmn/JavaPracticeHacktoberfest | 6b3d3e3053936b64addbd17a01a83be96916c2ec | 9c5d93a22391696a59e682bc4d60f43a484b9b05 | refs/heads/master | 2023-08-23T14:01:44.428372 | 2021-10-05T12:16:31 | 2021-10-05T12:16:31 | 413,803,069 | 0 | 0 | Apache-2.0 | 2021-10-05T12:11:48 | 2021-10-05T12:11:47 | null | UTF-8 | Java | false | false | 206 | java | public class adrianpaz2 {
public static void main(String[] args) {
int num1 = 1;
int num2 = 5;
int suma;
suma = num1 + num2;
System.out.println("La suma es: "+suma);
}
}
| [
"adrian.paz.97@gmail.com"
] | adrian.paz.97@gmail.com |
96bb6cafcfb0c5c12dd68876716c60f0c83b76b6 | f2c03c784f9999e0e9219c84fda342a202678b96 | /5book/src/com/it/dao/UserDao.java | 99195aa0a8e77e346f9049a3d0d67f119a19d486 | [] | no_license | zzj314/JavaWeb | c284eb5ebb14bedb8ea91d6bfee2a193d967f7c3 | bef0018485a5fbea1af9e3730bdd366dfadf3795 | refs/heads/master | 2023-01-08T02:34:38.790273 | 2020-11-04T13:51:34 | 2020-11-04T13:51:34 | 310,017,048 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 249 | java | package com.it.dao;
import com.it.pojo.User;
public interface UserDao {
public User queryUserByUsername(String username);
public User queryUserByUsernameAndPassword(String username,String password);
public int saveUser(User user);
}
| [
"757164273@qq.com"
] | 757164273@qq.com |
ab21e5e970727cddad3771942edb33a3c084a447 | 7197f6e4de2d5bd7a7df303a61460808f014616e | /src/main/java/structural/decorate/Shape.java | 48fd315ae7c87e9249b7cb802180cd55d77ce0a4 | [
"Apache-2.0"
] | permissive | githubmnume/Design-Pattern-In-Java | c69029ec16f2c66a3b001dcc7c85c05f9399dbcb | c9b3978d410bb2667d841a04f2af7750b6800d2e | refs/heads/master | 2020-04-08T18:48:16.825041 | 2018-11-29T07:43:27 | 2018-11-29T07:43:27 | 159,625,741 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 71 | java | package structural.decorate;
public interface Shape {
void draw();
}
| [
"feng.zhou@tieto.com"
] | feng.zhou@tieto.com |
9971cf58e830f858dfb20095be2777f6838a86ad | 2d666e65b8fce172523b4814d34bb88fdccf4a92 | /Basics/SortingDemo.java | b74d9890cb48579e825cb1574dadde5016849ab4 | [] | no_license | agnelrayan/java | b95c89a31f075edfa8c4b4b3ff3c1734da89119a | 3f6ba7b48320957e0f930e37f910cd041e4121ae | refs/heads/master | 2021-01-01T16:46:57.881527 | 2018-06-08T11:46:20 | 2018-06-08T11:46:20 | 97,918,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,120 | java | package com.expertzlab.Basics;
import java.util.Scanner;
/**
* Created by agnel on 3/5/18.
*/
public class SortingDemo {
public static void main(String[] args)
{
Scanner obj = new Scanner(System.in);
System.out.println("Enter the number to sort");
int input = obj.nextInt();
int a[] = new int[input];
System.out.println("Enter all the elements");
for(int i = 0;i<a.length;i++)
{
a[i] = obj.nextInt();
}
System.out.println("Print the given elements");
for(int i = 0;i<a.length;i++){
System.out.println(" " + a[i]);
}
sort(a);
System.out.println("After Sortting..");
for(int i=0;i<a.length;i++){
System.out.println(" "+a[i]);
}
}
public static void sort(int a[]){
for(int i=0;i<a.length-1;i++){
for(int j=0;j<a.length-1;j++){
if(a[j]>a[j+1]){
int temp = a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
}
}
| [
"agnelrayan@gmail.com"
] | agnelrayan@gmail.com |
68577c4d6732cfc51b1b7d799b6babd1d5656dad | e969c8380add19d1019ae96ced3520b5b279a546 | /src/main/java/com/brain/crud/socialclub/model/Friend.java | 1f4ddb7d6ee58b1870ccce845a6c3eb6cab024d2 | [] | no_license | Wolfpredator/socialAvtoClub | 3b5a227d8ea92f8e368da9d7878c02d5396ce556 | f0c32a78ecf126e80381688b54d4871bd8c79e36 | refs/heads/master | 2021-05-11T22:55:00.720863 | 2018-01-15T06:21:24 | 2018-01-15T06:21:24 | 117,504,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | package com.brain.crud.socialclub.model;
public class Friend {
private Long idFriend;
private Enum status;
public enum FriendStatus {
Subscribe,
SubscribeOnYou,
Friend
}
public Friend(Long idFriend, int idStatus) {
this.idFriend = idFriend;
parseStatus(idStatus);
}
public Long getIdFriend() {
return idFriend;
}
public Enum getStatus() {
return status;
}
private void parseStatus(int idForParse) {
switch (idForParse) {
case 0:
status = FriendStatus.Subscribe;
break;
case 1:
status = FriendStatus.SubscribeOnYou;
break;
case 2:
status = FriendStatus.Friend;
break;
default:
status = null;
}
}
}
| [
"motocross.ru@mail.ru"
] | motocross.ru@mail.ru |
bb46eb3747eed5a3ae62aca44c24947409dbf777 | aa411b1ecebada09fba2c8adaff596d59c79464f | /android/app/src/main/java/com/jigsaw/MainApplication.java | 59b3d3a45e3246d2c13c695900be7b5a402b12db | [] | no_license | ganganahmad1/rn-puzzle | 3403ea1fe4650d0905c656d94d225fc69c3e807c | 53cd0ff8fa9d983f29ac9e75d30f3ad00dd0ed7b | refs/heads/master | 2023-02-08T08:10:55.885359 | 2020-12-30T03:36:33 | 2020-12-30T03:36:33 | 325,445,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,708 | java | package com.jigsaw;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import fr.greweb.reactnativeviewshot.RNViewShotPackage;
import org.reactnative.maskedview.RNCMaskedViewPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.jigsaw.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"ganganahmad1@gmail.com"
] | ganganahmad1@gmail.com |
d6e24d50057a69c9e4c0c200079dfb2b7945a19b | ab92261ef3c0010f254304df5131f0952c0965e4 | /app/src/main/java/deb/com/firebaseapp/BlogDetails.java | b4427655382728a2d1f39ef4be66ef2b51b05419 | [] | no_license | PalashRoy975/Explore_BD_final | aead48f747451e9286fc698a740a1d705cd39f88 | 5dfa3320a30cf0ccc25c37b70c855f8afcf2da4f | refs/heads/master | 2021-07-25T14:52:33.415121 | 2017-11-07T17:09:28 | 2017-11-07T17:09:28 | 109,866,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,642 | java | package deb.com.firebaseapp;;
import android.os.Parcel;
import android.os.Parcelable;
/**
* Created by palash on 9/26/17.
*/
public class BlogDetails implements Parcelable {
String tourId,tourName,tourdis;
String tourGenre;
String season;
float rb;
String guname;
String email;
String guno;
String gudesc;
String desc;
String image;
private long timeMilli;
int likes;
public BlogDetails() {
}
public BlogDetails(String image, String tourId, String tourName,String tourdis, String email, String tourGenre, String season, float rb, String guname, String guno, String gudesc, String desc, int likes) {
this.image = image;
this.tourId = tourId;
this.tourName = tourName;
this.tourdis = tourdis;
this.tourGenre = tourGenre;
this.season = season;
this.rb = rb;
this.guname = guname;
this.guno = guno;
this.gudesc = gudesc;
this.desc = desc;
this.email = email;
this.likes=likes;
// this.timeMilli=timeMilli;
}
public String getTourdis() {
return tourdis;
}
public void setTourdis(String tourdis) {
this.tourdis = tourdis;
}
public String getTourId() {
return tourId;
}
public void setTourId(String tourId) {
this.tourId = tourId;
}
public String getTourName() {
return tourName;
}
public void setTourName(String tourName) {
this.tourName = tourName;
}
public String getTourGenre() {
return tourGenre;
}
public void setTourGenre(String tourGenre) {
this.tourGenre = tourGenre;
}
public String getSeason() {
return season;
}
public void setSeason(String season) {
this.season = season;
}
public float getRb() {
return rb;
}
public void setRb(float rb) {
this.rb = rb;
}
public String getGuname() {
return guname;
}
public void setGuname(String guname) {
this.guname = guname;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getGuno() {
return guno;
}
public void setGuno(String guno) {
this.guno = guno;
}
public String getGudesc() {
return gudesc;
}
public void setGudesc(String gudesc) {
this.gudesc = gudesc;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public long getTimeMilli() {
return timeMilli;
}
public void setTimeMilli(long timeMilli) {
this.timeMilli = timeMilli;
}
public int getLikes() {
return likes;
}
public void setLikes(int likes) {
this.likes = likes;
}
public static Creator<BlogDetails> getCREATOR() {
return CREATOR;
}
protected BlogDetails(Parcel in) {
image = in.readString();
tourId = in.readString();
tourName = in.readString();
tourdis=in.readString();
tourGenre = in.readString();
season = in.readString();
rb = in.readFloat();
guname = in.readString();
email = in.readString();
guno = in.readString();
gudesc = in.readString();
desc = in.readString();
likes=in.readInt();
// timeMilli=in.readLong();
}
public static final Creator<BlogDetails> CREATOR = new Creator<BlogDetails>() {
@Override
public BlogDetails createFromParcel(Parcel in) {
return new BlogDetails(in);
}
@Override
public BlogDetails[] newArray(int size) {
return new BlogDetails[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(image);
parcel.writeString(tourId);
parcel.writeString(tourName);
parcel.writeString(tourdis);
parcel.writeString(tourGenre);
parcel.writeString(season);
parcel.writeFloat(rb);
parcel.writeString(guname);
parcel.writeString(email);
parcel.writeString(guno);
parcel.writeString(gudesc);
parcel.writeString(desc);
parcel.writeInt(likes);
// parcel.writeLong(timeMilli);
}
}
| [
"palashroy975@gmail.com"
] | palashroy975@gmail.com |
e54c17a5c78ca9f7113cc57dd76143f65d0cc75b | 9b55fd3d1b0b7ece2a32a4896f05119186cf1815 | /Lab7/src/Lab7.java | 91161306dfa9769fba6482ba88c6c9047f391ea4 | [] | no_license | ItsCoolOnMars/Labs-for-CS2004 | 2a2ac7a4ec8ea5ee379e403e8b4de7c1042ba3db | 2c804e51b6f2d080600ee743ce945021e4b95d24 | refs/heads/master | 2020-04-29T11:44:07.182880 | 2019-03-17T20:56:59 | 2019-03-17T20:56:59 | 176,110,196 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,554 | java | import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
public class Lab7 {
public static void PrintArray (double [][] array){
System.out.println(Arrays.deepToString(array));
}
public static double[][] RandomArray(int n){
Random rand = new Random();
double matrix[][] = new double[n][n];
for(int i = 0; i < n; i++) {
for(int j = 0+i; j < n; j++) {
if(i==j) {
matrix[i][j]=0;
}else {
rand.setSeed(System.nanoTime());
Integer r = Math.abs(rand.nextInt() % 101);
matrix[i][j]=r;
matrix[j][i]=matrix[i][j];
}
}
}
return matrix;
}
public static long RunAlgorithm(int n)
{
long StartTime, EndTime, ElapsedTime;
double g[][] = RandomArray(n);
// Save the time before the algorithm run
StartTime=System.nanoTime();
// Run the algorithm
MST.PrimsMST(g);
// Save the time after the run
EndTime=System.nanoTime();
// Calculate the difference
ElapsedTime= EndTime- StartTime;
return ElapsedTime;
}
public static void main(String[] args) {
// Exercise 1
// double g[][] = {{0,1,2},{1,0,3},{2,3,0}};
// double mst[][] = MST.PrimsMST(g);
// PrintArray(mst);
// Exercise 2
// double g[][] = {{0,1,2,3,0},{1,0,6,0,5},{2,6,0,4,1},{3,0,4,0,2},{0,5,2,1,0}};
// double mst[][] = MST.PrimsMST(g);
// PrintArray(mst);
// Exercise 3
System.out.println("size,time");
for(int i = 100; i<=500;i+=10) {
for(int j = 0; j<10;j++) {
System.out.println(i+","+RunAlgorithm(i));
}
}
}
}
| [
"1625765@brunel.ac.uk,mxuswork@gmail.com"
] | 1625765@brunel.ac.uk,mxuswork@gmail.com |
d087ade2f3dcecacb182152821401f6ec02e4fbe | 024bc11966dfbd8049a10c306025fa6bbcdeba29 | /src/com/vincent/practice/multithread/forkjoinpool/MyRecursiveAction.java | 74ec5ab21c8a65023de2d2eaa7f05a67ebc86131 | [] | no_license | ys588281/leetcode_practice | 5b8e4f8cca1519ff3d89d7d0b0d0c238c1cfb622 | 6f3ecdc18b95d906dc31d9e8faae3b4e6a9d8d29 | refs/heads/main | 2023-02-24T17:44:13.198698 | 2021-01-29T14:21:55 | 2021-01-29T14:21:55 | 334,167,143 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 870 | java | package com.vincent.practice.multithread.forkjoinpool;
import java.util.concurrent.RecursiveAction;
public class MyRecursiveAction extends RecursiveAction {
private static final int MAX = 5;
private int start;
private int end;
public MyRecursiveAction(int start, int end) {
this.start = start;
this.end = end;
}
@Override
protected void compute() {
if (end - start < MAX) {
for (int i = start; i < end; i++) {
System.out.println(Thread.currentThread().getName() + " i value : " + i);
}
} else {
int middle = start + (end - start) / 2;
MyRecursiveAction left = new MyRecursiveAction(start, middle);
MyRecursiveAction right = new MyRecursiveAction(middle, end);
left.fork();
right.fork();
}
}
}
| [
"yuhsiang.wen@paypay-corp.co.jp"
] | yuhsiang.wen@paypay-corp.co.jp |
318f2da0c55731c62e0e0ffcc78e66d0e3576561 | 7d28a9cd32fa011e8b7b776f99d8cbf41b6da954 | /Java_2/Lesson2/src/MyArrayDataException.java | 3a6474a3e3729b494945bcb714a79f346cdb2db8 | [] | no_license | sablist99/GeekBrains | 009f0845b1e762ecfaecfcf5745f9ca09bd2fbf5 | 0ef179a8118d67d5d12a0dfc7727d7f6d18fd942 | refs/heads/master | 2022-11-17T17:58:53.320129 | 2020-07-17T15:38:59 | 2020-07-17T15:38:59 | 272,999,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | public class MyArrayDataException extends NumberFormatException {
private String mes;
public String getMes() {
return mes;
}
public MyArrayDataException(String s) {
mes = s;
}
}
| [
"53463825+sablist99@users.noreply.github.com"
] | 53463825+sablist99@users.noreply.github.com |
18a1ab3339e0bfd1bf081608e056067dc912c7f5 | a862bde3982a11e8a08739634470cdce15ee3f78 | /src/main/java/com/neuedu/vo/QinfoVo.java | f3ce4675d1f37324e6170ed397395b8670d81664 | [] | no_license | guoyang123/qinfo-20180927 | d3289476b40fca376b2ee0e0580b3fde4a9b5370 | 43e3ba4236deae2c90200e4223aa9d898630e46d | refs/heads/master | 2020-03-30T00:39:44.746565 | 2018-10-18T01:04:19 | 2018-10-18T01:04:19 | 150,535,880 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,454 | java | package com.neuedu.vo;
import java.io.Serializable;
/**
* 创建问卷后返回前端的vo类
*
* */
public class QinfoVo implements Serializable {
private String qno;//编号
private String qtitle;//问卷标题
private String result;// 1:succ 0:fail
private String message;//失败信息
public QinfoVo() {
}
public QinfoVo(String qno, String qtitle, String result, String message) {
this.qno = qno;
this.qtitle = qtitle;
this.result = result;
this.message = message;
}
public String getQno() {
return qno;
}
public void setQno(String qno) {
this.qno = qno;
}
public String getQtitle() {
return qtitle;
}
public void setQtitle(String qtitle) {
this.qtitle = qtitle;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String toString() {
return "QinfoVo{" +
"qno='" + qno + '\'' +
", qtitle='" + qtitle + '\'' +
", result='" + result + '\'' +
", message='" + message + '\'' +
'}';
}
}
| [
"3137772593@qq.com"
] | 3137772593@qq.com |
2e922a5442f0506d6af9a11e861fe80e509f1bfd | 770c9b6eb6666a5d6820d3c52b020277ea4b46a3 | /app/src/main/java/com/shlyren/mobilesecurity/LossFindSetup2Activity.java | c6de4dd52653d0f7ee528d93c4b2e76f3617764c | [
"MIT"
] | permissive | shlyren/MobileSecurity-Android | 380aac4d44726ebb4198ea758f97283551aa3158 | 35222710fa83a1a0f81881a98e5755026ffde063 | refs/heads/master | 2021-01-22T05:15:59.167499 | 2017-02-15T10:22:07 | 2017-02-15T10:22:07 | 81,636,581 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,151 | java | package com.shlyren.mobilesecurity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.TextView;
/**
* Created by yuxiang on 2017/2/14.
*/
public class LossFindSetup2Activity extends BaseSetupActivity {
private CheckBox cb_banding_sim;
private TextView tv_banding_sim;
private SharedPreferences setting;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lossfindsetup2);
cb_banding_sim = (CheckBox) findViewById(R.id.cb_banding_sim);
tv_banding_sim = (TextView) findViewById(R.id.tv_banding_sim);
setting = getApplication().getSharedPreferences("setting", MODE_PRIVATE);
cb_banding_sim.setChecked(!setting.getString("sim_num", "").isEmpty());
if (cb_banding_sim.isChecked()) {
tv_banding_sim.setText("sim卡已绑定");
}else {
tv_banding_sim.setText("sim卡未绑定");
}
}
public void banding_sim(View view) {
SharedPreferences.Editor edit = setting.edit();
if (cb_banding_sim.isChecked()) { // 解绑
edit.putString("sim_num", "");
tv_banding_sim.setText("sim卡未绑定");
}else { //绑定
// TelephonyManager tm = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE);
// String line1Number = tm.getLine1Number(); // 获取sim绑定的电话号码
// String sim = tm.getSimSerialNumber(); // 获取sim卡序列号
edit.putString("sim_num", "sim");
tv_banding_sim.setText("sim卡已绑定");
}
cb_banding_sim.setChecked(!cb_banding_sim.isChecked());
edit.commit();
}
@Override
public void next_activity() {
startActivity(new Intent(this, LossFindSetup3Activity.class));
finish();
}
@Override
public void pre_activity() {
startActivity(new Intent(this, LossFindSetup1Activity.class));
finish();
}
}
| [
"mail@yuxiang.ren"
] | mail@yuxiang.ren |
c4376418857a45e5c384dee794a940a86e66b177 | 65b3f179b3b5097c63f5fbcf132745be5e83478d | /src/main/java/com/insidecoding/opium/agent/os/OsCommand.java | 2ce33e64487e01807e7a199385f3f7504b4dbeb9 | [
"Apache-2.0"
] | permissive | ludovicianul/opium.agent | 8872f8d5344c8dff85bb9e7112f6be4f71c34f4d | df0c6379a70a478e52b4704117c4056de3e10801 | refs/heads/master | 2021-01-17T13:03:26.637800 | 2020-03-03T12:41:10 | 2020-03-03T12:41:10 | 59,685,153 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,348 | java | package com.insidecoding.opium.agent.os;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.PumpStreamHandler;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
public abstract class OsCommand {
private static final int DEFAULT_PROC_TIMEOUT = 10 * 1000;
/**
* Executes the given command and returns once the given "waitFor" string is found in the command
* output.
*
* @param waitFor - the String to wait for in the command output
* @param commandParams the additional command params
* @return the command output
* @throws IOException if something goes wrong
*/
public String executeAndWaitFor(String waitFor, String... commandParams) throws IOException {
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
CommandLine commandLine = new CommandLine(this.getCommand());
commandLine.addArguments(commandParams, false);
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
DefaultExecutor executor = new DefaultExecutor();
PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
executor.setStreamHandler(streamHandler);
executor.execute(commandLine, resultHandler);
try {
resultHandler.waitFor(DEFAULT_PROC_TIMEOUT);
boolean found = false;
while (!resultHandler.hasResult() && !found && !waitFor.isEmpty()) {
if (outputStream.toString().contains(waitFor)) {
found = true;
}
Thread.sleep(50);
}
if (resultHandler.hasResult() && resultHandler.getExitValue() != 0) {
throw new CommandFailedException(outputStream.toString());
}
} catch (InterruptedException e) {
throw new CommandFailedException(e);
}
return outputStream.toString();
}
}
public String execute(String... params) throws IOException {
return this.executeAndWaitFor("", params);
}
public abstract String getCommand();
}
| [
"iliemad@gmail.com"
] | iliemad@gmail.com |
ce7064c92a080db2690b80a02ae324cd0cd7fa5d | a5fb2f75f1fe093bac37ab560ddf77075fd64c87 | /src/com/yyHaker/lexical/scanner/AnalyzerByFA.java | 0ca250871d09754bdb7f493bc4029d23008a16f8 | [] | no_license | yyHaker/myComplierByJava | 5f7a2f45c2c7df78d943e9924ed6948910206a58 | 2eb1a816482885679b171c4d8855e817d6c3d9b2 | refs/heads/master | 2020-06-18T06:41:21.366502 | 2016-11-30T04:42:37 | 2016-11-30T04:42:37 | 75,151,986 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 17,347 | java | package com.yyHaker.lexical.scanner;
import com.yyHaker.lexical.model.*;
import com.yyHaker.lexical.model.Error;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;
import java.util.Scanner;
/**
* AnalyzerByFA
*扫描输入的字符
* 1.预处理 滤掉空格,跳过注释、换行符
* 2.识别各种字符,输出token序列
* 关键字、特殊字符、单界符、数学运算符、复合运算符、常量类型等等
* 实现的主要思想是基于DFA:通过将完整的DFA用三元组的格式写在文件中,然后实现
* 基本自动化判断逻辑,根据导入的DFA来进行词法分析
* 存储结构:主要是用了一个Node类的数据结构
* @author Le Yuan
* @date 2016/10/15
*/
public class AnalyzerByFA {
//记录输出的指定格式 (设置为静态,便于语法分析器调用)
public static List<TokenString> tokenStringList=new ArrayList<TokenString>();
//记录输出的token词法单元
private static List<KeyInfor> tokenList=new ArrayList<KeyInfor>();
//记录错误信息
private List<Error> errorList=new ArrayList<Error>();
//记录输入的总的字符
private String input;
//记录输入字符的下标
private int inputIndex;
//记录当前字符
private char currentCharacter;
//记录当前行号
private int row=1;
//输入框中的文本字符串
public static String codeText;
private List<Node> nodeList; //存放节点的集合
private List<Integer> finiteStateNodeList;//终极状态代号的集合
public List<KeyInfor> getTokenList() {
return tokenList;
}
public List<Error> getErrorList() {
return errorList;
}
public List<Node> getNodeList() {
return nodeList;
}
public List<Integer> getFiniteStateNodeList() {
return finiteStateNodeList;
}
com.yyHaker.lexical.scanner.Scanner myScanner=new com.yyHaker.lexical.scanner.Scanner();
public AnalyzerByFA() {
nodeList=new ArrayList<Node>();
finiteStateNodeList=new ArrayList<Integer>();
}
/**
* 读取下一个字符,下标为当前字符的下标
* @return currentCharacter
*/
private char getChar(){
inputIndex++;
if(inputIndex<input.length()){
currentCharacter=input.charAt(inputIndex);
}
return currentCharacter;
}
/**
* 判断终态集合中是否存在代号
* @param state
* @return
*/
public boolean isExistFiniteState(int state){
for (int a:finiteStateNodeList) {
if (a==state) return true;
}
return false;
}
/*public boolean isMatchRegex(String myString,String regex){
myString.matches(regex);
}*/
/**
* 判断节点集合中是否存在代号和currentNode相同的node
* @param currentNode
* @return Node
*/
public Node getNodeFromNodeList(int currentNode){
for (Node myNode:nodeList) {
if (myNode.getCurrentState()==currentNode) return myNode;
}
return null;
}
/**
* 从FA文件中读取状态
* @param file
*/
public void getStateFromFA(File file){
try {
FileInputStream fis=new FileInputStream(file);
java.util.Scanner in=new Scanner(fis);
while (in.hasNextLine()){
String line=in.nextLine().trim();
String []tokens=line.split("~");
int currentState;
String regex;
int nextState;
//获得currentState
if (tokens[0].contains("#")){
tokens[0]=tokens[0].substring(0,tokens[0].length()-1);
currentState=Integer.parseInt(tokens[0]);
if(!isExistFiniteState(currentState)) {
finiteStateNodeList.add(currentState);
}
}else {
currentState=Integer.parseInt(tokens[0]);
}
//获得regex
regex=tokens[1];
//获得nextState
if (tokens[2].contains("#")){
tokens[2]=tokens[2].substring(0,tokens[2].length()-1);
nextState=Integer.parseInt(tokens[2]);
if(!isExistFiniteState(nextState)) {
finiteStateNodeList.add(nextState);
}
}else {
nextState=Integer.parseInt(tokens[2]);
}
//添加nextNode和currentNode
Node nextNode;
if (getNodeFromNodeList(nextState)==null){
nextNode=new Node(nextState);
nodeList.add(nextNode);
}else{
nextNode=getNodeFromNodeList(nextState);
}
Node currentNode;
if (getNodeFromNodeList(currentState)==null){
currentNode=new Node(currentState);
currentNode.getStateTransitionList().put(regex,nextNode);
nodeList.add(currentNode);
}else{
currentNode=getNodeFromNodeList(currentState);
currentNode.getStateTransitionList().put(regex,nextNode);
}
// System.out.println(currentState+","+regex+","+nextState);
}
//初始化每一个状态是否为终极状态
for (Node node: nodeList){
if(isExistFiniteState(node.getCurrentState())){
node.setFiniteState(true);
}
}
}catch (IOException e){
e.printStackTrace();
}
}
public void startLexical(String scanningInput){
//基本初始化操作
row=1;
input=scanningInput+" ";//此处在输入的文本后自行添加一个字符,以便可以预读取下一个字符
inputIndex=-1;
int stateCode=0;
//初始化为初始状态
Node tempNode=getNodeFromNodeList(stateCode);
while (inputIndex<input.length()){
currentCharacter=getChar();
//预处理
if(myScanner.isSkip(currentCharacter)){//1.预处理:跳过空格、制表符、回退符、回车符、回车换行符
if (currentCharacter=='\n'){
row++;
}
}else if (myScanner.isMathOperator(currentCharacter+"")!=null&&input.charAt(inputIndex+1)!='*'){
//判断数学运算符,记录为状态28
StringBuilder myoperator=new StringBuilder();
Key tempKey;
myoperator.append(currentCharacter);
currentCharacter=getChar();
myoperator.append(currentCharacter);
if ((tempKey=myScanner.isMathOperator(myoperator.toString()))!=null){
tokenList.add(new KeyInfor(tempKey,row));
}else{
inputIndex--;//回退一个字符
tokenList.add(new KeyInfor(myScanner.isMathOperator(input.charAt(inputIndex)+""),row));
}
} else {
StringBuilder tokenString=new StringBuilder();
//根据DFA状态转换进行词法分析,根据给定的输入进入下一状态
while(getNodeFromNodeList(stateCode).getNextStateNode(currentCharacter)!=null){
tokenString.append(currentCharacter);
tempNode=getNodeFromNodeList(stateCode).getNextStateNode(currentCharacter);
stateCode=tempNode.getCurrentState();
if (inputIndex<input.length()){
currentCharacter=getChar();
}else{
break;
}
}
//循环跳出时的情况:1.不能再继续匹配2.已经读到最后一个字符
if(inputIndex<input.length()){
inputIndex--;
//错误处理
/*while (inputIndex<input.length()&&input.charAt(inputIndex+1)!=' '&&input.charAt(inputIndex+1)!='\n'){
tokenString.append(getChar());
}*/
}
//对于stateCode和tokenString给出相应处理
dealWithResult(stateCode,tokenString.toString());
//回到初始状态,继续向后分析
stateCode=0;
}
}
}
/**
* 对于stateCode和tokenString给出相应处理
* @param stateCode
* @param tokenString
*/
public void dealWithResult(int stateCode,String tokenString){
if (isExistFiniteState(stateCode)){
switch (stateCode){
case 12: if (myScanner.isKeyWordOrNull(tokenString)!=null){//关键字
tokenList.add(new KeyInfor(myScanner.isKeyWordOrNull(tokenString),row));
}else{
tokenList.add(new KeyInfor(new Key("<IDN," + tokenString+ ">", 256, "标识符"), row));
}
break; //关键字、标识符、INT10、浮点型常量、浮点型常量(科学计数法)、INT8、INT16、字符型常量、字符串型常量、界符、运算符/界符
case 13:
case 21:
case 29:tokenList.add(new KeyInfor(new Key(tokenString,myScanner.getConstTypeCode("INT10"),"INT10"),row));
break;
case 15: tokenList.add(new KeyInfor(new Key(tokenString,myScanner.getConstTypeCode("浮点型常量"),"浮点型常量"),row));
break;
case 19:tokenList.add(new KeyInfor(new Key(tokenString,myScanner.getConstTypeCode("浮点型常量"),"浮点型常量(科学计数法)"),row));
break;
case 30: tokenList.add(new KeyInfor(new Key(tokenString,myScanner.getConstTypeCode("INT8"),"INT8"),row));
break;
case 32: tokenList.add(new KeyInfor(new Key(tokenString,myScanner.getConstTypeCode("INT16"),"INT16"),row));
break;
case 40:
//错误处理
StringBuilder stringBuilder=new StringBuilder(tokenString);
while (inputIndex<input.length()&&input.charAt(inputIndex+1)!=' '&&input.charAt(inputIndex+1)!='\n'){
stringBuilder.append(getChar());
}
tokenString=stringBuilder.toString();
errorList.add(new Error(row,tokenString,"八进制数格式错误"));
break;
case 23: if (myScanner.isSingleDelimiters(tokenString.charAt(0))!=null){//单界符
tokenList.add(new KeyInfor(myScanner.isSingleDelimiters(tokenString.charAt(0)),row));
}
break;
case 35:tokenList.add(new KeyInfor(new Key(tokenString,myScanner.getConstTypeCode("字符型常量"),"字符型常量"),row));
break;
case 38:tokenList.add(new KeyInfor(new Key(tokenString,myScanner.getConstTypeCode("字符串型常量"),"字符串型常量"),row));
break;
case 27://注释格式正确
break;
}
}else{
//错误处理
StringBuilder stringBuilder=new StringBuilder(tokenString);
while (inputIndex<input.length()&&input.charAt(inputIndex+1)!=' '&&input.charAt(inputIndex+1)!='\n'){
stringBuilder.append(getChar());
}
tokenString=stringBuilder.toString();
switch (stateCode){
case 0:errorList.add(new Error(row,tokenString,"不能识别的非法字符"));
break;
case 14:
case 16:
case 17: errorList.add(new Error(row,tokenString,"浮点数格式不正确"));
break;
case 31: errorList.add(new Error(row,tokenString,"十六进制数格式错误"));
break;
case 33:if (myScanner.isSingleDelimiters(tokenString.charAt(0))!=null){//单界符
tokenList.add(new KeyInfor(myScanner.isSingleDelimiters(tokenString.charAt(0)),row));
}
break;
case 34: errorList.add(new Error(row,tokenString,"字符常量格式错误"));
break;
case 36:if (myScanner.isSingleDelimiters(tokenString.charAt(0))!=null){//单界符
tokenList.add(new KeyInfor(myScanner.isSingleDelimiters(tokenString.charAt(0)),row));
}
break;
case 37:errorList.add(new Error(row,tokenString,"字符串型常量格式错误"));
break;
case 24:if(myScanner.isMathOperator(tokenString)!=null){
tokenList.add(new KeyInfor(myScanner.isMathOperator(tokenString),row));
}
break;
case 25:
case 26: errorList.add(new Error(row, tokenString, "注释未封闭"));
break;
}
}
}
/**
* 打印输出tokenList
*/
public void printTokenList(){
for (KeyInfor keyInfor:tokenList){
System.out.println(keyInfor.toString());
}
}
/**
* 打印输出errorList
*/
public void printErrorList(){
for (Error error:errorList){
System.out.println(error.toString());
}
}
/**(待完善)
* 设置tokenStringList,便于语法分析调用
*/
public void setTokenStringList(){
for (KeyInfor keyInfor:tokenList){
tokenStringList.add(changeKeyInforToTokenString(keyInfor));
}
}
/**
* 将keyInfor转变为指定格式的token序列
* keyInfor.type:关键字、标识符、INT10、浮点型常量、浮点型常量(科学计数法)、INT8、INT16、
* 字符型常量、字符串型常量、界符、运算符/界符
*
* @param keyInfor
* @return
*/
public TokenString changeKeyInforToTokenString(KeyInfor keyInfor){
TokenString tokenString;
Key key=keyInfor.getKey();
if (key.getType().equals("关键字")){
tokenString=new TokenString(key.getName(),key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("标识符")){
tokenString=new TokenString("IDN",key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("INT10")){
tokenString=new TokenString("INT10",key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("浮点型常量")){
tokenString=new TokenString("FLOAT",key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("浮点型常量(科学计数法)")){
tokenString=new TokenString("FLOAT",key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("INT8")){
tokenString=new TokenString("INT8",key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("INT16")){
tokenString=new TokenString("INT16",key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("字符型常量")){
tokenString=new TokenString("CHAR",key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("字符串型常量")){
tokenString=new TokenString("STRING",key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("界符")){
tokenString=new TokenString(key.getName(),key.getName(),keyInfor.getRow());
return tokenString;
}
if (key.getType().equals("运算符/界符")){
tokenString=new TokenString(key.getName(),key.getName(),keyInfor.getRow());
return tokenString;
}
return null;
}
public static void main(String []args){
//AnalyzerByFA analyzerByFA=new AnalyzerByFA();
//analyzerByFA.getStateFromFA(new File("FAtable.txt"));
//System.out.println(analyzerByFA.getNodeFromNodeList(0).getNextStateNode('A').toString());
/* for (Node node:analyzerByFA.getNodeList()){
//System.out.println(node.getCurrentState()+"---"+node.isFiniteState());
System.out.println(node.toString());
}*/
// System.out.println(('/'+"").matches("[/]"));
//
}
}
| [
"572176750@qq.com"
] | 572176750@qq.com |
4eb4750de4ab8e20bc7cd7cdd128cd0323a2ff44 | 8f529ca19279acd5ccb2fa11724954b2f0950e6e | /recursosInvestigacion/src/main/java/co/edu/unicundi/recursosInvestigacion/service/imp/DocenteServiceImp.java | 9f74312c337663c2065da556125e913a6ea16eeb | [] | no_license | aleon01/Proyecto | b19c49c2989d12068eda02c762347b89847e30fc | 881d72126b1721acee6a29cf44f3ad9e57cb5bc7 | refs/heads/main | 2023-07-17T09:11:03.400406 | 2021-08-25T04:55:41 | 2021-08-25T04:55:41 | 399,691,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,915 | java | package co.edu.unicundi.recursosInvestigacion.service.imp;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import co.edu.unicundi.recursosInvestigacion.dto.docenteDTO;
import co.edu.unicundi.recursosInvestigacion.entity.Docente;
import co.edu.unicundi.recursosInvestigacion.entity.RolUser;
import co.edu.unicundi.recursosInvestigacion.exception.ModelNotFoundException;
import co.edu.unicundi.recursosInvestigacion.repository.IDocenteRepo;
import co.edu.unicundi.recursosInvestigacion.repository.IRolUserRepo;
import co.edu.unicundi.recursosInvestigacion.service.IDocenteService;
@Service
public class DocenteServiceImp implements IDocenteService{
@Autowired
private IDocenteRepo repo;
@Autowired
private IRolUserRepo repoRol;
@Override
public List<docenteDTO> retornar() {
List<Docente> listaUser = repo.findAll();
List<docenteDTO> DTOuser = new ArrayList<>();
for(Docente listUsuario : listaUser) {
ModelMapper modelMapper = new ModelMapper();
docenteDTO dtousuarios = modelMapper.map(listUsuario, docenteDTO.class);
dtousuarios.getTdocId().setEstudiante(null);
dtousuarios.getTdocId().setAdministrativo(null);
dtousuarios.getTdocId().setDocente(null);
dtousuarios.getRolUser().setEstudiante(null);
dtousuarios.getRolUser().setDocente(null);
dtousuarios.getRolUser().setAdministrativo(null);
DTOuser.add(dtousuarios);
}
return DTOuser;
}
@Override
public docenteDTO retornarPorId(Integer id) throws ModelNotFoundException {
Optional<Docente> optional = repo.findById(id);
Docente user;
docenteDTO dtouser;
if (optional.isPresent()) {
user = optional.get();
ModelMapper modelMapper = new ModelMapper();
dtouser = modelMapper.map(user, docenteDTO.class);
dtouser.getTdocId().setEstudiante(null);
dtouser.getTdocId().setAdministrativo(null);
dtouser.getTdocId().setDocente(null);
dtouser.getRolUser().setEstudiante(null);
dtouser.getRolUser().setDocente(null);
dtouser.getRolUser().setAdministrativo(null);
} else {
throw new ModelNotFoundException("Docente no existe");
}
return dtouser;
}
@Override
public void guardar(Docente user) throws ModelNotFoundException {
Docente userCod = repo.findByDoceCodigo(user.getDoceCodigo());
if(userCod == null) {
}else {
throw new ModelNotFoundException("El codigo del usuario ya existe");
}
//-----
Docente userIden = repo.findByDoceDocumento(user.getDoceDocumento());
if(userIden == null) {
}else {
throw new ModelNotFoundException("El documeto del docente ya existe");
}
//-----
//Valida el ROl
Optional<RolUser> rolu = repoRol.findById(user.getRolUser().getRoluId());
if(rolu.isPresent()) {
}else {
throw new ModelNotFoundException("El Rol no existe");
}
//-----
Docente userUser = repo.findByDoceUsuario(user.getDoceUsuario());
if(userUser == null) {
}else {
throw new ModelNotFoundException("Este usuario ya existe");
}
repo.save(user);
}
@Override
public void editar(Docente user) throws ModelNotFoundException {
Optional<Docente> optional = repo.findById(user.getDoce_id());
Docente userBus;
if (optional.isPresent()) {
userBus = optional.get();
userBus.setDoceCodigo(user.getDoceCodigo());
userBus.setDoceNombre(user.getDoceNombre());
userBus.setDoceApellido(user.getDoceApellido());
userBus.setTdocId(user.getTdocId());
userBus.setDoceDocumento(user.getDoceDocumento());
userBus.setDoceDireccion(user.getDoceDireccion());
userBus.setDoceCorreo(user.getDoceCorreo());
userBus.setDoceTelCelular(user.getDoceTelCelular());
userBus.setDoceTelCelular1(user.getDoceTelCelular1());
userBus.setDoceSede(user.getDoceSede());
userBus.setDoceLugarNacimiento(user.getDoceLugarNacimiento());
userBus.setDoceFechaNacimiento(user.getDoceFechaNacimiento());
userBus.setDoceUsuario(user.getDoceUsuario());
userBus.setDoceContrasena(user.getDoceContrasena());
//VALIDA ROL
Optional<RolUser> rolu = repoRol.findById(user.getRolUser().getRoluId());
if(rolu.isPresent()) {
} else {
throw new ModelNotFoundException("Rol no existe");
}
repo.save(userBus);
}else {
throw new ModelNotFoundException("Doce no existe");
}
}
@Override
public void eliminar(Integer id) throws ModelNotFoundException {
Optional<Docente> user = repo.findById(id);
if(user.isPresent()) {
repo.deleteById(id);
}else {
new ModelNotFoundException("Usuario no se encontra Registrado");
}
}
@Override
public docenteDTO findByDoceUsuarioAndDoceContrasena(String doceUsuario, String doceContrasena)
throws ModelNotFoundException {
Docente optional = repo.findByDoceUsuarioAndDoceContrasena(doceUsuario, doceContrasena);
docenteDTO dtouser;
if (optional != null) {
ModelMapper modelMapper = new ModelMapper();
dtouser = modelMapper.map(optional, docenteDTO.class);
dtouser.getRolUser().setEstudiante(null);
dtouser.getRolUser().setDocente(null);
dtouser.getRolUser().setAdministrativo(null);
} else {
throw new ModelNotFoundException("Usuario no existe");
}
return dtouser;
}
@Override
public docenteDTO consultarUsuarioAndContrasena(String doceUsuario, String doceContrasena)
throws ModelNotFoundException {
Docente optional = repo.consultarUsuarioAndContrasena(doceUsuario, doceContrasena);;
docenteDTO dtouser;
if (optional != null) {
ModelMapper modelMapper = new ModelMapper();
dtouser = modelMapper.map(optional, docenteDTO.class);
dtouser.getRolUser().setEstudiante(null);
dtouser.getRolUser().setDocente(null);
dtouser.getRolUser().setAdministrativo(null);
} else {
throw new ModelNotFoundException("Usuario no existe");
}
return dtouser;
}
}
| [
"aleon@ucundinamarca.edu.co"
] | aleon@ucundinamarca.edu.co |
77ad77b6ce21e6ac3fbfd3720b17ca5fdb5b9ef6 | 153dca3895b14b4980260bfd9078f6ea65d5d6f0 | /DemoOkHttp/src/test/java/com/dax/demo/ExampleUnitTest.java | 46701b0567697bec98c052bf96b8b65ec1eb1175 | [] | no_license | jerry0864/DemoDax | 2e9e5546e5eb023eba2b618b16ed91143a4942bf | 7bad2e0279f3258c193bc91495954022fd77fe3a | refs/heads/master | 2020-12-23T18:40:28.089841 | 2019-04-24T08:09:13 | 2019-04-24T08:09:13 | 57,119,765 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 305 | java | package com.dax.demo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"jerry0864@gmail.com"
] | jerry0864@gmail.com |
43630e57008c6d3e6b82e4c2e5d23082390366b2 | 677aaa5f4626b8c23e0bee07fb3ae80972386ad6 | /src/main/java/com/reign/framework/msgpack/ResponseList.java | d746b41b9a71117a69ead85b6288a1fe8fc9d794 | [] | no_license | WenXiangWu/reign_framework | faa9029c5adcde9bcfd4135545bae6ffa61b9dd7 | 7e28931d511002594e3b74250091c4d93f3bc2f5 | refs/heads/master | 2023-04-16T05:16:37.971872 | 2021-04-29T12:37:59 | 2021-04-29T12:37:59 | 355,860,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 181 | java | package com.reign.framework.msgpack;
/**
* @ClassName: ResponseList
* @Description: TODO
* @Author: wuwx
* @Date: 2021-04-08 18:18
**/
public class ResponseList {
}
| [
"280971337@qq.com"
] | 280971337@qq.com |
0c94cc9946e86518b860d8c9e33a05a145c91519 | c1323ae0a91e39e9d338f135f2bc2bf38a782b71 | /Lab12/JdbcFirstExample.java | cae6a7855e2aada22400c4d68094e63d2a5f0686 | [] | no_license | cuongnv2812/JavaTraining | 65634828fb844d09809abc530ae4bad8c9fe71b8 | 919bc4e61abfc9a41bdc0792a3816f429490f392 | refs/heads/master | 2022-12-09T07:09:23.510666 | 2019-10-09T03:10:29 | 2019-10-09T03:10:29 | 107,261,518 | 0 | 0 | null | 2022-11-22T04:17:07 | 2017-10-17T11:50:51 | Java | UTF-8 | Java | false | false | 1,023 | java | package com.lab12.JDBC;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class JdbcFirstExample {
public static void main(String[] args) throws SQLException, ClassNotFoundException {
Connection connection = null;
Statement statement=null;
try {
File file = new File("./dbExample");
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
connection = DriverManager.getConnection("jdbc:derby:" + file.getAbsolutePath() + ";create=true");
statement=connection.createStatement();
String sql="create table student("+
"id bigint primary key generated always as identity(start with 1,increment by 1)," +
"name varchar(1000),"+
"age integer default 20)";
System.out.println(statement.execute(sql));
/*System.out.println("db path :" + file.getAbsolutePath());
System.out.println("Create DB successfully");*/
} finally {
statement.close();
connection.close();
}
}
}
| [
"cuongnv2812@gmail.com"
] | cuongnv2812@gmail.com |
ca0b1caa843bc5234533b54d89ce42833fd4080d | f6be8485b53eac490d85929780a3082a298b8e7a | /app/src/main/java/com/twitter/university/android/yamba/svc/YambaService.java | 7980a3e410803836006d2798ce32455e7c07d216 | [] | no_license | twitter-university/SyncAdapterYamba | 64d8bee45d6a44af9c50f5a7a33cb1a919489ad4 | f549a0e0f06ef4f795c189d79022bcbe781f2416 | refs/heads/master | 2021-01-17T15:21:17.119416 | 2014-07-23T21:09:30 | 2014-07-23T21:09:30 | 22,177,834 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,226 | java | package com.twitter.university.android.yamba.svc;
import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
public class YambaService extends IntentService {
private static final String TAG = "SVC";
private static final String PARAM_OP = "YambaService.OP";
private static final int OP_POST = -2;
private static final String PARAM_TWEET = "YambaService.TWEET";
public static void postTweet(Context ctxt, String tweet) {
Intent i = new Intent(ctxt, YambaService.class);
i.putExtra(PARAM_OP, OP_POST);
i.putExtra(PARAM_TWEET, tweet);
ctxt.startService(i);
}
private volatile YambaLogic helper;
public YambaService() { super(TAG); }
@Override
public void onCreate() {
super.onCreate();
helper = new YambaLogic(this);
}
@Override
protected void onHandleIntent(Intent intent) {
int op = intent.getIntExtra(PARAM_OP, 0);
switch(op) {
case OP_POST:
helper.doPost(intent.getStringExtra(PARAM_TWEET));
break;
default:
throw new IllegalArgumentException("Unrecognized op: " + op);
}
}
}
| [
"bmeike@twitter.com"
] | bmeike@twitter.com |
7ac98bb01c565c2e7059f56bd6d3bbcd701690c7 | 8d4c193bc32f0aafe3df15bddb5bf6203ff96a99 | /time2020-common/src/main/java/org/timetracking/event/TimeTrackingEventConverter.java | 7fba349451f3b325fa7fbc3d469616b29899ca68 | [] | no_license | NicolasVanme/time-2020 | e3b97430e78b14039e189f22bc1e9d9a103969b6 | 82c7995bbedc0a79217b2760a55b4dee96e5f30e | refs/heads/main | 2023-01-13T15:38:04.986134 | 2020-11-22T10:06:23 | 2020-11-22T10:06:23 | 313,711,796 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,294 | java | package org.timetracking.event;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import static java.lang.String.format;
/**
* Used to :
* - Convert time tracking event to string
* - Convert string to time tracking event
*/
public class TimeTrackingEventConverter {
public String convertToString(TimeTrackingEvent event) {
return format("%d::%d::%s::%d",
event.getEmployeeId(),
event.getTaskId(),
event.getType().name(),
toSecond(event.getEventDateTime()));
}
public TimeTrackingEvent convertFromString(String message) {
String[] messageParts = message.split("::");
if (messageParts.length != 4) {
throw new IllegalArgumentException(format("Provided string '%s' is not correctly formatted", message));
}
return new TimeTrackingEvent(
Integer.parseInt(messageParts[0]),
Integer.parseInt(messageParts[1]),
TimeTrackingEventType.valueOf(messageParts[2]),
LocalDateTime.ofEpochSecond(Long.parseLong(messageParts[3]), 0, ZoneOffset.UTC));
}
private long toSecond(LocalDateTime localDateTime) {
return localDateTime.toInstant(ZoneOffset.UTC).getEpochSecond();
}
}
| [
"nicolas.vanmechelen@gmail.com"
] | nicolas.vanmechelen@gmail.com |
9a84794fdccf06914d2b24bfce010b7e947a7b9d | 0811724942b83be836976ef5f32f2852b5c9d1f7 | /kodilla-patterns2/src/main/java/com/kodilla/patterns2/decorator/pizza/AbstractPizzaOrderDecorator.java | cb1d68399e858846e49dd74cb5e51a449ecde349 | [] | no_license | J-Fi/jan-filipek-kodilla-java | 636e77ad67f2d86f6c17cfcb501114d622e3a852 | 47fc95165e24aa24a3210b94e40100f2a996683c | refs/heads/master | 2020-05-17T03:13:14.793586 | 2019-09-17T21:58:50 | 2019-09-17T21:58:50 | 183,472,658 | 0 | 0 | null | 2019-11-10T22:13:56 | 2019-04-25T16:35:55 | Java | UTF-8 | Java | false | false | 490 | java | package com.kodilla.patterns2.decorator.pizza;
import java.math.BigDecimal;
public class AbstractPizzaOrderDecorator implements PizzaOrder {
private final PizzaOrder pizzaOrder;
protected AbstractPizzaOrderDecorator(PizzaOrder pizzaOrder) {
this.pizzaOrder = pizzaOrder;
}
@Override
public BigDecimal getCost() {
return pizzaOrder.getCost();
}
@Override
public String getDescription() {
return pizzaOrder.getDescription();
}
}
| [
"y.neczek@gmail.com"
] | y.neczek@gmail.com |
363347ef907691e91473dd839ace8e99f7aec8c4 | 68f973a540e84fc253dab592dbd2dc73b4cf73f9 | /covidvaccine management system/src/Vaccine/User_quarantinecenter.java | c6df9ab75c6f98a3bbbac809fec1ef1e8883eb87 | [] | no_license | NidhiSingh25901/CovidVaccineManagementSystem | 859905086c48af4338107b7f650ce4a95f94064b | d4883c298d5e27f3d752ff7273ff46255bb2dc20 | refs/heads/master | 2023-06-20T08:15:17.554620 | 2021-07-15T11:31:08 | 2021-07-15T11:31:08 | 386,256,178 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,823 | java | package Vaccine;
import javax.swing.*;
import javax.swing.table.JTableHeader;
import javax.swing.table.DefaultTableModel;
import java.awt.event.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.awt.*;
public class User_quarantinecenter extends JFrame implements ActionListener {
public static void main(String[] args) {
new User_quarantinecenter();
}
JButton okbutton;
JTable table;
DefaultTableModel defaultTableModel;
public User_quarantinecenter() {
// frame size and styling
setBounds(500, 150, 760, 600);
setResizable(false);
setUndecorated(true);
setBackground(new Color(34, 54, 86, 250));
setLayout(null);
// vaccination center - title
JLabel quarantinehead = new JLabel("<html><u>QUARANTINE CENTER</u></html>");
quarantinehead.setBounds(250, 70, 550, 30);
quarantinehead.setForeground(Color.white);
quarantinehead.setFont(new Font("Tahoma", Font.BOLD, 20));
add(quarantinehead);
// table that fetches data from the database
defaultTableModel = new DefaultTableModel();
table = new JTable(defaultTableModel);
table.setBounds(300, 100, 200, 390);
table.setRowHeight(35);
table.setFont(new Font("Tahoma", Font.BOLD, 15));
table.setEnabled(false);
JTableHeader header = table.getTableHeader();
header.setForeground(Color.WHITE);
header.setBackground(Color.black);
header.setFont(new Font("Tahoma", Font.BOLD, 20));
JScrollPane sp = new JScrollPane(table);
sp.setBounds(150, 150, 480, 360);
add(sp);
defaultTableModel.addColumn("Center");
defaultTableModel.addColumn("Block");
try {
Conn con = new Conn();
String sql = "SELECT * FROM quarantinecenter";
PreparedStatement st = con.c.prepareStatement(sql);
ResultSet rs = st.executeQuery();
while (rs.next()) {
String centername = rs.getString(2);
String block = rs.getString(3);
String[] tbdata = { centername, block };
DefaultTableModel defaultTableModel = (DefaultTableModel) table.getModel();
defaultTableModel.addRow(tbdata);
}
} catch (Exception e) {
}
// ok button
okbutton = new JButton("OK");
okbutton.setBounds(300, 550, 70, 26);
okbutton.setBackground(Color.blue);
okbutton.setForeground(Color.white);
okbutton.addActionListener(this);
add(okbutton);
setVisible(true);
}
public void actionPerformed(ActionEvent e) {
if (e.getSource() == okbutton) {
this.setVisible(false);
}
}
}
| [
"nidhisingh25901@gmail.com"
] | nidhisingh25901@gmail.com |
a62e1a465b2b0745dd42afe05024758799dc2c32 | 917bd7ef84e3c5a3192e9344fbac62f258b53127 | /src/controller/InformDetailsServlet.java | 5c8eceb5980dad47b64de77ca24d89bbeb21dfbf | [] | no_license | hekezhao/student | 416b1140cc104bbddd1d38661cd5784c44073249 | 688b91b488f36c9dad8f52954f6ff0a1f1207563 | refs/heads/master | 2020-12-02T18:51:14.305626 | 2020-01-11T08:39:58 | 2020-01-11T08:39:58 | 231,086,915 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 966 | java | package controller;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.Timestamp;
import bean.Inform;
import dao.InformDao;
import javax.servlet.annotation.WebServlet;
@WebServlet("/informdetails")
public class InformDetailsServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,IOException {
InformDao informDao=new InformDao();
Inform inform=new Inform();
String sno=request.getParameter("sno");//获取学号
Timestamp sendTime=Timestamp.valueOf(request.getParameter("sendTime"));//获取通知发送时间
try {
inform=informDao.findSpecificInform(sno,sendTime);//获取该通知
request.getSession().setAttribute("inform", inform);
response.sendRedirect("/student/details.jsp");//重定向到通知细节页面
}catch(Exception e) {
System.out.println(e);
}
}
}
| [
"2691564278@qq.com"
] | 2691564278@qq.com |
5c169c6800de5cc864415c616621bd87528630e2 | 0c80bb4ce1b2cd2673298be9bc8e8f805e1def19 | /src/main/java/com/codegym/model/Product.java | 6c7e39522dec2e7e7bb3d8ff42fad174a749e67a | [] | no_license | tungnk0711/c0819h1-demo-springmvc | 47cd372ad169590bf900ffb971490b0dcc2df388 | a9e357e859eb9a9602dc98a2b28a945249137120 | refs/heads/master | 2020-08-17T19:01:52.897531 | 2019-10-18T07:27:22 | 2019-10-18T07:27:22 | 215,700,555 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 671 | java | package com.codegym.model;
public class Product {
private int id;
private String name;
private Double price;
public Product() {
}
public Product(int id, String name, Double price) {
this.id = id;
this.name = name;
this.price = price;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
}
| [
"tungnk0711@gmail.com"
] | tungnk0711@gmail.com |
c47a872f02ff23b9741f41954388a5941a8bb45c | a90bcf10bf13c8514a3fa4840dd05dcd4e956341 | /src/com/proxy/dynamicproxy/DynamicProxy.java | 98112f51f661c1e3417de1c1aaaa23e2e0064c1c | [] | no_license | willenfoo/headfirst | cc60e83a757069b2dcfe3f53b3adcac84b07ca28 | 43fc2885bda209aa8b8823d8a78195a2b4138f02 | refs/heads/master | 2021-01-22T22:53:33.487639 | 2014-09-11T12:17:37 | 2014-09-11T12:17:37 | 12,633,230 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 107 | java | package com.proxy.dynamicproxy;
public interface DynamicProxy {
public String say(String name);
}
| [
"willenfoo@gmail.com"
] | willenfoo@gmail.com |
36756fabc95e7c923a8c15836f1844bad7b696e2 | 01dfb27f1288a9ed62f83be0e0aeedf121b4623a | /Cadastros/src/java/com/t2tierp/cadastros/servidor/PaisGridAction.java | cc0e57f125b31bdff074d8b953d788f1a7a2701e | [
"MIT"
] | permissive | FabinhuSilva/T2Ti-ERP-2.0-Java-OpenSwing | deb486a13c264268d82e5ea50d84d2270b75772a | 9531c3b6eaeaf44fa1e31b11baa630dcae67c18e | refs/heads/master | 2022-11-16T00:03:53.426837 | 2020-07-08T00:36:48 | 2020-07-08T00:36:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,133 | java | /*
* The MIT License
*
* Copyright: Copyright (C) 2014 T2Ti.COM
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* The author may be contacted at: t2ti.com@gmail.com
*
* @author Claudio de Barros (T2Ti.com)
* @version 2.0
*/
package com.t2tierp.cadastros.servidor;
import com.t2tierp.padrao.servidor.HibernateUtil;
import com.t2tierp.padrao.java.Constantes;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.hibernate.Session;
import org.hibernate.type.Type;
import org.openswing.swing.message.receive.java.ErrorResponse;
import org.openswing.swing.message.receive.java.Response;
import org.openswing.swing.message.send.java.GridParams;
import org.openswing.swing.server.Action;
import org.openswing.swing.server.UserSessionParameters;
import org.openswing.swing.util.server.HibernateUtils;
public class PaisGridAction implements Action {
public PaisGridAction() {
}
public String getRequestName() {
return "paisGridAction";
}
public Response executeCommand(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) {
GridParams pars = (GridParams) inputPar;
Integer acao = (Integer) pars.getOtherGridParams().get("acao");
switch (acao) {
case Constantes.LOAD: {
return load(inputPar, userSessionPars, request, response, userSession, context);
}
case Constantes.INSERT: {
return insert(inputPar, userSessionPars, request, response, userSession, context);
}
case Constantes.UPDATE: {
return update(inputPar, userSessionPars, request, response, userSession, context);
}
case Constantes.DELETE: {
return delete(inputPar, userSessionPars, request, response, userSession, context);
}
}
return null;
}
private Response load(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) {
Session session = null;
GridParams pars = (GridParams) inputPar;
String baseSQL = "select PAIS from com.t2tierp.cadastros.java.PaisVO as PAIS";
try {
session = HibernateUtil.getSessionFactory().openSession();
Response res = HibernateUtils.getBlockFromQuery(
pars.getAction(),
pars.getStartPos(),
Constantes.TAMANHO_BLOCO, // block size...
pars.getFilteredColumns(),
pars.getCurrentSortedColumns(),
pars.getCurrentSortedVersusColumns(),
com.t2tierp.cadastros.java.PaisVO.class,
baseSQL,
new Object[0],
new Type[0],
"PAIS",
HibernateUtil.getSessionFactory(),
session);
return res;
} catch (Exception ex) {
ex.printStackTrace();
return new ErrorResponse(ex.getMessage());
} finally {
try {
session.close();
} catch (Exception ex1) {
}
}
}
public Response insert(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) {
return null;
}
public Response update(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) {
return null;
}
public Response delete(Object inputPar, UserSessionParameters userSessionPars, HttpServletRequest request, HttpServletResponse response, HttpSession userSession, ServletContext context) {
return null;
}
}
| [
"claudiobsi@gmail.com"
] | claudiobsi@gmail.com |
3af5a7113b9c1483c13c925f5af0bd4bf726661e | 0a564f3a3540659287746f3493dcca76c21079dd | /Facade/src/VideoConversionFacade.java | b759d9277d6a9bd3a713db48b6fb41877a658889 | [] | no_license | Matroso/Design_Patterns | e7dc83b072100afe017ccd65bb36c7235a2c7613 | 99964a4ab68b9c3f0001260a81fee4c2e77ddcc9 | refs/heads/master | 2023-02-01T17:46:44.967441 | 2020-11-28T18:20:16 | 2020-11-28T18:20:16 | 286,028,371 | 0 | 0 | null | 2020-11-28T18:20:17 | 2020-08-08T11:15:21 | Java | UTF-8 | Java | false | false | 863 | java | import Interface.Codec;
import java.io.File;
public class VideoConversionFacade {
public File convertVideo(String fileName, String format){
System.out.println("VideoConversionFacade: conversion started");
VideoFile file = new VideoFile(fileName);
Codec sourceCodec = CodecFactory.extract(file);
Codec destinationCodec;
if (format.equals("mp4")){
destinationCodec = new OggCompressionCodec();
} else {
destinationCodec = new MPEG4CompressionCodec();
}
VideoFile buffer = BitrateReader.read(file, sourceCodec);
VideoFile intermediateResult = BitrateReader.convert(buffer, destinationCodec);
File result = (new AudioMixer()).fix(intermediateResult);
System.out.println("VideoConversionFacade: conversion completed");
return result;
}
}
| [
"anton.elfimov90@gmail.com"
] | anton.elfimov90@gmail.com |
c8e91104f858fea8884678cdf56cad564e7586be | 55478169502b61f9bd9c81abff014eda17d94cfe | /app/src/main/java/lite/storeclerk/admin/playlazlo/com/storeclerklite/helper/GeoLocationUtil.java | 7c2e82a6fed86455b47cf189ffc16531ce95b922 | [] | no_license | mickychen0524/CL_Android | 9b5bf84f0a280aec38410fc9a755b61ae6de3145 | e36de1cf6a7661c3b3eab5ee965f9ca6b705667a | refs/heads/master | 2021-08-15T06:48:43.967114 | 2017-10-18T08:16:39 | 2017-10-18T08:16:39 | 106,808,314 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,074 | java | package lite.storeclerk.admin.playlazlo.com.storeclerklite.helper;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import java.util.Timer;
import java.util.TimerTask;
/**
* Created by Dev01 on 10/6/2017.
*/
public class GeoLocationUtil {
Timer timer1;
LocationManager lm;
LocationResult locationResult;
boolean gps_enabled=false;
boolean network_enabled=false;
public boolean getLocation(Context context, LocationResult result)
{
//use LocationResult callback class to pass location value
locationResult=result;
if(lm==null)
lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
//exceptions will be thrown if provider is not permitted.
try{gps_enabled=lm.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception ex){}
try{network_enabled=lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception ex){}
//don't start listeners if no provider is enabled
if(!gps_enabled && !network_enabled)
return false;
try {
if(gps_enabled)
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 1609, locationListenerGps);
if(network_enabled)
lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 1609, locationListenerNetwork);
} catch (SecurityException e) {
e.printStackTrace();
}
timer1=new Timer();
timer1.schedule(new GetLastLocation(), 20000);
return true;
}
LocationListener locationListenerGps = new LocationListener() {
public void onLocationChanged(Location location) {
timer1.cancel();
locationResult.gotLocation(location);
lm.removeUpdates(this);
lm.removeUpdates(locationListenerNetwork);
}
public void onProviderDisabled(String provider) {}
public void onProviderEnabled(String provider) {}
public void onStatusChanged(String provider, int status, Bundle extras) {}
};
LocationListener locationListenerNetwork = new LocationListener() {
public void onLocationChanged(Location location) {
timer1.cancel();
locationResult.gotLocation(location);
lm.removeUpdates(this);
lm.removeUpdates(locationListenerGps);
}
public void onProviderDisabled(String provider) {}
public void onProviderEnabled(String provider) {}
public void onStatusChanged(String provider, int status, Bundle extras) {}
};
class GetLastLocation extends TimerTask {
@Override
public void run() {
lm.removeUpdates(locationListenerGps);
lm.removeUpdates(locationListenerNetwork);
Location net_loc=null, gps_loc=null;
try {
if(gps_enabled)
gps_loc=lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if(network_enabled)
net_loc=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
} catch (SecurityException e) {
e.printStackTrace();
}
//if there are both values use the latest one
if(gps_loc!=null && net_loc!=null){
if(gps_loc.getTime()>net_loc.getTime())
locationResult.gotLocation(gps_loc);
else
locationResult.gotLocation(net_loc);
return;
}
if(gps_loc!=null){
locationResult.gotLocation(gps_loc);
return;
}
if(net_loc!=null){
locationResult.gotLocation(net_loc);
return;
}
locationResult.gotLocation(null);
}
}
public static abstract class LocationResult{
public abstract void gotLocation(Location location);
}
}
| [
"mickychen0524@yahoo.com"
] | mickychen0524@yahoo.com |
beac58fa4e754b28f9ea25d92ce52f1eb10ebf9d | b6d1154f0296bb20b96d8c19de1633594ee2cceb | /src/main/java/com/jilk/ros/rosapi/message/Service.java | a3e8d7821f74729eec20db9cb699d7603b7df986 | [
"MIT"
] | permissive | makingrobot/rosclient | f0be6d14f51504d4c692a2073932dbb7c062bb42 | c7b5bfe6b1699e5b28f243fb449f484ba00f7568 | refs/heads/master | 2020-07-14T14:02:18.911682 | 2019-08-30T07:49:21 | 2019-08-30T07:49:21 | 205,331,102 | 0 | 0 | MIT | 2020-05-08T19:17:59 | 2019-08-30T07:40:55 | Java | UTF-8 | Java | false | false | 1,127 | java | /**
* Copyright (c) 2014 Jilk Systems, Inc.
*
* This file is part of the Java ROSBridge Client.
*
* The Java ROSBridge Client is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Java ROSBridge Client is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Java ROSBridge Client. If not, see http://www.gnu.org/licenses/.
*
*/
package com.jilk.ros.rosapi.message;
import com.jilk.ros.message.Message;
import com.jilk.ros.message.MessageType;
@MessageType(string = "rosapi/Service")
public class Service extends Message {
public String service;
public Service() {}
public Service(String service) {
this.service = service;
}
} | [
"billy_zh@126.com"
] | billy_zh@126.com |
186077dbf561b53d0a685369b0b988cd9407255a | b481d7a5abfa6aa1e89abf3824c89305e1bc9be1 | /src/main/java/Week2/Assignments/Assignment_5/WeaponInterface.java | 029572e54a918454d1183132f3962380ee18d966 | [] | no_license | Malleas/CST-135 | 76bc2727565433086936eb9266ea6b973baf9df5 | afbe34e9c05296222a3ee111239c2c3ea5f1c58b | refs/heads/master | 2020-09-16T18:19:27.979963 | 2019-12-18T18:44:20 | 2019-12-18T18:44:20 | 223,850,636 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 294 | java | package Week2.Assignments.Assignment_5;
/**
* All work is created by Matt Sievers on 12-09-2019 for use in CST-105
*/
public interface WeaponInterface {
public void fireWeapon();
public void fireweapon(int power);
public void activate(boolean isActive);
public int getPower();
}
| [
"msievers@thegeneral.com"
] | msievers@thegeneral.com |
f3bf1075eb816e247538002433fa43b10df620c2 | 0fb805f310dd1d1915fc6682423ca5dde1f35a59 | /src/Building/BuildingConstructor.java | c7a1f043a7b4e3968b7f009a10f01b3fba607dfd | [] | no_license | Jake1996/OOMD | 3d1b4ac98d7917b91958272cdc60b29617a6a894 | 702f7b276446611bb9105f9d5ef72f0c013cdcfa | refs/heads/master | 2021-05-07T01:46:01.933717 | 2017-11-17T05:43:54 | 2017-11-17T05:43:54 | 110,425,207 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 774 | java | package Building;
import java.util.ArrayList;
import java.util.Iterator;
public class BuildingConstructor {
public static final int COMMERCIAL = 0;
public static final int FACTORY = 1;
public static final int RESIDENTIAL = 2;
private static int siteCount = 0;
private static ArrayList<Site> sites = new ArrayList<>();
public static Site getSite(int type,long length,long width) {
Site ret;
if(type == COMMERCIAL)
ret = new Commercial(siteCount++,length ,width);
else if(type == FACTORY)
ret = new Factory(siteCount++,length ,width);
else if(type == RESIDENTIAL)
ret = new Residential(siteCount++,length ,width);
else
return null;
sites.add(ret);
return ret;
}
public static Iterator<Site> getAllSites() {
return sites.iterator();
}
}
| [
"jake@localhost.localdomain"
] | jake@localhost.localdomain |
65861d8b723c6e094268eebcd7c9db72afb1df68 | 7fcf829950af5f7ff28f5085a122cb2f1c130e05 | /src/main/java/com/mindedu/api/util/DateUtils.java | f7597e79c0507b1eafee26c85ec8c077eea20311 | [] | no_license | deepstudyDev/mindedu-api | 71b1c636a3fa489e97deb302874c436866bc7ee5 | b6900516bed3ca86e2afd7666f7d0f78690f0e65 | refs/heads/master | 2020-04-07T19:37:17.990314 | 2018-11-22T07:05:59 | 2018-11-22T07:05:59 | 158,627,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,231 | java | package com.mindedu.api.util;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import java.util.Date;
public class DateUtils {
public final static DateTimeZone UTC_TIME_ZONE = DateTimeZone.UTC;
public final static String DF_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
/**
* 데이트 객체를 패턴에 따라 문자로 변환한다.
*
* @param date 데이트 객체.
* @param pattern 문자열 패턴
* @return 패턴화 문자.
*/
public static String dateToStr(Date date, String pattern, DateTimeZone timeZone){
if(date == null){
return null;
}
DateTime dt = new DateTime(date, timeZone);
return dt.toString(pattern);
}
/**
* 현재 시각의 데이트 객체를 반환한다.
* @return
*/
public static Date now() {
DateTime dateTime = new DateTime();
return dateTime.toDate();
}
public static String nowToStrUTC() {
DateTime dt = new DateTime(now(), UTC_TIME_ZONE);
return dt.toString(DF_TIME_PATTERN);
}
public static void main(String[] args) {
System.out.println(nowToStrUTC());
//System.out.println(dateToStr(d));
}
}
| [
"admin@ideepstudy.com"
] | admin@ideepstudy.com |
e5043557aa6286f21d6910fed460eef8c1b55795 | 926dbf21eec2cd5de0775bbff0216db795e07e78 | /shop-dao/src/main/java/com/lzh/shop/dao/GoodsPictureDao.java | 23f6703c0c0f611d6fcd7c5ba0ee8f293a2c3866 | [] | no_license | lihuihui123456/shop | f33e142483e70826651ec6f27690012ba642197e | c53c1f9c6c46305f587bb28eff0107a89bbd2f07 | refs/heads/hotfixBranch | 2022-06-22T18:22:15.615560 | 2020-04-05T11:20:04 | 2020-04-05T11:20:04 | 230,189,888 | 0 | 0 | null | 2022-06-17T02:49:28 | 2019-12-26T03:41:11 | Java | UTF-8 | Java | false | false | 248 | java | package com.lzh.shop.dao;
import com.lzh.shop.dao.writeDataSource.MyBatisDao;
import com.lzh.shopentity.GoodsPicture;
import org.springframework.stereotype.Repository;
@Repository
public class GoodsPictureDao extends MyBatisDao<GoodsPicture> {
} | [
"18336070328@163.com"
] | 18336070328@163.com |
caa7a97ee00c7ec006fd12c1afbc6b8c6591bccb | 1fae357939b3e440313e4ee0f36fa1a70fbbb6c1 | /src/main/java/Basic_test_Student_Bissell.java | 61ce8079c3acfe859176bc16f53ce0c48a72b723 | [] | no_license | andrasragany/moovs-automation | 15534087a4900b826abf4975d42350b084109413 | de42fe46fc47f41e59ec507e7d42da4d582ed936 | refs/heads/master | 2021-08-10T20:47:06.428101 | 2020-12-02T08:47:58 | 2020-12-02T08:47:58 | 228,189,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,962 | java | import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.opera.OperaDriver;
import org.openqa.selenium.opera.OperaOptions;
import org.openqa.selenium.support.ui.WebDriverWait;
import java.io.File;
import java.time.LocalDateTime;
import java.util.logging.FileHandler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
public class Basic_test_Student_Bissell extends Thread{
private WebDriver driver;
private WebDriverWait waiter;
private String browsertype;
public Basic_test_Student_Bissell(String name, String browsertype) {
super(name);
this.browsertype = browsertype;
}
@Override
public void run() {
System.out.println("Thread- Started" + Thread.currentThread().getName());
try {
Thread.sleep(1000);
setUp(this.browsertype);
student();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
tearDown();
}
System.out.println("Thread- END " + Thread.currentThread().getName());
}
public void setUp(String browsertype) throws Exception {
if (browsertype.contains("Chrome")) {
driver = new ChromeDriver();
waiter = new WebDriverWait(driver, 5);
} else if (browsertype.contains("Firefox")) {
driver = new FirefoxDriver();
waiter = new WebDriverWait(driver, 5);
} else if (browsertype.contains("Opera")) {
OperaOptions options = new OperaOptions();
//options.setBinary(new File("c:\\Users\\randr\\AppData\\Local\\Programs\\Opera\\66.0.3515.44\\opera.exe"));
options.setBinary(new File("c:\\Users\\Rendszergazda\\AppData\\Local\\Programs\\Opera\\66.0.3515.44\\opera.exe"));
options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
driver = new OperaDriver(options);
waiter = new WebDriverWait(driver, 5);
} else if (browsertype.contains("Edge")) {
//System.setProperty("webdriver.edge.driver", "c:\\chromedriver\\msedgedriver.exe");
System.setProperty("webdriver.edge.driver", "c:\\Program Files\\JetBrains\\IntelliJ IDEA Community Edition 2019.2.3\\bin\\msedgedriver.exe");
driver = new EdgeDriver();
waiter = new WebDriverWait(driver, 5);
}
driver.manage().window().maximize();
}
public void tearDown() {
driver.quit();
}
public void student() throws Exception {
String filename = "Mylogfile" + _fc.parseDate(LocalDateTime.now()) + ".log";
String pathname = "c://temp//";
String abspath = pathname + filename;
File file = new File(pathname, filename);
file.createNewFile();
FileHandler fh = new FileHandler(abspath);
Logger logger = Logger.getLogger(abspath);
logger.addHandler(fh);
SimpleFormatter formatter = new SimpleFormatter();
fh.setFormatter(formatter);
_fc.gotourl(logger,driver,"https://test.bissellexpert.com/login");
_fc.login(logger, driver, waiter, "bissellstudent", "bissellstudentpassword");
_fc.navigatetoprofile(logger, driver, "https://test.bissellexpert.com/profile");
((JavascriptExecutor) driver).executeScript("window.scrollTo(0, document.body.scrollHeight)");
_fc.editprofile(logger, driver, waiter);
_fc.changepreferreddevicetotablet(logger, driver, waiter);
_fc.saveprofile(logger, driver, waiter);
_fc.navigatetodashboard(logger, driver, waiter);
_fc.opentraining(driver, logger, waiter);
_fc.player(driver, logger, waiter);
_fc.exam(driver, logger, waiter);
}
public static void main(String[] argv) throws Exception {
Thread ChromeThread = new Basic_test_Student_Bissell("Thread Chrome", "Chrome");
Thread FireFoxThread = new Basic_test_Student_Bissell("Thread FireFox", "Firefox");
Thread OperaThread = new Basic_test_Student_Bissell("Thread Opera", "Opera");
Thread EdgeThread = new Basic_test_Student_Bissell("Thread Opera", "Edge");
System.out.println("Starting MyThreads");
ChromeThread.start();
ChromeThread.sleep(1000);
FireFoxThread.start();
FireFoxThread.sleep(1000);
OperaThread.start();
OperaThread.sleep(1000);
EdgeThread.start();
EdgeThread.sleep(1000);
System.out.println("Threads has been started");
}
} | [
"randris@gmail.com"
] | randris@gmail.com |
9325098d46b151045cbcaf42e52469d2ef06c95f | c27413833b62f51ac77cefae21cef8298f02586f | /app/src/main/java/com/example2/harsh2/mysafetyapp/EmergencyActivity.java | 2b48b9d8f71c7eb92a97a88d4aeaf85ac96c9d65 | [] | no_license | mohith2017/IEEEUVCE_hackathon | 838275d695cd8e030a5a6bfcad19f13373049517 | bae85178956e6098ead78ef3ed87549d97d6139f | refs/heads/master | 2020-03-29T12:17:44.057669 | 2018-10-04T09:34:29 | 2018-10-04T09:34:29 | 149,892,439 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 358 | java | package com.example2.harsh2.mysafetyapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class EmergencyActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_emergency);
}
}
| [
"harshjaiswalrdrt@gmail.com"
] | harshjaiswalrdrt@gmail.com |
d7f108526d34336c1b3e16b23674d278fc179fac | 98e666e26aae281daf5d93455cfaa0cee1304823 | /src/primeirafase/algs4/SymbolGraph.java | f8486217419d0c537a9f827f99cc454c21d28475 | [] | no_license | PedroAlmeidacode/LinkedIn_graph_search | 1a627bb18628dcde0b5b225ed8d846f9a94b6c8c | 368a69d6364428feb097bdaf559b1c909dd22c0d | refs/heads/master | 2021-04-21T03:22:00.576935 | 2020-05-05T14:14:58 | 2020-05-05T14:14:58 | 249,745,331 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,664 | java | /******************************************************************************
* Compilation: javac SymbolGraph.java
* Execution: java SymbolGraph filename.txt delimiter
* Dependencies: ST.java Graph.java In.java StdIn.java StdOut.java
* Data files: https://algs4.cs.princeton.edu/41graph/routes.txt
* https://algs4.cs.princeton.edu/41graph/movies.txt
* https://algs4.cs.princeton.edu/41graph/moviestiny.txt
* https://algs4.cs.princeton.edu/41graph/moviesG.txt
* https://algs4.cs.princeton.edu/41graph/moviestopGrossing.txt
*
* % java SymbolGraph routes.txt " "
* JFK
* MCO
* ATL
* ORD
* LAX
* PHX
* LAS
*
* % java SymbolGraph movies.txt "/"
* Tin Men (1987)
* Hershey, Barbara
* Geppi, Cindy
* Jones, Kathy (II)
* Herr, Marcia
* ...
* Blumenfeld, Alan
* DeBoy, David
* Bacon, Kevin
* Woodsman, The (2004)
* Wild Things (1998)
* Where the Truth Lies (2005)
* Tremors (1990)
* ...
* Apollo 13 (1995)
* Animal House (1978)
*
*
* Assumes that input file is encoded using UTF-8.
* % iconv -f ISO-8859-1 -t UTF-8 movies-iso8859.txt > movies.txt
*
******************************************************************************/
package primeirafase.algs4;
/**
* The {@code SymbolGraph} class represents an undirected graph, where the
* vertex names are arbitrary strings.
* By providing mappings between string vertex names and integers,
* it serves as a wrapper around the
* {@link Graph} data type, which assumes the vertex names are integers
* between 0 and <em>V</em> - 1.
* It also supports initializing a symbol graph from a file.
* <p>
* This implementation uses an {@link ST} to map from strings to integers,
* an array to map from integers to strings, and a {@link Graph} to store
* the underlying graph.
* The <em>indexOf</em> and <em>contains</em> operations take time
* proportional to log <em>V</em>, where <em>V</em> is the number of vertices.
* The <em>nameOf</em> operation takes constant time.
* <p>
* For additional documentation, see <a href="https://algs4.cs.princeton.edu/41graph">Section 4.1</a> of
* <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
*
* @author Robert Sedgewick
* @author Kevin Wayne
*/
public class SymbolGraph {
private ST<String, Integer> st; // string -> index
private String[] keys; // index -> string
private Graph graph; // the underlying graph
/**
* Initializes a graph from a file using the specified delimiter.
* Each line in the file contains
* the name of a vertex, followed by a list of the names
* of the vertices adjacent to that vertex, separated by the delimiter.
* @param filename the name of the file
* @param delimiter the delimiter between fields
*/
public SymbolGraph(String filename, String delimiter) {
st = new ST<String, Integer>();
// First pass builds the index by reading strings to associate
// distinct strings with an index
In in = new In(filename);
// while (in.hasNextLine()) {
while (!in.isEmpty()) {
String[] a = in.readLine().split(delimiter);
for (int i = 0; i < a.length; i++) {
if (!st.contains(a[i]))
st.put(a[i], st.size());
}
}
// inverted index to get string keys in an array
keys = new String[st.size()];
for (String name : st.keys()) {
keys[st.get(name)] = name;
}
// second pass builds the graph by connecting first vertex on each
// line to all others
graph = new Graph(st.size());
in = new In(filename);
while (in.hasNextLine()) {
String[] a = in.readLine().split(delimiter);
int v = st.get(a[0]);
for (int i = 1; i < a.length; i++) {
int w = st.get(a[i]);
graph.addEdge(v, w);
}
}
}
/**
* Does the graph contain the vertex named {@code s}?
* @param s the name of a vertex
* @return {@code true} if {@code s} is the name of a vertex, and {@code false} otherwise
*/
public boolean contains(String s) {
return st.contains(s);
}
/**
* Returns the integer associated with the vertex named {@code s}.
* @param s the name of a vertex
* @return the integer (between 0 and <em>V</em> - 1) associated with the vertex named {@code s}
* @deprecated Replaced by {@link #indexOf(String)}.
*/
@Deprecated
public int index(String s) {
return st.get(s);
}
/**
* Returns the integer associated with the vertex named {@code s}.
* @param s the name of a vertex
* @return the integer (between 0 and <em>V</em> - 1) associated with the vertex named {@code s}
*/
public int indexOf(String s) {
return st.get(s);
}
/**
* Returns the name of the vertex associated with the integer {@code v}.
* @param v the integer corresponding to a vertex (between 0 and <em>V</em> - 1)
* @return the name of the vertex associated with the integer {@code v}
* @throws IllegalArgumentException unless {@code 0 <= v < V}
* @deprecated Replaced by {@link #nameOf(int)}.
*/
@Deprecated
public String name(int v) {
validateVertex(v);
return keys[v];
}
/**
* Returns the name of the vertex associated with the integer {@code v}.
* @param v the integer corresponding to a vertex (between 0 and <em>V</em> - 1)
* @throws IllegalArgumentException unless {@code 0 <= v < V}
* @return the name of the vertex associated with the integer {@code v}
*/
public String nameOf(int v) {
validateVertex(v);
return keys[v];
}
/**
* Returns the graph assoicated with the symbol graph. It is the client's responsibility
* not to mutate the graph.
* @return the graph associated with the symbol graph
* @deprecated Replaced by {@link #graph()}.
*/
@Deprecated
public Graph G() {
return graph;
}
/**
* Returns the graph assoicated with the symbol graph. It is the client's responsibility
* not to mutate the graph.
* @return the graph associated with the symbol graph
*/
public Graph graph() {
return graph;
}
// throw an IllegalArgumentException unless {@code 0 <= v < V}
private void validateVertex(int v) {
int V = graph.V();
if (v < 0 || v >= V)
throw new IllegalArgumentException("vertex " + v + " is not between 0 and " + (V-1));
}
/**
* Unit tests the {@code SymbolGraph} data type.
*
* @param args the command-line arguments
*/
public static void main(String[] args) {
String filename = args[0];
String delimiter = args[1];
SymbolGraph sg = new SymbolGraph(filename, delimiter);
Graph graph = sg.graph();
while (StdIn.hasNextLine()) {
String source = StdIn.readLine();
if (sg.contains(source)) {
int s = sg.index(source);
for (int v : graph.adj(s)) {
StdOut.println(" " + sg.name(v));
}
}
else {
StdOut.println("input not contain '" + source + "'");
}
}
}
}
/******************************************************************************
* Copyright 2002-2018, Robert Sedgewick and Kevin Wayne.
*
* This file is part of algs4.jar, which accompanies the textbook
*
* Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne,
* Addison-Wesley Professional, 2011, ISBN 0-321-57351-X.
* http://algs4.cs.princeton.edu
*
*
* algs4.jar is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* algs4.jar is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with algs4.jar. If not, see http://www.gnu.org/licenses.
******************************************************************************/
| [
"plsalmeida18@gmail.com"
] | plsalmeida18@gmail.com |
ac0dd1f1e454124d85506d5eeaef559b44ea08c7 | 623ef934bf74b4ab4c51feef9e1405f69208ea34 | /src/views/FluxNbChoice.java | 8561d057e0655b670760a129f1b3e8172a12bda7 | [] | no_license | AndriyParkho/Klex_BDD | 5281b657d247f9d30b112801e4ffee0495ddd61c | 7bade220036c87556e836b22dacca0c6b00389c7 | refs/heads/master | 2023-03-01T22:25:11.895736 | 2020-12-11T17:08:42 | 2020-12-11T17:08:42 | 339,063,623 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,615 | java | package views;
import java.awt.CardLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import controller.FluxNbChoiceControl;
import model.aggregates.FichierFilm;
import model.aggregates.FichierPiste;
public class FluxNbChoice extends View{
private JSpinner nombreField = new JSpinner();
private JPanel container = new ChoixNbFluxPanel();
private FluxNbChoiceControl controller = new FluxNbChoiceControl(this);
private FichierFilm fichierFilm;
private FichierPiste fichierPiste;
public FluxNbChoice(JFrame fenetre, CardLayout switcherView, JPanel containerView, FichierFilm fichierFilm, FichierPiste fichierPiste) {
super(fenetre, switcherView, containerView, new String("Nombre de flux"));
this.fichierFilm = fichierFilm;
this.fichierPiste = fichierPiste;
super.getContainerView().add(container, "Nombre flux");
super.getPanels().add("Nombre flux");
super.getSwitcherView().show(super.getContainerView() , "Nombre flux");
super.getFenetre().setSize(282, 210);
super.getFenetre().setLocationRelativeTo(null);
}
class ChoixNbFluxPanel extends JPanel {
/**
* Create the panel.
*/
public ChoixNbFluxPanel() {
setLayout(null);
JLabel lblFluxDuFichier = new JLabel("Flux du fichier :");
lblFluxDuFichier.setFont(new Font("Tahoma", Font.BOLD, 18));
lblFluxDuFichier.setBounds(61, 23, 151, 16);
add(lblFluxDuFichier);
JLabel lblNombreDeFlux = new JLabel("Nombre de flux :");
lblNombreDeFlux.setBounds(58, 81, 96, 16);
add(lblNombreDeFlux);
nombreField.setModel(new SpinnerNumberModel(1, 1, null, 1));
nombreField.setBounds(166, 78, 46, 22);
add(nombreField);
JButton suivButton = new JButton("Suivant");
suivButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
controller.clicSuiv();
}
});
suivButton.setBounds(84, 137, 97, 25);
add(suivButton);
}
}
public JSpinner getNombreField() {
return nombreField;
}
public void setNombreField(JSpinner nombreField) {
this.nombreField = nombreField;
}
public FichierFilm getFichierFilm() {
return fichierFilm;
}
public void setFichierFilm(FichierFilm fichierFilm) {
this.fichierFilm = fichierFilm;
}
public FichierPiste getFichierPiste() {
return fichierPiste;
}
public void setFichierPiste(FichierPiste fichierPiste) {
this.fichierPiste = fichierPiste;
}
}
| [
"55849068+AndriyParkho@users.noreply.github.com"
] | 55849068+AndriyParkho@users.noreply.github.com |
7ce0e82bef37f57465750eb6e3a5f4ee8b72206a | 84f01073cbfbbbb9e0d284070bef594e466d5a48 | /src/main/java/com/javaneversleep/daydayup/lombok/MyTreeTranslator.java | 00dcafe110235dc232eb9d30e0831e75cd6dbd7b | [
"MIT"
] | permissive | elenazhao1004/day-day-up | 004d04d5ae2e31ee5e8562ae0c48d5e1c13afcc8 | d46b5c0bf636741b1735e610f807f67d080615b3 | refs/heads/master | 2020-08-12T07:47:12.131465 | 2019-06-18T05:00:33 | 2019-06-18T05:00:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,377 | java | package com.javaneversleep.daydayup.lombok;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.JCAnnotation;
import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.tree.JCTree.JCModifiers;
import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.tree.TreeMaker;
import com.sun.tools.javac.tree.TreeTranslator;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Names;
public class MyTreeTranslator extends TreeTranslator {
private final TreeMaker treeMaker;
private final Names names;
private List<JCTree> getters = List.nil();
MyTreeTranslator(TreeMaker treeMaker, Names names) {
this.treeMaker = treeMaker;
this.names = names;
}
@Override
public void visitClassDef(JCClassDecl decl) {
super.visitClassDef(decl);
if (!getters.isEmpty()) {
decl.defs = decl.defs.appendList(this.getters);
}
this.result = decl;
}
@Override
public void visitVarDef(JCVariableDecl field) {
super.visitVarDef(field);
JCModifiers modifiers = field.getModifiers();
List<JCAnnotation> annotations = modifiers.getAnnotations();
if (annotations == null || annotations.size() <= 0) {
return;
}
for (JCAnnotation annotation : annotations) {
if (!MyGetter.class.getName().equals(annotation.type.toString())) {
continue;
}
String name = field.getName().toString();
String methodName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
JCMethodDecl method = treeMaker.MethodDef(
treeMaker.Modifiers(Flags.PUBLIC),
names.fromString(methodName),
(JCExpression) field.getType(),
List.nil(),
List.nil(),
List.nil(),
treeMaker.Block(0L, List.of(treeMaker.Return(treeMaker.Select(treeMaker.Ident(names.fromString("this")),
names.fromString(field.getName().toString()))))),
null
);
this.getters = this.getters.append(method);
}
}
}
| [
"ny83427@gmail.com"
] | ny83427@gmail.com |
5f86fba8c76e4cd4dfd4063b2afdad6448b35323 | 8cb5035cfb1a77bc7e77bf142126faf1623fa123 | /src/main/java/com/ericsson/internal/dtra/projectmanagement/domain/repository/WorkBreakdownStructureRepository.java | e4feaf60922448e2a8f5c14ab7f52deac90bb5b0 | [] | no_license | hofner/iwps-project-manager | b9d3267f67e19f5c7be037f4c077cb6d52b2ff47 | d0bd3c1009f3d78f44fa34ddb7b38fdcb484837c | refs/heads/master | 2021-01-14T07:04:10.173533 | 2020-02-24T03:02:29 | 2020-02-24T03:02:29 | 242,634,162 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 797 | java | package com.ericsson.internal.dtra.projectmanagement.domain.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import com.ericsson.internal.dtra.projectmanagement.domain.entity.WorkBreakdownStructure;
@Repository
public interface WorkBreakdownStructureRepository extends JpaRepository<WorkBreakdownStructure, Integer> {
/**
* Gets a work breakdown structure
* @param projectId: Id of project
* @param id: Id of work break down structure
* @return wanted work breakdown structure
*/
public WorkBreakdownStructure findByProjectIdAndId(final Integer projectId, final Integer id);
@Modifying
public void deleteByIdIn(final Integer[] ids);
}
| [
"juan@canvasoft.com"
] | juan@canvasoft.com |
0e50b4a7a98ba2a364174767c62deb7ac4491387 | 643c47e10d84f74ab9ce590c7dd57929103e7cdb | /src/main/java/com/wenjuan/dao/AdminUsersMapper.java | dc5e40e208da4ca0ac5c4772c5f3697c9872ee79 | [] | no_license | gst-group/vc-community | 0cf83c025a3d14eeec949854e3ad8282f4b9a0d1 | 96d40da8acf8706be0046541984feca2784eb1c3 | refs/heads/master | 2021-01-22T20:07:43.565960 | 2017-03-27T04:07:49 | 2017-03-27T04:07:49 | 85,279,327 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 330 | java | package com.wenjuan.dao;
import com.wenjuan.model.AdminUsers;
public interface AdminUsersMapper {
int deleteByPrimaryKey(Integer id);
int insert(AdminUsers record);
AdminUsers selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AdminUsers record);
int updateByPrimaryKey(AdminUsers record);
} | [
"wuneng.zhang@guanshantech.com"
] | wuneng.zhang@guanshantech.com |
217eb83ac0ee60f24e2849c482037c2dd379ad1e | 8ad49d1f5e821134a0cb49b8c6c4f414f44b968a | /spring/servlet/src/main/java/hello/servlet/basic/request/RequestHeaderServlet.java | 298acf7e4a65d7ec61cb07441b2805f0d5f588b5 | [] | no_license | wizdom-js/web | 00bcf00de693ed3f86cd25673f78bb98bf0523bb | 676d690732b940d9af3525179dfe6838dff502eb | refs/heads/master | 2023-08-14T04:34:12.204388 | 2021-10-11T13:27:24 | 2021-10-11T13:27:24 | 316,250,293 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,562 | java | package hello.servlet.basic.request;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Enumeration;
@WebServlet(name="requestHeaderServlet", urlPatterns = "/request-header")
public class RequestHeaderServlet extends HttpServlet {
@Override //protected로 !
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
printStartLine(request);
printHeaders(request);
printHeaderUtils(request);
printEtc(request);
}
//start line 정보
private void printStartLine(HttpServletRequest request) {
System.out.println("--- REQUEST-LINE - start ---");
System.out.println("request.getMethod() = " + request.getMethod()); //GET
System.out.println("request.getProtocal() = " + request.getProtocol()); //HTTP/1.1
System.out.println("request.getScheme() = " + request.getScheme()); //http
// http://localhost:8080/request-header
System.out.println("request.getRequestURL() = " + request.getRequestURL());
// /request-test
System.out.println("request.getRequestURI() = " + request.getRequestURI());
//username=hi
System.out.println("request.getQueryString() = " + request.getQueryString());
System.out.println("request.isSecure() = " + request.isSecure()); //https사용 유무
System.out.println("--- REQUEST-LINE - end ---");
System.out.println();
}
//Header 모든 정보
private void printHeaders(HttpServletRequest request) {
System.out.println("--- Headers - start ---");
// 이건 옛날방식
// request.getHeaderNames 하면 http 요청 메세지에 있는거 다꺼내서 출력할 수 있음
// Enumeration<String> headerNames = request.getHeaderNames();
// while (headerNames.hasMoreElements()) {
// String headerName = headerNames.nextElement();
// System.out.println(headerName + ": " + headerName);
// }
// 요즘 스타일
request.getHeaderNames().asIterator()
.forEachRemaining(headerName -> System.out.println(headerName + ": " + headerName));
// 헤더 정보 하나만 조회하고 싶을때
// request.getHeader("host");
System.out.println("--- Headers - end ---");
System.out.println();
}
//Header 편리한 조회
private void printHeaderUtils(HttpServletRequest request) { System.out.println("--- Header 편의 조회 start ---");
System.out.println("[Host 편의 조회]");
System.out.println("request.getServerName() = " +
request.getServerName()); //Host 헤더
System.out.println("request.getServerPort() = " +
request.getServerPort()); //Host 헤더
System.out.println();
System.out.println("[Accept-Language 편의 조회]");
request.getLocales().asIterator()
.forEachRemaining(locale -> System.out.println("locale = " + locale));
System.out.println("request.getLocale() = " + request.getLocale());
System.out.println();
System.out.println("[cookie 편의 조회]");
// 쿠키 정보 담아놓을 수 있고 쿠키 정보가 계속 넘어온다.
// 쿠키 모양이 여러데이터라서 보기 쉽지 않은데 보기 쉽도록 해준다.
if (request.getCookies() != null) {
for (Cookie cookie : request.getCookies()) {
System.out.println(cookie.getName() + ": " + cookie.getValue());
} }
System.out.println();
System.out.println("[Content 편의 조회]");
System.out.println("request.getContentType() = " +
request.getContentType());
System.out.println("request.getContentLength() = " +
request.getContentLength());
System.out.println("request.getCharacterEncoding() = " +
request.getCharacterEncoding());
System.out.println("--- Header 편의 조회 end ---");
System.out.println();
}
// 기타 정보
// http 메세지 오는건 아니고 내부에서 네트워크 커넥션이 맺어진 정보들을 가지고 알 수 있는 정
private void printEtc(HttpServletRequest request) {
System.out.println("--- 기타 조회 start ---");
// 요청 온거에 대한 정보
System.out.println("[Remote 정보]");
System.out.println("request.getRemoteHost() = " +
request.getRemoteHost()); //
System.out.println("request.getRemoteAddr() = " +
request.getRemoteAddr()); //
System.out.println("request.getRemotePort() = " +
request.getRemotePort()); //
System.out.println();
// 나의 서버에 대한 정보
System.out.println("[Local 정보]");
System.out.println("request.getLocalName() = " +
request.getLocalName()); //
System.out.println("request.getLocalAddr() = " +
request.getLocalAddr()); //
System.out.println("request.getLocalPort() = " +
request.getLocalPort()); //
System.out.println("--- 기타 조회 end ---");
System.out.println();
}
}
| [
"65435762+wizdom-js@users.noreply.github.com"
] | 65435762+wizdom-js@users.noreply.github.com |
d60284916196dd122600337a00f5b8a0f6601dea | d7e668a4986dfea0455a4aaa80c87aaf5f8c92e8 | /gulimall-common/src/main/java/com/iflytek/gulimall/common/feign/vo/CartItemVO.java | d8228815418f70ac77fa023a4e44f8dda8116840 | [
"Apache-2.0",
"MIT"
] | permissive | ct16014515/gulimall | dce893c0567a71a74f891b31d0b6f4871b2b7a1c | 9e9b0f883c1f9205b57a57f4a503e9a3112efb36 | refs/heads/master | 2023-06-25T05:27:04.827561 | 2021-07-31T01:05:50 | 2021-07-31T01:05:50 | 391,222,181 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 746 | java | package com.iflytek.gulimall.common.feign.vo;
import lombok.Data;
import lombok.ToString;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data
@ToString
public class CartItemVO implements Serializable {
private String skuTitle;//商品标题
private List<String> skuAttrs;//商品属性
private String skuImg;//商品图片
private BigDecimal skuPrice;//商品单价
private Integer skuCount;//商品数量
private BigDecimal skuTotalMoney;//sku总价
private Long skuId;
/**
* 0:选中 1:未选中
*/
private Integer isChecked=0;//是否选中
/**
* 0表示没货,1表示有货
*/
private Integer hasStock=1;
private BigDecimal weight;
}
| [
"1016933282@qq.com"
] | 1016933282@qq.com |
de005dafdaa74662d418fa0322269ec877b6b642 | 2727bb9cf60f98034615e578cef6321d79c2bb23 | /app/src/main/java/com/xkcn/gallery/di/component/ActivityComponent.java | 987ebe5a16a2c802c2468460b28593cc77351c09 | [] | no_license | khoi-nguyen-2359/wallpaper-gallery | fec0c51bae66b06027808d12c194f3de8176642a | d6564aa4b3baccbba0ea897a481a9db45f2150e6 | refs/heads/master | 2021-01-21T14:40:00.711878 | 2016-07-15T09:54:32 | 2016-07-15T09:54:32 | 55,956,629 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 353 | java | package com.xkcn.gallery.di.component;
import android.app.Activity;
import com.xkcn.gallery.di.module.ActivityModule;
import com.xkcn.gallery.di.scope.PerActivity;
import dagger.Component;
@PerActivity
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {
Activity activity();
} | [
"akhoi90@gmail.com"
] | akhoi90@gmail.com |
ae59c59e0d81aca0926cb9326efca1de016192d7 | 51c5d4aab989398f59269cf805ed47e73bdb4169 | /SinaApp/app/src/main/java/com/qdqy/admin/sinaapp/newsdata/News.java | 2d75389ace9a7ec4b8965f0a4f12dc4ffc04d8fa | [] | no_license | zfireear/NewsApp | 1998afa8c244b6c63a0a59da237f5febb02474a2 | a0983e1b02298115aa8067313bd28c1617074a97 | refs/heads/master | 2021-01-20T20:29:05.376701 | 2016-06-15T09:13:18 | 2016-06-15T09:13:18 | 60,664,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 946 | java | package com.qdqy.admin.sinaapp.newsdata;
import android.graphics.Bitmap;
public class News {
public String flag;
public String title;
public String date;
public String source;
public String summary;
public int comment;
public String url;
public Bitmap photo;
public String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Bitmap getPhoto() {
return photo;
}
public String getFlag(){
return flag;
}
public String getDate() {
return date;
}
public String getTitle() {
return title;
}
public String getSource() {
return source;
}
public String getSummary() {
return summary;
}
public int getComment() { return comment; }
public String getUrl() { return url; }
}
| [
"zfireear@gmail.com"
] | zfireear@gmail.com |
487dd52d92c7184158fa2550a6180fc9c6297f1e | 2b9036ad64c2139a4402fe449b4093080f26dbc1 | /src/LinkedList/ReorderList.java | 96825730bab0d5693667b1dc0b6860c595b25b7d | [] | no_license | harshaks23/DS | e40b7cdb62a04b67169ad8d6e38bb784883cf0ce | 2342a761cd68ac1110731f6944b41252bfdf8024 | refs/heads/master | 2020-03-18T17:10:05.344303 | 2018-09-21T06:13:42 | 2018-09-21T06:13:42 | 96,051,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,191 | java | package LinkedList;
public class ReorderList {
public void reorderList(ListNode head) {
if(head==null || head.next==null || head.next.next==null)
{ }
else{
ListNode slow=head;
ListNode fast=head;
ListNode prev=slow;
while(fast!=null && fast.next!=null)
{
prev=slow;
fast=fast.next.next;
slow=slow.next;
}
if(fast!=null)
{prev=slow;
slow=slow.next;
}
prev.next=null;
ListNode rev=null;
while(slow!=null)
{
ListNode temp=slow.next;
slow.next=rev;
rev=slow;
slow=temp;
}
slow=head;
while(rev!=null)
{
ListNode temp_rev=rev.next;
rev.next=slow.next;
slow.next=rev;
slow=rev.next;
rev=temp_rev;
}
}
}
public class ListNode {
int val;
ListNode next;
ListNode(int x) { val = x; }
}
}
| [
"harshaksabbur@gmail.com"
] | harshaksabbur@gmail.com |
739566d229de66783605ef564c079b4b5f02e4f4 | 1a701c3598a27ce69e958d52639fa4e0106e00a9 | /nacos-feign/src/test/java/com/gzh/nacosfeign/NacosFeignApplicationTests.java | 99547d3d015c7b0a01fc54c1e092a8cdc0735e90 | [] | no_license | gzhkhd/springcloud | 414d52e9676a9f91371eeb4073b3a0ceb5ff3d5b | 1c24fbd8e1f83ba7496582a185b063b87603d65e | refs/heads/master | 2023-06-30T13:42:04.466503 | 2021-07-28T01:08:01 | 2021-07-28T01:08:01 | 381,330,227 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 223 | java | package com.gzh.nacosfeign;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class NacosFeignApplicationTests {
@Test
void contextLoads() {
}
}
| [
"gzh"
] | gzh |
0306f64c1be1e317773ed5241d06417498476c86 | e682fa3667adce9277ecdedb40d4d01a785b3912 | /internal/fischer/mangf/A121022.java | 0ed2c787e708751b9d93678d1e1d95f6195736b2 | [
"Apache-2.0"
] | permissive | gfis/joeis-lite | 859158cb8fc3608febf39ba71ab5e72360b32cb4 | 7185a0b62d54735dc3d43d8fb5be677734f99101 | refs/heads/master | 2023-08-31T00:23:51.216295 | 2023-08-29T21:11:31 | 2023-08-29T21:11:31 | 179,938,034 | 4 | 1 | Apache-2.0 | 2022-06-25T22:47:19 | 2019-04-07T08:35:01 | Roff | UTF-8 | Java | false | false | 719 | java | package irvine.oeis.a121;
import irvine.math.z.Z;
import irvine.oeis.Sequence;
/**
* A121022 Even numbers containing a 2 in their decimal representation.
* @author Georg Fischer
*/
public class A121022 implements Sequence {
private Z mN;
private String mMultS;
private int mMult;
/** Construct the sequence. */
public A121022() {
this(2);
}
/**
* Generic constructor with parameters
* @param mult
*/
public A121022(final int mult) {
mN = Z.valueOf(-mult);
mMult = mult;
mMultS = String.valueOf(mult);
}
@Override
public Z next() {
while (true) {
mN = mN.add(mMult);
if (mN.toString().indexOf(mMultS) >= 0) {
return mN;
}
}
}
}
| [
"dr.Georg.Fischer@gmail.com"
] | dr.Georg.Fischer@gmail.com |
4ddb68d90e0994367bcd4b4e29c9dceacb587caf | 16bacd6ef5d524c9c0fe99f32f2d2403d43b3aec | /instrument-simulator/system-modules/instrument-simulator-debug-model/src/main/java/com/shulie/instrument/simulator/module/model/trace2/StackEvent.java | 7f8623a9cdede3f02424770d71220739ebcb4573 | [
"Apache-2.0"
] | permissive | shulieTech/LinkAgent | cbcc9717d07ea636e791ebafe84aced9b03730e8 | 73fb7cd6d86fdce5ad08f0623c367b407e405d76 | refs/heads/main | 2023-09-02T11:21:57.784204 | 2023-08-31T07:02:01 | 2023-08-31T07:02:01 | 362,708,051 | 156 | 112 | Apache-2.0 | 2023-09-13T02:24:11 | 2021-04-29T06:05:47 | Java | UTF-8 | Java | false | false | 756 | java | /**
* Copyright 2021 Shulie Technology, Co.Ltd
* Email: shulie@shulie.io
* 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,
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.shulie.instrument.simulator.module.model.trace2;
/**
* @author jirenhe | jirenhe@shulie.io
* @since 2021/08/11 2:33 下午
*/
public enum StackEvent {
METHOD_CALL,
LINE_CALL
}
| [
"jirenhe@shulie.io"
] | jirenhe@shulie.io |
7a0b29bf05f334ca8bbea99162061f7d94aff313 | eb4c12ea2cc28f062358c52cb38dcff23f741343 | /autoTrade/src/TradeRecord.java | 9e1188aa5c13d88f40f1b681c92c8e0f8746de34 | [] | no_license | 4x/forex | a0e73106710840e835062e6c301645c4ce86887f | 7791134794874e1032497898f1d39004f500e1f6 | refs/heads/master | 2020-04-07T13:25:08.146892 | 2011-08-21T02:35:29 | 2011-08-21T02:35:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 310 | java | import java.io.Serializable;
public class TradeRecord implements Serializable {
String signal;
String direction;
int amount;
String pl;
public TradeRecord(String signal, String direction, int amount, String pl){
this.signal=signal;
this.direction=direction;
this.amount=amount;
this.pl=pl;
}
}
| [
"zjin@Ziqis-Mac-Pro.local"
] | zjin@Ziqis-Mac-Pro.local |
00f34843c96526dfa07157b5fd38f1d27b3c7a36 | a915d83d3088d355d90ba03e5b4df4987bf20a2a | /src/Applications/jetty/util/security/UnixCrypt.java | c82e990a63e3f843aa96406c7e9386016b9ba545 | [] | no_license | worldeditor/Aegean | 164c74d961185231d8b40dbbb6f8b88dcd978d79 | 33a2c651e826561e685fb84c1e3848c44d2ac79f | refs/heads/master | 2022-02-15T15:34:02.074428 | 2019-08-21T03:52:48 | 2019-08-21T15:37:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 16,907 | java | /*
* @(#)UnixCrypt.java 0.9 96/11/25
*
* Copyright (c) 1996 Aki Yoshida. All rights reserved.
*
* Permission to use, copy, modify and distribute this software
* for non-commercial or commercial purposes and without fee is
* hereby granted provided that this copyright notice appears in
* all copies.
*/
/**
* Unix crypt(3C) utility
*
* @version 0.9, 11/25/96
* @author Aki Yoshida
* <p>
* modified April 2001
* by Iris Van den Broeke, Daniel Deville
*/
/**
* modified April 2001
* by Iris Van den Broeke, Daniel Deville
*/
package Applications.jetty.util.security;
/* ------------------------------------------------------------ */
/**
* Unix Crypt. Implements the one way cryptography used by Unix systems for
* simple password protection.
*
* @version $Id: UnixCrypt.java,v 1.1 2005/10/05 14:09:14 janb Exp $
* @author Greg Wilkins (gregw)
*/
public class UnixCrypt {
/* (mostly) Standard DES Tables from Tom Truscott */
private static final byte[] IP = { /* initial permutation */
58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7};
/* The final permutation is the inverse of IP - no table is necessary */
private static final byte[] ExpandTr = { /* expansion operation */
32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29,
28, 29, 30, 31, 32, 1};
private static final byte[] PC1 = { /* permuted choice table 1 */
57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36,
63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4};
private static final byte[] Rotates = { /* PC1 rotation schedule */
1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1};
private static final byte[] PC2 = { /* permuted choice table 2 */
9, 18, 14, 17, 11, 24, 1, 5, 22, 25, 3, 28, 15, 6, 21, 10, 35, 38, 23, 19, 12, 4, 26, 8, 43, 54, 16, 7, 27, 20, 13, 2,
0, 0, 41, 52, 31, 37, 47, 55, 0, 0, 30, 40, 51, 45, 33, 48, 0, 0, 44, 49, 39, 56, 34, 53, 0, 0, 46, 42, 50, 36, 29, 32};
private static final byte[][] S = { /* 48->32 bit substitution tables */
/* S[1] */
{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9,
7, 3, 10, 5, 0, 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13},
/* S[2] */
{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12,
6, 9, 3, 2, 15, 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9},
/* S[3] */
{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1, 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2,
12, 5, 10, 14, 7, 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12},
/* S[4] */
{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9, 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3,
14, 5, 2, 8, 4, 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14},
/* S[5] */
{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6, 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12,
5, 6, 3, 0, 14, 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3},
/* S[6] */
{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8, 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4,
10, 1, 13, 11, 6, 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13},
/* S[7] */
{4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6, 1, 4, 11, 13, 12, 3, 7, 14, 10, 15,
6, 8, 0, 5, 9, 2, 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12},
/* S[8] */
{13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2, 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10,
13, 15, 3, 5, 8, 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}};
private static final byte[] P32Tr = { /* 32-bit permutation function */
16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25};
private static final byte[] CIFP = { /*
* compressed/interleaved
* permutation
*/
1, 2, 3, 4, 17, 18, 19, 20, 5, 6, 7, 8, 21, 22, 23, 24, 9, 10, 11, 12, 25, 26, 27, 28, 13, 14, 15, 16, 29, 30, 31, 32,
33, 34, 35, 36, 49, 50, 51, 52, 37, 38, 39, 40, 53, 54, 55, 56, 41, 42, 43, 44, 57, 58, 59, 60, 45, 46, 47, 48, 61, 62, 63, 64};
private static final byte[] ITOA64 = { /* 0..63 => ascii-64 */
(byte) '.', (byte) '/', (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8', (byte) '9', (byte) 'A',
(byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G', (byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M',
(byte) 'N', (byte) 'O', (byte) 'P', (byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U', (byte) 'V', (byte) 'W', (byte) 'X', (byte) 'Y',
(byte) 'Z', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f', (byte) 'g', (byte) 'h', (byte) 'i', (byte) 'j', (byte) 'k',
(byte) 'l', (byte) 'm', (byte) 'n', (byte) 'o', (byte) 'p', (byte) 'q', (byte) 'r', (byte) 's', (byte) 't', (byte) 'u', (byte) 'v', (byte) 'w',
(byte) 'x', (byte) 'y', (byte) 'z'};
/* ===== Tables that are initialized at run time ==================== */
private static final byte[] A64TOI = new byte[128]; /* ascii-64 => 0..63 */
/* Initial key schedule permutation */
private static final long[][] PC1ROT = new long[16][16];
/* Subsequent key schedule rotation permutations */
private static final long[][][] PC2ROT = new long[2][16][16];
/* Initial permutation/expansion table */
private static final long[][] IE3264 = new long[8][16];
/* Table that combines the S, P, and E operations. */
private static final long[][] SPE = new long[8][64];
/* compressed/interleaved => final permutation table */
private static final long[][] CF6464 = new long[16][16];
/* ==================================== */
static {
byte[] perm = new byte[64];
byte[] temp = new byte[64];
// inverse table.
for (int i = 0; i < 64; i++)
A64TOI[ITOA64[i]] = (byte) i;
// PC1ROT - bit reverse, then PC1, then Rotate, then PC2
for (int i = 0; i < 64; i++)
perm[i] = (byte) 0;
for (int i = 0; i < 64; i++) {
int k;
if ((k = PC2[i]) == 0) continue;
k += Rotates[0] - 1;
if ((k % 28) < Rotates[0]) k -= 28;
k = PC1[k];
if (k > 0) {
k--;
k = (k | 0x07) - (k & 0x07);
k++;
}
perm[i] = (byte) k;
}
init_perm(PC1ROT, perm, 8);
// PC2ROT - PC2 inverse, then Rotate, then PC2
for (int j = 0; j < 2; j++) {
int k;
for (int i = 0; i < 64; i++)
perm[i] = temp[i] = 0;
for (int i = 0; i < 64; i++) {
if ((k = PC2[i]) == 0) continue;
temp[k - 1] = (byte) (i + 1);
}
for (int i = 0; i < 64; i++) {
if ((k = PC2[i]) == 0) continue;
k += j;
if ((k % 28) <= j) k -= 28;
perm[i] = temp[k];
}
init_perm(PC2ROT[j], perm, 8);
}
// Bit reverse, intial permupation, expantion
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
int k = (j < 2) ? 0 : IP[ExpandTr[i * 6 + j - 2] - 1];
if (k > 32)
k -= 32;
else if (k > 0) k--;
if (k > 0) {
k--;
k = (k | 0x07) - (k & 0x07);
k++;
}
perm[i * 8 + j] = (byte) k;
}
}
init_perm(IE3264, perm, 8);
// Compression, final permutation, bit reverse
for (int i = 0; i < 64; i++) {
int k = IP[CIFP[i] - 1];
if (k > 0) {
k--;
k = (k | 0x07) - (k & 0x07);
k++;
}
perm[k - 1] = (byte) (i + 1);
}
init_perm(CF6464, perm, 8);
// SPE table
for (int i = 0; i < 48; i++)
perm[i] = P32Tr[ExpandTr[i] - 1];
for (int t = 0; t < 8; t++) {
for (int j = 0; j < 64; j++) {
int k = (((j >> 0) & 0x01) << 5) | (((j >> 1) & 0x01) << 3)
| (((j >> 2) & 0x01) << 2)
| (((j >> 3) & 0x01) << 1)
| (((j >> 4) & 0x01) << 0)
| (((j >> 5) & 0x01) << 4);
k = S[t][k];
k = (((k >> 3) & 0x01) << 0) | (((k >> 2) & 0x01) << 1) | (((k >> 1) & 0x01) << 2) | (((k >> 0) & 0x01) << 3);
for (int i = 0; i < 32; i++)
temp[i] = 0;
for (int i = 0; i < 4; i++)
temp[4 * t + i] = (byte) ((k >> i) & 0x01);
long kk = 0;
for (int i = 24; --i >= 0; )
kk = ((kk << 1) | ((long) temp[perm[i] - 1]) << 32 | (temp[perm[i + 24] - 1]));
SPE[t][j] = to_six_bit(kk);
}
}
}
/**
* You can't call the constructer.
*/
private UnixCrypt() {
}
/**
* Returns the transposed and split code of a 24-bit code into a 4-byte
* code, each having 6 bits.
*/
private static int to_six_bit(int num) {
return (((num << 26) & 0xfc000000) | ((num << 12) & 0xfc0000) | ((num >> 2) & 0xfc00) | ((num >> 16) & 0xfc));
}
/**
* Returns the transposed and split code of two 24-bit code into two 4-byte
* code, each having 6 bits.
*/
private static long to_six_bit(long num) {
return (((num << 26) & 0xfc000000fc000000L) | ((num << 12) & 0xfc000000fc0000L) | ((num >> 2) & 0xfc000000fc00L) | ((num >> 16) & 0xfc000000fcL));
}
/**
* Returns the permutation of the given 64-bit code with the specified
* permutataion table.
*/
private static long perm6464(long c, long[][] p) {
long out = 0L;
for (int i = 8; --i >= 0; ) {
int t = (int) (0x00ff & c);
c >>= 8;
long tp = p[i << 1][t & 0x0f];
out |= tp;
tp = p[(i << 1) + 1][t >> 4];
out |= tp;
}
return out;
}
/**
* Returns the permutation of the given 32-bit code with the specified
* permutataion table.
*/
private static long perm3264(int c, long[][] p) {
long out = 0L;
for (int i = 4; --i >= 0; ) {
int t = (0x00ff & c);
c >>= 8;
long tp = p[i << 1][t & 0x0f];
out |= tp;
tp = p[(i << 1) + 1][t >> 4];
out |= tp;
}
return out;
}
/**
* Returns the key schedule for the given key.
*/
private static long[] des_setkey(long keyword) {
long K = perm6464(keyword, PC1ROT);
long[] KS = new long[16];
KS[0] = K & ~0x0303030300000000L;
for (int i = 1; i < 16; i++) {
KS[i] = K;
K = perm6464(K, PC2ROT[Rotates[i] - 1]);
KS[i] = K & ~0x0303030300000000L;
}
return KS;
}
/**
* Returns the DES encrypted code of the given word with the specified
* environment.
*/
private static long des_cipher(long in, int salt, int num_iter, long[] KS) {
salt = to_six_bit(salt);
long L = in;
long R = L;
L &= 0x5555555555555555L;
R = (R & 0xaaaaaaaa00000000L) | ((R >> 1) & 0x0000000055555555L);
L = ((((L << 1) | (L << 32)) & 0xffffffff00000000L) | ((R | (R >> 32)) & 0x00000000ffffffffL));
L = perm3264((int) (L >> 32), IE3264);
R = perm3264((int) (L & 0xffffffff), IE3264);
while (--num_iter >= 0) {
for (int loop_count = 0; loop_count < 8; loop_count++) {
long kp;
long B;
long k;
kp = KS[(loop_count << 1)];
k = ((R >> 32) ^ R) & salt & 0xffffffffL;
k |= (k << 32);
B = (k ^ R ^ kp);
L ^= (SPE[0][(int) ((B >> 58) & 0x3f)] ^ SPE[1][(int) ((B >> 50) & 0x3f)]
^ SPE[2][(int) ((B >> 42) & 0x3f)]
^ SPE[3][(int) ((B >> 34) & 0x3f)]
^ SPE[4][(int) ((B >> 26) & 0x3f)]
^ SPE[5][(int) ((B >> 18) & 0x3f)]
^ SPE[6][(int) ((B >> 10) & 0x3f)] ^ SPE[7][(int) ((B >> 2) & 0x3f)]);
kp = KS[(loop_count << 1) + 1];
k = ((L >> 32) ^ L) & salt & 0xffffffffL;
k |= (k << 32);
B = (k ^ L ^ kp);
R ^= (SPE[0][(int) ((B >> 58) & 0x3f)] ^ SPE[1][(int) ((B >> 50) & 0x3f)]
^ SPE[2][(int) ((B >> 42) & 0x3f)]
^ SPE[3][(int) ((B >> 34) & 0x3f)]
^ SPE[4][(int) ((B >> 26) & 0x3f)]
^ SPE[5][(int) ((B >> 18) & 0x3f)]
^ SPE[6][(int) ((B >> 10) & 0x3f)] ^ SPE[7][(int) ((B >> 2) & 0x3f)]);
}
// swap L and R
L ^= R;
R ^= L;
L ^= R;
}
L = ((((L >> 35) & 0x0f0f0f0fL) | (((L & 0xffffffff) << 1) & 0xf0f0f0f0L)) << 32 | (((R >> 35) & 0x0f0f0f0fL) | (((R & 0xffffffff) << 1) & 0xf0f0f0f0L)));
L = perm6464(L, CF6464);
return L;
}
/**
* Initializes the given permutation table with the mapping table.
*/
private static void init_perm(long[][] perm, byte[] p, int chars_out) {
for (int k = 0; k < chars_out * 8; k++) {
int l = p[k] - 1;
if (l < 0) continue;
int i = l >> 2;
l = 1 << (l & 0x03);
for (int j = 0; j < 16; j++) {
int s = ((k & 0x07) + ((7 - (k >> 3)) << 3));
if ((j & l) != 0x00) perm[i][j] |= (1L << s);
}
}
}
/**
* Encrypts String into crypt (Unix) code.
*
* @param key the key to be encrypted
* @param setting the salt to be used
* @return the encrypted String
*/
public static String crypt(String key, String setting) {
long constdatablock = 0L; /* encryption constant */
byte[] cryptresult = new byte[13]; /* encrypted result */
long keyword = 0L;
/* invalid parameters! */
if (key == null || setting == null) return "*"; // will NOT match under
// ANY circumstances!
int keylen = key.length();
for (int i = 0; i < 8; i++) {
keyword = (keyword << 8) | ((i < keylen) ? 2 * key.charAt(i) : 0);
}
long[] KS = des_setkey(keyword);
int salt = 0;
for (int i = 2; --i >= 0; ) {
char c = (i < setting.length()) ? setting.charAt(i) : '.';
cryptresult[i] = (byte) c;
salt = (salt << 6) | (0x00ff & A64TOI[c]);
}
long rsltblock = des_cipher(constdatablock, salt, 25, KS);
cryptresult[12] = ITOA64[(((int) rsltblock) << 2) & 0x3f];
rsltblock >>= 4;
for (int i = 12; --i >= 2; ) {
cryptresult[i] = ITOA64[((int) rsltblock) & 0x3f];
rsltblock >>= 6;
}
return new String(cryptresult, 0, 13);
}
public static void main(String[] arg) {
if (arg.length != 2) {
System.err.println("Usage - java org.eclipse.util.UnixCrypt <key> <salt>");
System.exit(1);
}
System.err.println("Crypt=" + crypt(arg[0], arg[1]));
}
}
| [
"remzican_aksoy@apple.com"
] | remzican_aksoy@apple.com |
9238aa4b6dddb2302a3f8caf12d82d818a90e912 | a8d09a190da2a81c6b507b2707d5e32bd2ae7076 | /medicfind/src/com/allexceedvn/medicfind/District.java | 0aadddf3b61810c1e2e039162019c83a8d68bc03 | [] | no_license | vebinhhoanggia/medicfind | ea35c9d2eacf7c97ed34ef52d85315ea25cad8eb | fc7e00a541753f6d544097c94caff5ce04ea55cb | refs/heads/master | 2020-04-28T11:28:48.870513 | 2015-03-24T04:34:47 | 2015-03-24T04:34:47 | 32,772,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 840 | java | package com.allexceedvn.medicfind;
public class District {
private int cityCd;
private int districtCd;
private String districtName;
public District(int cityCd, int districtCd, String districtName) {
super();
this.cityCd = cityCd;
this.districtCd = districtCd;
this.districtName = districtName;
}
public int getCityCd() {
return cityCd;
}
public void setCityCd(int cityCd) {
this.cityCd = cityCd;
}
public int getDistrictCd() {
return districtCd;
}
public void setDistrictCd(int districtCd) {
this.districtCd = districtCd;
}
public String getDistrictName() {
return districtName;
}
public void setDistrictName(String districtName) {
this.districtName = districtName;
}
}
| [
"vebinhhoanggia@gmail.com@8c10c88f-4520-9c7e-81e0-17176e7972b3"
] | vebinhhoanggia@gmail.com@8c10c88f-4520-9c7e-81e0-17176e7972b3 |
9fbdea51b54ff0017771e7bbfed44b4e6079b6be | 4cc6fb1fde80a1730b660ba5ec13ad5f3228ea5c | /java-lihongjie/apache-kafka/spring-boot-with-spring-kafka-example/spring-boot-kafka-producer/src/main/java/com/example/lihongjie/kafka/SpringKafkaProducer.java | 14865dc56dd3eaec89acee7a545f79216e1b52f1 | [
"MIT"
] | permissive | lihongjie/tutorials | c598425b085549f5f7a29b1c7bf0c86ae9823c94 | c729ae0eac90564e6366bc4907dcb8a536519956 | refs/heads/master | 2023-08-19T05:03:23.754199 | 2023-08-11T08:25:29 | 2023-08-11T08:25:29 | 124,048,964 | 0 | 0 | MIT | 2018-04-01T06:26:19 | 2018-03-06T08:51:04 | Java | UTF-8 | Java | false | false | 1,007 | java | package com.example.lihongjie.kafka;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.concurrent.ListenableFuture;
import java.util.UUID;
/**
* 生产者
* 使用@EnableScheduling注解开启定时任务,每秒发送一次。
*/
@Component
@EnableScheduling
public class SpringKafkaProducer {
@Autowired
private KafkaTemplate kafkaTemplate;
@Scheduled(cron = "00/1 * * * * ?")
public void send() {
String message = UUID.randomUUID().toString();
ListenableFuture future = kafkaTemplate.send("app_log", "test", message);
future.addCallback(o -> System.out.println("send-消息发送成功: " + message), throwable -> System.out.println("消息发送失败: " + message));
}
}
| [
"you@example.com"
] | you@example.com |
b026786ffedf8d6d2b4ea68d0423737e01f02494 | 22423f81a1e5072de6ea2934e60ee9c383484021 | /src/uci/excutionToCallTree/Method.java | d188b4262ddf69a21f8adbf9f1ab2500adfa9423 | [] | no_license | lzccc/ExcutionTrace2CallTree | 241484bffa344f3d75be4be5bdbd4c559d07543d | 5de7d7fb189b0a88f40fb98b129da9926ba7970f | refs/heads/master | 2023-02-26T15:39:11.189293 | 2021-02-04T00:26:13 | 2021-02-04T00:26:13 | 335,791,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 282 | java | package uci.excutionToCallTree;
import java.util.ArrayList;
import java.util.List;
public class Method {
String name;
String className;
String id;
public Method(String name, String className, String id) {
this.name = name;
this.className = className;
this.id = id;
}
}
| [
"961191365@qq.com"
] | 961191365@qq.com |
c4e1e082e3329c6d32733023a181ab99c0cc9c73 | 3645c2a0a6633f036b8e10b31ac72c8b85113c64 | /src/main/java/com/imooc/food/po/OrderDetailPO.java | da14b658ce892202539f20ac092bbf22fb779ab5 | [] | no_license | vleuschen/food | d56e18ec9a2d2f313d14ca6f5b59689913810ac0 | d4d0d78c0d8fd17c818bc7edd5c7eb6a5ee4731e | refs/heads/master | 2023-03-13T22:34:21.191006 | 2021-03-13T16:13:32 | 2021-03-13T16:13:32 | 347,408,548 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 613 | java | package com.imooc.food.po;
import com.imooc.food.enummeration.OrderStatusEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
/**
* order_detal 表对应的Entity
*/
@Getter
@Setter
@ToString
public class OrderDetailPO {
private Integer id;
private OrderStatusEnum status;
private String address;
private Integer accountId;
private Integer productId;
private Integer deliverymanId;
private Integer settlementId;
private Integer rewardId;
private BigDecimal price;
private Date date;
} | [
"10719217@qq.com"
] | 10719217@qq.com |
c6282bd7bc0d4ab0c1bd79ff7e151c2611e46299 | 8d7cce31d9782ca53168974c155b164fefa88707 | /src/main/java/se/lexicon/model/Person.java | b96a05db22945359d6515ccd3b6186ffd1d51fb6 | [] | no_license | ReineMoberg/g34_oop-student-system | 0bce925d8506f9da616b3e2aa2239b138440c80d | 3e311300d62af30cfaa0bd911fbd493c9930e5fb | refs/heads/master | 2023-02-13T05:18:22.216589 | 2021-01-11T10:58:08 | 2021-01-11T10:58:08 | 328,714,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,987 | java | package se.lexicon.model;
import java.util.Objects;
// using abstract keyword : only can use for inheritance - cannot create and instance of it
public abstract class Person {
// fields
private String firstName;
private String lastName;
private int age;
private Gender gender;
// constructor
public Person() {
}
public Person(String firstName, String lastName, int age, Gender gender) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
this.gender = gender;
}
// abstract method
public abstract String showInformation();
// getters/setters
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Gender getGender() {
return gender;
}
public void setGender(Gender gender) {
this.gender = gender;
}
// override methods
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Person person = (Person) o;
return age == person.age && Objects.equals(firstName, person.firstName) && Objects.equals(lastName, person.lastName) && gender == person.gender;
}
@Override
public int hashCode() {
return Objects.hash(firstName, lastName, age, gender);
}
@Override
public String toString() {
return "Person{" +
"firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", age=" + age +
", gender=" + gender +
'}';
}
}
| [
"mehrdad.javan@lexicon.se"
] | mehrdad.javan@lexicon.se |
a0f32ba89fd989ba1f8eb3364a7d4f8a84d8317f | 99b2d132a7d63ac1071f5f0efda832f98f1e22b6 | /src/controller/LogoutServlet.java | aea9a8b9bf47703593b533eaee32cde53f39e39c | [] | no_license | whale4u/ServletProject | 4fcd6ce3cfe8e4bcca14d4695ca5c3b981869314 | d4d959e1020d604856f3fd651afd785bc82bc4ec | refs/heads/master | 2022-05-09T09:32:38.159923 | 2020-04-21T14:24:10 | 2020-04-21T14:24:10 | 256,907,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,079 | java | package controller;
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.servlet.http.HttpSession;
import java.io.IOException;
@WebServlet("/logout")
public class LogoutServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
HttpSession session = req.getSession(false);
if (session == null) {
// 没登录,重定向到首页
String url = resp.encodeRedirectURL(req.getContextPath() + "/index.html");
resp.sendRedirect(url);
return;
}
// 从session中移除登录状态
//session.removeAttribute("userName");
session.invalidate();
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req, resp);
}
}
| [
"n1como@163.com"
] | n1como@163.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.