blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
656f7a265ba3e3942152c9aea66c7984c209c530 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/com/vaadin/tests/components/treetable/MinimalWidthColumnsTest.java | 427d0542db53fb645fd621650781809ebd772c1b | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 374 | java | package com.vaadin.tests.components.treetable;
import com.vaadin.tests.tb3.MultiBrowserTest;
import org.junit.Test;
public class MinimalWidthColumnsTest extends MultiBrowserTest {
@Test
public void testFor1pxDifference() throws Exception {
openTestURL();
waitUntilLoadingIndicatorNotVisible();
compareScreen("onepixdifference");
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
1c4e6010dc7958560aca384ed3777fd4772c7629 | 9501126f7c3136d5c61f948007c686fae54d53ae | /src/main/java/nextg/bookstore/repository/ClientRepository.java | 74d4c6a4f993a6c101b97aa13798cbdd4b75e1df | [] | no_license | Roman2048/bookstore | 6d60ff40bd2583e61599c1f0fdb880b4fda3a959 | 229a3848abf650a08b0980d2798084e91bf91da5 | refs/heads/master | 2021-03-01T15:31:46.874175 | 2020-03-09T18:58:35 | 2020-03-09T18:58:35 | 245,795,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package nextg.bookstore.repository;
import nextg.bookstore.domain.Client;
import org.springframework.data.repository.CrudRepository;
public interface ClientRepository extends CrudRepository<Client, Long> {
}
| [
"roman.k.person@gmail.com"
] | roman.k.person@gmail.com |
65603ca0d8da8bf54280c822ddba1fd11d1cfabb | db66c8c640e7249b4b7e78afc8016624634d28fa | /src/com/offerCollections/PermutationSolution.java | 02505cdb0940fff0dcf1084abbcb2e930954cbe4 | [] | no_license | Jondamer/J_Coding_Interviews | 4dd99c1675fb8df17b20d328504aaa59323e4751 | 6745f44f4b10bc294bf4bbbf0bb76a5ee086a925 | refs/heads/master | 2020-04-29T14:20:26.399749 | 2019-03-18T06:02:23 | 2019-03-18T06:02:23 | 176,193,140 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,386 | java | package com.offerCollections;
import java.util.ArrayList;
import java.util.Collections;
/**
* 输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,
* bca,cab和cba。
*
* @author zhengzhentao
*
*/
public class PermutationSolution {
public PermutationSolution() {
// TODO Auto-generated constructor stub
}
public static ArrayList<String> Permutation(String str) {
ArrayList<String> list = new ArrayList<String>();
char[] ch = str.toCharArray();
Permu(ch, 0, list);
Collections.sort(list);
return list;
}
public static void Permu(char[] str, int i, ArrayList<String> list) {
if (str == null) {
return;
}
if (i == str.length - 1) {
if (list.contains(String.valueOf(str))) {
return;
}
list.add(String.valueOf(str));
} else {
for (int j = i; j < str.length; j++) {
char temp = str[j];
str[j] = str[i];
str[i] = temp;
Permu(str, i + 1, list);
temp = str[j];
str[j] = str[i];
str[i] = temp;
}
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
String str = "abcd";
ArrayList<String> al = Permutation(str);
for (String string : al) {
System.out.println(string);
}
}
}
| [
"jondamer@gmail.com"
] | jondamer@gmail.com |
e3e0668c6fe550f09478aac69110481f485aa444 | 8720bff328ccb94858729250cdd3106f7e213e78 | /nucMed/Filtros.java | 20b339a26e46d0275f223b7c752b342288f10e04 | [] | no_license | mvscosta/NucMed | 6d33d822abe1d52a3a6c2001b8ab574c7f946e1d | c1d6c3c2c7a0cb3999daea726a049efde8f62664 | refs/heads/master | 2021-01-20T14:55:25.931084 | 2017-05-10T02:17:11 | 2017-05-10T02:19:49 | 90,691,593 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,742 | java | /**
*
*/
package nucMed;
import funcoesNM.Complexo;
import funcoesNM.Funcoes;
/**
* @author Marcus Vin�cius da Silva Costa
*
* @version <b>1.7</b>
*
*/
public class Filtros {
private int tamImg;
private float fc;
private float N;
private int tipoFiltro;
/**
* Constructor da classe Filtros
*
* Inicaliza as variaveis utilizadas na classe.
*
*/
public Filtros(float fc,float N, int tipoFiltro, int tamImg) {
this.tamImg = tamImg;
this.fc = fc;
this.N= N;
this.tipoFiltro = tipoFiltro;
}
public Complexo[] gera_filtro_rampa() {
Complexo filter_rampa[] = new Complexo[(int) (tamImg)];
float f;// , fc;
int aux;
// fc = Float.parseFloat(tfParametro1.getText());
for (aux = 0; aux < tamImg; aux++) {
f = ((float) aux / (float) tamImg);
if (tipoFiltro == Funcoes.FILTRO_RAMPA)
if (fc < f)
if (Funcoes.filtroCorte)
filter_rampa[aux] = new Complexo(0.0, 0.0);
else
filter_rampa[aux] = new Complexo((f), 0.0);
else
filter_rampa[aux] = new Complexo((f), 0.0);
else
filter_rampa[aux] = new Complexo((f), 0.0);
}
/*
* if (execucao_grafica) { setSize(JANELA_RAMPA_WIDTH,
* JANELA_RAMPA_HEIGHT); btnReconstruir.setLocation(JANELA_RAMPA_WIDTH -
* 160, JANELA_RAMPA_HEIGHT - 60); btnReconstruir.setVisible(true); }
*/
return filter_rampa;
}
/**
* Função que calcula o vetor para o filtro.
*
* @return Retorna um vetor de complexo.
*/
public Complexo[] gera_filtro_butterworth() {
Complexo filter_butter[] = new Complexo[(int) (tamImg)];
float f, c1;// ,fc
int aux;// , N;
// N = Integer.parseInt(tfParametro1.getText());
// fc = Float.parseFloat(tfParametro2.getText());
for (aux = 0; aux < tamImg; aux++) {
f = (float) aux / tamImg;
c1 = (float) ((Math.pow((f / fc), (N * 2))) + 1);
filter_butter[aux] = new Complexo((1 / c1), 0.0);
}
/*
* if (execucao_grafica) { setSize(JANELA_BUTTERWORTH_WIDTH,
* JANELA_BUTTERWORTH_HEIGHT);
* btnReconstruir.setLocation(JANELA_BUTTERWORTH_WIDTH - 160,
* JANELA_BUTTERWORTH_HEIGHT - 60); btnReconstruir.setVisible(true); }
*/
return filter_butter;
}
/**
* Função que calcula o vetor para o filtro.
*
* @return Retorna um vetor de complexo.
*/
public Complexo[] gera_filtro_shepp_logan() {
Complexo filter_shepp[] = new Complexo[(int) (tamImg)];
float f, c1, c2;// , fc
int aux;
// fc = Float.parseFloat(tfParametro1.getText());
for (aux = 0; aux < tamImg; aux++) {
f = (float) aux / tamImg;
c1 = (float) (Math.PI * f) / (2 * fc);
c2 = (float) Math.sin(c1);
if (fc < f)
if (Funcoes.filtroCorte)
filter_shepp[aux] = new Complexo(0.0, 0.0);
else
filter_shepp[aux] = new Complexo((c2 / c1), 0.0);
else
filter_shepp[aux] = new Complexo((c2 / c1), 0.0);
filter_shepp[0] = new Complexo(1.0, 0.0);
}
/*
* if (execucao_grafica) { setSize(JANELA_SHEPP_LOGAN_WIDTH,
* JANELA_SHEPP_LOGAN_HEIGHT);
* btnReconstruir.setLocation(JANELA_SHEPP_LOGAN_WIDTH - 160,
* JANELA_SHEPP_LOGAN_HEIGHT - 60); btnReconstruir.setVisible(true); }
*/
return filter_shepp;
}
/**
* Função que calcula o vetor para o filtro.
*
* @return Retorna um vetor de complexo.
*/
public Complexo[] gera_filtro_hamming() {
Complexo filter_hamming[] = new Complexo[(int) (tamImg)];
float f, c1, c2;// , fc
int aux;
// fc = Float.parseFloat(tfParametro1.getText());
for (aux = 0; aux < tamImg; aux++) {
f = (float) aux / tamImg;
c1 = (float) (Math.PI * f) / fc;
c2 = (float) (0.46 * Math.cos(c1));
if (fc < f)
if (Funcoes.filtroCorte)
filter_hamming[aux] = new Complexo(0.0, 0.0);
else
filter_hamming[aux] = new Complexo(
(Funcoes.CONST_FILTRO_HAMMING + c2), 0.0);
else
filter_hamming[aux] = new Complexo(
(Funcoes.CONST_FILTRO_HAMMING + c2), 0.0);
}
/*
* if (execucao_grafica) { setSize(JANELA_HAMMING_WIDTH,
* JANELA_HAMMING_HEIGHT);
* btnReconstruir.setLocation(JANELA_HAMMING_WIDTH - 160,
* JANELA_HAMMING_HEIGHT - 60); btnReconstruir.setVisible(true); }
*/
return filter_hamming;
}
}
| [
"vinicius@mc2tech.com.br"
] | vinicius@mc2tech.com.br |
898da8467e5f1794d81512cde4cfa1e7215e696d | f6fb61f01d5a4600d527c9fe180339db4d47bce2 | /app/src/main/java/com/example/chenhangye/audiowavecut/Audio/recorder/RecordState.java | 9fcbd87e317725be7a102100901dbf1b8d443016 | [] | no_license | jaosnshen/AudioWaveCut | d544e98aad81c2a9e87facdc9cb204e8b98f7818 | c863d8f99f9717be77aa64b055fcced0c1e17c5a | refs/heads/master | 2021-01-24T11:09:36.714671 | 2016-10-07T13:16:10 | 2016-10-07T13:16:10 | 70,234,848 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 175 | java | package com.example.chenhangye.audiowavecut.Audio.recorder;
/**
* Created by chenhangye on 2016/10/2.
*/
public enum RecordState {
Recording,
Paused,
Stoped
}
| [
"291015026@gmail.com"
] | 291015026@gmail.com |
12b29aa4eda2ba3be0c33d06d47b374eca0274c4 | 3064913ffda3254d4f4c477bbfd83aa3f2fabcc9 | /src/Eggs.java | 8a3f46f23b21ef2c3e93da85a889307c73174ddc | [] | no_license | Java-Raker/Chapter2 | 7af953d04217c91ece4d9bdfc2014722e8ef9784 | 1ec243c227bff416db14b49ea30b5a655d6d2ed9 | refs/heads/master | 2020-07-14T00:04:01.472631 | 2019-09-06T14:15:47 | 2019-09-06T14:15:47 | 205,185,045 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 895 | java | import javax.swing.*;
public class Eggs {
public static void main(String[] args){
final double COST_OF_A_DOZEN = 3.25;
final double COST_OF_A_EGG = .45;
int dozens;
int looseEggs;
int boughtEggs;
double totalCost;
String userInput;
userInput = JOptionPane.showInputDialog(null, "How many eggs would you like to buy?",
"Message Dialog", JOptionPane.INFORMATION_MESSAGE);
boughtEggs = Integer.parseInt(userInput);
dozens = boughtEggs / 12;
looseEggs = boughtEggs % 12;
totalCost = dozens * COST_OF_A_DOZEN + looseEggs * COST_OF_A_EGG;
JOptionPane.showMessageDialog(null, "You ordered " + boughtEggs + " eggs." +
"That's " + dozens + " Dozen at $3.25 per dozen and " + looseEggs + " Loose eggs at 45 cents each for a total of " + totalCost + ".");
}
}
| [
"er306632@students.davenport.k12.ia.us"
] | er306632@students.davenport.k12.ia.us |
80d0c9e316c3488d189fee69b1384baef8b701c5 | d3e395e8dc773c301d318f68ae8650f2b16533ac | /src/main/java/com/microsoft/bingads/internal/HttpClientWebServiceCaller.java | 4fd221d20066ccc054b69292cf860641253922ed | [
"MIT"
] | permissive | shyTNT/BingAds-Java-SDK | c4488dfc28b826cf0a71fa94eac5c130b1bd7562 | c06261c70c2b18edc9424a42fc3624dc0ef1ec94 | refs/heads/master | 2021-01-18T04:34:16.377404 | 2016-04-28T11:16:24 | 2016-04-28T11:16:24 | 42,108,089 | 0 | 0 | null | 2015-09-08T11:26:11 | 2015-09-08T11:26:11 | null | UTF-8 | Java | false | false | 1,247 | java | package com.microsoft.bingads.internal;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
class HttpClientWebServiceCaller implements WebServiceCaller {
@Override
public HttpResponse post(URL requestUrl, List<NameValuePair> formValues) throws IOException {
HttpClient client = null;
try {
client = new DefaultHttpClient();
final HttpPost httpPost = new HttpPost(requestUrl.toURI());
final UrlEncodedFormEntity requestEntity = new UrlEncodedFormEntity(formValues, "UTF-8");
httpPost.setEntity(requestEntity);
return client.execute(httpPost);
} catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
} finally {
if (client != null) {
client.getConnectionManager().shutdown();
}
}
}
}
| [
"bing_ads_sdk@microsoft.com"
] | bing_ads_sdk@microsoft.com |
7cbd48be7b23b55589f613f13a724b36ba2db274 | 07ac433d94ef68715b5f18b834ac4dc8bb5b8261 | /Implementation/jpf-git/jpf-core/src/main/gov/nasa/jpf/vm/SystemTime.java | 6ae1074a5f752a267f9e9240a76a48ffca970b16 | [
"Apache-2.0",
"MIT"
] | permissive | shrBadihi/ARDiff_Equiv_Checking | a54fb2908303b14a5a1f2a32b69841b213b2c999 | e8396ae4af2b1eda483cb316c51cd76949cd0ffc | refs/heads/master | 2023-04-03T08:40:07.919031 | 2021-02-05T04:44:34 | 2021-02-05T04:44:34 | 266,228,060 | 4 | 4 | MIT | 2020-11-26T01:34:08 | 2020-05-22T23:39:32 | Java | UTF-8 | Java | false | false | 1,356 | java | /*
* Copyright (C) 2014, United States Government, as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All rights reserved.
*
* The Java Pathfinder core (jpf-core) platform is 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 gov.nasa.jpf.vm;
import gov.nasa.jpf.Config;
/**
* simple delegating TimeModel implementation that just returns System time.
* While elapsed time is not path sensitive, it is at least strictly increasing
* along any given path
*/
public class SystemTime implements TimeModel {
public SystemTime(VM vm, Config conf){
// we don't need these, but it speeds up VM initialization
}
@Override
public long currentTimeMillis() {
return System.currentTimeMillis();
}
@Override
public long nanoTime() {
return System.nanoTime();
}
}
| [
"shr.badihi@gmail.com"
] | shr.badihi@gmail.com |
be04c0d35af39269c50bb65bb0b95a2a2e9f34bb | 8efbf453a82b79e9388d17eaae9886a98f310b32 | /app/src/main/java/controllers/adapters/SearchAdapter.java | 1d8174a67f30c341b279c8edfb5bb2ffcd9850c1 | [] | no_license | RayanYanat/MyNews2.0 | 3674501d29e2b6569461f5b96ae6a3d3506f3862 | 65292f4cdf9b5188d60c7ada871dee0be6c000b7 | refs/heads/master | 2023-05-28T13:16:32.246907 | 2021-06-23T13:06:30 | 2021-06-23T13:06:30 | 275,803,795 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,465 | java | package controllers.adapters;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.example.mynews.R;
import java.util.List;
import models.search.Doc;
public class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.ImageViewHolder> {
private List<Doc> mData;
public SearchAdapter(List<Doc> data) {
mData = data;
}
@NonNull
@Override
public SearchAdapter.ImageViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.news_item, parent, false);
return new SearchAdapter.ImageViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ImageViewHolder holder, int position) {
Doc topSortiesItem =mData.get(position);
holder.newsTittle.setText(topSortiesItem.getHeadline().getMain());
holder.newsDate.setText(topSortiesItem.getPubDate());
holder.newsSection.setText(topSortiesItem.getSubsectionName());
if (topSortiesItem.getMultimedia()!= null && topSortiesItem.getMultimedia().size() > 0)
Glide.with(holder.itemView.getContext()).load("https://static01.nyt.com/" + topSortiesItem.getMultimedia().get(0).getUrl()).into(holder.newsImage);
}
@Override
public int getItemCount() {
int itemCount=0;
if (mData != null) itemCount = mData.size();
return itemCount;
}
public void setResults(List<Doc> topStoriesResults) {
this.mData=topStoriesResults;
notifyDataSetChanged();
}
static class ImageViewHolder extends RecyclerView.ViewHolder {
ImageView newsImage;
TextView newsTittle;
TextView newsDate;
TextView newsSection;
ImageViewHolder(View itemView) {
super(itemView);
newsImage = itemView.findViewById(R.id.news_item_image);
newsTittle = itemView.findViewById(R.id.news_item_title);
newsDate = itemView.findViewById(R.id.news_item_date);
newsSection = itemView.findViewById(R.id.news_item_section);
}
}
public Doc getUrl(int position){
List<Doc> result = mData;
return result.get(position);
}
}
| [
"rayan.yanat@gmail.com"
] | rayan.yanat@gmail.com |
a691ccde00c8c5c9f8e9dd1def8e815bc972f991 | 5fc7f9dd53dfa3d493ee9fb843ad2b1a2a74a4df | /gemma-web/src/test/java/ubic/gemma/web/services/rest/AnalysisResultSetsWebServiceTest.java | df9e2ef6f6a6edbae362e20f4fe9b9d7c76daeba | [
"Apache-2.0"
] | permissive | wagaskar/Gemma | 9630d2506cbc4ceda21eeec19aecaab7ed44889b | 28b4d663cf0f73123ffe029bbecd8d6755babc95 | refs/heads/master | 2023-08-28T07:31:08.509444 | 2021-10-28T21:42:50 | 2021-10-28T21:42:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,216 | java | package ubic.gemma.web.services.rest;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockHttpServletResponse;
import ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysis;
import ubic.gemma.model.analysis.expression.diff.DifferentialExpressionAnalysisResult;
import ubic.gemma.model.analysis.expression.diff.ExpressionAnalysisResultSet;
import ubic.gemma.model.analysis.expression.diff.ExpressionAnalysisResultSetValueObject;
import ubic.gemma.model.common.description.DatabaseEntry;
import ubic.gemma.model.common.description.ExternalDatabase;
import ubic.gemma.model.expression.arrayDesign.ArrayDesign;
import ubic.gemma.model.expression.designElement.CompositeSequence;
import ubic.gemma.model.expression.experiment.ExpressionExperiment;
import ubic.gemma.persistence.service.analysis.expression.diff.DifferentialExpressionAnalysisService;
import ubic.gemma.persistence.service.analysis.expression.diff.ExpressionAnalysisResultSetService;
import ubic.gemma.persistence.service.common.description.DatabaseEntryService;
import ubic.gemma.persistence.service.expression.arrayDesign.ArrayDesignService;
import ubic.gemma.persistence.service.expression.experiment.ExpressionExperimentService;
import ubic.gemma.web.services.rest.util.MalformedArgException;
import ubic.gemma.web.services.rest.util.ResponseDataObject;
import ubic.gemma.web.services.rest.util.args.*;
import ubic.gemma.web.util.BaseSpringWebTest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.*;
public class AnalysisResultSetsWebServiceTest extends BaseSpringWebTest {
@Autowired
private AnalysisResultSetsWebService service;
@Autowired
private ExpressionExperimentService expressionExperimentService;
@Autowired
private DifferentialExpressionAnalysisService differentialExpressionAnalysisService;
@Autowired
private ExpressionAnalysisResultSetService expressionAnalysisResultSetService;
@Autowired
private DatabaseEntryService databaseEntryService;
@Autowired
private ArrayDesignService arrayDesignService;
/* fixtures */
private ArrayDesign arrayDesign;
private CompositeSequence probe;
private ExpressionExperiment ee;
private DifferentialExpressionAnalysis dea;
private ExpressionAnalysisResultSet dears;
private DifferentialExpressionAnalysisResult dear;
private DatabaseEntry databaseEntry;
private DatabaseEntry databaseEntry2;
@Before
public void setUp() {
ee = getTestPersistentBasicExpressionExperiment();
dea = new DifferentialExpressionAnalysis();
dea.setExperimentAnalyzed( ee );
dea = differentialExpressionAnalysisService.create( dea );
dears = new ExpressionAnalysisResultSet();
dears.setAnalysis( dea );
dears = expressionAnalysisResultSetService.create( dears );
arrayDesign = testHelper.getTestPersistentArrayDesign( 1, true, true );
probe = arrayDesign.getCompositeSequences().stream().findFirst().orElse( null );
assertNotNull( probe );
dear = DifferentialExpressionAnalysisResult.Factory.newInstance();
dear.setPvalue( 1.0 );
dear.setCorrectedPvalue( 0.0001 );
dear.setResultSet( dears );
dear.setProbe( probe );
dears.setResults( Collections.singleton( dear ) );
expressionAnalysisResultSetService.update( dears );
ExternalDatabase geo = externalDatabaseService.findByName( "GEO" );
assertNotNull( geo );
assertEquals( geo.getName(), "GEO" );
databaseEntry = DatabaseEntry.Factory.newInstance();
databaseEntry.setAccession( "GEO123123" );
databaseEntry.setExternalDatabase( geo );
databaseEntry = databaseEntryService.create( databaseEntry );
databaseEntry2 = DatabaseEntry.Factory.newInstance();
databaseEntry2.setAccession( "GEO1213121" );
databaseEntry2.setExternalDatabase( geo );
databaseEntry2 = databaseEntryService.create( databaseEntry2 );
}
@After
public void tearDown() {
expressionAnalysisResultSetService.remove( dears );
differentialExpressionAnalysisService.remove( dea );
expressionExperimentService.remove( ee );
databaseEntryService.remove( databaseEntry2 );
arrayDesignService.remove( arrayDesign );
}
@Test
public void testFindAllWhenNoDatasetsAreProvidedThenReturnLatestAnalysisResults() {
HttpServletResponse response = new MockHttpServletResponse();
ResponseDataObject<?> result = service.findAll( null,
null,
FilterArg.valueOf( "" ),
OffsetArg.valueOf( "0" ),
LimitArg.valueOf( "10" ),
SortArg.valueOf( "+id" ),
response );
assertEquals( response.getStatus(), 200 );
//noinspection unchecked
List<ExpressionAnalysisResultSetValueObject> results = ( List<ExpressionAnalysisResultSetValueObject> ) result.getData();
assertEquals( results.size(), 1 );
// individual analysis results are not exposed from this endpoint
assertNull( results.get( 0 ).getResults() );
}
@Test
public void testFindAllWithFilters() {
HttpServletResponse response = new MockHttpServletResponse();
ResponseDataObject<?> result = service.findAll( null,
null,
FilterArg.valueOf( "id = " + this.dears.getId() ),
OffsetArg.valueOf( "0" ),
LimitArg.valueOf( "10" ),
SortArg.valueOf( "+id" ),
response );
assertEquals( response.getStatus(), 200 );
//noinspection unchecked
List<ExpressionAnalysisResultSetValueObject> results = ( List<ExpressionAnalysisResultSetValueObject> ) result.getData();
assertEquals( results.size(), 1 );
// individual analysis results are not exposed from this endpoint
assertNull( results.get( 0 ).getResults() );
}
@Test
public void testFindAllWithFiltersAndCollections() {
HttpServletResponse response = new MockHttpServletResponse();
ResponseDataObject<?> result = service.findAll( null,
null,
FilterArg.valueOf( "id in (" + this.dears.getId() + ")" ),
OffsetArg.valueOf( "0" ),
LimitArg.valueOf( "10" ),
SortArg.valueOf( "+id" ),
response );
assertEquals( response.getStatus(), 200 );
//noinspection unchecked
List<ExpressionAnalysisResultSetValueObject> results = ( List<ExpressionAnalysisResultSetValueObject> ) result.getData();
assertEquals( results.size(), 1 );
// individual analysis results are not exposed from this endpoint
assertNull( results.get( 0 ).getResults() );
}
@Test
public void testFindAllWithInvalidFilters() {
HttpServletResponse response = new MockHttpServletResponse();
assertThrows( BadRequestException.class, () -> service.findAll( null,
null,
FilterArg.valueOf( "id2 = " + this.dears.getId() ),
OffsetArg.valueOf( "0" ),
LimitArg.valueOf( "10" ),
SortArg.valueOf( "+id" ),
response ) );
}
@Test
public void testFindAllWithDatasetIdsThenReturnLatestAnalysisResults() {
HttpServletResponse response = new MockHttpServletResponse();
DatasetArrayArg datasets = DatasetArrayArg.valueOf( String.valueOf( ee.getId() ) );
ResponseDataObject<?> result = service.findAll(
datasets,
null,
FilterArg.valueOf( "" ),
OffsetArg.valueOf( "0" ),
LimitArg.valueOf( "10" ),
SortArg.valueOf( "+id" ),
response );
assertEquals( response.getStatus(), 200 );
//noinspection unchecked
List<ExpressionAnalysisResultSetValueObject> results = ( List<ExpressionAnalysisResultSetValueObject> ) result.getData();
assertEquals( results.get( 0 ).getId(), dears.getId() );
}
@Test
public void testFindAllWhenDatasetDoesNotExistThenRaise404NotFound() {
HttpServletResponse response = new MockHttpServletResponse();
NotFoundException e = assertThrows( NotFoundException.class, () -> service.findAll(
DatasetArrayArg.valueOf( "GEO123124" ),
null,
null,
OffsetArg.valueOf( "0" ),
LimitArg.valueOf( "10" ),
SortArg.valueOf( "+id" ),
response ) );
assertEquals( e.getResponse().getStatus(), Response.Status.NOT_FOUND.getStatusCode() );
}
@Test
public void testFindAllWithDatabaseEntriesThenReturnLatestAnalysisResults() {
HttpServletResponse response = new MockHttpServletResponse();
ResponseDataObject<?> result = service.findAll( null,
DatabaseEntryArrayArg.valueOf( ee.getAccession().getAccession() ),
FilterArg.valueOf( "" ),
OffsetArg.valueOf( "0" ),
LimitArg.valueOf( "10" ),
SortArg.valueOf( "+id" ),
response );
assertEquals( response.getStatus(), 200 );
//noinspection unchecked
List<ExpressionAnalysisResultSetValueObject> results = ( List<ExpressionAnalysisResultSetValueObject> ) result.getData();
assertEquals( results.get( 0 ).getId(), dears.getId() );
}
@Test
public void testFindAllWhenDatabaseEntryDoesNotExistThenRaise404NotFound() {
HttpServletResponse response = new MockHttpServletResponse();
NotFoundException e = assertThrows( NotFoundException.class, () -> service.findAll(
null,
DatabaseEntryArrayArg.valueOf( "GEO123124,GEO1213121" ),
null,
OffsetArg.valueOf( "0" ),
LimitArg.valueOf( "10" ),
SortArg.valueOf( "+id" ),
response ) );
assertEquals( e.getResponse().getStatus(), Response.Status.NOT_FOUND.getStatusCode() );
}
@Test
public void testFindByIdThenReturn200Success() {
HttpServletResponse response = new MockHttpServletResponse();
ResponseDataObject<?> result = service.findById( ExpressionAnalysisResultSetArg.valueOf( dears.getId().toString() ), false );
assertEquals( response.getStatus(), 200 );
ExpressionAnalysisResultSetValueObject dearsVo = ( ExpressionAnalysisResultSetValueObject ) result.getData();
assertEquals( dearsVo.getId(), dears.getId() );
assertEquals( dearsVo.getAnalysis().getId(), dea.getId() );
assertNotNull( dearsVo.getResults() );
}
@Test
public void testFindByIdWhenExcludeResultsThenReturn200Success() {
HttpServletResponse response = new MockHttpServletResponse();
ResponseDataObject<?> result = service.findById( ExpressionAnalysisResultSetArg.valueOf( dears.getId().toString() ), true );
assertEquals( response.getStatus(), 200 );
ExpressionAnalysisResultSetValueObject dearsVo = ( ExpressionAnalysisResultSetValueObject ) result.getData();
assertEquals( dearsVo.getId(), dears.getId() );
assertEquals( dearsVo.getAnalysis().getId(), dea.getId() );
assertNull( dearsVo.getResults() );
}
@Test
public void testFindByIdWhenInvalidIdentifierThenThrowMalformedArgException() {
HttpServletResponse response = new MockHttpServletResponse();
assertThrows( MalformedArgException.class, () -> service.findById( ExpressionAnalysisResultSetArg.valueOf( "alksdok102" ), false ) );
}
@Test
public void testFindByIdWhenResultSetDoesNotExistsThenReturn404NotFoundError() {
long id = 123129L;
HttpServletResponse response = new MockHttpServletResponse();
NotFoundException e = assertThrows( NotFoundException.class, () -> service.findById( ExpressionAnalysisResultSetArg.valueOf( String.valueOf( id ) ), false ) );
assertEquals( e.getResponse().getStatus(), Response.Status.NOT_FOUND.getStatusCode() );
}
@Test
public void testFindByIdToTsv() throws IOException {
HttpServletResponse response = new MockHttpServletResponse();
StreamingOutput result = service.findByIdToTsv( ExpressionAnalysisResultSetArg.valueOf( dears.getId().toString() ), response );
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
result.write( byteArrayOutputStream );
byteArrayOutputStream.toString( StandardCharsets.UTF_8.name() );
// FIXME: I could not find the equivalent of withFirstRecordAsHeader() in the builder API
CSVParser reader = CSVFormat.Builder.create( CSVFormat.TDF.withFirstRecordAsHeader() )
.setSkipHeaderRecord( false )
.setCommentMarker( '#' ).build()
.parse( new InputStreamReader( new ByteArrayInputStream( byteArrayOutputStream.toByteArray() ) ) );
assertEquals( reader.getHeaderNames(), Arrays.asList( "id", "probe_id", "probe_name", "gene_id", "gene_name", "gene_ncbi_id", "gene_official_symbol", "pvalue", "corrected_pvalue", "rank" ) );
CSVRecord record = reader.iterator().next();
assertEquals( record.get( "pvalue" ), "1E0" );
assertEquals( record.get( "corrected_pvalue" ), "1E-4" );
// rank is null, it should appear as an empty string
assertEquals( record.get( "rank" ), "" );
}
} | [
"poirigui@msl.ubc.ca"
] | poirigui@msl.ubc.ca |
b2f2effe48a22a22913f2610a7df456f79e86ad7 | 994bb312ea4ac99bc02dbbda0d7b58ac239cfcac | /app/src/main/java/com/rdzero/nuproject/beans/NuSummaryObjBean.java | 7aecb6222df4e9ccbed5e0872b9ff834c17e0917 | [] | no_license | ricardohnn/NuProject | d85b82cfb647faedf497cb0f334c1e81c3fe630c | e84babfd11c2b4303136d0ba535ad5d681b16a25 | refs/heads/master | 2021-01-10T05:09:24.366227 | 2016-01-03T17:47:56 | 2016-01-03T17:47:56 | 47,898,348 | 0 | 0 | null | 2015-12-13T01:19:26 | 2015-12-12T23:12:35 | Java | UTF-8 | Java | false | false | 2,690 | java | package com.rdzero.nuproject.beans;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
public class NuSummaryObjBean {
@SerializedName("due_date")
private Date dueDate;
@SerializedName("close_date")
private Date closeDate;
@SerializedName("past_balance")
private Long pastBalance;
@SerializedName("total_balance")
private Long totalBalance;
@SerializedName("interest")
private Long interest;
@SerializedName("total_cumulative")
private Long totalCumulative;
@SerializedName("paid")
private Long paid;
@SerializedName("minimum_payment")
private Long minimumPayment;
@SerializedName("open_date")
private Date openDate;
public NuSummaryObjBean(Date dueDate, Date closeDate, Long pastBalance, Long totalBalance, Long interest, Long totalCumulative, Long paid, Long minimumPayment, Date openDate) {
this.dueDate = dueDate;
this.closeDate = closeDate;
this.pastBalance = pastBalance;
this.totalBalance = totalBalance;
this.interest = interest;
this.totalCumulative = totalCumulative;
this.paid = paid;
this.minimumPayment = minimumPayment;
this.openDate = openDate;
}
public Date getDueDate() {
return dueDate;
}
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
public Date getCloseDate() {
return closeDate;
}
public void setCloseDate(Date closeDate) {
this.closeDate = closeDate;
}
public Long getPastBalance() {
return pastBalance;
}
public void setPastBalance(Long pastBalance) {
this.pastBalance = pastBalance;
}
public Long getTotalBalance() {
return totalBalance;
}
public void setTotalBalance(Long totalBalance) {
this.totalBalance = totalBalance;
}
public Long getInterest() {
return interest;
}
public void setInterest(Long interest) {
this.interest = interest;
}
public Long getTotalCumulative() {
return totalCumulative;
}
public void setTotalCumulative(Long totalCumulative) {
this.totalCumulative = totalCumulative;
}
public Long getPaid() {
return paid;
}
public void setPaid(Long paid) {
this.paid = paid;
}
public Long getMinimumPayment() {
return minimumPayment;
}
public void setMinimumPayment(Long minimumPayment) {
this.minimumPayment = minimumPayment;
}
public Date getOpenDate() {
return openDate;
}
public void setOpenDate(Date openDate) {
this.openDate = openDate;
}
}
| [
"ricardohnn@gmail.com"
] | ricardohnn@gmail.com |
f2ee6fea3d002fe3d63cf3878480d046d4e35b7f | 88239f2a63aab14acdc6625ff7c1a42caba7326c | /src/main/java/web/demo/config/spring/WebConfigurer.java | f4e6c7dea5b1d9116239dce61d36c8dabe89f307 | [] | no_license | sunc901008/web-demo | 359c1427364a0bfc7b4864af6d5e34e2d47d7724 | 897b78f47505569db70deca69d9226c1e142541f | refs/heads/master | 2020-09-11T02:14:37.565209 | 2019-11-20T02:13:28 | 2019-11-20T02:13:28 | 221,907,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,219 | java | package web.demo.config.spring;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
* @author sunc
* @date 2019/11/10 19:57
* @description WebConfigurer
*/
@Configuration
public class WebConfigurer implements WebMvcConfigurer {
private final TenantHandlerInterceptor tenantHandlerInterceptor;
@Autowired
public WebConfigurer(TenantHandlerInterceptor tenantHandlerInterceptor) {
this.tenantHandlerInterceptor = tenantHandlerInterceptor;
}
/**
* 配置静态资源, 如 html,js,css
*
* @param registry registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
}
/**
* 注册拦截器
*
* @param registry registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(tenantHandlerInterceptor).addPathPatterns("/**");
}
} | [
"sunc@openscanner.cn"
] | sunc@openscanner.cn |
7dc281c3724b8ce2eebaf40e711c47761e7e183b | c885ef92397be9d54b87741f01557f61d3f794f3 | /tests-without-trycatch/JacksonDatabind-111/com.fasterxml.jackson.databind.deser.std.AtomicReferenceDeserializer/BBC-F0-opt-60/20/com/fasterxml/jackson/databind/deser/std/AtomicReferenceDeserializer_ESTest.java | b0ebb57ad922ff486d946739d761c0e8d5487987 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 13,423 | java | /*
* This file was automatically generated by EvoSuite
* Thu Oct 21 13:51:59 GMT 2021
*/
package com.fasterxml.jackson.databind.deser.std;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.cfg.BaseSettings;
import com.fasterxml.jackson.databind.cfg.ConfigOverrides;
import com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig;
import com.fasterxml.jackson.databind.deser.BeanDeserializerFactory;
import com.fasterxml.jackson.databind.deser.DefaultDeserializationContext;
import com.fasterxml.jackson.databind.deser.ValueInstantiator;
import com.fasterxml.jackson.databind.deser.std.AtomicReferenceDeserializer;
import com.fasterxml.jackson.databind.introspect.SimpleMixInResolver;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import com.fasterxml.jackson.databind.jsontype.impl.AsExternalTypeDeserializer;
import com.fasterxml.jackson.databind.jsontype.impl.ClassNameIdResolver;
import com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver;
import com.fasterxml.jackson.databind.type.PlaceholderForType;
import com.fasterxml.jackson.databind.type.ResolvedRecursiveType;
import com.fasterxml.jackson.databind.type.TypeBindings;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.RootNameLookup;
import java.net.Proxy;
import java.util.concurrent.atomic.AtomicReference;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class AtomicReferenceDeserializer_ESTest extends AtomicReferenceDeserializer_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
Class<Proxy.Type> class0 = Proxy.Type.class;
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
ClassNameIdResolver classNameIdResolver0 = new ClassNameIdResolver((JavaType) null, (TypeFactory) null);
AsExternalTypeDeserializer asExternalTypeDeserializer0 = new AsExternalTypeDeserializer((JavaType) null, classNameIdResolver0, "&as0", true, (JavaType) null);
JsonDeserializer<Proxy.Type> jsonDeserializer0 = (JsonDeserializer<Proxy.Type>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer((JavaType) null, valueInstantiator_Base0, asExternalTypeDeserializer0, jsonDeserializer0);
JsonDeserializer<Module> jsonDeserializer1 = (JsonDeserializer<Module>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
AtomicReferenceDeserializer atomicReferenceDeserializer1 = atomicReferenceDeserializer0.withResolved(asExternalTypeDeserializer0, jsonDeserializer1);
assertFalse(atomicReferenceDeserializer1.isCachable());
}
@Test(timeout = 4000)
public void test1() throws Throwable {
PlaceholderForType placeholderForType0 = new PlaceholderForType(5427);
Class<Module> class0 = Module.class;
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
JsonDeserializer<String> jsonDeserializer0 = (JsonDeserializer<String>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer((JavaType) null, valueInstantiator_Base0, (TypeDeserializer) null, jsonDeserializer0);
TypeFactory typeFactory0 = TypeFactory.defaultInstance();
ClassNameIdResolver classNameIdResolver0 = new ClassNameIdResolver(placeholderForType0, typeFactory0);
ResolvedRecursiveType resolvedRecursiveType0 = new ResolvedRecursiveType(class0, (TypeBindings) null);
AsExternalTypeDeserializer asExternalTypeDeserializer0 = new AsExternalTypeDeserializer(resolvedRecursiveType0, classNameIdResolver0, "", true, placeholderForType0);
AtomicReferenceDeserializer atomicReferenceDeserializer1 = new AtomicReferenceDeserializer(resolvedRecursiveType0, valueInstantiator_Base0, asExternalTypeDeserializer0, atomicReferenceDeserializer0);
AtomicReferenceDeserializer atomicReferenceDeserializer2 = atomicReferenceDeserializer1.withResolved((TypeDeserializer) null, atomicReferenceDeserializer0);
assertNotSame(atomicReferenceDeserializer1, atomicReferenceDeserializer2);
}
@Test(timeout = 4000)
public void test2() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer(javaType0, valueInstantiator_Base0, (TypeDeserializer) null, (JsonDeserializer<?>) null);
AtomicReference<Object> atomicReference0 = new AtomicReference<Object>();
AtomicReference<Object> atomicReference1 = atomicReferenceDeserializer0.updateReference(atomicReference0, (Object) null);
assertSame(atomicReference0, atomicReference1);
}
@Test(timeout = 4000)
public void test3() throws Throwable {
Class<Proxy.Type> class0 = Proxy.Type.class;
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
ClassNameIdResolver classNameIdResolver0 = new ClassNameIdResolver((JavaType) null, (TypeFactory) null);
AsExternalTypeDeserializer asExternalTypeDeserializer0 = new AsExternalTypeDeserializer((JavaType) null, classNameIdResolver0, "&as0", true, (JavaType) null);
JsonDeserializer<Proxy.Type> jsonDeserializer0 = (JsonDeserializer<Proxy.Type>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer((JavaType) null, valueInstantiator_Base0, asExternalTypeDeserializer0, jsonDeserializer0);
AtomicReference<Object> atomicReference0 = new AtomicReference<Object>();
TypeBindings typeBindings0 = TypeBindings.emptyBindings();
ResolvedRecursiveType resolvedRecursiveType0 = new ResolvedRecursiveType(class0, typeBindings0);
atomicReference0.getAndSet(resolvedRecursiveType0);
ResolvedRecursiveType resolvedRecursiveType1 = (ResolvedRecursiveType)atomicReferenceDeserializer0.getReferenced(atomicReference0);
assertTrue(resolvedRecursiveType1.isConcrete());
}
@Test(timeout = 4000)
public void test4() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
Class<Proxy.Type> class0 = Proxy.Type.class;
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
ClassNameIdResolver classNameIdResolver0 = new ClassNameIdResolver((JavaType) null, (TypeFactory) null);
AsExternalTypeDeserializer asExternalTypeDeserializer0 = new AsExternalTypeDeserializer((JavaType) null, classNameIdResolver0, "&as0", true, (JavaType) null);
JsonDeserializer<Proxy.Type> jsonDeserializer0 = (JsonDeserializer<Proxy.Type>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer((JavaType) null, valueInstantiator_Base0, asExternalTypeDeserializer0, jsonDeserializer0);
AtomicReference<Object> atomicReference0 = atomicReferenceDeserializer0.getNullValue((DeserializationContext) defaultDeserializationContext_Impl0);
Object object0 = atomicReferenceDeserializer0.getReferenced(atomicReference0);
assertNull(object0);
}
@Test(timeout = 4000)
public void test5() throws Throwable {
Class<Proxy.Type> class0 = Proxy.Type.class;
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
ClassNameIdResolver classNameIdResolver0 = new ClassNameIdResolver((JavaType) null, (TypeFactory) null);
AsExternalTypeDeserializer asExternalTypeDeserializer0 = new AsExternalTypeDeserializer((JavaType) null, classNameIdResolver0, "&as0", true, (JavaType) null);
JsonDeserializer<Proxy.Type> jsonDeserializer0 = (JsonDeserializer<Proxy.Type>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer((JavaType) null, valueInstantiator_Base0, asExternalTypeDeserializer0, jsonDeserializer0);
AtomicReference<Object> atomicReference0 = atomicReferenceDeserializer0.referenceValue((Object) null);
assertEquals("null", atomicReference0.toString());
}
@Test(timeout = 4000)
public void test6() throws Throwable {
Class<Module> class0 = Module.class;
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
JsonDeserializer<String> jsonDeserializer0 = (JsonDeserializer<String>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer((JavaType) null, valueInstantiator_Base0, (TypeDeserializer) null, jsonDeserializer0);
DeserializerFactoryConfig deserializerFactoryConfig0 = new DeserializerFactoryConfig();
BeanDeserializerFactory beanDeserializerFactory0 = new BeanDeserializerFactory(deserializerFactoryConfig0);
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
Object object0 = atomicReferenceDeserializer0.getEmptyValue((DeserializationContext) defaultDeserializationContext_Impl0);
assertEquals("null", object0.toString());
}
@Test(timeout = 4000)
public void test7() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer(javaType0, valueInstantiator_Base0, (TypeDeserializer) null, (JsonDeserializer<?>) null);
// Undeclared exception!
// try {
atomicReferenceDeserializer0.getReferenced((AtomicReference<Object>) null);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("com.fasterxml.jackson.databind.deser.std.AtomicReferenceDeserializer", e);
// }
}
@Test(timeout = 4000)
public void test8() throws Throwable {
Class<Proxy.Type> class0 = Proxy.Type.class;
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(class0);
ClassNameIdResolver classNameIdResolver0 = new ClassNameIdResolver((JavaType) null, (TypeFactory) null);
AsExternalTypeDeserializer asExternalTypeDeserializer0 = new AsExternalTypeDeserializer((JavaType) null, classNameIdResolver0, "com.fasterxml.jackson.databind.deser.std.AtomicReferenceDeserializer", true, (JavaType) null);
JsonDeserializer<Proxy.Type> jsonDeserializer0 = (JsonDeserializer<Proxy.Type>) mock(JsonDeserializer.class, new ViolatedAssumptionAnswer());
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer((JavaType) null, valueInstantiator_Base0, asExternalTypeDeserializer0, jsonDeserializer0);
StdSubtypeResolver stdSubtypeResolver0 = new StdSubtypeResolver();
RootNameLookup rootNameLookup0 = new RootNameLookup();
ConfigOverrides configOverrides0 = new ConfigOverrides();
DeserializationConfig deserializationConfig0 = new DeserializationConfig((BaseSettings) null, stdSubtypeResolver0, (SimpleMixInResolver) null, rootNameLookup0, configOverrides0);
Boolean boolean0 = atomicReferenceDeserializer0.supportsUpdate(deserializationConfig0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test9() throws Throwable {
JavaType javaType0 = TypeFactory.unknownType();
ValueInstantiator.Base valueInstantiator_Base0 = new ValueInstantiator.Base(javaType0);
AtomicReferenceDeserializer atomicReferenceDeserializer0 = new AtomicReferenceDeserializer(javaType0, valueInstantiator_Base0, (TypeDeserializer) null, (JsonDeserializer<?>) null);
// Undeclared exception!
// try {
atomicReferenceDeserializer0.updateReference((AtomicReference<Object>) null, (Object) null);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("com.fasterxml.jackson.databind.deser.std.AtomicReferenceDeserializer", e);
// }
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
a24285cc3bbe024162ba3bb8a3c7d2fdc640471a | e268062d24a05d8bf44e4879424a6fff0b0e9d95 | /platform/src/main/java/fr/gaellalire/vestige/platform/ModuleConfiguration.java | f6f5c07d90b76560ac37a5cfde58356411a120ab | [] | no_license | vestige-java/vestige | 2aaa5f74e1ccbed0a31dca99a12e05569ff7ad46 | 46873654e8d89343b0e78fdb1b56567bc52a4b75 | refs/heads/master | 2022-02-07T13:35:25.303605 | 2022-01-17T21:13:51 | 2022-01-17T21:13:51 | 218,323,228 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,949 | java | /*
* This file is part of Vestige.
*
* Vestige 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.
*
* Vestige 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 Vestige. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.gaellalire.vestige.platform;
import java.io.Serializable;
import java.util.Set;
/**
* @author Gael Lalire
*/
public final class ModuleConfiguration implements Serializable, Comparable<ModuleConfiguration> {
private static final long serialVersionUID = 7556651787547224769L;
private String moduleName;
private Set<String> addExports;
private Set<String> addOpens;
private String targetModuleName;
public ModuleConfiguration(final String moduleName, final Set<String> addExports, final Set<String> addOpens, final String targetModuleName) {
this.moduleName = moduleName;
this.addExports = addExports;
this.addOpens = addOpens;
this.targetModuleName = targetModuleName;
}
public String getModuleName() {
return moduleName;
}
public Set<String> getAddExports() {
return addExports;
}
public Set<String> getAddOpens() {
return addOpens;
}
@Override
public int hashCode() {
return moduleName.hashCode();
}
public String getTargetModuleName() {
return targetModuleName;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ModuleConfiguration)) {
return false;
}
ModuleConfiguration other = (ModuleConfiguration) obj;
if (addExports == null) {
if (other.addExports != null) {
return false;
}
} else if (!addExports.equals(other.addExports)) {
return false;
}
if (addOpens == null) {
if (other.addOpens != null) {
return false;
}
} else if (!addOpens.equals(other.addOpens)) {
return false;
}
if (moduleName == null) {
if (other.moduleName != null) {
return false;
}
} else if (!moduleName.equals(other.moduleName)) {
return false;
}
return true;
}
@Override
public int compareTo(final ModuleConfiguration o) {
return moduleName.compareTo(o.moduleName);
}
}
| [
"gael.lalire@laposte.net"
] | gael.lalire@laposte.net |
ef85989d7e371691d56ef86b0d9c2d19e817c7e5 | 8d7150f0294fd680bf4974db3835a2a6922b25e2 | /app/src/main/java/pl/marchuck/catchemall/data/BeaconsInfo.java | b9b7f1b8792e279928c3d80c975ef3c570419c72 | [] | no_license | Marchuck/CatchEmAll | 08d6a2efc3ec990fe33acc2bc0e7554224a2a883 | b33180d599fc204fb84847df11269a0964cedc7a | refs/heads/master | 2021-01-17T20:32:04.760309 | 2016-07-24T16:37:02 | 2016-07-24T16:37:02 | 64,072,096 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,162 | java | package pl.marchuck.catchemall.data;
import java.util.ArrayList;
import java.util.List;
import pl.marchuck.catchemall.R;
import uk.co.alt236.bluetoothlelib.device.BluetoothLeDevice;
import uk.co.alt236.bluetoothlelib.device.beacon.BeaconType;
import uk.co.alt236.bluetoothlelib.device.beacon.BeaconUtils;
/**
* Created by Lukasz Marczak on 2015-08-23.
*/
public class BeaconsInfo {
public static boolean FORCE_STOP_SCAN = false;
public static int SCANTIME = 60; //how much seconds scanner should seek for beacons
public static boolean NEW_FIGHT; //prevent to start 2 or more fights at the same time
public interface MAC {
String Primeape = "F2:8E:23:A3:17:E6";
String Sandshrew = "D7:04:1D:B2:11:C9";
}
public static Boolean isBeacon(BluetoothLeDevice device) {
return BeaconUtils.getBeaconType(device) == BeaconType.IBEACON;
}
public interface PokeInterface {
int UNKNOWN_POKEMON_RESOURCE = R.drawable.unknown;
int MAX_HEALTH = 102;
int SUM_POWERS = 102;
String POKEMON_NAME = "POKEMON_NAME";
String POKEMON_ID = "POKEMON_ID";
}
private static List<Pokemon> pokemons = new ArrayList<>();
public interface Bundler {
String MAC = "MAC_ADDRESS";
String RSSI = "RSSI";
String MINOR = "MINOR";
String MAJOR = "MAJOR";
String CALIBRATED_POWER = "CALIBRATED_POWER";
String ACCURACY = "ACCURACY";
}
public static class PokeManager {
public static void addNewPoke(Pokemon newPokemon) {
boolean canAdd = true;
for (Pokemon poke : pokemons) {
if (poke.equals(newPokemon))
canAdd = false;
}
if (canAdd)
pokemons.add(newPokemon);
}
public static void deletePoke(Pokemon delPokemon) {
List<Pokemon> tempList = new ArrayList<>();
for (Pokemon poke : pokemons) {
if (!poke.equals(delPokemon))
tempList.add(poke);
}
pokemons.clear();
pokemons.addAll(tempList);
}
}
}
| [
"lukmar993@gmail.com"
] | lukmar993@gmail.com |
69cc8eb09102c6622938303b3c8901b651f3f36e | e010f83b9d383a958fc73654162758bda61f8290 | /src/main/java/com/alipay/api/response/AlipayOpenServicemarketCommodityShopOnlineResponse.java | 4035880011f1be5266aff7d37769cf83755a5546 | [
"Apache-2.0"
] | permissive | 10088/alipay-sdk-java | 3a7984dc591eaf196576e55e3ed657a88af525a6 | e82aeac7d0239330ee173c7e393596e51e41c1cd | refs/heads/master | 2022-01-03T15:52:58.509790 | 2018-04-03T15:50:35 | 2018-04-03T15:50:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.open.servicemarket.commodity.shop.online response.
*
* @author auto create
* @since 1.0, 2017-10-24 10:39:17
*/
public class AlipayOpenServicemarketCommodityShopOnlineResponse extends AlipayResponse {
private static final long serialVersionUID = 1876273227424397951L;
}
| [
"liuqun.lq@alibaba-inc.com"
] | liuqun.lq@alibaba-inc.com |
82bf9ed05ad4d11c7ed33e4e0ebe01e4c299ea86 | 95d8a4ab64cba3d452793d7e778efca61d327190 | /src/com/company/Matrix/Vector.java | 460e873af4840a527a38432886d5a0c7f20573ca | [] | no_license | XSmile2008/Unimodal | 601e62938e87f893ad006c77cdadac4067364e06 | d1bf777aa4323bd8f3eaa131100457fd2b961eef | refs/heads/master | 2021-01-10T14:40:20.422842 | 2015-11-25T18:07:30 | 2015-11-25T18:07:30 | 44,311,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,585 | java | package com.company.matrix;
/**
* Created by vladstarikov on 27.10.15.
*/
public class Vector {
public static double[] add(double A[], double B[]) throws IncompatibleSizesException {
if (B.length != A.length) throw new IncompatibleSizesException();
double[] C = new double[A.length];
for (int i = 0; i < A.length; i++)
C[i] = A[i] + B[i];
return C;
}
public static double[] substract(double A[], double B[]) throws IncompatibleSizesException {
if (B.length != A.length) throw new IncompatibleSizesException();
double[] C = new double[A.length];
for (int i = 0; i < A.length; i++)
C[i] = A[i] - B[i];
return C;
}
public static boolean equals(double A[], double B[]) throws IncompatibleSizesException {
if (B.length != A.length) throw new IncompatibleSizesException();
for (int i = 0; i < A.length; i++)
if (A[i] != B[i]) return false;
return true;
}
public static double[] multiply(double A[], double B[]) {
double[] C = new double[A.length];
for (int i = 0; i < A.length; i++)
C[i] = A[i] * B[i];
return C;
}
public static double[] multiply(double A[], double B) {
double[] C = new double[A.length];
for (int i = 0; i < A.length; i++)
C[i] = A[i] * B;
return C;
}
public static double norm(double[] vector) {
double sum = 0;
for (double d : vector) sum += d*d;
return Math.sqrt(sum);
}
}
| [
"XSmile2008@gmail.com"
] | XSmile2008@gmail.com |
bcc1ba9413dc0e26781f2ef4e6ee3805b4f716fd | 0fd7d41c4a03055eaf50e6464cb0970eef1b0d1d | /test/org/gz/mappainter/business/RegionIndexerTest.java | 16003e55c98f8d421b259335933c58f94d37844a | [] | no_license | gzucolotto/MapPainter | bfb2e08d07a5fccd7981e837666899ded2698e99 | 38a10f09cbe69ce3a8d8fe58ab7b827d56b8b585 | refs/heads/master | 2021-06-17T07:56:38.637302 | 2017-06-04T13:22:19 | 2017-06-04T13:22:19 | 93,314,750 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,262 | java | package org.gz.mappainter.business;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class RegionIndexerTest {
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void test1x1() {
int[][] map = {{100}};
MapNormalizer ri = new MapNormalizer(map);
ri.indexRegions();
int[][] indexMap = ri.getIndexMap();
Assert.assertEquals(1, indexMap[0][0]);
Assert.assertEquals(100, map[0][0]);
}
@Test
public void test2x2() {
int[][] map = {{100, 100}, {100, 200}};
MapNormalizer ri = new MapNormalizer(map);
ri.indexRegions();
int[][] indexMap = ri.getIndexMap();
Assert.assertEquals(1, indexMap[0][0]);
Assert.assertEquals(1, indexMap[0][1]);
Assert.assertEquals(1, indexMap[1][0]);
Assert.assertEquals(2, indexMap[1][1]);
Assert.assertEquals(100, map[0][0]);
Assert.assertEquals(100, map[0][1]);
Assert.assertEquals(100, map[1][0]);
Assert.assertEquals(200, map[1][1]);
}
}
| [
"gzucolotto@gmail.com"
] | gzucolotto@gmail.com |
f897dde788e13a69704ef882ba632a4f743730d1 | c393377fb6b841b4677eb005fc486c5c70304a13 | /src/main/resources/archetype-resources/server/src/main/java/__packageInPathFormat__/server/service/SimpleService.java | f5bd90b4627a4a896e301307e2be108b2fc22600 | [] | no_license | shaohuabaishuo/springboot-archetype-example | 5eb36da24333c3ae5c89f26e52cedaabb9d01534 | f67903ba38c8cc7d977a701f769c4c4c3926470f | refs/heads/master | 2022-04-24T09:23:12.376151 | 2020-04-30T15:41:30 | 2020-04-30T15:41:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 574 | java | package ${package}.server.service;
import ${package}.server.entity.req.SimpleParam;
import ${package}.server.entity.res.SimpleVO;
import org.springframework.stereotype.Service;
/**
* <p>示例服务</p>
*
* @author lixian
* @date 2020-04-22
*/
@Service
public class SimpleService {
/**
* 示例方法
*/
public SimpleVO getSimple(SimpleParam param) {
SimpleVO result = new SimpleVO();
result.setAgeDesc(param.getAge() + "岁:~好年轻");
result.setNameDesc(param.getName() + ": 好名字");
return result;
}
} | [
"lixian@shuwen.com"
] | lixian@shuwen.com |
795734b088032042bc65877b5bee5be7387eef4b | acfe980860caffd7c8dd71b90928a3c5a5762eb6 | /demothreads/src/main/java/by/epam/thread/helloworld/ex07/Resource.java | 99ce44ff7c1f46730b91e0e33a974447c0e2f0de | [] | no_license | isublsv/JavaWebDevelopment | 2b7aab0cb2374725784a1b03ec58ce70449a3629 | 1c2f0918b7bd522cacb175ff075756abd63fd19a | refs/heads/master | 2023-03-06T10:17:57.622680 | 2023-03-04T13:00:30 | 2023-03-04T13:02:17 | 208,277,162 | 0 | 0 | null | 2023-03-04T13:02:18 | 2019-09-13T14:06:44 | Java | UTF-8 | Java | false | false | 1,015 | java | package by.epam.thread.helloworld.ex07;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.FileWriter;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
class Resource {
private static final Logger LOGGER = LogManager.getLogger(Resource.class);
private FileWriter fileWriter;
Resource(String path) throws IOException {
fileWriter = new FileWriter(path);
}
synchronized void writing(String str, int i) {
try {
String message = str + i;
fileWriter.append(message);
LOGGER.debug(message);
TimeUnit.MILLISECONDS.sleep((long) (Math.random() * 50));
} catch (IOException | InterruptedException eValue) {
LOGGER.error(eValue);
Thread.currentThread().interrupt();
}
}
void close() {
try {
fileWriter.close();
} catch (IOException eValue) {
LOGGER.error(eValue);
}
}
}
| [
"isublsv@gmail.com"
] | isublsv@gmail.com |
a3d9efd973bdde3a41dfc9235355ea71c6029803 | 4c426f3249dd46c0e70b1db4f4d3a6f3cfb61173 | /src/test/java/org/forzm/demo/service/impl/CommentServiceImplTest.java | fea05faed779bd0ae5d2845ca58f62c1b0257bcf | [] | no_license | BitIgnas/forzm-backend-api | 7daf0701d46e852b326ef5d0fc5a6f8bced0ac6e | 9d71725cfd242ed1818a8347547c0671100d990c | refs/heads/main | 2023-08-29T05:25:40.011042 | 2021-09-18T17:55:26 | 2021-09-18T17:55:26 | 391,295,916 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,151 | java | package org.forzm.demo.service.impl;
import org.forzm.demo.dto.CommentRequestDto;
import org.forzm.demo.dto.CommentResponseDto;
import org.forzm.demo.dto.PostResponseDto;
import org.forzm.demo.model.*;
import org.forzm.demo.repository.CommentRepository;
import org.forzm.demo.repository.PostRepository;
import org.forzm.demo.service.AuthService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.modelmapper.ModelMapper;
import java.time.Instant;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import static java.util.Collections.emptyList;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
@ExtendWith(MockitoExtension.class)
public class CommentServiceImplTest {
@Mock
private CommentRepository commentRepository;
@Mock
private PostRepository postRepository;
@Mock
private AuthService authService;
@Mock
private ModelMapper modelMapper;
@InjectMocks
private CommentServiceImpl commentService;
@Captor
private ArgumentCaptor<Comment> commentArgumentCaptor;
@Test
void shouldAddComment() {
User currentUser = new User(1L, "test", "test@gmail.com", "TEST", true, null, null);
Forum forum = new Forum(1L, "TEST_FORUM", "FORUM DESC", ForumGameType.FPS, null, currentUser, emptyList(), Instant.now());
Post post = new Post(1L, "TEST_TITLE", "TEST CONTENT", null, PostType.DISCUSSION, null, currentUser, forum, null, null);
CommentRequestDto commentRequestDto = new CommentRequestDto("TEST CONTENT", "TEST_TITLE", 1L);
Comment comment = new Comment(1L, "TEST CONTENT", null, post, currentUser);
when(postRepository.findPostByTitleAndId(commentRequestDto.getPostTitle(), commentRequestDto.getPostId())).thenReturn(Optional.of(post));
when(modelMapper.map(commentRequestDto, Comment.class)).thenReturn(comment);
when(authService.getCurrentUser()).thenReturn(currentUser);
commentService.addComment(commentRequestDto);
verify(postRepository, times(1)).findPostByTitleAndId(anyString(), anyLong());
verify(commentRepository, times(1)).save(commentArgumentCaptor.capture());
verify(modelMapper, times(1)).map(commentRequestDto, Comment.class);
verify(authService, times(1)).getCurrentUser();
verifyNoMoreInteractions(postRepository);
verifyNoMoreInteractions(commentRepository);
Comment capturedComment = commentArgumentCaptor.getValue();
assertThat(capturedComment).isNotNull();
assertThat(capturedComment).isInstanceOf(Comment.class);
assertThat(capturedComment).isEqualTo(comment);
}
@Test
void getAllPostComments() {
Comment comment = new Comment(1L, "TEST CONTENT", null, null, null);
CommentResponseDto commentResponseDto = new CommentResponseDto("TEST CONTENT", null, null, null, null, null, null, null, null);
Post post = new Post(1L, "TEST_TITLE", "TEST CONTENT", null, PostType.DISCUSSION, null, null, null, null, null);
List<Comment> comments = Collections.singletonList(comment);
when(postRepository.findPostByTitleAndId(anyString(), anyLong())).thenReturn(Optional.of(post));
when(commentRepository.findAllByPost(any(Post.class))).thenReturn(comments);
when(modelMapper.map(comment, CommentResponseDto.class)).thenReturn(commentResponseDto);
List<CommentResponseDto> actualAllPostComments = commentService.getAllPostComments("TEST", 1L);
verify(postRepository, times(1)).findPostByTitleAndId(anyString(), anyLong());
verify(commentRepository, times(1)).findAllByPost(any(Post.class));
verify(modelMapper, times(1)).map(comment, CommentResponseDto.class);
verifyNoMoreInteractions(postRepository);
verifyNoMoreInteractions(commentRepository);
assertThat(actualAllPostComments).isNotNull();
assertThat(actualAllPostComments.size()).isEqualTo(1);
assertThat(actualAllPostComments.get(0)).isInstanceOf(CommentResponseDto.class);
assertThat(actualAllPostComments.get(0)).isEqualTo(commentResponseDto);
assertThat(commentResponseDto).isIn(actualAllPostComments);
}
@Test
void getUserCommentCount() {
Long userCommentCount = 1L;
when(commentRepository.countAllByUserUsername(anyString())).thenReturn(userCommentCount);
Long actualUserCommentCount = commentService.getUserCommentCount("username");
verify(commentRepository, times(1)).countAllByUserUsername(anyString());
verifyNoMoreInteractions(commentRepository);
assertThat(actualUserCommentCount).isNotNull();
assertThat(actualUserCommentCount).isInstanceOf(Long.class);
assertThat(actualUserCommentCount).isEqualTo(1L);
}
@Test
void getAllUserCommentsByUsername() {
Comment comment = new Comment(1L, "TEST CONTENT", null, null, null);
CommentResponseDto commentResponseDto = new CommentResponseDto("TEST CONTENT", null, null, null, null, null, null, null, null);
List<Comment> comments = Collections.singletonList(comment);
when(commentRepository.findAllByUserUsername(anyString())).thenReturn(comments);
when(modelMapper.map(comment, CommentResponseDto.class)).thenReturn(commentResponseDto);
List<CommentResponseDto> actualUserComments = commentService.getAllUserCommentsByUsername("username");
verify(commentRepository, times(1)).findAllByUserUsername(anyString());
verify(modelMapper, times(1)).map(comment, CommentResponseDto.class);
verifyNoMoreInteractions(commentRepository);
assertThat(actualUserComments).isNotNull();
assertThat(actualUserComments.size()).isEqualTo(1);
assertThat(actualUserComments.get(0)).isInstanceOf(CommentResponseDto.class);
assertThat(actualUserComments.get(0)).isEqualTo(commentResponseDto);
assertThat(commentResponseDto).isIn(actualUserComments);
}
@Test
void getUserFiveRecentComments() {
Comment comment = new Comment(1L, "TEST CONTENT", null, null, null);
CommentResponseDto commentResponseDto = new CommentResponseDto("TEST CONTENT", null, null, null, null, null, null, null, null);
List<Comment> comments = Collections.singletonList(comment);
when(commentRepository.findTop5ByUserUsernameOrderByDateRepliedAsc(anyString())).thenReturn(comments);
when(modelMapper.map(comment, CommentResponseDto.class)).thenReturn(commentResponseDto);
List<CommentResponseDto> actualUserComments = commentService.getUserFiveRecentComments("username");
verify(commentRepository, times(1)).findTop5ByUserUsernameOrderByDateRepliedAsc(anyString());
verify(modelMapper, times(1)).map(comment, CommentResponseDto.class);
verifyNoMoreInteractions(commentRepository);
assertThat(actualUserComments).isNotNull();
assertThat(actualUserComments.size()).isEqualTo(1);
assertThat(actualUserComments.get(0)).isInstanceOf(CommentResponseDto.class);
assertThat(actualUserComments.get(0)).isEqualTo(commentResponseDto);
assertThat(commentResponseDto).isIn(actualUserComments);
}
@Test
void mapToComment() {
Comment comment = new Comment(1L, "TEST CONTENT", null, null, null);
CommentRequestDto commentRequestDto = new CommentRequestDto("TEST CONTENT", "TEST_TITLE", 1L);
when(modelMapper.map(commentRequestDto, Comment.class)).thenReturn(comment);
Comment actualComment = commentService.mapToComment(commentRequestDto);
verify(modelMapper, times(1)).map(commentRequestDto, Comment.class);
verifyNoMoreInteractions(modelMapper);
assertThat(actualComment).isNotNull();
assertThat(actualComment).isInstanceOf(Comment.class);
assertThat(actualComment).isEqualTo(comment);
}
@Test
void mapToCommentResponseDto() {
Comment comment = new Comment(1L, "TEST CONTENT", null, null, null);
CommentResponseDto commentResponseDto = new CommentResponseDto("TEST CONTENT", null, null, null, null, null, null, null, null);
when(modelMapper.map(comment, CommentResponseDto.class)).thenReturn(commentResponseDto);
CommentResponseDto actualCommentResponseDto = commentService.mapToCommentResponseDto(comment);
verify(modelMapper, times(1)).map(comment, CommentResponseDto.class);
verifyNoMoreInteractions(modelMapper);
assertThat(actualCommentResponseDto).isNotNull();
assertThat(actualCommentResponseDto).isInstanceOf(CommentResponseDto.class);
assertThat(actualCommentResponseDto).isEqualTo(commentResponseDto);
}
} | [
"Ignotas99@gmail.com"
] | Ignotas99@gmail.com |
50fcf2e6c073e044866ac4fbb87d3ab782f3b8be | 57c11d1f89d3572e1a717eaee9b0a548f1121a51 | /Clase_10/ejercicios/sincronico/clases/FigurasBD/src/main/java/Test2.java | 0984317b0e3953d0aa5c3c1dd09da567d5e0798c | [] | no_license | dedosmedia/BackEnd_I | 8b64f4348118543ecd6e93ad642dc3c6578cbf37 | dedb06558f8c8916da8e881b907ffd241e8bbbdc | refs/heads/main | 2023-08-09T01:09:11.008569 | 2021-09-12T17:09:58 | 2021-09-12T17:09:58 | 394,388,946 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,135 | java |
/*Crear una tabla de figuras y guardar el
tipo de figura: ejemplo circulo
color: ejemplo rojo
(No nos olvidemos que el id es obligatorio)
Crear una conexion a la BD
insertar 2 circulos y 3 cuadrados de distinto color
crear una query para ver los circulos color rojo
mostrar todos las figuras en pantalla con un resultSet y un System.out.println
*/
import java.sql.*;
public class Test2 {
private static final String SQL_CREATE_TABLE = "DROP TABLE IF EXISTS FIGURAS; CREATE TABLE FIGURAS "
+ "("
+ " ID INT PRIMARY KEY,"
+ " COLOR varchar(100) NOT NULL, "
+ " TIPO varchar(100) NOT NULL "
+ " )";
private static final String SQL_INSERT = "INSERT INTO FIGURAS (ID, COLOR, TIPO) VALUES (1, ROJO, Circulo)";
private static final String SQL_INSERT2 = "INSERT INTO FIGURAS (ID, COLOR, TIPO) VALUES (2, VERDE, Cuadrado)";
private static final String SQL_INSERT3 = "INSERT INTO FIGURAS (ID, COLOR, TIPO) VALUES (3, AZUL, Cuadrado)";
private static final String SQL_INSERT4 = "INSERT INTO FIGURAS (ID, COLOR, TIPO) VALUES (4, ROJO, Cuadrado)";
private static final String SQL_INSERT5 = "INSERT INTO FIGURAS (ID, COLOR, TIPO) VALUES (5, VERDE, Circulo)";
private static final String SQL_DELETE = "DELETE FROM FIGURAS WHERE ID=2";
public static void main(String[] args) throws Exception {
Connection connection = null;
try {
connection= getConnection();
Statement statement = connection.createStatement();
statement.execute(SQL_CREATE_TABLE);
Statement statementIns = connection.createStatement();
statementIns.execute(SQL_INSERT);
Statement statementIns2 = connection.createStatement();
statementIns2.execute(SQL_INSERT2);
Statement statementIns3 = connection.createStatement();
statementIns3.execute(SQL_INSERT3);
Statement statementIns4 = connection.createStatement();
statementIns4.execute(SQL_INSERT4);
Statement statementIns5 = connection.createStatement();
statementIns5.execute(SQL_INSERT5);
verFiguras(connection, "SELECT * FROM FIGURAS WHERE COLOR = ROJO");
Statement statementDEl = connection.createStatement();
statementDEl.execute(SQL_DELETE);
verFiguras(connection, "SELECT * FROM FIGURAS");
} catch (Exception e) {
} finally {
connection.close();
}
}
private static void verFiguras(Connection connection, String sql) throws SQLException {
Statement sqlSmt = connection.createStatement();
ResultSet rs = sqlSmt.executeQuery(sql);
while (rs.next()) {
System.out.println(rs.getInt(1) + rs.getString(2) + rs.getInt(3));
}
}
public static Connection getConnection() throws Exception {
Class.forName("org.h2.Driver").newInstance();
//return DriverManager.getConnection("jdbc:h2:~/test");
return DriverManager.getConnection("jdbc:h2:tcp://localhost/~/test","sa", "");
}
}
| [
"gerencia@dedosmedia.com"
] | gerencia@dedosmedia.com |
312f17110263d7c1e038ecadfc8d38cf3b20d106 | 9f34c1249575d4540814265e2d1f3d50c4d097df | /src/sort/quickSort/code/PARTITION.java | be9f8cdb1f08c46b0deeb3d75960a1c0ca1b957e | [] | no_license | cat94/Algrithom_test | f6662ffedca7fdd4b4e51141cde771936e4da94e | c0ab6c7a785e127de1b25ea8ed74e05aaad2948c | refs/heads/master | 2021-01-18T14:15:52.578573 | 2015-05-19T08:32:36 | 2015-05-19T08:32:36 | 23,689,679 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,152 | java | package sort.quickSort.code;
/**
* ��ԭ������Ӱ���partition����
* @author shen
*
*/
public class PARTITION {
public static int partition(int[] list , int start_index,int end_index){
int change_index = start_index-1; //���Ƿ�Ƭ�������Ҫ�����滻���±꣬��start_index-1��ʼ
for (int i = start_index; i < end_index; i++) {
if (list[i]<list[end_index]) {
change_index++;
int temp = list[i];
list[i] = list[change_index];
list[change_index] = temp;
}
}
int temp = list[change_index+1];
list[change_index+1] = list[end_index];
list[end_index] = temp;
return change_index+1;
}
/**
* Ϊ��ʹ�㷨ʵ�������õؽӽ�ƽ�����ܣ���ֹ��Ϊ���µ������ij���
*
* ����������������ɺͽ����������ʱ����ģ������ڲ�����������Ե������С��20��Ԫ�أ���
* �������Ļ��ڻ��ú�ʱ�ӽ������δ���ʱ����ʱ�����Ƕ������20%
*
*
* ����һ��100000���������ʱ����Random�����ٶ���random�����ٶ����
*
* ����һ����СΪ100000�Ĵ�С�������е�����ʱ���ݹ�ķ�random: stackOverFlow =_=
* �����ݹ�ij�β�ݹ�֮��random:�����ʱ������: 89% 7.672����6.86��
* ��random: 0.57% 7.74����0.044��
*
*
* ���ϣ�random�����ڴ���������ʱ��Ƚ��ʺ�
*
* @param list
* @param start_index
* @param end_index
* @return
*/
public static int random_partition(int[] list , int start_index,int end_index){
int i = (int)Math.round((Math.random()*(end_index-start_index)))+start_index;
int temp = list[i];
list[i] = list[end_index];
list[end_index] = temp;
return partition(list, start_index, end_index);
}
}
| [
"CatMeetPet@gmail.com"
] | CatMeetPet@gmail.com |
97356f9245ad52ffa5918ef3d36f89d711d268a1 | 0721dbe2cea0a8a19ac348fb7c39938d84251689 | /src/pack1/Test3.java | 43422f82292006b82ad72b9074afe5a9270bc3c8 | [] | no_license | rabahoukara/SeleniumCours_Test2 | 38a3c58f1091911bf258b54c1efc1909a687e60d | 599a56164491f7d6d75d3eec6a67e9f7756106ef | refs/heads/main | 2023-06-15T07:49:59.998428 | 2021-07-16T02:48:24 | 2021-07-16T02:48:24 | 386,488,055 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 889 | java | package pack1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Test3 {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "drivers\\chromedriver.exe");
WebDriver driver = new ChromeDriver(); // une instance du navigateur chrome
// ChromeDriver driver2 = new ChromeDriver (); driver2 de type chrome uniquement
driver.get("https://opensource-demo.orangehrmlive.com/");
driver.manage().window().maximize(); // maximiser l'affichage de la fenetre
String codeSource = driver.getPageSource();
System.out.println("le code source est le suivant: "+codeSource);//afficher le code source dans la console
if(codeSource.contains("OrangeHRM")) { // valider que le code source contient "OrangeHRM"
System.out.println("passed");
}else {
System.out.println("failed");
}
}
}
| [
"rabah_oukara@yahoo.fr"
] | rabah_oukara@yahoo.fr |
6de27a5395f88230ab35c81c365497b4cd815024 | e91b519baf17446cde0e69099fe4fd1b96c424d4 | /src/main/java/uk/ac/qub/eeecs/closer/main/FileOperations.java | f0f6030137fd73d500e192b429313831a23fe686 | [] | no_license | closer-evolution/closer | 97d09789d665004bdd7b9b7fbeca142a8fbf56e5 | 40a3c508bf7d3ce689f3126aab08af8a53ef03a1 | refs/heads/main | 2023-07-01T23:44:24.223945 | 2021-08-02T13:20:07 | 2021-08-02T13:20:07 | 390,712,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 242 | java | package uk.ac.qub.eeecs.closer.main;
/**
* @author : Jordan
* @created : 11/01/2021, Monday
* @description : Class for all File IO operations, separated so that these methods can be mocked for testing
**/
public class FileOperations {
}
| [
"d.cutting@qub.ac.uk"
] | d.cutting@qub.ac.uk |
89436a5233f61798201a900a877524afbb9bff18 | 5ee79eb3c87bcd4d6b744d6396f4063448a245bd | /qr_simple/src/main/java/com/icechen/qr_simple/Intents.java | a0da165b99ea4ad3437e666eccb938335bb2c14b | [] | no_license | iceChenx/QR_Simple | 59931dd3893b137e6eb3e8af94ef0d6fc63bf00d | 6ead3e0e2426d955935562580b1d02cbd4d8ef8e | refs/heads/master | 2021-01-21T13:57:33.923882 | 2016-05-25T15:28:12 | 2016-05-25T15:28:12 | 55,806,594 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,169 | java | /*
* Copyright (C) 2008 ZXing 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 com.icechen.qr_simple;
/**
* This class provides the constants to use when sending an Intent to Barcode Scanner.
* These strings are effectively API and cannot be changed.
*
* @author dswitkin@google.com (Daniel Switkin)
*/
public final class Intents {
private Intents() {
}
public static final class Scan {
/**
* Send this intent to open the Barcodes app in scanning mode, find a barcode, and return
* the results.
*/
public static final String ACTION = "com.google.zxing.client.android.SCAN";
/**
* By default, sending this will decode all barcodes that we understand. However it
* may be useful to limit scanning to certain formats. Use
* {@link android.content.Intent#putExtra(String, String)} with one of the values below.
*
* Setting this is effectively shorthand for setting explicit formats with {@link #FORMATS}.
* It is overridden by that setting.
*/
public static final String MODE = "SCAN_MODE";
/**
* Decode only UPC and EAN barcodes. This is the right choice for shopping apps which get
* prices, reviews, etc. for products.
*/
public static final String PRODUCT_MODE = "PRODUCT_MODE";
/**
* Decode only 1D barcodes.
*/
public static final String ONE_D_MODE = "ONE_D_MODE";
/**
* Decode only QR codes.
*/
public static final String QR_CODE_MODE = "QR_CODE_MODE";
/**
* Decode only Data Matrix codes.
*/
public static final String DATA_MATRIX_MODE = "DATA_MATRIX_MODE";
/**
* Decode only Aztec.
*/
public static final String AZTEC_MODE = "AZTEC_MODE";
/**
* Decode only PDF417.
*/
public static final String PDF417_MODE = "PDF417_MODE";
/**
* Comma-separated list of formats to scan for. The values must match the names of
* {@link com.google.zxing.BarcodeFormat}s, e.g. {@link com.google.zxing.BarcodeFormat#EAN_13}.
* Example: "EAN_13,EAN_8,QR_CODE". This overrides {@link #MODE}.
*/
public static final String FORMATS = "SCAN_FORMATS";
/**
* Optional parameter to specify the id of the com.icechen.qr_simple.camera from which to recognize barcodes.
* Overrides the default com.icechen.qr_simple.camera that would otherwise would have been selected.
* If provided, should be an int.
*/
public static final String CAMERA_ID = "SCAN_CAMERA_ID";
/**
* @see com.google.zxing.DecodeHintType#CHARACTER_SET
*/
public static final String CHARACTER_SET = "CHARACTER_SET";
/**
* Optional parameters to specify the width and height of the scanning rectangle in pixels.
* The app will try to honor these, but will clamp them to the size of the preview frame.
* You should specify both or neither, and pass the size as an int.
*/
public static final String WIDTH = "SCAN_WIDTH";
public static final String HEIGHT = "SCAN_HEIGHT";
/**
* Desired duration in milliseconds for which to pause after a successful scan before
* returning to the calling intent. Specified as a long, not an integer!
* For example: 1000L, not 1000.
*/
public static final String RESULT_DISPLAY_DURATION_MS = "RESULT_DISPLAY_DURATION_MS";
/**
* Prompt to show on-screen when scanning by intent. Specified as a {@link String}.
*/
public static final String PROMPT_MESSAGE = "PROMPT_MESSAGE";
/**
* If a barcode is found, Barcodes returns {@link android.app.Activity#RESULT_OK} to
* {@link android.app.Activity#onActivityResult(int, int, android.content.Intent)}
* of the app which requested the scan via
* {@link android.app.Activity#startActivityForResult(android.content.Intent, int)}
* The barcodes contents can be retrieved with
* {@link android.content.Intent#getStringExtra(String)}.
* If the user presses Back, the result code will be {@link android.app.Activity#RESULT_CANCELED}.
*/
public static final String RESULT = "SCAN_RESULT";
/**
* Call {@link android.content.Intent#getStringExtra(String)} with {@link #RESULT_FORMAT}
* to determine which barcode format was found.
* See {@link com.google.zxing.BarcodeFormat} for possible values.
*/
public static final String RESULT_FORMAT = "SCAN_RESULT_FORMAT";
/**
* Call {@link android.content.Intent#getStringExtra(String)} with {@link #RESULT_UPC_EAN_EXTENSION}
* to return the content of any UPC extension barcode that was also found. Only applicable
* to {@link com.google.zxing.BarcodeFormat#UPC_A} and {@link com.google.zxing.BarcodeFormat#EAN_13}
* formats.
*/
public static final String RESULT_UPC_EAN_EXTENSION = "SCAN_RESULT_UPC_EAN_EXTENSION";
/**
* Call {@link android.content.Intent#getByteArrayExtra(String)} with {@link #RESULT_BYTES}
* to get a {@code byte[]} of raw bytes in the barcode, if available.
*/
public static final String RESULT_BYTES = "SCAN_RESULT_BYTES";
/**
* Key for the value of {@link com.google.zxing.ResultMetadataType#ORIENTATION}, if available.
* Call {@link android.content.Intent#getIntArrayExtra(String)} with {@link #RESULT_ORIENTATION}.
*/
public static final String RESULT_ORIENTATION = "SCAN_RESULT_ORIENTATION";
/**
* Key for the value of {@link com.google.zxing.ResultMetadataType#ERROR_CORRECTION_LEVEL}, if available.
* Call {@link android.content.Intent#getStringExtra(String)} with {@link #RESULT_ERROR_CORRECTION_LEVEL}.
*/
public static final String RESULT_ERROR_CORRECTION_LEVEL = "SCAN_RESULT_ERROR_CORRECTION_LEVEL";
/**
* Prefix for keys that map to the values of {@link com.google.zxing.ResultMetadataType#BYTE_SEGMENTS},
* if available. The actual values will be set under a series of keys formed by adding 0, 1, 2, ...
* to this prefix. So the first byte segment is under key "SCAN_RESULT_BYTE_SEGMENTS_0" for example.
* Call {@link android.content.Intent#getByteArrayExtra(String)} with these keys.
*/
public static final String RESULT_BYTE_SEGMENTS_PREFIX = "SCAN_RESULT_BYTE_SEGMENTS_";
/**
* Setting this to false will not save scanned codes in the history. Specified as a {@code boolean}.
*/
public static final String SAVE_HISTORY = "SAVE_HISTORY";
private Scan() {
}
}
public static final class History {
public static final String ITEM_NUMBER = "ITEM_NUMBER";
private History() {
}
}
public static final class Encode {
/**
* Send this intent to encode a piece of data as a QR code and display it full screen, so
* that another person can scan the barcode from your screen.
*/
public static final String ACTION = "com.google.zxing.client.android.ENCODE";
/**
* The data to encode. Use {@link android.content.Intent#putExtra(String, String)} or
* {@link android.content.Intent#putExtra(String, android.os.Bundle)},
* depending on the type and format specified. Non-QR Code formats should
* just use a String here. For QR Code, see Contents for details.
*/
public static final String DATA = "ENCODE_DATA";
/**
* The type of data being supplied if the format is QR Code. Use
* {@link android.content.Intent#putExtra(String, String)} with one of {@link Contents.Type}.
*/
public static final String TYPE = "ENCODE_TYPE";
/**
* The barcode format to be displayed. If this isn't specified or is blank,
* it defaults to QR Code. Use {@link android.content.Intent#putExtra(String, String)}, where
* format is one of {@link com.google.zxing.BarcodeFormat}.
*/
public static final String FORMAT = "ENCODE_FORMAT";
/**
* Normally the contents of the barcode are displayed to the user in a TextView. Setting this
* boolean to false will hide that TextView, showing only the encode barcode.
*/
public static final String SHOW_CONTENTS = "ENCODE_SHOW_CONTENTS";
private Encode() {
}
}
public static final class SearchBookContents {
/**
* Use Google Book Search to search the contents of the book provided.
*/
public static final String ACTION = "com.google.zxing.client.android.SEARCH_BOOK_CONTENTS";
/**
* The book to search, identified by ISBN number.
*/
public static final String ISBN = "ISBN";
/**
* An optional field which is the text to search for.
*/
public static final String QUERY = "QUERY";
private SearchBookContents() {
}
}
public static final class WifiConnect {
/**
* Internal intent used to trigger connection to a wi-fi network.
*/
public static final String ACTION = "com.google.zxing.client.android.WIFI_CONNECT";
/**
* The network to connect to, all the configuration provided here.
*/
public static final String SSID = "SSID";
/**
* The network to connect to, all the configuration provided here.
*/
public static final String TYPE = "TYPE";
/**
* The network to connect to, all the configuration provided here.
*/
public static final String PASSWORD = "PASSWORD";
private WifiConnect() {
}
}
public static final class Share {
/**
* Give the user a choice of items to encode as a barcode, then render it as a QR Code and
* display onscreen for a friend to scan with their phone.
*/
public static final String ACTION = "com.google.zxing.client.android.SHARE";
private Share() {
}
}
}
| [
"icechen_@outlook.com"
] | icechen_@outlook.com |
8e6b4c3179e1a4d9f21388fe73ff5135950a8041 | cae72498e51e9e86bfec795d11186bc5ecc50354 | /src/main/java/com/ibm/etcd/client/lease/EtcdLeaseClient.java | ffe7c8d7462e687c00585311d1ee42261e09d005 | [
"Apache-2.0"
] | permissive | arnaudbos/etcd-java | be52181bcfa477198dfed30984a9c7fd21ee94bc | 22173202820ef838c6c5b24f0c40e8c77832bd6c | refs/heads/master | 2020-03-30T09:01:51.502977 | 2018-10-01T08:28:59 | 2018-10-03T09:35:55 | 151,057,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 24,397 | java | /*
* Copyright 2017, 2018 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.ibm.etcd.client.lease;
import static com.google.common.util.concurrent.MoreExecutors.directExecutor;
import static com.ibm.etcd.client.lease.PersistentLease.LeaseState.*;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import java.io.Closeable;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.util.concurrent.AbstractFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.ibm.etcd.client.FutureListener;
import com.ibm.etcd.client.GrpcClient;
import com.ibm.etcd.client.GrpcClient.ResilientResponseObserver;
import com.ibm.etcd.client.lease.PersistentLease.LeaseState;
import com.ibm.etcd.api.LeaseGrantRequest;
import com.ibm.etcd.api.LeaseGrantResponse;
import com.ibm.etcd.api.LeaseGrpc;
import com.ibm.etcd.api.LeaseKeepAliveRequest;
import com.ibm.etcd.api.LeaseKeepAliveResponse;
import com.ibm.etcd.api.LeaseLeasesRequest;
import com.ibm.etcd.api.LeaseLeasesResponse;
import com.ibm.etcd.api.LeaseRevokeRequest;
import com.ibm.etcd.api.LeaseRevokeResponse;
import com.ibm.etcd.api.LeaseTimeToLiveRequest;
import com.ibm.etcd.api.LeaseTimeToLiveResponse;
import io.grpc.MethodDescriptor;
import io.grpc.Status.Code;
import io.grpc.stub.StreamObserver;
/**
*
*/
public class EtcdLeaseClient implements LeaseClient, Closeable {
private static final Logger logger = LoggerFactory.getLogger(EtcdLeaseClient.class);
// avoid volatile read on every invocation
private static final MethodDescriptor<LeaseGrantRequest,LeaseGrantResponse> METHOD_LEASE_GRANT =
LeaseGrpc.getLeaseGrantMethod();
private static final MethodDescriptor<LeaseRevokeRequest,LeaseRevokeResponse> METHOD_LEASE_REVOKE =
LeaseGrpc.getLeaseRevokeMethod();
private static final MethodDescriptor<LeaseTimeToLiveRequest,LeaseTimeToLiveResponse> METHOD_LEASE_TIME_TO_LIVE =
LeaseGrpc.getLeaseTimeToLiveMethod();
private static final MethodDescriptor<LeaseKeepAliveRequest,LeaseKeepAliveResponse> METHOD_LEASE_KEEP_ALIVE =
LeaseGrpc.getLeaseKeepAliveMethod();
private static final MethodDescriptor<LeaseLeasesRequest,LeaseLeasesResponse> METHOD_LEASE_LEASES =
LeaseGrpc.getLeaseLeasesMethod();
private final GrpcClient client;
private final ScheduledExecutorService ses;
private volatile boolean closed;
public EtcdLeaseClient(GrpcClient client) {
this.client = client;
this.ses = client.getInternalExecutor();
this.kaReqExecutor = GrpcClient.serialized(ses);
this.respExecutor = GrpcClient.serialized(ses);
}
// ------ simple lease APIs
@Override
public ListenableFuture<LeaseGrantResponse> create(long leaseId, long ttlSecs) {
return client.call(METHOD_LEASE_GRANT, LeaseGrantRequest.newBuilder()
.setID(leaseId).setTTL(ttlSecs).build(), false); //TODO(maybe) could support retry somehow?
}
@Override
public ListenableFuture<LeaseRevokeResponse> revoke(long leaseId) {
return client.call(METHOD_LEASE_REVOKE,
LeaseRevokeRequest.newBuilder().setID(leaseId).build(), false);
}
@Override
public ListenableFuture<LeaseTimeToLiveResponse> ttl(long leaseId, boolean includeKeys) {
return client.call(METHOD_LEASE_TIME_TO_LIVE,
LeaseTimeToLiveRequest.newBuilder().setID(leaseId)
.setKeys(includeKeys).build(), true);
}
@Override
public ListenableFuture<LeaseKeepAliveResponse> keepAliveOnce(long leaseId) {
throw new UnsupportedOperationException("coming soon"); //TODO
}
@Override
public ListenableFuture<LeaseLeasesResponse> list() {
return client.call(METHOD_LEASE_LEASES, LeaseLeasesRequest.getDefaultInstance(), true);
}
// ------ persistent lease impl
/* Still TODO:
* - back-off the retries for create failures
* - keepAliveOnce
* - (maybe) custom per-observer executors
*/
protected static final int MIN_MIN_EXPIRY_SECS = 2;
protected static final int MIN_INTERVAL_SECS = 4;
protected static final int DEFAULT_MIN_EXPIRY_SECS = 10;
protected static final int DEFAULT_INTERVAL_SECS = 5;
// only used from request executor
protected final LeaseKeepAliveRequest.Builder KAR_BUILDER = LeaseKeepAliveRequest.newBuilder();
protected StreamObserver<LeaseKeepAliveRequest> kaReqStream;
protected final Executor kaReqExecutor, respExecutor;
protected final Set<LeaseRecord> allLeases = ConcurrentHashMap.newKeySet();
protected final ConcurrentMap<Long,LeaseRecord> leaseMap = new ConcurrentHashMap<>();
protected final AtomicInteger leaseCount = new AtomicInteger();
@Override
public FluentMaintainRequest maintain() {
return new FluentMaintainRequest() {
private long id;
private int intervalSecs = DEFAULT_INTERVAL_SECS;
private int minTtlSecs = DEFAULT_MIN_EXPIRY_SECS;
private boolean permanent;
private Executor executor;
@Override
public FluentMaintainRequest leaseId(long leaseId) {
if(leaseId < 0L) throw new IllegalArgumentException("invalid leaseId "+leaseId);
this.id = leaseId;
return this;
}
@Override
public FluentMaintainRequest keepAliveFreq(int frequencySecs) {
if(frequencySecs < MIN_INTERVAL_SECS) {
throw new IllegalArgumentException("invalid keep-alive freq "+frequencySecs);
}
this.intervalSecs = frequencySecs;
return this;
}
@Override
public FluentMaintainRequest minTtl(int minTtlSecs) {
if(minTtlSecs < MIN_MIN_EXPIRY_SECS) {
throw new IllegalArgumentException("invalid min expiry "+minTtlSecs);
}
this.minTtlSecs = minTtlSecs;
return this;
}
@Override
public FluentMaintainRequest executor(Executor executor) {
this.executor = executor;
return this;
}
@Override
public FluentMaintainRequest permanent() {
this.permanent = true;
return this;
}
@Override
public PersistentLease start(StreamObserver<LeaseState> observer) {
return newPersisentLease(id, minTtlSecs, intervalSecs,
observer, executor, permanent);
}
@Override
public PersistentLease start() {
return start(null);
}
};
}
// throws IllegalStateException
protected PersistentLease newPersisentLease(long leaseId, int minExpirySecs, int keepAliveFreqSecs,
StreamObserver<LeaseState> observer, Executor executor, boolean protect) {
if(closed) throw new IllegalStateException("client closed");
LeaseRecord rec = !protect ? new LeaseRecord(leaseId, minExpirySecs,
keepAliveFreqSecs, observer, executor)
: new ProtectedLeaseRecord(leaseId, minExpirySecs,
keepAliveFreqSecs, observer, executor);
if(leaseId != 0L && leaseMap.putIfAbsent(leaseId, rec) != null)
throw new IllegalStateException("duplicate lease id");
boolean ok = false;
try {
if(leaseCount.getAndIncrement() == 0) kaReqExecutor.execute(() -> {
kaReqStream = client.callStream(METHOD_LEASE_KEEP_ALIVE,
responseObserver, respExecutor);
});
respExecutor.execute(() -> rec.start(streamEstablished));
ok = true;
} finally {
if(!ok) leaseMap.remove(leaseId, rec);
}
return rec;
}
// called from event loop
protected void leaseClosed(LeaseRecord rec) {
allLeases.remove(rec);
if(rec.leaseId != 0L) leaseMap.remove(rec.leaseId, rec);
if(leaseCount.decrementAndGet() == 0) kaReqExecutor.execute(() -> {
kaReqStream.onCompleted();
kaReqStream = null;
});
}
protected void sendKeepAlive(long leaseId) {
kaReqExecutor.execute(() -> {
StreamObserver<LeaseKeepAliveRequest> stream = kaReqStream;
if(stream != null) stream.onNext(KAR_BUILDER.setID(leaseId).build());
});
}
public void close() {
if(closed) return;
closed = true;
for(LeaseRecord rec : allLeases) rec.doClose(); // this is async
}
boolean streamEstablished = false; // accessed only from responseExecutor
protected final ResilientResponseObserver<LeaseKeepAliveRequest,LeaseKeepAliveResponse> responseObserver =
new ResilientResponseObserver<LeaseKeepAliveRequest,LeaseKeepAliveResponse>() {
@Override
public void onEstablished() {
streamEstablished = true;
for(LeaseRecord rec : allLeases) rec.reconnected();
}
@Override
public void onReplaced(StreamObserver<LeaseKeepAliveRequest> newStream) {
streamEstablished = false;
kaReqExecutor.execute(() -> { kaReqStream = newStream; });
for(LeaseRecord rec : allLeases) rec.connectionLost();
}
@Override
public void onNext(LeaseKeepAliveResponse lkar) {
LeaseRecord rec = leaseMap.get(lkar.getID());
if(rec != null) rec.processKeepAliveResponse(lkar);
}
@Override
public void onError(Throwable t) {
streamEstablished = false;
//TODO review fatal cases
kaReqExecutor.execute(() -> {
StreamObserver<LeaseKeepAliveRequest> stream = kaReqStream;
if(stream != null) kaReqStream.onError(t);
});
}
@Override
public void onCompleted() {
streamEstablished = false;
// alldone
}
};
class LeaseRecord extends AbstractFuture<Long> implements PersistentLease {
final CopyOnWriteArrayList<StreamObserver<LeaseState>> observers;
final Executor eventLoop, observerExecutor;
final int intervalSecs, minExpirySecs;
ListenableFuture<LeaseGrantResponse> createFuture;
long leaseId; // zero or final
long keepAliveTtlSecs = -1L;
long expiryTimeMs = -1L;
boolean connected; //TBC
LeaseState state = PENDING;
public LeaseRecord(long leaseId,
int minExpirySecs, int intervalSecs,
StreamObserver<LeaseState> observer, Executor executor) {
this.minExpirySecs = minExpirySecs;
this.intervalSecs = intervalSecs;
this.leaseId = leaseId;
this.observers = observer == null ? new CopyOnWriteArrayList<>()
: new CopyOnWriteArrayList<>(Collections.singletonList(observer));
this.eventLoop = GrpcClient.serialized(ses);
this.observerExecutor = GrpcClient.serialized(executor != null ? executor
: client.getResponseExecutor());
}
@Override
public void addStateObserver(StreamObserver<LeaseState> observer, boolean publishInit) {
if(publishInit) eventLoop.execute(() -> {
LeaseState stateNow = state;
observers.add(observer);
observerExecutor.execute(() -> callObserverOnNext(observer, stateNow));
});
else observers.add(observer);
}
@Override
public void removeStateObserver(StreamObserver<LeaseState> observer) {
observers.remove(observer);
}
private boolean callObserverOnNext(StreamObserver<LeaseState> observer, LeaseState state) {
try {
observer.onNext(state);
} catch(RuntimeException e) {
logger.warn("state observer onNext("
+state+") method threw", e);
observers.remove(observer);
try {
// per StreamObserver contract
observer.onError(e);
} catch(RuntimeException ee) {}
return false;
}
if(state == CLOSED) try {
observer.onCompleted();
} catch(RuntimeException e) {
logger.warn("state observer onComplete method threw", e);
}
return true;
}
// called from ka stream response context, *not* lease event loop
void start(boolean connected) {
this.connected = connected;
if(closed) close();
else {
allLeases.add(this);
// if leaseId != 0, will already be in leaseMap
create();
}
}
// *not* called from event loop
void reconnected() {
eventLoop.execute(() -> {
if(state == CLOSED) return;
connected = true;
if(createFuture != null) return;
if(leaseId == 0L || state == PENDING
|| state == EXPIRED) {
create();
} else {
sendKeepAliveIfNeeded();
changeState(ACTIVE);
}
});
}
// called from event loop
private void processGrantResponse(LeaseGrantResponse lgr) {
if(leaseId == 0L) {
leaseId = lgr.getID();
leaseMap.put(leaseId, this);
}
processTtlFromServer(lgr.getTTL());
}
// *not* called from event loop
void processKeepAliveResponse(LeaseKeepAliveResponse lkar) {
eventLoop.execute(() -> processTtlFromServer(lkar.getTTL()));
}
// called from event loop
private void processTtlFromServer(long newTtl) {
if(state == CLOSED) return;
// assert leaseId == lkar.getID();
if(newTtl <= 0L) {
// lease not found, trigger create
expiryTimeMs = 0L;
keepAliveTtlSecs = 0L;
changeState(EXPIRED);
create();
} else {
updateKeepAlive(newTtl);
changeState(ACTIVE);
}
}
// *not* called from event loop
void connectionLost() {
eventLoop.execute(() -> {
connected = false;
// wait 1.5 sec before exposing disconnection externally
ses.schedule(() -> {
eventLoop.execute(() -> {
if(connected) return;
long ttlSecs = getCurrentTtlSecs();
LeaseState newState = ttlSecs > 0 ? ACTIVE_NO_CONN : EXPIRED;
changeState(newState); // won't change if pending
if(ttlSecs > 0) {
ses.schedule(this::checkExpired, ttlSecs, SECONDS);
//TODO(maybe) cancel on ttl update? prob no
}
});
}, 1500L, MILLISECONDS);
});
}
// called from timer
void checkExpired() {
eventLoop.execute(() -> {
if(state != EXPIRED && getCurrentTtlSecs() <= 0) {
changeState(EXPIRED);
}
});
}
// called from event loop
private void changeState(LeaseState targetState) {
LeaseState stateBefore = state;
if(stateBefore == targetState) return;
if(stateBefore == PENDING
&& targetState != ACTIVE
&& targetState != CLOSED) return;
if(stateBefore == CLOSED) return; //tbc
state = targetState; // change state before completing future
long leaseToSet = stateBefore == PENDING && targetState == ACTIVE ? leaseId : -1L;
Iterator<StreamObserver<LeaseState>> snapshot = !observers.isEmpty()
? observers.iterator() : Collections.emptyIterator();
// use observerExecutor to complete future and/or call observers
if(snapshot.hasNext() || leaseToSet != -1L) observerExecutor.execute(() -> {
if(leaseToSet != -1L) set(leaseToSet);
while(snapshot.hasNext()) callObserverOnNext(snapshot.next(), targetState);
});
}
// called from start method and event loop
void create() {
if(createFuture != null || state == CLOSED) return;
//TODO(maybe) optimization: use eventLoop as the response executor for this call
createFuture = EtcdLeaseClient.this.create(leaseId, minExpirySecs+intervalSecs);
Futures.addCallback(createFuture, new FutureCallback<LeaseGrantResponse>() {
@Override public void onSuccess(LeaseGrantResponse result) {
createFuture = null;
if(state == CLOSED) revoke();
else processGrantResponse(result);
}
@Override public void onFailure(Throwable t) {
createFuture = null;
Code code = GrpcClient.codeFromThrowable(t);
if(state == CLOSED) {
if(!GrpcClient.isConnectException(t)) revoke();
}
else if(code == Code.ALREADY_EXISTS || code == Code.FAILED_PRECONDITION) {
// precon message is "etcdserver: lease already exists"
// assert leaseId != 0L
sendKeepAliveIfNeeded();
}
else if(connected) {
//TODO backoff retries .. tbd about createFuture field state when waiting
// eventLoop.execute(LeaseRecord.this::create);
create();
}
}
}, eventLoop);
}
// called from event loop, only for ttl > 0,
private void updateKeepAlive(long newTtlSecs) {
keepAliveTtlSecs = newTtlSecs;
expiryTimeMs = System.currentTimeMillis() + 1000L * newTtlSecs;
if(newTtlSecs <= intervalSecs) {
logger.warn("Keepalive ttl too short to meet target interval of "
+intervalSecs+" for lease "+leaseId);
}
//TODO(maybe) or use MIN_INTERVAL_SECS here
long ttNextKaSecs = Math.max(intervalSecs, newTtlSecs - minExpirySecs);
ses.schedule(() -> eventLoop.execute(this::sendKeepAliveIfNeeded),
ttNextKaSecs, TimeUnit.SECONDS);
}
// called from event loop
private void sendKeepAliveIfNeeded() {
if(connected && state != CLOSED && leaseId > 0L
&& getCurrentTtlSecs() <= minExpirySecs) {
sendKeepAlive(leaseId);
}
}
@Override
protected void interruptTask() {
// called if initial future is successfully cancelled
doClose();
}
@Override
public void close() {
doClose();
}
void doClose() {
if(state != CLOSED) eventLoop.execute(() -> {
if(state == CLOSED) return;
changeState(CLOSED);
if(createFuture == null) revoke();
else {
// revoke will be done when future completes
createFuture.cancel(false);
}
//TODO(maybe) cancel in case of create retry waiting
leaseClosed(this);
if(!isDone()) observerExecutor.execute(()
-> setException(new IllegalStateException("closed")));
});
}
// called from event loop
private void revoke() {
if(leaseId == 0L || getCurrentTtlSecs() <= 0) return;
ListenableFuture<LeaseRevokeResponse> fut = sendRevokeDirect(leaseId);
Futures.addCallback(fut, (FutureListener<LeaseRevokeResponse>) (v,t) -> {
try {
eventLoop.execute(() -> {
if(t == null || GrpcClient.codeFromThrowable(t) == Code.NOT_FOUND) {
expiryTimeMs = 0L;
keepAliveTtlSecs = 0L;
} else {
// no point in scheduling future retry if client is already closed
if(leaseId == 0 || getCurrentTtlSecs() <= 0 || closed) return;
//TODO convert to use common GrpcClient retry logic probably
ses.schedule(LeaseRecord.this::revoke, 2, SECONDS);
}
});
} catch(RejectedExecutionException ree) {
// ok if the client/eventloop is closed before we receive the response
if(!closed) throw ree;
}
}, directExecutor());
}
//TODO TBD external getter field visibility/mutual consistency
@Override
public long getCurrentTtlSecs() {
long expires = expiryTimeMs;
if(expires <= 0L) return expires;
expires = expires - System.currentTimeMillis();
return expires < 0L ? 0L : expires/1000L;
}
@Override
public long getLeaseId() {
return leaseId;
}
@Override
public LeaseState getState() {
return state;
}
@Override
public long getPreferredTtlSecs() {
return minExpirySecs+intervalSecs;
}
@Override
public long getKeepAliveTtlSecs() {
return keepAliveTtlSecs;
}
}
ListenableFuture<LeaseRevokeResponse> sendRevokeDirect(long leaseId) {
return client.call(METHOD_LEASE_REVOKE,
LeaseRevokeRequest.newBuilder().setID(leaseId).build(),
false, 0L, directExecutor());
}
class ProtectedLeaseRecord extends LeaseRecord {
public ProtectedLeaseRecord(long leaseId, int minExpirySecs, int intervalSecs,
StreamObserver<LeaseState> observer, Executor executor) {
super(leaseId, minExpirySecs, intervalSecs, observer, executor);
}
@Override
public boolean cancel(boolean mayInterruptIfRunning) { return false; }
@Override
public void close() {}
}
}
| [
"nickhill@us.ibm.com"
] | nickhill@us.ibm.com |
e2d95c18327f41dca44f05b64c39ebd94e03a8de | 673743a0bef13c356a0d3bf808916031ee87aec1 | /usjtest/src/main/java/com/poc/olingo/ta/model/Account.java | ddfa08304876c132c8363a166fcf4789eb1bda0b | [] | no_license | unsreejith/odata2 | c020cc4a132fbd5a19a6b8bbb78c4f2cdb3cd03b | b1ed8c3d3d7becb92e80484db0f0fd2f7052e62a | refs/heads/master | 2021-05-26T02:56:37.415992 | 2020-04-24T08:07:30 | 2020-04-24T08:07:30 | 254,024,238 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,423 | java | package com.poc.olingo.ta.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="account")
public class Account {
@Id
//@GeneratedValue
@Column(name = "account_number", nullable = false)
private int accountNumber;
@Column(name = "account_name", nullable = true)
private String accountName;
@Column(name = "account_revenue", nullable = true)
private int accountRevenue;
@Column(name = "account_id", nullable = true)
private String accountId;
@Column(name = "active", nullable = false)
private boolean active;
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public int getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(int accountNumber) {
this.accountNumber = accountNumber;
}
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public int getAccountRevenue() {
return accountRevenue;
}
public void setAccountRevenue(int accountRevenue) {
this.accountRevenue = accountRevenue;
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
ec7c63e8c6430b74d463d29ec78e2c4a23ded496 | 049c380769758383f3b956c3b9c9b613ce3e3fb5 | /src/main/java/com/lzl/netty/chapter7_msgpack/EchoClientHandler.java | ed5be220507930d566b55236a760f43e3f07ec46 | [] | no_license | lizanle521/springaop | 81ba30a8d646dd39b824d55d651e5503ff2d3c04 | f45bc79967d2f70a2443c586ba05acaae844e84b | refs/heads/master | 2022-12-21T21:41:15.513565 | 2019-07-01T15:51:51 | 2019-07-01T15:51:51 | 112,455,896 | 1 | 0 | null | 2022-10-04T23:50:10 | 2017-11-29T09:39:29 | Java | UTF-8 | Java | false | false | 1,847 | java | package com.lzl.netty.chapter7_msgpack;
import com.lzl.netty.chapter6_encode_decode.javaserilization.UserInfo;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
/**
* @author lizanle
* @data 2019/2/22 8:29 PM
*/
public class EchoClientHandler extends ChannelHandlerAdapter {
private final int sendNumber;
public EchoClientHandler(int sendNumber) {
this.sendNumber = sendNumber;
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
System.out.println("client channel in active");
}
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
System.out.println("client channel active");
UserInfo[] userInfos = userInfos();
for (UserInfo userInfo : userInfos) {
ctx.write(userInfo);
}
ctx.flush();
}
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
System.out.println("client receive the msgpack message:" + msg);
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
System.out.println("client channel read complete");
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
cause.printStackTrace();
ctx.close();
}
private UserInfo[] userInfos(){
UserInfo[] userInfos = new UserInfo[sendNumber];
UserInfo userInfo = null;
for (int i = 0; i < sendNumber; i++) {
userInfo = new UserInfo();
userInfo.setAddress("kkk"+i);
userInfo.setUserId("userid"+i);
userInfo.setUserName("user"+i);
userInfos[i] = userInfo;
}
return userInfos;
}
}
| [
"491823689@qq.com"
] | 491823689@qq.com |
115fd9cae1864d7de5976f36bbbef4886b7de67c | ee1e8f640ba908999da0fe43048b0a582d7b8d9b | /myvue/myblog/src/main/java/com/example/myblog/service/BlogServicelmi.java | fa5da736d88a8ef7139b4ff02f3f4932116f2bea | [] | no_license | lionheart4ever/study | 360ddda5836fd4fdcc627eda7429d31ff8a7af09 | 9baf828a86e49f760bd9a22439f2f64dc3e375a3 | refs/heads/master | 2023-06-19T22:16:20.887579 | 2021-07-20T05:58:45 | 2021-07-20T05:58:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,352 | java | package com.example.myblog.service;
import com.example.myblog.dao.BlogReqository;
import com.example.myblog.po.Blog;
import com.example.myblog.utils.MarkdownUtil;
import javassist.NotFoundException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.Date;
import java.util.List;
@Service
public class BlogServicelmi implements BlogService{
@Autowired
private BlogReqository blogReqository;
@Override
public Blog getBlog(Long id) {
return blogReqository.findById(id).get();
}
@Override
public Page<Blog> listBlog(Pageable pageable,Blog blog) {
return blogReqository.findAll(pageable);
}
@Override
public Page<Blog> listBlog(Pageable pageable) {
return blogReqository.findAll(pageable);
}
@Override
public List<Blog> listBlogTop(Integer numbers) {
Sort sort = Sort.by(Sort.Direction.DESC,"updatetime");
Pageable pageable = PageRequest.of(0,numbers,sort);
return blogReqository.findTop(pageable);
}
@Override
public Page<Blog> listBlog(String query, Pageable pageable) {
return blogReqository.finfQuery(query,pageable);
}
@Transactional
@Override
public Blog saveBlog(Blog blog) {
if(blog.getId()==null){
blog.setViews(0);//浏览记录
blog.setCreatetime(new Date());//创建时间
blog.setUpdatetime(new Date());//修改时间
}else{
blog.setCreatetime(new Date());//创建时间
blog.setUpdatetime(new Date());//修改时间
}
return blogReqository.save(blog);
}
@Transactional
@Override
public Blog updateBlog(Long id, Blog blog) throws NotFoundException {
Blog blog1 = blogReqository.getById(id);
blog1.setViews(blog1.getViews()+1);
if(blog1==null){
throw new NotFoundException("没有找到该信息!");
}
BeanUtils.copyProperties(blog,blog1);
return blogReqository.save(blog1);
}
@Transactional
@Override
public void deleteBlog(Long id) {
blogReqository.deleteById(id);
}
@Override
public void updateBlog1(Blog blog, Long id) throws NotFoundException {
Blog blog1 = blogReqository.getById(id);
blog1.setViews(blog1.getViews()+1);
if(blog1==null){
throw new NotFoundException("没有找到该信息!");
}
BeanUtils.copyProperties(blog1,blog);
blogReqository.save(blog);
}
@Override
public Blog getAndConvert(Long id) throws NotFoundException {
Blog blog = blogReqository.getById(id);
if(blog == null){
throw new NotFoundException("博客不存在!");
}
Blog b = new Blog();//为了防止修改了数据库,重新操作复制后的对象
BeanUtils.copyProperties(blog,b);
String content = b.getContent();
b.setContent(MarkdownUtil.markdownToHtmlExtensions(content));
return b;
}
}
| [
"2857154359@qq.com"
] | 2857154359@qq.com |
5536b4fcad05acc0b0562cd2e6b0ab93fd25fb38 | a00326c0e2fc8944112589cd2ad638b278f058b9 | /src/main/java/000/148/482/CWE90_LDAP_Injection__Property_12.java | 2f7577d23488332096703f26c1b4336a49e9fa19 | [] | no_license | Lanhbao/Static-Testing-for-Juliet-Test-Suite | 6fd3f62713be7a084260eafa9ab221b1b9833be6 | b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68 | refs/heads/master | 2020-08-24T13:34:04.004149 | 2019-10-25T09:26:00 | 2019-10-25T09:26:00 | 216,822,684 | 0 | 1 | null | 2019-11-08T09:51:54 | 2019-10-22T13:37:13 | Java | UTF-8 | Java | false | false | 5,994 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE90_LDAP_Injection__Property_12.java
Label Definition File: CWE90_LDAP_Injection.label.xml
Template File: sources-sink-12.tmpl.java
*/
/*
* @description
* CWE: 90 LDAP Injection
* BadSource: Property Read data from a system property
* GoodSource: A hardcoded string
* BadSink: data concatenated into LDAP search, which could result in LDAP Injection
* Flow Variant: 12 Control flow: if(IO.staticReturnsTrueOrFalse())
*
* */
import javax.naming.*;
import javax.naming.directory.*;
import java.util.Hashtable;
import java.util.logging.Level;
public class CWE90_LDAP_Injection__Property_12 extends AbstractTestCase
{
/* uses badsource and badsink - see how tools report flaws that don't always occur */
public void bad() throws Throwable
{
String data;
if (IO.staticReturnsTrueOrFalse())
{
/* get system property user.home */
/* POTENTIAL FLAW: Read data from a system property */
data = System.getProperty("user.home");
}
else
{
/* FIX: Use a hardcoded string */
data = "foo";
}
Hashtable<String, String> environmentHashTable = new Hashtable<String, String>();
environmentHashTable.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
environmentHashTable.put(Context.PROVIDER_URL, "ldap://localhost:389");
DirContext directoryContext = null;
try
{
directoryContext = new InitialDirContext(environmentHashTable);
/* POTENTIAL FLAW: data concatenated into LDAP search, which could result in LDAP Injection */
String search = "(cn=" + data + ")";
NamingEnumeration<SearchResult> answer = directoryContext.search("", search, null);
while (answer.hasMore())
{
SearchResult searchResult = answer.next();
Attributes attributes = searchResult.getAttributes();
NamingEnumeration<?> allAttributes = attributes.getAll();
while (allAttributes.hasMore())
{
Attribute attribute = (Attribute) allAttributes.next();
NamingEnumeration<?> allValues = attribute.getAll();
while(allValues.hasMore())
{
IO.writeLine(" Value: " + allValues.next().toString());
}
}
}
}
catch (NamingException exceptNaming)
{
IO.logger.log(Level.WARNING, "The LDAP service was not found or login failed.", exceptNaming);
}
finally
{
if (directoryContext != null)
{
try
{
directoryContext.close();
}
catch (NamingException exceptNaming)
{
IO.logger.log(Level.WARNING, "Error closing DirContext", exceptNaming);
}
}
}
}
/* goodG2B() - use goodsource and badsink by changing the "if" so that
* both branches use the GoodSource */
private void goodG2B() throws Throwable
{
String data;
if (IO.staticReturnsTrueOrFalse())
{
/* FIX: Use a hardcoded string */
data = "foo";
}
else
{
/* FIX: Use a hardcoded string */
data = "foo";
}
Hashtable<String, String> environmentHashTable = new Hashtable<String, String>();
environmentHashTable.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
environmentHashTable.put(Context.PROVIDER_URL, "ldap://localhost:389");
DirContext directoryContext = null;
try
{
directoryContext = new InitialDirContext(environmentHashTable);
/* POTENTIAL FLAW: data concatenated into LDAP search, which could result in LDAP Injection */
String search = "(cn=" + data + ")";
NamingEnumeration<SearchResult> answer = directoryContext.search("", search, null);
while (answer.hasMore())
{
SearchResult searchResult = answer.next();
Attributes attributes = searchResult.getAttributes();
NamingEnumeration<?> allAttributes = attributes.getAll();
while (allAttributes.hasMore())
{
Attribute attribute = (Attribute) allAttributes.next();
NamingEnumeration<?> allValues = attribute.getAll();
while(allValues.hasMore())
{
IO.writeLine(" Value: " + allValues.next().toString());
}
}
}
}
catch (NamingException exceptNaming)
{
IO.logger.log(Level.WARNING, "The LDAP service was not found or login failed.", exceptNaming);
}
finally
{
if (directoryContext != null)
{
try
{
directoryContext.close();
}
catch (NamingException exceptNaming)
{
IO.logger.log(Level.WARNING, "Error closing DirContext", exceptNaming);
}
}
}
}
public void good() throws Throwable
{
goodG2B();
}
/* 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);
}
}
| [
"anhtluet12@gmail.com"
] | anhtluet12@gmail.com |
aa993589dd406aa7db99156cd23cb3322f71ba31 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /newEvaluatedBugs/Jsoup_6_buggy/mutated/1072/QueryParser.java | 69cfe52528325e27d96df1aa0563e77b1d7e5963 | [] | 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 | 13,597 | java | package org.jsoup.select;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jsoup.helper.StringUtil;
import org.jsoup.helper.Validate;
import org.jsoup.parser.TokenQueue;
/**
* Parses a CSS selector into an Evaluator tree.
*/
public class QueryParser {
private final static String[] combinators = {",", ">", "+", "~", " "};
private static final String[] AttributeEvals = new String[]{"=", "!=", "^=", "$=", "*=", "~="};
private TokenQueue tq;
private String query;
private List<Evaluator> evals = new ArrayList<Evaluator>();
/**
* Create a new QueryParser.
* @param query CSS query
*/
private QueryParser(String query) {
this.query = query;
this.tq = new TokenQueue(query);
}
/**
* Parse a CSS query into an Evaluator.
* @param query CSS query
* @return Evaluator
*/
public static Evaluator parse(String query) {
QueryParser p = new QueryParser(query);
return p.parse();
}
/**
* Parse the query
* @return Evaluator
*/
Evaluator parse() {
tq.consumeWhitespace();
if (tq.matchesAny(combinators)) { // if starts with a combinator, use root as elements
evals.add(new StructuralEvaluator.Root());
combinator(tq.consume());
} else {
findElements();
}
while (!tq.isEmpty()) {
// hierarchy and extras
boolean seenWhite = tq.consumeWhitespace();
if (tq.matchesAny(combinators)) {
combinator(tq.consume());
} else if (seenWhite) {
combinator(' ');
} else { // E.class, E#id, E[attr] etc. AND
findElements(); // take next el, #. etc off queue
}
}
containsData();
if (evals.size() == 1)
return evals.get(0);
return new CombiningEvaluator.And(evals);
}
private void combinator(char combinator) {
tq.consumeWhitespace();
String subQuery = consumeSubQuery(); // support multi > childs
Evaluator rootEval; // the new topmost evaluator
Evaluator currentEval; // the evaluator the new eval will be combined to. could be root, or rightmost or.
Evaluator newEval = parse(subQuery); // the evaluator to add into target evaluator
boolean replaceRightMost = false;
if (evals.size() == 1) {
rootEval = currentEval = evals.get(0);
// make sure OR (,) has precedence:
if (rootEval instanceof CombiningEvaluator.Or && combinator != ',') {
currentEval = ((CombiningEvaluator.Or) currentEval).rightMostEvaluator();
replaceRightMost = true;
}
}
else {
rootEval = currentEval = new CombiningEvaluator.And(evals);
}
evals.clear();
// for most combinators: change the current eval into an AND of the current eval and the new eval
if (combinator == '>')
currentEval = new CombiningEvaluator.And(newEval, new StructuralEvaluator.ImmediateParent(currentEval));
else if (combinator == ' ')
currentEval = new CombiningEvaluator.And(newEval, new StructuralEvaluator.Parent(currentEval));
else if (combinator == '+')
currentEval = new CombiningEvaluator.And(newEval, new StructuralEvaluator.ImmediatePreviousSibling(currentEval));
else if (combinator == '~')
currentEval = new CombiningEvaluator.And(newEval, new StructuralEvaluator.PreviousSibling(currentEval));
else if (combinator == ',') { // group or.
CombiningEvaluator.Or or;
if (currentEval instanceof CombiningEvaluator.Or) {
or = (CombiningEvaluator.Or) currentEval;
or.add(newEval);
} else {
or = new CombiningEvaluator.Or();
or.add(currentEval);
or.add(newEval);
}
currentEval = or;
}
else
throw new Selector.SelectorParseException("Unknown combinator: " + combinator);
if (replaceRightMost)
((CombiningEvaluator.Or) rootEval).replaceRightMostEvaluator(currentEval);
else rootEval = currentEval;
evals.add(rootEval);
}
private String consumeSubQuery() {
StringBuilder sq = new StringBuilder();
while (!tq.isEmpty()) {
if (tq.matches("("))
sq.append("(").append(tq.chompBalanced('(', ')')).append(")");
else if (tq.matches("["))
sq.append("[").append(tq.chompBalanced('[', ']')).append("]");
else if (tq.matchesAny(combinators))
break;
else
sq.append(tq.consume());
}
return sq.toString();
}
private void findElements() {
if (tq.matchChomp("#"))
byId();
else if (tq.matchChomp("."))
byClass();
else if (tq.matchesWord() || tq.matches("*|"))
byTag();
else if (tq.matches("["))
byAttribute();
else if (tq.matchChomp("*"))
allElements();
else if (tq.matchChomp(":lt("))
indexLessThan();
else if (tq.matchChomp(":gt("))
indexGreaterThan();
else if (tq.matchChomp(":eq("))
indexEquals();
else if (tq.matches(":has("))
has();
else if (tq.matches(":contains("))
contains(false);
else if (tq.matches(":containsOwn("))
contains(true);
else if (tq.matches(":containsData("))
containsData();
else if (tq.matches(":matches("))
matches(false);
else if (tq.matches(":matchesOwn("))
matches(true);
else if (tq.matches(":not("))
not();
else if (tq.matchChomp(":nth-child("))
cssNthChild(false, false);
else if (tq.matchChomp(":nth-last-child("))
cssNthChild(true, false);
else if (tq.matchChomp(":nth-of-type("))
cssNthChild(false, true);
else if (tq.matchChomp(":nth-last-of-type("))
cssNthChild(true, true);
else if (tq.matchChomp(":first-child"))
evals.add(new Evaluator.IsFirstChild());
else if (tq.matchChomp(":last-child"))
evals.add(new Evaluator.IsLastChild());
else if (tq.matchChomp(":first-of-type"))
evals.add(new Evaluator.IsFirstOfType());
else if (tq.matchChomp(":last-of-type"))
evals.add(new Evaluator.IsLastOfType());
else if (tq.matchChomp(":only-child"))
evals.add(new Evaluator.IsOnlyChild());
else if (tq.matchChomp(":only-of-type"))
evals.add(new Evaluator.IsOnlyOfType());
else if (tq.matchChomp(":empty"))
evals.add(new Evaluator.IsEmpty());
else if (tq.matchChomp(":root"))
evals.add(new Evaluator.IsRoot());
else // unhandled
throw new Selector.SelectorParseException("Could not parse query '%s': unexpected token at '%s'", query, tq.remainder());
}
private void byId() {
String id = tq.consumeCssIdentifier();
Validate.notEmpty(id);
evals.add(new Evaluator.Id(id));
}
private void byClass() {
String className = tq.consumeCssIdentifier();
Validate.notEmpty(className);
evals.add(new Evaluator.Class(className.trim()));
}
private void byTag() {
String tagName = tq.consumeElementSelector();
Validate.notEmpty(tagName);
// namespaces: wildcard match equals(tagName) or ending in ":"+tagName
if (tagName.startsWith("*|")) {
evals.add(new CombiningEvaluator.Or(new Evaluator.Tag(tagName.trim().toLowerCase()), new Evaluator.TagEndsWith(tagName.replace("*|", ":").trim().toLowerCase())));
} else {
// namespaces: if element name is "abc:def", selector must be "abc|def", so flip:
if (tagName.contains("|"))
tagName = tagName.replace("|", ":");
evals.add(new Evaluator.Tag(tagName.trim()));
}
}
private void byAttribute() {
TokenQueue cq = new TokenQueue(tq.chompBalanced('[', ']')); // content queue
String key = cq.consumeToAny(AttributeEvals); // eq, not, start, end, contain, match, (no val)
Validate.notEmpty(key);
cq.consumeWhitespace();
if (cq.isEmpty()) {
if (key.startsWith("^"))
evals.add(new Evaluator.AttributeStarting(key.substring(1)));
else
evals.add(new Evaluator.Attribute(key));
} else {
if (cq.matchChomp("="))
evals.add(new Evaluator.AttributeWithValue(key, cq.remainder()));
else if (cq.matchChomp("!="))
evals.add(new Evaluator.AttributeWithValueNot(key, cq.remainder()));
else if (cq.matchChomp("^="))
evals.add(new Evaluator.AttributeWithValueStarting(key, cq.remainder()));
else if (cq.matchChomp("$="))
evals.add(new Evaluator.AttributeWithValueEnding(key, cq.remainder()));
else if (cq.matchChomp("*="))
evals.add(new Evaluator.AttributeWithValueContaining(key, cq.remainder()));
else if (cq.matchChomp("~="))
evals.add(new Evaluator.AttributeWithValueMatching(key, Pattern.compile(cq.remainder())));
else
throw new Selector.SelectorParseException("Could not parse attribute query '%s': unexpected token at '%s'", query, cq.remainder());
}
}
private void allElements() {
evals.add(new Evaluator.AllElements());
}
// pseudo selectors :lt, :gt, :eq
private void indexLessThan() {
evals.add(new Evaluator.IndexLessThan(consumeIndex()));
}
private void indexGreaterThan() {
evals.add(new Evaluator.IndexGreaterThan(consumeIndex()));
}
private void indexEquals() {
evals.add(new Evaluator.IndexEquals(consumeIndex()));
}
//pseudo selectors :first-child, :last-child, :nth-child, ...
private static final Pattern NTH_AB = Pattern.compile("((\\+|-)?(\\d+)?)n(\\s*(\\+|-)?\\s*\\d+)?", Pattern.CASE_INSENSITIVE);
private static final Pattern NTH_B = Pattern.compile("(\\+|-)?(\\d+)");
private void cssNthChild(boolean backwards, boolean ofType) {
String argS = tq.chompTo(")").trim().toLowerCase();
Matcher mAB = NTH_AB.matcher(argS);
Matcher mB = NTH_B.matcher(argS);
final int a, b;
if ("odd".equals(argS)) {
a = 2;
b = 1;
} else if ("even".equals(argS)) {
a = 2;
b = 0;
} else if (mAB.matches()) {
a = mAB.group(3) != null ? Integer.parseInt(mAB.group(1).replaceFirst("^\\+", "")) : 1;
b = mAB.group(4) != null ? Integer.parseInt(mAB.group(4).replaceFirst("^\\+", "")) : 0;
} else if (mB.matches()) {
a = 0;
b = Integer.parseInt(mB.group().replaceFirst("^\\+", ""));
} else {
throw new Selector.SelectorParseException("Could not parse nth-index '%s': unexpected format", argS);
}
if (ofType)
if (backwards)
evals.add(new Evaluator.IsNthLastOfType(a, b));
else
evals.add(new Evaluator.IsNthOfType(a, b));
else {
if (backwards)
evals.add(new Evaluator.IsNthLastChild(a, b));
else
evals.add(new Evaluator.IsNthChild(a, b));
}
}
private int consumeIndex() {
String indexS = tq.chompTo(")").trim();
Validate.isTrue(StringUtil.isNumeric(indexS), "Index must be numeric");
return Integer.parseInt(indexS);
}
// pseudo selector :has(el)
private void has() {
tq.consume(":has");
String subQuery = tq.chompBalanced('(', ')');
Validate.notEmpty(subQuery, ":has(el) subselect must not be empty");
evals.add(new StructuralEvaluator.Has(parse(subQuery)));
}
// pseudo selector :contains(text), containsOwn(text)
private void contains(boolean own) {
tq.consume(own ? ":containsOwn" : ":contains");
String searchText = TokenQueue.unescape(tq.chompBalanced('(', ')'));
Validate.notEmpty(searchText, ":contains(text) query must not be empty");
if (own)
evals.add(new Evaluator.ContainsOwnText(searchText));
else
evals.add(new Evaluator.ContainsText(searchText));
}
// pseudo selector :containsData(data)
private void containsData() {
tq.consume(":containsData");
String searchText = TokenQueue.unescape(tq.chompBalanced('(', ')'));
Validate.notEmpty(searchText, ":containsData(text) query must not be empty");
evals.add(new Evaluator.ContainsData(searchText));
}
// :matches(regex), matchesOwn(regex)
private void matches(boolean own) {
tq.consume(own ? ":matchesOwn" : ":matches");
String regex = tq.chompBalanced('(', ')'); // don't unescape, as regex bits will be escaped
Validate.notEmpty(regex, ":matches(regex) query must not be empty");
if (own)
evals.add(new Evaluator.MatchesOwn(Pattern.compile(regex)));
else
evals.add(new Evaluator.Matches(Pattern.compile(regex)));
}
// :not(selector)
private void not() {
tq.consume(":not");
String subQuery = tq.chompBalanced('(', ')');
Validate.notEmpty(subQuery, ":not(selector) subselect must not be empty");
evals.add(new StructuralEvaluator.Not(parse(subQuery)));
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
d3b65b58d889c82d4b132628f37e6858d40cd234 | d0c962d9700436975a257cd5a99eb6cba7914e20 | /src/main/java/life/majiang/community/model/User.java | 49c4c332842700e3ad9fca02781b00ef4bcc7d28 | [] | no_license | yus22/community | 7046fe20383fce735572d00654c8cc0187783ffc | 5b8c27ce32f104066f85ab722128092d118e79db | refs/heads/master | 2022-06-26T12:09:55.775646 | 2020-06-09T05:55:45 | 2020-06-09T05:55:45 | 201,917,046 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,228 | java | package life.majiang.community.model;
public class User {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column USER.ID
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
private Long id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column USER.ACCOUNT_ID
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
private String accountId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column USER.NAME
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
private String name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column USER.TOKEN
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
private String token;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column USER.GMT_CREATE
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
private Long gmtCreate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column USER.GMT_MODIFIED
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
private Long gmtModified;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column USER.BIO
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
private String bio;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column USER.AVATAR_URL
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
private String avatarUrl;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column USER.ID
*
* @return the value of USER.ID
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column USER.ID
*
* @param id the value for USER.ID
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column USER.ACCOUNT_ID
*
* @return the value of USER.ACCOUNT_ID
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public String getAccountId() {
return accountId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column USER.ACCOUNT_ID
*
* @param accountId the value for USER.ACCOUNT_ID
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public void setAccountId(String accountId) {
this.accountId = accountId == null ? null : accountId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column USER.NAME
*
* @return the value of USER.NAME
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public String getName() {
return name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column USER.NAME
*
* @param name the value for USER.NAME
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column USER.TOKEN
*
* @return the value of USER.TOKEN
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public String getToken() {
return token;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column USER.TOKEN
*
* @param token the value for USER.TOKEN
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public void setToken(String token) {
this.token = token == null ? null : token.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column USER.GMT_CREATE
*
* @return the value of USER.GMT_CREATE
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public Long getGmtCreate() {
return gmtCreate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column USER.GMT_CREATE
*
* @param gmtCreate the value for USER.GMT_CREATE
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public void setGmtCreate(Long gmtCreate) {
this.gmtCreate = gmtCreate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column USER.GMT_MODIFIED
*
* @return the value of USER.GMT_MODIFIED
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public Long getGmtModified() {
return gmtModified;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column USER.GMT_MODIFIED
*
* @param gmtModified the value for USER.GMT_MODIFIED
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public void setGmtModified(Long gmtModified) {
this.gmtModified = gmtModified;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column USER.BIO
*
* @return the value of USER.BIO
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public String getBio() {
return bio;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column USER.BIO
*
* @param bio the value for USER.BIO
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public void setBio(String bio) {
this.bio = bio == null ? null : bio.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column USER.AVATAR_URL
*
* @return the value of USER.AVATAR_URL
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public String getAvatarUrl() {
return avatarUrl;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column USER.AVATAR_URL
*
* @param avatarUrl the value for USER.AVATAR_URL
*
* @mbg.generated Fri May 01 10:00:25 CST 2020
*/
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim();
}
} | [
"1239993948@qq.com"
] | 1239993948@qq.com |
6fec633e9eed8b84c87eb7fdbb6759b0d83f0e56 | 03ebfeabb614b0a8e86443b2a3a767c8aad42453 | /src/playerStrategy/BlackJackStrategyAggresive.java | 88c426c214c265dbe08b55b7449ac39c69ef9fff | [] | no_license | leo113000/TP3-BlackJack | 545cae21e83bd02d6f3d6622b2a9ad79b95f2b8d | 4ab45a333cf0fe34eb3b0301c826ab1e2bdb957f | refs/heads/master | 2020-03-07T06:22:18.377955 | 2018-04-08T21:38:52 | 2018-04-08T21:38:52 | 127,320,339 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | package playerStrategy;
import java.util.ArrayList;
import deck.Card;
public class BlackJackStrategyAggresive extends BlackJackStrategy{
@Override
public Boolean askAnotherCard(int cardsValue) { return cardsValue<18; }
}
| [
"leo114000@gmail.com"
] | leo114000@gmail.com |
069da94b21c17d791627515b9c337d7eab90464c | a1f54c4fc08b70dfcde20dd3dc2e0b544850ceb9 | /Habibullin/src/Cp_24/Client.java | df2a48c5d29ef94222a7de0aaaf8cbd03d12cd3d | [] | no_license | smith1984/java_src_tutorial | 175d4f69e443084f82c48ab7457dcacfae3dfb23 | 50fd98e37d675f597074a6e53a9ef34824d5fcd4 | refs/heads/master | 2020-04-09T03:38:38.848665 | 2018-12-01T21:57:20 | 2018-12-01T21:57:20 | 159,990,788 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,406 | java | package Cp_24;
import java.net.*;
import java.io.*;
import java.util.*;
public class Client{
public static void main(String[] args){
if (args.length != 3){
System.err.println("Usage: Client host port file");
System.exit(0);
}
String host = args[0];
int port = Integer.parseInt(args[1]);
String file = args[2];
try{
Socket sock = new Socket(host, port);
PrintWriter pw = new PrintWriter(new OutputStreamWriter(
sock.getOutputStream()), true);
pw.println("POST " + file + " HTTP/1.1\n");
BufferedReader br = new BufferedReader(new InputStreamReader(
sock.getInputStream()));
String line = null;
line = br.readLine();
StringTokenizer st = new StringTokenizer(line);
String code = null;
if ((st.countTokens() >= 2) && st.nextToken().equals("POST")){
if ((code = st.nextToken()) != "200"){
System.err.println("File not found, code = " + code);
System.exit(0);
}
}
while ((line = br.readLine()) != null)
System.out.println(line);
sock.close();
}catch(Exception e){
System.err.println(e);
}
}
} | [
"smith150384@gmail.com"
] | smith150384@gmail.com |
c5f1e53a7643622d17c36895a65dfaa23ee01c92 | 0cec0cb357e30a15dcb08cb48767f98f7f52e46f | /Chapter-8/Car3.java | edf66fddf743f4aa102b066137c0162994957f21 | [] | no_license | jackfusion/Object-Oriented-Programming | 85ee8724c0b7b93a6cdda88e41fd30b7d32932f5 | bc77e3ec695f8f28b928f5b5edc4502153435551 | refs/heads/master | 2023-04-16T05:28:41.412305 | 2021-05-05T15:21:41 | 2021-05-05T15:21:41 | 359,615,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java | /********************************************************
* Car3.java - example from the book *
* *
* This class illustrates methods that can be chained. *
********************************************************/
public class Car3 {
private String make;
private int year;
//********************************************************
public Car3 setMake(String make) {
this.make = make;
return this;
}
public Car3 setYear(int year) {
this.year = year;
return this;
}
//********************************************************
public void printIt() {
System.out.println(this.make + ", " + this.year);
}
}
| [
"kendewitt@yftg.ca"
] | kendewitt@yftg.ca |
71e60f4a3aef802ae7fbf51f3bdfc4b9ed4552cc | f18218a61ced4025217c20a605ada8a55e765e67 | /Strategy/src/structure/hierarchy/concrete/Bird.java | ac3a2924320a4892f621df83f194b5452bb46af8 | [] | no_license | Diecaal/DesignPatterns | 4bafbd6bca9d6f2ed43dcb88b0c32e794427f8b7 | 2e122485ce10b4512b439c54e154bf4d101cb724 | refs/heads/master | 2023-05-14T12:51:45.420071 | 2021-06-01T19:23:00 | 2021-06-01T19:23:00 | 364,739,490 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 302 | java | package structure.hierarchy.concrete;
import structure.hierarchy.Animal;
import structure.strategy.concrete.ItFlys;
public class Bird extends Animal {
public Bird(String name, double height, int weight) {
super(name, height, weight);
setSound("Tweet!");
setFlyingAbility(new ItFlys());
}
}
| [
"diecaal@gmail.com"
] | diecaal@gmail.com |
5ac436cc7c867f0bed7fc329acef5e6cae3c3685 | 4be4dda9ac2efaf8e9099b263837488d86057ab3 | /C0920G1-CarInsurance-BE/src/main/java/com/c0920g1/c0920g1carinsurancebe/repository/PositionRepository.java | 7695effdc8faa62cb84a59aa9e8265e9d8768178 | [] | no_license | duchiep154/CarInsuranceBE | 6df542af2df13b9ed5e1685f344d8ae4fc18ac63 | 54a1d3c7102bc5382cbc15fedc438e9e97f230e7 | refs/heads/main | 2023-03-31T05:01:57.981652 | 2021-03-25T04:35:58 | 2021-03-25T04:35:58 | 351,308,892 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 481 | java | package com.c0920g1.c0920g1carinsurancebe.repository;
import com.c0920g1.c0920g1carinsurancebe.entities.employee.Position;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface PositionRepository extends JpaRepository<Position, Long> {
@Query(value = "select u from Position u")
List<Position> findAll();
}
| [
"duchiep154@gmail.com"
] | duchiep154@gmail.com |
60276fcbde9924e2ea781aca13009e1649230178 | 2efe3bb5a96f93b52e158834342b2152f3a648d6 | /Lesson15/TextSimilarity-v01/src/ru/kpfu/itis/textsimilarity/FileNameTextProvider.java | 24b65fee1fe389498116a39b98f6327fc18ba33d | [] | no_license | Gulnaz1304/Amirkhanova_11-807 | 44044e9596a108d997e8b537841d70f497f45666 | 1667becb51e0ff939288cb74e53ebf87a4d54141 | refs/heads/master | 2020-03-28T12:24:42.391582 | 2018-12-11T10:36:58 | 2018-12-11T10:36:58 | 148,294,839 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 371 | java | package ru.kpfu.itis.textsimilarity;
import java.io.File;
public class FileNameTextProvider extends FileTextProvider {
public FileNameTextProvider(File input) {
super(input);
}
@Override
public String getText() {
String filename = input.getName();
String text = super.getText();
return filename + ": " + text;
}
} | [
"mrrrrrrrrrrrrr1@icloud.com"
] | mrrrrrrrrrrrrr1@icloud.com |
4cfe723b8158f85d41834bac14d5c99e0d833fad | b930dcf5f4a92c7969111b9cd5c11f36e2b62d1d | /customer-service/src/main/java/com/sliit/mtit/microservice/customerservice/controller/package-info.java | f13c5798f7e27bb976ec6b7d680f055d2b3b49e5 | [] | no_license | infas03/MTIT_Microservice | 30f56ee49ef6fd104416dfe580185cf2756f2909 | 9575bd99c4bfb36afef8024e28f48e658cefe51e | refs/heads/main | 2023-05-01T11:19:22.903107 | 2021-05-19T18:14:04 | 2021-05-19T18:14:04 | 368,959,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 63 | java | package com.sliit.mtit.microservice.customerservice.controller; | [
"noreply@github.com"
] | noreply@github.com |
eceadf98a1590be723823fb19ee3bf1ee8661ded | 2a1f054e49f9cc2c43fc17b810a518471ec18caa | /VaultSpringAdminPanel/src/main/java/com/snap/controller/JavaVersion.java | 86b531866597a57f9e6c9a2c4151d7d2242f504c | [] | no_license | lagging/DevTools | 424405526448da766cd3fd004a08e9dd31f4a998 | 4f5e66ba0c2d78fba3a68992a92d4087ebb9c800 | refs/heads/master | 2021-01-10T08:02:51.690991 | 2016-02-26T08:20:33 | 2016-02-26T08:20:33 | 52,588,947 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 179 | java | package com.snap.controller;
public class JavaVersion {
public static void main(String[] args) {
System.out.println(System.getProperty("java.runtime.version"));
}
}
| [
"ashish.rathore@snapdeal.com"
] | ashish.rathore@snapdeal.com |
d61c95f0f1064242c3e311e9eedeb37f0fc6f0fe | 768ac7d2fbff7b31da820c0d6a7a423c7e2fe8b8 | /WEB-INF/java/com/youku/search/sort/util/filter/JSONFilter.java | d185935a00bba0969d7c36a28510592439685456 | [] | no_license | aiter/-java-soku | 9d184fb047474f1e5cb8df898fcbdb16967ee636 | 864b933d8134386bd5b97c5b0dd37627f7532d8d | refs/heads/master | 2021-01-18T17:41:28.396499 | 2015-08-24T06:09:21 | 2015-08-24T06:09:21 | 41,285,373 | 0 | 0 | null | 2015-08-24T06:08:00 | 2015-08-24T06:08:00 | null | UTF-8 | Java | false | false | 306 | java | package com.youku.search.sort.util.filter;
import com.youku.search.sort.util.BaseFilter;
public class JSONFilter extends BaseFilter {
@Override
protected void innerFilter(char[] chars, int i) {
if (chars[i] == '\\' || chars[i] == '/' || chars[i] == '"') {
chars[i] = ' ';
}
}
}
| [
"lyu302@gmail.com"
] | lyu302@gmail.com |
f0cfe01f42765013a0eae9cb88e648f62ee3d617 | 221003e3cee5783948b3c00ad72be93463b9b23c | /modules/exam-service-parent/exam-service-api/src/main/java/com/github/tangyi/exam/api/module/ExaminationSubject.java | faa219f71952c212888bb1f19e012e6ede442bc3 | [
"MIT"
] | permissive | chenzhenguo/spring-microservice-exam | da8bde53c2f95c13f659a78fe8a74abf2665733f | a2eccefd64d485722d12d5d5361d97514c545e16 | refs/heads/master | 2023-02-13T07:32:53.793698 | 2020-10-23T10:55:54 | 2020-10-23T10:55:54 | 287,155,902 | 0 | 0 | MIT | 2021-01-13T05:26:32 | 2020-08-13T01:52:07 | null | UTF-8 | Java | false | false | 893 | java | package com.github.tangyi.exam.api.module;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.tangyi.common.core.persistence.BaseEntity;
import lombok.Data;
/**
* 考试题目关联
*
* @author tangyi
* @date 2019/6/16 13:46
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ExaminationSubject extends BaseEntity<ExaminationSubject> {
/**
* 考试ID
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long examinationId;
/**
* 分类ID
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long categoryId;
/**
* 题目ID
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long subjectId;
/**
* 题目类型,0:选择题,1:简答题,2:判断题,3:多选题
*/
private Integer type;
}
| [
"1633736729@qq.com"
] | 1633736729@qq.com |
bcedcd9dcbc32950b2611cfe9cde9b9e8b08f55c | a27c88ba183bc7385a66c3b99cd2fbb8cda49797 | /src/main/java/egovframework/let/cop/com/service/BoardUseInfVO.java | 479fb6729593d539c651548d61dca8e66c9fc4fb | [
"Apache-2.0"
] | permissive | WooYoungsik/egovframe-simple-homepage-template | 6aaf1b9d2c5297e4f4f934aa951704bb4c921d67 | 7c5208432e9b67418ae69913f92c9fe6353a078f | refs/heads/main | 2023-06-29T05:31:54.875800 | 2021-07-24T15:49:54 | 2021-07-24T15:49:54 | 389,075,230 | 0 | 0 | Apache-2.0 | 2021-07-24T11:01:49 | 2021-07-24T11:01:49 | null | UTF-8 | Java | false | false | 11,489 | java | package egovframework.let.cop.com.service;
import java.io.Serializable;
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* 게시판의 이용정보를 관리하기 위한 VO 클래스
* @author 공통서비스개발팀 이삼섭
* @since 2009.04.02
* @version 1.0
* @see
*
* <pre>
* << 개정이력(Modification Information) >>
*
* 수정일 수정자 수정내용
* ------- -------- ---------------------------
* 2009.04.02 이삼섭 최초 생성
* 2011.05.31 JJY 경량환경 커스터마이징버전 생성
*
* </pre>
*/
public class BoardUseInfVO extends BoardUseInf implements Serializable {
/**
* serialVersion UID
*/
private static final long serialVersionUID = -2688781320530443850L;
/** 검색시작일 */
private String searchBgnDe = "";
/** 검색조건 */
private String searchCnd = "";
/** 검색종료일 */
private String searchEndDe = "";
/** 검색단어 */
private String searchWrd = "";
/** 정렬순서(DESC,ASC) */
private long sortOrdr = 0L;
/** 검색사용여부 */
private String searchUseYn = "";
/** 현재페이지 */
private int pageIndex = 1;
/** 페이지갯수 */
private int pageUnit = 10;
/** 페이지사이즈 */
private int pageSize = 10;
/** 첫페이지 인덱스 */
private int firstIndex = 1;
/** 마지막페이지 인덱스 */
private int lastIndex = 1;
/** 페이지당 레코드 개수 */
private int recordCountPerPage = 10;
/** 레코드 번호 */
private int rowNo = 0;
/** 최초 등록자명 */
private String frstRegisterNm = "";
/** 최종 수정자명 */
private String lastUpdusrNm = "";
/** 등록구분 코드명 */
private String registSeCodeNm = "";
/** 커뮤니티 아이디 */
private String cmmntyId = "";
/** 커뮤니티 명 */
private String cmmntyNm = "";
/** 동호회 아이디 */
private String clbId = "";
/** 동호회 명 */
private String clbNm = "";
/** 게시판 명 */
private String bbsNm = "";
/** 사용자 명 */
private String userNm = "";
/** 제공 URL */
private String provdUrl = "";
/** 게시판 유형코드 */
private String bbsTyCode = "";
/**
* searchBgnDe attribute를 리턴한다.
*
* @return the searchBgnDe
*/
public String getSearchBgnDe() {
return searchBgnDe;
}
/**
* searchBgnDe attribute 값을 설정한다.
*
* @param searchBgnDe
* the searchBgnDe to set
*/
public void setSearchBgnDe(String searchBgnDe) {
this.searchBgnDe = searchBgnDe;
}
/**
* searchCnd attribute를 리턴한다.
*
* @return the searchCnd
*/
public String getSearchCnd() {
return searchCnd;
}
/**
* searchCnd attribute 값을 설정한다.
*
* @param searchCnd
* the searchCnd to set
*/
public void setSearchCnd(String searchCnd) {
this.searchCnd = searchCnd;
}
/**
* searchEndDe attribute를 리턴한다.
*
* @return the searchEndDe
*/
public String getSearchEndDe() {
return searchEndDe;
}
/**
* searchEndDe attribute 값을 설정한다.
*
* @param searchEndDe
* the searchEndDe to set
*/
public void setSearchEndDe(String searchEndDe) {
this.searchEndDe = searchEndDe;
}
/**
* searchWrd attribute를 리턴한다.
*
* @return the searchWrd
*/
public String getSearchWrd() {
return searchWrd;
}
/**
* searchWrd attribute 값을 설정한다.
*
* @param searchWrd
* the searchWrd to set
*/
public void setSearchWrd(String searchWrd) {
this.searchWrd = searchWrd;
}
/**
* sortOrdr attribute를 리턴한다.
*
* @return the sortOrdr
*/
public long getSortOrdr() {
return sortOrdr;
}
/**
* sortOrdr attribute 값을 설정한다.
*
* @param sortOrdr
* the sortOrdr to set
*/
public void setSortOrdr(long sortOrdr) {
this.sortOrdr = sortOrdr;
}
/**
* searchUseYn attribute를 리턴한다.
*
* @return the searchUseYn
*/
public String getSearchUseYn() {
return searchUseYn;
}
/**
* searchUseYn attribute 값을 설정한다.
*
* @param searchUseYn
* the searchUseYn to set
*/
public void setSearchUseYn(String searchUseYn) {
this.searchUseYn = searchUseYn;
}
/**
* pageIndex attribute를 리턴한다.
*
* @return the pageIndex
*/
public int getPageIndex() {
return pageIndex;
}
/**
* pageIndex attribute 값을 설정한다.
*
* @param pageIndex
* the pageIndex to set
*/
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
/**
* pageUnit attribute를 리턴한다.
*
* @return the pageUnit
*/
public int getPageUnit() {
return pageUnit;
}
/**
* pageUnit attribute 값을 설정한다.
*
* @param pageUnit
* the pageUnit to set
*/
public void setPageUnit(int pageUnit) {
this.pageUnit = pageUnit;
}
/**
* pageSize attribute를 리턴한다.
*
* @return the pageSize
*/
public int getPageSize() {
return pageSize;
}
/**
* pageSize attribute 값을 설정한다.
*
* @param pageSize
* the pageSize to set
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* firstIndex attribute를 리턴한다.
*
* @return the firstIndex
*/
public int getFirstIndex() {
return firstIndex;
}
/**
* firstIndex attribute 값을 설정한다.
*
* @param firstIndex
* the firstIndex to set
*/
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* lastIndex attribute를 리턴한다.
*
* @return the lastIndex
*/
public int getLastIndex() {
return lastIndex;
}
/**
* lastIndex attribute 값을 설정한다.
*
* @param lastIndex
* the lastIndex to set
*/
public void setLastIndex(int lastIndex) {
this.lastIndex = lastIndex;
}
/**
* recordCountPerPage attribute를 리턴한다.
*
* @return the recordCountPerPage
*/
public int getRecordCountPerPage() {
return recordCountPerPage;
}
/**
* recordCountPerPage attribute 값을 설정한다.
*
* @param recordCountPerPage
* the recordCountPerPage to set
*/
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
/**
* rowNo attribute를 리턴한다.
*
* @return the rowNo
*/
public int getRowNo() {
return rowNo;
}
/**
* rowNo attribute 값을 설정한다.
*
* @param rowNo
* the rowNo to set
*/
public void setRowNo(int rowNo) {
this.rowNo = rowNo;
}
/**
* frstRegisterNm attribute를 리턴한다.
*
* @return the frstRegisterNm
*/
public String getFrstRegisterNm() {
return frstRegisterNm;
}
/**
* frstRegisterNm attribute 값을 설정한다.
*
* @param frstRegisterNm
* the frstRegisterNm to set
*/
public void setFrstRegisterNm(String frstRegisterNm) {
this.frstRegisterNm = frstRegisterNm;
}
/**
* lastUpdusrNm attribute를 리턴한다.
*
* @return the lastUpdusrNm
*/
public String getLastUpdusrNm() {
return lastUpdusrNm;
}
/**
* lastUpdusrNm attribute 값을 설정한다.
*
* @param lastUpdusrNm
* the lastUpdusrNm to set
*/
public void setLastUpdusrNm(String lastUpdusrNm) {
this.lastUpdusrNm = lastUpdusrNm;
}
/**
* registSeCodeNm attribute를 리턴한다.
*
* @return the registSeCodeNm
*/
public String getRegistSeCodeNm() {
return registSeCodeNm;
}
/**
* registSeCodeNm attribute 값을 설정한다.
*
* @param registSeCodeNm
* the registSeCodeNm to set
*/
public void setRegistSeCodeNm(String registSeCodeNm) {
this.registSeCodeNm = registSeCodeNm;
}
/**
* cmmntyId attribute를 리턴한다.
*
* @return the cmmntyId
*/
public String getCmmntyId() {
return cmmntyId;
}
/**
* cmmntyId attribute 값을 설정한다.
*
* @param cmmntyId
* the cmmntyId to set
*/
public void setCmmntyId(String cmmntyId) {
this.cmmntyId = cmmntyId;
}
/**
* cmmntyNm attribute를 리턴한다.
*
* @return the cmmntyNm
*/
public String getCmmntyNm() {
return cmmntyNm;
}
/**
* cmmntyNm attribute 값을 설정한다.
*
* @param cmmntyNm
* the cmmntyNm to set
*/
public void setCmmntyNm(String cmmntyNm) {
this.cmmntyNm = cmmntyNm;
}
/**
* clbId attribute를 리턴한다.
*
* @return the clbId
*/
public String getClbId() {
return clbId;
}
/**
* clbId attribute 값을 설정한다.
*
* @param clbId
* the clbId to set
*/
public void setClbId(String clbId) {
this.clbId = clbId;
}
/**
* clbNm attribute를 리턴한다.
*
* @return the clbNm
*/
public String getClbNm() {
return clbNm;
}
/**
* clbNm attribute 값을 설정한다.
*
* @param clbNm
* the clbNm to set
*/
public void setClbNm(String clbNm) {
this.clbNm = clbNm;
}
/**
* bbsNm attribute를 리턴한다.
*
* @return the bbsNm
*/
public String getBbsNm() {
return bbsNm;
}
/**
* bbsNm attribute 값을 설정한다.
*
* @param bbsNm
* the bbsNm to set
*/
public void setBbsNm(String bbsNm) {
this.bbsNm = bbsNm;
}
/**
* userNm attribute를 리턴한다.
*
* @return the userNm
*/
public String getUserNm() {
return userNm;
}
/**
* userNm attribute 값을 설정한다.
*
* @param userNm
* the userNm to set
*/
public void setUserNm(String userNm) {
this.userNm = userNm;
}
/**
* provdUrl attribute를 리턴한다.
*
* @return the provdUrl
*/
public String getProvdUrl() {
return provdUrl;
}
/**
* provdUrl attribute 값을 설정한다.
*
* @param provdUrl
* the provdUrl to set
*/
public void setProvdUrl(String provdUrl) {
this.provdUrl = provdUrl;
}
/**
* bbsTyCode attribute를 리턴한다.
* @return the bbsTyCode
*/
public String getBbsTyCode() {
return bbsTyCode;
}
/**
* bbsTyCode attribute 값을 설정한다.
* @param bbsTyCode the bbsTyCode to set
*/
public void setBbsTyCode(String bbsTyCode) {
this.bbsTyCode = bbsTyCode;
}
/**
* toString 메소드를 대치한다.
*/
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
}
| [
"ohorage21@naver.com"
] | ohorage21@naver.com |
42664b3c7a338307c93fec4967d05cdb91748765 | 4cba848019e2b86ceec35e9a37c4628fcb2e6114 | /src/main/java/com/example/auto/config/RedisConfig.java | 9b251d0c61d24aac881ac196a1ffd6de7dbf8db2 | [] | no_license | jakkkkead/bieshe-auto | 983599a70977d6d83344878ab41b80d71c62838a | b3211562e2bd784f48d70a12fe5d4a1a91eb97a3 | refs/heads/master | 2020-04-28T10:51:57.750442 | 2019-04-08T16:14:12 | 2019-04-08T16:14:12 | 175,217,328 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,636 | java | package com.example.auto.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
@EnableCaching//开启注解
public class RedisConfig {
@Bean
public CacheManager cacheManager(RedisTemplate<?, ?> redisTemplate) {
CacheManager cacheManager = new RedisCacheManager(redisTemplate);
return cacheManager;
/*RedisCacheManager rcm = new RedisCacheManager(redisTemplate);
// 多个缓存的名称,目前只定义了一个
rcm.setCacheNames(Arrays.asList("thisredis"));
//设置缓存默认过期时间(秒)
rcm.setDefaultExpiration(600);
return rcm;*/
}
@Bean
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<Object, Object> template = new RedisTemplate<>();
template.setConnectionFactory(connectionFactory);
//使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper mapper = new ObjectMapper();
mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
serializer.setObjectMapper(mapper);
template.setValueSerializer(serializer);
//使用StringRedisSerializer来序列化和反序列化redis的key值
template.setKeySerializer(new StringRedisSerializer());
template.afterPropertiesSet();
return template;
}
@Bean
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory factory) {
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(factory);
return stringRedisTemplate;
}
}
| [
"123456789"
] | 123456789 |
e2a2aa302b10e9dcd798dc3918769b8f97cc6869 | c90a649ed12562483bd0aec071c5e2b3421c7e64 | /polytech/src/main/java/kr/co/uclick/controller/ServiceController.java | c2173e010226fda15df451efd85207f790d73a35 | [] | no_license | grandtempler/kopo10 | a34971664cc9b6f2d0a22b80e88994ee6beb228a | f8ff4bc634c68e00e63c5530615450081f151f15 | refs/heads/master | 2020-03-27T08:25:19.279105 | 2018-08-27T05:55:20 | 2018-08-27T05:55:20 | 146,252,542 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,312 | java | package kr.co.uclick.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import kr.co.uclick.entity.Phone;
import kr.co.uclick.entity.User;
import kr.co.uclick.service.PhoneService;
import kr.co.uclick.service.UserService;
@Controller
public class ServiceController {
// private static final Logger logger = LoggerFactory.getLogger(ServiceController.class);
@Autowired
private UserService userService;
@Autowired
private PhoneService phoneService;
@Transactional(readOnly = true)
public List<User> setUsers(String searchusername, String searchphonenumber) {
List<User> users = new ArrayList<User>();
if (searchusername != null && !searchusername.equals("")) { // 사용자검색 파라미터가 null이 아니고 빈 Str이 아닐 때
users = userService.findUserByNameContaining(searchusername);
} else if (searchphonenumber != null && !searchphonenumber.equals("")) { // 핸드폰검색 파라미터가 null이 아니고 빈 Str이 아닐 때
List<Phone> phoneList = phoneService.findPhoneByPhonenumberContaining(searchphonenumber);
for(Phone phone : phoneList) {
users.add(phone.getUser());
}
users = userService.deduplication(users);
} else {
users = userService.findAll();
}
return users;
}
@RequestMapping(value = "/", method = RequestMethod.GET) // 파라미터 받는 법 : get방식
public String home(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
model.addAttribute("Samples", "홈임둥" );
return "sample";
}
@RequestMapping(value = "/user", method = RequestMethod.GET) // 파라미터 받는 법 : get방식
public String user(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
List<User> users = userService.findAll();
model.addAttribute("users", users );
model.addAttribute("id", param.get("id") );
return "user";
}
@RequestMapping(value = "/user_1", method = {RequestMethod.GET, RequestMethod.POST}) // 파라미터 받는 법 : get방식
public String user_1(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
model.addAttribute("searchusername", param.get("searchusername")); //
model.addAttribute("searchphonenumber", param.get("searchphonenumber")); //
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users ); // user list인 users 객체를 넘겨줌
model.addAttribute("idpl", param.get("idpl") ); // 핸드폰 리스트를 누른 경우 들어오는 해당 사용자의 id + phonelist(pl) 파라미터를 받아 넘겨줌
model.addAttribute("plist", param.get("plist") ); // 핸드폰 리스트를 누른 경우 들어오는 해당 사용자의 id + phonelist(pl) 파라미터를 받아 넘겨줌
model.addAttribute("userup", param.get("userup") ); // 유저번호로 해당 라인을 업데이트 상태로 만들어주는 userup 파라미터를 받아 넘겨줌
model.addAttribute("phup", param.get("phup") ); // 업데이트할 핸드폰의 id인 phup 파라미터를 받아 다시 넘겨줌
model.addAttribute("userinsert", param.get("userinsert")); // 유저 등록인지 여부를 판단할 수 있는 userinsert 파라미터를 받아 다시 넘겨줌
model.addAttribute("phinsert", param.get("phinsert")); // 폰 등록인지 여부를 판단할 수 있는 phinsert 파라미터를 받아 다시 넘겨줌
return "user_1";
}
@RequestMapping(value = "/user_search", method = RequestMethod.POST)
public String user_search(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
System.out.println("user_search :: searchusername: " + searchusername);
System.out.println("user_search :: searchphonenumber: " + searchphonenumber);
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users );
model.addAttribute("searchusername", param.get("searchusername"));
model.addAttribute("searchphonenumber", param.get("searchphonenumber"));
return "user_1";
}
@RequestMapping(value = "/phone_search", method = RequestMethod.POST)
public String phone_search(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users );
model.addAttribute("searchusername", param.get("searchusername"));
model.addAttribute("searchphonenumber", param.get("searchphonenumber"));
return "user_1";
}
@RequestMapping(value = "/user_insert", method = RequestMethod.POST)
public String user_insert(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String name = param.get("name");
String age = param.get("age");
String sex = param.get("sex");
String address1 = param.get("address1"); // 업데이트할 전화번호
String address2 = param.get("address2"); // 업데이트할 텔레콤
User user = new User();
user.setName(name);
user.setAge(age);
user.setSex(sex);
user.setAddress1(address1);
user.setAddress2(address2);
userService.save(user); // 유저 등록
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users );
model.addAttribute("idpl", param.get("idpl") );
model.addAttribute("searchusername", param.get("searchusername"));
model.addAttribute("searchphonenumber", param.get("searchphonenumber"));
return "user_1";
}
@RequestMapping(value = "/user_update", method = RequestMethod.POST)
public String user_update(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String userup = param.get("userup"); // 업데이트할 유저의 아이디
String name = param.get("name");
String age = param.get("age");
String sex = param.get("sex");
String address1 = param.get("address1"); // 업데이트할 전화번호
String address2 = param.get("address2"); // 업데이트할 텔레콤
User user = new User();
user.setId(Long.parseLong(userup));
user.setName(name);
user.setAge(age);
user.setSex(sex);
user.setAddress1(address1);
user.setAddress2(address2);
userService.updateOne(user); // 유저 업데이트
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
System.out.println("user_update :: searchusername: " + searchusername);
System.out.println("user_update :: searchphonenumber: " + searchphonenumber);
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users );
model.addAttribute("idpl", param.get("idpl") );
model.addAttribute("searchusername", param.get("searchusername"));
model.addAttribute("searchphonenumber", param.get("searchphonenumber"));
return "user_1";
}
@RequestMapping(value = "/user_delete", method = {RequestMethod.GET, RequestMethod.POST}) // DB에서 phone 테이블 외래키를 RESTRICT에서 CASCADE로 변경해야 한다.
public String user_delete(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String userdel = param.get("userdel"); // 삭제할 유저의 아이디
User user = userService.selectOne(Long.parseLong(userdel));
userService.deleteOne(user); // 유저 삭제
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users );
model.addAttribute("idpl", param.get("idpl") );
model.addAttribute("searchusername", param.get("searchusername"));
model.addAttribute("searchphonenumber", param.get("searchphonenumber"));
return "user_1";
}
@RequestMapping(value = "/phone_insert", method = RequestMethod.POST)
public String phone_insert(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String idpl = param.get("idpl"); // 유저의 아이디
String phonenumber = param.get("phonenumber"); // 업데이트할 전화번호
String telecom = param.get("telecom"); // 업데이트할 텔레콤
if (phoneService.phoneInsertDuplicationChk(phonenumber)) {
Phone phone = new Phone();
phone.setPhonenumber(phonenumber);
phone.setTelecom(telecom);
phone.setUser(userService.selectOne(Long.parseLong(idpl)));
phoneService.save(phone); // 핸드폰 업데이트
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users );
model.addAttribute("idpl", param.get("idpl") );
model.addAttribute("searchusername", param.get("searchusername"));
model.addAttribute("searchphonenumber", param.get("searchphonenumber"));
return "user_1";
} else {
model.addAttribute("alertplace", "Phone Insert");
model.addAttribute("alertmessage", "중복된 핸드폰 번호입니다.");
return "alert";
}
}
@RequestMapping(value = "/phone_update", method = RequestMethod.POST)
public String phone_update(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String idpl = param.get("idpl"); // 유저의 아이디
String phonenumber = param.get("phonenumber"); // 업데이트할 전화번호
String telecom = param.get("telecom"); // 업데이트할 텔레콤
String phid = param.get("phid"); // 해당 유저의 수정할 핸드폰 아이디
if (phoneService.phoneUpdateDuplicationChk(phonenumber, Long.parseLong(phid))) {
Phone phone = new Phone();
phone.setId(Long.parseLong(phid));
phone.setPhonenumber(phonenumber);
phone.setTelecom(telecom);
phone.setUser(userService.selectOne(Long.parseLong(idpl)));
phoneService.updateOne(phone); // 핸드폰 업데이트
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users );
model.addAttribute("idpl", param.get("idpl") );
model.addAttribute("searchusername", param.get("searchusername"));
model.addAttribute("searchphonenumber", param.get("searchphonenumber"));
return "user_1";
} else {
model.addAttribute("alertplace", "Phone Update");
model.addAttribute("alertmessage", "중복된 핸드폰 번호입니다.");
return "alert";
}
}
@RequestMapping(value = "/phone_delete", method = {RequestMethod.GET, RequestMethod.POST})
public String phone_delete(Locale locale, @RequestParam Map<String, String> param, Model model) { // page, page당 갯수 : itemCountPerPage
String phdel = param.get("phdel"); // 삭제할 핸드폰의 아이디
Phone phone = phoneService.selectOne(Long.parseLong(phdel));
phoneService.deleteOne(phone); // 핸드폰 삭제
String searchusername = param.get("searchusername");
String searchphonenumber = param.get("searchphonenumber");
List<User> users = setUsers(searchusername, searchphonenumber); // 유저 리스트가 들어갈 리스트 users 를 세팅한다.
model.addAttribute("users", users );
model.addAttribute("idpl", param.get("idpl") );
model.addAttribute("searchusername", param.get("searchusername"));
model.addAttribute("searchphonenumber", param.get("searchphonenumber"));
return "user_1";
}
}
| [
"grandtempler@naver.com"
] | grandtempler@naver.com |
08bbcb08f30dbe5636f19bc999e850579249e3c1 | 4efe3aec9b0ac0ef05fa08f27e351d16489afd90 | /README.java | 092143336a070b185c5a57937a44851524380436 | [] | no_license | saravanabalasubramaniam/Decimal | da031dfd5d4b6f4c0222d2968c35ba29ae1ad46e | 600c1fc124b48440bf52421fae991c3ffa537e79 | refs/heads/master | 2020-04-24T02:13:25.226694 | 2019-02-20T08:25:13 | 2019-02-20T08:25:13 | 171,629,405 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | import java.io.*;
import java.util.*;
class Decimal
{
public static void main(String args[])
{
Scanner input=new Scanner(System.in);
double a=input.nextFloat();
double b=Math.ceil(a);
System.out.println(Math.round(b));
}
}
| [
"noreply@github.com"
] | noreply@github.com |
282b108b05f8abfabc44b5c0ed54dbd1c7f09ea4 | 01df1cfea13d7b025161429bb86a6d35a6a75f3a | /app/src/test/java/cn/kavel/demo/javantwk/ExampleUnitTest.java | 88a8806d28b98cbebbd02cf0e3d3081a07d76b55 | [] | no_license | KavelCortex/JavaNtwk | 0568076377e1b8cd832ec3bdedeecbae0b878650 | 406e8aabd57fafa3944b938a76e7916f37d09b68 | refs/heads/master | 2021-01-18T17:23:50.955425 | 2017-04-09T15:03:44 | 2017-04-09T15:03:44 | 86,794,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | package cn.kavel.demo.javantwk;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"me@kavel.cn"
] | me@kavel.cn |
666751c948b7a26ce57f1ba5d60273f4d00267d0 | c81ff5289efa6f8c52b2601af1ece43b234c1e45 | /S3Proftaak/src/s3proftaak/Client/Visuals/Lobby_Utils/LocalPlayer.java | 88751d956316ff633a247373009345577b47036c | [] | no_license | RBijlard/S3Proftaak | acca4433b384fe54e06831fb69f97a9db40cf4a4 | 2b472cb1d9fe33a6fe0d8ee283fb593f22a2e5bc | refs/heads/master | 2021-01-10T16:08:38.863713 | 2016-01-27T08:51:19 | 2016-01-27T08:51:19 | 43,669,756 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 734 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package s3proftaak.Client.Visuals.Lobby_Utils;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
/**
*
* @author Stan
*/
public class LocalPlayer {
private final String name;
private final BooleanProperty ready;
public LocalPlayer(String name, boolean ready) {
this.name = name;
this.ready = new SimpleBooleanProperty(ready);
}
public String getName() {
return name;
}
public BooleanProperty readyProperty() {
return ready;
}
}
| [
"s.caniels@student.fontys.nl"
] | s.caniels@student.fontys.nl |
681f63259145081eb68f3e79286e1d707f5650fe | 96a64802ea68161702941a23b1675ba8b9678d53 | /app/src/main/java/com/apecs/im/view/fragment/dialogue/ChartFragment.java | c9ab5ad2128c4e4236755229a44ea2c2475f67a6 | [] | no_license | HJianFei/MVPDemo | 911e0ea2366cf10809b25c35d70535c27abcd762 | 8fa1d64b729e3ebddaab252c420626ef25415701 | refs/heads/master | 2020-12-03T03:57:33.652503 | 2017-07-04T01:18:10 | 2017-07-04T01:18:10 | 95,794,648 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,072 | java | package com.apecs.im.view.fragment.dialogue;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.apecs.im.R;
/**
* A simple {@link Fragment} subclass.
* Use the {@link ChartFragment#newInstance} factory method to
* create an instance of this fragment.
*/
public class ChartFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
public ChartFragment() {
// Required empty public constructor
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment ChartFragment.
*/
// TODO: Rename and change types and number of parameters
public static ChartFragment newInstance(String param1, String param2) {
ChartFragment fragment = new ChartFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_chart, container, false);
}
}
| [
"190766172@qq.com"
] | 190766172@qq.com |
f0237c7c4e22a7da860a0024c53e219f4dd674e5 | b64a6b216ac8ec212d307edb65dcc760cecc1aba | /FirstFrame/src/test/java/com/example/demo/FirstFrameApplicationTests.java | 399156c830e805f5869e97d89b0ce2d249bca3b9 | [
"Apache-2.0"
] | permissive | ryokidd7/Java_SpringFramework | 377ddf5400aa630652e1c8518c21e172038160a6 | 5b6b6c25360b98123bd2851bf88680b81692bd9c | refs/heads/master | 2020-07-05T14:00:16.160349 | 2019-08-16T06:44:33 | 2019-08-16T06:44:33 | 202,666,007 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 337 | java | package com.example.demo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class FirstFrameApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"ryooki.0726@gmail.com"
] | ryooki.0726@gmail.com |
1c6d0e9967a716a30a8a2c0d3b17af5283a3ff8a | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /api-vs-impl-small/domain/src/main/java/org/gradle/testdomain/performancenull_8/Productionnull_705.java | 0c3c8ec36d3fada68ac457e782bd704f2599d69c | [] | 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 | 588 | java | package org.gradle.testdomain.performancenull_8;
public class Productionnull_705 {
private final String property;
public Productionnull_705(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
private String prop0;
public String getProp0() {
return prop0;
}
public void setProp0(String value) {
prop0 = value;
}
private String prop1;
public String getProp1() {
return prop1;
}
public void setProp1(String value) {
prop1 = value;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
7f04191410a8af4e7d2e0330ab3399e6637fba98 | 9968b8accbb2055a8494e65e7e0402d57394b9fd | /src/main/java/com/v/aspect/LoggerAspect.java | 678c85a0f3ee46f47b63fdc2cb3f57910574e6e8 | [] | no_license | IronLung7/idiot-server | 997cc0206d00b2b3c2a930d83bf965e870b7324a | dba1786a5cfa88b12b6f7767940f5ab32f594860 | refs/heads/master | 2021-01-17T17:49:41.824404 | 2016-08-01T09:46:49 | 2016-08-01T09:46:49 | 64,655,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,046 | java | //package com.v.aspect;
//
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//
///**
// * Created by zhlingyu on 2016/7/29.
// */
//@Aspect
//@Component
//public class LoggerAspect {
//
// private static final Logger logger = LoggerFactory.getLogger(LoggerAspect.class);
//
// @Around("execution(* com.v..*(..))")
// public Object logMethod(ProceedingJoinPoint joinPoint) throws Throwable {
// System.out.println("lol");
// if (joinPoint == null) {
// logger.error("Cannot traceMethod for NULL");
// return null;
// }
// logger.info("in method");
// Object retVal = null;
// try {
// retVal = joinPoint.proceed();
// } catch (Throwable t) {
//
// } finally {
// logger.info("end method");
// }
// return retVal;
// }
//} | [
"lingyue.zhu@hpe.com"
] | lingyue.zhu@hpe.com |
22f34a05763f2205d249c8dc422db06b3b090f65 | de10a81abceadd4d0f9e630c18a5ce02648005d4 | /residentEvil/src/main/java/com/residentevildemo/repositories/CapitalRepository.java | 8afd77d72ad8ce8c8f10a067493d0adfaeb0b9b1 | [] | no_license | rori4/Softuni | 2833dc3e3aea03b7b704b38f48fe0500714e2b80 | 4e30be529897974fd5f227d90a47497f5703579c | refs/heads/master | 2021-03-24T13:39:28.793650 | 2018-01-28T10:28:09 | 2018-01-28T10:28:09 | 119,249,557 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | package com.residentevildemo.repositories;
import com.residentevildemo.entities.Capital;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Set;
@Repository
public interface CapitalRepository extends JpaRepository<Capital,Long> {
@Query(value = "SELECT c.name FROM Capital AS c")
List<String> getCapitalNames();
Set<Capital> getAllByNameIn(String[] names);
}
| [
"RangelStoilov@students.softuni.bg"
] | RangelStoilov@students.softuni.bg |
4e83821f992182944efb2f5a34349a77424a7bda | fa9135df89e195b88345be8508d68e976b0b1c2b | /java/java-tests/testData/inspection/inefficientStreamCount/afterSimpleCountComparisonIsEmpty.java | 8d491f18f83ba8fa554e7391cad8c344f00c0c05 | [
"Apache-2.0"
] | permissive | k-bespalov/intellij-community | 5274548f375aa4b610f83e4d328c5733f0c02456 | d1652eee4ff9289169d96e0b03d14c07be6f8c89 | refs/heads/master | 2023-04-14T00:36:46.417119 | 2021-03-22T16:35:45 | 2021-03-22T16:59:32 | 350,450,859 | 0 | 0 | Apache-2.0 | 2021-03-22T18:36:17 | 2021-03-22T18:36:17 | null | UTF-8 | Java | false | false | 210 | java | // "Replace 'stream.count() == 0' with 'stream.findAny().isEmpty()'" "true"
import java.util.stream.Stream;
class Test {
boolean isEmpty(Stream<String> stream) {
return stream.findAny().isEmpty();
}
} | [
"intellij-monorepo-bot-no-reply@jetbrains.com"
] | intellij-monorepo-bot-no-reply@jetbrains.com |
7dc9345d14ab7779bb99ee8ccd664c621258fb03 | 27fdae4490acf372846d207116b67d4adb3f3cfa | /EditProjectServlet.java | 37854e4387449ef34fd943fe5616c4475f7a71c8 | [] | no_license | sdpuglisi/Team_Up | acb484643c0c2ed2334d946427d3adfbb6997ca3 | 61dc7541d38434e5cb65dba5e28b6ac37eb011d9 | refs/heads/master | 2022-11-10T19:44:30.509380 | 2020-06-29T16:44:05 | 2020-06-29T16:44:05 | 275,869,348 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,067 | java | package com.teamup.servlet;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.teamup.beans.Project;
import com.teamup.utils.MyUtils;
/**
* Servlet implementation class EditProjectServlet
*/
@WebServlet("/editProject")
public class EditProjectServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public EditProjectServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Project p = new Project();
String projectName = request.getParameter("editProjectName").trim();
String category = request.getParameter("editCategory");
String description = request.getParameter("editDescription").trim();
String status = request.getParameter("editStatus");
p.setTitle(projectName);
p.setCategory(category);
p.setDescription(description);
p.setStatus(status);
Connection conn = MyUtils.getStoredConnection(request);
try {
// Edit the selected project
Project.editProject(conn, request.getParameter("leader"), request.getParameter("oldProjectTitle"), p);
} catch (SQLException e) {
e.printStackTrace();
}
// Redirect to userInfo page.
response.sendRedirect(request.getContextPath() + "/userInfo");
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
900556a31ccf26b469aa30dda21ea354822a2595 | 12defbb19a15f7ce239e99b18ab8f27bb15dac41 | /src/main/java/com/maserhe/enums/LoginParam.java | 13a62c889f2f3e24ebbad0541ebf46d70d59cbce | [] | no_license | Maserhe/MForum | b80b4487f88ac1c4285f4db9de5ab2c290fd67f4 | 91de66a6cf07dd2fa870f67ad70732f479df22cf | refs/heads/master | 2023-06-18T03:23:01.750867 | 2021-07-11T12:46:39 | 2021-07-11T12:46:39 | 354,457,896 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 682 | java | package com.maserhe.enums;
/**
* 描述:
*
* @author Maserhe
* @create 2021-04-03 17:33
*/
public interface LoginParam {
/**
* 激活成功
*/
int ACTIVATION_SUCCESS = 0;
/**
* 重复激活
*/
int ACTIVATION_REPEAT = 1;
/**
* 激活失败
*/
int ACTIVATION_FAILURE = 2;
/**
* 默认状态下 的 凭证超时时间
*/
long DEFAULT_EXPIRED_SECONDS = 3600 * 12;
/**
* 记住我状态下 的 超时时间
*/
long REMEMBER_EXPIRED_SECONDS = 3600 * 24 * 30;
/**
* 帖子
*/
int ENTITY_TYPE_POST = 1;
/**
* 评论
*/
int ENTITY_TYPE_COMMENT = 2;
}
| [
"982289931@qq.com"
] | 982289931@qq.com |
b8631661665fcedea74dbbd468e48d005ad04bf3 | 6fea46d57282e2c92bcde22217ea6b4a1c0dc6f2 | /ANDROID/Cause_Android_User/app/src/main/java/com/example/dsm2018/cause_android_user/fragment/SettingFragment.java | a841ba8aa04101643190f9a24ce0d9287c6af1b0 | [] | no_license | goifproject/Cause_Phantom | 600b7f094e02cee7a5fb667b426ed0a9704e8b42 | 410dcbc344c814fef6e4debee1a25bee47e99940 | refs/heads/master | 2021-09-27T19:21:48.925469 | 2018-11-10T22:57:09 | 2018-11-10T22:57:09 | 156,986,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,320 | java | package com.example.dsm2018.cause_android_user.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.example.dsm2018.cause_android_user.R;
import com.example.dsm2018.cause_android_user.activity.ContactUsActivity;
import com.example.dsm2018.cause_android_user.activity.DonationListActivity;
import com.example.dsm2018.cause_android_user.activity.FundingListActivity;
import com.example.dsm2018.cause_android_user.activity.MyInfoActivity;
import com.example.dsm2018.cause_android_user.activity.PointListActivity;
import com.example.dsm2018.cause_android_user.activity.PointShopActivity;
public class SettingFragment extends Fragment {
LinearLayout myInfoButton, pointShopBtn, pointListBtn, fundListBtn, donationListBtn, contactBtn;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_setting, container, false);
myInfoButton = rootView.findViewById(R.id.myInfoButton);
pointShopBtn = rootView.findViewById(R.id.pointShopBtn);
pointListBtn = rootView.findViewById(R.id.pointListBtn);
fundListBtn = rootView.findViewById(R.id.fundListBtn);
donationListBtn = rootView.findViewById(R.id.donationListBtn);
contactBtn = rootView.findViewById(R.id.contactBtn);
myInfoButton.setOnClickListener(v-> startActivity(new Intent(getActivity(), MyInfoActivity.class)));
pointShopBtn.setOnClickListener(v-> startActivity(new Intent(getActivity(), PointShopActivity.class)));
pointListBtn.setOnClickListener(v-> startActivity(new Intent(getActivity(), PointListActivity.class)));
fundListBtn.setOnClickListener(v-> startActivity(new Intent(getActivity(), FundingListActivity.class)));
donationListBtn.setOnClickListener(v-> startActivity(new Intent(getActivity(),
DonationListActivity.class)));
contactBtn.setOnClickListener(v-> startActivity(new Intent(getActivity(), ContactUsActivity.class)));
return rootView;
}
}
| [
"dogyhbin12345@gmail.com"
] | dogyhbin12345@gmail.com |
a89e3fe3edbdd574de07b97dbb170437adc0389d | d76c2200bdf66695a2014cd961d01e71efab6ba9 | /spring1/src/main/java/main/MainClassXML1.java | 275af179f6d1894242df31a1766396163b156183 | [] | no_license | gusals9355/jsp | c1ceb41760ab7d33f0632fe4372a7d226c997b90 | 9ae482b47378b7238e5650f49b6d3d21ad6d8f97 | refs/heads/main | 2023-05-05T14:58:45.440863 | 2021-05-25T07:48:28 | 2021-05-25T07:48:28 | 360,715,068 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,942 | java | package main;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import org.springframework.context.support.GenericXmlApplicationContext;
import assembler.StudentAssembler;
import dao.StudentDao;
import member.Student;
import service.AllSelectService;
import service.ModifyService;
import service.RegisterService;
import service.SelectService;
public class MainClassXML1 {
public static void main(String[] args) {
String[] sNums = { "H39r8djakndfae32", "H39asdfaelu42o23", "H39iiemamca8w9h4", "H39lkmn754fghia7",
"H39plo865cuy8k92", "H39mnbviiaed89q1", "H399omjjyv56t3d5", "H39lczaqwg644gj8", "H39ymbcsh74thgh2",
"H39lesvj7544vf89" };
String[] sIds = { "rabbit", "hippo", "raccoon", "elephant", "lion", "tiger", "pig", "horse", "bird", "deer" };
String[] sPws = { "96539", "94875", "15284", "48765", "28661", "60915", "30028", "29801", "28645", "28465" };
String[] sNames = { "agatha", "barbara", "chris", "doris", "elva", "fiona", "holly", "jasmin", "lena",
"melissa" };
int[] sAges = { 19, 22, 20, 27, 19, 21, 19, 25, 22, 24 };
String[] sGenders = { "M", "W", "W", "M", "M", "M", "W", "M", "W", "W" };
String[] sMajors = { "English Literature", "Korean Language and Literature", "French Language and Literature",
"Philosophy", "History", "Law", "Statistics", "Computer", "Economics", "Public Administration" };
// StudentAssembler assembler = new StudentAssembler();
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext("classpath:applicationContext.xml");
// RegisterService registerService = assembler.getRegisterService();
RegisterService registerService = ctx.getBean("registerService",RegisterService.class);
for (int j = 0; j < sNums.length; j++) {
Student student = new Student(sNums[j], sIds[j], sPws[j], sNames[j], sAges[j], sGenders[j], sMajors[j]);
registerService.register(student);
}
// ModifyService modifyService = assembler.getModifyService();
ModifyService modifyService = ctx.getBean("modifyService",ModifyService.class);
modifyService.modify(new Student("H39lesvj7544vf89", "deer", "00000", "melissa",
26, "W", "Vocal Music"));
// SelectService selectService = assembler.getSelectService();
SelectService selectService = ctx.getBean("selectService",SelectService.class);
Student modifiedStudent = selectService.select("H39lesvj7544vf89");
System.out.print("sNum:" + modifiedStudent.getsNum() + "\t");
System.out.print("|sId:" + modifiedStudent.getsId() + "\t");
System.out.print("|sPw:" + modifiedStudent.getsPw() + "\t");
System.out.print("|sName:" + modifiedStudent.getsName() + "\t");
System.out.print("|sAge:" + modifiedStudent.getsAge() + "\t");
System.out.print("|sGender:" + modifiedStudent.getsGender() + "\t");
System.out.print("|sMajor:" + modifiedStudent.getsMajor() + "\n\n");
// AllSelectService allSelectService = assembler.getAllSelectService();
AllSelectService allSelectService = ctx.getBean("allSelectService",AllSelectService.class);
Map<String, Student> allStudent = allSelectService.allSelect();
Set<String> keys = allStudent.keySet();
Iterator<String> iterator = keys.iterator();
while(iterator.hasNext()) {
String key = iterator.next();
Student student = allStudent.get(key);
System.out.print("sNum:" + student.getsNum() + "\t");
System.out.print("|sId:" + student.getsId() + "\t");
System.out.print("|sPw:" + student.getsPw() + "\t");
System.out.print("|sName:" + student.getsName() + "\t");
System.out.print("|sAge:" + student.getsAge() + "\t");
System.out.print("|sGender:" + student.getsGender() + "\t");
System.out.println("|sMajor:" + student.getsMajor() + "\t");
}
while(true) {
Scanner scanner = new Scanner(System.in);
String str = "";
System.out.println("\n==================================================================="
+ "==============================================================================");
System.out.println("Select number.");
System.out.println("1. Check student information");
System.out.println("2. Exit");
str = scanner.next();
if(str.equals("2")) {
System.out.println("Bye~~");
break;
} else {
System.out.println("Please input your class number.");
str = scanner.next();
Student student = selectService.select(str);
System.out.print("sNum:" + student.getsNum() + "\t");
System.out.print("|sId:" + student.getsId() + "\t");
System.out.print("|sPw:" + student.getsPw() + "\t");
System.out.print("|sName:" + student.getsName() + "\t");
System.out.print("|sAge:" + student.getsAge() + "\t");
System.out.print("|sGender:" + student.getsGender() + "\t");
System.out.println("|sMajor:" + student.getsMajor() + "\t");
}
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
5a828e5c99590d540a534d06d281b240a65cf6ad | e2c7b2b5595fb3c60f30188e522c5c43f9b89e7a | /shopping-service/src/main/java/com/sr/shopping/dao/WalletDao.java | 6a07859655e0c80b04a885039921ed3ae9da1cfd | [
"MIT"
] | permissive | Unchastity/shopping_mvn | b386fcc872d845fb3ea43faf1307926310aaeab5 | 7226b360f1805699720bac824e64411b18ff681c | refs/heads/master | 2021-01-24T03:48:52.301225 | 2018-03-01T08:49:23 | 2018-03-01T08:49:23 | 122,907,961 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 124 | java | package com.sr.shopping.dao;
import com.sr.shopping.entity.Wallet;
public interface WalletDao extends BaseDao<Wallet> {
}
| [
"jimg1991@163.com"
] | jimg1991@163.com |
28ab052c116f284cce4dd61edc24b5404f42eb5a | 86fe5400292126b66ac154194d99640d13ede97f | /TugasIO/src/adins/tugas/Test.java | 5ed30968c8dec785c218a24743d1ec10d95b73b7 | [] | no_license | asemsao/io | 0edc152e9cafd7cd16c0577044df6341276cb4d8 | e4bfcc2c99f30d39dd36af314091940f5a0e8c5b | refs/heads/master | 2019-01-19T10:04:18.857102 | 2014-02-21T08:31:32 | 2014-02-21T08:31:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 145 | java | package adins.tugas;
public class Test {
public static void main(String[] args) {
NotePad np = new NotePad();
np.start();
}
}
| [
"kartikoedhi@gmail.com"
] | kartikoedhi@gmail.com |
bb9b53e0f2fcba1db5aac37c7387f27048693309 | ab2ba7fd5f894bc77e3a14d4e0dd92687e75afaa | /src/main/java/org/tinymediamanager/ui/movies/settings/MovieSettingsContainerPanel.java | 17612ef1d79b92b54d1f4a529921f3bdf3bec59b | [
"Apache-2.0"
] | permissive | vlagorce/tinyMediaManager | cf7ff6a3c695db4433fc5eaec3e6fb3328399e84 | 1843beddf85221695e24f813c1b7c323c4426a10 | refs/heads/master | 2021-04-09T14:24:59.278962 | 2018-02-08T10:24:25 | 2018-02-08T10:24:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,982 | java | /*
* Copyright 2012 - 2017 Manuel Laggner
*
* 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.tinymediamanager.ui.movies.settings;
import java.awt.BorderLayout;
import java.util.ResourceBundle;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import org.tinymediamanager.ui.UTF8Control;
/**
* The class MovieSettingsContainerPanel. Holding all settings panes for the movie section
*
* @author Manuel Laggner
*/
public class MovieSettingsContainerPanel extends JPanel {
private static final long serialVersionUID = -1191910643362891059L;
/**
* @wbp.nls.resourceBundle messages
*/
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("messages", new UTF8Control()); //$NON-NLS-1$
public MovieSettingsContainerPanel() {
setLayout(new BorderLayout(0, 0));
{
JTabbedPane tabbedPanePages = new JTabbedPane(JTabbedPane.TOP);
add(tabbedPanePages, BorderLayout.CENTER);
{
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(new MovieSettingsPanel());
tabbedPanePages.addTab(BUNDLE.getString("Settings.general"), null, scrollPane, null); //$NON-NLS-1$
}
{
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(new MovieScraperSettingsPanel());
tabbedPanePages.addTab(BUNDLE.getString("Settings.scraper"), null, scrollPane, null); //$NON-NLS-1$
}
{
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(new MovieImageSettingsPanel());
tabbedPanePages.addTab(BUNDLE.getString("Settings.images"), null, scrollPane, null); //$NON-NLS-1$
}
{
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(new MovieTrailerSettingsPanel());
tabbedPanePages.addTab(BUNDLE.getString("Settings.trailer"), null, scrollPane, null); //$NON-NLS-1$
}
{
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(new MovieSubtitleSettingsPanel());
tabbedPanePages.addTab(BUNDLE.getString("Settings.subtitle"), null, scrollPane, null); //$NON-NLS-1$
}
{
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(new MovieRenamerSettingsPanel());
tabbedPanePages.addTab(BUNDLE.getString("Settings.renamer"), null, scrollPane, null); //$NON-NLS-1$
}
}
}
}
| [
"manuel.laggner@gmail.com"
] | manuel.laggner@gmail.com |
606113aa61c2adafcb772af32593675a752b8f5a | 8856ad736e04498e5fb0ffe7a9fc9e286a7ede4c | /src/fr/diginamic/recensement/RecherchePopulationDepartementService.java | 8430ddaf5a6ca81aa89e57a276ab7ef25eb5d843 | [] | no_license | sanaeltahhan/approche_objet | a86916fd51c6590638e0be9b415670a8299780ec | 5440f5ead05525b72fdfa8d81eb2b95c6ecbb7c9 | refs/heads/master | 2022-11-05T23:03:51.121544 | 2020-06-22T19:02:22 | 2020-06-22T19:02:22 | 271,234,636 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,356 | java | /**
*
*/
package fr.diginamic.recensement;
import java.util.Scanner;
/**
* Classe RecherchePopulationDepartementService, elle hérite de la classe MenuService, permet de rechercher la population total d'un département donnée
*
* @author eltahhansana
*
*/
public class RecherchePopulationDepartementService extends MenuService {
@Override
public void traiter(Recensement recensement, Scanner scanner) throws ClasseException {
System.out.println("Quel est le numéro du département dont vous souhaitez rechercher la population total ? ");
// Recupérer le choix de l'utilisateur
String choix = scanner.nextLine();
// Initialisation Boolean pour lancer une exception si l'utilisateur donne departement inconnu
boolean trouve = false;
int population = 0;
for (Ville ville : recensement.getListVilles()) {
if ( ville.getCodeDepartement().equalsIgnoreCase(choix)) {
population = population + ville.getPopulationTotale();
trouve = true;
}
}
if (! trouve) {
throw new ClasseException("Le numero de département que vous avez saisie est incorrect");
}
if (population > 0) {
System.out.println("La population du département " + choix + " est de " + population);
}
else {
System.out.println("Le département " + choix + " n'existe pas.");
}
System.out.println();
}
}
| [
"sana.eltahhan@hotmail.fr"
] | sana.eltahhan@hotmail.fr |
9b898f99cfc417d97eab7b0ee17256777df88fde | cc65e10feea55bfa97cade23176cd6e574d3bbea | /iportal/iportal-core/src/main/java/com/imall/iportal/core/shop/vo/PurchaseAcceptanceRecordItemSaveVo.java | ccc341e81c808726c1bd39a8cdd6c02ed860ed06 | [] | no_license | weishihuai/imallCloudc | ef5a0d7e4866ad7e63251dff512afede7246bd4f | f3163208eaf539aa63dc9e042d2ff6c7403aa405 | refs/heads/master | 2021-08-20T05:42:23.717707 | 2017-11-28T09:10:36 | 2017-11-28T09:10:36 | 112,305,704 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 4,240 | java | package com.imall.iportal.core.shop.vo;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* Created by lxh on 2017/7/14.
*/
public class PurchaseAcceptanceRecordItemSaveVo {
//采购收货记录项id
@NotNull
private Long purchaseReceiveRecordItemId;
//商品ID
@NotNull
private Long goodsId;
//商品批号
@NotNull
@Length(max = 32)
private String goodsBatch;
//商品批次ID
private Long goodsBatchId;
//生产日期
@NotNull
private String productionDateString;
//有效期至
@NotNull
private String validityString;
//到货数量
@NotNull
@Min(1)
private Long goodsArrivalQuantity;
//合格数量
@NotNull
@Min(0)
private Long qualifiedQuantity;
//抽样数量
@NotNull
@Min(0)
private Long sampleQuantity;
//零售价
@NotNull
@Min(0)
private Double retailPrice;
//灭菌批次
private String sterilizationBatch;
//验收报告
private String acceptanceRep;
//货位
private String goodsAllocation;
//验收结论
private String acceptanceConclusion;
//货位ID
@NotNull
private Long storageSpaceId;
public Long getPurchaseReceiveRecordItemId() {
return purchaseReceiveRecordItemId;
}
public void setPurchaseReceiveRecordItemId(Long purchaseReceiveRecordItemId) {
this.purchaseReceiveRecordItemId = purchaseReceiveRecordItemId;
}
public Long getGoodsId() {
return goodsId;
}
public void setGoodsId(Long goodsId) {
this.goodsId = goodsId;
}
public String getGoodsBatch() {
return goodsBatch;
}
public void setGoodsBatch(String goodsBatch) {
this.goodsBatch = goodsBatch;
}
public Long getGoodsBatchId() {
return goodsBatchId;
}
public void setGoodsBatchId(Long goodsBatchId) {
this.goodsBatchId = goodsBatchId;
}
public String getProductionDateString() {
return productionDateString;
}
public void setProductionDateString(String productionDateString) {
this.productionDateString = productionDateString;
}
public String getValidityString() {
return validityString;
}
public void setValidityString(String validityString) {
this.validityString = validityString;
}
public Long getGoodsArrivalQuantity() {
return goodsArrivalQuantity;
}
public void setGoodsArrivalQuantity(Long goodsArrivalQuantity) {
this.goodsArrivalQuantity = goodsArrivalQuantity;
}
public Long getQualifiedQuantity() {
return qualifiedQuantity;
}
public void setQualifiedQuantity(Long qualifiedQuantity) {
this.qualifiedQuantity = qualifiedQuantity;
}
public Long getSampleQuantity() {
return sampleQuantity;
}
public void setSampleQuantity(Long sampleQuantity) {
this.sampleQuantity = sampleQuantity;
}
public Double getRetailPrice() {
return retailPrice;
}
public void setRetailPrice(Double retailPrice) {
this.retailPrice = retailPrice;
}
public String getSterilizationBatch() {
return sterilizationBatch;
}
public void setSterilizationBatch(String sterilizationBatch) {
this.sterilizationBatch = sterilizationBatch;
}
public String getAcceptanceRep() {
return acceptanceRep;
}
public void setAcceptanceRep(String acceptanceRep) {
this.acceptanceRep = acceptanceRep;
}
public String getGoodsAllocation() {
return goodsAllocation;
}
public void setGoodsAllocation(String goodsAllocation) {
this.goodsAllocation = goodsAllocation;
}
public String getAcceptanceConclusion() {
return acceptanceConclusion;
}
public void setAcceptanceConclusion(String acceptanceConclusion) {
this.acceptanceConclusion = acceptanceConclusion;
}
public Long getStorageSpaceId() {
return storageSpaceId;
}
public void setStorageSpaceId(Long storageSpaceId) {
this.storageSpaceId = storageSpaceId;
}
}
| [
"34024258+weishihuai@users.noreply.github.com"
] | 34024258+weishihuai@users.noreply.github.com |
b509fd6750a6ec5867889e52b937f1abc9f6b5fc | 376a05fb5b86295365e191f48636ade928d0760d | /app/src/main/java/com/example/uberv/fotography/ErrorDialog.java | cdad562ea669c1fa85f4e0a8f54cb3a3470a37eb | [] | no_license | Rikharthu/android-Fotography | d6109a7a43d4857bb6e0c467b380469b125b9cc6 | 619c27bb644f75bd7a58a0f9cb4e10c66fbe19a6 | refs/heads/master | 2021-01-20T08:36:43.760739 | 2018-03-21T10:53:53 | 2018-03-21T10:53:53 | 101,567,446 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,195 | java | package com.example.uberv.fotography;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
/**
* Shows an error message dialog.
*/
public class ErrorDialog extends DialogFragment {
private static final String ARG_MESSAGE = "message";
public static ErrorDialog newInstance(String message) {
ErrorDialog dialog = new ErrorDialog();
Bundle args = new Bundle();
args.putString(ARG_MESSAGE, message);
dialog.setArguments(args);
return dialog;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Activity activity = getActivity();
return new android.app.AlertDialog.Builder(activity)
.setMessage(getArguments().getString(ARG_MESSAGE))
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
activity.finish();
}
})
.create();
}
}
| [
"uberviolence@gmail.com"
] | uberviolence@gmail.com |
f10ea58760d78bf82a2a85fd33a9b761525b236e | 57c2e636673365cbbf6bc689d709227cc04cfd0b | /app/src/main/java/com/codeitfactory/linkedus_android/MainActivity.java | 7015b534808fc824a286ccee7b7498d43a1a1f6a | [] | no_license | hristog121/likedus_android | 21dd397e5608d96b0aaef03133ee65202527e0a2 | 2c8088f86df0554500116d6f90404090caef5e85 | refs/heads/master | 2020-04-08T11:17:17.249570 | 2018-12-05T08:19:16 | 2018-12-05T08:19:16 | 159,300,201 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,212 | java | package com.codeitfactory.linkedus_android;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.support.annotation.NonNull;
import android.support.design.internal.BottomNavigationItemView;
import android.support.design.widget.BottomNavigationView;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.linkedin.platform.APIHelper;
import com.linkedin.platform.LISessionManager;
import com.linkedin.platform.errors.LIApiError;
import com.linkedin.platform.errors.LIAuthError;
import com.linkedin.platform.listeners.ApiListener;
import com.linkedin.platform.listeners.ApiResponse;
import com.linkedin.platform.listeners.AuthListener;
import com.linkedin.platform.utils.Scope;
import com.squareup.picasso.Picasso;
import org.json.JSONException;
import org.json.JSONObject;
import java.security.MessageDigest;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private ImageView imgProfile;
private TextView txtDetails;
private ImageView imgLogin;
private Button btnLogout;
private Button btnGoHome;
BottomNavigationView bottomNavigationView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
computePakageHash();
initControls();
}
//Method to bind the view with the backend
private void initControls() {
imgLogin = (ImageView) findViewById(R.id.imgLogin);
imgLogin.setOnClickListener(this);
btnLogout = (Button) findViewById(R.id.btnLogout);
btnLogout.setOnClickListener(this);
//btnGoHome = (Button) findViewById(R.id.btnGoHome);
//btnGoHome.setOnClickListener(this);
imgProfile = (ImageView) findViewById(R.id.imgProfile);
txtDetails = (TextView) findViewById(R.id.txtDetails);
bottomNavigationView = findViewById(R.id.nav12);
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
if (item.getItemId() == R.id.navigation_home) {
goHome();
return true;
}
return false;
}
});
//Default
imgLogin.setVisibility(View.VISIBLE);
btnLogout.setVisibility(View.GONE);
imgProfile.setVisibility(View.GONE);
txtDetails.setVisibility(View.GONE);
}
private void computePakageHash() {
try {
PackageInfo info = getPackageManager().getPackageInfo(
"com.codeitfactory.linkedus_android",
PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
}
} catch (Exception e) {
Log.e("TAG", e.getMessage());
}
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.imgLogin:
handleLogin();
break;
case R.id.btnLogout:
handleLogout();
break;
// case R.id.btnGoHome:
// goHome();
}
}
private void goHome(){
Intent intent = new Intent(MainActivity.this, PageActivity.class);
startActivity(intent);
}
private void handleLogout(){
LISessionManager.getInstance(getApplicationContext()).clearSession();
imgLogin.setVisibility(View.VISIBLE);
btnLogout.setVisibility(View.GONE);
imgProfile.setVisibility(View.GONE);
txtDetails.setVisibility(View.GONE);
}
private void handleLogin() {
LISessionManager.getInstance(getApplicationContext()).init(this, buildScope(), new AuthListener() {
@Override
public void onAuthSuccess() {
// Authentication was successful. You can now do
// other calls with the SDK.
imgLogin.setVisibility(View.GONE);
btnLogout.setVisibility(View.VISIBLE);
imgProfile.setVisibility(View.VISIBLE);
txtDetails.setVisibility(View.VISIBLE);
getPersonalInfo();
}
@Override
public void onAuthError(LIAuthError error) {
// Handle authentication errors
Log.e("ICE1", error.toString());
}
}, true);
}
// Build the list of member permissions our LinkedIn session requires
private static Scope buildScope() {
return Scope.build(Scope.R_BASICPROFILE, Scope.W_SHARE, Scope.R_EMAILADDRESS);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// Add this line to your existing onActivityResult() method
LISessionManager.getInstance(getApplicationContext()).onActivityResult(this, requestCode, resultCode, data);
}
private void getPersonalInfo() {
String url = "https://api.linkedin.com/v1/people/~:(id,first-name,last-name,public-profile-url,picture-url,email-address,picture-urls::(original))";
APIHelper apiHelper = APIHelper.getInstance(getApplicationContext());
apiHelper.getRequest(this, url, new ApiListener() {
@Override
public void onApiSuccess(ApiResponse apiResponse) {
// Success!
JSONObject jsonObject = apiResponse.getResponseDataAsJson();
try {
String firstName = jsonObject.getString("firstName");
String lastName = jsonObject.getString("lastName");
String pictureUrl = jsonObject.getString("pictureUrl");
String emailAddress = jsonObject.getString("emailAddress");
Picasso.get().load(pictureUrl).into(imgProfile);
StringBuilder sb = new StringBuilder();
sb.append("First Name " + firstName);
sb.append("\n\n");
sb.append("Last Name " + lastName);
sb.append("\n\n");
sb.append("Email: " + emailAddress);
sb.append("\n\n");
txtDetails.setText(sb);
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override
public void onApiError(LIApiError liApiError) {
// Error making GET request!
Log.e("ICE2",liApiError.getMessage());
}
});
}
}
| [
"hristog121@kth.se"
] | hristog121@kth.se |
da1f1db37cdc929802443127452df0ab2366c59c | 1a58914ebbc3495eb6edabd069de76b7b39da785 | /ProjectAL/workspace/projectAL/src/soldier/core/UnitGroup.java | c09ae9047f3b5f4a16ea051680d899d1a5788ac1 | [] | no_license | lassouani/ProjectArcitectureLogiciel | e21590c28fff69ceadcc70b6791b4b2df23bf135 | 7777e7b1fb86234047f74e18828fbcd2f7249808 | refs/heads/master | 2021-04-29T10:01:15.154626 | 2017-01-02T17:58:06 | 2017-01-02T17:58:06 | 77,849,472 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,796 | java | /**
* D. Auber & P. Narbel
* Solution TD Architecture Logicielle 2016 Universit� Bordeaux.
*/
package soldier.core;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
import soldier.observer_util.ObservableAbstract;
public class UnitGroup extends ObservableAbstract<Unit>
implements Unit {
private Set<Unit> units;
private String name;
public UnitGroup(String name) {
this.name = name;
units = new TreeSet<Unit>(new Comparator<Unit>() {
@Override
public int compare(Unit o1, Unit o2) {
if (o1.getName().compareTo(o2.getName()) == 0)
return o1.hashCode() - o2.hashCode();
else
return o1.getName().compareTo(o2.getName());
}
});
}
@Override
public void addUnit(Unit au) {
units.add(au);
}
@Override
public void removeUnit(Unit au) {
units.remove(au);
}
@Override
public String getName() {
return name;
}
@Override
public float getHealthPoints() {
float sum = 0.f;
for (Unit u : units)
sum += u.getHealthPoints();
return sum;
}
@Override
public boolean alive() {
return getHealthPoints() > 0.f;
}
@Override
public void heal() {
for (Unit u : units)
u.heal();
}
@Override
public float parry(float force) {
float f = 0.f;
Iterator<Unit> it = subUnits();
while (force > 0.f && it.hasNext()) {
Unit u = it.next();
if (!u.alive())
continue;
force = u.parry(force);
}
notifyObservers(this);
return f;
}
@Override
public float strike() {
float sum = 0;
for (Unit u : units) {
if (u.alive())
sum += u.strike();
}
return sum;
}
@Override
public Iterator<Unit> subUnits() {
return units.iterator();
}
@Override
public void accept(UnitVisitor v) {
v.visit(this);
}
@Override
public Iterator<Weapon> getWeapons() {
if (units.isEmpty())
return Collections.emptyIterator();
return new Iterator<Weapon>() {
Iterator<Unit> itUnit = subUnits();
Iterator<Weapon> curIt = itUnit.next().getWeapons();
@Override
public boolean hasNext() {
while (!curIt.hasNext() && itUnit.hasNext())
curIt = itUnit.next().getWeapons();
return curIt.hasNext();
}
@Override
public Weapon next() {
return curIt.next();
}
};
}
@Override
public void addEquipment(Weapon w) {
Iterator<Unit> it = subUnits();
while (it.hasNext()) {
Unit u = it.next();
try {
u.addEquipment(w);
w = w.clone();
} catch (BreakingRuleException b) {
System.out.println("Impossible to add " + w.getName() + " to " + u.getName());
}
}
}
@Override
public void removeEquipment(Weapon w) {
for (Iterator<Unit> it = subUnits(); it.hasNext(); it.next()
.removeEquipment(w)) {
}
}
}
| [
"lassaouni_sofiane@outlook.com"
] | lassaouni_sofiane@outlook.com |
0b611e3c12ceefa7aba9e7486472e9db904b3278 | 71ea2e1689a684892496c17127ce4bba86d17ec2 | /src/main/java/com/tf/smart/community/wechat/entity/dto/question/AccountAnswerRelationDTO.java | 4d790c3cf510f0162e4a30ea600b68f76b4cae7c | [] | no_license | fqd0514/scaffolding-work | 7edd6d24296f46bf6eaf86e7f7f6524ab25737f6 | 7622e57c98fef36a0e0cb208288d6ad9af4bdb65 | refs/heads/main | 2023-02-28T01:23:51.141797 | 2021-01-15T09:52:56 | 2021-01-15T09:52:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 989 | java | package com.tf.smart.community.wechat.entity.dto.question;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/***
* 调查问卷人员和题目答案DTO
* @Author Leeyoung
* @Date 2020/8/13
**/
@ApiModel(value = "调查问卷人员和题目答案DTO", description = "调查问卷人员和题目答案DTO")
@Data
public class AccountAnswerRelationDTO {
/**
* 主键ID
*/
@JsonIgnore
private Long id;
/**
* 微信认证表的ID
*/
@JsonIgnore
private String openId;
/**
* 楼栋ID
*/
@JsonIgnore
private Long buildingId;
/**
* 问卷主键
*/
@ApiModelProperty(value = "问卷主键", dataType = "Long")
@NotNull(message = "问卷主键不能为空")
private Long questionId;
} | [
"liyang_ruanjian@tftnet.cn"
] | liyang_ruanjian@tftnet.cn |
4a6eb702d8b8c6929ea9ddd33a06d76be8e1ec4d | 4134d9e4e9da6ac494c32460dabdf085b9dbdef5 | /app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/graphics/drawable/R.java | 07c689273f7fd4d3a3772b3b43f02ccaf014cc9a | [] | no_license | mattia1142866/Fotocamera | 7b883932a61b01436c714f72d3631b2cae36a66c | 212ff42bd388e77ef903bdb86c246fea7b687caa | refs/heads/master | 2020-04-02T13:10:48.343773 | 2018-12-14T15:38:55 | 2018-12-14T15:38:55 | 154,470,729 | 1 | 0 | null | 2018-12-28T14:55:32 | 2018-10-24T09:02:16 | Java | UTF-8 | Java | false | false | 8,261 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.graphics.drawable;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int font = 0x7f020078;
public static final int fontProviderAuthority = 0x7f02007a;
public static final int fontProviderCerts = 0x7f02007b;
public static final int fontProviderFetchStrategy = 0x7f02007c;
public static final int fontProviderFetchTimeout = 0x7f02007d;
public static final int fontProviderPackage = 0x7f02007e;
public static final int fontProviderQuery = 0x7f02007f;
public static final int fontStyle = 0x7f020080;
public static final int fontWeight = 0x7f020081;
}
public static final class bool {
private bool() {}
public static final int abc_action_bar_embed_tabs = 0x7f030000;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f04003e;
public static final int notification_icon_bg_color = 0x7f04003f;
public static final int ripple_material_light = 0x7f040049;
public static final int secondary_text_default_material_light = 0x7f04004b;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f05004b;
public static final int compat_button_inset_vertical_material = 0x7f05004c;
public static final int compat_button_padding_horizontal_material = 0x7f05004d;
public static final int compat_button_padding_vertical_material = 0x7f05004e;
public static final int compat_control_corner_material = 0x7f05004f;
public static final int notification_action_icon_size = 0x7f050059;
public static final int notification_action_text_size = 0x7f05005a;
public static final int notification_big_circle_margin = 0x7f05005b;
public static final int notification_content_margin_start = 0x7f05005c;
public static final int notification_large_icon_height = 0x7f05005d;
public static final int notification_large_icon_width = 0x7f05005e;
public static final int notification_main_column_padding_top = 0x7f05005f;
public static final int notification_media_narrow_margin = 0x7f050060;
public static final int notification_right_icon_size = 0x7f050061;
public static final int notification_right_side_padding_top = 0x7f050062;
public static final int notification_small_icon_background_padding = 0x7f050063;
public static final int notification_small_icon_size_as_large = 0x7f050064;
public static final int notification_subtext_size = 0x7f050065;
public static final int notification_top_pad = 0x7f050066;
public static final int notification_top_pad_large_text = 0x7f050067;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f060057;
public static final int notification_bg = 0x7f060058;
public static final int notification_bg_low = 0x7f060059;
public static final int notification_bg_low_normal = 0x7f06005a;
public static final int notification_bg_low_pressed = 0x7f06005b;
public static final int notification_bg_normal = 0x7f06005c;
public static final int notification_bg_normal_pressed = 0x7f06005d;
public static final int notification_icon_background = 0x7f06005e;
public static final int notification_template_icon_bg = 0x7f06005f;
public static final int notification_template_icon_low_bg = 0x7f060060;
public static final int notification_tile_bg = 0x7f060061;
public static final int notify_panel_notification_icon_bg = 0x7f060062;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f07000d;
public static final int action_divider = 0x7f07000f;
public static final int action_image = 0x7f070010;
public static final int action_text = 0x7f070016;
public static final int actions = 0x7f070017;
public static final int async = 0x7f07001d;
public static final int blocking = 0x7f070020;
public static final int chronometer = 0x7f070029;
public static final int forever = 0x7f07003c;
public static final int icon = 0x7f070041;
public static final int icon_group = 0x7f070042;
public static final int info = 0x7f070045;
public static final int italic = 0x7f070047;
public static final int line1 = 0x7f070049;
public static final int line3 = 0x7f07004a;
public static final int normal = 0x7f070052;
public static final int notification_background = 0x7f070053;
public static final int notification_main_column = 0x7f070054;
public static final int notification_main_column_container = 0x7f070055;
public static final int right_icon = 0x7f07005e;
public static final int right_side = 0x7f07005f;
public static final int tag_transition_group = 0x7f07007f;
public static final int text = 0x7f070080;
public static final int text2 = 0x7f070081;
public static final int time = 0x7f070085;
public static final int title = 0x7f070086;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f080004;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f09001c;
public static final int notification_action_tombstone = 0x7f09001d;
public static final int notification_template_custom_big = 0x7f09001e;
public static final int notification_template_icon_group = 0x7f09001f;
public static final int notification_template_part_chronometer = 0x7f090020;
public static final int notification_template_part_time = 0x7f090021;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0b001f;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f0c00e7;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00e8;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00e9;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00ea;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00eb;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0c0153;
public static final int Widget_Compat_NotificationActionText = 0x7f0c0154;
}
public static final class styleable {
private styleable() {}
public static final int[] FontFamily = { 0x7f02007a, 0x7f02007b, 0x7f02007c, 0x7f02007d, 0x7f02007e, 0x7f02007f };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x7f020078, 0x7f020080, 0x7f020081 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_font = 3;
public static final int FontFamilyFont_fontStyle = 4;
public static final int FontFamilyFont_fontWeight = 5;
}
}
| [
"mattia.molinaro.1@studenti.unipd.it"
] | mattia.molinaro.1@studenti.unipd.it |
5d29404e2846102ef8345bf533765ccd1ac32208 | 3f7c7d559a5743ab38012a92ea35a2a5410f18ee | /services/Dynamohr126tabs/src/com/test_25feb/dynamohr126tabs/TypeTravellingExpense.java | 3383caa99342ad43a4f2ed7ab09808d9eae00423 | [] | no_license | Sushma-M/tes25feb | 427a8d2d875a894ffaa45170ff62fbcd37ecc74a | 2adc594a0a12673349463fd328e2beb89586b3a5 | refs/heads/master | 2021-01-10T15:09:35.906779 | 2016-02-25T08:40:21 | 2016-02-25T08:40:21 | 52,509,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,142 | java | /*Copyright (c) 2016-2017 gmail.com All Rights Reserved.
This software is the confidential and proprietary information of gmail.com You shall not disclose such Confidential Information and shall use it only in accordance
with the terms of the source code license agreement you entered into with gmail.com*/
package com.test_25feb.dynamohr126tabs;
/*This is a Studio Managed File. DO NOT EDIT THIS FILE. Your changes may be reverted by Studio.*/
import javax.persistence.PrimaryKeyJoinColumn;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Arrays;
import javax.persistence.Transient;
import javax.persistence.CascadeType;
import javax.persistence.UniqueConstraint;
/**
* TypeTravellingExpense generated by hbm2java
*/
@Entity
@Table(name="`type_travelling_expense`"
)
public class TypeTravellingExpense implements java.io.Serializable {
private Integer idTypeTravellingExpense;
private String nombre;
private String name;
private String observation;
private Integer modUser;
private Date modDate;
private Set<TravelExpense> travelExpenses = new HashSet<TravelExpense>(0);
public TypeTravellingExpense() {
}
@Id @GeneratedValue(strategy=IDENTITY)
@Column(name="`id_type_travelling_expense`", nullable=false, precision=10)
public Integer getIdTypeTravellingExpense() {
return this.idTypeTravellingExpense;
}
public void setIdTypeTravellingExpense(Integer idTypeTravellingExpense) {
this.idTypeTravellingExpense = idTypeTravellingExpense;
}
@Column(name="`nombre`", nullable=false, length=150)
public String getNombre() {
return this.nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
@Column(name="`name`", nullable=false, length=150)
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
@Column(name="`observation`", nullable=false)
public String getObservation() {
return this.observation;
}
public void setObservation(String observation) {
this.observation = observation;
}
@Column(name="`mod_user`", nullable=false, precision=10)
public Integer getModUser() {
return this.modUser;
}
public void setModUser(Integer modUser) {
this.modUser = modUser;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name="`mod_date`", nullable=false, length=19)
public Date getModDate() {
return this.modDate;
}
public void setModDate(Date modDate) {
this.modDate = modDate;
}
@OneToMany(fetch=FetchType.LAZY, cascade = {CascadeType.ALL}, mappedBy="typeTravellingExpense")
public Set<TravelExpense> getTravelExpenses() {
return this.travelExpenses;
}
public void setTravelExpenses(Set<TravelExpense> travelExpenses) {
this.travelExpenses = travelExpenses;
}
public boolean equals(Object o) {
if (this == o) return true;
if ( (o == null )) return false;
if ( !(o instanceof TypeTravellingExpense) )
return false;
TypeTravellingExpense that = (TypeTravellingExpense) o;
return ( (this.getIdTypeTravellingExpense()==that.getIdTypeTravellingExpense()) || ( this.getIdTypeTravellingExpense()!=null && that.getIdTypeTravellingExpense()!=null && this.getIdTypeTravellingExpense().equals(that.getIdTypeTravellingExpense()) ) );
}
public int hashCode() {
int result = 17;
result = 37 * result + ( getIdTypeTravellingExpense() == null ? 0 : this.getIdTypeTravellingExpense().hashCode() );
return result;
}
}
| [
"sushmapkrm@gmail.com"
] | sushmapkrm@gmail.com |
25b6191aab69198992f7e777ebeaf103e3f536ad | 223cec9cd14a378b5ef61f54d2c66baec84e01c7 | /app/src/main/java/ifpr/delabona/fabiana/tcc/TabuleiroActivity.java | d7f01071559cdcf9be95d441050c749ca19f09ac | [] | no_license | lucasruchel/AvancandoComOResto | c8f745f24c702d1a5061a0a2466af8af44d43daa | 97a7b46552a1897d56a7c1cf273a8fa9cb12e9c7 | refs/heads/master | 2021-02-26T12:25:04.238685 | 2020-03-06T22:09:01 | 2020-03-06T22:09:01 | 245,525,094 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,949 | java | package ifpr.delabona.fabiana.tcc;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.Random;
import java.util.zip.Inflater;
import ifpr.delabona.fabiana.tcc.tasks.ContadorTask;
import ifpr.delabona.fabiana.tcc.views.Casas;
import ifpr.delabona.fabiana.tcc.views.TabuleiroView;
public class TabuleiroActivity extends AppCompatActivity implements ContadorTask.CountTimerListener{
private Random mRandomObject;
private int mValorSorteado;
private boolean jogouDados; //Variável para controlar se os dados foram jogados
private ImageView mDado1;
private ImageView mDado2;
private Button mBtnVerifica;
private EditText mValorDigitado;
private TabuleiroView tabuleiro;
private TextView cronometro;
private int posicaoFinal; //Última posição, utilizada para verificar final do jogo
private ContadorTask contadorTask;
private MediaPlayer mediaPlayer;
private ObjectAnimator colorAnim;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tabuleiro);
tabuleiro = (TabuleiroView) findViewById(R.id.tabuleiro);
String[] values = getResources().getStringArray(R.array.numeros);
posicaoFinal = values.length-1;
tabuleiro.setValues(values);
Intent it = getIntent();
Bundle bundle = it.getExtras();
int imagePeao = bundle.getInt(MainActivity.PEAO_KEY);
tabuleiro.setPlayerIcon(imagePeao);
mRandomObject = new Random();
mDado1 = (ImageView) findViewById(R.id.dado1);
mDado2 = (ImageView) findViewById(R.id.dado2);
mBtnVerifica = (Button) findViewById(R.id.verificarValor);
mValorDigitado = (EditText) findViewById(R.id.valorDigitado);
cronometro = (TextView) findViewById(R.id.cronometro);
jogouDados = false;
mediaPlayer = MediaPlayer.create(this,R.raw.somfundo);
mediaPlayer.setLooping(true);
//Cria objeto que altera cor de texto
colorAnim = ObjectAnimator.ofInt(cronometro, "textColor",
Color.RED, Color.BLUE,Color.MAGENTA);
colorAnim.setEvaluator(new ArgbEvaluator());
colorAnim.setRepeatMode(ValueAnimator.RESTART);
colorAnim.setRepeatCount(6);
colorAnim.setDuration(10000);
}
@Override
protected void onStart() {
super.onStart();
mediaPlayer.start();
}
private void alterarDados(ImageView dado, int valor){
switch (valor){
case 1:
dado.setImageResource(R.drawable.d1);
break;
case 2:
dado.setImageResource(R.drawable.d2);
break;
case 3:
dado.setImageResource(R.drawable.d3);
break;
case 4:
dado.setImageResource(R.drawable.d4);
break;
case 5:
dado.setImageResource(R.drawable.d5);
break;
case 6:
dado.setImageResource(R.drawable.d6);
break;
}
}
//Quando clica no botão de ajuda
public void mostraDicas(View v){
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setPositiveButton("Entendi",null)
.setTitle("Dicas")
.setMessage("\n" +
"\n" +
"1ª DICA: Jogue os dados.\n" +
"\n" +
"2ª DICA: Some os números obtidos nos dados. \n" +
"\n" +
"3ª DICA: Divida o número da casa em que seu peão está pela soma obtida através dos dados.\n" +
"\n" +
"4ª DICA: Escreva o resto da divisão obtida no espaço adequado e clique no botão de verificar para testar se o resto da divisão está correta.\n" +
"\n" +
"5ª DICA: Se o resto da divisão estiver exata, seu peão andará a quantidade equivalente ao resto da divisão. \n" +
"\n" +
"6ª DICA: Caso esteja errado o resto da divisão, seu peão voltará três casas. \n" +
"\n" +
"7ª DICA: Você terá um tempo para responder e verificar o resto da divisão, caso estoure o tempo, seu peão voltará duas casas. \n" +
"\n" +
"8ª DICA: O objetivo é chegar exatamente na casa FIM, caso o resultado verificado utrapasse essa casa, o peão continuará avançando no início do tabuleiro");
builder.show();
}
//Método chamado quando o botão de verificar é clicado
public void verificar(View v){
//EditText do layout
String valorDigitado = mValorDigitado.getText().toString();
//Verifica se usuário digitou valor
if (valorDigitado.length() == 0){
Toast.makeText(this, "Digite um valor!!", Toast.LENGTH_SHORT).show();
return;
}
if (jogouDados){
jogouDados = false;
}else{
Toast.makeText(this, "Você deve jogar os dados!!", Toast.LENGTH_SHORT).show();
return;
}
//Para cronômetro e animação
contadorTask.cancel();
cronometro.setText("00");
colorAnim.pause();
contadorTask = null;
//Limpa valor de EditText
mValorDigitado.setText("");
//Pega posição atual do tabuleiro
int posicao = tabuleiro.getPosicao();
Casas casa = tabuleiro.getCasaAtual();
//Inicializa valor digita
int digitado;
//inicializa valor da casa
int value = 0;
try{
value = Integer.parseInt(casa.getmValue());
digitado = Integer.parseInt(valorDigitado);
}catch (NumberFormatException e){
digitado = 0;
}
//Acerta resto da divisão
if(value%mValorSorteado==digitado){
//Resto da divisão é 0 - volta uma casa
if (posicao+digitado>posicaoFinal){ //extrapola posição final
int movimento = (posicao+digitado) - posicaoFinal;
tabuleiro.setPosicao(movimento-1);
}else {
//Anda o número de casas referente ao resto da divisão
tabuleiro.setPosicao(posicao+digitado);
}
}else { //Erra resto da divisão
Toast.makeText(this, "Pense mais um pouco, tente na próxima!", Toast.LENGTH_SHORT).show();
if (posicao-3>0)
tabuleiro.setPosicao(posicao-3);
else
tabuleiro.setPosicao(0);
}
if (tabuleiro.getPosicao() == posicaoFinal){
AlertDialog.Builder builder = new AlertDialog.Builder(this);
LayoutInflater inflater = getLayoutInflater();
builder.setView(inflater.inflate(R.layout.felicitacoes,null,false));
builder.setNegativeButton("Sair", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
builder.setPositiveButton("Jogar Novamente", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
tabuleiro.setPosicao(0);
}
});
builder.setTitle("Você chegou ao fim do jogo!!");
builder.show();
}
}
public void sortearDados(View v){
if (!jogouDados){
jogouDados = true;
}else {
Toast.makeText(this, "Você ja jogou os dados!!", Toast.LENGTH_SHORT).show();
return;
}
if (contadorTask == null){
contadorTask = new ContadorTask();
contadorTask.setListener(this);
contadorTask.start();
colorAnim.start();
}
//Sorteia um número entre 1 e 6
int randomValue = mRandomObject.nextInt(6)+1;
alterarDados(mDado1,randomValue);
mValorSorteado = randomValue;
randomValue = mRandomObject.nextInt(6)+1;
mValorSorteado += randomValue;
alterarDados(mDado2,randomValue);
}
@Override
public void updateCounter(long remainingTime) {
cronometro.setText(String.valueOf(remainingTime));
if (remainingTime==0){
//Pega posição atual do tabuleiro
int posicao = tabuleiro.getPosicao();
Casas casa = tabuleiro.getCasaAtual();
if (posicao-3>0)
tabuleiro.setPosicao(posicao-2);
else
tabuleiro.setPosicao(0);
}
}
@Override
protected void onStop() {
super.onStop();
mediaPlayer.release();
mediaPlayer = null;
}
}
| [
"lukasruchel@gmail.com"
] | lukasruchel@gmail.com |
84cf4b230385d7d72a069c6701a730807144b046 | a59fc72cff77a257f50bf96fa280d4cc5cd5337a | /WebDriver/src/test/java/i_can_win/ICanWinTest.java | 9cd818cc038a54c4ba571c38c8668a2690d9c76c | [] | no_license | DimaKudelich/TAT | c40fcf083d15d8a73259782e8d0981cf598f81c9 | 9c518f2be17430d068f67b17d7d181999b6ea2be | refs/heads/main | 2023-02-11T20:24:14.692720 | 2021-01-04T09:14:02 | 2021-01-04T09:14:02 | 325,365,376 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,687 | java | package i_can_win;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class ICanWinTest {
private WebDriver driver;
@BeforeMethod
public void setUp(){
driver = new ChromeDriver();
}
@Test
public void testICanWin(){
driver.get("https://pastebin.com/");
WebElement textArea = driver.findElement(By.id("postform-text"));
textArea.sendKeys("Hello from WebDriver");
WebElement pasteExpiration = driver.findElement(By.xpath("//*[@id='w0']/div[5]/div[1]/div[2]/div/span/span[1]/span"));
pasteExpiration.click();
WebElement chooseExpiration = driver.findElement(By.xpath("//*[contains(@id,'select2-postform-expiration-result-') and contains(@id,'-10M')]"));
chooseExpiration.click();
WebElement name = driver.findElement(By.id("postform-name"));
name.sendKeys("helloweb");
WebElement createPaste = driver.findElement(By.xpath("//*[@id=\"w0\"]/div[5]/div[1]/div[8]/button"));
createPaste.click();
WebElement result = driver.findElement(By.linkText("body > div.wrap > div.container > div.content > div.post-view > div.highlighted-code > div.source > ol > li > div"));
String v = result.getText();
System.out.println(v);
Assert.assertEquals(v, "Hello from WebDriver");
}
@AfterMethod
public void setDown(){
driver.quit();
driver = null;
}
}
| [
"dima.kudelich2@mail.ru"
] | dima.kudelich2@mail.ru |
c0134751355fffa7a30b32a8e14b27578e3e8701 | 56e2a35ea822372022c843dff181c832cd267faa | /src/main/java/br/com/caelum/mapper/modelo/PedidoFlat.java | 8b1604761998854b19641e2997acc19109ef0510 | [] | no_license | luizhleme/modelmapper | 0f75975a8cced63ba3e23ca66c052c8585730849 | d825e00ff897fdbb0fd21d2a176ece0abefddb41 | refs/heads/master | 2021-01-16T23:12:51.416619 | 2014-04-03T21:46:08 | 2014-04-03T21:46:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 747 | java | package br.com.caelum.mapper.modelo;
public class PedidoFlat {
private String nomeCliente;
private String rua;
private int numero;
private String cidade;
private String cep;
public int getNumero() {
return numero;
}
public void setNumero(int numero) {
this.numero = numero;
}
public String getNomeCliente() {
return nomeCliente;
}
public void setNomeCliente(String nome) {
this.nomeCliente = nome;
}
public String getRua() {
return rua;
}
public void setRua(String rua) {
this.rua = rua;
}
public String getCidade() {
return cidade;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
public String getCep() {
return cep;
}
public void setCep(String cep) {
this.cep = cep;
}
}
| [
"nico.steppat@caelum.com.br"
] | nico.steppat@caelum.com.br |
06369b05a7b3888df74f1cd5453064c71340ec8f | 08be53201ebd0929479cad82c5a5f84e7031c92b | /backend/src/main/java/com/ssafy/common/util/ResponseBodyWriteUtil.java | e8d576798219bdb5495f5c18fa49619be764740c | [] | no_license | bongdaehyun/K-Speech | e95e4db80b50f9468deed11863f174f03e30e952 | a4725990ceb79ec6aedde0da6ab783f7e33afa21 | refs/heads/S05P31D104-22_MainPage | 2023-09-05T11:32:48.233465 | 2021-11-19T07:01:40 | 2021-11-19T07:01:40 | 429,679,901 | 0 | 0 | null | 2021-11-19T06:48:04 | 2021-11-19T05:26:56 | Java | UTF-8 | Java | false | false | 2,107 | java | package com.ssafy.common.util;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Calendar;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import com.ssafy.common.model.response.BaseResponseBody;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
/**
* 컨트롤러(controller)가 아닌곳에서, 서버 응답값(바디) 직접 변경 및 전달 하기위한 유틸 정의.
*/
public class ResponseBodyWriteUtil {
public static void sendApiResponse(HttpServletResponse response, BaseResponseBody apiResponse) throws IOException {
response.setStatus(HttpStatus.OK.value());
response.setContentType(APPLICATION_JSON_VALUE);
response.setCharacterEncoding("UTF-8");
response.getOutputStream().write(new ObjectMapper().writeValueAsString(apiResponse).getBytes());
}
public static void sendError(HttpServletRequest request, HttpServletResponse response, Exception ex, HttpStatus httpStatus) throws IOException {
response.setStatus(httpStatus.value());
response.setContentType(APPLICATION_JSON_VALUE);
response.setCharacterEncoding("UTF-8");
String message = ex.getMessage();
message = message == null ? "" : message;
Map<String, Object> data = ImmutableMap.of(
"timestamp", Calendar.getInstance().getTime(),
"status", httpStatus.value(),
"error", ex.getClass().getSimpleName(),
"message", message,
"path", request.getRequestURI()
);
PrintWriter pw = response.getWriter();
pw.print(new ObjectMapper().writeValueAsString(data));
pw.flush();
}
public static void sendError(HttpServletRequest request, HttpServletResponse response, Exception ex) throws IOException {
sendError(request, response, ex, HttpStatus.UNAUTHORIZED);
}
} | [
"alswn8972@daum.net"
] | alswn8972@daum.net |
bd7a62ee75c1effc9391630d9548afe6a290f182 | 53d6a07c1a7f7ce6f58135fefcbd0e0740b059a6 | /workspace/Launcher2/src/com/android/launcher2/AllAppsList.java | 3a5baeaa39dda5f4612bef161304bef809fb87ed | [
"Apache-2.0"
] | permissive | jx-admin/Code2 | 33dfa8d7a1acfa143d07309b6cf33a9ad7efef7f | c0ced8c812c0d44d82ebd50943af8b3381544ec7 | refs/heads/master | 2021-01-15T15:36:33.439310 | 2017-05-17T03:22:30 | 2017-05-17T03:22:30 | 43,429,217 | 8 | 4 | null | null | null | null | UTF-8 | Java | false | false | 8,066 | java | /*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.launcher2;
import android.content.ComponentName;
import android.content.Intent;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Stores the list of all applications for the all apps view.
*/
class AllAppsList {
public static final int DEFAULT_APPLICATIONS_NUMBER = 42;
/** The list off all apps. */
public ArrayList<ApplicationInfo> data =
new ArrayList<ApplicationInfo>(DEFAULT_APPLICATIONS_NUMBER);
/** The list of apps that have been added since the last notify() call. */
public ArrayList<ApplicationInfo> added =
new ArrayList<ApplicationInfo>(DEFAULT_APPLICATIONS_NUMBER);
/** The list of apps that have been removed since the last notify() call. */
public ArrayList<ApplicationInfo> removed = new ArrayList<ApplicationInfo>();
/** The list of apps that have been modified since the last notify() call. */
public ArrayList<ApplicationInfo> modified = new ArrayList<ApplicationInfo>();
private IconCache mIconCache;
/**
* Boring constructor.
*/
public AllAppsList(IconCache iconCache) {
mIconCache = iconCache;
}
/**
* Add the supplied ApplicationInfo objects to the list, and enqueue it into the
* list to broadcast when notify() is called.
*
* If the app is already in the list, doesn't add it.
*/
public void add(ApplicationInfo info) {
if (findActivity(data, info.componentName)) {
return;
}
data.add(info);
added.add(info);
}
public void clear() {
data.clear();
// TODO: do we clear these too?
added.clear();
removed.clear();
modified.clear();
}
public int size() {
return data.size();
}
public ApplicationInfo get(int index) {
return data.get(index);
}
/**
* Add the icons for the supplied apk called packageName.
*/
public void addPackage(Context context, String packageName) {
final List<ResolveInfo> matches = findActivitiesForPackage(context, packageName);
if (matches.size() > 0) {
for (ResolveInfo info : matches) {
add(new ApplicationInfo(info, mIconCache));
}
}
}
/**
* Remove the apps for the given apk identified by packageName.
*/
public void removePackage(String packageName) {
final List<ApplicationInfo> data = this.data;
for (int i = data.size() - 1; i >= 0; i--) {
ApplicationInfo info = data.get(i);
final ComponentName component = info.intent.getComponent();
if (packageName.equals(component.getPackageName())) {
removed.add(info);
data.remove(i);
}
}
// This is more aggressive than it needs to be.
mIconCache.flush();
}
/**
* Add and remove icons for this package which has been updated.
*/
public void updatePackage(Context context, String packageName) {
final List<ResolveInfo> matches = findActivitiesForPackage(context, packageName);
if (matches.size() > 0) {
// Find disabled/removed activities and remove them from data and add them
// to the removed list.
for (int i = data.size() - 1; i >= 0; i--) {
final ApplicationInfo applicationInfo = data.get(i);
final ComponentName component = applicationInfo.intent.getComponent();
if (packageName.equals(component.getPackageName())) {
if (!findActivity(matches, component)) {
removed.add(applicationInfo);
mIconCache.remove(component);
data.remove(i);
}
}
}
// Find enabled activities and add them to the adapter
// Also updates existing activities with new labels/icons
int count = matches.size();
for (int i = 0; i < count; i++) {
final ResolveInfo info = matches.get(i);
ApplicationInfo applicationInfo = findApplicationInfoLocked(
info.activityInfo.applicationInfo.packageName,
info.activityInfo.name);
if (applicationInfo == null) {
add(new ApplicationInfo(info, mIconCache));
} else {
mIconCache.remove(applicationInfo.componentName);
mIconCache.getTitleAndIcon(applicationInfo, info);
modified.add(applicationInfo);
}
}
} else {
// Remove all data for this package.
for (int i = data.size() - 1; i >= 0; i--) {
final ApplicationInfo applicationInfo = data.get(i);
final ComponentName component = applicationInfo.intent.getComponent();
if (packageName.equals(component.getPackageName())) {
removed.add(applicationInfo);
mIconCache.remove(component);
data.remove(i);
}
}
}
}
/**
* Query the package manager for MAIN/LAUNCHER activities in the supplied package.
*/
private static List<ResolveInfo> findActivitiesForPackage(Context context, String packageName) {
final PackageManager packageManager = context.getPackageManager();
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
mainIntent.setPackage(packageName);
final List<ResolveInfo> apps = packageManager.queryIntentActivities(mainIntent, 0);
return apps != null ? apps : new ArrayList<ResolveInfo>();
}
/**
* Returns whether <em>apps</em> contains <em>component</em>.
*/
private static boolean findActivity(List<ResolveInfo> apps, ComponentName component) {
final String className = component.getClassName();
for (ResolveInfo info : apps) {
final ActivityInfo activityInfo = info.activityInfo;
if (activityInfo.name.equals(className)) {
return true;
}
}
return false;
}
/**
* Returns whether <em>apps</em> contains <em>component</em>.
*/
private static boolean findActivity(ArrayList<ApplicationInfo> apps, ComponentName component) {
final int N = apps.size();
for (int i=0; i<N; i++) {
final ApplicationInfo info = apps.get(i);
if (info.componentName.equals(component)) {
return true;
}
}
return false;
}
/**
* Find an ApplicationInfo object for the given packageName and className.
*/
private ApplicationInfo findApplicationInfoLocked(String packageName, String className) {
for (ApplicationInfo info: data) {
final ComponentName component = info.intent.getComponent();
if (packageName.equals(component.getPackageName())
&& className.equals(component.getClassName())) {
return info;
}
}
return null;
}
}
| [
"jx.wang@holaverse.com"
] | jx.wang@holaverse.com |
db8580b609d034c2496a3ea3e071fe3af9c4f7a7 | 820cddf941c146e9342aa7eb7221aa6234d76bc5 | /vetapp/src/main/java/com/example/vetapp/dao/RoleRepository.java | 5e3df54bb68cb505811fa268370d055645a99db8 | [] | no_license | kj2386/vetapp | cd27665c069c4374ea40e156c678c77031b68988 | 1ea5811257dca352cfbd50ddf1c1f4935204fb2a | refs/heads/master | 2020-05-16T16:01:27.539474 | 2019-05-01T22:09:00 | 2019-05-01T22:09:00 | 183,149,297 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 323 | java | package com.example.vetapp.dao;
import com.example.vetapp.entity.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository("roleRepository")
public interface RoleRepository extends JpaRepository<Role, Integer> {
Role findByRole(String role);
}
| [
"kj2386@gmail.com"
] | kj2386@gmail.com |
5149442cd4a9b438b223b72cef341782e8b9b3d7 | 4a042d911f6ee8e733a0c9c442e37f65984b7a69 | /app/src/main/java/com/example/gugu/FindIdActivity.java | 328962eb57c454522a04201352721c2f91bb47cc | [] | no_license | poi0322/gugu | 6549e02e9d6d76710737525f243f6ecff599a6d2 | 660b9b5ca21569665e08a43002b3574aaa2fe507 | refs/heads/master | 2020-09-09T22:43:06.229452 | 2019-12-10T14:12:31 | 2019-12-10T14:12:31 | 221,588,218 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package com.example.gugu;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.Nullable;
public class FindIdActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_id_find);
}
//아이디 찾는코드
public void nextid(View view){
Intent intent = new Intent(getApplicationContext(),ViewIdActivity.class);
startActivity(intent);
}
}
| [
"abc1242@naver.com"
] | abc1242@naver.com |
7f45130a807534bdf9889ec3af2432c2d916238d | 597b0daa76ba28adf45359b5aa09cef5886f0e29 | /spring-web/src/main/java/org/springframework/http/client/reactive/AbstractClientHttpRequest.java | 524af3e1b0e81a90d1768dfdb92d6f68e1ef9c3c | [
"Apache-2.0"
] | permissive | wjmwss-zz/spring | 78e579e3ec4abc983aa80a4547fadc2b654ea959 | e94eb5efb79fc4bc5336d0b571609c141d35d5cb | refs/heads/master | 2023-02-21T09:26:25.768420 | 2021-01-23T19:04:30 | 2021-01-23T19:04:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,556 | java | /*
* Copyright 2002-2020 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.http.client.reactive;
import org.reactivestreams.Publisher;
import org.springframework.http.HttpCookie;
import org.springframework.http.HttpHeaders;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
import java.util.stream.Collectors;
/**
* Base class for {@link ClientHttpRequest} implementations.
*
* @author Rossen Stoyanchev
* @author Brian Clozel
* @since 5.0
*/
public abstract class AbstractClientHttpRequest implements ClientHttpRequest {
/**
* COMMITTING -> COMMITTED is the period after doCommit is called but before
* the response status and headers have been applied to the underlying
* response during which time pre-commit actions can still make changes to
* the response status and headers.
*/
private enum State {NEW, COMMITTING, COMMITTED}
private final HttpHeaders headers;
private final MultiValueMap<String, HttpCookie> cookies;
private final AtomicReference<State> state = new AtomicReference<>(State.NEW);
private final List<Supplier<? extends Publisher<Void>>> commitActions = new ArrayList<>(4);
@Nullable
private HttpHeaders readOnlyHeaders;
public AbstractClientHttpRequest() {
this(new HttpHeaders());
}
public AbstractClientHttpRequest(HttpHeaders headers) {
Assert.notNull(headers, "HttpHeaders must not be null");
this.headers = headers;
this.cookies = new LinkedMultiValueMap<>();
}
@Override
public HttpHeaders getHeaders() {
if (this.readOnlyHeaders != null) {
return this.readOnlyHeaders;
}
else if (State.COMMITTED.equals(this.state.get())) {
this.readOnlyHeaders = HttpHeaders.readOnlyHttpHeaders(this.headers);
return this.readOnlyHeaders;
}
else {
return this.headers;
}
}
@Override
public MultiValueMap<String, HttpCookie> getCookies() {
if (State.COMMITTED.equals(this.state.get())) {
return CollectionUtils.unmodifiableMultiValueMap(this.cookies);
}
return this.cookies;
}
@Override
public void beforeCommit(Supplier<? extends Mono<Void>> action) {
Assert.notNull(action, "Action must not be null");
this.commitActions.add(action);
}
@Override
public boolean isCommitted() {
return (this.state.get() != State.NEW);
}
/**
* A variant of {@link #doCommit(Supplier)} for a request without body.
* @return a completion publisher
*/
protected Mono<Void> doCommit() {
return doCommit(null);
}
/**
* Apply {@link #beforeCommit(Supplier) beforeCommit} actions, apply the
* request headers/cookies, and write the request body.
* @param writeAction the action to write the request body (may be {@code null})
* @return a completion publisher
*/
protected Mono<Void> doCommit(@Nullable Supplier<? extends Publisher<Void>> writeAction) {
if (!this.state.compareAndSet(State.NEW, State.COMMITTING)) {
return Mono.empty();
}
this.commitActions.add(() ->
Mono.fromRunnable(() -> {
applyHeaders();
applyCookies();
this.state.set(State.COMMITTED);
}));
if (writeAction != null) {
this.commitActions.add(writeAction);
}
List<? extends Publisher<Void>> actions = this.commitActions.stream()
.map(Supplier::get).collect(Collectors.toList());
return Flux.concat(actions).then();
}
/**
* Apply header changes from {@link #getHeaders()} to the underlying request.
* This method is called once only.
*/
protected abstract void applyHeaders();
/**
* Add cookies from {@link #getHeaders()} to the underlying request.
* This method is called once only.
*/
protected abstract void applyCookies();
}
| [
"wjmcoo@outlook.com"
] | wjmcoo@outlook.com |
db6b847cd02a8022e8eb0b844c793baf912b2920 | 212f6e11d1fd18f3f657b93409f8e8b6c28f683d | /app/src/main/java/com/joeanakbar/fp/ui/favorite/tvshow/TvShowFavView.java | 6e000c92361c3a057a0e51fc7f71180edd6dd9c0 | [] | no_license | joeanakbar/FP-PAM | 939b95b0741deccda4ebd95a73ca602d2e762556 | 87e7848feddf3a7a911aa7b395e86bf9a74d6908 | refs/heads/master | 2020-12-08T02:45:33.189517 | 2020-01-09T17:20:46 | 2020-01-09T17:20:46 | 232,862,418 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 378 | java | package com.joeanakbar.fp.ui.favorite.tvshow;
import android.content.Context;
import com.joeanakbar.fp.model.TvShowItem;
import java.util.List;
public interface TvShowFavView {
interface View {
void hideRefresh();
void showDataList(List<TvShowItem> tvShowItems);
}
interface Presenter {
void getDataListMovie(Context context);
}
}
| [
"joean.s@students.amikom.ac.id"
] | joean.s@students.amikom.ac.id |
5ffece514ba495451d88e2432853063d0e6c270f | 742fc331f0ba12612c82fdaea4019c633c4759ba | /src/main/java/com/laptrinhjavaweb/service/ICategoryService.java | 7bae0b0e1182b756781c5377ed08365d0788cd51 | [] | no_license | tqbao2608/free-jsp-servlet-jdbc | 2c4d7b06b9b7edbd0c1a73f6dee97acef6d5fa73 | 6d998b7af0f670a8a66c2960a8567f1fcf5ba41e | refs/heads/master | 2023-08-04T19:27:20.129209 | 2021-09-14T16:38:30 | 2021-09-14T16:38:30 | 404,698,670 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 260 | java | /*
* (C) Java Core
*
* @author DELL
* @date 5 the 9, 2021
* @version 1.0
*/
package com.laptrinhjavaweb.service;
import java.util.List;
import com.laptrinhjavaweb.model.CategoryModel;
public interface ICategoryService {
List<CategoryModel> findAll();
}
| [
"tqbaocteck18@gmail.com"
] | tqbaocteck18@gmail.com |
115075349e56ed9897ebc758e46f0a0c46ca48b6 | 65e2b5fb90ed75cb16ada045d9440467d91b5147 | /src/main/java/com/fastcampus/faststore/service/BookService.java | 6a03fd6041415bde2714cf1f4327f76e8f5321b9 | [] | no_license | dasom222g/java-final-project | a332c4c0567adccded3e3bf777d1468bd4fcf6be | fbb2e67e6cd0b204ec74d74af3171186541aa045 | refs/heads/master | 2023-08-30T22:51:33.853062 | 2021-10-11T11:06:02 | 2021-10-11T11:06:02 | 415,888,761 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,597 | java | package com.fastcampus.faststore.service;
import com.fastcampus.faststore.entity.Book;
import com.fastcampus.faststore.repository.BookRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
@Service
@RequiredArgsConstructor
public class BookService {
private final BookRepository bookRepository;
@Transactional(readOnly = true)
public Book getOrThrow(String title) {
return bookRepository.findByTitle(title)
.orElseThrow(() -> new RuntimeException("해당 제목의 책이 존재하지 않습니다."));
}
// 완료
// TODO: 동일한 책의 제목이 존재하면 RunTimeException을 발생시키고, 그렇지 않으면 책을 저장하도록 구현하세요. 제목으로 책을 조회해오는 쿼리는 이미 BookRepository에 등록되어있습니다.
@Transactional
public void registerBook(String title, String author, Long price) {
Optional<Book> findBook = bookRepository.findByTitle(title);
if(findBook.isPresent()) {
// 동일한 책 존재할 경우
throw new RuntimeException("해당 제목의 책이 이미 존재 합니다.");
} else {
// 동일한 책 존재하지 않을 경우
Book book = Book.builder()
.title(title)
.author(author)
.price(price)
.build();
Book newBook = bookRepository.save(book);
}
}
}
| [
"dasom228@gmail.com"
] | dasom228@gmail.com |
96597f361fb847e9278e051e8c560029a7d7abdf | 5b1b2a703880b7e36d5637530dd27586f3e1b3ce | /PCSOS/src/epusp/pcs/os/admin/client/presenter/VictimTablePresenter.java | a1c3be5c5c1b80c0c28965068b7e78e0d823a7cd | [] | no_license | augustoerico/pcsos | 2e15d5c0ea4915b428a1798e9d5f1bf951e184c7 | 3a067484fe51fc53647a968d5eb87bb4d52606cc | refs/heads/master | 2021-01-01T17:00:56.868916 | 2014-12-17T13:42:07 | 2014-12-17T13:42:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,950 | java | package epusp.pcs.os.admin.client.presenter;
import com.google.gwt.cell.client.Cell.Context;
import com.google.gwt.cell.client.ImageCell;
import com.google.gwt.cell.client.ImageResourceCell;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.cellview.client.SimplePager;
import com.google.gwt.user.cellview.client.TextColumn;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.view.client.ProvidesKey;
import com.google.gwt.view.client.SelectionChangeEvent;
import com.google.gwt.view.client.SelectionChangeEvent.Handler;
import com.google.gwt.view.client.SingleSelectionModel;
import epusp.pcs.os.admin.client.constants.AdminWorkspaceConstants;
import epusp.pcs.os.admin.client.rpc.IAdminWorkspaceServiceAsync;
import epusp.pcs.os.shared.client.SharedResources;
import epusp.pcs.os.shared.client.presenter.Presenter;
import epusp.pcs.os.shared.general.SelectedRowHandler;
import epusp.pcs.os.shared.model.person.victim.Victim;
import epusp.pcs.os.shared.provider.AsyncVictimProvider;
public class VictimTablePresenter implements Presenter{
private final IAdminWorkspaceServiceAsync rpcService;
private final AdminWorkspaceConstants constants;
private final int pageSize;
private final SharedResources resources;
private final CellTable<Victim> table = new CellTable<Victim>();
private final SimplePager pager = new SimplePager();
private final DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.PX);
private final SingleSelectionModel<Victim> selectionModel = new SingleSelectionModel<Victim>(new ProvidesKey<Victim>() {
@Override
public Object getKey(Victim item) {
return item == null ? null : item.getId();
}
});
private final SelectedRowHandler<Victim> handler;
public VictimTablePresenter(IAdminWorkspaceServiceAsync rpcService, AdminWorkspaceConstants constants, SharedResources resources,
int pageSize, SelectedRowHandler<Victim> handler){
this.rpcService = rpcService;
this.constants = constants;
this.pageSize = pageSize;
this.handler = handler;
this.resources = resources;
}
@Override
public void go(HasWidgets container) {
AsyncVictimProvider victimProvider = new AsyncVictimProvider(table, pager, rpcService, pageSize);
table.setPageSize(pageSize);
victimProvider.addDataDisplay(table);
pager.setDisplay(table);
TextColumn<Victim> victimNameColumn = new TextColumn<Victim>() {
@Override
public String getValue(Victim object) {
if(object.getSecondName() != null)
return object.getName() + " " + object.getSecondName();
else
return object.getName();
}
};
TextColumn<Victim> victimSurnameColumn = new TextColumn<Victim>() {
@Override
public String getValue(Victim object) {
return object.getSurname();
}
};
TextColumn<Victim> victimEmailColumn = new TextColumn<Victim>() {
@Override
public String getValue(Victim object) {
return object.getEmail();
}
};
Column<Victim, ImageResource> victimActiveColumn = new Column<Victim, ImageResource>(new ImageResourceCell()) {
@Override
public ImageResource getValue(Victim object) {
if(object.isActive())
return resources.active();
else
return resources.inactive();
}
};
Column<Victim, String> victimPictureColumn = new Column<Victim, String>(new ImageCell()) {
@Override
public String getValue(Victim object) {
return "";
}
@Override
public void render(Context context, Victim object,
SafeHtmlBuilder sb) {
super.render(context, object, sb);
sb.appendHtmlConstant("<img src = '"+object.getPictureURL()+"' height = '50px' />");
}
};
table.setSelectionModel(selectionModel);
victimPictureColumn.setCellStyleNames("picture");
table.addColumn(victimSurnameColumn, constants.surname());
table.addColumn(victimNameColumn, constants.name());
table.addColumn(victimEmailColumn, constants.email());
table.addColumn(victimPictureColumn, constants.picture());
table.addColumn(victimActiveColumn, constants.active());
dockLayoutPanel.setSize("100%", "100%");
dockLayoutPanel.addSouth(pager, 35);
dockLayoutPanel.add(table);
container.add(dockLayoutPanel);
bind();
}
private void bind(){
selectionModel.addSelectionChangeHandler(new Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
handler.onSelectedRow(selectionModel.getSelectedObject());
}
});
}
public SingleSelectionModel<Victim> getSelectionModel(){
return selectionModel;
}
} | [
"giovanni.gatti.pinheiro@gmail.com"
] | giovanni.gatti.pinheiro@gmail.com |
3a876b0669d7a0e7f00f2fb08b1ff720013326fc | 0b44382945e836a5e9975fdac856157eea311fb2 | /src/evaluaciones/sem2020/evaluacion3/Prueba.java | 4eb5d773c077de9d162bb903d3b906245efee692 | [] | no_license | hanconina/javaPOO | dc41b1f81af0a0b269c2d8921e2fdba3f5a16412 | 9c260f4c63eebdb28a93a08209ae1d7686badf6d | refs/heads/master | 2023-01-03T19:09:07.587944 | 2020-10-23T21:46:58 | 2020-10-23T21:46:58 | 183,959,734 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package evaluaciones.sem2020.evaluacion3;
public class Prueba {
public static void main(String[] args) {
Policia policia = new Policia("Juan",29,2);
Multa multa = new PicoPlaca(
"Lunes","Javier Prado","PE028",2234,"Miraflores",4,policia);
System.out.println("Multa: "+ multa.mostrar());
}
}
| [
"user@teminal"
] | user@teminal |
6cd963777b70a859e8e8b89de3978c3d6f11897b | 582e11495fd653f8f118610595ad8075d779d9f0 | /src/main/java/com/system/design/lld/movieticketbooking/repository/IRepository.java | 59836ae1789f41bffc8aa868d85ca8a49643aa27 | [] | no_license | Nayanava/LLDCaseStudies | e8c4bc51004633fb5bce7280f1a68da510c33961 | ec771612d1ebdb69c516279e1868bbbe9f27dbc2 | refs/heads/master | 2023-07-28T18:35:54.881104 | 2021-09-11T16:07:25 | 2021-09-11T16:07:25 | 405,138,405 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 321 | java | package com.system.design.lld.movieticketbooking.repository;
import java.io.*;
import java.util.List;
import java.util.function.Function;
public interface IRepository<TObj, TId> {
void save(TObj entity) throws InvalidObjectException;
TObj get(TId id);
boolean update(TObj entity);
void delete(TId id);
} | [
"nayanava.de01@gmail.com"
] | nayanava.de01@gmail.com |
d2c8b9fe6601fe10f6b9a958d7184b8df0bd1e1a | 29d5f9565f14a84fbd7f005221654b5a19db42d9 | /md-blog/src/main/java/com/cloud/mdblog/mapper/FriendLinkMapper.java | 17546b55bf55ae62a56236e45c9adb2367b5b161 | [] | no_license | AbrahamTemple/Vue-Blog | 1e2cf9ca69431f554c911e4f3bad651c5a411fb1 | f2d58c9215225de3bebf7e1480d0a7ea1116d1da | refs/heads/main | 2023-07-28T10:53:51.764272 | 2021-08-24T09:22:48 | 2021-08-24T09:22:48 | 396,387,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | package com.cloud.mdblog.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cloud.mdblog.entity.FriendLink;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Repository
public interface FriendLinkMapper extends BaseMapper<FriendLink> {
int create(FriendLink friendLink);
int delete(Map<String, Object> paraMap);
int update(Map<String, Object> paraMap);
List<FriendLink> query(Map<String, Object> paramMap);
FriendLink detail(Map<String, Object> paramMap);
int count(Map<String, Object> paramMap);
}
| [
"noreply@github.com"
] | noreply@github.com |
bcbdada268ff845af628c805751b5d23a2c921f5 | 64268f9655cb92e22a75db4e0d3225ba2f0bb90a | /TurtleRaceGame/src/ovn8/RacingEvent.java | d4e08bbec10b623ece51455e74c59bcf12e005a2 | [] | no_license | em0004ni-s/EDAA10---Programmering-i-Java | 32ab62774d013a6a622b5d0fabc2db923b53380c | 477850ea9bcfce9751ae764c45a5bf27a513896b | refs/heads/master | 2020-03-31T23:25:30.572407 | 2018-10-11T21:02:05 | 2018-10-11T21:02:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,377 | java | package ovn8;
import se.lth.cs.window.SimpleWindow;
import java.util.Random;
public class RacingEvent {
private int counter1, counter2, counter3, steps1, steps2, steps3;
RaceTrack track;
Turtle t1, t2, t3;
RacingEvent(RaceTrack track, Turtle t1, Turtle t2, Turtle t3) {
this.track = track;
this.t1 = t1;
this.t2 = t2;
this.t3 = t3;
counter1 = 0;
counter2 = 0;
counter3 = 0;
steps1 = 0;
steps2 = 0;
steps3 = 0;
}
void StartRace(SimpleWindow w) {
Random rand = new Random();
while (counter1 < 200 && counter2 < 200 && counter3 < 200) {
steps1 = rand.nextInt(2);
steps2 = rand.nextInt(2);
steps3 = rand.nextInt(2);
t1.penDown();
t2.penDown();
t3.penDown();
t1.forward(steps1);
t2.forward(steps2);
t3.forward(steps3);
counter1 = counter1 + steps1;
counter2 = counter2 + steps2;
counter3 = counter3 + steps3;
SimpleWindow.delay(5);
}
}
void resetRace(SimpleWindow w) {
t1.setX(t1.getXStart());
t1.setY(t1.getYStart());
t2.setX(t2.getXStart());
t2.setY(t2.getYStart());
t3.setX(t3.getXStart());
t3.setY(t3.getYStart());
counter1 = 0;
counter2 = 0;
counter3 = 0;
steps1 = 0;
steps2 = 0;
steps3 = 0;
}
int whoWon() {
if (counter1 >= 200) {
return 1;
} else if (counter2 >= 200) {
return 2;
} else if (counter3 >= 200) {
return 3;
} else {
return 0;
}
}
}
| [
"emilhoffnielsen@gmail.com"
] | emilhoffnielsen@gmail.com |
bc175fa85a0193bf393da07fc91ce933302c0f29 | d89c434f9b7938dda73cf672c3e477c425233acd | /AdmConjutosResidenciales/src/main/java/co/edu/uan/ctrlAdministrador/CtrlPanelMenuAdmin.java | 56ca12bdacda5b08b0eb44e29797307faa64c8a3 | [] | no_license | Joanne86/admConjuntosResidenciales | 5350f7e7be9f09086d41a18d7217d28cfafaa8d0 | 64c4b5cb13d282cdf2b339a09951e518a729842a | refs/heads/master | 2020-03-28T21:40:24.900399 | 2018-11-18T14:47:44 | 2018-11-18T14:47:44 | 149,173,492 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,901 | java | package co.edu.uan.ctrlAdministrador;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import com.jfoenix.controls.JFXButton;
import co.edu.uan.controlador.CtrlLogin;
import co.edu.uan.controlador.CtrlMenuPrincipal;
import co.edu.uan.dao.LoginDAO;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class CtrlPanelMenuAdmin implements Initializable {
@FXML
private JFXButton btnQuejasSugerencias;
@FXML
private JFXButton btnGestionarServicios;
@FXML
private JFXButton btnRegistroVisitante;
@FXML
private JFXButton btnRegistroResidente;
@FXML
private Label lbNombre;
@FXML
private Label lbRol;
@FXML
private JFXButton btnCerrarSesion;
@FXML
private JFXButton btnConsultarArrendatarios;
@FXML
private JFXButton btnGestionarApartamentos;
@FXML
private JFXButton btnPagoAdmin;
static AnchorPane pane2;
static AnchorPane pane3;
static AnchorPane pane4;
static AnchorPane pane5;
static AnchorPane pane6;
static AnchorPane pane7;
static AnchorPane pane8;
public static Stage primaryStage;
/**
* metodo para abrir la vista de registro de propietarios
* @param event
* @throws IOException
*/
@FXML
void registrarPropietario(ActionEvent event) throws IOException {
CtrlMenuPrincipal.drawer1.close();
if (pane2 == null) {
pane2 = FXMLLoader.load(getClass().getResource("/view/GestionPropietarios.fxml"));
pane2.setLayoutX(0);
pane2.setLayoutY(45);
CtrlMenuPrincipal.rootP.getChildren().add(pane2);
pane2.setPrefHeight(java.awt.Toolkit.getDefaultToolkit().getScreenSize().height - 45);
pane2.setPrefWidth(java.awt.Toolkit.getDefaultToolkit().getScreenSize().width);
} else {
pane2.toFront();
}
}
/**
* metodo para abrir la vista de registrar visitante
* @param event
* @throws IOException
*/
@FXML
void registrarVisitante(ActionEvent event) throws IOException {
CtrlMenuPrincipal.drawer1.close();
if (pane3 == null) {
pane3 = FXMLLoader.load(getClass().getResource("/view/RegistroVisitantes.fxml"));
pane3.setLayoutX(0);
pane3.setLayoutY(45);
CtrlMenuPrincipal.rootP.getChildren().add(pane3);
pane3.setPrefHeight(java.awt.Toolkit.getDefaultToolkit().getScreenSize().height - 45);
pane3.setPrefWidth(java.awt.Toolkit.getDefaultToolkit().getScreenSize().width);
} else {
pane3.toFront();
// actualizar tabla de bases de datos.
}
}
/**
* metodo para abrir la vista de pagos de administracion
*/
@FXML
void pagosAdmin(ActionEvent event) throws IOException {
CtrlMenuPrincipal.drawer1.close();
if (pane4 == null) {
pane4 = FXMLLoader.load(getClass().getResource("/view/PagosAdmin.fxml"));
pane4.setLayoutX(0);
pane4.setLayoutY(45);
CtrlMenuPrincipal.rootP.getChildren().add(pane4);
pane4.setPrefHeight(java.awt.Toolkit.getDefaultToolkit().getScreenSize().height - 45);
pane4.setPrefWidth(java.awt.Toolkit.getDefaultToolkit().getScreenSize().width);
} else {
pane4.toFront();
// actualizar tabla de bases de datos.
}
}
/**
* metodo para abrir la vista de gestion de apartamentos
* @param event
* @throws IOException
*/
@FXML
void gestionarApartamentos(ActionEvent event) throws IOException {
CtrlMenuPrincipal.drawer1.close();
if (pane5 == null) {
pane5 = FXMLLoader.load(getClass().getResource("/view/GestionApartamentos.fxml"));
pane5.setPrefHeight(java.awt.Toolkit.getDefaultToolkit().getScreenSize().height - 45);
pane5.setPrefWidth(java.awt.Toolkit.getDefaultToolkit().getScreenSize().width);
pane5.setLayoutX(0);
pane5.setLayoutY(45);
CtrlMenuPrincipal.rootP.getChildren().add(pane5);
} else {
pane5.toFront();
// actualizar tabla de bases de datos.
}
}
/**
* metodo para abrir la vista de consulta de arrendatarios
* @param event
* @throws IOException
*/
@FXML
void consultarArrendatarios(ActionEvent event) throws IOException {
CtrlMenuPrincipal.drawer1.close();
if (pane6 == null) {
pane6 = FXMLLoader.load(getClass().getResource("/view/ConsultaArrendatarios.fxml"));
pane6.setPrefHeight(java.awt.Toolkit.getDefaultToolkit().getScreenSize().height - 45);
pane6.setPrefWidth(java.awt.Toolkit.getDefaultToolkit().getScreenSize().width);
pane6.setLayoutX(0);
pane6.setLayoutY(45);
CtrlMenuPrincipal.rootP.getChildren().add(pane6);
} else {
pane6.toFront();
}
}
/**
* metodo para abrir la vista de recepcion de quejas y o sigerencias
* @param event
* @throws IOException
*/
@FXML
void quejasSugerencias(ActionEvent event) throws IOException {
CtrlMenuPrincipal.drawer1.close();
if (pane7 == null) {
pane7 = FXMLLoader.load(getClass().getResource("/view/QuejasSugerencias.fxml"));
pane7.setPrefHeight(java.awt.Toolkit.getDefaultToolkit().getScreenSize().height - 45);
pane7.setPrefWidth(java.awt.Toolkit.getDefaultToolkit().getScreenSize().width);
pane7.setLayoutX(0);
pane7.setLayoutY(45);
CtrlMenuPrincipal.rootP.getChildren().add(pane7);
} else {
pane7.toFront();
}
}
/**
* metodo para abrir la vista de gestion del personal de servicios
* @param event
* @throws IOException
*/
@FXML
void gestionarServicios(ActionEvent event) throws IOException {
CtrlMenuPrincipal.drawer1.close();
if (pane8 == null) {
pane8 = FXMLLoader.load(getClass().getResource("/view/GestionServicios.fxml"));
pane8.setPrefHeight(java.awt.Toolkit.getDefaultToolkit().getScreenSize().height - 45);
pane8.setPrefWidth(java.awt.Toolkit.getDefaultToolkit().getScreenSize().width);
pane8.setLayoutX(0);
pane8.setLayoutY(45);
CtrlMenuPrincipal.rootP.getChildren().add(pane8);
} else {
pane8.toFront();
}
}
/**
* metodo para cerrar la vista de administracion y volver a la vista principal
* @param event
* @throws IOException
*/
@FXML
void cerrarSesion(ActionEvent event) throws IOException {
primaryStage = new Stage();
Parent root;
root = FXMLLoader.load(getClass().getResource("/view/Principal.fxml"));
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.show();
primaryStage.setMaximized(true);
CtrlLogin.cerrarVentana();
}
public static void cerrarVentana() {
primaryStage.close();
}
@Override
public void initialize(URL arg0, ResourceBundle arg1) {
lbRol.setText(LoginDAO.getInstancePersona().getLogin().getTipoPersona());
lbNombre.setText(LoginDAO.getInstancePersona().getNombre());
}
}
| [
"LORETOladygaga1234"
] | LORETOladygaga1234 |
cddca594453394a4b94d6f9a93334fedb39a56b2 | f2efba843a18d142e35d35538895d4eeca695f72 | /app/src/main/java/xyz/iseeyou/sayhi/MyMessageReceiver.java | f881d7694dec9bf05ea5d60705944b136302b2a8 | [] | no_license | tomator/sayhi | c90dd8d98ab71cbc7ae170c7ba2bff3b12e2ca26 | cc16b28e976916d7cf441fb01c481396d9107805 | refs/heads/master | 2021-01-10T01:57:18.487945 | 2016-01-13T12:58:55 | 2016-01-13T12:58:55 | 49,573,935 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,068 | java | package xyz.iseeyou.sayhi;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import cn.bmob.im.BmobChatManager;
import cn.bmob.im.BmobNotifyManager;
import cn.bmob.im.BmobUserManager;
import cn.bmob.im.bean.BmobChatUser;
import cn.bmob.im.bean.BmobInvitation;
import cn.bmob.im.bean.BmobMsg;
import cn.bmob.im.config.BmobConfig;
import cn.bmob.im.config.BmobConstant;
import cn.bmob.im.db.BmobDB;
import cn.bmob.im.inteface.EventListener;
import cn.bmob.im.inteface.OnReceiveListener;
import cn.bmob.im.util.BmobJsonUtil;
import cn.bmob.im.util.BmobLog;
import cn.bmob.v3.listener.FindListener;
import xyz.iseeyou.sayhi.ui.MainActivity;
import xyz.iseeyou.sayhi.ui.NewFriendActivity;
import xyz.iseeyou.sayhi.util.CollectionUtils;
import xyz.iseeyou.sayhi.util.CommonUtils;
/**
* 推送消息接收器
* @ClassName: MyMessageReceiver
* @Description: TODO
* @author smile
* @date 2014-5-30 下午4:01:13
*/
public class MyMessageReceiver extends BroadcastReceiver {
// 事件监听
public static ArrayList<EventListener> ehList = new ArrayList<EventListener>();
public static final int NOTIFY_ID = 0x000;
public static int mNewNum = 0;//
BmobUserManager userManager;
BmobChatUser currentUser;
//如果你想发送自定义格式的消息,请使用sendJsonMessage方法来发送Json格式的字符串,然后你按照格式自己解析并处理
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
String json = intent.getStringExtra("msg");
BmobLog.i("收到的message = " + json);
userManager = BmobUserManager.getInstance(context);
currentUser = userManager.getCurrentUser();
boolean isNetConnected = CommonUtils.isNetworkAvailable(context);
if(isNetConnected){
parseMessage(context, json);
}else{
for (int i = 0; i < ehList.size(); i++)
((EventListener) ehList.get(i)).onNetChange(isNetConnected);
}
}
/** 解析Json字符串
* @Title: parseMessage
* @Description: TODO
* @param @param context
* @param @param json
* @return void
* @throws
*/
private void parseMessage(final Context context, String json) {
JSONObject jo;
try {
jo = new JSONObject(json);
String tag = BmobJsonUtil.getString(jo, BmobConstant.PUSH_KEY_TAG);
if(tag.equals(BmobConfig.TAG_OFFLINE)){//下线通知
if(currentUser!=null){
if (ehList.size() > 0) {// 有监听的时候,传递下去
for (EventListener handler : ehList)
handler.onOffline();
}else{
//清空数据
App.getInstance().logout();
}
}
}else{
String fromId = BmobJsonUtil.getString(jo, BmobConstant.PUSH_KEY_TARGETID);
//增加消息接收方的ObjectId--目的是解决多账户登陆同一设备时,无法接收到非当前登陆用户的消息。
final String toId = BmobJsonUtil.getString(jo, BmobConstant.PUSH_KEY_TOID);
String msgTime = BmobJsonUtil.getString(jo,BmobConstant.PUSH_READED_MSGTIME);
if(fromId!=null && !BmobDB.create(context,toId).isBlackUser(fromId)){//该消息发送方不为黑名单用户
if(TextUtils.isEmpty(tag)){//不携带tag标签--此可接收陌生人的消息
BmobChatManager.getInstance(context).createReceiveMsg(json, new OnReceiveListener() {
@Override
public void onSuccess(BmobMsg msg) {
// TODO Auto-generated method stub
if (ehList.size() > 0) {// 有监听的时候,传递下去
for (int i = 0; i < ehList.size(); i++) {
((EventListener) ehList.get(i)).onMessage(msg);
}
} else {
boolean isAllow = App.getInstance().getSpUtil().isAllowPushNotify();
if(isAllow && currentUser!=null && currentUser.getObjectId().equals(toId)){//当前登陆用户存在并且也等于接收方id
mNewNum++;
showMsgNotify(context,msg);
}
}
}
@Override
public void onFailure(int code, String arg1) {
// TODO Auto-generated method stub
BmobLog.i("获取接收的消息失败:"+arg1);
}
});
}else{//带tag标签
if(tag.equals(BmobConfig.TAG_ADD_CONTACT)){
//保存好友请求道本地,并更新后台的未读字段
BmobInvitation message = BmobChatManager.getInstance(context).saveReceiveInvite(json, toId);
if(currentUser!=null){//有登陆用户
if(toId.equals(currentUser.getObjectId())){
if (ehList.size() > 0) {// 有监听的时候,传递下去
for (EventListener handler : ehList)
handler.onAddUser(message);
}else{
showOtherNotify(context, message.getFromname(), toId, message.getFromname()+"请求添加好友", NewFriendActivity.class);
}
}
}
}else if(tag.equals(BmobConfig.TAG_ADD_AGREE)){
String username = BmobJsonUtil.getString(jo, BmobConstant.PUSH_KEY_TARGETUSERNAME);
//收到对方的同意请求之后,就得添加对方为好友--已默认添加同意方为好友,并保存到本地好友数据库
BmobUserManager.getInstance(context).addContactAfterAgree(username, new FindListener<BmobChatUser>() {
@Override
public void onError(int arg0, final String arg1) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(List<BmobChatUser> arg0) {
// TODO Auto-generated method stub
//保存到内存中
App.getInstance().setContactList(CollectionUtils.list2map(BmobDB.create(context).getContactList()));
}
});
//显示通知
showOtherNotify(context, username, toId, username+"同意添加您为好友", MainActivity.class);
//创建一个临时验证会话--用于在会话界面形成初始会话
BmobMsg.createAndSaveRecentAfterAgree(context, json);
}else if(tag.equals(BmobConfig.TAG_READED)){//已读回执
String conversionId = BmobJsonUtil.getString(jo,BmobConstant.PUSH_READED_CONVERSIONID);
if(currentUser!=null){
//更改某条消息的状态
BmobChatManager.getInstance(context).updateMsgStatus(conversionId, msgTime);
if(toId.equals(currentUser.getObjectId())){
if (ehList.size() > 0) {// 有监听的时候,传递下去--便于修改界面
for (EventListener handler : ehList)
handler.onReaded(conversionId, msgTime);
}
}
}
}
}
}else{//在黑名单期间所有的消息都应该置为已读,不然等取消黑名单之后又可以查询的到
BmobChatManager.getInstance(context).updateMsgReaded(true, fromId, msgTime);
BmobLog.i("该消息发送方为黑名单用户");
}
}
} catch (Exception e) {
e.printStackTrace();
//这里截取到的有可能是web后台推送给客户端的消息,也有可能是开发者自定义发送的消息,需要开发者自行解析和处理
BmobLog.i("parseMessage错误:"+e.getMessage());
}
}
/**
* 显示与聊天消息的通知
* @Title: showNotify
* @return void
* @throws
*/
public void showMsgNotify(Context context,BmobMsg msg) {
// 更新通知栏
int icon = R.drawable.ic_launcher;
String trueMsg = "";
if(msg.getMsgType()==BmobConfig.TYPE_TEXT && msg.getContent().contains("\\ue")){
trueMsg = "[表情]";
}else if(msg.getMsgType()==BmobConfig.TYPE_IMAGE){
trueMsg = "[图片]";
}else if(msg.getMsgType()==BmobConfig.TYPE_VOICE){
trueMsg = "[语音]";
}else if(msg.getMsgType()==BmobConfig.TYPE_LOCATION){
trueMsg = "[位置]";
}else{
trueMsg = msg.getContent();
}
CharSequence tickerText = msg.getBelongUsername() + ":" + trueMsg;
String contentTitle = msg.getBelongUsername()+ " (" + mNewNum + "条新消息)";
Intent intent = new Intent(context, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
boolean isAllowVoice = App.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = App.getInstance().getSpUtil().isAllowVibrate();
BmobNotifyManager.getInstance(context).showNotifyWithExtras(isAllowVoice,isAllowVibrate,icon, tickerText.toString(), contentTitle, tickerText.toString(),intent);
}
/** 显示其他Tag的通知
* showOtherNotify
*/
public void showOtherNotify(Context context,String username,String toId,String ticker,Class<?> cls){
boolean isAllow = App.getInstance().getSpUtil().isAllowPushNotify();
boolean isAllowVoice = App.getInstance().getSpUtil().isAllowVoice();
boolean isAllowVibrate = App.getInstance().getSpUtil().isAllowVibrate();
if(isAllow && currentUser!=null && currentUser.getObjectId().equals(toId)){
//同时提醒通知
BmobNotifyManager.getInstance(context).showNotify(isAllowVoice,isAllowVibrate,R.drawable.ic_launcher, ticker,username, ticker.toString(),NewFriendActivity.class);
}
}
}
| [
"jiang7637@163.com"
] | jiang7637@163.com |
6012a860e0a686854a394479a843b7f8dbfecb47 | b6d3c60583f0717049d6f52a4aea5f290560deb8 | /src/main/java/com/rengu/operationsmanagementsuitev3/Configuration/AsyncConfiguration.java | 50a15dd56d07f7d1d0248e6fbed79af4e7668975 | [] | no_license | zhangqiankunstack/TestControlTools | 009e693ef86247fc2e893f715787e20c4ca84b8c | 7103fa063376e5056576e92674d9d1e640629f55 | refs/heads/master | 2022-12-30T21:45:56.132657 | 2020-10-26T01:41:04 | 2020-10-26T01:41:04 | 307,231,523 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,227 | java | package com.rengu.operationsmanagementsuitev3.Configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @program: OperationsManagementSuiteV3
* @author: hanchangming
* @create: 2018-09-11 16:43
**/
@EnableAsync
@Configuration
public class AsyncConfiguration implements AsyncConfigurer {
/**
* The {@link Executor} instance to be used when processing async
* method invocations.
*/
@Override
public Executor getAsyncExecutor() {
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setCorePoolSize(50);
threadPoolTaskExecutor.setMaxPoolSize(100);
threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
threadPoolTaskExecutor.setThreadNamePrefix("OMS-Thread");
threadPoolTaskExecutor.initialize();
return threadPoolTaskExecutor;
}
}
| [
"zhangqk.n@aliyun.com"
] | zhangqk.n@aliyun.com |
a7941dd948c55e05b8672cc90ebfc826647480b4 | 4aa9e3ecb92919c70c31d296ea782b32635353ef | /project3-exercises/SampleServlet/src/servletPackage/StudentService.java | 08932240b1c3e8cdecb4f9a366f2457c109ac556 | [] | no_license | steven-indra/Java-Servlet-Exercise | 2db2cc3acdb2fa68459a08c535d55710485ace0d | 774cded8219e6358db03bce5955bbaae066f0a39 | refs/heads/master | 2021-01-19T22:23:56.992026 | 2017-04-21T08:03:07 | 2017-04-21T08:03:07 | 88,807,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,998 | java | package servletPackage;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.gson.Gson;
/**
* Servlet implementation class StudentService
*/
@WebServlet("/StudentService")
@MultipartConfig
public class StudentService extends HttpServlet {
private static final long serialVersionUID = 1L;
List<Student> list = new ArrayList<Student>();
public StudentService()
{
list.add(new Student(1,"aaaa"));
list.add(new Student(2,"bbbb"));
list.add(new Student(3,"ascd"));
list.add(new Student(4,"qweq"));
list.add(new Student(5,"qwer"));
list.add(new Student(6,"aacc"));
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String json = new Gson().toJson(new WriteJson(list, "hello from server"));
response.setContentType("application/json");
response.getWriter().write(json);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
//doGet(request, response);
String param = request.getParameter("name");
System.out.println(param);
List<Student> result = new ArrayList<Student>();
for(Student entry:list)
{
if (entry.getName().contains(param))
{
result.add(entry);
}
}
String json = new Gson().toJson(new WriteJson(result, "hello from server"));
response.setContentType("application/json");
response.getWriter().write(json);
}
}
| [
"trainee"
] | trainee |
fa3f4d77e6da545aab56f6e2bc03d5e54112a3a5 | 3dc73e437b6e69db99ab77b7163c4215e895103b | /src/main/java/com/demo/DemoApp.java | 795c0e73657609cbe683fa306212f33fdcf0792b | [
"MIT"
] | permissive | vkslax/java-microservices-arquillian | a556174026c226b97d60c7088b9d45b7a8f6e652 | e973cbf413c8df1d76457a2cbf1c80342a2f515d | refs/heads/master | 2020-09-06T06:46:04.538403 | 2019-11-08T21:49:28 | 2019-11-08T21:49:28 | 220,355,009 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 233 | java | package com.demo;
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
@ApplicationScoped
@ApplicationPath("/api")
public class DemoApp extends Application {
}
| [
"victor.lopez4@telusinternational.com"
] | victor.lopez4@telusinternational.com |
a2eb631cc8304d5e02eee79fc8a60dfe38004ff2 | 121fe1ac4b0ea0a27ae2f80775c74c838147ad3e | /src/main/java/com/wibowo/games/triviachat/statemachine/states/InitialState.java | 93e696080ea080247b4ee3bdc5a2e4797e381756 | [] | no_license | alexwibowo/TriviaChat | 989781b73ee77db427f107e5665bf90f1acf58e4 | 79c79129c654c3395508863d3439bbe2d2a775c0 | refs/heads/master | 2022-12-12T07:05:30.398039 | 2020-09-13T07:16:14 | 2020-09-13T07:16:14 | 289,008,867 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,592 | java | package com.wibowo.games.triviachat.statemachine.states;
import com.wibowo.games.triviachat.statemachine.ChatStateMachineContext;
import com.wibowo.machinia.Command;
import com.wibowo.games.triviachat.statemachine.commands.StartTrivia;
import com.wibowo.machinia.State;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public final class InitialState implements State<ChatStateMachineContext> {
public static final InitialState INSTANCE = new InitialState();
@Override
public List<Command> availableCommands(final ChatStateMachineContext context) {
return Collections.singletonList(StartTrivia.INSTANCE);
}
@Override
public Command parseCommand(final String commandString) {
if (commandString.equals("START")) {
return StartTrivia.INSTANCE;
}
return null;
}
@Override
public List<String> machineResponses(final ChatStateMachineContext context) {
return Arrays.asList(
String.format("Hi %s, welcome to Monash Medical Exam Prep", context.getUserProfile().firstName()),
"My name is Bob, I'm a robot",
"I can help you prepare for your exam by asking some questions",
"Please use the button below to continue to chat with me"
);
}
@Override
public State onCommand(final ChatStateMachineContext context,
final Command command) {
if (command == StartTrivia.INSTANCE) {
return YearNotDetermined.INSTANCE;
}
return this;
}
}
| [
"alexwibowo@gmail.com"
] | alexwibowo@gmail.com |
b7c863a608b92a61747dad468b76dd746c031445 | e6aff8eebe050852e9364709546db48f24845755 | /app/src/androidTest/java/com/android/example/activityrecognition/ExampleInstrumentedTest.java | 991562d08feeb3f537a8b5142f0e502691fe1316 | [] | no_license | VictorMotogna/ActivityRecognition | 1a684dd042da9c3e83745b4700ea74aae2f0d675 | a601aa37439fe5c08ffce9f9b592ef9041b066db | refs/heads/master | 2021-01-23T00:06:06.638732 | 2017-03-21T11:41:53 | 2017-03-21T11:41:53 | 85,694,749 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 782 | java | package com.android.example.activityrecognition;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.android.example.activityrecognition", appContext.getPackageName());
}
}
| [
"vmotogna@gmail.com"
] | vmotogna@gmail.com |
815dc804d45866060f54be0a979e8a3ace4a445b | 41514073c2938f96cc7cbc49845319a508de93a2 | /app/src/main/java/com/example/android/project6/Surface.java | d4b4063623e878c20c745e3b5236baaadfd54d5b | [] | no_license | kjones47/Project6Web | ec4bb80d8f89cb29f9ad3d9e4a8821bd6177482b | 8b2ca426cb88f2dce8c6acb938f9ca5267683ff9 | refs/heads/master | 2020-09-10T18:55:27.698696 | 2019-11-25T06:08:51 | 2019-11-25T06:08:51 | 221,805,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,928 | java | package com.example.android.project6;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.PixelFormat;
import android.view.SurfaceView;
import android.view.SurfaceHolder;
public class Surface extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder surfaceHolder = null;
private Paint paint = null;
private float circleX = 0;
private float circleY = 0;
public Surface(Context context) {
super(context);
surfaceHolder = getHolder();
paint = new Paint();
paint.setColor(Color.RED);
}
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
drawBall();
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
paint = null;
}
public void drawBall()
{
surfaceHolder = getHolder();
// Get and lock canvas object from surfaceHolder.
Canvas canvas = surfaceHolder.lockCanvas();
Paint surfaceBackground = new Paint();
// Set the surfaceview background color.
surfaceBackground.setColor(Color.BLACK);
// Draw the surfaceview background color.
canvas.drawRect(0, 0, this.getWidth(), this.getHeight(), surfaceBackground);
// Draw the circle.
paint.setColor(Color.RED);
canvas.drawCircle(circleX, circleY, 100, paint);
canvas.drawCircle(50, 50, 200, paint);
// Unlock the canvas object and post the new draw.
surfaceHolder.unlockCanvasAndPost(canvas);
}
}
| [
"kjones47@binghamton.edu"
] | kjones47@binghamton.edu |
1343d9a450c957d124d47b3fbd5d3da05c141c16 | 4c6211f48cca94158d61f2b3ed0a048b15e4a00c | /src/main/java/web/App.java | 19e0be10dcffd6cb5db246bee308d40ff6436c6f | [] | no_license | benjacarp/SpringBootPractice | 4071000d2371f8ca487cb4af2efda2b83e6ed66b | 543dac526ff510e7619cc04d8441557ad6879b5b | refs/heads/master | 2021-01-09T20:18:20.892243 | 2017-02-10T21:01:54 | 2017-02-10T21:01:54 | 81,250,833 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package web;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class App {
public static void main(String[] args) throws Exception {
initRepo();
SpringApplication.run(App.class, args);
}
private static void initRepo() {
}
}
| [
"benjamin.salas@globant.com"
] | benjamin.salas@globant.com |
2d828154e10cd37318856063a0b266a4840e0651 | 590cebae4483121569983808da1f91563254efed | /Router/eps2-src/engine/src/main/java/ru/acs/fts/eps2/engine/persistence/entities/CustomsRouting.java | d7f2be0f58f774d57871edc9dc6fa43b5f8e568d | [] | no_license | ke-kontur/eps | 8b00f9c7a5f92edeaac2f04146bf0676a3a78e27 | 7f0580cd82022d36d99fb846c4025e5950b0c103 | refs/heads/master | 2020-05-16T23:53:03.163443 | 2014-11-26T07:00:34 | 2014-11-26T07:01:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,469 | java | package ru.acs.fts.eps2.engine.persistence.entities;
public class CustomsRouting
{
private String _transportAddress;
private String _transportServer;
private String _localManager;
private String _localQueue;
private String _remoteManager;
private String _remoteQueue;
private Boolean _isLocal;
// @formatter:off
public void setTransportAddress( String transportAddress ) { _transportAddress = transportAddress; }
public String getTransportAddress( ) { return _transportAddress; }
public void setTransportServer( String transportServer ) { _transportServer = transportServer; }
public String getTransportServer( ) { return _transportServer; }
public void setLocalManager( String localManager ) { _localManager = localManager; }
public String getLocalManager( ) { return _localManager; }
public void setLocalQueue( String localQueue ) { _localQueue = localQueue; }
public String getLocalQueue( ) { return _localQueue; }
public void setRemoteManager( String remoteManager ) { _remoteManager = remoteManager; }
public String getRemoteManager( ) { return _remoteManager; }
public void setRemoteQueue( String remoteQueue ) { _remoteQueue = remoteQueue; }
public String getRemoteQueue( ) { return _remoteQueue; }
public void setIsLocal( Boolean isLocal ) { _isLocal = isLocal; }
public Boolean getIsLocal( ) { return _isLocal; }
// @formatter:on
}
| [
"m@brel.me"
] | m@brel.me |
5f6aed054e1f698edb9aeb2a517b8531ecf8c87e | c8d7c2e13733d9433aa2ac191df5792b5e780b01 | /src/main/java/org/wcong/test/spring/MyComponent.java | 39a13f7e4fc138933362910249e065bfa14a80ec | [] | no_license | wcong/learn-java | 2670628c68b416346402f82f924ab836871de9ae | 6cf0f373eeccdbb160d914ab79b6fe4e6ce6586b | refs/heads/master | 2022-12-23T23:54:49.609109 | 2020-11-27T03:19:56 | 2020-11-27T03:19:56 | 47,055,761 | 162 | 177 | null | 2023-06-21T11:44:58 | 2015-11-29T08:29:13 | Java | UTF-8 | Java | false | false | 331 | java | package org.wcong.test.spring;
import org.springframework.stereotype.Component;
import java.lang.annotation.*;
/**
* @author wcong<wc19920415@gmail.com>
* @since 16/1/21
*/
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface MyComponent {
String value() default "";
}
| [
"wc19920415@gmail.com"
] | wc19920415@gmail.com |
5d49d639ecc6e11b1c9dce62809d658afcc333c1 | 6f16f903e92206f26c005bb5fd8e14a46c18daee | /src/main/java/movies/spring/data/neo4j/repositories/RealOrganizationRepository.java | b0d4804f86e41bb10f099c9272abe5898b4970e4 | [] | no_license | 4thWave/movies-java-spring-data-neo4j | 0f8151deb6049f3f55e38e39d054bd19b960a951 | d7db0a97292321327378c49c992985a9910422bf | refs/heads/master | 2021-09-13T23:42:56.166124 | 2018-05-06T01:55:39 | 2018-05-06T01:55:39 | 114,908,755 | 0 | 0 | null | 2017-12-20T16:33:15 | 2017-12-20T16:33:14 | null | UTF-8 | Java | false | false | 1,426 | java | package movies.spring.data.neo4j.repositories;
import java.util.Collection;
import movies.spring.data.neo4j.domain.RealOrganization;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
/**
* @author Michael Hunger
* @author Mark Angrish
*/
@RepositoryRestResource(collectionResourceRel = "realorganizations", path = "realorganizations")
public interface RealOrganizationRepository extends PagingAndSortingRepository<RealOrganization, Long> {
RealOrganization findByPrimaryName(@Param("primaryname") String primaryName);
// Collection<RealOrganization> findByTitleLike(@Param("title") String title);
// @Query("MATCH (n:Organization)-[s:SURGING_ON]->(t:Topic) WHERE t.name = \"Graph Databases\" and s.weight>80 RETURN n,s,t LIMIT {limit}")
// @Query("MATCH (n:IndustrySize)-[:ORG_SIZED_AS]->(o:Organization)-[s:SURGING_ON]->(t:Topic)-[:HAS_A]->(c:Category) WHERE s.weight>80 and s.confidence='A' and n.name = 'Small (10 - 49 Employees)' AND s.weight>82 RETURN n,o,s,t,c LIMIT {limit}")
// Collection<Organization> graph(@Param("limit") int limit);
@Query("MATCH (o:RealOrganization) RETURN o LIMIT {limit}")
Collection<RealOrganization> graph(@Param("limit") int limit);
}
| [
"tedgamester@Teds-iMac.lan"
] | tedgamester@Teds-iMac.lan |
2abcf3d459a2118ef124136b9a32b01bad1f0e24 | 10d212c445ef0fc0c9555f805286db1d9dd35de5 | /src/oa/pojo/EmailFile.java | b91fae10b49b805277432cd0ee077835a229dbc8 | [] | no_license | renchengwei/oa | 6f229b5a97bb7eea1eb6a450df72f1662e32357c | c59b35bba1ddd35d5fc7e2bbfb601066b82e286a | refs/heads/master | 2021-01-10T21:51:43.677899 | 2015-06-16T15:24:33 | 2015-06-16T15:24:33 | 36,078,798 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,302 | java | package oa.pojo;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.context.annotation.Scope;
@Entity
@Table(name = "tb_emailfile")
@Scope(value = "prototype")
public class EmailFile {
@Id
@GeneratedValue(generator="hibernate-uuid")
@GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
private String id;
/**
* 邮件ID
*/
private String emailid;
/**
* 附件地址
*/
private String filepath;
/**
* 附件名称
*/
private String filename;
/**
* 附件大小
*/
private Double filesize;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getEmailid() {
return emailid;
}
public void setEmailid(String emailid) {
this.emailid = emailid;
}
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public Double getFilesize() {
return filesize;
}
public void setFilesize(Double filesize) {
this.filesize = filesize;
}
public String getFilepath() {
return filepath;
}
public void setFilepath(String filepath) {
this.filepath = filepath;
}
}
| [
"627127819@qq.com"
] | 627127819@qq.com |
509c39da01cd659ec0f0948b4f15890786f33cd0 | 0102de442709fe709e7a2b15207708ecbacd5f3b | /plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/data/types/SubsystemType.java | 64f55230d108c44ba5b91cde8b96bb347b0d02ef | [] | no_license | blucoat/shuffleboard | 0b5679293e6f247555717b1a1be284c755657128 | 838e511ff730e74788cbad4628f0ef6cbf9a3852 | refs/heads/master | 2021-05-11T21:30:17.471757 | 2018-01-14T21:50:57 | 2018-01-14T21:50:57 | 117,469,549 | 0 | 0 | null | 2018-01-14T21:50:05 | 2018-01-14T21:50:04 | null | UTF-8 | Java | false | false | 568 | java | package edu.wpi.first.shuffleboard.plugin.base.data.types;
import edu.wpi.first.shuffleboard.api.data.ComplexDataType;
import java.util.Map;
import java.util.function.Function;
/**
* Type of a simple subsystem. Subsystems don't contain any data in and of themselves.
*/
public class SubsystemType extends ComplexDataType {
public SubsystemType() {
super("LW Subsystem", Object.class);
}
@Override
public Function<Map<String, Object>, ?> fromMap() {
return __ -> null;
}
@Override
public Object getDefaultValue() {
return null;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.