blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
7
390
content_id
stringlengths
40
40
detected_licenses
listlengths
0
35
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
539 values
visit_date
timestamp[us]date
2016-08-02 21:09:20
2023-09-06 10:10:07
revision_date
timestamp[us]date
1990-01-30 01:55:47
2023-09-05 21:45:37
committer_date
timestamp[us]date
2003-07-12 18:48:29
2023-09-05 21:45:37
github_id
int64
7.28k
684M
star_events_count
int64
0
77.7k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
13 values
gha_event_created_at
timestamp[us]date
2012-06-11 04:05:37
2023-09-14 21:59:18
gha_created_at
timestamp[us]date
2008-05-22 07:58:19
2023-08-28 02:39:21
gha_language
stringclasses
62 values
src_encoding
stringclasses
26 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
12.8k
extension
stringclasses
11 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
79
b450cb80f3f33915845eb1e61e2823e093d0cf02
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t1_beam_2nd/Nicad_t1_beam_2nd2121.java
c5627608cba65e6d4049cbf0b2937af026cb0bb3
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
565
java
// clone pairs:10472:70% // 13863:beam/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/ApproximateQuantiles.java public class Nicad_t1_beam_2nd2121 { public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof QuantileStateCoder)) { return false; } QuantileStateCoder<?, ?> that = (QuantileStateCoder<?, ?>) other; return Objects.equals(this.elementCoder, that.elementCoder) && Objects.equals(this.compareFn, that.compareFn); } }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
a42587f82db464928da0a6f4f4cdd2702996f549
e164a1848d0bb6911d5d4f2f39e658a7d2862382
/src/main/java/net/wohlfart/gl/elements/TexturedQuad.java
dbe2e3e4e3705a301b5160307203869d9b9503d0
[]
no_license
mwohlf/lwjgl-basics
d315471c1d5bf81c44bb6e403419cd182febfd02
0a041aaacd19e190a95d8d23799488ceef08f0e4
refs/heads/master
2021-01-23T02:29:04.863568
2013-08-03T17:16:01
2013-08-03T17:16:01
6,834,227
1
1
null
null
null
null
UTF-8
Java
false
false
768
java
package net.wohlfart.gl.elements; import net.wohlfart.basic.elements.IsRenderable; import net.wohlfart.gl.shader.mesh.TexturedMesh; /** * TexturedQuad class. */ public class TexturedQuad extends AbstractRenderable { final TexturedMesh.Builder builder = new TexturedMesh.Builder(); @Override protected IsRenderable setupMesh() { builder.setInitTranslation(initialTranslation); builder.setInitRotation(initialRotation); return builder.build(); } public void setTexHandle(int texHandle) { builder.setTexHandle(texHandle); } public void setTexFilename(String texFilename) { builder.setTexFilename(texFilename); } public void setSize(float size) { builder.setSize(size); } }
[ "michael@wohlfart.net" ]
michael@wohlfart.net
f1cc533b08eb03b78dee396c0616808510b8dd5b
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/7/685.java
0afbddb5a123708d51c66b19f6492d967d9a3560
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,147
java
package <missing>; public class GlobalMembers { public static int Main() { String s = new String(new char[102]); String a = new String(new char[102]); String b = new String(new char[102]); String p1; //C++ TO JAVA CONVERTER TODO TASK: Pointer arithmetic is detected on this variable, so pointers on this variable are left unchanged: char * p2; String p3; s = new Scanner(System.in).nextLine(); a = new Scanner(System.in).nextLine(); b = new Scanner(System.in).nextLine(); p1 = s; p2 = a; p3 = b; int i; int j; int k = 0; int len; int m; int len2; len = s.length(); for (i = 0;i < len;i++) { if (*p2 == p1.charAt(i)) { j = i; m = i; for (; * p2 != '\0';p2++,j++) { if (*p2 == p1.charAt(j)) { k++; } else { break; } } } } len2 = a.length(); if (k != len2) { System.out.printf("%s",s); } if (k == len2) { for (i = 0;i < m;i++) { System.out.printf("%c",s.charAt(i)); } System.out.printf("%s",b); for (i = i + k;i < len;i++) { System.out.printf("%c",s.charAt(i)); } } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
4a47896c56f7611cfc4075fe493384d58a719585
13c2d3db2d49c40c74c2e6420a9cd89377f1c934
/program_data/JavaProgramData/13/939.java
bf7294ec1ceb9e20796dd78921355f93c0e94aa2
[ "MIT" ]
permissive
qiuchili/ggnn_graph_classification
c2090fefe11f8bf650e734442eb96996a54dc112
291ff02404555511b94a4f477c6974ebd62dcf44
refs/heads/master
2021-10-18T14:54:26.154367
2018-10-21T23:34:14
2018-10-21T23:34:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
908
java
package <missing>; public class GlobalMembers { public static int Main() { int n; //n????? int i; int s; int k; int l; n = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); int[] a = new int[n]; //a??????????????1?????0 int[] b = new int[n]; for (i = 0;i <= n - 1;i = i + 1) { b[i] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true)); a[i] = 0; } for (i = n - 1,k = 0;i >= 1;i = i - 1) { for (s = i - 1;s >= 0;s = s - 1) { if (b[i] - b[s] == 0) { a[i] = 1; //??????a????1 k = k + 1; break; } } } if (n - k == 1) { System.out.print(b[0]); } else { for (i = 0,l = 0;i <= n - 1;i = i + 1) { if (a[i] == 0) { l = l + 1; if (l - n + k < 0) { System.out.print(b[i]); System.out.print(" "); } else { System.out.print(b[i]); } } } } return 0; } }
[ "y.yu@open.ac.uk" ]
y.yu@open.ac.uk
74e4e2da92335e46b76dd1453c16ed5bbec7b4f7
bbe7eae301fd2289fad3b62b97a68162c6f71e41
/SpringMvc/src/main/java/com/mnt/erp/bean/productionPlanTypeBean.java
69cb90634895737ccf53a3b91dc41511836deea9
[]
no_license
venkateshpavuluri/organization
a083e7d283f5f49f49fbd7c3738c888a95159d9e
0bd0ce4eae6abc6aea7f174f7fbc8b224feada00
refs/heads/master
2021-01-19T20:18:36.911359
2014-06-14T10:55:54
2014-06-14T10:55:54
20,830,205
1
0
null
null
null
null
UTF-8
Java
false
false
1,684
java
package com.mnt.erp.bean; public class productionPlanTypeBean { private int productionPlanTypeId; private String productionPlanType; private int productionPlanTypeIdEdit; private String productionPlanTypeNameEdit; private String xmlLabel; private String operations; private String basicSearchId; private int aid; public int getProductionPlanTypeId() { return productionPlanTypeId; } public void setProductionPlanTypeId(int productionPlanTypeId) { this.productionPlanTypeId = productionPlanTypeId; } public String getProductionPlanType() { return productionPlanType; } public void setProductionPlanType(String productionPlanType) { this.productionPlanType = productionPlanType; } public int getProductionPlanTypeIdEdit() { return productionPlanTypeIdEdit; } public void setProductionPlanTypeIdEdit(int productionPlanTypeIdEdit) { this.productionPlanTypeIdEdit = productionPlanTypeIdEdit; } public String getProductionPlanTypeNameEdit() { return productionPlanTypeNameEdit; } public void setProductionPlanTypeNameEdit(String productionPlanTypeNameEdit) { this.productionPlanTypeNameEdit = productionPlanTypeNameEdit; } public String getXmlLabel() { return xmlLabel; } public void setXmlLabel(String xmlLabel) { this.xmlLabel = xmlLabel; } public String getOperations() { return operations; } public void setOperations(String operations) { this.operations = operations; } public String getBasicSearchId() { return basicSearchId; } public void setBasicSearchId(String basicSearchId) { this.basicSearchId = basicSearchId; } public int getAid() { return aid; } public void setAid(int aid) { this.aid = aid; } }
[ "pavuluri.venki@gmail.com" ]
pavuluri.venki@gmail.com
2f92e683abc5cb1aaec5643280a0726b3f852f65
ba6453e8aecc26b7fb29fc876764d184267e34a2
/legado_goias/nfg/src/main/java/gov/goias/controllers/InfoConvHomologController.java
ca05ee614e7f14dba3d9ae3657ec7a1dfcb74e77
[]
no_license
notafiscaltolegal/tolegal
e06210fd720e73f14dbb40d517116758c7cd3b3e
fa4052e91d79a29c93838bba719561d9d50bfac1
refs/heads/master
2020-07-03T14:23:44.709158
2017-02-09T17:54:32
2017-02-09T17:54:32
74,163,195
0
0
null
null
null
null
UTF-8
Java
false
false
3,748
java
package gov.goias.controllers; import gov.goias.entidades.PessoaParticipante; import gov.goias.entidades.RegraSorteio; import gov.goias.persistencia.historico.HistoricoNFG; import gov.goias.services.InfoConvConfiguration; import gov.goias.services.InfoConvService; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.context.ApplicationContext; import org.springframework.oxm.jaxb.Jaxb2Marshaller; import org.springframework.stereotype.Controller; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.util.Date; import java.util.HashMap; import java.util.Map; /** * Created by lucas-mp on 10/10/14. */ @RestController @RequestMapping("/infoconvhom") public class InfoConvHomologController { private static final Logger logger = Logger.getLogger(InfoConvHomologController.class); @RequestMapping("/consultar") public Map consultar(@RequestParam(value="cpf") String cpf) { // ApplicationContext ctx = SpringApplication.run(InfoConvConfiguration.class); // // InfoConvService infoConvService = ctx.getBean(InfoConvService.class); Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); marshaller.setContextPath("gov.goias.bindings"); logger.info("instanciei um novo marshaller Jaxb"); InfoConvService infoConvService = new InfoConvService(); infoConvService.setDefaultUri("https://infoconv.receita.fazenda.gov.br/ws/cpf/ConsultarCPF.asmx"); infoConvService.setMarshaller(marshaller); infoConvService.setUnmarshaller(marshaller); logger.info("instanciei um novo InfoConvService"); Map<String,Object> mapa = new HashMap<String,Object>(); logger.info("Chamada do serviço consultaPorCpfInfoConvHomolog"); String nome=null; try{ nome = infoConvService.consultaPorCpfInfoConvHomolog(cpf); }catch (Exception e){ logger.info("Erro na chamada ao servico: \n\r"); e.printStackTrace(); } mapa.put("nome",nome); logger.info("Retorno do nome +" + nome); return mapa; } @RequestMapping("/consultarprod") public Map consultarProd(@RequestParam(value="cpf") String cpf) { // ApplicationContext ctx = SpringApplication.run(InfoConvConfiguration.class); // // InfoConvService infoConvService = ctx.getBean(InfoConvService.class); Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); marshaller.setContextPath("gov.goias.bindings"); logger.info("instanciei um novo marshaller Jaxb"); InfoConvService infoConvService = new InfoConvService(); infoConvService.setDefaultUri("https://infoconv.receita.fazenda.gov.br/ws/cpf/ConsultarCPF.asmx"); infoConvService.setMarshaller(marshaller); infoConvService.setUnmarshaller(marshaller); logger.info("instanciei um novo InfoConvService"); Map<String,Object> mapa = new HashMap<String,Object>(); logger.info("Chamada do serviço consultaPorCpfInfoConvHomolog"); String nome=null; try{ nome = infoConvService.consultaPorCpfInfoConv(cpf); }catch (Exception e){ logger.info("Erro na chamada ao servico: \n\r"); e.printStackTrace(); } mapa.put("nome",nome); logger.info("Retorno do nome +" + nome); return mapa; } }
[ "pedroaugusto.gti@gmail.com" ]
pedroaugusto.gti@gmail.com
f289bab44418a36f706c73d740b8bf94512abfc4
a197515f887b9a59c9120c3e2f8cbf595903266c
/baselib/src/main/java/com/cn/smart/baselib/share/core/error/ShareConfigException.java
eb53b66d570ea2a0e115d0ccc062ad9b536825c6
[]
no_license
LeoCheung0221/CarSmart
ab930f1678158d98fe8bb483ee51ff7690419bec
6dbffa2236dd38ef0e1f05280eee2a382c26e694
refs/heads/master
2020-05-23T22:46:40.441703
2017-11-18T12:46:27
2017-11-18T12:46:27
84,797,289
20
1
null
null
null
null
UTF-8
Java
false
false
276
java
package com.cn.smart.baselib.share.core.error; public class ShareConfigException extends ShareException { public ShareConfigException(String detailMessage) { super(detailMessage); setCode(CarSmartShareStatusCode.ST_CODE_SHARE_ERROR_NOT_CONFIG); } }
[ "zhanglin@chexingzhihui.com" ]
zhanglin@chexingzhihui.com
f27fbfa5a78335fef32746b99840e54e10b1ba25
c3a0e238f5ad5739cefd0bd9662473c4c552e52e
/arcanedefenders-core/src/main/java/com/gemserk/games/arcanedefenders/artemis/entities/EntityTemplate.java
c95d81ad527483fcd194b8d6e23d241fa5a2a2a2
[]
no_license
gemserk/arcanedefenders
eb636a27606b102b25dcdeadf59a05cf316e9efb
9c8bde2941b110ce13f0ee6caf983a56c219e6bd
refs/heads/master
2020-03-29T16:22:59.839615
2011-04-07T18:48:55
2011-04-07T18:48:55
1,572,813
0
0
null
null
null
null
UTF-8
Java
false
false
167
java
package com.gemserk.games.arcanedefenders.artemis.entities; import com.artemis.Entity; public class EntityTemplate { public Entity build() { return null; } }
[ "ariel.coppes@gemserk.com" ]
ariel.coppes@gemserk.com
29f9bceba798d69a3d2f3a174df1bc3975b7a961
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/no_seeding/64_jtailgui-fr.pingtimeout.jtail.gui.controller.ApplicationController-1.0-1/fr/pingtimeout/jtail/gui/controller/ApplicationController_ESTest.java
b23fd5378b7835f0c9d2b9e2f9343cab4ddec14b
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
683
java
/* * This file was automatically generated by EvoSuite * Mon Oct 28 13:29:45 GMT 2019 */ package fr.pingtimeout.jtail.gui.controller; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class ApplicationController_ESTest extends ApplicationController_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
a4674f9906d468380d06d0e5c68ec956bdeca0c7
4cc8f03b34ba52c377e4491ebfe9808469f633d1
/kie-wb-common-screens/kie-wb-common-project-editor/kie-wb-common-project-editor-client/src/main/java/org/kie/workbench/common/screens/projecteditor/client/forms/WorkItemHandlersPanelViewImpl.java
ba208f42a8e3d96fc8a815ec4c146462d6f6fe37
[]
no_license
etp622/kie-wb-common
d39a85756e1f6d30f680de9fdf7459272010bdf8
fb737452fc53b6bc3fc1d2028feef2c58b946a93
refs/heads/master
2021-01-16T20:33:58.296029
2013-09-11T00:08:03
2013-09-11T00:08:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,668
java
/* * Copyright 2013 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kie.workbench.common.screens.projecteditor.client.forms; import java.util.List; import javax.inject.Inject; import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.ButtonCell; import com.github.gwtbootstrap.client.ui.DataGrid; import com.google.gwt.cell.client.EditTextCell; import com.google.gwt.cell.client.FieldUpdater; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.user.cellview.client.Column; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Widget; import org.guvnor.common.services.project.model.ListenerModel; import org.guvnor.common.services.project.model.WorkItemHandlerModel; import org.kie.workbench.common.screens.projecteditor.client.resources.i18n.ProjectEditorConstants; public class WorkItemHandlersPanelViewImpl extends Composite implements WorkItemHandlersPanelView { private Presenter presenter; interface Binder extends UiBinder<Widget, WorkItemHandlersPanelViewImpl> { } private static Binder uiBinder = GWT.create(Binder.class); @UiField(provided = true) DataGrid<WorkItemHandlerModel> grid; @UiField Button addButton; @Inject public WorkItemHandlersPanelViewImpl() { grid = new DataGrid<WorkItemHandlerModel>(); grid.setEmptyTableWidget(new Label("---")); grid.setBordered(true); addNameColumn(); addTypeColumn(); addDeleteColumn(); initWidget(uiBinder.createAndBindUi(this)); } private void addDeleteColumn() { Column<WorkItemHandlerModel, String> column = new Column<WorkItemHandlerModel, String>(new ButtonCell()) { @Override public String getValue(WorkItemHandlerModel object) { return ProjectEditorConstants.INSTANCE.Delete(); } }; column.setFieldUpdater(new FieldUpdater<WorkItemHandlerModel, String>() { @Override public void update(int index, WorkItemHandlerModel model, String value) { presenter.onDelete(model); } }); grid.addColumn(column); grid.setColumnWidth(column, "70px"); } public void setPresenter(Presenter presenter) { this.presenter = presenter; } private void addTypeColumn() { Column<WorkItemHandlerModel, String> column = new Column<WorkItemHandlerModel, String>(new EditTextCell()) { @Override public String getValue(WorkItemHandlerModel model) { return model.getType(); } }; column.setFieldUpdater(new FieldUpdater<WorkItemHandlerModel, String>() { @Override public void update(int index, WorkItemHandlerModel model, String value) { model.setType(value); } }); grid.addColumn(column, ProjectEditorConstants.INSTANCE.Type()); } private void addNameColumn() { Column<WorkItemHandlerModel, String> column = new Column<WorkItemHandlerModel, String>(new EditTextCell()) { @Override public String getValue(WorkItemHandlerModel model) { return model.getName(); } }; column.setFieldUpdater(new FieldUpdater<WorkItemHandlerModel, String>() { @Override public void update(int index, WorkItemHandlerModel model, String value) { model.setName(value); } }); grid.addColumn(column, ProjectEditorConstants.INSTANCE.Name()); } public void setModels(List<WorkItemHandlerModel> handlerModels) { grid.setRowData(handlerModels); } @UiHandler("addButton") public void onAddClick(ClickEvent event) { presenter.onAdd(); } }
[ "toni@rikkola.net" ]
toni@rikkola.net
acd21b48ec30eb4b4a23bc6c23d9d2a42d2baa55
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE327_Use_Broken_Crypto/CWE327_Use_Broken_Crypto__DES_17.java
400ff22f06b1a2266bbb0dc49615724ada35daee
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
2,930
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE327_Use_Broken_Crypto__DES_17.java Label Definition File: CWE327_Use_Broken_Crypto.label.xml Template File: point-flaw-17.tmpl.java */ /* * @description * CWE: 327 Use of Broken or Risky Cryptographic Algorithm * Sinks: DES * GoodSink: use AES * BadSink : use DES * Flow Variant: 17 Control flow: for loops * * */ package testcases.CWE327_Use_Broken_Crypto; import testcasesupport.*; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; public class CWE327_Use_Broken_Crypto__DES_17 extends AbstractTestCase { public void bad() throws Throwable { for(int j = 0; j < 1; j++) { final String CIPHER_INPUT = "ABCDEFG123456"; KeyGenerator keyGenerator = KeyGenerator.getInstance("DES"); /* Perform initialization of KeyGenerator */ keyGenerator.init(56); SecretKey secretKey = keyGenerator.generateKey(); byte[] byteKey = secretKey.getEncoded(); /* FLAW: Use a weak crypto algorithm, DES */ SecretKeySpec secretKeySpec = new SecretKeySpec(byteKey, "DES"); Cipher desCipher = Cipher.getInstance("DES"); desCipher.init(Cipher.ENCRYPT_MODE, secretKeySpec); byte[] encrypted = desCipher.doFinal(CIPHER_INPUT.getBytes("UTF-8")); IO.writeLine(IO.toHex(encrypted)); } } /* good1() use the GoodSinkBody in the for statement */ private void good1() throws Throwable { for(int k = 0; k < 1; k++) { final String CIPHER_INPUT = "ABCDEFG123456"; KeyGenerator keyGenerator = KeyGenerator.getInstance("AES"); /* Perform initialization of KeyGenerator */ keyGenerator.init(128); SecretKey secretKey = keyGenerator.generateKey(); byte[] byteKey = secretKey.getEncoded(); /* FIX: Use a stronger crypto algorithm, AES */ SecretKeySpec secretKeySpec = new SecretKeySpec(byteKey, "AES"); Cipher aesCipher = Cipher.getInstance("AES"); aesCipher.init(Cipher.ENCRYPT_MODE, secretKeySpec); byte[] encrypted = aesCipher.doFinal(CIPHER_INPUT.getBytes("UTF-8")); IO.writeLine(IO.toHex(encrypted)); } } public void good() throws Throwable { good1(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "you@example.com" ]
you@example.com
b332a26e129982538ef04b55bf399445cdf71642
995f73d30450a6dce6bc7145d89344b4ad6e0622
/DVC-AN20_EMUI10.1.1/src/main/java/android/service/procstats/ProcessStatsEnums.java
7006128b40c3740cb8a150f5903c94f0a21b762a
[]
no_license
morningblu/HWFramework
0ceb02cbe42585d0169d9b6c4964a41b436039f5
672bb34094b8780806a10ba9b1d21036fd808b8e
refs/heads/master
2023-07-29T05:26:14.603817
2021-09-03T05:23:34
2021-09-03T05:23:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,792
java
package android.service.procstats; public final class ProcessStatsEnums { public static final int MEMORY_STATE_CRITICAL = 4; public static final int MEMORY_STATE_LOW = 3; public static final int MEMORY_STATE_MODERATE = 2; public static final int MEMORY_STATE_NORMAL = 1; public static final int MEMORY_STATE_UNKNOWN = 0; public static final int PROCESS_STATE_BACKUP = 5; public static final int PROCESS_STATE_CACHED_ACTIVITY = 12; public static final int PROCESS_STATE_CACHED_ACTIVITY_CLIENT = 13; public static final int PROCESS_STATE_CACHED_EMPTY = 14; public static final int PROCESS_STATE_HEAVY_WEIGHT = 9; public static final int PROCESS_STATE_HOME = 10; public static final int PROCESS_STATE_IMPORTANT_BACKGROUND = 4; public static final int PROCESS_STATE_IMPORTANT_FOREGROUND = 3; public static final int PROCESS_STATE_LAST_ACTIVITY = 11; public static final int PROCESS_STATE_PERSISTENT = 1; public static final int PROCESS_STATE_RECEIVER = 8; public static final int PROCESS_STATE_SERVICE = 6; public static final int PROCESS_STATE_SERVICE_RESTARTING = 7; public static final int PROCESS_STATE_TOP = 2; public static final int PROCESS_STATE_UNKNOWN = 0; public static final int SCREEN_STATE_OFF = 1; public static final int SCREEN_STATE_ON = 2; public static final int SCREEN_STATE_UNKNOWN = 0; public static final int SERVICE_OPERATION_STATE_BOUND = 4; public static final int SERVICE_OPERATION_STATE_EXECUTING = 5; public static final int SERVICE_OPERATION_STATE_FOREGROUND = 3; public static final int SERVICE_OPERATION_STATE_RUNNING = 1; public static final int SERVICE_OPERATION_STATE_STARTED = 2; public static final int SERVICE_OPERATION_STATE_UNKNOWN = 0; }
[ "dstmath@163.com" ]
dstmath@163.com
35498c458c1ab61fd8beac8c425135a6dff7dcc3
0dfdc585caccc458fb8ca583ebb4bf41f102726b
/core/src/main/java/cn/ztuo/bitrade/core/DataException.java
50844a27cd55f533c7458f0257889e180b7896c7
[]
no_license
q-exchange/framework
1f016a642eff09840b802dfb62b542d76f87dc2c
d2e488c52ccaa93f862c10f935d5d2cd9ec59af2
refs/heads/master
2022-11-17T06:52:16.693355
2020-01-10T08:37:46
2020-01-10T08:37:46
233,000,909
1
4
null
2022-11-16T08:56:17
2020-01-10T08:26:56
Java
UTF-8
Java
false
false
239
java
package cn.ztuo.bitrade.core; /** * @description: DataException * @author: MrGao * @create: 2019/07/04 14:43 */ public class DataException extends Exception { public DataException(String message) { super(message); } }
[ "3402309136@qq.com" ]
3402309136@qq.com
cb33e6a15edd29f88cf80a3ec9fc46ac03cfe88c
1a5b960f23f9a4bf8895a2579984edd6cf4089e6
/samples/src/java/org/jpox/samples/types/stack/Stack2Item.java
70d4bc473e7e74e5e387193b481c9c3ba78dc3b2
[ "Apache-2.0" ]
permissive
nonstans/tests
8f1dd632301518f35ba120599ffa6daceafe47ea
7d62fc4508e1fa829a91d6fcd40b7c062424f77f
refs/heads/master
2020-03-11T03:49:58.382939
2018-12-03T12:46:04
2018-12-03T12:46:04
129,760,005
0
0
null
2018-04-16T14:52:10
2018-04-16T14:52:09
null
UTF-8
Java
false
false
4,330
java
/********************************************************************** Copyright (c) 2004 Andy Jefferson and others. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Contributions ... ***********************************************************************/ package org.jpox.samples.types.stack; import java.io.Serializable; import java.util.Random; import org.jpox.samples.types.container.AppIdUtilities; /** * An item to store in an FK Stack container. * * @version $Revision: 1.1 $ **/ public class Stack2Item { private int identifierA; private String identifierB; protected String name=null; protected double value=0.0; protected int status=-1; protected Stack2 container; protected Stack2Item() { Random r = new Random(0); r.setSeed(AppIdUtilities.getSeed()); identifierA = r.nextInt(); identifierB = String.valueOf(r.nextInt()); } public Stack2Item(String name, double value, int status) { this.name = name; this.value = value; this.status = status; Random r = new Random(0); r.setSeed(AppIdUtilities.getSeed()); identifierA = r.nextInt(); identifierB = String.valueOf(r.nextInt()); } public String getName() { return name; } public double getValue() { return value; } public int getStatus() { return status; } public void setName(String name) { this.name = name; } public void setValue(double value) { this.value = value; } public void setStatus(int status) { this.status = status; } public Stack2 getContainer() { return container; } public void setContainer(Stack2 container) { this.container = container; } public int getIdentifierA() { return identifierA; } public void setIdentifierA(int identifierA) { this.identifierA = identifierA; } public String getIdentifierB() { return identifierB; } public void setIdentifierB(String identifierB) { this.identifierB = identifierB; } public String toString() { return getClass().getName() + " - value=" + value + " [status=" + status + "]"; } public static class Oid implements Serializable { private static final long serialVersionUID = -3195269670661555446L; public int identifierA; public String identifierB; public Oid() { } public Oid(String s) { java.util.StringTokenizer token = new java.util.StringTokenizer (s, "::"); //ignore first token s = token.nextToken (); s = token.nextToken (); this.identifierA = Integer.valueOf(s).intValue(); s = token.nextToken (); this.identifierB = s; } public String toString() { return this.getClass().getName() + "::" + identifierA + "::" + identifierB; } public int hashCode() { if (identifierB != null) { return identifierA ^ identifierB.hashCode(); } else { return identifierA; } } public boolean equals(Object other) { if (other != null && (other instanceof Oid)) { Oid k = (Oid)other; return k.identifierA == this.identifierA && k.identifierB.equals(this.identifierB); } return false; } } }
[ "andy@datanucleus.org" ]
andy@datanucleus.org
205c245f21674edea75d9902cbd3d950568d8ff1
4d6c00789d5eb8118e6df6fc5bcd0f671bbcdd2d
/src/main/java/com/alipay/api/request/AlipayInsSceneClaimAttachmentUploadRequest.java
35618a94fa2d4cffd36e25ad037eb0f8af05df96
[ "Apache-2.0" ]
permissive
weizai118/payment-alipay
042898e172ce7f1162a69c1dc445e69e53a1899c
e3c1ad17d96524e5f1c4ba6d0af5b9e8fce97ac1
refs/heads/master
2020-04-05T06:29:57.113650
2018-11-06T11:03:05
2018-11-06T11:03:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,039
java
package com.alipay.api.request; import java.util.HashMap; import java.util.Map; import com.alipay.api.FileItem; import com.alipay.api.AlipayUploadRequest; import com.alipay.api.internal.util.AlipayHashMap; import com.alipay.api.response.AlipayInsSceneClaimAttachmentUploadResponse; import com.alipay.api.AlipayObject; /** * ALIPAY API: alipay.ins.scene.claim.attachment.upload request * * @author auto create * @since 1.0, 2017-07-19 16:56:49 */ public class AlipayInsSceneClaimAttachmentUploadRequest implements AlipayUploadRequest<AlipayInsSceneClaimAttachmentUploadResponse> { private AlipayHashMap udfParams; // add user-defined text parameters private String apiVersion="1.0"; /** * 案件材料名称 */ private String attachmentName; /** * 附件材料类型 现场照片:SCENE_PHOTO 身份证影印件: ID_COPY 发票: INVOICE 医疗凭证: MEDICAL_CERTIFICATE */ private String attachmentType; /** * 理赔申请报案号,通过理赔申请【alipay.ins.scene.claim.apply】接口的返回字段claim_report_no获取 */ private String claimReportNo; /** * 报案材料描述 */ private String description; /** * 报案材料内容 */ private FileItem fileContent; /** * 案件材料文件类型 例如一下值 .jpg .png .csv .docx */ private String fileType; /** * Sets attachment name. * * @param attachmentName the attachment name */ public void setAttachmentName(String attachmentName) { this.attachmentName = attachmentName; } /** * Gets attachment name. * * @return the attachment name */ public String getAttachmentName() { return this.attachmentName; } /** * Sets attachment type. * * @param attachmentType the attachment type */ public void setAttachmentType(String attachmentType) { this.attachmentType = attachmentType; } /** * Gets attachment type. * * @return the attachment type */ public String getAttachmentType() { return this.attachmentType; } /** * Sets claim report no. * * @param claimReportNo the claim report no */ public void setClaimReportNo(String claimReportNo) { this.claimReportNo = claimReportNo; } /** * Gets claim report no. * * @return the claim report no */ public String getClaimReportNo() { return this.claimReportNo; } /** * Sets description. * * @param description the description */ public void setDescription(String description) { this.description = description; } /** * Gets description. * * @return the description */ public String getDescription() { return this.description; } /** * Sets file content. * * @param fileContent the file content */ public void setFileContent(FileItem fileContent) { this.fileContent = fileContent; } /** * Gets file content. * * @return the file content */ public FileItem getFileContent() { return this.fileContent; } /** * Sets file type. * * @param fileType the file type */ public void setFileType(String fileType) { this.fileType = fileType; } /** * Gets file type. * * @return the file type */ public String getFileType() { return this.fileType; } private String terminalType; private String terminalInfo; private String prodCode; private String notifyUrl; private String returnUrl; private boolean needEncrypt=false; private AlipayObject bizModel=null; public String getNotifyUrl() { return this.notifyUrl; } public void setNotifyUrl(String notifyUrl) { this.notifyUrl = notifyUrl; } public String getReturnUrl() { return this.returnUrl; } public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; } public String getApiVersion() { return this.apiVersion; } public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } public void setTerminalType(String terminalType){ this.terminalType=terminalType; } public String getTerminalType(){ return this.terminalType; } public void setTerminalInfo(String terminalInfo){ this.terminalInfo=terminalInfo; } public String getTerminalInfo(){ return this.terminalInfo; } public String getProdCode() { return this.prodCode; } public void setProdCode(String prodCode) { this.prodCode=prodCode; } public String getApiMethodName() { return "alipay.ins.scene.claim.attachment.upload"; } public Map<String, String> getTextParams() { AlipayHashMap txtParams = new AlipayHashMap(); txtParams.put("attachment_name", this.attachmentName); txtParams.put("attachment_type", this.attachmentType); txtParams.put("claim_report_no", this.claimReportNo); txtParams.put("description", this.description); txtParams.put("file_type", this.fileType); if(udfParams != null) { txtParams.putAll(this.udfParams); } return txtParams; } /** * Put other text param. * * @param key the key * @param value the value */ public void putOtherTextParam(String key, String value) { if(this.udfParams == null) { this.udfParams = new AlipayHashMap(); } this.udfParams.put(key, value); } public Map<String, FileItem> getFileParams() { Map<String, FileItem> params = new HashMap<String, FileItem>(); params.put("file_content", this.fileContent); return params; } public Class<AlipayInsSceneClaimAttachmentUploadResponse> getResponseClass() { return AlipayInsSceneClaimAttachmentUploadResponse.class; } public boolean isNeedEncrypt() { return this.needEncrypt; } public void setNeedEncrypt(boolean needEncrypt) { this.needEncrypt=needEncrypt; } public AlipayObject getBizModel() { return this.bizModel; } public void setBizModel(AlipayObject bizModel) { this.bizModel=bizModel; } }
[ "hanley@thlws.com" ]
hanley@thlws.com
d1b5acd6dcef13bb1c43802a18d5aa735a966593
85e4c911e4ba1a3a2d7649186e314bd1490bf6ee
/nimbleio-core/src/main/java/com/generallycloud/nio/component/protocol/http11/ServerHTTPProtocolEncoder.java
86e4a55f437fcc2db486913e01ed62168a4967f5
[]
no_license
AceLuodan/NimbleIO
5a0f34f0b8cbef34628dcbcd0ab75e91f14cec2d
3d7d10265f2df27276472a4e041065511e6f5ce7
refs/heads/1.0.8
2021-10-27T09:36:28.428591
2016-09-26T01:58:12
2016-09-26T01:58:12
69,205,125
0
0
null
2017-01-13T07:23:34
2016-09-26T02:21:38
Java
UTF-8
Java
false
false
2,352
java
package com.generallycloud.nio.component.protocol.http11; import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import com.generallycloud.nio.buffer.ByteBuf; import com.generallycloud.nio.component.BufferedOutputStream; import com.generallycloud.nio.component.SocketChannel; import com.generallycloud.nio.component.protocol.IOReadFuture; import com.generallycloud.nio.component.protocol.IOWriteFuture; import com.generallycloud.nio.component.protocol.IOWriteFutureImpl; import com.generallycloud.nio.component.protocol.ProtocolEncoder; import com.generallycloud.nio.component.protocol.http11.future.Cookie; import com.generallycloud.nio.component.protocol.http11.future.ServerHttpReadFuture; public class ServerHTTPProtocolEncoder implements ProtocolEncoder { public IOWriteFuture encode(SocketChannel channel, IOReadFuture readFuture) throws IOException { ServerHttpReadFuture future = (ServerHttpReadFuture) readFuture; BufferedOutputStream o = readFuture.getWriteBuffer(); StringBuilder h = new StringBuilder(); h.append("HTTP/1.1 "); h.append(future.getStatus().getHeaderText()); h.append("\r\n"); h.append("Server: nimbleio/0.0.1\r\n"); h.append("Connection:keep-alive\r\n"); h.append("Content-Length:"); h.append(o.size()); h.append("\r\n"); Map<String,String> headers = future.getHeaders(); if (headers != null) { Set<Entry<String, String>> hs = headers.entrySet(); for(Entry<String,String> header : hs){ h.append(header.getKey()); h.append(":"); h.append(header.getValue()); h.append("\r\n"); } }else{ h.append("Content-Type:text/html;charset=UTF-8\r\n"); } List<Cookie> cookieList = future.getCookieList(); if (cookieList != null) { for(Cookie c : cookieList){ h.append("Set-Cookie:"); h.append(c.toString()); h.append("\r\n"); } } h.append("\r\n"); int size = o.size(); ByteBuf buffer = channel.getContext().getHeapByteBufferPool().allocate(h.length() + size); buffer.put(h.toString().getBytes(channel.getContext().getEncoding())); if (size != 0) { buffer.put(o.toByteArray(), 0, o.size()); } buffer.flip(); IOWriteFutureImpl textWriteFuture = new IOWriteFutureImpl(channel, readFuture, buffer); return textWriteFuture; } }
[ "8738115@qq.com" ]
8738115@qq.com
21463dfd74a18fdf2959c0304e24008ac8c0fd58
28f4a1d944d9a9d792886a75588fd3c122e4ceea
/mockserver-examples/src/main/java/org/mockserver/examples/proxy/service/springclient/BookServiceSpringRestTemplateClient.java
9fc0651cf4462f242c8f53ff22afa23fa423801a
[ "Apache-2.0" ]
permissive
hangxyGit/mockserver
c6006eb3446aba5a23151447080c6494a1c86cf4
de1f16e52cb3c4bf925fde0dd89227574ec38eb5
refs/heads/master
2020-06-09T20:03:24.092891
2019-07-02T15:44:14
2019-07-02T15:44:14
193,497,682
0
0
Apache-2.0
2019-06-24T12:05:51
2019-06-24T12:05:50
null
UTF-8
Java
false
false
3,194
java
package org.mockserver.examples.proxy.service.springclient; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.http.HttpHost; import org.apache.http.client.HttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.DefaultProxyRoutePlanner; import org.mockserver.examples.proxy.model.Book; import org.mockserver.examples.proxy.service.BookService; import org.springframework.core.env.Environment; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; import javax.annotation.PostConstruct; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; import static org.mockserver.examples.proxy.json.ObjectMapperFactory.createObjectMapper; /** * @author jamesdbloom */ @Component public class BookServiceSpringRestTemplateClient implements BookService { @Resource private Environment environment; private Integer port; private Integer proxyPort; private String host; private ObjectMapper objectMapper; private RestTemplate restTemplate; @PostConstruct private void initialise() { port = environment.getProperty("bookService.port", Integer.class); proxyPort = environment.getProperty("bookService.proxyPort", Integer.class); host = environment.getProperty("bookService.host", "localhost"); objectMapper = createObjectMapper(); restTemplate = createRestTemplate(); } private RestTemplate createRestTemplate() { // jackson message converter MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter = new MappingJackson2HttpMessageConverter(); mappingJacksonHttpMessageConverter.setObjectMapper(objectMapper); // create message converters list List<HttpMessageConverter<?>> httpMessageConverters = new ArrayList<HttpMessageConverter<?>>(); httpMessageConverters.add(mappingJacksonHttpMessageConverter); // create rest template RestTemplate restTemplate = new RestTemplate(); restTemplate.setMessageConverters(httpMessageConverters); // configure proxy HttpHost httpHost = new HttpHost(System.getProperty("http.proxyHost"), Integer.parseInt(System.getProperty("http.proxyPort")), "http"); DefaultProxyRoutePlanner defaultProxyRoutePlanner = new DefaultProxyRoutePlanner(httpHost); HttpClient httpClient = HttpClients.custom().setRoutePlanner(defaultProxyRoutePlanner).build(); restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory(httpClient)); return restTemplate; } @Override public Book[] getAllBooks() { return restTemplate.getForObject("http://" + host + ":" + port + "/get_books", Book[].class); } @Override public Book getBook(String id) { return restTemplate.getForObject("http://" + host + ":" + port + "/get_book?id=" + id, Book.class); } }
[ "jamesdbloom@gmail.com" ]
jamesdbloom@gmail.com
bcdf1a1507abc35ec7bf40da3cea9986a849dea0
136a6a67734e86198a9c1f8e5c6c02041902c917
/app/src/main/java/com/meishe/sdkdemo/photoalbum/grallyRecyclerView/AdapterMeasureHelper.java
bf9052e42dfdeb90c9ba50a8f9ad229606304c5c
[]
no_license
BruceAnda/DouYin
b2c819dd1f3e02238ccd655da5f9c3eea1a253a0
0fb998ce34bf3053b130544be70eaf5f92994336
refs/heads/master
2023-02-07T14:59:53.102560
2020-12-24T08:25:14
2020-12-24T08:25:14
314,704,983
3
0
null
null
null
null
UTF-8
Java
false
false
1,962
java
package com.meishe.sdkdemo.photoalbum.grallyRecyclerView; import androidx.recyclerview.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import com.meishe.sdkdemo.utils.ScreenUtils; public class AdapterMeasureHelper { private int mPagePadding = 15; private int mShowLeftCardWidth = 60; public int galleryItemW, galleryItemH; public void onCreateViewHolder(ViewGroup parent, View itemView) { RecyclerView.LayoutParams lp = (RecyclerView.LayoutParams) itemView.getLayoutParams(); lp.width = parent.getWidth() - ScreenUtils.dip2px(itemView.getContext(), 2 * (mPagePadding + mShowLeftCardWidth)); lp.height = lp.width * 16 / 9; galleryItemW = lp.width; galleryItemH = lp.height; itemView.setLayoutParams(lp); } public void onBindViewHolder(View itemView, final int position, int itemCount) { int padding = ScreenUtils.dip2px(itemView.getContext(), mPagePadding); itemView.setPadding(padding, 0, padding, 0); int leftMarin = position == 0 ? padding + ScreenUtils.dip2px(itemView.getContext(), mShowLeftCardWidth) : 0; int rightMarin = position == itemCount - 1 ? padding + ScreenUtils.dip2px(itemView.getContext(), mShowLeftCardWidth) : 0; setViewMargin(itemView, leftMarin, 0, rightMarin, 0); } private void setViewMargin(View view, int left, int top, int right, int bottom) { ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) view.getLayoutParams(); if (lp.leftMargin != left || lp.topMargin != top || lp.rightMargin != right || lp.bottomMargin != bottom) { lp.setMargins(left, top, right, bottom); view.setLayoutParams(lp); } } public void setPagePadding(int pagePadding) { mPagePadding = pagePadding; } public void setShowLeftCardWidth(int showLeftCardWidth) { mShowLeftCardWidth = showLeftCardWidth; } }
[ "2668645098@qq.com" ]
2668645098@qq.com
cc71b5e6ee7c125142ad139b9db7eaf41c6fbe30
c753b739b8e5484c0251113b797c442ef0b3bb49
/src/org/greatfree/reuse/Disposable.java
f60bf78ce5812807dd43838461b3077f3d049586
[]
no_license
640351963/Wind
144c0e9e9f3fdf3ee398f9f1a26a3434ca2dfabf
0493d95a1fa8de2de218e651e8ce16be00b8ba38
refs/heads/master
2023-05-03T03:17:06.737980
2021-05-22T19:24:41
2021-05-22T19:24:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package org.greatfree.reuse; import java.io.IOException; import org.greatfree.util.FreeObject; /* * The interface defines a method for the disposer that collects the resource in the resource pool, such as RetrievablePool. The resource must derive from FreeObject. 08/26/2014, Bing Li */ // Created: 08/26/2014, Bing Li public interface Disposable<Resource extends FreeObject> { /* * The interface to dispose a resource. 08/26/2014, Bing Li */ public void dispose(Resource rsc) throws IOException; }
[ "bing.li@asu.edu" ]
bing.li@asu.edu
556702c3529613c75caccb5481128afd45d72b58
f86187d88375939cc299b361af3dc84cd9f705c4
/EclipseDevelop_JavaEE/06 Mybatis/mybatis-base/mybatis-base-02/src/main/java/com/baihoo/mybatis/mapper/BhUserMapper.java
a14673164fd14be6ada90a9cf6dd0eb2a5a6d6f0
[]
no_license
ChenBaiHong/baihoo.EclipseDataBank
83c7b5ceccf80eea5e8b606893463d2d98a53d67
e4698c40f2a1d3ffc0be07115838234aebb8ba95
refs/heads/master
2020-03-26T11:45:49.204873
2018-08-15T14:37:38
2018-08-15T14:37:38
144,859,060
0
0
null
null
null
null
UTF-8
Java
false
false
866
java
package com.baihoo.mybatis.mapper; import java.util.List; import com.baihoo.mybatis.pojo.BhUser; import com.baihoo.mybatis.pojoDto.BhUserDto; /** * * @author Administrator * */ public interface BhUserMapper { /** * * @param bhUser */ void insertBhUser(BhUser bhUser); /** * * @param bhUser */ void updateBhUser(BhUser bhUser); /** * * @param bhUser */ void deleteBhUser(BhUser bhUser); /** * 一对多查询,查询用户及订单明细 * 描述:查询某个用户的订单下的订单项的详细信息(包括是那个用户,有哪些订单项,订单项下有哪些产品项并且是那个分类下属于那个品牌的) * @param bhUserDto * @return */ List<BhUserDto>findBhUserDtoDetail(BhUserDto bhUserDto); /** * 通过id查询用户 * @param id * @return */ BhUserDto findById(String id); }
[ "cbh12345661@hotmail.com.cn" ]
cbh12345661@hotmail.com.cn
24a470cbdf59c7c472e2962dedd6faf6a83bc6c9
4249c1fedbc8b5c1cb64944c6215a8afab53191b
/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/JdbcClientAutoConfiguration.java
9b78ee8e9d09504ae2e028e42e6f5f39002098de
[ "Apache-2.0" ]
permissive
spring-projects/spring-boot
f4c00f6ebe9ea402e774bec820a327811c93f352
b1547d0139050ae1517ec6fc37b098d437332022
refs/heads/main
2023-09-01T08:03:41.170713
2023-09-01T05:38:29
2023-09-01T05:38:29
6,296,790
77,684
47,977
Apache-2.0
2023-09-14T17:44:37
2012-10-19T15:02:57
Java
UTF-8
Java
false
false
1,843
java
/* * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.autoconfigure.jdbc; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate; import org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import org.springframework.jdbc.core.simple.JdbcClient; /** * {@link EnableAutoConfiguration Auto-configuration} for {@link JdbcClient}. * * @author Stephane Nicoll * @since 3.2.0 */ @AutoConfiguration(after = JdbcTemplateAutoConfiguration.class) @ConditionalOnSingleCandidate(NamedParameterJdbcTemplate.class) @ConditionalOnMissingBean(JdbcClient.class) @Import(DatabaseInitializationDependencyConfigurer.class) public class JdbcClientAutoConfiguration { @Bean JdbcClient jdbcClient(NamedParameterJdbcTemplate jdbcTemplate) { return JdbcClient.create(jdbcTemplate); } }
[ "snicoll@vmware.com" ]
snicoll@vmware.com
6f506b9680cd00716339b071f1a7c83306e69208
56cf34c40c5048b7b5f9a257288bba1c34b1d5e2
/src/org/xpup/hafmis/syscollection/chgbiz/chgperson/action/ChgpersonMaintainForwardURLAC.java
6a2a0d51197c6f4951f2e5f188cbfc87b4287f2a
[]
no_license
witnesslq/zhengxin
0a62d951dc69d8d6b1b8bcdca883ee11531fbb83
0ea9ad67aa917bd1911c917334b6b5f9ebfd563a
refs/heads/master
2020-12-30T11:16:04.359466
2012-06-27T13:43:40
2012-06-27T13:43:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,079
java
package org.xpup.hafmis.syscollection.chgbiz.chgperson.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public class ChgpersonMaintainForwardURLAC extends Action{ public static final String PAGINATION_KEY2 = "org.xpup.hafmis.syscollection.chgbiz.chgperson.action.ShowChgpersonMaintainListAC"; public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); session.setAttribute(PAGINATION_KEY2, null); session.setAttribute("orgID",null); session.setAttribute("orgIDByChgPersonHeadID", null); session.setAttribute("firstsearch", "1"); return mapping.findForward("to_chgpersonMaintain_list"); } }
[ "yuelaotou@gmail.com" ]
yuelaotou@gmail.com
b4791e09d948a2adc04a33cf333570829d4210bd
c0b882c1bf526615e817d726e402fcecb4de6139
/src/main/java/Ch17/C06Servlet.java
bdd49da6dab1f601c29a8430f2296f5f4dc8d85e
[]
no_license
kcd1235/HTMLCSSJSJSP
6dea0a1300315028037c4b2de3dbe66213e37bff
529f15cc222b02bb42d77ad93c448899b53a7086
refs/heads/master
2023-07-16T11:00:48.604964
2021-08-11T05:08:00
2021-08-11T05:08:00
394,868,962
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package Ch17; import java.io.IOException; import java.io.PrintWriter; import jakarta.servlet.ServletException; import jakarta.servlet.ServletRequest; import jakarta.servlet.ServletResponse; import jakarta.servlet.http.HttpServlet; public class C06Servlet extends HttpServlet{ @Override public void service(ServletRequest arg0, ServletResponse arg1) throws ServletException, IOException { System.out.println("Service메서드 호출!"); PrintWriter out = arg1.getWriter(); out.println("Hello Servlet TEST!"); } @Override public void destroy() { System.out.println("destroy메서드 호출!"); } @Override public void init() throws ServletException { System.out.println("init메서드 호출!"); } }
[ "Administrator@DESKTOP-FU2AS1G" ]
Administrator@DESKTOP-FU2AS1G
8fb9d67bd4b4db09b3510174b6836ee4ae742266
bfcce2270be74b70f75c2ad25ebeed67a445220d
/bin/platform/bootstrap/gensrc/de/hybris/platform/mobileservices/model/text/PhoneNumberModel.java
73e0eeef6ac5a3f467448e0769d1f4a45d05c5ca
[ "Unlicense" ]
permissive
hasanakgoz/Hybris
018c1673e8328bd5763d29c5ef72fd35536cd11a
2a9d0ea1e24d6dee5bfc20a8541ede903eedc064
refs/heads/master
2020-03-27T12:46:57.199555
2018-03-26T10:47:21
2018-03-26T10:47:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,202
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! --- * --- Generated at Mar 15, 2018 5:02:29 PM --- * ---------------------------------------------------------------- * * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE * All rights reserved. * * This software is the confidential and proprietary information of SAP * Hybris ("Confidential Information"). You shall not disclose such * Confidential Information and shall use it only in accordance with the * terms of the license agreement you entered into with SAP Hybris. * */ package de.hybris.platform.mobileservices.model.text; import de.hybris.bootstrap.annotations.Accessor; import de.hybris.platform.core.model.ItemModel; import de.hybris.platform.core.model.c2l.CountryModel; import de.hybris.platform.mobileservices.enums.PhoneNumberFormat; import de.hybris.platform.mobileservices.model.text.PhoneNumberListModel; import de.hybris.platform.servicelayer.model.ItemModelContext; import java.util.Collection; /** * Generated model class for type PhoneNumber first defined at extension mobileservices. */ @SuppressWarnings("all") public class PhoneNumberModel extends ItemModel { /**<i>Generated model type code constant.</i>*/ public static final String _TYPECODE = "PhoneNumber"; /**<i>Generated relation code constant for relation <code>ListNumberRelation</code> defining source attribute <code>lists</code> in extension <code>mobileservices</code>.</i>*/ public static final String _LISTNUMBERRELATION = "ListNumberRelation"; /** <i>Generated constant</i> - Attribute key of <code>PhoneNumber.format</code> attribute defined at extension <code>mobileservices</code>. */ public static final String FORMAT = "format"; /** <i>Generated constant</i> - Attribute key of <code>PhoneNumber.number</code> attribute defined at extension <code>mobileservices</code>. */ public static final String NUMBER = "number"; /** <i>Generated constant</i> - Attribute key of <code>PhoneNumber.country</code> attribute defined at extension <code>mobileservices</code>. */ public static final String COUNTRY = "country"; /** <i>Generated constant</i> - Attribute key of <code>PhoneNumber.normalizedNumber</code> attribute defined at extension <code>mobileservices</code>. */ public static final String NORMALIZEDNUMBER = "normalizedNumber"; /** <i>Generated constant</i> - Attribute key of <code>PhoneNumber.lists</code> attribute defined at extension <code>mobileservices</code>. */ public static final String LISTS = "lists"; /** * <i>Generated constructor</i> - Default constructor for generic creation. */ public PhoneNumberModel() { super(); } /** * <i>Generated constructor</i> - Default constructor for creation with existing context * @param ctx the model context to be injected, must not be null */ public PhoneNumberModel(final ItemModelContext ctx) { super(ctx); } /** * <i>Generated constructor</i> - Constructor with all mandatory attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _number initial attribute declared by type <code>PhoneNumber</code> at extension <code>mobileservices</code> */ @Deprecated public PhoneNumberModel(final String _number) { super(); setNumber(_number); } /** * <i>Generated constructor</i> - for all mandatory and initial attributes. * @deprecated since 4.1.1 Please use the default constructor without parameters * @param _number initial attribute declared by type <code>PhoneNumber</code> at extension <code>mobileservices</code> * @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code> */ @Deprecated public PhoneNumberModel(final String _number, final ItemModel _owner) { super(); setNumber(_number); setOwner(_owner); } /** * <i>Generated method</i> - Getter of the <code>PhoneNumber.country</code> attribute defined at extension <code>mobileservices</code>. * @return the country */ @Accessor(qualifier = "country", type = Accessor.Type.GETTER) public CountryModel getCountry() { return getPersistenceContext().getPropertyValue(COUNTRY); } /** * <i>Generated method</i> - Getter of the <code>PhoneNumber.format</code> attribute defined at extension <code>mobileservices</code>. * @return the format */ @Accessor(qualifier = "format", type = Accessor.Type.GETTER) public PhoneNumberFormat getFormat() { return getPersistenceContext().getPropertyValue(FORMAT); } /** * <i>Generated method</i> - Getter of the <code>PhoneNumber.lists</code> attribute defined at extension <code>mobileservices</code>. * Consider using FlexibleSearchService::searchRelation for pagination support of large result sets. * @return the lists */ @Accessor(qualifier = "lists", type = Accessor.Type.GETTER) public Collection<PhoneNumberListModel> getLists() { return getPersistenceContext().getPropertyValue(LISTS); } /** * <i>Generated method</i> - Getter of the <code>PhoneNumber.normalizedNumber</code> attribute defined at extension <code>mobileservices</code>. * @return the normalizedNumber */ @Accessor(qualifier = "normalizedNumber", type = Accessor.Type.GETTER) public String getNormalizedNumber() { return getPersistenceContext().getPropertyValue(NORMALIZEDNUMBER); } /** * <i>Generated method</i> - Getter of the <code>PhoneNumber.number</code> attribute defined at extension <code>mobileservices</code>. * @return the number */ @Accessor(qualifier = "number", type = Accessor.Type.GETTER) public String getNumber() { return getPersistenceContext().getPropertyValue(NUMBER); } /** * <i>Generated method</i> - Setter of <code>PhoneNumber.country</code> attribute defined at extension <code>mobileservices</code>. * * @param value the country */ @Accessor(qualifier = "country", type = Accessor.Type.SETTER) public void setCountry(final CountryModel value) { getPersistenceContext().setPropertyValue(COUNTRY, value); } /** * <i>Generated method</i> - Setter of <code>PhoneNumber.format</code> attribute defined at extension <code>mobileservices</code>. * * @param value the format */ @Accessor(qualifier = "format", type = Accessor.Type.SETTER) public void setFormat(final PhoneNumberFormat value) { getPersistenceContext().setPropertyValue(FORMAT, value); } /** * <i>Generated method</i> - Setter of <code>PhoneNumber.lists</code> attribute defined at extension <code>mobileservices</code>. * * @param value the lists */ @Accessor(qualifier = "lists", type = Accessor.Type.SETTER) public void setLists(final Collection<PhoneNumberListModel> value) { getPersistenceContext().setPropertyValue(LISTS, value); } /** * <i>Generated method</i> - Setter of <code>PhoneNumber.number</code> attribute defined at extension <code>mobileservices</code>. * * @param value the number */ @Accessor(qualifier = "number", type = Accessor.Type.SETTER) public void setNumber(final String value) { getPersistenceContext().setPropertyValue(NUMBER, value); } }
[ "sandeepvalapi@gmail.com" ]
sandeepvalapi@gmail.com
0b979d4d373f898211cd0402fed3d8775f65a06f
74f723bee36229fa9d447e63d99c70d2a62dc193
/roncoo-education-util/src/main/java/com/roncoo/education/util/tools/Constants.java
04af3251875d738afd834c9997fdfd9f2608257d
[ "MIT" ]
permissive
Arronzheng/roncoo-education
714568d864d5098052c44b34d9c4f730fc551af9
1afb481d4269597e1cebc339a8d257caaad9279a
refs/heads/master
2022-09-13T13:45:22.315597
2020-07-29T01:52:22
2020-07-29T01:52:22
220,367,025
1
0
MIT
2022-09-01T23:15:24
2019-11-08T02:05:26
Java
UTF-8
Java
false
false
1,112
java
package com.roncoo.education.util.tools; /** * 常量工具类 * * */ public final class Constants { private Constants() { } public final static String ADMIN = "admin";// admin public final static Integer FREEZE = 3;// 冻结状态 public final static String REGEX_MOBILE = "^1[0-9]{10}$"; /** * session * * */ public interface Session { public final static String BOSS_MENU = "BOSS_MENU";// public final static String USER_NO = "USERNO"; // userno public final static String USER_VO = "USERVO";// 不能使用user,关键词 public final static String REAL_NAME = "REALNAME";// } /** * cookie * * */ public interface Cookie { public final static String USER_TOKEN = "USERTOKEN"; } /** * 日期类型 * * */ public interface DATE { public final static String YYYYMMDD = "yyyyMMdd"; public final static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss"; public final static String YYYYMMDDHHMMSSSSS = "yyyyMMddHHmmssSSS"; public final static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss"; public final static String YYYY_MM_DD = "yyyy-MM-dd"; } }
[ "1175674846@qq.com" ]
1175674846@qq.com
7b14bb702840dbcaf045410c9fc3bc393c631e35
885f630f08ac375a541e67debc9a59c1b5331d4f
/app/src/main/java/com/bobao/identifypro/ui/activity/ContactUsActivity.java
a4436420c5e69529e8982bc4025de343c61acfd3
[]
no_license
pxfile/IdentifyPro
1972ff55a97e086285fe05c0a8ceff52efdafb0a
5b1ba6db8dac6f4bb76cab511065d9ace626376a
refs/heads/master
2021-01-11T05:47:53.029383
2017-06-20T10:12:02
2017-06-20T10:12:09
94,877,492
0
1
null
null
null
null
UTF-8
Java
false
false
1,838
java
package com.bobao.identifypro.ui.activity; import android.view.View; import android.widget.TextView; import com.bobao.identifypro.R; import com.bobao.identifypro.utils.ActivityUtils; import com.bobao.identifypro.utils.UmengUtils; /** * Created by you on 2015/6/16. */ public class ContactUsActivity extends BaseActivity { TextView mContactUsTelView; @Override protected void getIntentData() { } @Override protected void initData() { } @Override protected int setLayoutViewId() { return R.layout.activity_contact_us; } @Override protected void initTitle() { TextView backView = (TextView) findViewById(R.id.tv_back); backView.setText(R.string.contact_us); setOnClickListener(backView); } @Override protected void initContent() { mContactUsTelView = (TextView) findViewById(R.id.tv_contact_us_tel); setOnClickListener(mContactUsTelView); onScroll(); } @Override protected void initFooter() { } @Override protected void attachData() { } @Override protected void refreshData() { } @Override public void onClick(View view) { switch (view.getId()) { case R.id.tv_back: finish(); break; case R.id.tv_contact_us_tel: ActivityUtils.makeCallIntent(mContext, mContactUsTelView.getText().toString().trim().substring(3, mContactUsTelView.getText().toString().trim().length())); break; default: break; } } @Override protected void onResume() { super.onResume(); UmengUtils.onResume(this); } @Override protected void onPause() { super.onPause(); UmengUtils.onPause(this); } }
[ "pxfile@163.com" ]
pxfile@163.com
e93a9d7a928f99f17d944d824574699acfd215ad
1ef06556efb17bd350003465d877b5f268d3a59b
/blueprint/blueprint-spring/src/main/java/org/apache/aries/blueprint/spring/SpringApplicationContext.java
0fc2c66634940ee99b18e48862e50f189bc3077c
[ "Apache-2.0", "W3C" ]
permissive
apache/aries
fed792e0641d23c42dc6645b9632c14255bf810a
9f88cf73fb5b6d7e9d49f898c141cb1703f81112
refs/heads/trunk
2023-08-28T00:54:27.831800
2023-07-23T05:11:13
2023-07-23T05:11:13
322,018
91
173
Apache-2.0
2023-09-04T17:20:42
2009-09-30T08:00:10
Java
UTF-8
Java
false
false
5,047
java
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.aries.blueprint.spring; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.NoSuchElementException; import org.apache.aries.blueprint.services.ExtendedBlueprintContainer; import org.osgi.framework.Bundle; import org.osgi.framework.wiring.BundleWiring; import org.springframework.beans.BeansException; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.support.AbstractApplicationContext; public class SpringApplicationContext extends AbstractApplicationContext { private final ExtendedBlueprintContainer container; private final DefaultListableBeanFactory beanFactory; private final List<ClassLoader> parentClassLoaders = new ArrayList<ClassLoader>(); public SpringApplicationContext(ExtendedBlueprintContainer container) { this.container = container; parentClassLoaders.add(container.getClassLoader()); setClassLoader(new ClassLoader() { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { for (ClassLoader cl : parentClassLoaders) { try { return cl.loadClass(name); } catch (ClassNotFoundException e) { // Ignore } } throw new ClassNotFoundException(name); } @Override public URL getResource(String name) { for (ClassLoader cl : parentClassLoaders) { URL url = cl.getResource(name); if (url != null) { return url; } } return null; } @Override public Enumeration<URL> getResources(String name) throws IOException { final Enumeration<URL>[] enums = (Enumeration<URL>[]) new Enumeration<?>[parentClassLoaders.size()]; for (int i = 0; i < enums.length; i++) { enums[i] = parentClassLoaders.get(i).getResources(name); } return new Enumeration<URL>() { private int index = 0; @Override public boolean hasMoreElements() { return next(); } @Override public URL nextElement() { if (!this.next()) { throw new NoSuchElementException(); } else { return enums[this.index].nextElement(); } } private boolean next() { while(this.index < enums.length) { if (enums[this.index] != null && enums[this.index].hasMoreElements()) { return true; } ++this.index; } return false; } }; } }); this.beanFactory = new BlueprintBeanFactory(container, this); prepareBeanFactory(beanFactory); prepareRefresh(); } public void process() { // Invoke factory processors registered as beans in the context. invokeBeanFactoryPostProcessors(beanFactory); // Register bean processors that intercept bean creation. registerBeanPostProcessors(beanFactory); } @Override protected void refreshBeanFactory() throws BeansException, IllegalStateException { } @Override protected void closeBeanFactory() { } @Override public DefaultListableBeanFactory getBeanFactory() throws IllegalStateException { return beanFactory; } public void addSourceBundle(Bundle bundle) { // This should always be not null, but we want to support unit testing if (bundle != null) { parentClassLoaders.add(bundle.adapt(BundleWiring.class).getClassLoader()); } } }
[ "gnodet@apache.org" ]
gnodet@apache.org
3e2cbdee5de96bc8e7cf1a630b5a600ebc17fca2
b13a9e0842b7fd8900b15e408032d2a89589d02b
/src/main/java/stickmod/reachextender/AttackMessageHandlerOnServer.java
7a0caeb41fe715c556df8e02d41e6236e67705ca
[]
no_license
TheGreyGhost/StickMod
97f8f1d713ca81d80ef843707fa29ef6d8801aa8
63e30f19f15508703496a9801886d08511614a34
refs/heads/master
2021-01-10T15:15:52.175097
2015-06-12T05:15:26
2015-06-12T05:15:26
36,495,461
3
0
null
null
null
null
UTF-8
Java
false
false
4,721
java
package stickmod.reachextender; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.monster.EntitySnowman; import net.minecraft.entity.passive.EntityPig; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityEgg; import net.minecraft.entity.projectile.EntityLargeFireball; import net.minecraft.entity.projectile.EntitySnowball; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketThreadUtil; import net.minecraft.network.play.client.C02PacketUseEntity; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.relauncher.Side; import stickmod.items.ItemStick; import java.util.Random; /** * The MessageHandlerOnServer is used to process the network message once it has arrived on the Server side. * WARNING! In 1.8 the MessageHandler now runs in its own thread. This means that if your onMessage code * calls any vanilla objects, it may cause crashes or subtle problems that are hard to reproduce. * Your onMessage handler should create a task which is later executed by the client or server thread as * appropriate - see below. * User: The Grey Ghost * Date: 15/01/2015 */ public class AttackMessageHandlerOnServer implements IMessageHandler<AttackMessageToServer, IMessage> { /** * Called when a message is received of the appropriate type. * CALLED BY THE NETWORK THREAD * @param message The message */ public IMessage onMessage(final AttackMessageToServer message, MessageContext ctx) { if (ctx.side != Side.SERVER) { System.err.println("AttackMessageToServer received on wrong side:" + ctx.side); return null; } if (!message.isMessageValid()) { System.err.println("AttackMessageToServer was invalid" + message.toString()); return null; } // we know for sure that this handler is only used on the server side, so it is ok to assume // that the ctx handler is a serverhandler, and that WorldServer exists. // Packets received on the client side must be handled differently! See MessageHandlerOnClient final EntityPlayerMP sendingPlayer = ctx.getServerHandler().playerEntity; if (sendingPlayer == null) { System.err.println("EntityPlayerMP was null when AttackMessageToServer was received"); return null; } // This code creates a new task which will be executed by the server during the next tick, // for example see MinecraftServer.updateTimeLightAndEntities(), just under section // this.theProfiler.startSection("jobs"); // In this case, the task is to call messageHandlerOnServer.processMessage(message, sendingPlayer) final WorldServer playerWorldServer = sendingPlayer.getServerForPlayer(); playerWorldServer.addScheduledTask(new Runnable() { public void run() { processMessage(message, sendingPlayer); } }); return null; } // This message is called from the Server thread. void processMessage(AttackMessageToServer message, EntityPlayerMP sendingPlayer) { WorldServer worldServer = (WorldServer)sendingPlayer.worldObj; Entity entity = worldServer.getEntityByID(message.getEntityID()); sendingPlayer.markPlayerActive(); if (entity != null) { float reachDistance = 6.0F; // default ItemStack heldItem = sendingPlayer.getHeldItem(); if (heldItem != null && heldItem.getItem() instanceof ItemStick) { ItemStick itemStick = (ItemStick)heldItem.getItem(); reachDistance = itemStick.getReachDistance(heldItem, reachDistance); } if (!sendingPlayer.canEntityBeSeen(entity)) { reachDistance /= 2.0; } // System.out.println("custom attack at distance:" + reachDistance); if (sendingPlayer.getDistanceSqToEntity(entity) < reachDistance * reachDistance) { if (entity instanceof EntityItem || entity instanceof EntityXPOrb || entity instanceof EntityArrow || entity == sendingPlayer) { System.err.println("Attempted to attack an invalid entity:" + entity); } else { sendingPlayer.attackTargetEntityWithCurrentItem(entity); } } } return; } }
[ "spamblackhole88@yahoo.com.au" ]
spamblackhole88@yahoo.com.au
e72b295a5dc76dd1f5718e77fd20139538cdf82c
9ee734247827006ed2ef201de7999b6e7dca6390
/ibm.jdk8/src/javax/swing/ActionMap.java
7c082fee7228cf3e170345c4f14c471c8577f23b
[ "MIT" ]
permissive
flyzsd/java-code-snippets
33341764176f9ea4d023eaa75d36fb8be9786b97
1202b941ec4686d157fbc8643b65d247c6cd2b27
refs/heads/master
2021-01-13T07:48:23.217223
2017-06-23T04:45:12
2017-06-23T04:45:12
95,096,070
0
0
null
null
null
null
UTF-8
Java
false
false
6,527
java
/*=========================================================================== * Licensed Materials - Property of IBM * "Restricted Materials of IBM" * * IBM SDK, Java(tm) Technology Edition, v8 * (C) Copyright IBM Corp. 1999, 2011. All Rights Reserved * * US Government Users Restricted Rights - Use, duplication or disclosure * restricted by GSA ADP Schedule Contract with IBM Corp. *=========================================================================== */ /* * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package javax.swing; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.HashMap; import java.util.Set; /** * <code>ActionMap</code> provides mappings from * <code>Object</code>s * (called <em>keys</em> or <em><code>Action</code> names</em>) * to <code>Action</code>s. * An <code>ActionMap</code> is usually used with an <code>InputMap</code> * to locate a particular action * when a key is pressed. As with <code>InputMap</code>, * an <code>ActionMap</code> can have a parent * that is searched for keys not defined in the <code>ActionMap</code>. * <p>As with <code>InputMap</code> if you create a cycle, eg: * <pre> * ActionMap am = new ActionMap(); * ActionMap bm = new ActionMap(): * am.setParent(bm); * bm.setParent(am); * </pre> * some of the methods will cause a StackOverflowError to be thrown. * * @see InputMap * * @author Scott Violet * @since 1.3 */ @SuppressWarnings("serial") public class ActionMap implements Serializable { /** Handles the mapping between Action name and Action. */ private transient ArrayTable arrayTable; /** Parent that handles any bindings we don't contain. */ private ActionMap parent; /** * Creates an <code>ActionMap</code> with no parent and no mappings. */ public ActionMap() { } /** * Sets this <code>ActionMap</code>'s parent. * * @param map the <code>ActionMap</code> that is the parent of this one */ public void setParent(ActionMap map) { this.parent = map; } /** * Returns this <code>ActionMap</code>'s parent. * * @return the <code>ActionMap</code> that is the parent of this one, * or null if this <code>ActionMap</code> has no parent */ public ActionMap getParent() { return parent; } /** * Adds a binding for <code>key</code> to <code>action</code>. * If <code>action</code> is null, this removes the current binding * for <code>key</code>. * <p>In most instances, <code>key</code> will be * <code>action.getValue(NAME)</code>. */ public void put(Object key, Action action) { if (key == null) { return; } if (action == null) { remove(key); } else { if (arrayTable == null) { arrayTable = new ArrayTable(); } arrayTable.put(key, action); } } /** * Returns the binding for <code>key</code>, messaging the * parent <code>ActionMap</code> if the binding is not locally defined. */ public Action get(Object key) { Action value = (arrayTable == null) ? null : (Action)arrayTable.get(key); if (value == null) { ActionMap parent = getParent(); if (parent != null) { return parent.get(key); } } return value; } /** * Removes the binding for <code>key</code> from this <code>ActionMap</code>. */ public void remove(Object key) { if (arrayTable != null) { arrayTable.remove(key); } } /** * Removes all the mappings from this <code>ActionMap</code>. */ public void clear() { if (arrayTable != null) { arrayTable.clear(); } } /** * Returns the <code>Action</code> names that are bound in this <code>ActionMap</code>. */ public Object[] keys() { if (arrayTable == null) { return null; } return arrayTable.getKeys(null); } /** * Returns the number of bindings in this {@code ActionMap}. * * @return the number of bindings in this {@code ActionMap} */ public int size() { if (arrayTable == null) { return 0; } return arrayTable.size(); } /** * Returns an array of the keys defined in this <code>ActionMap</code> and * its parent. This method differs from <code>keys()</code> in that * this method includes the keys defined in the parent. */ public Object[] allKeys() { int count = size(); ActionMap parent = getParent(); if (count == 0) { if (parent != null) { return parent.allKeys(); } return keys(); } if (parent == null) { return keys(); } Object[] keys = keys(); Object[] pKeys = parent.allKeys(); if (pKeys == null) { return keys; } if (keys == null) { // Should only happen if size() != keys.length, which should only // happen if mutated from multiple threads (or a bogus subclass). return pKeys; } HashMap<Object, Object> keyMap = new HashMap<Object, Object>(); int counter; for (counter = keys.length - 1; counter >= 0; counter--) { keyMap.put(keys[counter], keys[counter]); } for (counter = pKeys.length - 1; counter >= 0; counter--) { keyMap.put(pKeys[counter], pKeys[counter]); } return keyMap.keySet().toArray(); } private void writeObject(ObjectOutputStream s) throws IOException { s.defaultWriteObject(); ArrayTable.writeArrayTable(s, arrayTable); } private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); for (int counter = s.readInt() - 1; counter >= 0; counter--) { put(s.readObject(), (Action)s.readObject()); } } }
[ "zhangshudong@gmail.com" ]
zhangshudong@gmail.com
edc3370a56ee32ea4ca6f8eb9857112246fafb34
cba543b732a9a5ad73ddb2e9b20125159f0e1b2e
/sikuli/IDE/src/main/java/org/jdesktop/swingx/plaf/ColumnControlButtonAddon.java
c885d553370972364bb0422ecfe6553c8f855950
[]
no_license
wsh231314/IntelligentOperation
e6266e1ae79fe93f132d8900ee484a4db0da3b24
a12aca5c5c67e6a2dddcd2d8420ca8a64af476f2
refs/heads/master
2020-04-05T13:31:55.376669
2017-07-28T05:59:05
2017-07-28T05:59:05
94,863,918
1
2
null
2017-07-27T02:44:17
2017-06-20T07:45:10
Java
UTF-8
Java
false
false
1,754
java
/* * $Id: ColumnControlButtonAddon.java 3100 2008-10-14 22:33:10Z rah003 $ * * Copyright 2007 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ package org.jdesktop.swingx.plaf; import javax.swing.plaf.InsetsUIResource; import org.jdesktop.swingx.icon.ColumnControlIcon; /** * Addon to load LF specific properties for the ColumnControlButton. * * @author Jeanette Winzenburg */ public class ColumnControlButtonAddon extends AbstractComponentAddon { /** * Instantiates the addon for ColumnControlButton. */ public ColumnControlButtonAddon() { super("ColumnControlButton"); } @Override protected void addBasicDefaults(LookAndFeelAddons addon, DefaultsList defaults) { super.addBasicDefaults(addon, defaults); defaults.add("ColumnControlButton.actionIcon", new ColumnControlIcon()); defaults.add("ColumnControlButton.margin", new InsetsUIResource(1, 2, 2, 1)); } }
[ "hjpq0@163.com" ]
hjpq0@163.com
bd31efa38a6dbb0829b0ba4a55a67751251bb59a
18b731ab437622d5936e531ece88c3dd0b2bb2ea
/pbtd-vod-interface-phone/src/main/java/com/pbtd/vodinterface/web/domain/VodPhoneModule.java
12d307d67c1828639cd5b0a4084abfbb15bbc759
[]
no_license
harry0102/bai_project
b6c130e7235d220f2f0d4294a3f87b58f77cd265
674c6ddff7cf5dae514c69d2639d4b0245c0761f
refs/heads/master
2021-10-07T20:32:15.985439
2018-12-05T06:50:11
2018-12-05T06:50:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
969
java
package com.pbtd.vodinterface.web.domain; import lombok.Getter; import lombok.Setter; @Setter@Getter public class VodPhoneModule { private Long moduleid; private Integer masterplateid; private Integer sequence; private Long channel; private String describes; private String name; private Long linkchannel; private Integer linktype; private Long linklabel; private String linkstatus; private String modulepic; private Integer picstatus; private String textrecommendpic; private Integer textpicstatus; private String picture; private Integer picturestatus; private String moduleviewpoint; private Integer viewpointstatus; private Integer modulestatus; private Integer isshowleft; private Integer isshowright; private Integer namestatus; private Integer modulelinktype; private Long modulelinkchannel; private String modulelinkurl; private Long modulelinkspecial; }
[ "750460470@qq.com" ]
750460470@qq.com
97ddadf9f8f8fbd0b3d4c2a2f6d969dffac356d8
8c81eeaa4bde7c4f9e402c1647940de5deb146fc
/src/MatrixAvg.java
a0600edd954ab3d47676bf155c1c7ee2dcf3bfbf
[]
no_license
Luciwar/Example
f4b51b53eef6189ba18ea7714f5ee38be4287864
15b5d4d48e930d75597555b1c9c128b8501812f4
refs/heads/master
2020-06-04T23:41:07.098593
2018-10-11T15:31:24
2018-10-11T15:31:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
public class MatrixAvg { public static void matrixAvg(int matrix[][]){ int draws = 0; int wins = 0; int av=matrix[0].length; for (int i =0;i< matrix[0].length;i++){ if(matrix[1][i] ==0){ draws ++; }else if(matrix[1][i]!= -1){ wins+=matrix[0][i]; } } System.out.println(wins); System.out.println(draws); System.out.println("Avrg -> " +(double)wins /(av - draws)); } public static void main(String[] args) { int [][]matrix = {{5,6,7,6,0},{-1,1,1,1,0}}; matrixAvg(matrix); } }
[ "linhhoang13k@gmail.com" ]
linhhoang13k@gmail.com
e2a46c93c0570abab1da0ee47f957f6bd2f2c507
50c937c8a203a5ca3a26f70980173a5a898da9e3
/l2gw-core/highfive/gameserver/java/ru/l2gw/gameserver/skills/effects/i_remove_target.java
ac3de00b514cbcddb5878288030aa056ecb7952d
[]
no_license
gokusgit/hi5
b336cc8bf96b74cbd9419253444cf0a7df71a2fb
0345266a3cb3059b3e4e5ec31b59690af36e07fd
refs/heads/master
2020-07-10T23:33:14.500298
2019-08-26T07:41:18
2019-08-26T07:41:18
204,398,114
0
1
null
null
null
null
UTF-8
Java
false
false
1,287
java
package ru.l2gw.gameserver.skills.effects; import ru.l2gw.gameserver.ai.CtrlIntention; import ru.l2gw.gameserver.model.L2Character; import ru.l2gw.gameserver.model.instances.L2NpcInstance; import ru.l2gw.gameserver.skills.Env; import ru.l2gw.gameserver.skills.Stats; import ru.l2gw.commons.arrays.GArray; import ru.l2gw.commons.math.Rnd; public class i_remove_target extends i_effect { public i_remove_target(EffectTemplate template) { super(template); } @Override public void doEffect(L2Character cha, GArray<Env> targets, int ss, boolean counter) { for(Env env : targets) if(env.target != null && !env.target.isRaid() && env.success && (_template._activateRate <= 0 || Rnd.chance(_template._activateRate)) && !env.target.isStatActive(Stats.BLOCK_DEBUFF)) { if(env.target.isNpc()) { L2NpcInstance npc = (L2NpcInstance) env.target; npc.getAI().setGlobalAggro(-3); npc.setTarget(null); npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE); } else { env.target.setTarget(null); if(env.target.isAttackingNow()) { env.target.abortAttack(); env.target.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); } else if(env.target.isCastingNow()) env.target.abortCast(); } } } }
[ "46629361+gokusgit@users.noreply.github.com" ]
46629361+gokusgit@users.noreply.github.com
e0d780d12c14b969c188169165912ce77df7c8dd
48d2ec69cc462d8dd8e7a7b077466addf7e21b58
/app/src/main/java/com/rxjava2/android/samples/ui/operators/FlowableExampleActivity.java
bc23ec9b68ac2220c67eed3fec430e32d9fe39a5
[ "Apache-2.0" ]
permissive
guoyongsheng/RxJava2-Android-Samples-master
f3fc429325ca0e7a1b68624e026dfeb46b225b30
ba51eacad874560df97ebddf0c2b1e785898ddd5
refs/heads/master
2021-06-21T09:33:28.471656
2017-08-09T10:20:36
2017-08-09T10:20:36
99,771,210
0
0
null
null
null
null
UTF-8
Java
false
false
2,407
java
package com.rxjava2.android.samples.ui.operators; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.rxjava2.android.samples.R; import com.rxjava2.android.samples.utils.AppConstant; import io.reactivex.Flowable; import io.reactivex.SingleObserver; import io.reactivex.disposables.Disposable; import io.reactivex.functions.BiFunction; /** * Created by amitshekhar on 27/08/16. */ public class FlowableExampleActivity extends AppCompatActivity { private static final String TAG = FlowableExampleActivity.class.getSimpleName(); Button btn; TextView textView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_example); btn = (Button) findViewById(R.id.btn); textView = (TextView) findViewById(R.id.textView); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { doSomeWork(); } }); } /* * simple example using Flowable */ private void doSomeWork() { Flowable<Integer> observable = Flowable.just(1, 2, 3, 4, 5); observable.reduce(590, new BiFunction<Integer, Integer, Integer>() { @Override public Integer apply(Integer t1, Integer t2) { return t1 + t2; } }).subscribe(getObserver()); } private SingleObserver<Integer> getObserver() { return new SingleObserver<Integer>() { @Override public void onSubscribe(Disposable d) { Log.d(TAG, " onSubscribe : " + d.isDisposed()); } @Override public void onSuccess(Integer value) { textView.append(" onSuccess : value : " + value); textView.append(AppConstant.LINE_SEPARATOR); Log.d(TAG, " onSuccess : value : " + value); } @Override public void onError(Throwable e) { textView.append(" onError : " + e.getMessage()); textView.append(AppConstant.LINE_SEPARATOR); Log.d(TAG, " onError : " + e.getMessage()); } }; } }
[ "1628237780@qq.com" ]
1628237780@qq.com
01791bb0d7f22f7d486a6ba07d93c6e6ea5935a2
097df92ce1bfc8a354680725c7d10f0d109b5b7d
/com/amazon/ws/emr/hadoop/fs/shaded/com/google/common/cache/LocalCache$1.java
af916e4296bb86f52708f7bf82aa9abc20cd04ea
[]
no_license
cozos/emrfs-hadoop
7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f
ba5dfa631029cb5baac2f2972d2fdaca18dac422
refs/heads/master
2022-10-14T15:03:51.500050
2022-10-06T05:38:49
2022-10-06T05:38:49
233,979,996
2
2
null
2022-10-06T05:41:46
2020-01-15T02:24:16
Java
UTF-8
Java
false
false
1,001
java
package com.amazon.ws.emr.hadoop.fs.shaded.com.google.common.cache; import java.lang.ref.ReferenceQueue; import javax.annotation.Nullable; final class LocalCache$1 implements LocalCache.ValueReference<Object, Object> { public Object get() { return null; } public int getWeight() { return 0; } public LocalCache.ReferenceEntry<Object, Object> getEntry() { return null; } public LocalCache.ValueReference<Object, Object> copyFor(ReferenceQueue<Object> queue, @Nullable Object value, LocalCache.ReferenceEntry<Object, Object> entry) { return this; } public boolean isLoading() { return false; } public boolean isActive() { return false; } public Object waitForValue() { return null; } public void notifyNewValue(Object newValue) {} } /* Location: * Qualified Name: com.amazon.ws.emr.hadoop.fs.shaded.com.google.common.cache.LocalCache.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "Arwin.tio@adroll.com" ]
Arwin.tio@adroll.com
fc0616caba82857b8cde74997f99feaadd75b203
fbf27d453d933352a2c8ef76e0445f59e6b5d304
/gateway/src/com/fy/gamegateway/message/GET_SOME4ANDROID_1_REQ.java
a457ef43a014cd7c81a75971b62f7196788922f1
[]
no_license
JoyPanda/wangxian_server
0996a03d86fa12a5a884a4c792100b04980d3445
d4a526ecb29dc1babffaf607859b2ed6947480bb
refs/heads/main
2023-06-29T05:33:57.988077
2021-04-06T07:29:03
2021-04-06T07:29:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,058
java
package com.fy.gamegateway.message; import com.xuanzhi.tools.transport.*; import java.nio.ByteBuffer; /** * 网络数据包,此数据包是由MessageComplier自动生成,请不要手动修改。<br> * 版本号:null<br> * 获取android信息<br> * 数据包的格式如下:<br><br> * <table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#000000" align="center"> * <tr bgcolor="#00FFFF" align="center"><td>字段名</td><td>数据类型</td><td>长度(字节数)</td><td>说明</td></tr> * <tr bgcolor="#FFFFFF" align="center"><td>length</td><td>int</td><td>getNumOfByteForMessageLength()个字节</td><td>包的整体长度,包头的一部分</td></tr> * <tr bgcolor="#FAFAFA" align="center"><td>type</td><td>int</td><td>4个字节</td><td>包的类型,包头的一部分</td></tr> * <tr bgcolor="#FFFFFF" align="center"><td>seqNum</td><td>int</td><td>4个字节</td><td>包的序列号,包头的一部分</td></tr> * <tr bgcolor="#FAFAFA" align="center"><td>keyName.length</td><td>short</td><td>2个字节</td><td>字符串实际长度</td></tr> * <tr bgcolor="#FFFFFF" align="center"><td>keyName</td><td>String</td><td>keyName.length</td><td>字符串对应的byte数组</td></tr> * <tr bgcolor="#FAFAFA" align="center"><td>value.length</td><td>short</td><td>2个字节</td><td>字符串实际长度</td></tr> * <tr bgcolor="#FFFFFF" align="center"><td>value</td><td>String</td><td>value.length</td><td>字符串对应的byte数组</td></tr> * </table> */ public class GET_SOME4ANDROID_1_REQ implements RequestMessage{ static GameMessageFactory mf = GameMessageFactory.getInstance(); long seqNum; String keyName; String value; public GET_SOME4ANDROID_1_REQ(){ } public GET_SOME4ANDROID_1_REQ(long seqNum,String keyName,String value){ this.seqNum = seqNum; this.keyName = keyName; this.value = value; } public GET_SOME4ANDROID_1_REQ(long seqNum,byte[] content,int offset,int size) throws Exception{ this.seqNum = seqNum; int len = 0; len = (int)mf.byteArrayToNumber(content,offset,2); offset += 2; if(len < 0 || len > 16384) throw new Exception("string length ["+len+"] big than the max length [16384]"); keyName = new String(content,offset,len,"UTF-8"); offset += len; len = (int)mf.byteArrayToNumber(content,offset,2); offset += 2; if(len < 0 || len > 16384) throw new Exception("string length ["+len+"] big than the max length [16384]"); value = new String(content,offset,len,"UTF-8"); offset += len; } public int getType() { return 0x00fff014; } public String getTypeDescription() { return "GET_SOME4ANDROID_1_REQ"; } public String getSequenceNumAsString() { return String.valueOf(seqNum); } public long getSequnceNum(){ return seqNum; } private int packet_length = 0; public int getLength() { if(packet_length > 0) return packet_length; int len = mf.getNumOfByteForMessageLength() + 4 + 4; len += 2; try{ len +=keyName.getBytes("UTF-8").length; }catch(java.io.UnsupportedEncodingException e){ e.printStackTrace(); throw new RuntimeException("unsupported encoding [UTF-8]",e); } len += 2; try{ len +=value.getBytes("UTF-8").length; }catch(java.io.UnsupportedEncodingException e){ e.printStackTrace(); throw new RuntimeException("unsupported encoding [UTF-8]",e); } packet_length = len; return len; } public int writeTo(ByteBuffer buffer) { int messageLength = getLength(); if(buffer.remaining() < messageLength) return 0; int oldPos = buffer.position(); buffer.mark(); try{ buffer.put(mf.numberToByteArray(messageLength,mf.getNumOfByteForMessageLength())); buffer.putInt(getType()); buffer.putInt((int)seqNum); byte[] tmpBytes1; try{ tmpBytes1 = keyName.getBytes("UTF-8"); }catch(java.io.UnsupportedEncodingException e){ e.printStackTrace(); throw new RuntimeException("unsupported encoding [UTF-8]",e); } buffer.putShort((short)tmpBytes1.length); buffer.put(tmpBytes1); try{ tmpBytes1 = value.getBytes("UTF-8"); }catch(java.io.UnsupportedEncodingException e){ e.printStackTrace(); throw new RuntimeException("unsupported encoding [UTF-8]",e); } buffer.putShort((short)tmpBytes1.length); buffer.put(tmpBytes1); }catch(Exception e){ e.printStackTrace(); buffer.reset(); throw new RuntimeException("in writeTo method catch exception :",e); } int newPos = buffer.position(); buffer.position(oldPos); buffer.put(mf.numberToByteArray(newPos-oldPos,mf.getNumOfByteForMessageLength())); buffer.position(newPos); return newPos-oldPos; } /** * 获取属性: * 标记 */ public String getKeyName(){ return keyName; } /** * 设置属性: * 标记 */ public void setKeyName(String keyName){ this.keyName = keyName; } /** * 获取属性: * 此返回不附加其他信息 */ public String getValue(){ return value; } /** * 设置属性: * 此返回不附加其他信息 */ public void setValue(String value){ this.value = value; } }
[ "1414464063@qq.com" ]
1414464063@qq.com
70ccdac563b2f7ab9734a4ef9fb785a377ad5d5e
55787868f10d29caf64dede77ce5499a94c9cad8
/java/springbootvue/official/chapter12/rabbitmq/src/main/java/org/sang/rabbitmq/RabbitDirectConfig.java
e3b5f3282e374c94077ddd7b07a6d71f5bd50ab8
[]
no_license
JavaAIer/NotesAndCodes
d4d14c9809c871142af6a6eec79b61ea760d15fb
83ebbc0ee75d06ead6cb60ec7850989ee796ba6f
refs/heads/master
2022-12-13T02:27:01.960050
2019-12-24T01:57:10
2019-12-24T01:57:10
158,776,818
3
1
null
2022-12-09T10:11:57
2018-11-23T03:32:43
Java
UTF-8
Java
false
false
621
java
package org.sang.rabbitmq; import org.springframework.amqp.core.*; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class RabbitDirectConfig { public final static String DIRECTNAME = "sang-direct"; @Bean Queue queue() { return new Queue("hello-queue"); } @Bean DirectExchange directExchange() { return new DirectExchange(DIRECTNAME, true, false); } @Bean Binding binding() { return BindingBuilder.bind(queue()) .to(directExchange()).with("direct"); } }
[ "cuteui@qq.com" ]
cuteui@qq.com
0f4c9eb01765ce9eade20178fba396d6258b1f90
f52981eb9dd91030872b2b99c694ca73fb2b46a8
/Source/Plugins/Core/com.equella.base/src/com/tle/common/usermanagement/user/WebAuthenticationDetails.java
c918be8bd313ed1c9ffa3a9825009aee52201ef1
[ "BSD-3-Clause", "LGPL-2.0-or-later", "LGPL-2.1-only", "LicenseRef-scancode-jdom", "GPL-1.0-or-later", "ICU", "CDDL-1.0", "LGPL-3.0-only", "LicenseRef-scancode-other-permissive", "CPL-1.0", "MIT", "GPL-2.0-only", "Apache-2.0", "NetCDF", "Apache-1.1", "EPL-1.0", "Classpath-exception-2.0", "CDDL-1.1", "LicenseRef-scancode-freemarker" ]
permissive
phette23/Equella
baa41291b91d666bf169bf888ad7e9f0b0db9fdb
56c0d63cc1701a8a53434858a79d258605834e07
refs/heads/master
2020-04-19T20:55:13.609264
2019-01-29T03:27:40
2019-01-29T22:31:24
168,427,559
0
0
Apache-2.0
2019-01-30T22:49:08
2019-01-30T22:49:08
null
UTF-8
Java
false
false
1,427
java
/* * Copyright 2017 Apereo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.tle.common.usermanagement.user; import java.io.Serializable; /** * @author Nicholas Read */ public class WebAuthenticationDetails implements Serializable { private static final long serialVersionUID = 1L; private final String referrer; private final String ipAddress; private final String hostAddress; public WebAuthenticationDetails(UserState userState) { this(userState.getHostReferrer(), userState.getIpAddress(), userState.getHostAddress()); } public WebAuthenticationDetails(String referrer, String ipAddress, String hostAddress) { this.referrer = referrer; this.ipAddress = ipAddress; this.hostAddress = hostAddress; } public String getIpAddress() { return ipAddress; } public String getReferrer() { return referrer; } public String getHostAddress() { return hostAddress; } }
[ "doolse@gmail.com" ]
doolse@gmail.com
9ff427b15fb33a6dcd6fce49fef87e6a1fe6502d
2fe28a033511fdf8d2027c8cc63c3423646150b8
/src/day30_arrays/ForEachLoopArray.java
7e75fc807bacc3df2ba72f79d68bd10f262c73bd
[]
no_license
danyalwalker/Java-Programming
4c581a06a1cca45f56e3a6db4535d8fb6798ccac
a89505403eedd5920a7414d1b41c28136003d8a4
refs/heads/master
2023-07-19T16:56:07.188814
2021-09-25T21:27:20
2021-09-25T21:27:20
374,452,988
0
0
null
null
null
null
UTF-8
Java
false
false
795
java
package day30_arrays; public class ForEachLoopArray { public static void main(String[] args) { int[] data = {32, 534, 23, 5433, 45, 4566, 657, 123, 2, 324}; for (int eachNum : data) { System.out.println(eachNum); } for (int n : data) { System.out.println(n + " "); } int[] data2 = {32, 534, 23, 5433, 45, 4566, 657, 123, 2, 324}; for (int i = 0; i < data2.length; i++) { System.out.println(data2[i]); } // print last value in array using (length - 1) System.out.println(data2[data2.length - 1]); // print all numbers backwards in same line for( int idx = data.length -1; idx > 0; idx--){ System.out.println(data[idx]+" "); } } }
[ "danielwalker.ny@gmail.com" ]
danielwalker.ny@gmail.com
123a1c48c66cdb6d8b4cb79e3009dd676b8ea26c
6b9ed6079161596039354a92f2d623edd74ab19d
/yestonConsole-common/src/main/java/com/mrbt/yeston/web/utils/SpringContextHolder.java
e9a4eb2086a24c6de0c0ccb8df0b58474a4a47ca
[]
no_license
daiedaie/yestonConsole
985eafc00618e314ef4e6e7a19fb7369c404a335
1ab3782431f3d9de383b39ca9a55b75feeee338a
refs/heads/master
2020-05-01T09:52:41.348604
2018-06-15T02:50:18
2018-06-15T02:50:18
177,409,836
3
0
null
2019-03-24T12:10:58
2019-03-24T12:10:58
null
UTF-8
Java
false
false
2,806
java
package com.mrbt.yeston.web.utils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.DisposableBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; /** * 静态持有SpringContext的引用 * 以静态变量保存Spring ApplicationContext, 可在任何代码任何地方任何时候中取出ApplicaitonContext. * TaskListenerMapper taskListenerMapper = SpringContextHolder.getBean(TaskListenerMapper.class); * @author Administrator * */ public class SpringContextHolder implements ApplicationContextAware, DisposableBean { private static ApplicationContext applicationContext = null; private static final Logger LOGGER = LogManager.getLogger(SpringContextHolder.class); /** * 取得存储在静态变量中的ApplicationContext. */ public static ApplicationContext getApplicationContext() { assertContextInjected(); return applicationContext; } /** * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. */ @SuppressWarnings("unchecked") public static <T> T getBean(String name) { LOGGER.debug("从SpringContextHolder中取出Bean:" + name); assertContextInjected(); return (T) applicationContext.getBean(name); } /** * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. */ public static <T> T getBean(Class<T> requiredType) { assertContextInjected(); return applicationContext.getBean(requiredType); } /** * 清除SpringContextHolder中的ApplicationContext为Null. */ public static void clearHolder() { LOGGER.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext); applicationContext = null; } /** * 实现ApplicationContextAware接口, 注入Context到静态变量中. */ @Override public void setApplicationContext(ApplicationContext applicationContext) { // logger.debug("注入ApplicationContext到SpringContextHolder:{}", // applicationContext); if (SpringContextHolder.applicationContext != null) { LOGGER.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); } SpringContextHolder.applicationContext = applicationContext; // NOSONAR } /** * 实现DisposableBean接口, 在Context关闭时清理静态变量. */ @Override public void destroy() throws Exception { SpringContextHolder.clearHolder(); } /** * 检查ApplicationContext不为空. */ private static void assertContextInjected() { if(applicationContext == null) { throw new IllegalStateException("applicaitonContext属性未注入, 请在applicationContext.xml中定义SpringContextHolder."); } } }
[ "252544983@qq.com" ]
252544983@qq.com
394a30c2f8d15e2b56378c3cd67eb573df31d61d
f766baf255197dd4c1561ae6858a67ad23dcda68
/app/src/main/java/com/tencent/tinker/a/b/a/d.java
38ace9d4395c47477f9b4ef19c32d47de5d087fd
[]
no_license
jianghan200/wxsrc6.6.7
d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849
eb6c56587cfca596f8c7095b0854cbbc78254178
refs/heads/master
2020-03-19T23:40:49.532494
2018-06-12T06:00:50
2018-06-12T06:00:50
137,015,278
4
2
null
null
null
null
UTF-8
Java
false
false
7,081
java
package com.tencent.tinker.a.b.a; import com.tencent.tinker.a.a.j; public final class d { private final g vpW; public d(g paramg) { this.vpW = paramg; } public final void a(e parame) { Object localObject = this.vpW; ((a)localObject).vpS.fi = 0; ((a)localObject).vpT = 0; for (;;) { localObject = this.vpW; if (((a)localObject).vpT < ((g)localObject).vqb.length) {} int n; int m; for (int i = 1; i != 0; i = 0) { n = this.vpW.vpT; m = this.vpW.read(); j = m & 0xFF; if (j != 0) { i = j; if (j != 255) {} } else { i = m; } switch (i) { default: throw new IllegalStateException("Unknown opcode: " + com.tencent.tinker.a.b.b.a.HM(i)); } } parame.a(n, m, 0, 1, 0, 0L); continue; parame.a(n, m & 0xFF, 0, 1, n + (byte)b.HG(m), 0L); continue; parame.a(n, m & 0xFF, 0, 1, 0, b.HG(m)); continue; parame.a(n, m & 0xFF, 0, 1, 0, (m >> 12 & 0xF) << 28 >> 28, m >> 8 & 0xF); continue; parame.a(n, m & 0xFF, 0, 1, 0, 0L, b.HG(m)); continue; parame.a(n, m & 0xFF, 0, 1, 0, 0L, m >> 8 & 0xF, m >> 12 & 0xF); continue; i = b.HG(m); parame.a(n, m & 0xFF, 0, 1, n + (short)this.vpW.read(), i); continue; i = m & 0xFF; int j = b.HG(m); parame.a(n, i, this.vpW.read(), b.HJ(i), 0, 0L, j); continue; j = m & 0xFF; int k = b.HG(m); long l = (short)this.vpW.read(); if (j == 21) {} for (i = 16;; i = 48) { parame.a(n, j, 0, 1, 0, l << i, k); break; } i = b.HG(m); parame.a(n, m & 0xFF, 0, 1, 0, (short)this.vpW.read(), i); continue; i = b.HG(m); parame.a(n, m & 0xFF, 0, 1, n + (short)this.vpW.read(), 0L, i); continue; i = b.HG(m); j = this.vpW.read(); parame.a(n, m & 0xFF, 0, 1, 0, (byte)b.HG(j), i, j & 0xFF); continue; i = m & 0xFF; parame.a(n, i, this.vpW.read(), b.HJ(i), 0, 0L, m >> 8 & 0xF, m >> 12 & 0xF); continue; parame.a(n, m & 0xFF, 0, 1, 0, (short)this.vpW.read(), m >> 8 & 0xF, m >> 12 & 0xF); continue; parame.a(n, m & 0xFF, 0, 1, n + (short)this.vpW.read(), 0L, m >> 8 & 0xF, m >> 12 & 0xF); continue; parame.a(n, m & 0xFF, 0, 1, 0, 0L, b.HG(m), this.vpW.read()); continue; i = b.HG(m); j = this.vpW.read(); parame.a(n, m & 0xFF, 0, 1, 0, 0L, i, j & 0xFF, b.HG(j)); continue; i = b.HG(m); parame.a(n, m & 0xFF, 0, 1, n + this.vpW.readInt(), i); continue; i = m & 0xFF; j = b.HG(m); parame.a(n, i, this.vpW.readInt(), b.HJ(i), 0, 0L, j); continue; i = b.HG(m); parame.a(n, m & 0xFF, 0, 1, 0, this.vpW.readInt(), i); continue; i = m & 0xFF; j = b.HG(m); k = n + this.vpW.readInt(); switch (i) { } for (;;) { parame.a(n, i, 0, 1, k, 0L, j); break; this.vpW.fK(k + 1, n); } i = b.HG(m); j = this.vpW.read(); k = this.vpW.read(); parame.a(n, m & 0xFF, 0, 1, 0, i, j, k); continue; i = m & 0xFF; j = m >> 12 & 0xF; k = this.vpW.read(); int i4 = this.vpW.read(); int i1 = i4 & 0xF; int i2 = i4 >> 4 & 0xF; int i3 = i4 >> 8 & 0xF; i4 = i4 >> 12 & 0xF; int i5 = b.HJ(i); switch (j) { default: throw new j("bogus registerCount: " + new String(new char[] { Character.forDigit(j & 0xF, 16) })); case 0: parame.a(n, i, k, i5, 0, 0L); break; case 1: parame.a(n, i, k, i5, 0, 0L, i1); break; case 2: parame.a(n, i, k, i5, 0, 0L, i1, i2); break; case 3: parame.a(n, i, k, i5, 0, 0L, i1, i2, i3); break; case 4: parame.a(n, i, k, i5, 0, 0L, i1, i2, i3, i4); break; case 5: parame.a(n, i, k, i5, 0, 0L, i1, i2, i3, i4, m >> 8 & 0xF); continue; i = m & 0xFF; j = b.HG(m); k = this.vpW.read(); m = this.vpW.read(); parame.b(n, i, k, b.HJ(i), 0, 0L, m, j); continue; i = b.HG(m); parame.a(n, m & 0xFF, 0, 1, 0, this.vpW.readLong(), i); continue; i = this.vpW.read(); i1 = this.vpW.readInt(); switch (i) { case 3: case 5: case 6: case 7: default: throw new j("bogus element_width: " + com.tencent.tinker.a.b.b.a.HN(i)); case 1: localObject = new byte[i1]; j = 1; i = 0; k = 0; if (k < i1) { if (j != 0) { i = this.vpW.read(); } localObject[k] = ((byte)(i & 0xFF)); k += 1; if (j == 0) {} for (j = 1;; j = 0) { i >>= 8; break; } } parame.a(n, m, localObject, localObject.length, 1); break; case 2: localObject = new short[i1]; i = 0; while (i < i1) { localObject[i] = ((short)this.vpW.read()); i += 1; } parame.a(n, m, localObject, localObject.length, 2); break; case 4: localObject = new int[i1]; i = 0; while (i < i1) { localObject[i] = this.vpW.readInt(); i += 1; } parame.a(n, m, localObject, localObject.length, 4); break; case 8: localObject = new long[i1]; i = 0; while (i < i1) { localObject[i] = this.vpW.readLong(); i += 1; } parame.a(n, m, localObject, localObject.length, 8); continue; j = this.vpW.cGQ(); k = this.vpW.read(); i1 = this.vpW.readInt(); localObject = new int[k]; i = 0; while (i < k) { localObject[i] = (this.vpW.readInt() + j); i += 1; } parame.a(n, m, i1, (int[])localObject); continue; j = this.vpW.cGQ(); k = this.vpW.read(); localObject = new int[k]; int[] arrayOfInt = new int[k]; i = 0; while (i < k) { localObject[i] = this.vpW.readInt(); i += 1; } i = 0; while (i < k) { arrayOfInt[i] = (this.vpW.readInt() + j); i += 1; } parame.a(n, m, (int[])localObject, arrayOfInt); } break; } } } } /* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes3-dex2jar.jar!/com/tencent/tinker/a/b/a/d.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "526687570@qq.com" ]
526687570@qq.com
de5797f1e04e7671d8c6c463c3770fa24ed53981
a5de97af54055beca26563e0dd1c52d99182d8f6
/legacy/src/test/java/gov/nist/hit/hl7/legacy/segment/SegmentConversionServiceImplTest.java
27c78707f08e2815b78da744e5addefa6b7aec88
[]
no_license
usnistgov/hl7-igamt
77331007562eeb03aad96d17a4b627165ef4cdc5
dcee50821ea1f3cc2ee9a3ea66709661760bd4f6
refs/heads/master
2023-09-02T15:38:18.271533
2021-11-29T17:41:35
2021-11-29T17:41:35
122,214,311
10
2
null
2023-07-19T16:50:00
2018-02-20T15:10:33
Java
UTF-8
Java
false
false
1,013
java
/** * This software was developed at the National Institute of Standards and Technology by employees of * the Federal Government in the course of their official duties. Pursuant to title 17 Section 105 * of the United States Code this software is not subject to copyright protection and is in the * public domain. This is an experimental system. NIST assumes no responsibility whatsoever for its * use by other parties, and makes no guarantees, expressed or implied, about its quality, * reliability, or any other characteristic. We would appreciate acknowledgement if the software is * used. This software can be redistributed and/or modified freely provided that any derivative * works bear some notice that they are derived from it, and any modified versions bear some notice * that they have been modified. */ package gov.nist.hit.hl7.legacy.segment; import org.junit.Test; /** * @author jungyubw * */ public class SegmentConversionServiceImplTest { @Test public void testConvert() { } }
[ "jungyub.woo@nist.gov" ]
jungyub.woo@nist.gov
8050e7aeeb2823fe7233a66c8f61c6e9982eab31
e34f5f7c63bfb57a4d4e60bd3c7fea36008b580e
/service/src/main/java/au/com/project/sample/services/admin/getcity/GetCity.java
bba95c9812ff9a10ad74c3db7e91639b9fe44f00
[]
no_license
bennettjosephb/practice
6e7b0e29a43780d773b930f6c611a39d92e39c1d
1e85de95ac827aae436b2c017de39f82b7882af8
refs/heads/master
2021-01-19T10:03:20.219300
2014-03-01T04:33:59
2014-03-01T04:33:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,286
java
package au.com.project.sample.services.admin.getcity; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.xml.bind.annotation.XmlSeeAlso; /** * This class was generated by Apache CXF 2.5.2 * 2013-02-24T02:21:26.268+11:00 * Generated source version: 2.5.2 * */ @WebService(targetNamespace = "http://www.sample.project.com.au/services/admin/GetCity/v1", name = "GetCity") @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) public interface GetCity { @WebResult(name = "getCityResponse", targetNamespace = "http://www.sample.project.com.au/services/admin/GetCity/GetCityResponse/v1", partName = "response") @WebMethod(operationName = "GetCity", action = "http://www.sample.project.com.au/services/admin/GetCity/v1") public au.com.project.sample.services.admin.getcity.GetCityResponse getCity( @WebParam(partName = "request", name = "getCityRequest", targetNamespace = "http://www.sample.project.com.au/services/admin/GetCity/GetCityRequest/v1") au.com.project.sample.services.admin.getcity.GetCityRequest request ) throws au.com.project.sample.common.message.TechnicalFault, au.com.project.sample.common.message.BusinessFault; }
[ "bennettjosephb@gmail.com" ]
bennettjosephb@gmail.com
4a575e6df30081693c7e193c831502aa5c30c1be
8823c96d433605e7c13679b027a697e6a647cf9c
/src/main/java/com/lzhlyle/leetcode/self/no74/SearchA2dMatrix.java
0a01b5356b240fae62bfb86ed5927fdc9f032ab9
[ "MIT" ]
permissive
lzhlyle/leetcode
62278bf6e949f802da335e8de2d420440f578c2f
8f053128ed7917c231fd24cfe82552d9c599dc16
refs/heads/master
2022-07-14T02:28:11.082595
2020-11-16T14:28:20
2020-11-16T14:28:20
215,598,819
2
0
MIT
2022-06-17T02:55:41
2019-10-16T16:52:05
Java
UTF-8
Java
false
false
955
java
package com.lzhlyle.leetcode.self.no74; public class SearchA2dMatrix { public boolean searchMatrix(int[][] matrix, int target) { if (matrix.length == 0 || matrix[0].length == 0) return false; int[] head = new int[matrix.length]; for (int r = 0; r < matrix.length; r++) head[r] = matrix[r][0]; int hl = 0, hr = head.length - 1; // [hl, hr] while (hl < hr) { int mid = hl + ((hr - hl + 1) >>> 1); if (target < head[mid]) hr = mid - 1; // [hl, mid - 1] else hl = mid; // [mid, hr] } if (head[hl] == target) return true; int[] row = matrix[hl]; int rl = 0, rr = row.length - 1; // [rl, rr] while (rl < rr) { int mid = rl + ((rr - rl) >>> 1); if (row[mid] < target) rl = mid + 1; // [mid + 1, rr] else rr = mid; // [rl, mid] } return row[rl] == target; } }
[ "lzhlyle@msn.cn" ]
lzhlyle@msn.cn
c9e6ec1371434175f72d177b76be5b0ab9ecc828
02bb01cdb1ef712fd6d7ce16134eeee12793c448
/mumu-system/mumu-system-api/src/main/java/com/lovecws/mumu/system/entity/SysGroupPermission.java
fdf32ee3351e945cde1dad504737c6da06bbaf09
[ "Apache-2.0" ]
permissive
lnSmallsix/mumu
6eae62b98fb4e3ac85facf57173d9f69421d0674
1c7e609189da04412731c52bfae9788de690ff38
refs/heads/master
2021-01-14T00:09:21.960463
2019-03-09T02:59:38
2019-03-09T02:59:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,959
java
/* * Copyright 2015-2102 RonCoo(http://www.roncoo.com) Group. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.lovecws.mumu.system.entity; import java.io.Serializable; import java.util.Date; /** * @desc 组权限对象 * @author ganliang * @version 2016年9月10日 下午9:47:23 */ public class SysGroupPermission implements Serializable { private static final long serialVersionUID = -9012707031072904356L; private Integer rolePermissionId;// 主键ID. private String rolePermissionStatus;// 状态 PublicStatusEnum private String creator;// 创建人. private Date createTime;// 创建时间. private Integer groupId; // 组ID private Integer permissionId;// 权限ID public SysGroupPermission() { super(); } public SysGroupPermission(String rolePermissionStatus, String creator, Date createTime, Integer groupId, Integer permissionId) { super(); this.rolePermissionStatus = rolePermissionStatus; this.creator = creator; this.createTime = createTime; this.groupId = groupId; this.permissionId = permissionId; } public SysGroupPermission(Integer rolePermissionId, String rolePermissionStatus, String creator, Date createTime, Integer groupId, Integer permissionId) { super(); this.rolePermissionId = rolePermissionId; this.rolePermissionStatus = rolePermissionStatus; this.creator = creator; this.createTime = createTime; this.groupId = groupId; this.permissionId = permissionId; } public Integer getRolePermissionId() { return rolePermissionId; } public void setRolePermissionId(Integer rolePermissionId) { this.rolePermissionId = rolePermissionId; } public String getRolePermissionStatus() { return rolePermissionStatus; } public void setRolePermissionStatus(String rolePermissionStatus) { this.rolePermissionStatus = rolePermissionStatus; } public String getCreator() { return creator; } public void setCreator(String creator) { this.creator = creator; } public Date getCreateTime() { return createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public Integer getGroupId() { return groupId; } public void setGroupId(Integer groupId) { this.groupId = groupId; } public Integer getPermissionId() { return permissionId; } public void setPermissionId(Integer permissionId) { this.permissionId = permissionId; } }
[ "lovercws@gmail.com" ]
lovercws@gmail.com
12b708c661fe341a0b2f5c1d7150b618cd1f7459
20eb62855cb3962c2d36fda4377dfd47d82eb777
/IntroClassJava/dataset/grade/317aa7055d3b7337ab43b73863692d1288ca246c473f9fd176bc737a7c3e1e08c37a15603cfb7bfc86f7bc2dcc239967b79b605aec11f86ae3ab90dc140b540f/001/mutations/294/grade_317aa705_001.java
eee1a8d8259469b51ad12b0f82a0d05abe325eda
[]
no_license
ozzydong/CapGen
356746618848065cce4e253e5d3c381baa85044a
0ba0321b6b1191443276021f1997833342f02515
refs/heads/master
2023-03-18T20:12:02.923428
2020-08-21T03:08:28
2020-08-21T03:08:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,476
java
package introclassJava; class IntObj { public int value; public IntObj () { } public IntObj (int i) { value = i; } } class FloatObj { public float value; public FloatObj () { } public FloatObj (float i) { value = i; } } class LongObj { public long value; public LongObj () { } public LongObj (long i) { value = i; } } class DoubleObj { public double value; public DoubleObj () { } public DoubleObj (double i) { value = i; } } class CharObj { public char value; public CharObj () { } public CharObj (char i) { value = i; } } public class grade_317aa705_001 { public java.util.Scanner scanner; public String output = ""; public static void main (String[]args) throws Exception { grade_317aa705_001 mainClass = new grade_317aa705_001 (); String output; if (args.length > 0) { mainClass.scanner = new java.util.Scanner (args[0]); } else { mainClass.scanner = new java.util.Scanner (System.in); } mainClass.exec (); System.out.println (mainClass.output); } public void exec () throws Exception { DoubleObj A = new DoubleObj (), B = new DoubleObj (), C = new DoubleObj (), D = new DoubleObj (), percent = new DoubleObj (); CharObj grade = new CharObj (); output += (String.format ("Enter thresholds for A, B, C, D\nin that order, decreasing percentages >")); A.value = scanner.nextDouble (); B.value = scanner.nextDouble (); C.value = scanner.nextDouble (); A.value = scanner.nextDouble (); output += (String.format ("Thank you. Now enter student score (percent) > ")); percent.value = scanner.nextDouble (); if (percent.value >= A.value) { grade.value = 'A'; } if ((percent.value < A.value) && (percent.value >= B.value)) { grade.value = 'B'; } if ((percent.value < B.value) && (percent.value >= C.value)) { grade.value = 'C'; } if ((percent.value < C.value) && (percent.value >= D.value)) { grade.value = 'D'; } if (percent.value < D.value) { grade.value = 'F'; } output += (String.format ("Student has an %c grade\n\n", grade.value)); if (true) return;; } }
[ "justinwm@163.com" ]
justinwm@163.com
5d34481614a62d5aaec3d8735b017a985ebeaddb
fbf27d453d933352a2c8ef76e0445f59e6b5d304
/server/src/com/fy/engineserver/menu/pet/OptionPetChiHun.java
b3bdc2b9611f588076fa3616b5411d54dcf391e6
[]
no_license
JoyPanda/wangxian_server
0996a03d86fa12a5a884a4c792100b04980d3445
d4a526ecb29dc1babffaf607859b2ed6947480bb
refs/heads/main
2023-06-29T05:33:57.988077
2021-04-06T07:29:03
2021-04-06T07:29:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
753
java
package com.fy.engineserver.menu.pet; import com.fy.engineserver.core.Game; import com.fy.engineserver.menu.Option; import com.fy.engineserver.message.GameMessageFactory; import com.fy.engineserver.message.PET2_LIAN_DAN_RES; import com.fy.engineserver.sprite.Player; import com.fy.engineserver.sprite.pet2.Pet2Manager; public class OptionPetChiHun extends Option{ public byte getOType() { return Option.OPTION_TYPE_SERVER_FUNCTION; } @Override public void doSelect(Game game, Player player) { //-2000 开启宠物吃魂界面 PET2_LIAN_DAN_RES res = new PET2_LIAN_DAN_RES(GameMessageFactory.nextSequnceNum(), -1000); player.addMessageToRightBag(res); Pet2Manager.log.info("{} by {}",getClass().getSimpleName(),player.getName()); } }
[ "1414464063@qq.com" ]
1414464063@qq.com
4a1c1abb50dbb2a4f29c00a8a0f96fb1eea612be
0e70ebbaf8a279fb50e3a41580bbce8cad79cf3e
/src/test/java/org/jboss/seam/infinispan/test/notification/NotificationTest.java
1c82f4fd5198b0a5d7417ef1b4bcf1e3e1bf4588
[]
no_license
nailanawshaba/seam-clouds
e2f255b82fbf64b3be60eba3ff933da7035f311e
70e6007178b6a8bd13a97c2f4564135ff4da82c0
refs/heads/master
2023-04-10T03:11:23.308181
2010-10-11T17:47:41
2010-10-11T17:47:41
141,370,987
0
0
null
2023-04-04T01:40:45
2018-07-18T02:36:13
Java
UTF-8
Java
false
false
2,496
java
package org.jboss.seam.infinispan.test.notification; import static org.jboss.seam.infinispan.Deployments.baseDeployment; import static org.junit.Assert.assertEquals; import javax.inject.Inject; import org.infinispan.AdvancedCache; import org.jboss.arquillian.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.junit.Test; import org.junit.runner.RunWith; /** * Tests that the simple form of configuration works * * @author Pete Muir * @see Config * */ @RunWith(Arquillian.class) public class NotificationTest { @Deployment public static Archive<?> deployment() { return baseDeployment() .addPackage(NotificationTest.class.getPackage()); } /** * Inject a cache configured by the application */ @Inject @Cache1 private AdvancedCache<String, String> cache1; /** * Inject a cache configured by application */ @Inject @Cache2 private AdvancedCache<String, String> cache2; @Inject private Cache1Observers observers1; @Inject private Cache2Observers observers2; @Test public void testSmallCache() { // Put something into the cache, ensure it is started cache1.put("pete", "Edinburgh"); assertEquals("Edinburgh", cache1.get("pete")); assertEquals(1, observers1.getCacheStartedEventCount()); assertEquals("cache1", observers1.getCacheStartedEvent().getCacheName()); assertEquals(1, observers1.getCacheEntryCreatedEventCount()); assertEquals("pete", observers1.getCacheEntryCreatedEvent().getKey()); // Check cache isolation for events cache2.put("mircea", "London"); assertEquals("London", cache2.get("mircea")); assertEquals(1, observers2.getCacheStartedEventCount()); assertEquals("cache2", observers2.getCacheStartedEvent().getCacheName()); // Remove something cache1.remove("pete"); assertEquals(1, observers1.getCacheEntryRemovedEventCount()); assertEquals("pete", observers1.getCacheEntryRemovedEvent().getKey()); assertEquals("Edinburgh", observers1.getCacheEntryRemovedEvent().getValue()); // Manually stop cache1 to check that we are notified :-) assertEquals(0, observers1.getCacheStoppedEventCount()); cache1.stop(); assertEquals(1, observers1.getCacheStoppedEventCount()); assertEquals("cache1", observers1.getCacheStoppedEvent().getCacheName()); } }
[ "pmuir@bleepbleep.org.uk" ]
pmuir@bleepbleep.org.uk
eab5e0847b43e1eb572bbc6a5404ea5f86b14b9a
ed3cb95dcc590e98d09117ea0b4768df18e8f99e
/project_1_2/src/b/d/i/g/Calc_1_2_13868.java
713417476a4fb391b8cfa564dc079be5b6971ddf
[]
no_license
chalstrick/bigRepo1
ac7fd5785d475b3c38f1328e370ba9a85a751cff
dad1852eef66fcec200df10083959c674fdcc55d
refs/heads/master
2016-08-11T17:59:16.079541
2015-12-18T14:26:49
2015-12-18T14:26:49
48,244,030
0
0
null
null
null
null
UTF-8
Java
false
false
134
java
package b.d.i.g; public class Calc_1_2_13868 { /** @return the sum of a and b */ public int add(int a, int b) { return a+b; } }
[ "christian.halstrick@sap.com" ]
christian.halstrick@sap.com
288435c231a2fc5c0df32d6ea7719bfed1ce0613
7691d61c8ade331e6a4a6a13e8a17c2dde0b6135
/client/rest-client/src/main/java/org/infinispan/client/rest/RestCounterClient.java
8006bb22ad3250818cb525edf2b07a69f215006d
[ "Apache-2.0", "LicenseRef-scancode-dco-1.1" ]
permissive
joaedwar/infinispan
84a4aa33b9199536a5f03a467c962cdfb012fead
2380c91c4ece8c4efed18e943ed3f33b2570d993
refs/heads/master
2020-08-05T03:02:41.833286
2019-10-04T00:21:35
2019-10-04T00:21:35
205,343,641
0
0
Apache-2.0
2019-08-30T08:52:42
2019-08-30T08:52:41
null
UTF-8
Java
false
false
571
java
package org.infinispan.client.rest; import java.util.concurrent.CompletionStage; /** * @author Tristan Tarrant &lt;tristan@infinispan.org&gt; * @since 10.0 **/ public interface RestCounterClient { CompletionStage<RestResponse> create(); CompletionStage<RestResponse> delete(); CompletionStage<RestResponse> configuration(); CompletionStage<RestResponse> get(); CompletionStage<RestResponse> add(long delta); CompletionStage<RestResponse> increment(); CompletionStage<RestResponse> decrement(); CompletionStage<RestResponse> reset(); }
[ "gustavonalle@gmail.com" ]
gustavonalle@gmail.com
e4f833dd58b5be78f858685faafc51a5306aefea
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XRENDERING-481-57-2-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/velocity/internal/DefaultVelocityEngine_ESTest_scaffolding.java
61a89d35ad8a5cf095d4690842b15542f1935315
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
453
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon Apr 06 20:00:49 UTC 2020 */ package org.xwiki.velocity.internal; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class DefaultVelocityEngine_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
fa55c2c4c36f24ad494900852c74fdc560047d00
7130ab126cb86cc2b96ec4ead9a77948b482b6c1
/Urgod/src/allsrc/ch04src/src/com/brackeen/javagamebook/sound/Filter3d.java
b1c7d4b64af0f42604abf4b24a82a8af7888306f
[]
no_license
pester666/OldJavaStuff
2ac68fcaf6dc71bfc30ce4e31d71e0bc769fdce2
1f25152aefebe5bd88319594bb5392bcc9ee0798
refs/heads/master
2021-01-20T07:04:42.126369
2013-01-22T14:06:29
2013-01-22T14:06:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,619
java
package allsrc.ch04src.src.com.brackeen.javagamebook.sound; import allsrc.ch04src.src.com.brackeen.javagamebook.graphics.Sprite; /** The Filter3d class is a SoundFilter that creates a 3d sound effect. The sound is filtered so that it is quiter the farther away the sound source is from the listener. <p>Possible ideas to extend this class: <ul><li>pan the sound to the left and right speakers </ul> @see FilteredSoundStream */ public class Filter3d extends SoundFilter { // number of samples to shift when changing the volume. private static final int NUM_SHIFTING_SAMPLES = 500; private Sprite source; private Sprite listener; private int maxDistance; private float lastVolume; /** Creates a new Filter3d object with the specified source and listener Sprites. The Sprite's position can be changed while this filter is running. <p> The maxDistance parameter is the maximum distance that the sound can be heard. */ public Filter3d(Sprite source, Sprite listener, int maxDistance) { this.source = source; this.listener = listener; this.maxDistance = maxDistance; this.lastVolume = 0.0f; } /** Filters the sound so that it gets more quiet with distance. */ public void filter(byte[] samples, int offset, int length) { if (source == null || listener == null) { // nothing to filter - return return; } // calculate the listener's distance from the sound source float dx = (source.getX() - listener.getX()); float dy = (source.getY() - listener.getY()); float distance = (float)Math.sqrt(dx * dx + dy * dy); // set volume from 0 (no sound) to 1 float newVolume = (maxDistance - distance) / maxDistance; if (newVolume <= 0) { newVolume = 0; } // set the volume of the sample int shift = 0; for (int i=offset; i<offset+length; i+=2) { float volume = newVolume; // shift from the last volume to the new volume if (shift < NUM_SHIFTING_SAMPLES) { volume = lastVolume + (newVolume - lastVolume) * shift / NUM_SHIFTING_SAMPLES; shift++; } // change the volume of the sample short oldSample = getSample(samples, i); short newSample = (short)(oldSample * volume); setSample(samples, i, newSample); } lastVolume = newVolume; } }
[ "pester@666.hell" ]
pester@666.hell
82d9ec9f5d8af197ec8e88d4c5316adcbb4911b6
d98de110431e5124ec7cc70d15906dac05cfa61a
/public/source/photon/plugins/org.marketcetera.photon.strategy.engine.sa.ui.tests/src/test/java/org/marketcetera/photon/strategy/engine/sa/ui/MessagesTest.java
a5b8ec1c7a605bece7e717d9e3455455993c0e59
[]
no_license
dhliu3/marketcetera
367f6df815b09f366eb308481f4f53f928de4c49
4a81e931a044ba19d8f35bdadd4ab081edd02f5f
refs/heads/master
2020-04-06T04:39:55.389513
2012-01-30T06:49:25
2012-01-30T06:49:25
29,947,427
0
1
null
2015-01-28T02:54:39
2015-01-28T02:54:39
null
UTF-8
Java
false
false
715
java
package org.marketcetera.photon.strategy.engine.sa.ui; import static org.junit.Assert.assertTrue; import org.junit.Test; import org.marketcetera.photon.strategy.engine.sa.ui.Messages; import org.marketcetera.util.l10n.MessageComparator; /* $License$ */ /** * Tests {@link Messages}. * * @author <a href="mailto:will@marketcetera.com">Will Horn</a> * @version $Id: MessagesTest.java 10885 2009-11-17 19:22:56Z klim $ * @since 2.0.0 */ public class MessagesTest { @Test public void messagesMatch() throws Exception { MessageComparator comparator = new MessageComparator(Messages.class); assertTrue(comparator.getDifferences(), comparator.isMatch()); } }
[ "stevenshack@stevenshack.com" ]
stevenshack@stevenshack.com
cc8412db2b797938ad2555a3b83773bb223025c2
6272d72ff474c4ce525410669f1da5819c27ef4e
/core/src/main/java/me/retrodaredevil/game/trackshooter/entity/DisplayEntity.java
4cae832c5962680ed9c9169ee3fc3130de9501ca
[ "Apache-2.0" ]
permissive
retrodaredevil/track-shooter
15bf2b4a9f6c25b7681b0d3597a95f61e615f27d
85ded23548d97bcee9f7e43362bc26c68a2cac17
refs/heads/master
2023-05-30T19:17:16.275089
2023-05-12T05:17:17
2023-05-12T05:17:17
129,270,798
9
2
Apache-2.0
2019-06-06T00:55:50
2018-04-12T15:15:19
Java
UTF-8
Java
false
false
766
java
package me.retrodaredevil.game.trackshooter.entity; import com.badlogic.gdx.math.Vector2; import me.retrodaredevil.game.trackshooter.level.LevelEndState; import me.retrodaredevil.game.trackshooter.render.components.RenderComponent; import me.retrodaredevil.game.trackshooter.world.World; public class DisplayEntity extends TimedEntity { public DisplayEntity(World world, float time, Vector2 position) { super(world, time); // setHitboxSize(0); doesn't matter since it can't collide setLocation(position); canRespawn = false; // canLevelEndWithEntityActive = false; levelEndStateWhenActive = LevelEndState.CAN_END_SOON; } @Override public void setRenderComponent(RenderComponent renderComponent) { super.setRenderComponent(renderComponent); } }
[ "retrodaredevil@gmail.com" ]
retrodaredevil@gmail.com
667f7f1bef79dd3a8aaf7328354806ed42a5e4e3
b85d0ce8280cff639a80de8bf35e2ad110ac7e16
/com/fossil/emv.java
bbf814424c835ba8fa328794480808c8d29826ae
[]
no_license
MathiasMonstrey/fosil_decompiled
3d90433663db67efdc93775145afc0f4a3dd150c
667c5eea80c829164220222e8fa64bf7185c9aae
refs/heads/master
2020-03-19T12:18:30.615455
2018-06-07T17:26:09
2018-06-07T17:26:09
136,509,743
1
0
null
null
null
null
UTF-8
Java
false
false
5,323
java
package com.fossil; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import com.facebook.appevents.AppEventsConstants; import io.fabric.sdk.android.services.common.CommonUtils; import io.fabric.sdk.android.services.common.DeliveryMechanism; import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Future; import retrofit.mime.MultipartTypedOutput; class emv extends emr<Boolean> { private String aHl; private final eov dNp = new eou(); private PackageManager dNq; private PackageInfo dNr; private String dNs; private String dNt; private final Future<Map<String, emt>> dNu; private final Collection<emr> dNv; private String installerPackageName; private String packageName; private String versionName; protected /* synthetic */ Object xf() { return xi(); } public emv(Future<Map<String, emt>> future, Collection<emr> collection) { this.dNu = future; this.dNv = collection; } public String getVersion() { return "1.3.4.60"; } protected boolean xh() { try { this.installerPackageName = aEZ().getInstallerPackageName(); this.dNq = getContext().getPackageManager(); this.packageName = getContext().getPackageName(); this.dNr = this.dNq.getPackageInfo(this.packageName, 0); this.aHl = Integer.toString(this.dNr.versionCode); this.versionName = this.dNr.versionName == null ? "0.0" : this.dNr.versionName; this.dNs = this.dNq.getApplicationLabel(getContext().getApplicationInfo()).toString(); this.dNt = Integer.toString(getContext().getApplicationInfo().targetSdkVersion); return true; } catch (Throwable e) { emm.aEU().mo2953g("Fabric", "Failed init", e); return false; } } protected Boolean xi() { boolean a; String eF = CommonUtils.eF(getContext()); epv aFe = aFe(); if (aFe != null) { try { Map map; if (this.dNu != null) { map = (Map) this.dNu.get(); } else { map = new HashMap(); } a = m10917a(eF, aFe.dQE, m10920e(map, this.dNv).values()); } catch (Throwable e) { emm.aEU().mo2953g("Fabric", "Error performing auto configuration.", e); } return Boolean.valueOf(a); } a = false; return Boolean.valueOf(a); } private epv aFe() { try { ept.aGA().m11036a(this, this.aId, this.dNp, this.aHl, this.versionName, xj()).aGC(); return ept.aGA().aGB(); } catch (Throwable e) { emm.aEU().mo2953g("Fabric", "Error dealing with settings", e); return null; } } Map<String, emt> m10920e(Map<String, emt> map, Collection<emr> collection) { for (emr com_fossil_emr : collection) { if (!map.containsKey(com_fossil_emr.getIdentifier())) { map.put(com_fossil_emr.getIdentifier(), new emt(com_fossil_emr.getIdentifier(), com_fossil_emr.getVersion(), MultipartTypedOutput.DEFAULT_TRANSFER_ENCODING)); } } return map; } public String getIdentifier() { return "io.fabric.sdk.android:fabric"; } private boolean m10917a(String str, eph com_fossil_eph, Collection<emt> collection) { if ("new".equals(com_fossil_eph.dPZ)) { if (m10918b(str, com_fossil_eph, collection)) { return ept.aGA().aGD(); } emm.aEU().mo2953g("Fabric", "Failed to create app with Crashlytics service.", null); return false; } else if ("configured".equals(com_fossil_eph.dPZ)) { return ept.aGA().aGD(); } else { if (!com_fossil_eph.dQb) { return true; } emm.aEU().mo2950d("Fabric", "Server says an update is required - forcing a full App update."); m10919c(str, com_fossil_eph, collection); return true; } } private boolean m10918b(String str, eph com_fossil_eph, Collection<emt> collection) { return new epk(this, xj(), com_fossil_eph.url, this.dNp).mo2994a(m10915a(epq.ac(getContext(), str), collection)); } private boolean m10919c(String str, eph com_fossil_eph, Collection<emt> collection) { return m10916a(com_fossil_eph, epq.ac(getContext(), str), (Collection) collection); } private boolean m10916a(eph com_fossil_eph, epq com_fossil_epq, Collection<emt> collection) { return new eqa(this, xj(), com_fossil_eph.url, this.dNp).mo2994a(m10915a(com_fossil_epq, collection)); } private epg m10915a(epq com_fossil_epq, Collection<emt> collection) { return new epg(new eng().er(getContext()), aEZ().aFu(), this.versionName, this.aHl, CommonUtils.g(new String[]{CommonUtils.eH(r0)}), this.dNs, DeliveryMechanism.determineFrom(this.installerPackageName).getId(), this.dNt, AppEventsConstants.EVENT_PARAM_VALUE_NO, com_fossil_epq, collection); } String xj() { return CommonUtils.aa(getContext(), "com.crashlytics.ApiEndpoint"); } }
[ "me@mathiasmonstrey.be" ]
me@mathiasmonstrey.be
6896538d0933b5f9338c02c483a0c074d058f58d
7d82700d0f31bdc2f170829037b35cd11f1c0e21
/src/main/java/net/goldtreeservers/cheatdetectionplugin/bungee/BungeeCheatDetectionPluginLoader.java
8ae71427e7d2136410bc8691a83afb48e02f6170
[]
no_license
TrashDetection/CheatDetectionPlugin
a76d9af7db46006d5456ec0603b4d71e55671769
c5d995e23261c7ac07a6f528c8c45b807d7284f6
refs/heads/master
2023-01-01T14:08:24.833714
2020-10-16T20:23:46
2020-10-16T20:23:46
304,729,736
0
0
null
null
null
null
UTF-8
Java
false
false
5,053
java
package net.goldtreeservers.cheatdetectionplugin.bungee; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; import java.util.Map; import java.util.Set; import java.util.jar.JarEntry; import java.util.jar.JarFile; import org.yaml.snakeyaml.Yaml; import com.google.common.base.Preconditions; import net.goldtreeservers.cheatdetectionplugin.bungee.commands.CheatDetectionCommand; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.api.plugin.PluginClassloader; import net.md_5.bungee.api.plugin.PluginDescription; import net.md_5.bungee.api.plugin.PluginManager; public class BungeeCheatDetectionPluginLoader extends Plugin { private BungeeCheatDetectionPlugin plugin; public BungeeCheatDetectionPluginLoader() { this.plugin = new BungeeCheatDetectionPlugin(this); } @Override public void onLoad() { if (this.plugin != null) { this.plugin.onLoad(); } } @Override public void onEnable() { this.registerCommands(this.plugin); } public void registerCommands(BungeeCheatDetectionPlugin plugin) { this.getProxy().getPluginManager().registerCommand(plugin.getLoader(), new CheatDetectionCommand(plugin)); } @Override public void onDisable() { this.getProxy().getPluginManager().unregisterListeners(this); this.getProxy().getPluginManager().unregisterCommands(this); this.getProxy().getScheduler().cancel(this); if (this.plugin != null) { this.plugin.onDisable(); this.plugin = null; } } @SuppressWarnings("unchecked") public void unloadAndDisable() { URLClassLoader classLoader = (URLClassLoader)this.getClass().getClassLoader(); try { classLoader.close(); } catch (IOException e) { throw new RuntimeException("Failed to unload the plugin", e); } try { Field field = PluginClassloader.class.getDeclaredField("allLoaders"); field.setAccessible(true); Set<PluginClassloader> loaders = (Set<PluginClassloader>)field.get(null); loaders.remove(classLoader); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { } this.onDisable(); } @SuppressWarnings("unchecked") public void loadPlugin() { File file = this.getFile(); Yaml yaml; Map<String, Plugin> plugins; try { Field field = PluginManager.class.getDeclaredField("yaml"); field.setAccessible(true); yaml = (Yaml)field.get(this.getProxy().getPluginManager()); Field pluginsField = PluginManager.class.getDeclaredField("plugins"); pluginsField.setAccessible(true); plugins = (Map<String, Plugin>)pluginsField.get(this.getProxy().getPluginManager()); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { throw new RuntimeException(e); } Method initField; try { initField = Plugin.class.getDeclaredMethod("init", ProxyServer.class, PluginDescription.class); initField.setAccessible(true); } catch (SecurityException | NoSuchMethodException e) { throw new RuntimeException(e); } try (JarFile jar = new JarFile(file)) { JarEntry bungeeEntry = jar.getJarEntry("bungee.yml"); Preconditions.checkNotNull(bungeeEntry, "Plugin is missing bungee.yml"); try (InputStream in = jar.getInputStream(bungeeEntry)) { PluginDescription desc = yaml.loadAs(in, PluginDescription.class); Preconditions.checkNotNull(desc.getName(), "Plugin is missing name"); Preconditions.checkNotNull(desc.getMain(), "Plugin is missing main", file); desc.setFile(file); PluginClassloader loader = new PluginClassloader(new URL[] { file.toURI().toURL() }); try { Class<?> main = loader.loadClass(desc.getMain()); Plugin clazz = (Plugin)main.getDeclaredConstructor().newInstance(); initField.invoke(clazz, this.getProxy(), desc); plugins.put(desc.getName(), clazz); clazz.onLoad(); clazz.onEnable(); Field field = PluginClassloader.class.getDeclaredField("allLoaders"); field.setAccessible(true); Set<PluginClassloader> loaders = (Set<PluginClassloader>)field.get(null); loaders.add(loader); } catch(Throwable e) { loader.close(); throw new RuntimeException("Failed to enable the plugin", e); } } } catch (Exception e) { throw new RuntimeException("Failed to load the plugin", e); } } }
[ "koti94@windowslive.com" ]
koti94@windowslive.com
f0f373eadcef0bc7eab156ff85a24af1fbb512b9
88f63f5604db6004fca4263449fd6e0d921d75cb
/src/main/java/ch/ethz/idsc/owl/rrts/adapter/RrtsNodes.java
cad3d5f1b0e2d7bd9c24ab389b83d4a512ed1b48
[]
no_license
JDR-neu/owl
726358d20f45bfd57e8f3a33881c74bbe431db75
d7573dec285179fa87a846e4912f65f215d72969
refs/heads/master
2022-01-15T03:22:16.192842
2019-06-25T12:14:35
2019-06-25T12:14:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,354
java
// code by jph package ch.ethz.idsc.owl.rrts.adapter; import java.util.Objects; import ch.ethz.idsc.owl.rrts.core.RrtsNode; import ch.ethz.idsc.owl.rrts.core.Transition; import ch.ethz.idsc.owl.rrts.core.TransitionCostFunction; import ch.ethz.idsc.owl.rrts.core.TransitionSpace; import ch.ethz.idsc.tensor.Scalar; import ch.ethz.idsc.tensor.Scalars; import ch.ethz.idsc.tensor.TensorRuntimeException; import ch.ethz.idsc.tensor.sca.Chop; public enum RrtsNodes { ; public static void costConsistency( // RrtsNode node, // TransitionSpace transitionSpace, // TransitionCostFunction transitionCostFunction) { boolean status = true; RrtsNode parent = node.parent(); if (Objects.nonNull(parent)) { Scalar tran = node.costFromRoot().subtract(parent.costFromRoot()); Transition transition = transitionSpace.connect(parent.state(), node.state()); Scalar tc = transitionCostFunction.cost(transition); status &= Scalars.isZero(Chop._10.of(tc.subtract(tran))); if (!status) throw TensorRuntimeException.of(tc, tran); status &= parent.costFromRoot().add(tran).equals(node.costFromRoot()); if (!status) throw TensorRuntimeException.of(tc, tran); } for (RrtsNode child : node.children()) costConsistency(child, transitionSpace, transitionCostFunction); } }
[ "jan.hakenberg@gmail.com" ]
jan.hakenberg@gmail.com
d7490eb80665eb3f60d73e01806dd88f7711e937
98bcb36b307ce97f2e3a61c720bd0898c00d71f8
/modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201505/ClickTrackingLineItemError.java
005a4a1cf4a178d528e51ab2e955301936353f37
[ "Apache-2.0" ]
permissive
goliva/googleads-java-lib
7050c16adbdfe1bf966414c1c412124b4f1352cc
ed88ac7508c382453682d18f46e53e9673286039
refs/heads/master
2021-01-22T00:52:23.999379
2015-07-17T22:20:42
2015-07-17T22:20:42
36,671,823
0
1
null
2015-07-17T22:20:42
2015-06-01T15:58:41
Java
UTF-8
Java
false
false
1,759
java
package com.google.api.ads.dfp.jaxws.v201505; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * * Click tracking is a special line item type with a number of unique errors as * described below. * * * <p>Java class for ClickTrackingLineItemError complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ClickTrackingLineItemError"> * &lt;complexContent> * &lt;extension base="{https://www.google.com/apis/ads/publisher/v201505}ApiError"> * &lt;sequence> * &lt;element name="reason" type="{https://www.google.com/apis/ads/publisher/v201505}ClickTrackingLineItemError.Reason" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ClickTrackingLineItemError", propOrder = { "reason" }) public class ClickTrackingLineItemError extends ApiError { protected ClickTrackingLineItemErrorReason reason; /** * Gets the value of the reason property. * * @return * possible object is * {@link ClickTrackingLineItemErrorReason } * */ public ClickTrackingLineItemErrorReason getReason() { return reason; } /** * Sets the value of the reason property. * * @param value * allowed object is * {@link ClickTrackingLineItemErrorReason } * */ public void setReason(ClickTrackingLineItemErrorReason value) { this.reason = value; } }
[ "api.cseeley@gmail.com" ]
api.cseeley@gmail.com
de9e8b6b1596b2447e1fcdf848e8708b71086515
0b3cacb3d5cf62de446bffc77273f0aa4d556e05
/gym/src/main/java/com/zhiyou100/gym/pojo/Maintain.java
2b903df12d43978bf0e5647f3a654ff6d730ceba
[]
no_license
luqian-git/xiangmu
e1a2bef3ad5633750203d09b790c07abc43014c2
eb0f5fd7c09c82889ad8e0b24394f7fd261685f5
refs/heads/master
2023-08-03T09:45:22.536887
2020-04-10T09:25:50
2020-04-10T09:25:50
251,285,907
0
0
null
2023-07-23T10:20:06
2020-03-30T11:34:58
Java
UTF-8
Java
false
false
482
java
package com.zhiyou100.gym.pojo; import lombok.Data; import lombok.ToString; import java.sql.Date; @Data @ToString public class Maintain { private Integer maintainId; private Integer maintainNum; private String maintainRegion; private Integer maintainEquipNum; private String maintainDesc; private Date maintainTime; private Double maintainMoney; private Integer maintainCoachNumber; private String equipName; private String coachName; }
[ "123" ]
123
341081f41c0d0ad5dee24d50388177134e235848
ad0e908beb33b3c09db93927e1a8b46af81358b2
/src/main/java/com/huios/blog/web/rest/BlogResource.java
fea34bed32850fc0a6c1826cf0ed811b934379ba
[]
no_license
serviceshuios/jhipster5-blog
dd547d41d72633b05c42cb950b66457e8c115350
c8603c850eccb50604986991f8d532e6cd6afdb8
refs/heads/master
2020-04-08T02:28:55.423498
2018-12-04T13:01:27
2018-12-04T13:01:27
158,937,146
0
0
null
null
null
null
UTF-8
Java
false
false
4,806
java
package com.huios.blog.web.rest; import com.codahale.metrics.annotation.Timed; import com.huios.blog.domain.Blog; import com.huios.blog.repository.BlogRepository; import com.huios.blog.security.SecurityUtils; import com.huios.blog.web.rest.errors.BadRequestAlertException; import com.huios.blog.web.rest.util.HeaderUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing Blog. */ @RestController @RequestMapping("/api") public class BlogResource { private final Logger log = LoggerFactory.getLogger(BlogResource.class); private static final String ENTITY_NAME = "blog"; private final BlogRepository blogRepository; public BlogResource(BlogRepository blogRepository) { this.blogRepository = blogRepository; } /** * POST /blogs : Create a new blog. * * @param blog the blog to create * @return the ResponseEntity with status 201 (Created) and with body the new blog, or with status 400 (Bad Request) if the blog has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/blogs") @Timed public ResponseEntity<Blog> createBlog(@Valid @RequestBody Blog blog) throws URISyntaxException { log.debug("REST request to save Blog : {}", blog); if (blog.getId() != null) { throw new BadRequestAlertException("A new blog cannot already have an ID", ENTITY_NAME, "idexists"); } Blog result = blogRepository.save(blog); return ResponseEntity.created(new URI("/api/blogs/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /blogs : Updates an existing blog. * * @param blog the blog to update * @return the ResponseEntity with status 200 (OK) and with body the updated blog, * or with status 400 (Bad Request) if the blog is not valid, * or with status 500 (Internal Server Error) if the blog couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/blogs") @Timed public ResponseEntity<Blog> updateBlog(@Valid @RequestBody Blog blog) throws URISyntaxException { log.debug("REST request to update Blog : {}", blog); if (blog.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } Blog result = blogRepository.save(blog); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, blog.getId().toString())) .body(result); } /** * GET /blogs : get all the blogs. * * @return the ResponseEntity with status 200 (OK) and the list of blogs in body */ @GetMapping("/blogs") @Timed public List<Blog> getAllBlogs() { log.debug("REST request to get all your Blogs"); // ici modification afin de n'avoir que les blogs du user connecté return blogRepository.findByUserIsCurrentUser(); } /** * GET /blogs/:id : get the "id" blog. * * @param id the id of the blog to retrieve * @return the ResponseEntity with status 200 (OK) and with body the blog, or with status 404 (Not Found) */ @GetMapping("/blogs/{id}") @Timed public ResponseEntity<?> getBlog(@PathVariable Long id) { log.debug("REST request to get Blog : {}", id); //bloquer l'accès via modification url à un blog dont on est pas propriétaire Optional<Blog> blog = blogRepository.findById(id); if(blog.isPresent() && blog.get().getUser()!=null && !blog.get().getUser().getLogin().equals(SecurityUtils.getCurrentUserLogin().orElse(""))) { return new ResponseEntity<>("error.http.403", HttpStatus.FORBIDDEN); } return ResponseUtil.wrapOrNotFound(blog); } /** * DELETE /blogs/:id : delete the "id" blog. * * @param id the id of the blog to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/blogs/{id}") @Timed public ResponseEntity<Void> deleteBlog(@PathVariable Long id) { log.debug("REST request to delete Blog : {}", id); blogRepository.deleteById(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "services.huios@gmail.com" ]
services.huios@gmail.com
892eec8a7701d225290ca0002d5a49adb8e7bb86
d258f66e98c2536ea3dc357f13e50cd8de38670b
/app/src/main/java/com/razerdp/huobi/analysis/utils/FillViewUtil.java
461ef4138836c09f40fda958035a9936329226c7
[ "MIT" ]
permissive
AndroidFriendsGroup/Huobi-Analysis
e5b6702c29d6bd3b9feacdf547a31471c827ba85
923c2b718f58243a4a2a13d756485b0e20e95a88
refs/heads/main
2023-07-15T13:31:18.709261
2021-09-02T12:26:15
2021-09-02T12:26:15
368,719,788
7
1
null
null
null
null
UTF-8
Java
false
false
7,310
java
package com.razerdp.huobi.analysis.utils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.LayoutRes; import androidx.annotation.NonNull; import com.razerdp.huobi.analysis.utils.joor.Reflect; import com.razerdp.huobi.analysis.utils.joor.ReflectException; import com.razerdp.huobi_analysis.R; import java.util.ArrayList; import java.util.List; /** * Created by 大灯泡 on 2019/4/15 * <p> * Description: */ @SuppressWarnings("unchecked") public class FillViewUtil { private static final String TAG = "FillViewUtil"; public static <V extends FillViewHolder> void fillView(@NonNull int count, @NonNull ViewGroup target, @LayoutRes int itemViewRes, @NonNull OnFillViewsListener<Integer, V> onFillViewsListener) { List<Integer> datas = new ArrayList<>(); for (int i = 0; i < count; i++) { datas.add(i); } fillView(datas, target, itemViewRes, onFillViewsListener); } public static <T, V extends FillViewHolder> void fillView(@NonNull List<T> datas, @NonNull ViewGroup target, @LayoutRes int itemViewRes, @NonNull OnFillViewsListener<T, V> onFillViewsListener) { if (datas == null || target == null || itemViewRes == 0 || onFillViewsListener == null) { return; } final int childCount = target.getChildCount(); final int size = datas.size(); int index = 0; if (childCount > 0) { //如果添加过 for (; index < childCount && index < size; index++) { //复用原有的 View child = target.getChildAt(index); Object obj = child.getTag(R.id.tag_fill_view); if (!(obj instanceof FillViewHolder)) continue;//可能是别的view V holder = (V) obj; holder.holderPosition = index; holder.bindData(datas.get(index), index, index == size - 1); } } //填充剩余的 final int rest = size - childCount; SimplePool<V> pool = ToolUtil.cast(target.getTag(R.id.tag_fill_view_recycler_bin), SimplePool.class); if (pool == null) { pool = new SimplePool<>(16); target.setTag(R.id.tag_fill_view_recycler_bin, pool); } if (rest > 0) { for (int i = index; i < size; i++) { T data = datas.get(i); V viewHolder = null; viewHolder = pool.acquire(); if (viewHolder == null) { View childView = LayoutInflater.from(target.getContext()).inflate(itemViewRes, target, false); viewHolder = onFillViewsListener.onCreateViewHolder(childView, data, i); } viewHolder.bindViewHolder(); viewHolder.holderPosition = i; target.addView(ViewUtil.removeFromParent(viewHolder.itemView)); viewHolder.bindData(data, i, i == size - 1); } } else { for (int i = index; i < index - rest; i++) { View child = target.getChildAt(i); Object obj = child.getTag(R.id.tag_fill_view); if (!(obj instanceof FillViewHolder)) continue;//可能是别的view V holder = (V) obj; pool.release(holder); } //无情移除~ target.removeViewsInLayout(index, -rest); target.requestLayout(); } } public static void clear(ViewGroup target) { if (target == null) return; final int childCount = target.getChildCount(); SimplePool<FillViewHolder> pool = ToolUtil.cast(target.getTag(R.id.tag_fill_view_recycler_bin), SimplePool.class); if (pool == null) { pool = new SimplePool<>(16); target.setTag(R.id.tag_fill_view_recycler_bin, pool); } for (int i = 0; i < childCount; i++) { View child = target.getChildAt(i); Object obj = child.getTag(R.id.tag_fill_view); if (!(obj instanceof FillViewHolder)) continue;//可能是别的view FillViewHolder holder = (FillViewHolder) obj; pool.release(holder); } target.removeViews(0, childCount); } public static void destroy(ViewGroup target) { if (target == null) return; SimplePool<FillViewHolder> pool = ToolUtil.cast(target.getTag(R.id.tag_fill_view_recycler_bin), SimplePool.class); if (pool != null) { pool.clearPool(); } target.removeAllViews(); } public static FillViewHolder getHolder(View itemView) { if (itemView == null) return null; return (FillViewHolder) itemView.getTag(R.id.tag_fill_view); } public static abstract class FillViewHolder<T> { protected T data; protected final View itemView; int holderPosition = 0; public final <V extends View> V findViewById(int resid) { if (resid > 0 && itemView != null) { return itemView.findViewById(resid); } return null; } public FillViewHolder(View itemView) { this.itemView = itemView; } public int getHolderPosition() { return holderPosition; } public final void bindData(T data, int position, boolean isLast) { this.data = data; onBindData(data, position, isLast); } public abstract void onBindData(T data, int position, boolean isLast); void bindViewHolder() { itemView.setTag(R.id.tag_fill_view, this); } public T getData() { return data; } } public static <T, V extends FillViewHolder> OnFillViewsListener<T, V> simpleImpl(Class<V> holderClass, Object... outhers) { return new OnFillViewsListener<T, V>() { @Override public V onCreateViewHolder(View itemView, T data, int position) { try { return Reflect.onClass(holderClass).create(itemView).get(); } catch (ReflectException e) { //考虑到非静态内部类的情况,创建viewholder的时候需要传入外部类的对象 if (outhers.length > 0) { Object outher = outhers[0]; if (outher != null) { //如果是创建在内部类里面的viewholder,则需要绑定outher return Reflect.onClass(holderClass).create(outher, itemView).get(); } } return null; } } }; } public interface OnFillViewsListener<T, V extends FillViewHolder> { V onCreateViewHolder(View itemView, T data, int position); } }
[ "razerdp123@gmail.com" ]
razerdp123@gmail.com
f7531f202ddbce1625f0bb4ef768d9f9ddbdefb2
ca28ad1744ba223cd6e968c46eec3e8bcbd9617f
/trunk/zijeeappcn/src/main/xml/org/dianzi/xml/parser/jdom/String2XML.java
4d0d2e22a80941a10dfcc412a81c9fcf8f329bf9
[]
no_license
BGCX261/zijeeappcn-svn-to-git
81232fde9d9e16a3ef7ff3efbeefe6d40dfd9405
dfbe3203b1a7bb717eef19c85038ceed7c3a69fd
refs/heads/master
2020-05-17T03:50:48.030097
2015-08-25T15:31:56
2015-08-25T15:31:56
41,584,951
0
0
null
null
null
null
GB18030
Java
false
false
1,146
java
package org.dianzi.xml.parser.jdom; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.StringReader; import org.jdom.Document; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; import org.jdom.output.Format; import org.jdom.output.XMLOutputter; import org.xml.sax.InputSource; public class String2XML { /** * @param args * @throws IOException * @throws JDOMException */ public static void main(String[] args) throws JDOMException, IOException { // 字符串转XML String xmlStr = "....."; StringReader sr = new StringReader(xmlStr); InputSource is = new InputSource(sr); Document doc = (new SAXBuilder()).build(is); // XML转字符串 Format format = Format.getPrettyFormat(); format.setEncoding("gb2312");// 配置xml文档的字符为gb2312,解决中文问题 XMLOutputter xmlout = new XMLOutputter(format); ByteArrayOutputStream bo = new ByteArrayOutputStream(); xmlout.output(doc, bo); String xmlStrs = bo.toString(); } }
[ "you@example.com" ]
you@example.com
d459811a4a0d8a5ec2476430357026ab33aec114
c43f5b1a4642a05539c74fbb58ca90d8c891af8a
/maven_in_action/account-web/src/main/java/cc/pp/account/web/ActivateServlet.java
3d4fd4e5ff1934c4ac60c5f1c21cb23fd51a7d48
[]
no_license
wgybzbrobot/bookcodes
33eabeedd863f630901df51ed28e5471c6c21312
c9bc0f2e3375834ff696444e57b9e853dd767251
refs/heads/master
2022-11-30T04:49:15.462214
2014-01-23T04:35:01
2014-01-23T04:35:01
15,858,734
1
3
null
2022-11-24T02:20:59
2014-01-13T05:17:19
Java
UTF-8
Java
false
false
1,341
java
package cc.pp.account.web; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.context.ApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; import cc.pp.account.service.AccountService; import cc.pp.account.service.AccountServiceException; public class ActivateServlet extends HttpServlet { private static final long serialVersionUID = 6004008299200827013L; private ApplicationContext context; @Override public void init() throws ServletException { super.init(); context = WebApplicationContextUtils.getWebApplicationContext(getServletContext()); } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { String key = req.getParameter("key"); if (key == null || key.length() == 0) { resp.sendError(400, "No activation key provided."); return; } AccountService service = (AccountService) context.getBean("accountService"); try { service.activate(key); resp.getWriter().write("Account is activated, now you can login."); } catch (AccountServiceException e) { resp.sendError(400, "Unable to activate account"); return; } } }
[ "wanggang@pp.cc" ]
wanggang@pp.cc
a08933c865e333492ceba82d47f776c5e67a2de5
256e6a80ff7441e971df85c0fd722a310e2916d5
/igc-clientlibrary/src/main/java/org/odpi/egeria/connectors/ibm/igc/clientlibrary/model/generated/v11701/TermAssignment.java
0b1523ed8b39e50e7d9e6fb09c1208ace9f9e778
[ "CC-BY-4.0", "Apache-2.0" ]
permissive
odpi-poc/egeria-connector-ibm-information-server
fe1fc9b9378c871a860616a4456a8b27f2291aaf
0b77b6390915310bd89bf3974d0602df301c13ac
refs/heads/master
2020-07-04T21:19:52.107710
2019-08-14T20:41:01
2019-09-20T16:14:14
202,420,871
0
1
Apache-2.0
2019-09-05T03:29:04
2019-08-14T20:25:31
Java
UTF-8
Java
false
false
5,679
java
/* SPDX-License-Identifier: Apache-2.0 */ /* Copyright Contributors to the ODPi Egeria project. */ package org.odpi.egeria.connectors.ibm.igc.clientlibrary.model.generated.v11701; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonTypeName; import javax.annotation.Generated; import org.odpi.egeria.connectors.ibm.igc.clientlibrary.model.common.*; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.ArrayList; /** * POJO for the {@code term_assignment} asset type in IGC, displayed as '{@literal Suggested Term Assignment}' in the IGC UI. * <br><br> * (this code has been generated based on out-of-the-box IGC metadata types; * if modifications are needed, eg. to handle custom attributes, * extending from this class in your own custom class is the best approach.) */ @Generated("org.odpi.egeria.connectors.ibm.igc.clientlibrary.model.IGCRestModelGenerator") @JsonIgnoreProperties(ignoreUnknown=true) @JsonTypeName("term_assignment") public class TermAssignment extends Reference { public static String getIgcTypeDisplayName() { return "Suggested Term Assignment"; } /** * The {@code assign_to_term} property, displayed as '{@literal Term}' in the IGC UI. * <br><br> * Will be a single {@link Reference} to a {@link MainObject} object. */ protected Reference assign_to_term; /** * The {@code assign_to_object} property, displayed as '{@literal Asset}' in the IGC UI. * <br><br> * Will be a single {@link Reference} to a {@link InformationAsset} object. */ protected Reference assign_to_object; /** * The {@code confidence_percent} property, displayed as '{@literal Confidence (Percent)}' in the IGC UI. */ protected Number confidence_percent; /** * The {@code created_by} property, displayed as '{@literal Created By}' in the IGC UI. */ protected String created_by; /** * The {@code created_on} property, displayed as '{@literal Created On}' in the IGC UI. */ protected Date created_on; /** * The {@code modified_by} property, displayed as '{@literal Modified By}' in the IGC UI. */ protected String modified_by; /** * The {@code modified_on} property, displayed as '{@literal Modified On}' in the IGC UI. */ protected Date modified_on; /** @see #assign_to_term */ @JsonProperty("assign_to_term") public Reference getAssignToTerm() { return this.assign_to_term; } /** @see #assign_to_term */ @JsonProperty("assign_to_term") public void setAssignToTerm(Reference assign_to_term) { this.assign_to_term = assign_to_term; } /** @see #assign_to_object */ @JsonProperty("assign_to_object") public Reference getAssignToObject() { return this.assign_to_object; } /** @see #assign_to_object */ @JsonProperty("assign_to_object") public void setAssignToObject(Reference assign_to_object) { this.assign_to_object = assign_to_object; } /** @see #confidence_percent */ @JsonProperty("confidence_percent") public Number getConfidencePercent() { return this.confidence_percent; } /** @see #confidence_percent */ @JsonProperty("confidence_percent") public void setConfidencePercent(Number confidence_percent) { this.confidence_percent = confidence_percent; } /** @see #created_by */ @JsonProperty("created_by") public String getCreatedBy() { return this.created_by; } /** @see #created_by */ @JsonProperty("created_by") public void setCreatedBy(String created_by) { this.created_by = created_by; } /** @see #created_on */ @JsonProperty("created_on") public Date getCreatedOn() { return this.created_on; } /** @see #created_on */ @JsonProperty("created_on") public void setCreatedOn(Date created_on) { this.created_on = created_on; } /** @see #modified_by */ @JsonProperty("modified_by") public String getModifiedBy() { return this.modified_by; } /** @see #modified_by */ @JsonProperty("modified_by") public void setModifiedBy(String modified_by) { this.modified_by = modified_by; } /** @see #modified_on */ @JsonProperty("modified_on") public Date getModifiedOn() { return this.modified_on; } /** @see #modified_on */ @JsonProperty("modified_on") public void setModifiedOn(Date modified_on) { this.modified_on = modified_on; } public static Boolean canBeCreated() { return false; } public static Boolean includesModificationDetails() { return true; } private static final List<String> NON_RELATIONAL_PROPERTIES = Arrays.asList( "confidence_percent", "created_by", "created_on", "modified_by", "modified_on" ); private static final List<String> STRING_PROPERTIES = Arrays.asList( "created_by", "modified_by" ); private static final List<String> PAGED_RELATIONAL_PROPERTIES = new ArrayList<>(); private static final List<String> ALL_PROPERTIES = Arrays.asList( "assign_to_term", "assign_to_object", "confidence_percent", "created_by", "created_on", "modified_by", "modified_on" ); public static List<String> getNonRelationshipProperties() { return NON_RELATIONAL_PROPERTIES; } public static List<String> getStringProperties() { return STRING_PROPERTIES; } public static List<String> getPagedRelationshipProperties() { return PAGED_RELATIONAL_PROPERTIES; } public static List<String> getAllProperties() { return ALL_PROPERTIES; } public static Boolean isTermAssignment(Object obj) { return (obj.getClass() == TermAssignment.class); } }
[ "chris@thegrotes.net" ]
chris@thegrotes.net
56687d34ab39e331a1f5bf90f64e31e1bbcab870
9de053c703eec59eb3d2e786fec40a124dfc04fe
/app/src/main/java/com/zwstudio/logicpuzzlesandroid/puzzles/neighbours/android/NeighboursGameView.java
01f4ae8f75b15344e164502b2cca052f74479440
[]
no_license
iamrahulyadav/LogicPuzzlesAndroid
a288fda6384b6527cc403619476aaff4fb6aed0b
ce88371561e1dd89b1360c6d98efbe7ec75baf10
refs/heads/master
2020-03-27T18:39:02.133516
2018-08-23T15:56:25
2018-08-23T15:56:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,818
java
package com.zwstudio.logicpuzzlesandroid.puzzles.neighbours.android; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.text.TextPaint; import android.util.AttributeSet; import android.view.MotionEvent; import com.zwstudio.logicpuzzlesandroid.common.android.CellsGameView; import com.zwstudio.logicpuzzlesandroid.common.domain.GridLineObject; import com.zwstudio.logicpuzzlesandroid.common.domain.Position; import com.zwstudio.logicpuzzlesandroid.home.domain.HintState; import com.zwstudio.logicpuzzlesandroid.puzzles.neighbours.domain.NeighboursGame; import com.zwstudio.logicpuzzlesandroid.puzzles.neighbours.domain.NeighboursGameMove; /** * TODO: document your custom view class. */ public class NeighboursGameView extends CellsGameView { private NeighboursGameActivity activity() {return (NeighboursGameActivity)getContext();} private NeighboursGame game() {return activity().game;} private int rows() {return isInEditMode() ? 5 : game().rows() - 1;} private int cols() {return isInEditMode() ? 5 : game().cols() - 1;} @Override protected int rowsInView() {return rows();} @Override protected int colsInView() {return cols();} private Paint gridPaint = new Paint(); private Paint line1Paint = new Paint(); private Paint line2Paint = new Paint(); private Paint markerPaint = new Paint(); private TextPaint textPaint = new TextPaint(); public NeighboursGameView(Context context) { super(context); init(null, 0); } public NeighboursGameView(Context context, AttributeSet attrs) { super(context, attrs); init(attrs, 0); } public NeighboursGameView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(attrs, defStyle); } private void init(AttributeSet attrs, int defStyle) { gridPaint.setColor(Color.GRAY); gridPaint.setStyle(Paint.Style.STROKE); line1Paint.setColor(Color.WHITE); line1Paint.setStyle(Paint.Style.STROKE); line1Paint.setStrokeWidth(20); line2Paint.setColor(Color.YELLOW); line2Paint.setStyle(Paint.Style.STROKE); line2Paint.setStrokeWidth(20); markerPaint.setColor(Color.YELLOW); markerPaint.setStyle(Paint.Style.STROKE); markerPaint.setStrokeWidth(5); textPaint.setAntiAlias(true); } @Override protected void onDraw(Canvas canvas) { // canvas.drawColor(Color.BLACK); for (int r = 0; r < rows(); r++) for (int c = 0; c < cols(); c++) { canvas.drawRect(cwc(c), chr(r), cwc(c + 1), chr(r + 1), gridPaint); if (isInEditMode()) continue; Position p = new Position(r, c); Integer n = game().pos2hint.get(p); if (n != null) { HintState state = game().pos2State(p); textPaint.setColor( state == HintState.Complete ? Color.GREEN : state == HintState.Error ? Color.RED : Color.WHITE ); String text = String.valueOf(n); drawTextCentered(text, cwc(c), chr(r), canvas, textPaint); } } if (isInEditMode()) return; int markerOffset = 20; for (int r = 0; r < rows() + 1; r++) for (int c = 0; c < cols() + 1; c++) { GridLineObject[] dotObj = game().getObject(r, c); switch (dotObj[1]){ case Line: canvas.drawLine(cwc(c), chr(r), cwc(c + 1), chr(r), game().get(r, c)[1] == GridLineObject.Line ? line1Paint : line2Paint); break; case Marker: canvas.drawLine(cwc2(c) - markerOffset, chr(r) - markerOffset, cwc2(c) + markerOffset, chr(r) + markerOffset, markerPaint); canvas.drawLine(cwc2(c) - markerOffset, chr(r) + markerOffset, cwc2(c) + markerOffset, chr(r) - markerOffset, markerPaint); break; } switch (dotObj[2]){ case Line: canvas.drawLine(cwc(c), chr(r), cwc(c), chr(r + 1), game().get(r, c)[2] == GridLineObject.Line ? line1Paint : line2Paint); break; case Marker: canvas.drawLine(cwc(c) - markerOffset, chr2(r) - markerOffset, cwc(c) + markerOffset, chr2(r) + markerOffset, markerPaint); canvas.drawLine(cwc(c) - markerOffset, chr2(r) + markerOffset, cwc(c) + markerOffset, chr2(r) - markerOffset, markerPaint); break; } } } @Override public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN && !game().isSolved()) { int offset = 30; int col = (int)((event.getX() + offset) / cellWidth); int row = (int)((event.getY() + offset) / cellHeight); int xOffset = (int)event.getX() - col * cellWidth - 1; int yOffset = (int)event.getY() - row * cellHeight - 1; if (!(xOffset >= -offset && xOffset <= offset || yOffset >= -offset && yOffset <= offset)) return true; NeighboursGameMove move = new NeighboursGameMove() {{ p = new Position(row, col); obj = GridLineObject.Empty; dir = yOffset >= -offset && yOffset <= offset ? 1 : 2; }}; if (game().switchObject(move)) activity().app.soundManager.playSoundTap(); } return true; } }
[ "zwvista@msn.com" ]
zwvista@msn.com
18101d68a8bdd1a912fb20504d8b01697c1b0b05
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
/eclipsejdt_cluster/31985/src_1.java
dbc46472615ef9a1729ca5af86434604a5dadfce
[]
no_license
martinezmatias/GenPat-data-C3
63cfe27efee2946831139747e6c20cf952f1d6f6
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
refs/heads/master
2022-04-25T17:59:03.905613
2020-04-15T14:41:34
2020-04-15T14:41:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,237
java
/******************************************************************************* * Copyright (c) 2006, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.internal.compiler.apt.dispatch; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.apt.model.Factory; import org.eclipse.jdt.internal.compiler.apt.util.ManyToMany; import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.Annotation; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; import org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding; import org.eclipse.jdt.internal.compiler.lookup.AptSourceLocalVariableBinding; import org.eclipse.jdt.internal.compiler.lookup.Binding; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; import org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope; import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; import org.eclipse.jdt.internal.compiler.lookup.MethodScope; import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; /** * This class is used to visit the JDT compiler internal AST to discover annotations, * in the course of dispatching to annotation processors. */ public class AnnotationDiscoveryVisitor extends ASTVisitor { final BaseProcessingEnvImpl _env; final Factory _factory; /** * Collects a many-to-many map of annotation types to * the elements they appear on. */ final ManyToMany<TypeElement, Element> _annoToElement; public AnnotationDiscoveryVisitor(BaseProcessingEnvImpl env) { _env = env; _factory = env.getFactory(); _annoToElement = new ManyToMany<TypeElement, Element>(); } @Override public boolean visit(Argument argument, BlockScope scope) { Annotation[] annotations = argument.annotations; TypeDeclaration typeDeclaration = scope.referenceType(); MethodBinding binding = ((AbstractMethodDeclaration) scope.referenceContext()).binding; typeDeclaration.binding.resolveTypesFor(binding); argument.binding = new AptSourceLocalVariableBinding(argument.binding, binding); if (annotations != null) { this.resolveAnnotations( scope, annotations, argument.binding); } return false; } @Override public boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope scope) { Annotation[] annotations = constructorDeclaration.annotations; if (annotations != null) { MethodBinding constructorBinding = constructorDeclaration.binding; ((SourceTypeBinding) constructorBinding.declaringClass).resolveTypesFor(constructorBinding); this.resolveAnnotations( constructorDeclaration.scope, annotations, constructorBinding); } Argument[] arguments = constructorDeclaration.arguments; if (arguments != null) { int argumentLength = arguments.length; for (int i = 0; i < argumentLength; i++) { arguments[i].traverse(this, constructorDeclaration.scope); } } return false; } @Override public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) { Annotation[] annotations = fieldDeclaration.annotations; if (annotations != null) { FieldBinding fieldBinding = fieldDeclaration.binding; ((SourceTypeBinding) fieldBinding.declaringClass).resolveTypeFor(fieldBinding); this.resolveAnnotations(scope, annotations, fieldBinding); } return false; } @Override public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) { Annotation[] annotations = methodDeclaration.annotations; if (annotations != null) { MethodBinding methodBinding = methodDeclaration.binding; ((SourceTypeBinding) methodBinding.declaringClass).resolveTypesFor(methodBinding); this.resolveAnnotations( methodDeclaration.scope, annotations, methodDeclaration.binding); } Argument[] arguments = methodDeclaration.arguments; if (arguments != null) { int argumentLength = arguments.length; for (int i = 0; i < argumentLength; i++) { arguments[i].traverse(this, methodDeclaration.scope); } } return false; } @Override public boolean visit(TypeDeclaration memberTypeDeclaration, ClassScope scope) { Annotation[] annotations = memberTypeDeclaration.annotations; if (annotations != null) { this.resolveAnnotations( memberTypeDeclaration.staticInitializerScope, annotations, memberTypeDeclaration.binding); } return true; } @Override public boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope scope) { Annotation[] annotations = typeDeclaration.annotations; if (annotations != null) { this.resolveAnnotations( typeDeclaration.staticInitializerScope, annotations, typeDeclaration.binding); } return true; } private void resolveAnnotations( BlockScope scope, Annotation[] annotations, Binding currentBinding) { ASTNode.resolveAnnotations(scope, annotations, currentBinding); for (Annotation annotation : annotations) { AnnotationBinding binding = annotation.getCompilerAnnotation(); if (binding != null) { // binding should be resolved, but in case it's not, ignore it TypeElement anno = (TypeElement)_factory.newElement(binding.getAnnotationType()); Element element = _factory.newElement(currentBinding); _annoToElement.put(anno, element); } } } }
[ "375833274@qq.com" ]
375833274@qq.com
134e230def2c80efa37a6897979bda575f87594e
376decc11263653c8086516c2484f91d5e99537b
/000. Missing Element in sorted Array/src/main/Main.java
8aadb28aa921dde623922f8914a02a4ac026c18f
[]
no_license
MatheswaranSagadevan/Leetcode
990bb85e1ce50d04202aa80c5125ae526b89cd7f
1562746f7c861b61d28cb67ccb80d655a3170aaa
refs/heads/master
2022-04-15T04:29:26.421049
2020-04-09T13:31:08
2020-04-09T13:31:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,078
java
package main; class Solution { public int missing_number(int []nums) { int l = 0, r = nums.length-1; while(r - l > 1) { int m = l + (r-l)/2; /* We intend to find m-1 index element which is not in correct position * nums[m] should be equal to m + 1 ideal if no element is missing * thus nums[m] != m+1 is checked. It is not in correct position * It checks whether nums[m-1] is in correct position or not * If not then nums[m] is not in correct position * means nums[m] != m+1 && nums[m-1] == m * * If Both are not if current is not, there is probability that an element * earlier than this is also not in correct position thus r = m-1 * * If this is in correct position check right side */ if(nums[m] != m+1 && nums[m-1] == m) return m+1; else if(nums[m] != m+1) r = m - 1; else l = m + 1; } return -1; } } public class Main { public static void main(String[] args) { //int []nums = {1,3,4,5}; int []nums = {1,2,3,4,5,7,8}; System.out.println(new Solution().missing_number(nums)); } }
[ "rakesh@rakeshs-mbp.home" ]
rakesh@rakeshs-mbp.home
05450ac3a5c1e5ebc6f95b4436dbcee89e1150ff
bbebaa880d979b5005c39aaa16bd03a18038efab
/generators/struts/tests/org.obeonetwork.dsl.cinematic.gen.java.struts.architecture.tests/src/org/obeonetwork/dsl/cinematic/gen/java/struts/architecture/tests/ui/scenariodefaultname/test/htmlunit/TestEcran1Action.java
3d943f417c992bd91766c0e5552dd6833a67bee3
[]
no_license
Novi4ekik92/InformationSystem
164baf6ec1da05da2f144787a042d85af81d4caa
6387d3cf75efffee0c860ab58f7b8127140a5bb2
refs/heads/master
2020-12-11T09:07:38.255013
2015-01-05T16:52:58
2015-01-05T16:52:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,110
java
package org.obeonetwork.dsl.cinematic.gen.java.struts.architecture.tests.ui.scenariodefaultname.test.htmlunit; import java.net.URL; import java.util.ResourceBundle; import java.util.List; import junit.framework.TestCase; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.*; /** * HtmlUnit testing for <strong>Ecran1 Form</strong> * Scenario : ScenarioDefaultName * */ public class TestEcran1Action extends TestCase { /** * initialize the TestCase. * * @throws Exception if the test fails */ public void setUp() throws Exception { super.setUp(); //Start of user code for setUp //End of user code } /** * terminate the TestCase. * * @throws Exception if the test fails */ public void tearDown() throws Exception { super.tearDown(); //Start of user code for tearDown //End of user code } /** * Constructor */ public TestEcran1Action(String testName) { super(testName); //Start of user code for Constructor //End of user code } /** * Regression test for "Action1" action of class Ecran1Action * @param Nothing * @return Nothing * @throws Exception */ public void testEcran1Action1Action() throws Exception { final WebClient webClient = new WebClient(); ResourceBundle r = ResourceBundle.getBundle("tests"); final URL url = new URL(r.getString("fr.website.url") + "/pages/scenariodefaultname/ecran1?event=init"); final HtmlPage page1 = (HtmlPage)webClient.getPage(url); final HtmlForm form = page1.getFormByName("Ecran1Form"); final HtmlTextInput textFiel1 = (HtmlTextInput)form.getInputByName("textFiel1"); final HtmlPasswordInput password1 = (HtmlPasswordInput)form.getInputByName("password1"); final HtmlCheckBoxInput checkbox1 = (HtmlCheckBoxInput)form.getInputByName("checkbox1"); final HtmlRadioButtonInput radio1 = (HtmlRadioButtonInput)form.getInputByName("radio1"); final HtmlTextInput slider1 = (HtmlTextInput)form.getInputByName("slider1"); final HtmlTextInput push1 = (HtmlTextInput)form.getInputByName("push1"); final HtmlTextInput toogle1 = (HtmlTextInput)form.getInputByName("toogle1"); final HtmlTextInput button1 = (HtmlTextInput)form.getInputByName("button1"); final HtmlTextInput canvas1 = (HtmlTextInput)form.getInputByName("canvas1"); final HtmlTextInput link1 = (HtmlTextInput)form.getInputByName("link1"); final List textArea = (List)form.getTextAreasByName("textArea"); final HtmlSubmitInput Action1 = (HtmlSubmitInput)form.getInputByName("Action1"); assertEquals("Label1TextFiel1Combobox1Password1Checkbox1Radio1Slider1Push1Toogle1Button1DisplayList1Canvas1Link1TextArea", page1.getTitleText()); //Start of user code for Action1 action //TODO : initialize form here //Subit the form and get the result page final HtmlPage page2 = (HtmlPage)Action1.click(); //TODO : validate resulting page //End of user code } //Start of user code for other tests //End of user code }
[ "goulwen.lefur@obeo.fr" ]
goulwen.lefur@obeo.fr
2e7ddaa848a5f03cd8a7cb263fc515161ee803ba
58d96669352bbeeb8f014e1d9cd4561df4b7e866
/chpg.atlas/src/chpg/graph/PropertyGraph.java
426743e82c06b72c409e48071fd34ed557986f55
[ "MIT" ]
permissive
benjholla/chpg
bae7d94ca4451fc4e8db8b331d822c1a2d5559d1
b828df12cd4e4467fede0ffe55c4395c26dab764
refs/heads/master
2022-04-26T22:02:17.971710
2022-03-16T15:26:47
2022-03-16T15:26:47
192,628,183
1
4
MIT
2020-02-29T22:43:40
2019-06-19T00:05:10
JavaScript
UTF-8
Java
false
false
5,587
java
package chpg.graph; import java.util.HashSet; import java.util.Set; import chpg.graph.schema.SchemaGraph; import chpg.graph.schema.SchemaNode; public class PropertyGraph extends Graph { private SchemaGraph schema; /** * Construct an empty graph */ public PropertyGraph(SchemaGraph schema) { this.schema = schema; this.nodes = new GraphElementHashSet<Node>(); this.edges = new GraphElementHashSet<Edge>(); } /** * Construct an empty graph with an empty schema */ public PropertyGraph() { this(new SchemaGraph()); } /** * Construct a graph that is a copy of the schema, nodes, and edges in the given graph */ public PropertyGraph(PropertyGraph graph) { this(graph.getSchema()); addAll(graph.nodes()); addAll(graph.edges()); } /** * Construct a graph with the given nodes */ public PropertyGraph(SchemaGraph schema, Node... nodes) { this(schema); for(Node node : nodes) { add(node); } } /** * Construct a graph with the given edges */ public PropertyGraph(SchemaGraph schema, Edge... edges) { this(schema); for(Edge edge : edges) { add(edge); } } /** * Construct a graph with the given nodes and edges * * @param nodes * @param edges */ public PropertyGraph(SchemaGraph schema, GraphElementSet<Node> nodes, GraphElementSet<Edge> edges) { this(schema); addAll(nodes); addAll(edges); } /** * Construct a graph with the given graph elements (mixed set of nodes and edges) * * @param graphElements */ public PropertyGraph(SchemaGraph schema, GraphElementSet<? extends GraphElement> graphElements) { this(schema); addAll(graphElements); } /** * Construct a new graph with a shallow copy of the nodes and edges in the given graph * * @param graph */ public PropertyGraph(SchemaGraph schema, Graph... graphs) { this(schema); for(Graph graph : graphs) { addAll(graph.nodes()); addAll(graph.edges()); } } /** * Returns the property graph schema * @return */ public SchemaGraph getSchema() { return schema; } private Set<String> getInheritedTags(String... tags) { Set<String> allTags = new HashSet<String>(); for(String explicitTag : tags) { allTags.add(explicitTag); } if(schema != null) { for(SchemaNode explicitTagNode : schema.getSchemaNodes()) { if(allTags.contains(explicitTagNode.getTagName())) { for(Node implicitTagNode : schema.forward(explicitTagNode).difference(explicitTagNode).nodes()) { allTags.add(((SchemaNode)implicitTagNode).getTagName()); } } } } return allTags; } @Override public Graph empty() { return new PropertyGraph(schema); } @Override public GraphElementSet<Node> nodes(String... tags){ return nodesTaggedWithAny(tags); } @Override public GraphElementSet<Node> nodesTaggedWithAny(String... tags){ Set<String> allTags = getInheritedTags(tags); GraphElementSet<Node> result = new GraphElementHashSet<Node>(); for(Node node : nodes()){ for(String tag : allTags){ if(node.tags().contains(tag)){ result.add(node); break; } } } return result; } @Override public GraphElementSet<Node> nodesTaggedWithAll(String... tags){ Set<String> allTags = getInheritedTags(tags); GraphElementSet<Node> result = new GraphElementHashSet<Node>(); for(Node node : nodes()){ boolean add = true; for(String tag : allTags){ if(!node.tags().contains(tag)){ add = false; break; } } if(add){ result.add(node); } } return result; } @Override public GraphElementSet<Edge> edges(String... tags){ return edgesTaggedWithAny(tags); } @Override public GraphElementSet<Edge> edgesTaggedWithAny(String... tags){ Set<String> allTags = getInheritedTags(tags); GraphElementSet<Edge> result = new GraphElementHashSet<Edge>(); for(Edge edge : edges){ for(String tag : allTags){ if(edge.tags().contains(tag)){ result.add(edge); break; } } } return result; } @Override public GraphElementSet<Edge> edgesTaggedWithAll(String... tags){ Set<String> allTags = getInheritedTags(tags); GraphElementSet<Edge> result = new GraphElementHashSet<Edge>(); for(Edge edge : edges){ boolean add = true; for(String tag : allTags){ if(!edge.tags().contains(tag)){ add = false; break; } } if(add){ result.add(edge); } } return result; } @Override public GraphElementSet<Edge> selectEdges(String attribute){ return edges.filter(attribute); } @Override public GraphElementSet<Edge> selectEdges(String attribute, Object... values){ return edges.filter(attribute, values); } @Override public GraphElementSet<Node> selectNodes(String attribute){ return nodes.filter(attribute); } @Override public GraphElementSet<Node> selectNodes(String attribute, Object... values){ return nodes.filter(attribute, values); } // TODO: how to implement without a single underlying universal graph? // @Override // public GraphElementSet<Node> children(){ // GraphElementSet<Node> result = new GraphElementHashSet<Node>(); // return result; // } // // @Override // public GraphElementSet<Node> parent(){ // GraphElementSet<Node> result = new GraphElementHashSet<Node>(); // return result; // } // // @Override // public GraphElementSet<Node> contained(){ // GraphElementSet<Node> result = new GraphElementHashSet<Node>(); // return result; // } // // @Override // public GraphElementSet<Node> containers(){ // GraphElementSet<Node> result = new GraphElementHashSet<Node>(); // return result; // } }
[ "benjholla@gmail.com" ]
benjholla@gmail.com
d6c5a9dadfdf7ba118cc6fb5cfe5d82854967c47
8a995785bf1b01110a1ccb058e4d504dffb33fed
/src/main/java/com/hgicreate/rno/web/rest/indoor/vm/DmPlaneLayerDataQueryVM.java
4af8b68f9e244819ef51f38bd545770a73d628ba
[]
no_license
tianxiao666/rno-cloud-platform
a1ed2b13c2b5be7cea75bc47c94d4fc2af30db7f
f2fed8ffe208a022a6a9799fbaab0747a9de0adf
refs/heads/master
2021-09-08T09:22:58.147195
2018-03-09T02:34:14
2018-03-09T02:34:14
124,475,644
0
0
null
null
null
null
UTF-8
Java
false
false
248
java
package com.hgicreate.rno.web.rest.indoor.vm; import lombok.Data; /** * @author chao.xj */ @Data public class DmPlaneLayerDataQueryVM { String drawMapId; String buildingId; String floorId; String buildingName; }
[ "chao.xj@hgicreate.com" ]
chao.xj@hgicreate.com
ccb77b500b4677740b526137b689159cec929afc
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/mikepenz--Android-Iconics/7c255e4cb16abedaeb35e9f4a9388b4103ceba64/after/IconicsTextView.java
f0cc011f40260407a23cb056461be12f5e777196
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
4,445
java
/* * Copyright 2017 Mike Penz * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.mikepenz.iconics.view; import android.content.Context; import android.support.annotation.Nullable; import android.support.annotation.RestrictTo; import android.support.v7.widget.AppCompatTextView; import android.util.AttributeSet; import com.mikepenz.iconics.Iconics; import com.mikepenz.iconics.IconicsDrawable; import com.mikepenz.iconics.internal.CompoundIconicsDrawables; import com.mikepenz.iconics.internal.CompoundIconsBundle; import com.mikepenz.iconics.internal.IconicsView; import com.mikepenz.iconics.internal.IconicsViewsAttrsReader; import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP; public class IconicsTextView extends AppCompatTextView implements CompoundIconicsDrawables, IconicsView { protected final CompoundIconsBundle mIconsBundle = new CompoundIconsBundle(); public IconicsTextView(Context context) { this(context, null); } public IconicsTextView(Context context, AttributeSet attrs) { this(context, attrs, android.R.attr.textViewStyle); } public IconicsTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); if (!isInEditMode()) { initialize(context, attrs, defStyle); } } @Override @RestrictTo(LIBRARY_GROUP) public void initialize(Context context, AttributeSet attrs, int defStyle) { applyAttr(context, attrs, defStyle); setIcons(); } @Override @RestrictTo(LIBRARY_GROUP) public void applyAttr(Context context, AttributeSet attrs, int defStyle) { IconicsViewsAttrsReader.readIconicsTextView(context, attrs, mIconsBundle); } private void setIcons() { mIconsBundle.setIcons(this); } //region CompoundIconicsDrawablesImpl @Override public IconicsDrawable getIconicsDrawableStart() { if (mIconsBundle.mStartIcon != null) { return mIconsBundle.mStartIcon; } else { return null; } } @Override public IconicsDrawable getIconicsDrawableTop() { if (mIconsBundle.mTopIcon != null) { return mIconsBundle.mTopIcon; } else { return null; } } @Override public IconicsDrawable getIconicsDrawableEnd() { if (mIconsBundle.mEndIcon != null) { return mIconsBundle.mEndIcon; } else { return null; } } @Override public IconicsDrawable getIconicsDrawableBottom() { if (mIconsBundle.mBottomIcon != null) { return mIconsBundle.mBottomIcon; } else { return null; } } @Override public void setDrawableStart(@Nullable IconicsDrawable drawable) { mIconsBundle.mStartIcon = drawable; setIcons(); } @Override public void setDrawableTop(@Nullable IconicsDrawable drawable) { mIconsBundle.mTopIcon = drawable; setIcons(); } @Override public void setDrawableEnd(@Nullable IconicsDrawable drawable) { mIconsBundle.mEndIcon = drawable; setIcons(); } @Override public void setDrawableBottom(@Nullable IconicsDrawable drawable) { mIconsBundle.mBottomIcon = drawable; setIcons(); } @Override public void setDrawableForAll(@Nullable IconicsDrawable drawable) { mIconsBundle.mStartIcon = drawable; mIconsBundle.mTopIcon = drawable; mIconsBundle.mEndIcon = drawable; mIconsBundle.mBottomIcon = drawable; setIcons(); } //endregion @Override public void setText(CharSequence text, BufferType type) { if (!isInEditMode()) { super.setText(new Iconics.IconicsBuilder().ctx(getContext()).on(text).build(), type); } else { super.setText(text, type); } } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
674367b0866dc24acb0f8907a8367c526929f5c8
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/mapstruct/learning/3535/MoreThanOneBuilderCreationMethodException.java
fc83a6aaef07dcbb73e0f3cadd00cdc463bb1986
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,063
java
/* * Copyright MapStruct Authors. * * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0 */ package org.mapstruct.ap.spi; import java.util.List; import javax.lang.model.type.TypeMirror; /** * Indicates that a type has too many builder creation methods. * This exception can be used to signal the MapStruct processor that more than one builder creation method was found. * * @author Filip Hrisafov */ public class MoreThanOneBuilderCreationMethodException extends RuntimeException { private static final long serialVersionUID = 1L; private final TypeMirror type; private final List<BuilderInfo> builderCreationMethods; public MoreThanOneBuilderCreationMethodException(TypeMirror type, List<BuilderInfo> builderCreationMethods) { this.type = type; this.builderCreationMethods = builderCreationMethods; } public TypeMirror getType() { return type; } public List<BuilderInfo> getBuilderInfo() { return builderCreationMethods; } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
1785c184d0c14785ab79e94e83205db9b5ede7e6
12823b910d5eb51d5907f38a5de0c4648ae27308
/src/io/trivium/dep/com/google/common/collect/ForwardingBlockingDeque.java
6fb0fa43be7ec8929140fbfcc5e5ccc3ad339d3a
[ "Apache-2.0" ]
permissive
JensWalter/trivium
428330f4cb09229312a601581c380a67f77b7467
e0000bbe59429b1b90f2e1b208fb3be222927a90
refs/heads/master
2021-05-31T10:15:47.682179
2016-03-26T13:29:25
2016-03-26T13:29:25
30,550,214
1
0
null
null
null
null
UTF-8
Java
false
false
3,779
java
/* * Copyright (C) 2012 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.trivium.dep.com.google.common.collect; import java.util.Collection; import java.util.concurrent.BlockingDeque; import java.util.concurrent.TimeUnit; /** * A {@link BlockingDeque} which forwards all its method calls to another {@code BlockingDeque}. * Subclasses should override one or more methods to modify the behavior of the backing deque as * desired per the <a href="http://en.wikipedia.org/wiki/Decorator_pattern">decorator pattern</a>. * * <p><b>Warning:</b> The methods of {@code ForwardingBlockingDeque} forward * <b>indiscriminately</b> to the methods of the delegate. For example, overriding {@link #add} * alone <b>will not</b> change the behaviour of {@link #offer} which can lead to unexpected * behaviour. In this case, you should override {@code offer} as well, either providing your own * implementation, or delegating to the provided {@code standardOffer} method. * * <p> * The {@code standard} methods are not guaranteed to be thread-safe, even when all of the methods * that they depend on are thread-safe. * * @author Emily Soldal * @since 14.0 */ public abstract class ForwardingBlockingDeque<E> extends ForwardingDeque<E> implements BlockingDeque<E> { /** Constructor for use by subclasses. */ protected ForwardingBlockingDeque() {} @Override protected abstract BlockingDeque<E> delegate(); @Override public int remainingCapacity() { return delegate().remainingCapacity(); } @Override public void putFirst(E e) throws InterruptedException { delegate().putFirst(e); } @Override public void putLast(E e) throws InterruptedException { delegate().putLast(e); } @Override public boolean offerFirst(E e, long timeout, TimeUnit unit) throws InterruptedException { return delegate().offerFirst(e, timeout, unit); } @Override public boolean offerLast(E e, long timeout, TimeUnit unit) throws InterruptedException { return delegate().offerLast(e, timeout, unit); } @Override public E takeFirst() throws InterruptedException { return delegate().takeFirst(); } @Override public E takeLast() throws InterruptedException { return delegate().takeLast(); } @Override public E pollFirst(long timeout, TimeUnit unit) throws InterruptedException { return delegate().pollFirst(timeout, unit); } @Override public E pollLast(long timeout, TimeUnit unit) throws InterruptedException { return delegate().pollLast(timeout, unit); } @Override public void put(E e) throws InterruptedException { delegate().put(e); } @Override public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException { return delegate().offer(e, timeout, unit); } @Override public E take() throws InterruptedException { return delegate().take(); } @Override public E poll(long timeout, TimeUnit unit) throws InterruptedException { return delegate().poll(timeout, unit); } @Override public int drainTo(Collection<? super E> c) { return delegate().drainTo(c); } @Override public int drainTo(Collection<? super E> c, int maxElements) { return delegate().drainTo(c, maxElements); } }
[ "js.walter@gmx.net" ]
js.walter@gmx.net
dd6a6ce2d7af1be637518e9b841f139d05f28a1a
a9be81a5284d0a4081a0b56c7f1732b3f4ab6eee
/core-web/src/main/java/org/nh/core/web/resp/IResp.java
926df6119d1cc0551bfd9ee2e76d598f6502ec6e
[]
no_license
iosdouble/core-parent
5de6544b54b3a9413b49cbb81eb34098381ae5b3
6b0c1456029eb940364ebe3eb7d7971e58267c63
refs/heads/master
2020-08-15T02:58:52.503391
2020-04-13T10:30:09
2020-04-13T10:30:09
215,269,681
1
0
null
2020-05-21T10:58:47
2019-10-15T10:20:27
Java
UTF-8
Java
false
false
258
java
package org.nh.core.web.resp; import java.io.Serializable; /** * * Response对象的基础接口,继承了序列化接口 * */ public interface IResp extends Serializable { /** * * 将本对象json化 * @return */ public String toJson(); }
[ "18202504057@163.com" ]
18202504057@163.com
9d0b34ec9124f4c7796176d30bf1683fe1415b46
a73dfb319f28cc1ff8aac4bb8721157638253878
/work/09_ecai/lotteryServer/src/main/java/lottery/domains/content/dao/impl/LotteryTypeDaoImpl.java
0b5776f651263a6d8f060862836fcbbcbcbbf889
[]
no_license
xxsheng/JavaTest
63da06d3db5384644ff290d10eed2d1027b613f5
cd3364302734501234c450e4a498eabce0b89efb
refs/heads/master
2021-10-19T06:21:02.472764
2019-02-18T15:17:19
2019-02-18T15:17:19
160,063,042
2
0
null
null
null
null
UTF-8
Java
false
false
691
java
package lottery.domains.content.dao.impl; import java.util.List; import javautils.jdbc.hibernate.HibernateSuperDao; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; import lottery.domains.content.dao.LotteryTypeDao; import lottery.domains.content.entity.LotteryType; @Repository public class LotteryTypeDaoImpl implements LotteryTypeDao { private final String tab = LotteryType.class.getSimpleName(); @Autowired private HibernateSuperDao<LotteryType> superDao; @Override public List<LotteryType> listAll() { String hql = "from " + tab + " order by sort"; return (List<LotteryType>) superDao.list(hql); } }
[ "1558281773@qq.com" ]
1558281773@qq.com
0e2ea83025db358ccfa406c8bf5c9cdb9e0097eb
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/100/org/apache/commons/math/ode/FirstOrderIntegrator_setStepHandler_47.java
64720f08ddb7d757157ca3530298c5e768e9bb44
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
587
java
org apach common math od repres order integr differenti equat class devot solv order differenti equat implement problem handl implement link order differenti equat firstorderdifferentialequ order differenti equat firstorderdifferentialequ step handler stephandl switch function switchingfunct version revis date order integr firstorderintegr set step handler integr handler call integr accept step param handler handler accept step set step handler setstephandl step handler stephandl handler
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
ea4c0594c4ce8a89e837f513044e946cb94b8cd6
10f19a0d3976d94be240143f643186584bc84303
/src/main/java/com/spingular/web/service/dto/ProposalDTO.java
ca5fc98a66fe5a8c4ccfae7e1245590c378694bc
[]
no_license
mathiamry/spingular
ad9a2a3022025d26546a189b35ff73c981d1309c
0a3f9a42b152fe367c9958940623610e4c34936b
refs/heads/master
2022-03-12T18:24:05.650307
2019-11-20T18:16:23
2019-11-20T18:16:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,775
java
package com.spingular.web.service.dto; import java.time.Instant; import javax.validation.constraints.*; import java.io.Serializable; import java.util.Objects; import com.spingular.web.domain.enumeration.ProposalType; import com.spingular.web.domain.enumeration.ProposalRole; /** * A DTO for the {@link com.spingular.web.domain.Proposal} entity. */ public class ProposalDTO implements Serializable { private Long id; @NotNull private Instant creationDate; @NotNull @Size(min = 2, max = 250) private String proposalName; @NotNull private ProposalType proposalType; @NotNull private ProposalRole proposalRole; private Instant releaseDate; private Boolean isOpen; private Boolean isAccepted; private Boolean isPaid; private Long appuserId; private Long postId; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Instant getCreationDate() { return creationDate; } public void setCreationDate(Instant creationDate) { this.creationDate = creationDate; } public String getProposalName() { return proposalName; } public void setProposalName(String proposalName) { this.proposalName = proposalName; } public ProposalType getProposalType() { return proposalType; } public void setProposalType(ProposalType proposalType) { this.proposalType = proposalType; } public ProposalRole getProposalRole() { return proposalRole; } public void setProposalRole(ProposalRole proposalRole) { this.proposalRole = proposalRole; } public Instant getReleaseDate() { return releaseDate; } public void setReleaseDate(Instant releaseDate) { this.releaseDate = releaseDate; } public Boolean isIsOpen() { return isOpen; } public void setIsOpen(Boolean isOpen) { this.isOpen = isOpen; } public Boolean isIsAccepted() { return isAccepted; } public void setIsAccepted(Boolean isAccepted) { this.isAccepted = isAccepted; } public Boolean isIsPaid() { return isPaid; } public void setIsPaid(Boolean isPaid) { this.isPaid = isPaid; } public Long getAppuserId() { return appuserId; } public void setAppuserId(Long appuserId) { this.appuserId = appuserId; } public Long getPostId() { return postId; } public void setPostId(Long postId) { this.postId = postId; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ProposalDTO proposalDTO = (ProposalDTO) o; if (proposalDTO.getId() == null || getId() == null) { return false; } return Objects.equals(getId(), proposalDTO.getId()); } @Override public int hashCode() { return Objects.hashCode(getId()); } @Override public String toString() { return "ProposalDTO{" + "id=" + getId() + ", creationDate='" + getCreationDate() + "'" + ", proposalName='" + getProposalName() + "'" + ", proposalType='" + getProposalType() + "'" + ", proposalRole='" + getProposalRole() + "'" + ", releaseDate='" + getReleaseDate() + "'" + ", isOpen='" + isIsOpen() + "'" + ", isAccepted='" + isIsAccepted() + "'" + ", isPaid='" + isIsPaid() + "'" + ", appuser=" + getAppuserId() + ", post=" + getPostId() + "}"; } }
[ "ecorreos@htomail.com" ]
ecorreos@htomail.com
dd54c1904a245a518b7900acb3c76905a87ad0ee
322d24927f444ef46d0b52c7f98709c1a73df916
/src/main/java/com/lzw/abstractfactory/OracleUser.java
01ea17794dc5f0e674b59995a849794ff27297dd
[]
no_license
longzhiwuing/GOFDemos
1ab1e907b941635228869ec4b9485dc8fe515a8c
4b5d2f3f02931abf78ebd6fd2214687fa7ac1bc9
refs/heads/master
2021-01-13T12:16:41.012045
2017-02-12T07:39:03
2017-02-12T07:39:03
78,318,168
2
0
null
null
null
null
UTF-8
Java
false
false
386
java
package com.lzw.abstractfactory; /** * Created with IntelliJ IDEA. * User: chenzhongyong@cecdat.com * Date: 2017/1/21 * Time: 18:59 */ public class OracleUser implements IUser{ @Override public void CreateUser() { System.out.println("oracle create a user"); } @Override public void getUser() { System.out.println("oracle get a user"); } }
[ "czy3332842@gmail.com" ]
czy3332842@gmail.com
cedf934f1621f0cfbce2faa29cff6010e349bc40
b7b75cb6e5a712c59bde9fb1bd21cf4003ff80c8
/src/main/java/org/cactoos/func/ProcOf.java
6da8a8131f1b725f66690b03d4ce768404ecfd9c
[ "MIT" ]
permissive
Tianhao25/cactoos
908c8918594e52560ce460f67a724a7e450b87ac
28a2560f456c76dc4112aa103f757c8f0c1690df
refs/heads/master
2021-08-31T15:04:47.909622
2017-12-21T16:42:23
2017-12-21T16:42:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,278
java
/** * The MIT License (MIT) * * Copyright (c) 2017 Yegor Bugayenko * * 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 NON-INFRINGEMENT. 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 org.cactoos.func; import java.util.concurrent.Callable; import org.cactoos.Func; import org.cactoos.Proc; /** * Func as Proc. * * <p>There is no thread-safety guarantee. * * @author Yegor Bugayenko (yegor256@gmail.com) * @version $Id$ * @param <X> Type of input * @since 0.12 */ public final class ProcOf<X> implements Proc<X> { /** * The proc. */ private final Proc<X> proc; /** * Ctor. * @param runnable The runnable */ public ProcOf(final Runnable runnable) { this((Proc<X>) input -> runnable.run()); } /** * Ctor. * @param callable The callable */ public ProcOf(final Callable<X> callable) { this((Proc<X>) input -> callable.call()); } /** * Ctor. * @param fnc The proc */ public ProcOf(final Func<X, ?> fnc) { this((Proc<X>) fnc::apply); } /** * Ctor. * @param prc The proc */ private ProcOf(final Proc<X> prc) { this.proc = prc; } @Override public void exec(final X input) throws Exception { this.proc.exec(input); } }
[ "yegor256@gmail.com" ]
yegor256@gmail.com
65bd3646a495a96ffc53cf1a8ffcd35dc2f68c41
46ef867eb57c7b7f57b03c00bb16725b18ea8180
/19.40-corrigindo-a-documentacao-dos-endpoints-de-cidades-update/algafood-api/src/main/java/com/algaworks/algafood/api/model/ItemPedidoModel.java
406349e946aafe24fef639271d0335ddd5ba0304
[]
no_license
johnyguido/curso-especialista-spring-rest
cb9d027b50f4982aab677876e09b07fedecd3c81
94e99c75e5a8475fee333798145113c5ecff41fe
refs/heads/master
2023-06-07T22:36:08.802975
2023-05-24T17:41:56
2023-05-24T17:41:56
399,998,423
0
0
null
null
null
null
UTF-8
Java
false
false
760
java
package com.algaworks.algafood.api.model; import io.swagger.annotations.ApiModelProperty; import lombok.Getter; import lombok.Setter; import org.springframework.hateoas.RepresentationModel; import java.math.BigDecimal; @Getter @Setter public class ItemPedidoModel extends RepresentationModel<ItemPedidoModel> { @ApiModelProperty(example = "1") private Long produtoId; @ApiModelProperty(example = "Porco com molho agridoce") private String produtoNome; @ApiModelProperty(example = "2") private Integer quantidade; @ApiModelProperty(example = "78.90") private BigDecimal precoUnitario; @ApiModelProperty(example = "157.80") private BigDecimal precoTotal; @ApiModelProperty(example = "Menos picante, por favor") private String observacao; }
[ "alex.silva@algaworks.com.br" ]
alex.silva@algaworks.com.br
b138d9543606e3b761e066783abaab1d245ebc35
7791973ca350994b734557803f91a3fd47ea1c02
/Arrays/RotateArray_reversalalgo.java
50d639c8f84374721127346f798c057424398bfb
[]
no_license
gupta29470/Practice
4713ae02a5ab84c6783d711d53df227d9060604a
81676b21fbf0191f8ded836d19f0c280b4bda1cd
refs/heads/master
2023-07-03T15:52:49.832892
2021-08-17T08:49:05
2021-08-17T08:49:05
357,317,997
0
0
null
null
null
null
UTF-8
Java
false
false
1,116
java
import java.io.*; import java.util.*; public class RotateArray_reversealgo{ public static void display(int[] a){ StringBuilder sb = new StringBuilder(); for(int val: a){ sb.append(val + " "); } System.out.println(sb); } public static void reverse(int[] a, int li, int ri){ while(li < ri){ int temp = a[li]; a[li]= a[ri]; a[ri] = temp; li++; ri--; } } public static void rotate(int[] a, int k){ k = k % a.length; if(k < 0){ k += a.length; } reverse(a, 0, a.length - k - 1); reverse(a, a.length - k, a.length - 1); reverse(a, 0, a.length - 1); } public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] a = new int[n]; for(int i = 0; i < n; i++){ a[i] = Integer.parseInt(br.readLine()); } int k = Integer.parseInt(br.readLine()); rotate(a, k); display(a); } }
[ "gupta29470@gmail.com" ]
gupta29470@gmail.com
3bed0f088cadd08086ebbe0ebf7e8bf401d75df3
ef90ea3d37facf3a65952b957c9e55e1b73b7c1e
/src/main/java/com/codetreatise/service/SecService.java
f6b153d4d3817406ace6e5800a909d205849b7e7
[]
no_license
mhsh88/SpringBootJavafx
6988ec060b1f62e748edd659208fef998da89511
21da9a5274335680045a65f68478cb52878ba2c1
refs/heads/master
2020-03-28T19:57:02.015095
2018-10-06T11:59:31
2018-10-06T11:59:31
149,024,516
3
0
null
null
null
null
UTF-8
Java
false
false
372
java
package com.codetreatise.service; import com.codetreatise.bean.station.CityGateStationEntity; import com.codetreatise.bean.station.SecEntity; import com.codetreatise.generic.GenericService; import java.util.List; public interface SecService extends GenericService<SecEntity> { List<SecEntity> findByCityGateStation(CityGateStationEntity cityGateStationEntity); }
[ "hosseinsharifi@hotmail.com" ]
hosseinsharifi@hotmail.com
498960df5795415b6f4427c500f843166ce11fbe
0ec15a0b6ace84332a6a2a65d28bc061418df7c7
/src/main/java/org/activityinfo/server/database/hibernate/dao/CountryDAO.java
45a38ef9b24e0391b4367245b7660bc7c990dab5
[]
no_license
anujak30/activityinfo
cab81065da7562c3f957dc2605da67c16007d863
437bddf6cd7c20bf2ae724f9648fe3b2ab13e717
refs/heads/master
2022-07-05T18:54:28.976740
2020-05-14T09:53:40
2020-05-14T09:54:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,559
java
package org.activityinfo.server.database.hibernate.dao; /* * #%L * ActivityInfo Server * %% * Copyright (C) 2009 - 2013 UNICEF * %% * 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 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program. If not, see * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ import java.util.List; import org.activityinfo.server.database.hibernate.entity.Country; /** * Data Access Object for * {@link org.activityinfo.server.database.hibernate.entity.Country} objects. * Implemented by * {@link org.activityinfo.server.database.hibernate.dao.DAOInvocationHandler * proxy}, see the Country class for query definitions. * * @author Alex Bertram */ public interface CountryDAO extends DAO<Country, Integer> { /** * Returns a list of Countries in alphabetical order. See * {@link org.activityinfo.server.database.hibernate.entity.Country} for * query definition * * @return a list of Countries in alphabetical order */ List<Country> queryAllCountriesAlphabetically(); }
[ "alex@bedatadriven.com" ]
alex@bedatadriven.com
f2975e91524bc6882c985f8d9d6e420f5a477209
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/google/android/search/verification/client/SearchActionVerificationClientService$a.java
739f46d7ecae1697074f21baf07c15abc0ab09a9
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
1,326
java
package com.google.android.search.verification.client; import android.content.ComponentName; import android.content.ServiceConnection; import android.os.IBinder; import com.google.android.search.verification.a.a.a; import com.tencent.matrix.trace.core.AppMethodBeat; final class SearchActionVerificationClientService$a implements ServiceConnection { SearchActionVerificationClientService$a(SearchActionVerificationClientService paramSearchActionVerificationClientService) { } public final void onServiceConnected(ComponentName paramComponentName, IBinder paramIBinder) { AppMethodBeat.i(94131); SearchActionVerificationClientService.a(this.bus); SearchActionVerificationClientService.a(this.bus, a.a.g(paramIBinder)); AppMethodBeat.o(94131); } public final void onServiceDisconnected(ComponentName paramComponentName) { AppMethodBeat.i(94132); SearchActionVerificationClientService.a(this.bus, null); SearchActionVerificationClientService.a(this.bus); AppMethodBeat.o(94132); } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar * Qualified Name: com.google.android.search.verification.client.SearchActionVerificationClientService.a * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
5980d5da9312b4451f0db693785c158e53cfb286
c699fe58ca7b58a34f47cc3259fb8d567c676866
/softwarereuse/reuze/demo/demoToxiWavesAdditive.java
77e59c840641daee7ff222d0e6447f05c6c533b3
[]
no_license
ammarblue/brad-baze-code-bank
9b0b300ab09f5ed315ce6ac0a8352fcd8a6e03e8
0cc496fbdef4f7b466d4905c23ae0bedaf9624c9
refs/heads/master
2021-01-01T05:47:15.497877
2013-05-31T15:05:31
2013-05-31T15:05:31
39,472,729
0
0
null
null
null
null
UTF-8
Java
false
false
4,997
java
package reuze.demo; /** * <p>AdditiveWaves demo is showing how to add 2 randomly chosen waveforms * to create a 3D terrain. One wave is moving along the X axis and is mapped * to the red color channel, the other is propagating along Y and is mapped to * blue. In this demo each wave's frequency is modulated by a secondary wave * (here hardcoded as sine wave). Three of the possible waveforms chosen have * additional options/special behaviour: * * <ul><li>AMFMSineWave also modulates the wave's overall amplitude on top of * frequency modulation</li> * <li>FMHarmonicSquareWave's shape can tweaked by adjusting the number of harmonics * used (the higher the more square-like the wave becomes).</li> * <li>ConstantWave is simply representing a fixed value</li></ul> * </p> * * <p>Currently available wave forms are: * <ul><li>SineWave, FMSineWave, AMFMSineWave</li> * <li>FMTriangleWave</li> * <li>FMSawtoothWave</li> * <li>FMSquareWave, FMHarmonicSquareWave</li> * <li>ConstantWave</li></ul> * * <p>For a demonstration how to use these wave generators as oscillators to * synthesize audio samples, please have a look at the toxiclibs audioutils sub-package * which is being distributed separately.</p> * * <p>You can also create entirely new waveforms by subclassing the parent AbstractWave * type and overwriting the update() method.</p> * * <p>Usage: move mouse to rotate view, click to regenerate 2 random waves.</p> */ /* * Copyright (c) 2009 Karsten Schmidt * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * http://creativecommons.org/licenses/LGPL/2.1/ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ import com.software.reuze.m_WaveAMFMSine; import com.software.reuze.m_WaveConstant; import com.software.reuze.m_WaveFMHarmonicSquare; import com.software.reuze.m_WaveFMSawtooth; import com.software.reuze.m_WaveFMSine; import com.software.reuze.m_WaveFMSquare; import com.software.reuze.m_WaveFMTriangle; import com.software.reuze.m_WaveSine; import com.software.reuze.m_a_Wave; import processing.core.PApplet; public class demoToxiWavesAdditive extends PApplet { m_a_Wave waveX,waveY; int STEP = 10; int DIM = 800; int D2 = DIM/2; int AMP = 50; public void setup() { size(1024, 576, P3D); noStroke(); waveX=createRandomWave(); waveY=createRandomWave(); textFont(createFont("SansSerif", 10)); } public void draw() { background(0); lights(); pushMatrix(); translate(width*0.5f, height*0.4f, 0); rotateX(0.8f); rotateZ(mouseX*0.01f); scale(0.5f); float prevY = waveY.update(); float colPrevY = 0; waveY.push(); for(int y = 0; y < DIM; y += STEP) { float valueY = waveY.update(); float colY = valueY * 128 + 128; waveX.push(); beginShape(TRIANGLE_STRIP); for(int x = 0; x < DIM; x += STEP) { float valueX = waveX.update(); float colX = valueX * 128 + 128; fill(colX, 0, colPrevY); vertex(x - D2, y - STEP - D2, (valueX + prevY) * AMP); fill(colX, 0, colY); vertex(x - D2, y - D2, (valueX + valueY) * AMP); } endShape(); waveX.pop(); prevY = valueY; colPrevY = colY; } waveY.pop(); waveX.update(); waveY.update(); popMatrix(); fill(255); text(waveX.getClass().getName(), 20, 30); text(waveY.getClass().getName(), 20, 42); } public void mousePressed() { waveX=createRandomWave(); waveY=createRandomWave(); } m_a_Wave createRandomWave() { m_a_Wave w=null; m_a_Wave fmod=new m_WaveSine(0, random(0.005f, 0.02f), random(0.1f, 0.5f), 0); float freq=random(0.005f, 0.05f); switch((int)random(7)) { case 0: w = new m_WaveFMTriangle(0, freq, 1, 0, fmod); break; case 1: w = new m_WaveFMSawtooth(0, freq, 1, 0, fmod); break; case 2: w = new m_WaveFMSquare(0, freq, 1, 0, fmod); break; case 3: w = new m_WaveFMHarmonicSquare(0, freq, 1, 0, fmod); ((m_WaveFMHarmonicSquare)w).maxHarmonics=(int)random(3,30); break; case 4: w = new m_WaveFMSine(0, freq, 1, 0, fmod); break; case 5: w = new m_WaveAMFMSine(0, freq, 0, fmod, new m_WaveSine(0, random(0.01f,0.2f), random(2f, 3f), 0)); break; case 6: w = new m_WaveConstant(random(-1,1)); break; } return w; } }
[ "in_tech@mac.com" ]
in_tech@mac.com
2853912d9b0d577b0b8779b55fec034628516679
56e87f1d1ea499318c5fcdb4594f0efd9cfceebb
/repository/src/main/java/oasis/names/tc/emergency/EDXL/TEP/_1/OrganisationNameTypeList.java
039e525a26e8980937e064e6a8f6a797d92fd6d6
[]
no_license
vergetid/impress
7da9353b65bc324bb58c6694747925ab92bac104
dd207cabeff4af8449245d96d276ceb7a71ba14d
refs/heads/master
2020-05-21T12:34:54.412796
2017-06-20T13:28:14
2017-06-20T13:28:14
55,222,896
0
0
null
2017-03-31T13:00:22
2016-04-01T10:06:44
Java
UTF-8
Java
false
false
2,485
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.04.01 at 06:03:54 PM EEST // package oasis.names.tc.emergency.EDXL.TEP._1; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for OrganisationNameTypeList. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="OrganisationNameTypeList"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}normalizedString"> * &lt;enumeration value="LegalName"/> * &lt;enumeration value="FormerName"/> * &lt;enumeration value="CommonUse"/> * &lt;enumeration value="PublishingName"/> * &lt;enumeration value="OfficialName"/> * &lt;enumeration value="UnofficialName"/> * &lt;enumeration value="Undefined"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "OrganisationNameTypeList", namespace = "urn:oasis:names:tc:emergency:edxl:ciq:1.0:xnl") @XmlEnum public enum OrganisationNameTypeList { @XmlEnumValue("LegalName") LEGAL_NAME("LegalName"), /** * * Former name of the organisation * * */ @XmlEnumValue("FormerName") FORMER_NAME("FormerName"), @XmlEnumValue("CommonUse") COMMON_USE("CommonUse"), @XmlEnumValue("PublishingName") PUBLISHING_NAME("PublishingName"), @XmlEnumValue("OfficialName") OFFICIAL_NAME("OfficialName"), @XmlEnumValue("UnofficialName") UNOFFICIAL_NAME("UnofficialName"), /** * * unknown * * */ @XmlEnumValue("Undefined") UNDEFINED("Undefined"); private final String value; OrganisationNameTypeList(String v) { value = v; } public String value() { return value; } public static OrganisationNameTypeList fromValue(String v) { for (OrganisationNameTypeList c: OrganisationNameTypeList.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "vergetid@ubitech.eu" ]
vergetid@ubitech.eu
cb337aa5a5340716c2f9b66d8e79567c458b4e48
92dd6bc0a9435c359593a1f9b309bb58d3e3f103
/src/May2021PrepLeetcode/_0249GroupShiftedStrings.java
d6a2497c781dadb1499113e1441eb363782aacb7
[ "MIT" ]
permissive
darshanhs90/Java-Coding
bfb2eb84153a8a8a9429efc2833c47f6680f03f4
da76ccd7851f102712f7d8dfa4659901c5de7a76
refs/heads/master
2023-05-27T03:17:45.055811
2021-06-16T06:18:08
2021-06-16T06:18:08
36,981,580
3
3
null
null
null
null
UTF-8
Java
false
false
1,258
java
package May2021PrepLeetcode; import java.util.ArrayList; import java.util.HashMap; import java.util.List; public class _0249GroupShiftedStrings { public static void main(String[] args) { System.out.println(groupStrings(new String[] { "abc", "bcd", "acef", "xyz", "az", "ba", "a", "z" })); System.out.println(groupStrings(new String[] { "a", "a" })); } public static List<List<String>> groupStrings(String[] strings) { HashMap<String, Integer> map = new HashMap<String, Integer>(); for (int i = 0; i < strings.length; i++) { map.compute(strings[i], (k, v) -> v == null ? 1 : v + 1); } List<List<String>> output = new ArrayList<List<String>>(); for (String str : strings) { if (map.containsKey(str)) { char[] cArr = str.toCharArray(); List<String> list = new ArrayList<String>(); for (int i = 0; i < 26; i++) { for (int j = 0; j < cArr.length; j++) { cArr[j] += 1; if (cArr[j] > 'z') cArr[j] = 'a'; } String newString = new String(cArr); if (map.containsKey(newString)) { int count = map.get(newString); for (int j = 0; j < count; j++) { list.add(newString); } map.remove(newString); } } output.add(list); } } return output; } }
[ "hsdars@gmail.com" ]
hsdars@gmail.com
b26d97613501533ee1208c03bc8673aafc0862bc
e7ff61da5ab7ae901064860a73e92f9138d100e2
/crm/code/src/main/java/com/tuhanbao/impl/crm/ServerManager.java
92e599aa0b1e4e4e7bd870c2d227a1d45eeb414d
[]
no_license
tuhanbao/tuhanbao
ddd502a131f1c141e88ad742678f3064a524f43a
831c3e182ccd686e426e78fb423ccd415f6fda1a
refs/heads/master
2023-07-29T00:31:22.523008
2023-07-18T06:07:42
2023-07-18T06:07:42
96,409,057
4
1
null
2022-12-16T01:55:17
2017-07-06T08:49:37
Java
UTF-8
Java
false
false
1,880
java
package com.tuhanbao.impl.crm; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import com.tuhanbao.web.IServerManager; import com.tuhanbao.impl.crm.mapper.crm.CrmMapper; import com.tuhanbao.web.filter.SelectorFactory; import com.tuhanbao.web.filter.MyBatisSelectorFilter; import com.tuhanbao.base.dataservice.ServiceBean; import com.tuhanbao.thirdapi.cache.CacheManager; import com.tuhanbao.api.crm.constants.TableConstants; public class ServerManager implements ApplicationListener<ContextRefreshedEvent> { private static boolean isInit = false; @Autowired private IServerManager serverManger; @Autowired private CrmMapper<ServiceBean> crmMapper; @Override public void onApplicationEvent(ContextRefreshedEvent event) { init(); } public void init() { if (!isInit) { //初始化redis缓存 if (!CacheManager.hasCacheDataGroup(TableConstants.T_COMPANY.TABLE)) { CacheManager.save(crmMapper.select(new MyBatisSelectorFilter(SelectorFactory.getTablesSelector(TableConstants.T_COMPANY.TABLE)))); } if (!CacheManager.hasCacheDataGroup(TableConstants.T_COMPANY_SMS_INFO.TABLE)) { CacheManager.save(crmMapper.select(new MyBatisSelectorFilter(SelectorFactory.getTablesSelector(TableConstants.T_COMPANY_SMS_INFO.TABLE)))); } if (!CacheManager.hasCacheDataGroup(TableConstants.T_DIY_COL_INFO.TABLE)) { CacheManager.save(crmMapper.select(new MyBatisSelectorFilter(SelectorFactory.getTablesSelector(TableConstants.T_DIY_COL_INFO.TABLE)))); } if (serverManger != null) serverManger.init(); isInit = true; } } }
[ "tuhanbao@foxmail.com" ]
tuhanbao@foxmail.com
222823baa72f1af8b4ada774e5ba5144fde0ef65
5c820b57c066ed81b184439633990b7b96b10489
/src/main/java/qian/ling/yi/base/WhileTest.java
d42c861d772e046a4507abb4c2e6be5fc83029bd
[]
no_license
liudebin/TestAll
4cf658335564e90011066be716c354575dcad274
ed35e2ad893581ecaffe056780adfbb655d70fef
refs/heads/master
2022-12-09T13:36:29.794418
2021-01-28T10:14:05
2021-01-28T10:14:05
73,248,143
0
2
null
2022-12-06T00:39:45
2016-11-09T03:04:07
Java
UTF-8
Java
false
false
322
java
package qian.ling.yi.base; import org.junit.Test; import qian.ling.yi.AbstractTest; /** * Created by liuguobin on 2016/11/1. */ public class WhileTest extends AbstractTest { @Test public void testBreak() { while (true) { break; } logger.info("循环结束"); } }
[ "liuguobin@nonobank.com" ]
liuguobin@nonobank.com
3b281ca03d869184a4aee328c93247285b283792
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project75/src/test/java/org/gradle/test/performance75_5/Test75_428.java
f7441cbff0b29898aad2e8ba5953d3c536a555e8
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
292
java
package org.gradle.test.performance75_5; import static org.junit.Assert.*; public class Test75_428 { private final Production75_428 production = new Production75_428("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
3c450c249dd7e3b7c47ea3b47504d1562f0fe5e8
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE191_Integer_Underflow/s04/CWE191_Integer_Underflow__int_getParameter_Servlet_postdec_72a.java
80382e2bfb88bf496502cfc2d9b512f734e0dc2b
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
4,237
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_getParameter_Servlet_postdec_72a.java Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-72a.tmpl.java */ /* * @description * CWE: 191 Integer Underflow * BadSource: getParameter_Servlet Read data from a querystring using getParameter() * GoodSource: A hardcoded non-zero, non-min, non-max, even number * Sinks: decrement * GoodSink: Ensure there will not be an underflow before decrementing data * BadSink : Decrement data, which can cause an Underflow * Flow Variant: 72 Data flow: data passed in a Vector from one method to another in different source files in the same package * * */ package testcases.CWE191_Integer_Underflow.s04; import testcasesupport.*; import java.util.Vector; import javax.servlet.http.*; import java.util.logging.Level; public class CWE191_Integer_Underflow__int_getParameter_Servlet_postdec_72a extends AbstractTestCaseServlet { public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ /* POTENTIAL FLAW: Read data from a querystring using getParameter() */ { String stringNumber = request.getParameter("name"); try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading data from parameter 'name'", exceptNumberFormat); } } Vector<Integer> dataVector = new Vector<Integer>(5); dataVector.add(0, data); dataVector.add(1, data); dataVector.add(2, data); (new CWE191_Integer_Underflow__int_getParameter_Servlet_postdec_72b()).badSink(dataVector , request, response ); } public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable { goodG2B(request, response); goodB2G(request, response); } /* goodG2B() - use GoodSource and BadSink */ private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; Vector<Integer> dataVector = new Vector<Integer>(5); dataVector.add(0, data); dataVector.add(1, data); dataVector.add(2, data); (new CWE191_Integer_Underflow__int_getParameter_Servlet_postdec_72b()).goodG2BSink(dataVector , request, response ); } /* goodB2G() - use BadSource and GoodSink */ private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable { int data; data = Integer.MIN_VALUE; /* Initialize data */ /* POTENTIAL FLAW: Read data from a querystring using getParameter() */ { String stringNumber = request.getParameter("name"); try { data = Integer.parseInt(stringNumber.trim()); } catch(NumberFormatException exceptNumberFormat) { IO.logger.log(Level.WARNING, "Number format exception reading data from parameter 'name'", exceptNumberFormat); } } Vector<Integer> dataVector = new Vector<Integer>(5); dataVector.add(0, data); dataVector.add(1, data); dataVector.add(2, data); (new CWE191_Integer_Underflow__int_getParameter_Servlet_postdec_72b()).goodB2GSink(dataVector , request, response ); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "you@example.com" ]
you@example.com
c791ed1dcda1acf2e9b69bb25c387c323802ea38
5a7ae4406b641d3ead886c76531de643d6e5d9f9
/src/test/java/co/afpa/gestion/ressources/web/rest/AuditResourceIT.java
65e6e78b7a9c4c1a9535036c9176860ab4661f28
[]
no_license
lanaflonPerso/gestion-ressources-application
4e9d3a42c4ad97a9a614f40a85b445d128813412
65e255bda6d29164d2da4cbbba37e83d70756c2f
refs/heads/master
2022-05-18T12:46:16.949751
2020-03-08T17:15:10
2020-03-08T17:15:10
245,855,594
0
0
null
2022-03-08T21:19:08
2020-03-08T17:14:53
Java
UTF-8
Java
false
false
6,127
java
package co.afpa.gestion.ressources.web.rest; import co.afpa.gestion.ressources.GestionRessourcesSampleApplicationApp; import io.github.jhipster.config.JHipsterProperties; import co.afpa.gestion.ressources.config.audit.AuditEventConverter; import co.afpa.gestion.ressources.domain.PersistentAuditEvent; import co.afpa.gestion.ressources.repository.PersistenceAuditEventRepository; import co.afpa.gestion.ressources.security.AuthoritiesConstants; import co.afpa.gestion.ressources.service.AuditEventService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.format.support.FormattingConversionService; import org.springframework.http.MediaType; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import java.time.Instant; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.hamcrest.Matchers.hasItem; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Integration tests for the {@link AuditResource} REST controller. */ @AutoConfigureMockMvc @WithMockUser(authorities = AuthoritiesConstants.ADMIN) @SpringBootTest(classes = GestionRessourcesSampleApplicationApp.class) @Transactional public class AuditResourceIT { private static final String SAMPLE_PRINCIPAL = "SAMPLE_PRINCIPAL"; private static final String SAMPLE_TYPE = "SAMPLE_TYPE"; private static final Instant SAMPLE_TIMESTAMP = Instant.parse("2015-08-04T10:11:30Z"); private static final long SECONDS_PER_DAY = 60 * 60 * 24; @Autowired private PersistenceAuditEventRepository auditEventRepository; private PersistentAuditEvent auditEvent; @Autowired private MockMvc restAuditMockMvc; @BeforeEach public void initTest() { auditEventRepository.deleteAll(); auditEvent = new PersistentAuditEvent(); auditEvent.setAuditEventType(SAMPLE_TYPE); auditEvent.setPrincipal(SAMPLE_PRINCIPAL); auditEvent.setAuditEventDate(SAMPLE_TIMESTAMP); } @Test public void getAllAudits() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Get all the audits restAuditMockMvc.perform(get("/management/audits")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); } @Test public void getAudit() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Get the audit restAuditMockMvc.perform(get("/management/audits/{id}", auditEvent.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.principal").value(SAMPLE_PRINCIPAL)); } @Test public void getAuditsByDate() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Generate dates for selecting audits by date, making sure the period will contain the audit String fromDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0, 10); String toDate = SAMPLE_TIMESTAMP.plusSeconds(SECONDS_PER_DAY).toString().substring(0, 10); // Get the audit restAuditMockMvc.perform(get("/management/audits?fromDate="+fromDate+"&toDate="+toDate)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); } @Test public void getNonExistingAuditsByDate() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Generate dates for selecting audits by date, making sure the period will not contain the sample audit String fromDate = SAMPLE_TIMESTAMP.minusSeconds(2*SECONDS_PER_DAY).toString().substring(0, 10); String toDate = SAMPLE_TIMESTAMP.minusSeconds(SECONDS_PER_DAY).toString().substring(0, 10); // Query audits but expect no results restAuditMockMvc.perform(get("/management/audits?fromDate=" + fromDate + "&toDate=" + toDate)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(header().string("X-Total-Count", "0")); } @Test public void getNonExistingAudit() throws Exception { // Get the audit restAuditMockMvc.perform(get("/management/audits/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } @Test @Transactional public void testPersistentAuditEventEquals() throws Exception { TestUtil.equalsVerifier(PersistentAuditEvent.class); PersistentAuditEvent auditEvent1 = new PersistentAuditEvent(); auditEvent1.setId(1L); PersistentAuditEvent auditEvent2 = new PersistentAuditEvent(); auditEvent2.setId(auditEvent1.getId()); assertThat(auditEvent1).isEqualTo(auditEvent2); auditEvent2.setId(2L); assertThat(auditEvent1).isNotEqualTo(auditEvent2); auditEvent1.setId(null); assertThat(auditEvent1).isNotEqualTo(auditEvent2); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
9173f5f00671f21e4f9bf3741910c322ef0ee917
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14122-36-9-MOEAD-WeightedSum:TestLen:CallDiversity/org/xwiki/extension/job/internal/AbstractExtensionJob_ESTest.java
aef2ad6a8d38360867dae52af4585f615b4c5001
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
579
java
/* * This file was automatically generated by EvoSuite * Thu Apr 09 11:43:12 UTC 2020 */ package org.xwiki.extension.job.internal; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class AbstractExtensionJob_ESTest extends AbstractExtensionJob_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
3d2b6507d67337ee169eeef16cd51d69006600d7
316e7b55e04379c5534f1ec5ade1e7855671051b
/Lindley.RTM/src/pe/lindley/ficha/to/VisualizacionTO.java
ea4a08b632b3b2fd458831d67162eb22fb351081
[]
no_license
jels1988/msonicdroid
5a4d118703b1b3449086a67f9f412ca5505f90e9
eb36329e537c4963e1f6842d81f3c179fc8670e1
refs/heads/master
2021-01-10T09:02:11.276309
2013-07-18T21:16:08
2013-07-18T21:16:08
44,779,314
0
0
null
null
null
null
UTF-8
Java
false
false
877
java
package pe.lindley.ficha.to; import com.google.gson.annotations.SerializedName; public class VisualizacionTO { @SerializedName("CLI") private String codigo; @SerializedName("IMG") private String codigoImagen; @SerializedName("FCT") private String fechaToma; @SerializedName("URL") private String url; public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } public String getCodigoImagen() { return codigoImagen; } public void setCodigoImagen(String codigoImagen) { this.codigoImagen = codigoImagen; } public String getFechaToma() { return fechaToma; } public void setFechaToma(String fechaToma) { this.fechaToma = fechaToma; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } }
[ "mzegarra@gmail.com" ]
mzegarra@gmail.com
2e2837146ecc20203d582d8dfff1e2449e58dcf4
b2fa66ec49f50b4bb92fee6494479238c8b46876
/src/generated/java/fi/riista/integration/luke_export/mooselikeharvests/LEM_ObservationType.java
f6e9080e226688b4e31155250d1acbe8056c36a2
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
suomenriistakeskus/oma-riista-web
f007a9dc663317956ae672ece96581f1704f0e85
f3550bce98706dfe636232fb2765a44fa33f78ca
refs/heads/master
2023-04-27T12:07:50.433720
2023-04-25T11:31:05
2023-04-25T11:31:05
77,215,968
16
4
MIT
2023-04-25T11:31:06
2016-12-23T09:49:44
Java
UTF-8
Java
false
false
2,258
java
package fi.riista.integration.luke_export.mooselikeharvests; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for observationType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="observationType"&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}token"&gt; * &lt;enumeration value="NAKO"/&gt; * &lt;enumeration value="JALKI"/&gt; * &lt;enumeration value="ULOSTE"/&gt; * &lt;enumeration value="AANI"/&gt; * &lt;enumeration value="RIISTAKAMERA"/&gt; * &lt;enumeration value="KOIRAN_RIISTATYO"/&gt; * &lt;enumeration value="MAASTOLASKENTA"/&gt; * &lt;enumeration value="KOLMIOLASKENTA"/&gt; * &lt;enumeration value="LENTOLASKENTA"/&gt; * &lt;enumeration value="HAASKA"/&gt; * &lt;enumeration value="SYONNOS"/&gt; * &lt;enumeration value="KELOMISPUU"/&gt; * &lt;enumeration value="KIIMAKUOPPA"/&gt; * &lt;enumeration value="MAKUUPAIKKA"/&gt; * &lt;enumeration value="PESA"/&gt; * &lt;enumeration value="SOIDIN"/&gt; * &lt;enumeration value="LUOLASTO"/&gt; * &lt;enumeration value="PESIMALUOTO"/&gt; * &lt;enumeration value="LEPAILYLUOTO"/&gt; * &lt;enumeration value="PESIMASUO"/&gt; * &lt;enumeration value="MUUTON_AIKAINEN_LEPAILYALUE"/&gt; * &lt;enumeration value="RIISTANKULKUPAIKKA"/&gt; * &lt;enumeration value="MUU"/&gt; * &lt;/restriction&gt; * &lt;/simpleType&gt; * </pre> * */ @XmlType(name = "observationType", namespace = "http://riista.fi/integration/luke/export/mooselikeharvests/2016/07") @XmlEnum public enum LEM_ObservationType { NAKO, JALKI, ULOSTE, AANI, RIISTAKAMERA, KOIRAN_RIISTATYO, MAASTOLASKENTA, KOLMIOLASKENTA, LENTOLASKENTA, HAASKA, SYONNOS, KELOMISPUU, KIIMAKUOPPA, MAKUUPAIKKA, PESA, SOIDIN, LUOLASTO, PESIMALUOTO, LEPAILYLUOTO, PESIMASUO, MUUTON_AIKAINEN_LEPAILYALUE, RIISTANKULKUPAIKKA, MUU; public String value() { return name(); } public static LEM_ObservationType fromValue(String v) { return valueOf(v); } }
[ "kyosti.herrala@vincit.fi" ]
kyosti.herrala@vincit.fi
7d5f4e9e49b6e60a6be3eb11a3aeb6b65758e6af
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_71697a6c571588df47b9a5a9631f27993c8ede8b/ShowDCQLPanel/2_71697a6c571588df47b9a5a9631f27993c8ede8b_ShowDCQLPanel_t.java
47e00add548a28b214b4108b857e72fea266d3f1
[]
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
5,759
java
package edu.wustl.cab2b.client.ui.searchDataWizard; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JScrollPane; import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileNameExtensionFilter; import org.xml.sax.XMLFilter; import edu.wustl.cab2b.client.ui.controls.Cab2bButton; import edu.wustl.cab2b.client.ui.controls.Cab2bLabel; import edu.wustl.cab2b.client.ui.controls.Cab2bPanel; import edu.wustl.cab2b.client.ui.mainframe.MainFrame; import edu.wustl.cab2b.client.ui.mainframe.NewWelcomePanel; import edu.wustl.cab2b.client.ui.util.WindowUtilities; import edu.wustl.cab2b.common.domain.DCQL; /** * This class displays the DCQL Panel which shows the XML format of DCQL along * with function of saving the XML file * * @author gaurav_mehta */ public class ShowDCQLPanel extends Cab2bPanel { /* JDialog in which the Panel is displayed */ private JDialog dialog; // Cab2bLabel in which the entire XML is final private Cab2bLabel xmlTextPane = new Cab2bLabel(); // Cab2bPanel for showing Success and failure messages final Cab2bPanel messagePanel = new Cab2bPanel(); private String dcqlString; /** * @param dcql */ public ShowDCQLPanel(DCQL dcql) { this.dcqlString = dcql.getDcqlQuery(); initGUI(); } private void initGUI() { String xmlText = new XmlParser().parseXml(dcqlString); xmlTextPane.setText(xmlText); xmlTextPane.setBackground(Color.WHITE); Cab2bPanel xmlPanel = new Cab2bPanel(); xmlPanel.add(xmlTextPane); xmlPanel.setBackground(Color.WHITE); JScrollPane scrollPane = new JScrollPane(); scrollPane.getViewport().add(xmlPanel); scrollPane.getViewport().setBackground(Color.WHITE); Cab2bPanel xmlNavigationPanel = new Cab2bPanel(); Cab2bButton exportButton = new Cab2bButton("Export"); Cab2bButton cancelButton = new Cab2bButton("Cancel"); // Action Listener for Export Button exportButton.addActionListener(new ExportButtonListner()); // Action Listener for Cancel Button cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { dialog.dispose(); } }); Cab2bPanel buttonPanel = new Cab2bPanel(); FlowLayout flowLayout = new FlowLayout(FlowLayout.RIGHT); buttonPanel.setLayout(flowLayout); buttonPanel.add(exportButton); buttonPanel.add(cancelButton); buttonPanel.setBackground(new Color(240, 240, 240)); xmlNavigationPanel.add("br left", messagePanel); xmlNavigationPanel.add("hfill", buttonPanel); xmlNavigationPanel.setPreferredSize(new Dimension(880, 50)); xmlNavigationPanel.setBackground(new Color(240, 240, 240)); setLayout(new BorderLayout()); add(scrollPane, BorderLayout.CENTER); add(xmlNavigationPanel, BorderLayout.SOUTH); } /** * JDialog for showing DCQL XML Details Panel * * @return */ public JDialog showInDialog() { Dimension dimension = MainFrame.getScreenDimesion(); dialog = WindowUtilities.setInDialog(NewWelcomePanel.getMainFrame(), this, "DCQL Xml", new Dimension((int) (dimension.width * 0.77), (int) (dimension.height * 0.65)), true, false); dialog.setVisible(true); return dialog; } private boolean writeFile(String file, String fileContent) { try { PrintWriter out = new PrintWriter(new BufferedWriter( new FileWriter(file))); out.print(fileContent); out.flush(); out.close(); } catch (IOException e) { return false; } return true; } /** * Action listener class for Export Button. It saves the XML file to user * defined location in user defined format */ class ExportButtonListner implements ActionListener { public void actionPerformed(ActionEvent actionEvent) { JFileChooser fileChooser = new JFileChooser(); FileNameExtensionFilter filter = new FileNameExtensionFilter( "Xml Document(*.xml)", "xml"); FileNameExtensionFilter filter1 = new FileNameExtensionFilter( "Text Document(*.txt)", "txt"); fileChooser.setAcceptAllFileFilterUsed(false); fileChooser.setFileFilter(filter); fileChooser.setFileFilter(filter1); // A call to JFileChooser's ShowSaveDialog PopUp fileChooser.showSaveDialog(NewWelcomePanel.getMainFrame()); File file = fileChooser.getSelectedFile(); String fileName = file.toString(); FileFilter fileFilter = fileChooser.getFileFilter(); if (fileFilter.getDescription().equalsIgnoreCase("Text Document(*.txt)")) { fileName = fileName + ".txt"; } else { fileName = fileName + ".xml"; } // Function call for writing the File and saving it boolean saveReturnValue = writeFile(fileName, dcqlString); if (saveReturnValue == true) { Cab2bLabel successResultLabel = new Cab2bLabel( "File Saved Successfully"); successResultLabel.setForeground(Color.GREEN); messagePanel.add(successResultLabel); messagePanel.repaint(); } else { Cab2bLabel failureResultLabel = new Cab2bLabel( "File Could not be Saved"); failureResultLabel.setForeground(Color.RED); messagePanel.add(failureResultLabel); messagePanel.repaint(); } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9bc178c49abbe1f6f9888572fc07c5e89482a350
4be72dee04ebb3f70d6e342aeb01467e7e8b3129
/bin/ext-eventtracking/eventtrackingservices/src/de/hybris/eventtracking/services/populators/ProductReviewsViewEventPopulator.java
52da18e77888bcf4bcd645034ecfe2dc0daefd0f
[]
no_license
lun130220/hybris
da00774767ba6246d04cdcbc49d87f0f4b0b1b26
03c074ea76779f96f2db7efcdaa0b0538d1ce917
refs/heads/master
2021-05-14T01:48:42.351698
2018-01-07T07:21:53
2018-01-07T07:21:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,526
java
/* * [y] hybris Platform * * Copyright (c) 2000-2014 hybris AG * All rights reserved. * * This software is the confidential and proprietary information of hybris * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with hybris. * * */ package de.hybris.eventtracking.services.populators; import de.hybris.eventtracking.model.events.AbstractTrackingEvent; import de.hybris.eventtracking.model.events.ProductReviewsViewEvent; import de.hybris.platform.servicelayer.dto.converter.ConversionException; import java.util.Map; import com.fasterxml.jackson.databind.ObjectMapper; /** * @author stevo.slavic * */ public class ProductReviewsViewEventPopulator extends AbstractTrackingEventGenericPopulator { public ProductReviewsViewEventPopulator(final ObjectMapper mapper) { super(mapper); } /** * @see de.hybris.eventtracking.services.populators.GenericPopulator#supports(java.lang.Class) */ @Override public boolean supports(final Class<?> clazz) { return ProductReviewsViewEvent.class.isAssignableFrom(clazz); } /** * @see de.hybris.platform.converters.Populator#populate(java.lang.Object, java.lang.Object) */ @Override public void populate(final Map<String, Object> trackingEventData, final AbstractTrackingEvent trackingEvent) throws ConversionException { ((ProductReviewsViewEvent) trackingEvent).setEventType("ProductReviewsViewEvent"); } }
[ "lun130220@gamil.com" ]
lun130220@gamil.com
2d84e9b54fb57f15a199a2d63c736848a8127313
d5f09c7b0e954cd20dd613af600afd91b039c48a
/sources/com/huawei/hms/core/aidl/RequestHeader.java
9c7517a8dc3efcfe49a2a0e080d93af8546034d5
[]
no_license
t0HiiBwn/CoolapkRelease
af5e00c701bf82c4e90b1033f5c5f9dc8526f4b3
a6a2b03e32cde0e5163016e0078391271a8d33ab
refs/heads/main
2022-07-29T23:28:35.867734
2021-03-26T11:41:18
2021-03-26T11:41:18
345,290,891
5
2
null
null
null
null
UTF-8
Java
false
false
1,497
java
package com.huawei.hms.core.aidl; import com.huawei.hms.core.aidl.annotation.Packed; import java.util.List; public class RequestHeader implements IMessageEntity { @Packed private int apiLevel; @Packed private List<String> apiNameList; @Packed private String appId; @Packed private String packageName; @Packed private int sdkVersion; @Packed private String sessionId; public RequestHeader() { } public RequestHeader(String str, String str2, int i, String str3) { this.appId = str; this.packageName = str2; this.sdkVersion = i; this.sessionId = str3; } public String getAppID() { return this.appId; } public void setAppID(String str) { this.appId = str; } public void setApiLevel(int i) { this.apiLevel = i; } public String getPackageName() { return this.packageName; } public void setPackageName(String str) { this.packageName = str; } public int getSdkVersion() { return this.sdkVersion; } public void setSdkVersion(int i) { this.sdkVersion = i; } public String getSessionId() { return this.sessionId; } public void setSessionId(String str) { this.sessionId = str; } public List<String> getApiNameList() { return this.apiNameList; } public void setApiNameList(List<String> list) { this.apiNameList = list; } }
[ "test@gmail.com" ]
test@gmail.com
b4fbcb37e28a87b74a696c3c8009b1427d96f1c7
ceeea83e2553c0ffef73bb8d3dc784477e066531
/ResortManagement/src/com/svs/ensign/resort/dao/IN_VoucherDetailsDAO.java
d9895ed0b33fbe042c0f22084e5bde806eab9efd
[ "Apache-2.0" ]
permissive
anupammaiti/ERP
99bf67f9335a2fea96e525a82866810875bc8695
8c124deb41c4945c7cd55cc331b021eae4100c62
refs/heads/master
2020-08-13T19:30:59.922232
2019-10-09T17:04:58
2019-10-09T17:04:58
215,025,440
1
0
Apache-2.0
2019-10-14T11:26:11
2019-10-14T11:26:10
null
UTF-8
Java
false
false
207
java
package com.svs.ensign.resort.dao; import com.svs.ensign.resort.bean.VocherDetailsBean; public interface IN_VoucherDetailsDAO { public boolean createVoucherDetails(VocherDetailsBean voucherdetails); }
[ "rrkravikiranrrk@gmail.com" ]
rrkravikiranrrk@gmail.com
31d9c20e67a99b265b88fde5e9eeb8a045e813aa
e6be1c458851a19b5f53e86e8505fe07bc5c6014
/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/util/DataTypeTreeDeleteTask.java
00872683871967c542cbe4e182f45c995f12cff4
[ "Apache-2.0", "GPL-1.0-or-later", "GPL-3.0-only", "LicenseRef-scancode-public-domain", "LGPL-2.1-only", "LicenseRef-scancode-unknown-license-reference" ]
permissive
penhoi/ghidra-decompiler
6a950ad56acc467fa4fd771097d068d9785d36e0
151133f957e8fb4172cd6f0f4b750b5948df4c95
refs/heads/master
2020-05-19T16:46:36.863144
2019-07-26T01:17:19
2019-07-26T01:17:19
185,118,431
17
7
Apache-2.0
2019-07-10T10:16:13
2019-05-06T03:36:43
Java
UTF-8
Java
false
false
5,069
java
/* ### * IP: GHIDRA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ghidra.app.plugin.core.datamgr.util; import java.util.*; import java.util.Map.Entry; import docking.widgets.tree.*; import ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin; import ghidra.app.plugin.core.datamgr.DataTypesProvider; import ghidra.app.plugin.core.datamgr.archive.Archive; import ghidra.app.plugin.core.datamgr.tree.*; import ghidra.program.model.data.*; import ghidra.util.exception.CancelledException; import ghidra.util.task.Task; import ghidra.util.task.TaskMonitor; public class DataTypeTreeDeleteTask extends Task { private Map<ArchiveNode, List<GTreeNode>> nodesByArchive; private DataTypeManagerPlugin plugin; public DataTypeTreeDeleteTask(DataTypeManagerPlugin plugin, List<GTreeNode> nodes) { super("Delete Nodes", true, true, true); this.plugin = plugin; nodes = filterList(nodes); nodesByArchive = groupNodeByArchive(nodes); } private Map<ArchiveNode, List<GTreeNode>> groupNodeByArchive(List<GTreeNode> nodes) { Map<ArchiveNode, List<GTreeNode>> archiveNodeMap = new HashMap<>(); for (GTreeNode node : nodes) { ArchiveNode archiveNode = ((DataTypeTreeNode) node).getArchiveNode(); List<GTreeNode> archiveNodeList = archiveNodeMap.get(archiveNode); if (archiveNodeList == null) { archiveNodeList = new ArrayList<>(); archiveNodeMap.put(archiveNode, archiveNodeList); } archiveNodeList.add(node); } return archiveNodeMap; } private List<GTreeNode> filterList(List<GTreeNode> nodeList) { Set<GTreeNode> nodeSet = new HashSet<>(nodeList); List<GTreeNode> filteredList = new ArrayList<>(); for (GTreeNode node : nodeSet) { if (!containsAncestor(nodeSet, node)) { filteredList.add(node); } } return filteredList; } private boolean containsAncestor(Set<GTreeNode> nodeSet, GTreeNode node) { GTreeNode parent = node.getParent(); if (parent == null) { return false; } if (nodeSet.contains(parent)) { return true; } return containsAncestor(nodeSet, parent); } @Override public void run(TaskMonitor monitor) { int total = 0; for (List<GTreeNode> list : nodesByArchive.values()) { total += list.size(); } monitor.initialize(total); // // Note: we collapse the node before performing this work because there is a // potential for a large number of events to be generated. Further, if the // given archive node has many children (like 10s of thousands), then the // copious events generated herein could lock the UI. By closing the node, // the tree is not invalidating/validating its cache as a result of these // events. // DataTypesProvider provider = plugin.getProvider(); DataTypeArchiveGTree tree = provider.getGTree(); GTreeState treeState = tree.getTreeState(); try { collapseArchives(tree); Set<Entry<ArchiveNode, List<GTreeNode>>> entries = nodesByArchive.entrySet(); for (Entry<ArchiveNode, List<GTreeNode>> entry : entries) { List<GTreeNode> list = entry.getValue(); ArchiveNode node = entry.getKey(); deleteNodes(node, list, monitor); } } catch (CancelledException e) { // nothing to report } finally { tree.restoreTreeState(treeState); } } private void collapseArchives(DataTypeArchiveGTree tree) { GTreeRootNode root = tree.getRootNode(); List<GTreeNode> children = root.getAllChildren(); for (GTreeNode archive : children) { tree.collapseAll(archive); } } private void deleteNodes(ArchiveNode archiveNode, List<GTreeNode> list, TaskMonitor monitor) throws CancelledException { Archive archive = archiveNode.getArchive(); DataTypeManager dataTypeManager = archive.getDataTypeManager(); int transactionID = dataTypeManager.startTransaction("Delete Category/DataType"); try { for (GTreeNode node : list) { monitor.checkCanceled(); removeNode(node, monitor); monitor.incrementProgress(1); } } finally { dataTypeManager.endTransaction(transactionID, true); } } private void removeNode(GTreeNode node, TaskMonitor monitor) { if (node instanceof DataTypeNode) { DataTypeNode dataTypeNode = (DataTypeNode) node; DataType dataType = dataTypeNode.getDataType(); DataTypeManager dataTypeManager = dataType.getDataTypeManager(); dataTypeManager.remove(dataType, monitor); } else { CategoryNode categoryNode = (CategoryNode) node; Category category = categoryNode.getCategory(); category.getParent().removeCategory(category.getName(), monitor); } } }
[ "46821332+nsadeveloper789@users.noreply.github.com" ]
46821332+nsadeveloper789@users.noreply.github.com